:root {
  --ink:#32252b; --muted:#665a60; --wine:#371726; --wine-dark:#2c131f;
  --paper:#f7f5f2; --surface:#fffdfb; --line:#e6ddd8; --gold:#e5bb96;
  --serif:"Source Serif 4", Georgia, serif; --sans:"IBM Plex Sans", system-ui, sans-serif;
}
* { box-sizing:border-box }
body { margin:0; background:var(--paper); color:var(--ink); font: 16px/1.55 var(--sans); }
a { color:inherit }
button, input, textarea, select { font:inherit }
button { cursor:pointer }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline:3px solid #a94966; outline-offset:3px }
.sr,.skip:not(:focus) { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.skip:focus { position:fixed; z-index:5; top:12px; left:12px; background:white; padding:8px 12px }
.topbar { min-height:83px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 32px; background:var(--wine-dark); color:#fff8ee }
.identity,.toolbar,.mode,.badge,.button,.section-title,.file-label,.case-footer { display:flex; align-items:center }
.identity { gap:22px; min-width:0 }
.identity img { width:104px; height:auto; display:block; flex:none }
.identity-caption { display:grid; gap:2px; min-width:0; border-inline-start:1px solid #856577; padding-inline-start:20px; color:#f2ddd2; font-size:.96rem; line-height:1.35; overflow-wrap:anywhere }
.topbar[data-workspace="staff"] .identity-caption strong { color:#ffe0b8 }
.account-email { color:#e7cfd7; font-size:.85rem }
.toolbar { gap:14px; justify-content:flex-end }
.mode { gap:3px; padding:4px; border-radius:8px; background:#ffffff12 }
.mode button { border:0; color:#f5e8df; background:transparent; border-radius:5px; padding:6px 12px; min-height:36px; font-size:.88rem; white-space:nowrap }
.mode button[aria-pressed="true"] { color:var(--wine-dark); background:#f4e7dd; font-weight:650 }
.mode.language button { min-width:39px; padding-inline:7px }
.layout { display:grid; grid-template-columns:242px minmax(0,1fr); min-height:calc(100vh - 83px) }
.sidebar { border-inline-end:1px solid var(--line); display:flex; flex-direction:column; gap:29px; padding:32px 20px 23px; background:#f1ede9 }
.side-head { padding:0 10px; display:flex; align-items:center; gap:11px }
.avatar { flex:none; display:grid; place-items:center; width:42px; height:42px; border-radius:50%; font-size:.82rem; font-weight:700; background:#e8d8d1; color:var(--wine) }
.side-head strong,.side-head small { display:block }
.side-head strong { font-size:.93rem }
.side-head small { font-size:.8rem; color:var(--muted) }
.sidebar nav { display:grid; gap:4px }
.nav-button { width:100%; min-height:46px; display:flex; align-items:center; gap:12px; text-align:start; border:1px solid transparent; border-radius:7px; padding:9px 12px; background:transparent; color:#594b52; font-size:.94rem }
.nav-button:hover { background:#eae1dc }
.nav-button[aria-current="page"] { background:#e7d9d4; border-color:#dfcec8; color:var(--wine); font-weight:650 }
.nav-button svg,.file-label svg,.icon-button svg,.button svg,.badge svg { flex:none; width:19px; height:19px }
.side-demo { margin-top:auto; padding:16px 10px 0; border-top:1px solid #ded1cc; color:var(--muted); font-size:.83rem }
.side-demo p { margin:4px 0 10px }
.side-demo strong { color:var(--ink) }
.side-demo button,.text-button { border:0; padding:2px 0; background:none; color:#6b2d47; text-decoration:underline; text-underline-offset:3px; text-align:start }
main { width:100%; max-width:1500px; margin:0 auto; padding:30px clamp(24px,4vw,62px) 58px; min-width:0 }
main:focus { outline:none }
.crumb { font-size:.87rem; color:var(--muted); margin:0 0 16px }
.crumb strong { color:var(--ink) }
.hero { position:relative; overflow:hidden; color:#fff7f0; padding:29px clamp(24px,4vw,46px) 28px; background:linear-gradient(107deg,#321623 12%,#482234 100%); border-radius:13px }
.hero:after { position:absolute; content:""; right:1%; top:-106%; border:1px solid #e2b89827; border-radius:50%; width:445px; aspect-ratio:1; box-shadow:0 0 0 37px #e2b8980b,0 0 0 77px #e2b89808; pointer-events:none }
.hero > * { position:relative; z-index:1 }
.hero-meta { color:#f0c9ae; display:flex; align-items:center; flex-wrap:wrap; gap:7px 12px; font-size:.86rem }
.hero h1,.page-head h1 { margin:9px 0 2px; font:normal clamp(2.05rem,4.2vw,3.55rem)/1.11 var(--serif); letter-spacing:-.035em }
.hero-address { color:#efdad1; margin:5px 0 20px }
.case-footer { flex-wrap:wrap; justify-content:space-between; gap:10px 20px; border-top:1px solid #ffffff32; padding-top:17px; color:#f1ded1; font-size:.9rem }
.case-footer strong { color:#fff6ef }
.badge { display:inline-flex; gap:5px; width:fit-content; max-width:100%; padding:4px 9px; border-radius:20px; color:#74421c; background:#f6e7d4; font-size:.78rem; line-height:1.35; font-weight:680 }
.badge.done { color:#285037; background:#e2eee3 }
.badge.review { color:#573c67; background:#ece5f3 }
.badge.neutral { color:#5a4e51; background:#eee8e5 }
.case-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(285px,.9fr); gap:22px; margin-top:22px; align-items:start }
.client-matters { max-width:850px; margin-top:22px }
.stack { display:grid; gap:22px; min-width:0 }
.panel { padding:22px; border:1px solid var(--line); background:var(--surface); border-radius:12px; min-width:0 }
.panel h2 { font:normal clamp(1.45rem,2.25vw,1.9rem)/1.2 var(--serif); letter-spacing:-.02em; margin:0 }
.section-title { justify-content:space-between; flex-wrap:wrap; gap:10px 16px; margin-bottom:16px }
.section-title p,.panel p { margin:5px 0 0; color:var(--muted); overflow-wrap:anywhere }
.list-row { display:flex; align-items:center; justify-content:space-between; gap:12px 16px; padding:14px 0; border-top:1px solid var(--line); min-width:0 }
.file-label { gap:10px; min-width:0; overflow-wrap:anywhere }
.file-label svg { color:#884966 }
.list-row small,.event small,.milestone small,.message small { color:var(--muted); display:block; font-size:.82rem }
.row-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; flex-shrink:0 }
.button { display:inline-flex; gap:7px; justify-content:center; min-height:42px; padding:8px 14px; border:1px solid var(--wine); border-radius:6px; background:var(--wine); color:#fff9f2; font-size:.88rem; font-weight:630; text-decoration:none; text-align:center }
.button:hover { background:#5a2840 }
.button.secondary { color:var(--wine); background:transparent; border-color:#d7c4cc }
.button.secondary:hover { background:#f1e7e9 }
.button svg { width:16px; height:16px }
.timeline { list-style:none; padding:0; margin:0 }
.milestone { position:relative; display:grid; grid-template-columns:28px minmax(0,1fr); gap:10px; padding:0 0 18px; min-height:48px }
.milestone:last-child { padding-bottom:0 }
.milestone:not(:last-child):before { content:""; position:absolute; left:12px; width:1px; background:#d9cac4; top:23px; bottom:-1px }
.marker { position:relative; width:25px; height:25px; display:grid; place-items:center; border-radius:50%; border:1px solid #e0d4cf; color:#7b5870; font-size:.83rem; background:var(--surface) }
.marker.done { color:#335c44; border-color:#d7e4db; background:#edf4ef }
.marker.current { color:white; border-color:var(--wine); background:var(--wine) }
.milestone strong,.file-label strong { font-size:.94rem; font-weight:650 }
.event { padding:12px 0; border-top:1px solid var(--line); overflow-wrap:anywhere }
.event strong { font-size:.94rem }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:21px }
.page-head p { margin:4px 0 0; color:var(--muted) }
.message { margin:0 0 16px; width:min(680px,93%); padding:13px 16px; background:#f0ebe7; border-radius:9px; overflow-wrap:anywhere }
.message.mine { margin-inline-start:auto; background:#f0e4e9 }
.message p { margin:5px 0 0; white-space:pre-wrap; color:var(--ink) }
.compose { margin-top:18px; display:grid; justify-items:start; gap:10px }
.compose textarea { width:100% }
.field { display:grid; gap:5px; font-size:.9rem; font-weight:630 }
input, textarea, select { width:100%; min-width:0; border:1px solid #bfadb4; background:#fff; color:var(--ink); border-radius:6px; padding:9px 11px }
textarea { resize:vertical }
dialog { max-width:min(94vw,500px); width:100%; max-height:90vh; overflow:auto; padding:24px; border:1px solid #ddcfd2; border-radius:12px; color:var(--ink); background:var(--surface); box-shadow:0 25px 55px #2c131f38 }
dialog::backdrop { background:#26141dc2 }
.dialog-form { display:grid; gap:15px }
.dialog-form h2 { margin:0; font:normal 1.75rem/1.18 var(--serif) }
.dialog-form p { margin:0; color:var(--muted) }
.dialog-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:4px }
@media(max-width:1080px) { .layout { grid-template-columns:205px minmax(0,1fr) } .sidebar { padding-inline:14px } .case-grid { grid-template-columns:minmax(0,1fr) } }
@media(max-width:740px) {
  .topbar { padding:10px 15px; gap:10px; flex-wrap:wrap }
  .identity { gap:11px } .identity img { width:84px } .identity-caption { padding-inline-start:11px; font-size:.84rem }
  .toolbar { gap:8px; width:100%; justify-content:space-between }
  .layout { display:block }
  .sidebar { border-inline-end:none; border-bottom:1px solid var(--line); padding:13px 14px; gap:12px }
  .sidebar nav { display:flex; flex-wrap:wrap }
  .nav-button { width:auto; padding:5px 8px; gap:6px; font-size:.85rem; min-height:36px }
  .nav-button svg { width:15px; height:15px }
  .side-head { padding:0 2px }
  .avatar { width:34px; height:34px }
  .side-demo { padding:8px 0 0; display:flex; align-items:baseline; flex-wrap:wrap; justify-content:space-between; gap:5px 12px }
  .side-demo p { display:inline; margin:0 } .side-demo strong { display:none }
  main { padding:20px 14px 36px }
  .hero { border-radius:9px; padding:22px 17px } .hero:after { right:-70%; top:-85% }
  .panel { padding:16px } .case-grid,.stack { gap:14px }
}
@media(max-width:450px) { .list-row { align-items:flex-start; flex-direction:column; gap:7px } .row-actions { flex-shrink:1; justify-content:flex-start } }
[hidden] { display:none!important }
.hero .button { background:#f2e4d8; border-color:#f2e4d8; color:var(--wine) }
.hero .button:hover { background:#fff8f0 }
.toast { position:fixed; z-index:4; right:24px; bottom:24px; max-width:calc(100vw - 48px); padding:12px 17px; border-radius:7px; background:var(--wine); color:#fff8f2; box-shadow:0 7px 20px #3717263d }

/* Signed-in portal and server-rendered forms */
.identity { text-decoration:none }
.mode.language a { min-width:38px; min-height:37px; padding:7px; text-align:center; border-radius:5px; text-decoration:none; color:#f5e8df; font-size:.88rem; }
.mode.language a[aria-current] { background:#f4e7dd; color:var(--wine); font-weight:650 }
.toolbar .button.secondary { color:#fff8ef }
.toolbar .button.secondary:hover { color:var(--wine) }
.portal-main { max-width:1220px }
.signin-main { max-width:555px; margin:clamp(26px,8vh,85px) auto }
.auth-panel { padding:clamp(22px,4vw,44px) }
.auth-panel h1 { margin:0; font:normal 2.2rem/1.2 var(--serif) }
.auth-panel a { display:inline-block; margin-top:13px }
.signin-options { display:flex; flex-wrap:wrap; gap:0 20px; margin-top:14px; padding-top:3px; border-top:1px solid var(--line) }
.portal-form,.upload-form { display:grid; gap:12px; align-items:start }
[data-email-code-fields]:not([hidden]) { display:contents }
.portal-form .button,.upload-form .button { justify-self:start }
.panel > .portal-form,.auth-panel .portal-form { margin-top:17px }
.banner { margin:0 0 16px; padding:12px 14px; border:1px solid #d7ddd0; border-radius:6px; background:#e8efe4 }
.banner.error { background:#f7e7e7; border-color:#dfc2c8 }
.request-card { padding:16px 0; border-top:1px solid var(--line); overflow-wrap:anywhere }
.request-title,.doc-row,.review-actions,.person-row { display:flex; gap:10px; justify-content:space-between; align-items:center; flex-wrap:wrap }
.doc-row,.upload-form,.review-actions { margin-top:13px }
.review-actions { justify-content:flex-start }
.person-row { border-top:1px solid var(--line); padding:13px 0 }
.request-card small,.person-row small,.doc-row small { display:block; color:var(--muted) }
.matter-link { color:var(--wine); font-weight:650; text-underline-offset:4px }
.file-picker { display:flex; align-items:center; flex-wrap:wrap; gap:7px 12px; cursor:pointer }
.file-picker-label { padding:7px 12px; border:1px solid #bfadb4; border-radius:6px; font-weight:650 }
.file-picker:focus-within .file-picker-label { outline:3px solid #a94966; outline-offset:3px }
.file-picker [data-filename] { color:var(--muted); overflow-wrap:anywhere; min-width:0 }
.request-card details { margin-top:12px }
.hero-address { overflow-wrap:anywhere }
@media(max-width:740px) { .toolbar { width:auto; margin-inline-start:auto } .portal-main .case-grid { grid-template-columns:1fr } }
