/* Legal Assistant SaaS — themed to match legal.sme.bytefuture.ai
   (Instrument Sans + the warm-green "jade on paper" palette; tokens copied
   from the legal_assistant_sme app stylesheet). */

:root {
  --ink: #1e1d18;
  --graphite: #3a3831;
  --paper: #f4f1e8;
  --panel: #ffffff;
  --card-2: #f0ebde;
  --sidebar: #faf8f1;
  --jade: #5c7650;
  --jade-bright: #6e8c60;
  --jade-soft: #e8efe2;
  --jade-line: #d4e0c9;
  --amber: #a9762b;
  --amber-soft: #f3ead4;
  --amber-line: #e6d8b4;
  --red: #b6483c;
  --red-soft: #fbf0ee;
  --red-line: #e6cfc9;
  --muted: #6b675c;
  --muted-2: #a29c8c;
  --line: #e7e0cf;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(30, 29, 24, 0.04);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-size: 16px; font-family: inherit; }
a { color: var(--jade); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); background: var(--card-2); padding: 2px 6px; border-radius: 6px; font-size: 0.85em; color: var(--graphite); }

/* ── shell ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--sidebar); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-weight: 500; }
.topbar nav a { color: var(--graphite); }
.topbar nav a:hover { color: var(--ink); text-decoration: none; }
.inline { display: inline; margin: 0; }
.link { background: none; border: none; padding: 0; color: var(--jade); cursor: pointer; font: inherit; font-weight: 500; }
.link:hover { text-decoration: underline; background: none; }
.link.danger { color: var(--red); }

.container { max-width: 880px; margin: 0 auto; padding: 34px 22px 60px; }
.foot { max-width: 880px; margin: 0 auto; padding: 22px; color: var(--muted-2); font-size: 0.85rem; text-align: center; }
.foot a { color: var(--jade); }

/* ── hero ── */
.hero h1 { font-size: 2rem; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero .sub { color: var(--muted); margin: 0 0 26px; max-width: 62ch; }

/* ── visitor landing (the SME front page, free edition) ── */
.display { font-family: "Newsreader", Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #2e6a43; margin-bottom: 14px;
}
.eyebrow.on-dark { color: #9fd3a8; }

.landing-hero { display: flex; gap: 40px; align-items: center; padding: 26px 0 44px; flex-wrap: wrap; }
.landing-hero .lh-copy { flex: 1.15; min-width: 320px; }
.landing-hero h1 { font-size: 2.9rem; line-height: 1.12; margin: 0 0 16px; }
.lh-sub { color: var(--muted); font-size: 1.06rem; max-width: 56ch; margin: 0 0 22px; }
.lh-ctas { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.ghost { font-weight: 600; color: var(--ink); }
.lh-ticks { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 0.88rem; }

.lh-mock {
  flex: 1; min-width: 300px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 18px 44px rgba(30, 29, 24, 0.13);
}
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.mock-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #d8534e; } .dot.yellow { background: #e3b23c; } .dot.green { background: #4e9a53; }
.mock-url { flex: 1; text-align: center; font-family: var(--mono); font-size: 0.68rem; color: var(--muted-2); background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 3px 12px; }
.mock-body { padding: 14px 16px 18px; }
.mock-title { font-weight: 600; margin-bottom: 10px; }
.mock-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin: 7px 0;
  font-size: 0.9rem; background: var(--panel);
}
.mock-row.done .t { text-decoration: line-through; color: var(--muted); }
.mock-row.working { border-style: dashed; background: var(--sidebar); }
.mock-btn { background: var(--ink); color: var(--paper); border-radius: 8px; padding: 4px 10px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }

.landing-section { padding: 46px 0 8px; }
.landing-section h2.display { font-size: 2.1rem; margin: 0 0 10px; }
.land-sub { color: var(--muted); max-width: 64ch; margin: 0 0 10px; }
.land-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
@media (max-width: 820px) { .land-grid { grid-template-columns: 1fr; } }
.land-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 20px 16px; box-shadow: var(--shadow); }
.land-card h3 { margin: 8px 0 8px; font-size: 1.05rem; }
.land-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.step-tag {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: #2e6a43; background: var(--jade-soft);
  border: 1px solid var(--jade-line); border-radius: 6px; padding: 2px 9px;
}
.step-num { font-family: "Newsreader", Georgia, serif; font-size: 1.9rem; color: var(--jade); font-weight: 500; }

.landing-dark {
  background: #15150f; color: #f4f0e6;
  margin: 44px calc(50% - 50vw) 10px; padding: 56px calc(50vw - 50%);
}
.landing-dark-inner { max-width: 836px; margin: 0 auto; }
.landing-dark h2.display { font-size: 2.1rem; margin: 0 0 12px; }
.landing-dark p { color: #c7c7bc; max-width: 66ch; }
.grade-list { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.grade-row { color: #c7c7bc; }
.grade {
  display: inline-block; font-family: var(--mono); font-size: 0.78rem; border-radius: 6px;
  padding: 3px 10px; margin-right: 8px; border: 1px solid transparent;
}
.g-easy { background: rgba(159, 211, 168, 0.16); color: #9fd3a8; border-color: rgba(159, 211, 168, 0.35); }
.g-some { background: rgba(227, 178, 60, 0.14); color: #e3b23c; border-color: rgba(227, 178, 60, 0.35); }
.g-pro { background: rgba(216, 83, 78, 0.14); color: #e08984; border-color: rgba(216, 83, 78, 0.35); }
.signin-cta h2.display { font-size: 1.8rem; }

/* ── cards ── */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 24px; margin: 18px 0; box-shadow: var(--shadow);
}
.card.narrow { max-width: 480px; margin-inline: auto; }
.card h1 { margin-top: 0; }
.card h2 { margin: 0 0 14px; font-size: 1.15rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.fineprint { color: var(--muted); font-size: 0.85rem; margin-top: 14px; }
.warn { color: var(--red); background: var(--red-soft); border: 1px solid var(--red-line); padding: 8px 12px; border-radius: var(--r); }
.ok { color: var(--jade); }
.back { display: inline-block; margin-bottom: 10px; }

/* ── forms & buttons ── */
input, textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--r); font: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { border-color: var(--jade); outline: none; box-shadow: 0 0 0 3px var(--jade-soft); }
label { display: block; margin: 12px 0; font-weight: 600; }
label input, label textarea { margin-top: 6px; font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 4px; }

button, .btn {
  border: 1px solid var(--ink); border-radius: var(--r); padding: 10px 16px;
  background: var(--ink); color: var(--paper); cursor: pointer; font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background 0.14s, border-color 0.14s;
  width: auto;
}
button:hover, .btn:hover { background: var(--graphite); text-decoration: none; }
button.big, .btn.big { width: 100%; padding: 14px; font-size: 1.05rem; margin-top: 8px; }
.btn-sm {
  padding: 6px 11px; font-size: 0.88rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; margin-left: 0;
}
.btn-sm:hover { background: var(--card-2); text-decoration: none; }
.btn-sm.primary, .btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-sm.primary:hover, .btn.primary:hover { background: var(--graphite); }
button.link, .link { background: none; border: none; }
button.link:hover { background: none; }

.want { display: flex; gap: 10px; }
.want input { flex: 1; }

/* ── intake box: File our own copy vs Have the agent review ── */
.intake-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 640px) { .intake-paths { grid-template-columns: 1fr; } }
.intake-path {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px; font-weight: 500;
}
.intake-path:hover { background: var(--sidebar); }
.intake-path.active { border-color: var(--jade); background: var(--jade-soft); box-shadow: 0 0 0 1px var(--jade); }
.intake-path .t { font-weight: 600; }
.intake-path .muted { font-size: 0.85rem; font-weight: 400; }
.intake-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .intake-details { grid-template-columns: 1fr; } }
.review { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.review input[type="file"] { flex: 1; min-width: 220px; }
.status { margin-top: 12px; color: var(--muted); }
.result { margin-top: 18px; }
.result.empty { color: var(--muted); }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }

/* ── showcase (visitor homepage) ── */
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 760px) { .showcase { grid-template-columns: 1fr; } }
.showcase-col h2 { margin-bottom: 10px; }
.task {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r);
  margin: 8px 0; color: inherit; background: var(--panel);
  transition: border-color 0.14s, background 0.14s;
}
.task:hover { border-color: var(--jade); background: var(--jade-soft); text-decoration: none; }
.task .t { display: block; font-weight: 600; }
.task .muted { font-size: 0.88rem; }
.signin-cta { text-align: center; padding: 34px 24px; }
.signin-cta .btn { margin-top: 10px; }

.saved-notice {
  background: var(--jade-soft); border-color: var(--jade-line); color: #33502f;
  padding: 14px 18px; margin-bottom: 14px;
}

.field-help { margin-top: 10px; font-size: 0.92rem; }
.field-help > p { margin: 0 0 4px; font-weight: 600; }
.field-help ul { margin: 0; padding-left: 18px; }
.field-help li { margin: 3px 0; line-height: 1.45; }
.field-help em { color: var(--muted); font-style: italic; }

/* ── admin console ── */
.container.wide { max-width: 1180px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.admin-stats .stat {
  display: flex; flex-direction: column; gap: 2px; min-width: 104px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 14px;
}
.admin-stats .n { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.admin-stats .l { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td {
  text-align: left; padding: 8px 9px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
/* The user cell is the only wide one — let it wrap so the numeric columns fit. */
.admin-table td:first-child, .admin-table th:first-child { white-space: normal; min-width: 200px; }
.admin-table th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--ink);
}
.admin-table td.num, .admin-table th.num { text-align: right; font-family: var(--mono); font-size: 0.84rem; }
.admin-table tbody tr:hover { background: var(--sidebar); }
.admin-table .t { font-weight: 600; }
.admin-table .pill { margin-left: 6px; }

/* ── account page: profile + a big green "Start working" button ── */
.account-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.account-hero h1 { margin: 0 0 6px; }
.account-hero p { margin: 0; max-width: 52ch; }
.btn-go {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  background: var(--jade); color: #fff; border: 1px solid var(--jade);
  border-radius: var(--r); padding: 15px 28px; font-size: 1.1rem; font-weight: 700;
  box-shadow: 0 2px 10px rgba(92, 118, 80, 0.28); transition: background 0.14s;
}
.btn-go:hover { background: var(--jade-bright); border-color: var(--jade-bright); color: #fff; text-decoration: none; }

/* ── the "I need…" thread ── */
.thread-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; max-height: 480px; overflow-y: auto; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 85%; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg.user a, .msg.user code { color: inherit; background: rgba(255, 255, 255, 0.12); }
.msg.assistant { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 4px; }
.msg.assistant.question { background: var(--jade-soft); border: 1px solid var(--jade-line); }
.msg.assistant.warn { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.thread-tools { display: flex; justify-content: flex-end; margin-top: 6px; }

/* ── work grid: "I need…" + upload side by side (stacked on mobile) ── */
/* align-items: stretch keeps both cards the same height at all times. */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.work-grid > .card { margin: 0; }
@media (max-width: 820px) { .work-grid { grid-template-columns: 1fr; } }

/* ── checklist (SME to-do rows) ── */
.checklist.card { padding: 20px 22px; }
.checklist h3 { margin: 0 0 10px; }
.todo {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px;
  margin: 8px 0; background: var(--panel); box-shadow: var(--shadow);
}
.todo .todo-main { flex: 1; min-width: 0; }
.todo .todo-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; white-space: nowrap; }
.todo.done .t { text-decoration: line-through; color: var(--muted); }
.todo.working { border-style: dashed; background: var(--sidebar); }
.todo-head { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.pill, button.pill {
  display: inline-flex; align-items: center; gap: 6px; background: var(--jade-soft);
  color: #4a6651; border: 1px solid var(--jade-line); border-radius: 6px;
  padding: 2px 9px; font-size: 0.75rem; font-weight: 600;
}
button.pill { cursor: pointer; font-family: inherit; }
button.pill:hover { background: var(--jade-line); }
.pill.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.pill.plain { background: var(--card-2); color: var(--muted); border-color: var(--line); }
details.todo-how { margin: 6px 0 0; }
details.todo-how summary { cursor: pointer; color: var(--jade); font-size: 0.88rem; font-weight: 500; }
details.todo-how > div { margin-top: 6px; }
/* ⋯ menu on every to-do row (SME todo-menu) */
.todo-menu { position: relative; flex: none; }
.todo-menu-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line);
  color: var(--graphite); padding: 0;
}
.todo-menu-btn:hover { background: var(--panel); color: var(--ink); border-color: #cfc4a9; }
.todo-menu-btn svg { width: 18px; height: 18px; flex: none; }
.todo-menu-panel {
  position: absolute; right: 0; top: 40px; z-index: 20; min-width: 160px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 10px 28px rgba(30, 29, 24, 0.12); padding: 6px;
}
.todo-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; font-size: 0.84rem; font-weight: 500; color: var(--ink);
  background: transparent; border: none; padding: 9px 11px; border-radius: 8px;
}
.todo-menu-item:hover { background: var(--card-2); }
.todo-menu-item.danger { color: var(--red); }
.todo-menu-item.danger:hover { background: var(--red-soft); }

.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid var(--jade-line);
  border-top-color: var(--jade); border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.doc-item, .action-item, .comment-item {
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin: 8px 0; background: var(--panel);
}
.doc-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.doc-item .t { font-weight: 600; }
.action-item .who { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); font-family: var(--mono); }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-item .stance {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
  color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-line);
  border-radius: 6px; padding: 2px 7px; font-family: var(--mono);
}
.comment-item label { font-weight: 400; margin: 0; cursor: pointer; }
.comment-item input[type="checkbox"] { width: auto; margin-right: 6px; }
.ctitle { font-weight: 600; }

/* ── account / login / fill ── */
.sig-preview { max-height: 90px; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; background: #fff; }
.sig-field .field-label { font-weight: 600; display: block; margin-bottom: 4px; }
input[type="file"] { background: var(--sidebar); }
input[type="checkbox"] { width: auto; }
