/* Nivora bid monitor.
   One stylesheet, no framework, no external requests, no web fonts.
   Warm paper rather than dashboard grey, because this gets read at six in the morning.

   Deliberately absent: #6366F1 and every neighbor of it. That indigo is the default
   accent of generated apps and the project's own notes name it as a tell. */

:root {
  color-scheme: light dark;

  --ink:        #221d19;
  --ink-soft:   #5b5248;
  --ink-faint:  #8a8073;
  --paper:      #fbf8f3;
  --card:       #ffffff;
  --rule:       #e4ddd2;
  --rule-soft:  #efe9e0;

  --accent:     #8c3f23;   /* burnt sienna. Nothing near indigo. */
  --accent-ink: #ffffff;
  --accent-wash:#f6ece6;

  --go:         #2f6b43;
  --go-wash:    #e4f0e7;
  --hold:       #8a6117;
  --hold-wash:  #fbefd8;
  --stop:       #8d3030;
  --stop-wash:  #f7e6e4;

  --input:      #fffaea;
  --shadow:     0 1px 2px rgba(34,29,25,.05), 0 6px 18px -8px rgba(34,29,25,.10);
  --radius:     10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:        #f0eae2;
    --ink-soft:   #b9afa2;
    --ink-faint:  #8b8175;
    --paper:      #16130f;
    --card:       #201c17;
    --rule:       #332c24;
    --rule-soft:  #2a241d;
    --accent:     #d98662;
    --accent-ink: #1a1510;
    --accent-wash:#2e211a;
    --go:         #7fc295;
    --go-wash:    #1d2f23;
    --hold:       #e0b057;
    --hold-wash:  #322717;
    --stop:       #e08b84;
    --stop-wash:  #32201e;
    --input:      #241f17;
    --shadow:     0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  letter-spacing: -0.005em;
}

/* Faint paper tooth. Pure CSS, no image request. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(circle at 17% 23%, rgba(140,63,35,.030) 0 1px, transparent 1px),
    radial-gradient(circle at 71% 61%, rgba(34,29,25,.025) 0 1px, transparent 1px);
  background-size: 23px 23px, 31px 29px;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 72px; }

header.top {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 10;
}
header.top .wrap { display: flex; align-items: center; gap: 20px; padding-block: 12px 11px; flex-wrap: wrap; }

.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
         color: var(--ink); text-decoration: none; margin-right: 4px; white-space: nowrap; }
.brand .sub { color: var(--ink-faint); font-weight: 400; font-size: 13px; font-family: var(--sans); }

nav.main { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
nav.main a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 6px 11px; border-radius: 7px;
}
nav.main a:hover { background: var(--rule-soft); color: var(--ink); }
nav.main a[aria-current="page"] { background: var(--accent-wash); color: var(--accent); }

h1 { font-family: var(--serif); font-size: clamp(26px, 4vw, 34px); line-height: 1.15;
     letter-spacing: -0.025em; font-weight: 600; margin: 32px 0 6px; }
h2 { font-family: var(--serif); font-size: 21px; letter-spacing: -0.02em; font-weight: 600;
     margin: 36px 0 12px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint);
     font-weight: 600; margin: 0 0 10px; }
.lede { color: var(--ink-soft); margin: 0 0 24px; max-width: 62ch; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) {
  .grid.two { grid-template-columns: 1.4fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .grid.four { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- numbers row ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px;
         background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius);
         overflow: hidden; margin-bottom: 20px; }
.stat { background: var(--card); padding: 14px 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 28px; font-weight: 600;
          letter-spacing: -0.03em; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- the task list ---------- */
ol.today { list-style: none; counter-reset: t; margin: 0; padding: 0; }
ol.today li { counter-increment: t; display: flex; gap: 14px; padding: 13px 0;
              border-bottom: 1px solid var(--rule-soft); }
ol.today li:last-child { border-bottom: 0; }
ol.today li::before {
  content: counter(t); flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: var(--accent-wash); color: var(--accent); font-weight: 600; font-size: 13px;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
ol.today .what { font-weight: 550; }
ol.today .why { color: var(--ink-soft); font-size: 14.5px; }

/* ---------- opportunity rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--rule-soft); }
.rows > li:last-child { border-bottom: 0; }
.row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 20px;
       text-decoration: none; color: inherit; }
.row:hover { background: var(--rule-soft); }
.row .score {
  flex: 0 0 44px; text-align: center; font-family: var(--serif); font-size: 21px;
  font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.row .score small { display: block; font-size: 10px; letter-spacing: .07em;
                    text-transform: uppercase; font-family: var(--sans); font-weight: 600; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 550; margin-bottom: 2px; }
.row .meta { color: var(--ink-faint); font-size: 13.5px; display: flex; gap: 10px;
             flex-wrap: wrap; }
.row .meta b { font-weight: 600; color: var(--ink-soft); }
.row .reason { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }

.v-bid   { color: var(--go); }
.v-maybe { color: var(--hold); }
.v-skip  { color: var(--ink-faint); }

/* ---------- pills ---------- */
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
        padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pill.go   { background: var(--go-wash); color: var(--go); }
.pill.hold { background: var(--hold-wash); color: var(--hold); }
.pill.stop { background: var(--stop-wash); color: var(--stop); }
.pill.flat { background: var(--rule-soft); color: var(--ink-soft); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
     color: var(--ink-faint); font-weight: 600; padding: 9px 12px;
     border-bottom: 1px solid var(--rule); }
td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- score breakdown ---------- */
.breakdown { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.breakdown li { display: grid; grid-template-columns: 120px 46px 1fr; gap: 10px;
                padding: 8px 0; border-bottom: 1px solid var(--rule-soft); align-items: baseline; }
.breakdown li:last-child { border-bottom: 0; }
.breakdown .pts { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.breakdown .pos { color: var(--go); }
.breakdown .neg { color: var(--stop); }
.breakdown .zero { color: var(--ink-faint); }
.breakdown .detail { color: var(--ink-soft); }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft);
        margin-bottom: 5px; }
input[type=text], input[type=email], input[type=number], input[type=search],
select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--input);
  border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px;
}
textarea { min-height: 160px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.field { margin-bottom: 14px; }
.help { font-size: 13px; color: var(--ink-faint); margin-top: 4px; font-weight: 400; }

/* After a fact a model read out of the notice. The help text under the score says what
   it means, so the dot itself stays small. */
.model-dot { color: var(--hold); font-size: 9px; margin-left: 5px; vertical-align: 2px; cursor: help; }

button, .btn {
  font: inherit; font-weight: 550; font-size: 14.5px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent;
  border-radius: 8px; padding: 9px 16px; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button.quiet, .btn.quiet { background: transparent; color: var(--ink-soft);
                           border-color: var(--rule); }
button.quiet:hover, .btn.quiet:hover { background: var(--rule-soft); color: var(--ink); }
button.danger { background: var(--stop-wash); color: var(--stop); border-color: transparent; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
form.inline { display: inline; }

/* ---------- notices ---------- */
.note { border-left: 3px solid var(--accent); background: var(--accent-wash);
        padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 14.5px;
        margin-bottom: 16px; color: var(--ink); }
.note.warn { border-color: var(--hold); background: var(--hold-wash); }
.note.bad  { border-color: var(--stop); background: var(--stop-wash); }
.note.good { border-color: var(--go); background: var(--go-wash); }
.note b { font-weight: 650; }

.empty { color: var(--ink-faint); font-style: italic; padding: 18px 0; }

/* ---------- brief ---------- */
.brief { font-family: var(--serif); font-size: 17px; line-height: 1.6; white-space: pre-wrap; }

/* ---------- cost bars ---------- */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 92px 1fr 72px; gap: 10px; align-items: center;
           padding: 4px 0; font-size: 13.5px; }
.bars .bar { height: 9px; border-radius: 99px; background: var(--rule-soft); overflow: hidden; }
.bars .bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* ---------- misc ---------- */
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--ink-faint); }
.right { text-align: right; }
.flexbar { display: flex; gap: 10px; align-items: center; justify-content: space-between;
           flex-wrap: wrap; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }
details > summary { cursor: pointer; font-weight: 550; padding: 6px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

footer.foot { border-top: 1px solid var(--rule); margin-top: 48px; padding: 20px 0 40px;
              color: var(--ink-faint); font-size: 13px; }

@media (max-width: 640px) {
  .row { padding: 13px 14px; }
  .breakdown li { grid-template-columns: 1fr 44px; }
  .breakdown .detail { grid-column: 1 / -1; }
  .bars li { grid-template-columns: 76px 1fr 60px; }
}

@media print {
  header.top, nav.main, .actions, footer.foot { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
