:root {
  --green: #1F7A3A;
  --green-soft: #e8f3ec;
  --dark: #0F1A14;
  --orange: #C2410C;
  --amber: #b45309;
  --amber-soft: #fef3e2;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #17201b;
  --muted: #5d6b63;
  --line: #dfe5e1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --green-soft: #14301f;
    --amber-soft: #33240d;
    --red-soft: #3a1414;
    --bg: #0F1A14;
    --card: #16241c;
    --text: #e8efe9;
    --muted: #9aaba1;
    --line: #2a3a31;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--dark); color: #fff; }
.brand { color: #fff; font-weight: 700; text-decoration: none; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-right: 8px; }
.crumb { color: #b8c7be; }
.who { margin-left: auto; color: #b8c7be; font-size: 13px; }
.wrap { max-width: 920px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); white-space: pre-line; margin: 8px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; }
.grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.narrow { max-width: 360px; margin-top: 10px; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: 0; }
.seg { display: flex; gap: 16px; margin-bottom: 8px; }
.seg label { flex-direction: row; align-items: center; color: var(--text); font-size: 14px; }
button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; padding: 9px 14px; cursor: pointer; }
button.primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
button.link { border: 0; background: none; color: var(--green); padding: 4px 0; }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
details { margin-top: 14px; }
summary { cursor: pointer; color: var(--green); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 600; }
.item-row { display: grid; grid-template-columns: 1fr 140px 32px; gap: 8px; margin-bottom: 6px; }
.item-row button { padding: 4px; }

.verdict { border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid; }
.verdict b { text-transform: uppercase; letter-spacing: .04em; }
.verdict.pursue { background: var(--green-soft); border-color: var(--green); }
.verdict.negotiate { background: var(--amber-soft); border-color: var(--amber); }
.verdict.pass { background: var(--red-soft); border-color: var(--red); }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.offer { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.offer .label { font-size: 13px; color: var(--muted); }
.offer .big { font-size: 24px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.offer .src { font-size: 12px; color: var(--muted); }
.neg { color: var(--red); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; }
.formula { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; text-transform: capitalize; }
.pill.pursue { background: var(--green-soft); color: var(--green); }
.pill.negotiate { background: var(--amber-soft); color: var(--amber); }
.pill.pass { background: var(--red-soft); color: var(--red); }
ul.notes { margin: 0; padding-left: 18px; }
.disclaimer { font-size: 12px; color: var(--muted); margin-top: 12px; }
@media (max-width: 520px) {
  .item-row { grid-template-columns: 1fr 110px 32px; }
  .offer .big { font-size: 20px; }
}

/* Submit a Deal review panel */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.submit-panel h4 { margin: 16px 0 6px; font-size: 14px; }
.warn { background: var(--amber-soft); border: 1px solid var(--amber); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
a.button { display: inline-block; font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; padding: 9px 14px; text-decoration: none; }
.persona .pill { background: var(--green-soft); color: var(--green); text-transform: none; }

/* ---------- App layout: menu + content (all signed-in pages) ---------- */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; max-width: 1100px; margin: 0 auto; padding: 16px; }
.layout > * { min-width: 0; } /* long titles in the sidebar must never widen the page */
.side .card { padding: 12px; }
.side h2 { font-size: 14px; margin: 0 0 8px; }
.modes a { display: block; color: var(--text); text-decoration: none; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.modes a:hover, .modes a.on { background: var(--green-soft); }
.modes a.on { font-weight: 600; }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  /* On phones the menu becomes a row of chips at the top; the other sidebar cards go below the content. */
  .side { display: contents; }
  .side .navcard { order: -1; padding: 6px; margin-bottom: 0; }
  .side > .card:not(.navcard) { order: 2; }
  .layout > main, .layout > section { order: 0; }
  .modes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .modes::-webkit-scrollbar { display: none; }
  .modes a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
}
