/* SigmaWay Contracts - SigmaWay palette: navy #001c47, deep navy #0a2d63, teal #1cc0bd, light teal #55d7da,
   sky #eef3fa; Raleway headings, Roboto text. Light only. */
:root {
  --navy: #001c47; --navy2: #0a2d63; --teal: #1cc0bd; --teal2: #55d7da; --teal-d: #0e8f8c; --sky: #eef3fa; --sky2: #dbe4f2;
  --ink: #1f2a44; --muted: #5b6475; --line: #e2e8f0; --bg: #f4f7fb; --card: #fff;
  --good: #10b981; --warn: #f59e0b; --bad: #ef4444; --violet: #7c3aed;
  --shadow: 0 1px 2px rgba(0,28,71,.06), 0 8px 24px rgba(0,28,71,.07); --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3, .brand, .nav a, .btn, .pill, .kpi .n, .tab { font-family: Raleway, Roboto, sans-serif; }
h1 { font-size: 24px; margin: 0 0 4px; color: var(--navy); letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--navy); }
a { color: var(--navy2); }
a:hover { color: var(--teal-d); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ic { vertical-align: -3px; flex: none; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* layout: navy side rail + white top bar */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.rail { background: linear-gradient(180deg, var(--navy) 0%, #00143a 100%); color: #c9d3e6; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; text-decoration: none; color: #fff; }
.brand img { height: 38px; background: #fff; border-radius: 8px; padding: 3px 6px; }
.brand .wm { font-weight: 800; font-size: 20px; color: #fff; }
.brand .wm b { color: var(--teal); }
.brand .app { font: 700 10.5px Raleway, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--navy);
  background: var(--teal2); padding: 3px 8px; border-radius: 999px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #c9d3e6; text-decoration: none;
  font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s, transform .15s; position: relative; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav a.on { background: rgba(28,192,189,.16); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
.nav .badge { margin-left: auto; background: var(--teal); color: var(--navy); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 7px; }
.nav .badge.warn { background: var(--warn); }
.nav-h { font: 700 10.5px Raleway, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #7f8db0; padding: 16px 12px 6px; }
.nav .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rail-foot { margin-top: auto; padding: 12px; font-size: 11.5px; color: #7f8db0; }
.top { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 14px; padding: 10px 28px; min-height: 60px; }
.top .search { flex: 1; max-width: 460px; position: relative; }
.top .search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--sky); }
.top .search .ic { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bell { position: relative; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--navy); background: var(--sky); text-decoration: none; }
.bell i { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 9px; background: var(--bad); color: #fff;
  font: 700 10px/16px Roboto, sans-serif; font-style: normal; text-align: center; padding: 0 4px; }
.who { position: relative; }
.who summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); }
.who summary::-webkit-details-marker { display: none; }
.av { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font: 700 11.5px Roboto, sans-serif; flex: none; }
.who .menu { position: absolute; right: 0; top: calc(100% + 6px); width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; animation: pop .18s var(--ease); z-index: 60; }
.who .menu a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.who .menu a:hover { background: var(--sky); }
.who .menu a.on { background: #e6f8f8; }
.who .menu .lab { font: 700 10.5px Raleway, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; }
.main { padding: 26px 28px 60px; max-width: 1360px; width: 100%; }
.page-h { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h .sub { color: var(--muted); margin: 0; }
.page-h .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* cards, grid */
.card { background: var(--card); border: 1px solid #e6ebf2; border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.kpi { position: relative; overflow: hidden; }
.kpi .lab { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.kpi .n { font-size: 30px; font-weight: 800; color: var(--navy); margin-top: 4px; letter-spacing: -.02em; }
.kpi .n small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(28,192,189,.18), transparent 70%); }
.kpi.warn .n { color: #b45309; } .kpi.bad .n { color: #b91c1c; }
.flash { background: #e6f8f8; border: 1px solid #b5ecea; color: #0b4f4e; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px;
  animation: drop .3s var(--ease); }
.empty { text-align: center; color: var(--muted); padding: 26px; }

/* buttons, inputs, pills */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: var(--navy); color: #fff; padding: 9px 15px; border-radius: 10px;
  font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { color: #fff; background: var(--navy2); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,28,71,.2); }
.btn.teal { background: var(--teal); color: var(--navy); } .btn.teal:hover { background: var(--teal2); color: var(--navy); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); } .btn.ghost:hover { background: var(--sky); box-shadow: none; }
.btn.bad { background: #fff; color: #b91c1c; border: 1px solid #fecaca; } .btn.bad:hover { background: #fef2f2; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.busy { opacity: .7; pointer-events: none; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid #d5dce6; border-radius: 9px; padding: 8px 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(28,192,189,.18); }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.form-row input, .form-row select, .form-row textarea, .w100 { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--sky); color: var(--navy2); white-space: nowrap; }
.st-draft { background: #f1f5f9; color: #475569; } .st-in_review { background: #fef3c7; color: #92400e; }
.st-changes { background: #fee2e2; color: #991b1b; } .st-approved { background: #dbeafe; color: #1e40af; }
.st-out_for_signature { background: #ede9fe; color: #5b21b6; } .st-active { background: #d1fae5; color: #065f46; }
.st-expired { background: #e5e7eb; color: #374151; } .st-renewed { background: #e6f8f8; color: #0e6f6c; }
.st-terminated { background: #fce7f3; color: #9d174d; }
.chip-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chip-cat i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* tables */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font: 700 11px Raleway, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafcfe; }
table.t td { padding: 11px 10px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
table.t tr { transition: background .15s; }
table.t tbody tr:hover { background: #f7fbff; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.title-link { font-weight: 700; color: var(--navy); text-decoration: none; }
.title-link:hover { color: var(--teal-d); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 5px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg a.on { background: var(--navy); color: #fff; }
.left-days { font-weight: 700; } .left-days.soon { color: #b45309; } .left-days.late { color: #b91c1c; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .col { width: 100%; max-width: 42px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--teal), var(--teal-d));
  transform-origin: bottom; animation: grow .7s var(--ease) both; position: relative; min-height: 2px; }
.bars .col .auto { position: absolute; left: 0; right: 0; bottom: 0; background: var(--navy2); border-radius: 0 0 3px 3px; }
.bars .v { font-size: 11px; font-weight: 700; color: var(--navy); }
.bars .x { font-size: 11px; color: var(--muted); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel .row { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.funnel .track { height: 26px; background: var(--sky); border-radius: 8px; overflow: hidden; }
.funnel .fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--navy2), var(--teal)); transform-origin: left;
  animation: growx .8s var(--ease) both; min-width: 4px; }
.funnel .n { font-weight: 800; color: var(--navy); text-align: right; }
.hbar { display: grid; grid-template-columns: 170px 1fr 90px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--sky); border-radius: 9px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 9px; transform-origin: left; animation: growx .8s var(--ease) both; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* timeline + activity */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #edf1f6; }
.feed li:last-child { border: 0; }
.feed .k { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sky); color: var(--navy2); }
.feed .k.approval, .feed .k.escalation { background: #fef3c7; color: #92400e; } .feed .k.check { background: #e6f8f8; color: var(--teal-d); }
.feed .k.signature { background: #ede9fe; color: #5b21b6; } .feed .k.renewal { background: #d1fae5; color: #065f46; }
.feed .txt { white-space: pre-line; font-size: 13px; }
.feed .meta { font-size: 11.5px; color: var(--muted); }

/* contract page */
.c-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.c-head .ref { font: 700 12px Roboto, monospace; color: var(--muted); }
.c-head .facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.c-head .facts b { color: var(--ink); }
.stepper { display: flex; gap: 0; margin: 4px 0 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stepper .s { flex: 1; padding: 10px 12px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; position: relative; }
.stepper .s + .s { border-left: 1px solid var(--line); }
.stepper .s i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1; display: inline-flex; align-items: center; justify-content: center;
  font: 700 11px Roboto, sans-serif; font-style: normal; flex: none; background: #fff; }
.stepper .s.done { color: var(--ink); } .stepper .s.done i { background: var(--teal); border-color: var(--teal); color: var(--navy); }
.stepper .s.now { color: var(--navy); font-weight: 700; background: #f2fbfb; }
.stepper .s.now i { border-color: var(--teal); color: var(--teal-d); animation: pulse 1.8s infinite; }
.actbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; background: linear-gradient(90deg, #f2fbfb, #fff);
  border: 1px solid #c9eeed; border-radius: 14px; margin-bottom: 16px; }
.actbar .what { font-weight: 700; color: var(--navy); margin-right: 6px; display: flex; gap: 8px; align-items: center; }
.actbar .sp { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13px; border-bottom: 3px solid transparent;
  display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--navy); } .tab.on { color: var(--navy); border-color: var(--teal); }
.finding { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f3f7; font-size: 13px; }
.finding .sev { font: 800 10.5px Roboto, sans-serif; text-transform: uppercase; letter-spacing: .06em; border-radius: 6px; padding: 3px 6px; text-align: center; height: fit-content; }
.finding .sev.major { background: #fee2e2; color: #991b1b; } .finding .sev.minor { background: #fef3c7; color: #92400e; }
.path { display: flex; flex-direction: column; gap: 0; }
.path .st { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 12px 0; position: relative; }
.path .st::before { content: ""; position: absolute; left: 16px; top: 40px; bottom: -12px; width: 2px; background: var(--line); }
.path .st:last-child::before { display: none; }
.path .dot { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #f1f5f9;
  color: var(--muted); border: 2px solid #e2e8f0; z-index: 1; }
.path .approved .dot { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.path .pending .dot { background: #fef3c7; color: #92400e; border-color: #fde68a; animation: pulse 1.8s infinite; }
.path .changes .dot { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.path .over .dot { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.path .nm { font-weight: 700; color: var(--navy); }
.path .sub { font-size: 12px; color: var(--muted); }
.sla { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: #f1f5f9; color: #475569; }
.sla.over { background: #fee2e2; color: #b91c1c; } .sla.esc { background: #ede9fe; color: #5b21b6; }

/* editor (from Leads) */
.ce-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.ce-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; background: #fff; border: 1px solid #e6eaf0; border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.ce-help { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.ce-field { padding: 9px 10px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 9px; margin-bottom: 8px; transition: background .3s, box-shadow .3s; }
.ce-field.set { border-left-color: var(--good); } .ce-field.locked { border-left-color: #cbd5e1; background: #fafbfc; }
.ce-field.flash-ok { background: #ecfdf5; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.ce-field label { display: block; font-weight: 600; color: var(--navy); font-size: 12.5px; margin-bottom: 4px; }
.ce-field input, .ce-field textarea { width: 100%; }
.ce-row { display: flex; gap: 6px; align-items: center; margin-top: 5px; justify-content: flex-end; }
.ce-ok { border: 0; background: var(--navy); color: #fff; width: 30px; height: 28px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, transform .15s; }
.ce-ok:hover { background: var(--teal); color: var(--navy); transform: scale(1.06); }
.ce-paper { background: #fff; border: 1px solid #e3e7ee; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,28,71,.10); padding: 44px 54px 60px;
  font: 13.5px/1.6 Calibri, "Segoe UI", Roboto, sans-serif; animation: rise .4s var(--ease); }
.ce-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; margin: -20px 0 20px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); font-family: Roboto, sans-serif; }
.ce-p { position: relative; padding: 3px 34px 3px 8px; margin: 0 -8px 6px; border-radius: 6px; transition: background .15s, box-shadow .15s; text-align: justify; }
.ce-p:hover { background: #f7fafc; box-shadow: inset 3px 0 0 var(--teal); }
.ce-p.ce-empty { min-height: 6px; padding: 0; margin: 0; } .ce-p.ce-empty:hover { background: none; box-shadow: none; }
.ce-p.ce-heading { font-family: Raleway, sans-serif; color: var(--navy); margin-top: 12px; }
.ce-p.ce-edited { background: #fffbeb; box-shadow: inset 3px 0 0 var(--warn); }
.ce-p.editing { background: #f0f9ff; box-shadow: inset 3px 0 0 var(--navy); }
.ce-pen { position: absolute; right: 4px; top: 4px; border: 0; background: #fff; color: var(--navy); width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.12); opacity: 0; transform: scale(.9); transition: opacity .15s, transform .15s, background .15s; display: inline-flex; align-items: center; justify-content: center; }
.ce-p:hover > .ce-pen, .ce-pen:focus { opacity: 1; transform: none; }
.ce-pen:hover { background: var(--navy); color: #fff; }
.ce-flag { display: inline-block; font-size: 10.5px; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 0 7px; font-family: Roboto, sans-serif; }
.ce-p > .ce-flag { position: absolute; right: 34px; top: 7px; }
.ce-tab { display: inline-block; width: 2.2em; }
.ce-chip { display: inline; padding: 1px 6px; border-radius: 6px; border: 1px dashed var(--warn); background: #fffbeb; color: #92400e; font-size: 12.5px; cursor: pointer; transition: background .2s; }
.ce-chip.on { border: 1px solid transparent; background: #e6f8f8; color: #0b5563; font-weight: 600; }
.ce-chip.pop { animation: chip .5s var(--ease); }
.ce-sign { display: inline-block; padding: 1px 8px; border: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3; border-radius: 6px; font-size: 12px; }
.ce-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
.ce-table td { border: 1px solid #d5dce6; padding: 6px 8px; vertical-align: top; }
.ce-table .ce-p { margin: 0; padding-right: 30px; text-align: left; }
.ce-box { margin: 6px 0 4px; }
.ce-box textarea { width: 100%; font: 13.5px/1.55 Calibri, "Segoe UI", Roboto, sans-serif; }
.ce-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-family: Roboto, sans-serif; }
.ce-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ce-bar { width: 110px; height: 7px; background: #e5eaf1; border-radius: 9px; overflow: hidden; }
.ce-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--good)); border-radius: 9px; transition: width .4s var(--ease); }

/* escalation builder */
.esc-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid #f0f3f7; }
.esc-step.new { opacity: .85; }
.esc-top { display: grid; grid-template-columns: 1.3fr 1fr .8fr .7fr auto; gap: 12px; align-items: end; }
.esc-top label.f { margin-top: 0; }
.esc-del { align-self: center; display: flex; gap: 6px; align-items: center; color: #b91c1c; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  font-size: 12.5px; background: #fff; transition: background .15s, border-color .15s, transform .12s; user-select: none; }
.pick:hover { transform: translateY(-1px); border-color: #b8c4d6; }
.pick input { display: none; }
.pick .av { width: 22px; height: 22px; font-size: 9.5px; opacity: .55; }
.pick:has(input:checked) { background: #e6f8f8; border-color: var(--teal); color: var(--navy); font-weight: 700; }
.pick:has(input:checked) .av { opacity: 1; }
.pick.esc:has(input:checked) { background: #ede9fe; border-color: #a78bfa; }
@media (max-width: 900px) { .esc-top { grid-template-columns: 1fr 1fr; } }
.card .kpi::after { display: none; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow: auto; padding: 4px; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 14px; white-space: pre-wrap; font-size: 13.5px; animation: rise .3s var(--ease); }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.msg .src { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); white-space: normal; }
.msg .src a { display: block; }
.ask { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.ask textarea { flex: 1; resize: vertical; min-height: 46px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.suggest button { border: 1px dashed var(--teal); background: #f2fbfb; color: var(--teal-d); border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer; }
.suggest button:hover { background: #e6f8f8; }
.ai-off { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 10px 12px; border-radius: 12px; font-size: 13px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .hero { background: radial-gradient(circle at 20% 20%, rgba(28,192,189,.35), transparent 40%), linear-gradient(160deg, var(--navy), #00102b);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; position: relative; overflow: hidden; }
.login .hero h1 { color: #fff; font-size: 38px; line-height: 1.15; }
.login .hero h1 b { color: var(--teal); }
.login .hero p { color: #c9d3e6; font-size: 15px; max-width: 520px; }
.login .hero .feat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 560px; }
.login .hero .feat div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.login .chooser { padding: 48px; overflow: auto; }
.person { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: transform .15s, box-shadow .2s, border-color .2s; font: inherit; color: inherit; }
.person:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--teal); }
.person .r { font-size: 12px; color: var(--muted); }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; animation: float 9s ease-in-out infinite; }

/* animations */
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes chip { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(28,192,189,.35); } 50% { box-shadow: 0 0 0 6px rgba(28,192,189,0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@view-transition { navigation: auto; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--teal), var(--teal2)); z-index: 100; transition: width .3s; }
.progress.go { width: 75%; transition: width 6s cubic-bezier(.1,.6,.2,1); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* small screens */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 6px; }
  .rail .nav { flex-direction: row; flex-wrap: wrap; } .nav-h, .rail-foot, .rail .cats { display: none; }
  .top { padding: 10px 16px; } .main { padding: 18px 16px 40px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .ce-wrap { grid-template-columns: 1fr; } .ce-side { position: static; max-height: none; }
  .ce-paper { padding: 24px 18px; } .login { grid-template-columns: 1fr; } .login .hero { padding: 32px 20px; } .login .chooser { padding: 24px 16px; }
  .stepper { flex-direction: column; } .stepper .s + .s { border-left: 0; border-top: 1px solid var(--line); }
  table.t { display: block; overflow-x: auto; }
}
