/* DIBBS Watch design system: landing page + app.
   Palette: graphite ink on a soft canvas, one brand color (teal), amber reserved for fast-award urgency,
   green/red only for won/lost. Type: Manrope (display), Inter (text), JetBrains Mono (identifiers). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Manrope:wght@600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --canvas: #f4f5f7; --surface: #ffffff; --surface-2: #f8f9fb; --ink: #111827; --ink-2: #374151; --mute: #6b7280;
  --line: #e5e7eb; --line-2: #d1d5db;
  --brand: #0f766e; --brand-ink: #0b5e58; --brand-soft: #e6f4f2; --brand-text: #0f766e;
  --amber: #b45309; --amber-soft: #fef3c7; --green: #15803d; --green-soft: #dcfce7; --red: #b91c1c; --red-soft: #fee2e2;
  --violet: #6d28d9; --violet-soft: #ede9fe; --blue: #1d4ed8; --blue-soft: #dbeafe;
  --dark: #0b1220; --on-dark: #e5e9f0; --on-dark-mute: #9aa6b8;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(17,24,39,.05), 0 6px 20px rgba(17,24,39,.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Manrope", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0b1220; --surface: #111a2e; --surface-2: #16203a; --ink: #e5e9f0; --ink-2: #c7cfdb; --mute: #94a0b4;
    --line: #243049; --line-2: #2f3d5a; --brand: #2dd4bf; --brand-ink: #5eead4; --brand-soft: #0f2f2c; --brand-text: #5eead4;
    --amber: #fbbf24; --amber-soft: #3a2a08; --green: #4ade80; --green-soft: #0f2e1a; --red: #f87171; --red-soft: #3b1212;
    --violet: #a78bfa; --violet-soft: #241a3f; --blue: #60a5fa; --blue-soft: #122344; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --canvas: #0b1220; --surface: #111a2e; --surface-2: #16203a; --ink: #e5e9f0; --ink-2: #c7cfdb; --mute: #94a0b4;
  --line: #243049; --line-2: #2f3d5a; --brand: #2dd4bf; --brand-ink: #5eead4; --brand-soft: #0f2f2c; --brand-text: #5eead4;
  --amber: #fbbf24; --amber-soft: #3a2a08; --green: #4ade80; --green-soft: #0f2e1a; --red: #f87171; --red-soft: #3b1212;
  --violet: #a78bfa; --violet-soft: #241a3f; --blue: #60a5fa; --blue-soft: #122344; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; color: var(--ink); background: var(--canvas); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
.mono, .id { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.spacer { flex: 1; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand { font-family: var(--display); font-weight: 800; color: var(--ink); font-size: 17px; display: inline-flex; align-items: center; gap: 10px; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: var(--brand); display: inline-grid; place-items: center; }
.brand .dot::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: #fff; transform: rotate(45deg); }
.topbar nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.topbar nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.topbar nav a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.topbar nav a .pill { margin-left: 4px; }
.topbar select { padding: 6px 10px; font-size: 13px; }

/* controls */
button, .btn, input, select, textarea { font: inherit; font-size: 14px; }
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover, button:hover { background: var(--surface-2); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
.btn.primary, button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover, button.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.red { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.big { padding: 13px 20px; font-size: 15px; border-radius: 10px; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea { width: 100%; min-height: 140px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
label.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mute); letter-spacing: .02em; }
label.field input, label.field select { font-weight: 400; color: var(--ink); font-size: 14px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.fast { border-left: 4px solid var(--amber); }
.card h3 { margin-bottom: 12px; }
a.card { color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--line-2); }
.tile { padding: 18px 20px; }
.tile .k { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.tile .v { font-family: var(--display); font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1.05; margin-top: 6px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile .v.red { color: var(--amber); }
.tile .s { font-size: 13px; color: var(--mute); margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--mute); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td b { font-weight: 600; }
td .small.mute, .facts .id { font-family: var(--mono); font-size: 12px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.pill.red { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.pill.green { background: var(--green-soft); border-color: transparent; color: var(--green); }
.pill.amber { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.flag { color: var(--amber); }
.empty { padding: 28px; text-align: center; color: var(--mute); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); font-size: 14px; }
.msg { min-height: 20px; }
.msg.err { color: var(--red); }

/* landing */
.hero { background: var(--dark); color: var(--on-dark); padding: 84px 0 72px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; top: -30%; right: -10%; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; background: radial-gradient(closest-side, rgba(45,212,191,.22), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; }
.hero h1 { color: #fff; max-width: 980px; }
.hero .lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--on-dark-mute); max-width: 720px; margin-bottom: 30px; line-height: 1.65; }
.hero .eyebrow { color: #2dd4bf; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; margin-bottom: 18px; }
.hero .btn { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; }
.hero .btn:hover { background: rgba(255,255,255,.12); }
.hero .btn.red { background: #2dd4bf; border-color: #2dd4bf; color: #06201d; }
.hero .btn.red:hover { background: #5eead4; }
section.band { padding: 64px 0; }
section.band.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.step .n { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; font-weight: 800; font-family: var(--display); }
.feature .ico { font-size: 20px; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 12px; }
.feature h3 { margin-top: 0; }
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.report .hd { background: var(--dark); color: #fff; padding: 12px 16px; font-weight: 600; display: flex; justify-content: space-between; font-family: var(--display); }
.report .hd span { font-weight: 400; opacity: .7; font-family: var(--font); font-size: 13px; }
.report table { font-size: 13px; }
.report td, .report th { padding: 9px 12px; }
.facts li { margin-bottom: 8px; }
footer { padding: 36px 0 56px; color: var(--mute); font-size: 13.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

/* app */
.app-main { padding: 26px 0 72px; }
.view > h2 { margin: 6px 0 16px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 8px 0 20px; }
.login-wrap { max-width: 440px; margin: 64px auto; padding: 28px; }
.login-wrap h2 { margin-bottom: 6px; }
.brand-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.brand-row:last-child { border-bottom: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filters .field { min-width: 120px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; background: var(--surface); color: var(--ink-2); }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.status { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.status.new { background: var(--blue-soft); color: var(--blue); } .status.reviewing { background: var(--amber-soft); color: var(--amber); }
.status.quoted { background: var(--violet-soft); color: var(--violet); } .status.passed { background: var(--surface-2); color: var(--mute); border: 1px solid var(--line); }
.status.expired { background: var(--surface-2); color: var(--mute); } .status.won { background: var(--green-soft); color: var(--green); } .status.lost { background: var(--red-soft); color: var(--red); }
tr.clickable { cursor: pointer; }
tr.selected td { background: var(--brand-soft) !important; }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); margin-bottom: 10px; }
.bulk button, .bulk select, .bulk input { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.bulk button:hover { background: rgba(255,255,255,.16); }
.drawer-back { position: fixed; inset: 0; background: rgba(11,18,32,.45); z-index: 40; backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(900px, 100vw); background: var(--canvas); z-index: 41; overflow-y: auto; box-shadow: -12px 0 40px rgba(0,0,0,.22); padding: 22px 24px 70px; }
.drawer .close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.drawer h2 { margin-right: 60px; }
.drawer .card { margin-top: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 16px; margin: 14px 0 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts .k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); font-weight: 600; }
.facts .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: 180px; display: block; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; border-radius: 8px 8px 0 0; background: transparent; padding: 10px 14px; font-weight: 600; color: var(--mute); }
.tabs button:hover { background: var(--surface-2); color: var(--ink); }
.tabs button.on { color: var(--brand-text); box-shadow: inset 0 -2px 0 var(--brand); background: transparent; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.act { border-left: 2px solid var(--line-2); padding: 4px 12px; margin: 8px 0; font-size: 13px; }
.act .when { color: var(--mute); font-size: 12px; }
.ok { color: var(--green); } .warn { color: var(--amber); }
.list-ed { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 720px) {
  .topbar nav { gap: 2px; } .topbar nav a { font-size: 13px; padding: 6px 8px; }
  .hero { padding: 56px 0 44px; }
  td.hide-sm, th.hide-sm { display: none; }
  .kv { grid-template-columns: 1fr; } .drawer { padding: 16px; }
}


/* wrapping discipline */
h1, h2 { text-wrap: balance; }
.hero h1 { max-width: 24ch; font-size: clamp(34px, 4.6vw, 56px); margin-bottom: 14px; }
.hero .sub { font-family: var(--display); font-weight: 600; font-size: clamp(18px, 2vw, 24px); color: #cfe9e5; margin: 0 0 18px; letter-spacing: -.01em; }
.hero .lead { text-wrap: pretty; }
.topbar .wrap { flex-wrap: nowrap; }
.topbar nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar #who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.tile .k, .tile .s { text-wrap: pretty; }
th { white-space: nowrap; }
td { white-space: normal; }
td.num, td.nowrap, td:has(> .status), td:has(> .pill) { white-space: nowrap; }
td .status, td .pill { white-space: nowrap; }
td b { display: inline-block; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
td .small.mute { white-space: nowrap; }
td.why { min-width: 260px; max-width: 420px; }
td.why .r { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
td.why .flag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 420px; }
.filters .field select, .filters .field input { min-width: 0; }
.facts .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step h3, .feature h3 { text-wrap: balance; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
#nTable td:nth-child(5) { max-width: 220px; } #nTable td:nth-child(5) > span, #nTable td:nth-child(5) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nTable td:nth-child(4) { min-width: 260px; }

/* app pages: full-width tables, sticky filter bars */
main.app-main.wrap { max-width: none; padding-left: 24px; padding-right: 24px; }
.filters, .bulk { position: sticky; top: 63px; z-index: 5; }
.filters { background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(6px); box-shadow: 0 6px 16px rgba(17,24,39,.06); }
.bulk { top: 63px; }
.filters + .bulk { top: 63px; }
.table-wrap.card { overflow: visible; }
.table-wrap.card > table { width: 100%; }
.table-wrap table { min-width: 100%; }
#inboxTable td.why { max-width: none; }
.toolbar { position: sticky; top: 63px; z-index: 5; background: var(--canvas); padding: 10px 0; margin: 0 0 10px; }
@media (max-width: 720px) { .filters, .bulk, .toolbar { position: static; } main.app-main.wrap { padding-left: 16px; padding-right: 16px; } }
#nTable td:nth-child(4) { min-width: 340px; max-width: 560px; }
#nTable td:nth-child(5) { max-width: 260px; }
#nTable td.nowrap { white-space: nowrap; }

/* sources list on the landing page */
.srclist { margin: 28px 0 0; border-top: 1px solid var(--line); }
.srclist > div { display: grid; grid-template-columns: 280px 1fr; gap: 12px 32px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.srclist dt { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); margin: 0; }
.srclist dd { margin: 0; color: var(--mute); font-size: 15px; max-width: 70ch; }
@media (max-width: 720px) { .srclist > div { grid-template-columns: 1fr; gap: 4px; } }
