/* Viva Docket - colors come from the logo: slate #25333d, teal #0599a1 / #0a7f88, cyan #00c9d2 */
:root {
  --ink: #25333d;
  --bg: #f4f7f8;
  --card: #ffffff;
  --border: #dfe6e9;
  --muted: #64737d;
  --teal: #0a7f88;
  --teal-bright: #0599a1;
  --teal-soft: #e3f4f5;
  --cyan: #00c9d2;
  --red: #c53b3b;
  --amber: #b7790a;
  --green: #1f8a4c;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--teal); }
a:hover { color: #06636a; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 28px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.right { text-align: right; }
.hidden { display: none; }

/* top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand img { height: 44px; display: block; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--teal); }
.nav a.btn { color: #fff; }

/* footer */
.footer { border-top: 1px solid var(--border); background: #fff; padding: 22px 0; font-size: 14px; color: var(--muted); }
.footer p { margin: 4px 0; }

/* buttons */
/* one class (no element or attribute selectors) so the variants below win for <a>, <button> and <input type=submit> alike */
.btn {
  display: inline-block; background: var(--teal); color: #fff; border: 1px solid var(--teal); border-radius: 10px;
  padding: 11px 18px; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; font-family: inherit; line-height: 1.2;
  -webkit-appearance: none; appearance: none;
}
.btn:hover { background: #06636a; border-color: #06636a; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-ghost { background: #fff; color: var(--teal); border-color: var(--border); }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal); border-color: var(--border); }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-danger { background: #fff; color: var(--red); border-color: #efc9c9; }
.btn-danger:hover { background: #fbeaea; color: var(--red); border-color: #efc9c9; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* cards and layout */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card h2 { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } h1 { font-size: 24px; } }

/* forms */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=file]), .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 10px 12px; font-size: 16px; color: var(--ink); font-family: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: var(--teal); }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.check input { margin-top: 4px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.checks label { font-size: 15px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 400; }
.form-narrow { max-width: 440px; margin: 0 auto; }

/* messages */
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
.alert-error { background: #fbeaea; color: var(--red); border: 1px solid #efc9c9; }
.alert-ok { background: var(--teal-soft); color: #06636a; border: 1px solid #bfe3e6; }
.note-box { background: var(--teal-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #06636a; }

/* lists of dates, cases, papers */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.item:first-child { border-top: 0; padding-top: 4px; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 700; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }
.date-badge { width: 58px; flex: 0 0 58px; text-align: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.date-badge .m { background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 2px 0; }
.date-badge .d { font-size: 22px; font-weight: 800; padding: 2px 0 4px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 20px; padding: 2px 10px; background: var(--teal-soft); color: #06636a; margin-right: 6px; }
.tag-deadline { background: #fdf1dc; color: var(--amber); }
.tag-past { background: #fbeaea; color: var(--red); }
.tag-done { background: #e8f4ec; color: var(--green); }
.done .item-title { text-decoration: line-through; color: var(--muted); }
.case-card { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.case-card:hover { border-color: var(--teal); color: var(--ink); }
.case-card .next { margin-top: 8px; font-size: 14px; color: var(--teal); font-weight: 600; }
dl.facts { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 14px; }
dl.facts dd { margin: 0; }
@media (max-width: 720px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: 6px; } }

/* landing page */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; padding: 30px 0 18px; }
.hero h1 { font-size: 40px; letter-spacing: -.5px; }
.hero .lead { font-size: 19px; color: var(--muted); }
.hero-art { background: linear-gradient(160deg, #ffffff 0%, var(--teal-soft) 100%); border: 1px solid var(--border); border-radius: 20px; padding: 34px; text-align: center; }
.hero-art img { width: 70%; max-width: 260px; }
.feature h3 { color: var(--teal); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 32px; } }

/* guides */
.guide-body h3 { margin-top: 22px; }
.guide-body ul { padding-left: 22px; }
.guide-body li { margin-bottom: 6px; }
.disclaimer { font-size: 14px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 20px; }
.cat { font-size: 13px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .6px; margin: 22px 0 8px; }

/* admin tables */
table.grid-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid-table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); padding: 8px; }
table.grid-table td { border-bottom: 1px solid var(--border); padding: 8px; vertical-align: top; }
.stat { font-size: 30px; font-weight: 800; color: var(--teal); }

/* case pages: header and tabs */
.case-head h1 { margin: 0 0 2px; }
.case-head p { margin: 0 0 4px; }
.case-head .you { margin: 6px 0 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--teal); border-bottom-color: var(--teal); }
.tag-draft { background: #eef1f3; color: var(--muted); }
.date-badge-none .m { background: #9aa7af; }
.section-label { font-size: 13px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .6px; margin: 18px 0 6px; }
.section-label:first-child { margin-top: 0; }

/* discovery */
.rules-box { border-left: 4px solid var(--teal); }
.rules-box.estimate { border-left-color: var(--amber); }
.rules-box ul { margin: 6px 0 0; padding-left: 20px; }
.rules-box li { margin-bottom: 4px; }
.due-big { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.due-big.overdue { color: var(--red); }
.req { border-top: 1px solid var(--border); padding: 14px 0; display: flex; gap: 14px; align-items: flex-start; }
.req:first-child { border-top: 0; padding-top: 4px; }
.req-num { flex: 0 0 34px; font-weight: 800; color: var(--teal); }
.req-body { flex: 1; min-width: 0; }
.req-answer { background: #f7f9fa; border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 15px; }
.req-answer b { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.doc-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.doc-link { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); background: #fff; }
.doc-link:hover { border-color: var(--teal); color: var(--ink); }
.doc-link b { display: block; color: var(--teal); }
.doc-link span { font-size: 13px; color: var(--muted); }
.warn { background: #fdf1dc; color: #7a5208; border: 1px solid #f1d9a8; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* choosing papers and people */
.pick { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--border); border-radius: 10px; max-height: 360px; overflow-y: auto; }
.pick li { border-top: 1px solid var(--border); }
.pick li:first-child { border-top: 0; }
.pick label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; }
.pick label:hover { background: #f7f9fa; }
.pick input { margin-top: 4px; }
.pick .muted { font-size: 13px; }
.sel-col { width: 28px; }
.filters { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 0 12px; align-items: end; }
@media (max-width: 720px) { .filters { grid-template-columns: 1fr; } }
.check > span { display: flex; gap: 8px; align-items: flex-start; }
.check > span input { margin-top: 4px; }
@media (max-width: 720px) {
  .req { flex-wrap: wrap; }
  .req .item-actions { order: 3; flex-basis: 100%; justify-content: flex-start; padding-left: 48px; }
}


/* ================================================================ signed-in pages: next steps, folding sections, phone layout */

.btn-block { display: block; width: 100%; text-align: center; }
.back { display: inline-block; margin-bottom: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.lead-text { font-size: 17px; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; vertical-align: 2px; }
.count-soft { background: var(--teal-soft); color: #06636a; }
.tag-lock { background: #e7eef3; color: #3d5566; }

/* what to do next */
.todo { border-left: 4px solid var(--teal); }
.todo h2 { margin-bottom: 8px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item { display: flex; gap: 12px; align-items: center; padding: 12px 0 12px 16px; border-top: 1px solid var(--border); position: relative; }
.todo-list:first-of-type > .todo-item:first-child { border-top: 0; }
.todo-item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--teal); }
.todo-item.u0::before { background: var(--red); }
.todo-item.u1::before { background: var(--amber); }
.todo-item.u3::before { background: #c9d4d9; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-weight: 700; overflow-wrap: anywhere; }
.todo-detail { font-size: 14px; color: var(--muted); margin-top: 2px; }
.todo-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; max-width: 45%; }
.todo-clear { display: flex; gap: 12px; align-items: center; }
.tick { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #e8f4ec; color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 800; }

/* sections that fold away (details/summary) */
details.fold { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
details.fold > summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 12px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary > .sum-text { flex: 1; min-width: 0; }
details.fold > summary .muted { font-weight: 400; font-size: 14px; }
details.fold > summary::after { content: ""; flex: 0 0 auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.fold > summary:hover { color: var(--teal); }
.fold-body { padding: 0 20px 20px; }
details.inline { margin-top: 6px; }
details.inline > summary { list-style: none; cursor: pointer; color: var(--teal); font-weight: 700; padding: 8px 0; font-size: 15px; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline > summary::before { content: "+"; display: inline-block; width: 18px; font-weight: 800; }
details.inline[open] > summary::before { content: "\2212"; }
.form-box { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 16px; }

/* choosing one of a few (big tap targets) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.choices.three { grid-template-columns: 1fr 1fr 1fr; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; background: #fff; font-size: 15px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0; }
.choice input { margin-top: 4px; accent-color: var(--teal); }
.choice b { display: block; }
.choice .muted { font-size: 13px; display: block; }
.choice:hover { border-color: var(--teal); }
a.choice { text-decoration: none; }
a.choice b { color: var(--teal); }
.choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }

/* getting started */
.steps { list-style: none; padding: 0; margin: 0 0 18px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.steps li::before { content: counter(step); flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps li b { display: block; }

/* the next step on a discovery set */
.next-step { border-left: 4px solid var(--teal); }
.next-step.urgent { border-left-color: var(--red); }
.next-step.soon { border-left-color: var(--amber); }
.next-step h2 { margin-bottom: 6px; }
.next-step .btn-row { margin-top: 12px; }

/* case cards */
.case-card .badges { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.case-card .badges .tag { margin: 0; }
.case-card .you { font-size: 13px; color: var(--muted); }

/* recent activity and history */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 9px 0; border-top: 1px solid var(--border); font-size: 15px; }
.activity li:first-child { border-top: 0; padding-top: 2px; }
.activity .when { display: block; font-size: 13px; color: var(--muted); }

/* message conversations */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.subtabs a { padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; }
.subtabs a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.chat { max-height: 60vh; overflow-y: auto; padding: 4px 2px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-day { align-self: center; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; }
.msg { max-width: 80%; align-self: flex-start; background: #eef2f4; border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: var(--teal-soft); border-radius: 14px 14px 4px 14px; }
.msg-who { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.msg-body { overflow-wrap: anywhere; }
.msg-ref { font-size: 13px; margin-top: 4px; }
.compose { border-top: 1px solid var(--border); padding-top: 14px; }
.compose textarea { min-height: 80px; }

/* invitation links */
.copy-row { display: flex; gap: 8px; margin-top: 8px; }
.copy-link { flex: 1; min-width: 0; font-size: 13px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: #f7f9fa; font-family: inherit; }

/* people on the case */
.person { display: flex; gap: 12px; align-items: center; }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.avatar.other { background: #eef1f3; color: var(--muted); }

@media (max-width: 720px) {
  .wrap { padding: 0 14px; }
  .main { padding-top: 16px; }
  .topbar-in { min-height: 56px; gap: 8px; }
  .brand img { height: 34px; }
  .nav { gap: 14px; }
  .nav a { font-size: 14px; }
  .nav .hide-sm { display: none; }
  .card { padding: 16px; }
  details.fold > summary { padding: 14px 16px; font-size: 16px; }
  .fold-body { padding: 0 16px 16px; }
  .case-head h1, h1 { font-size: 23px; }
  .tabs { margin: 0 -14px 16px; padding: 0 6px; }
  .tabs a { padding: 10px 6px; font-size: 13.5px; flex: 1 0 auto; text-align: center; }
  .tabs .count { min-width: 18px; line-height: 18px; padding: 0 5px; font-size: 11px; }
  .item { flex-wrap: wrap; }
  .item > .item-actions { flex-basis: 100%; justify-content: flex-start; }
  .item > .date-badge ~ .item-actions { padding-left: 72px; }
  .todo-item { flex-wrap: wrap; }
  .todo-act { max-width: none; flex-basis: 100%; justify-content: flex-start; }
  .choices, .choices.three { grid-template-columns: 1fr; }
  .page-head > .btn, .page-head > .btn-row { width: 100%; }
  .page-head > .btn { text-align: center; }
  .msg { max-width: 92%; }
  .filters { gap: 0; }
}
.soon-today { color: var(--red); }
.soon-tomorrow { color: var(--amber); }
