/* Agency CRM. Internal tool styling: dark rail, light workspace, one accent.
   Not the client-facing gold/black brand system. Derived from the TuckerCRM engine sheet. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #16191d; --body: #2c3238; --muted: #6b7580;
  --line: #dfe3e8; --line-soft: #eceff2; --bg: #f6f7f9; --surface: #ffffff;
  --rail: #1b1f24; --rail-2: #262b31; --rail-ink: #c8cdd4;
  --accent: #b7791f; --accent-soft: #fdf6e8;
  --good: #1f7a4d; --good-soft: #eaf6f0; --warn: #9a6212; --warn-soft: #fdf3e3;
  --risk: #a32d2d; --risk-soft: #fbeceb; --info: #2b5f9e; --info-soft: #eef4fb;
  --radius: 6px; --shadow: 0 1px 2px rgba(16,20,24,.06), 0 4px 12px rgba(16,20,24,.05);
  --rail-w: 224px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--body); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.08rem; } h3 { font-size: 1rem; } h4 { font-size: .9rem; }
code, kbd, pre { font-family: var(--mono); font-size: .86em; }
button { font: inherit; }

/* ------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }
.rail { width: var(--rail-w); flex: 0 0 var(--rail-w); background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail .brand { padding: 18px 18px 14px; border-bottom: 1px solid #32383f; position: relative; }
.rail .brand b { color: #fff; font-size: 1.05rem; letter-spacing: -.02em; display: block; }
.rail .brand small { color: #8b939d; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.rail .rail-close { display: none; position: absolute; right: 10px; top: 14px; color: #c8cdd4; font-size: 1.6rem; }
.rail nav { padding: 10px 8px; flex: 1; }
.rail nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; margin: 1px 0; border-radius: 5px; color: var(--rail-ink); font-size: .88rem; text-decoration: none; }
.rail nav a:hover { background: var(--rail-2); color: #fff; text-decoration: none; }
.rail nav a.on { background: var(--accent); color: #fff; font-weight: 600; }
.rail nav a .n { background: rgba(255,255,255,.14); color: #fff; font-size: .72rem; padding: 1px 6px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.rail nav a.on .n { background: rgba(0,0,0,.22); }
.rail nav .grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #767e88; padding: 12px 10px 4px; }
.rail .foot { padding: 12px 16px 16px; border-top: 1px solid #32383f; font-size: .76rem; color: #8b939d; }
.mode { display: inline-flex; align-items: center; gap: 6px; }
.mode .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ea87a; }
.mode.demo .dot { background: #c99b3a; }

.main { flex: 1; min-width: 0; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 22px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.topbar .tt { min-width: 0; }
.topbar .sp { flex: 1; }
.topbar .sub { color: var(--muted); font-size: .82rem; margin-top: 1px; }
.topbar .search input { width: 200px; padding: 6px 10px; font-size: .86rem; }
.topbar .quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.menu-btn { display: none; }
.wrap { padding: 20px 22px 60px; max-width: 1280px; }

.timer-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--good-soft); border: 1px solid #cbe7d9; color: var(--good); border-radius: 99px; padding: 3px 4px 3px 10px; font-size: .84rem; font-weight: 600; }
.timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.4s infinite; }
.timer-pill .t { font-variant-numeric: tabular-nums; font-family: var(--mono); }
.timer-pill .what { color: var(--body); font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.big-timer { font-family: var(--mono); font-size: 2.2rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 6px 12px; font-size: .86rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c3c9d1; background: #fbfcfd; text-decoration: none; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.pri:hover { background: #a06a1a; border-color: #a06a1a; }
.btn.danger { color: var(--risk); border-color: #e6c4c2; }
.btn.danger:hover { background: var(--risk-soft); }
.btn.sm { padding: 3px 9px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; vertical-align: middle; }
.tick:hover { border-color: var(--good); background: var(--good-soft); }
.tick.done { background: var(--good); border-color: var(--good); }

input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 7px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; font-family: inherit; }
label { display: block; font-size: .8rem; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; color: var(--body); font-weight: 500; margin: 6px 14px 6px 0; cursor: pointer; }
label.check input { width: auto; margin: 0; }
.field { margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.subhead { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 14px 0 6px; }
.subhead.risk { color: var(--risk); }
.quickdates { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }

/* ------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card .hd { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px; flex-wrap: wrap; }
.card .hd .sp { flex: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.tile .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.tile .v { font-size: 1.55rem; font-weight: 660; color: var(--ink); margin: 4px 0 1px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .v .of { font-size: .95rem; color: var(--muted); font-weight: 500; }
.tile .s { font-size: .78rem; color: var(--muted); }
.tile .meter { margin: 6px 0 4px; }
.tile.alert { border-left: 3px solid var(--risk); }
.tile.warnb { border-left: 3px solid var(--warn); }

/* ----------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 0 10px 7px; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tw { overflow-x: auto; }

/* ------------------------------------------------------------ chips */
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .74rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; vertical-align: middle; }
.chip.gray { background: #f1f3f5; color: #5a636c; border-color: #e3e7ea; }
.chip.gold { background: var(--accent-soft); color: var(--accent); border-color: #f0dfbb; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: #cbe7d9; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: #f2e0bf; }
.chip.risk { background: var(--risk-soft); color: var(--risk); border-color: #f0cecb; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: #cfe0f2; }
.chip.dot::before { content: "\25CF"; margin-right: 5px; font-size: .7em; vertical-align: 1px; }

.muted { color: var(--muted); } .small { font-size: .84rem; } .tiny { font-size: .76rem; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .mt { margin-top: 12px; }
.empty { color: var(--muted); font-size: .88rem; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.banner { background: var(--accent-soft); border: 1px solid #f0dfbb; color: #6d4a12; padding: 9px 14px; border-radius: var(--radius); font-size: .85rem; margin-bottom: 14px; }
.banner.soft { background: #f6f7f9; border-color: var(--line); color: var(--body); }
.banner.risk { background: var(--risk-soft); border-color: #f0cecb; color: var(--risk); }
.banner.good { background: var(--good-soft); border-color: #cbe7d9; color: var(--good); }
pre.brief { white-space: pre-wrap; font-family: var(--sans); font-size: .88rem; background: #fafbfc; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; margin: 0; overflow-wrap: anywhere; }
pre.mono { white-space: pre-wrap; font-size: .78rem; background: #fafbfc; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 12px; margin: 0; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
.mail-body { white-space: pre-wrap; font-size: .9rem; overflow-wrap: anywhere; }

/* ---------------------------------------------------- suggestions */
.sug { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.sug .score { font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--muted); background: #f1f3f5; border-radius: 5px; text-align: center; padding: 4px 0; }
.sug.hot .score { background: var(--risk-soft); color: var(--risk); }
.sug.warm .score { background: var(--accent-soft); color: var(--accent); }
.sug-title { font-size: .9rem; font-weight: 600; }
.sug-title a { color: var(--ink); }
.sug-acts, .fu-acts { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.fu-row, .call-row, .inbox-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.fu-main, .inbox-row .im { flex: 1; min-width: 0; }
.fu-row b, .call-row b { font-size: .9rem; color: var(--ink); }
.health-row, .cal-row, .srow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.cal-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.plan { padding-left: 20px; margin: 0; } ol.plan li { margin: 0 0 8px; }

/* --------------------------------------------------------- pipeline */
.board { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 12px; align-items: start; }
.board.b3 { grid-template-columns: repeat(3, minmax(210px, 1fr)); }
.col { background: #eef0f3; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col > .ch { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 9px; }
.col > .ch b { font-size: .82rem; color: var(--ink); }
.col > .ch .n { color: var(--muted); font-size: .78rem; }
.col > .ch .v { margin-left: auto; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.deal, .tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 10px 11px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 1px rgba(16,20,24,.04); }
.deal:hover, .tcard:hover { border-color: var(--accent); }
.deal .co { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.deal .nm, .tcard .nm { font-weight: 600; color: var(--ink); font-size: .88rem; margin: 2px 0 6px; line-height: 1.32; }
.deal .mt2 { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.deal .amt { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.deal .na { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: .78rem; color: var(--body); }
.deal .na.over { color: var(--risk); font-weight: 600; }
.deal .na.none { color: var(--warn); font-style: italic; }

/* -------------------------------------------------------- timeline */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl .ev { position: relative; padding: 0 0 14px; }
.tl .ev::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.tl .ev.in::before { border-color: var(--info); } .tl .ev.out::before { border-color: var(--good); } .tl .ev.sys::before { border-color: var(--line); background: var(--line); }
.tl .ev .top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl .ev .top b { color: var(--ink); font-size: .89rem; }
.tl .ev .top .when { color: var(--muted); font-size: .78rem; margin-left: auto; }
.tl .ev p { margin: 3px 0 0; font-size: .86rem; color: var(--body); white-space: pre-wrap; }

/* --------------------------------------------------------- detail */
.det { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.det > * { min-width: 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 5px 12px; font-size: .86rem; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.crumb { font-size: .82rem; color: var(--muted); margin-bottom: 8px; } .crumb a { color: var(--muted); }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.stage-steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; }
.stage-steps .st { padding: 4px 10px; border-radius: 99px; font-size: .78rem; border: 1px solid var(--line); color: var(--muted); cursor: pointer; background: var(--surface); }
.stage-steps .st.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.stage-steps .st.past { background: var(--accent-soft); border-color: #f0dfbb; color: var(--accent); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line-soft); font-size: .88rem; }
.checklist li.done span { text-decoration: line-through; color: var(--muted); }

/* ---------------------------------------------------------- meter */
.meter { height: 7px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.good i { background: var(--good); } .meter.warn i { background: var(--warn); } .meter.risk i { background: var(--risk); }
.bars td { padding: 5px 10px; }
.bars .bar { height: 16px; background: var(--accent-soft); border-radius: 3px; position: relative; }
.bars .bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.funnel .step { background: #fafbfc; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px; text-align: center; }
.funnel .step .v { font-size: 1.3rem; font-weight: 650; color: var(--ink); }
.funnel .step .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------------------------------------------------------- modal */
.veil { position: fixed; inset: 0; background: rgba(16,20,24,.44); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; z-index: 60; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 8px; width: 100%; max-width: 560px; box-shadow: 0 12px 40px rgba(0,0,0,.24); }
.modal.wide { max-width: 760px; }
.modal .mh { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .mh h3 { flex: 1; }
.modal .mb { padding: 16px 18px; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: #fafbfc; border-radius: 0 0 8px 8px; }
.modal .mf .sp { flex: 1; }
.x { background: none; border: 0; font-size: 1.3rem; color: var(--muted); cursor: pointer; line-height: 1; padding: 0 4px; }

/* ----------------------------------------------------------- login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--rail); }
.login .box { background: var(--surface); border-radius: 8px; padding: 28px; width: 100%; max-width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.login h1 { margin-bottom: 3px; }
.login .err { background: var(--risk-soft); color: var(--risk); padding: 8px 11px; border-radius: 5px; font-size: .85rem; margin-bottom: 12px; }

/* ------------------------------------------------------------ misc */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 6px; font-size: .86rem; z-index: 90; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 92vw; }
.toast.err { background: var(--risk); }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; align-items: center; }
.tabs .sp { flex: 1; }
.tabs .tab { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: .82rem; cursor: pointer; color: var(--body); font-family: inherit; font-weight: 500; text-decoration: none; }
.tabs .tab.on { background: var(--rail); color: #fff; border-color: var(--rail); font-weight: 600; }
.tab .n { margin-left: 6px; opacity: .7; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters .sp { flex: 1; }
.legend { font-size: .76rem; color: var(--muted); display: inline-flex; gap: 10px; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: -1px; }
.k-followup { background: var(--accent); } .k-task { background: var(--info); } .k-close { background: var(--good); } .k-milestone { background: #7a4fa3; } .k-meeting { background: var(--risk); }
.legend i.k-followup { background: var(--accent); } .legend i.k-task { background: var(--info); } .legend i.k-close { background: var(--good); } .legend i.k-milestone { background: #7a4fa3; } .legend i.k-meeting { background: var(--risk); }

/* --------------------------------------------------------- calendar */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 2px 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; min-height: 96px; padding: 5px 6px; font-size: .76rem; }
.cal-cell.off { background: #f3f4f6; color: var(--muted); }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell .dn { font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.cal-item { display: block; color: var(--ink); background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 1px 5px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.k-task { background: var(--info-soft); border-color: var(--info); }
.cal-item.k-close { background: var(--good-soft); border-color: var(--good); }
.cal-item.k-milestone { background: #f1eaf7; border-color: #7a4fa3; }
.cal-item.k-meeting { background: var(--risk-soft); border-color: var(--risk); }
.cal-item.k-followup { background: var(--accent-soft); border-color: var(--accent); }

/* ------------------------------------------------------------- mail */
.thr { display: grid; grid-template-columns: 210px minmax(0, 1fr) 150px; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--line-soft); cursor: pointer; align-items: center; }
.thr:first-child { border-top: 0; } .thr:hover { background: #fafbfc; } .thr.need { box-shadow: inset 3px 0 0 var(--accent); }
.thr .who b, .thr .who .tiny, .thr .sub, .thr .what .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.thr .sub { font-size: .9rem; color: var(--ink); font-weight: 600; } .thr .meta { text-align: right; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; box-shadow: var(--shadow); }
.msg.out { border-left: 3px solid var(--good); } .msg.in { border-left: 3px solid var(--info); }
.msg .mh { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; } .msg .mh .when { margin-left: auto; }
.msg .mb { white-space: pre-wrap; font-size: .9rem; color: var(--body); overflow-wrap: anywhere; }

/* --------------------------------------------------------- sequences */
.step-row { display: grid; grid-template-columns: 70px 100px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.step-row .day { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: 4px; }
.step-body { white-space: pre-wrap; font-size: .84rem; color: var(--body); }
.seq-editor .srow2 { display: grid; grid-template-columns: 80px 120px minmax(0, 1fr) 36px; gap: 8px; align-items: start; margin-bottom: 8px; }
.seq-editor textarea { min-height: 54px; }

/* --------------------------------------------------- outreach loop */
/* Pipeline strip on a company page: the six stages, the current one lit, the ones before it done. */
.pipe { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; }
.pipe .chip { background: var(--surface); color: var(--muted); border-color: var(--line); }
.pipe .chip.done { background: var(--accent-soft); color: var(--accent); border-color: #f0dfbb; }
.pipe .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pipe a { margin-left: auto; color: var(--muted); }
/* Tracking marks on a sent record: Opened, Clicked, Replied, each with its first time. */
.marks { display: inline-flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
.marks .tiny { margin-right: 6px; }
/* Eight tiles on Today: two rows of four rather than seven and an orphan. */
.tiles.t8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Seven-step funnel for outreach conversion. */
.funnel.f7 { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
.funnel.f7 .step { padding: 8px 6px; }
.funnel.f7 .step .v { font-size: 1.15rem; }
.funnel.f7 .step .k { font-size: .64rem; letter-spacing: .04em; }
.scout-form textarea { min-height: 54px; }

/* ------------------------------------------------------------ AI */
.ai-out { background: #fafbfc; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; }
.ai-out .subj { font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.job-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }

/* --------------------------------------------------------- responsive */
@media (max-width: 1080px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .board.b3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .det { grid-template-columns: 1fr; } .funnel { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .shell { display: block; }
  .rail { display: none; }
  body.menu-open .rail { display: flex; position: fixed; inset: 0; width: 100%; height: 100vh; z-index: 80; }
  body.menu-open .rail .rail-close { display: block; }
  body.menu-open { overflow: hidden; }
  .rail nav a { padding: 10px 12px; font-size: 1rem; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar .search { order: 5; flex: 1 1 100%; } .topbar .search input { width: 100%; }
  .topbar .quick { order: 6; }
  .topbar .quick .btn { min-height: 36px; }
  .wrap { padding: 14px 14px 50px; }
  .tiles, .tiles.t8 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 12px; } .tile .v { font-size: 1.3rem; }
  .pipe .chip { font-size: .68rem; padding: 1px 6px; } .pipe a { margin-left: 0; flex: 1 1 100%; }
  .funnel.f7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board, .board.b3 { grid-template-columns: 1fr; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .sug { grid-template-columns: 34px minmax(0, 1fr); } .sug-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .fu-row, .call-row, .inbox-row { flex-wrap: wrap; } .fu-acts { width: 100%; justify-content: flex-start; }
  .thr { grid-template-columns: 1fr; gap: 4px; } .thr .meta { text-align: left; }
  .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } .cal-cell { min-height: 56px; padding: 3px; font-size: .68rem; } .cal-item { font-size: .62rem; padding: 0 3px; }
  .step-row { grid-template-columns: 60px 1fr; } .seq-editor .srow2 { grid-template-columns: 70px 1fr; }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .job-row { grid-template-columns: 1fr; }
  .btn, .tick { min-height: 34px; }
}
