:root {
  --accent: #76558f;
  --accent-dark: #53376a;
  --accent-deep: #392348;
  --accent-soft: #eee8f3;
  --accent-pale: #f7f3f9;
  --ink: #1f2933;
  --muted: #66737f;
  --surface: #fff;
  --background: #f4f6f8;
  --border: #dce2e7;
  --field-border: #abb6bf;
  --danger: #a92d2d;
  --danger-soft: #fff0ef;
  --success: #247044;
  --success-soft: #e8f4ec;
  --warning: #7a4b00;
  --warning-soft: #fff5df;
  --touch-target: 2.75rem;
  --page-inline: 1rem;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
html { min-height: 100%; background: var(--background); }
body { min-height: 100vh; min-height: 100dvh; margin: 0; padding-bottom: 5rem; background: var(--background); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1 { margin: .1rem 0 .5rem; font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.15rem); line-height: 1.08; letter-spacing: -.025em; }
h2 { margin: .25rem 0 .5rem; font-size: 1.08rem; line-height: 1.2; }
h3 { margin: .2rem 0 .4rem; font-size: 1rem; }
p { line-height: 1.45; }
.skip-link { position: fixed; z-index: 2000; top: -5rem; left: 1rem; border-radius: .5rem; background: white; padding: .75rem 1rem; }
.skip-link:focus { top: .75rem; }
.offline-banner { position: sticky; z-index: 1200; top: 0; background: var(--warning); padding: .45rem 1rem; color: white; font-size: .8rem; font-weight: 800; text-align: center; }
.eyebrow { color: var(--accent-dark); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.lead, .field-help { color: var(--muted); }
.lead { margin: .3rem 0 0; }

.app-header { position: sticky; z-index: 1000; top: 0; display: flex; min-height: 3.8rem; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); padding: .5rem max(var(--page-inline), env(safe-area-inset-right)) .5rem max(var(--page-inline), env(safe-area-inset-left)); backdrop-filter: blur(10px); }
.brand { display: inline-flex; min-width: 0; min-height: var(--touch-target); align-items: center; gap: .65rem; color: var(--ink); font-size: 1.12rem; font-weight: 850; text-decoration: none; }
.brand img { width: 38px; height: 38px; flex: 0 0 auto; border-radius: .65rem; }
.header-actions { display: flex; min-width: 0; align-items: center; gap: .2rem; }
.header-actions form { margin: 0; }
.workspace-badge { display: none; max-width: 16rem; overflow: hidden; border-radius: 999px; background: var(--accent-soft); padding: .35rem .65rem; color: var(--accent-dark); font-size: .74rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.link-button, .text-action { appearance: none; min-height: var(--touch-target); border: 0; background: transparent; padding: .45rem .55rem; color: var(--accent-dark); font-weight: 800; cursor: pointer; }
.text-action { display: inline-flex; min-height: var(--touch-target); align-items: center; padding: .25rem 0; text-decoration: underline; text-underline-offset: .18rem; }

.bottom-nav { position: fixed; z-index: 1100; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; border-top: 1px solid var(--border); background: white; padding: .3rem max(.5rem, env(safe-area-inset-right)) max(.3rem, env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left)); box-shadow: 0 -4px 18px rgba(0,0,0,.06); }
.bottom-nav a { display: flex; min-width: 0; min-height: var(--touch-target); flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: .08rem; padding: .2rem; color: #48545e; font-size: .68rem; font-weight: 750; text-decoration: none; }
.bottom-nav a span { color: var(--accent); font-size: 1.16rem; line-height: 1; }

.page-shell { width: min(100%, 68rem); min-width: 0; max-width: 100%; margin: 0 auto; padding: .9rem var(--page-inline) 1.5rem; }
.page-shell > * { min-width: 0; max-width: 100%; }
.hero, .page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .95rem; }
.hero > div, .page-heading > div { min-width: 0; }
.hero-action { flex: 0 0 auto; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .7rem; color: var(--muted); font-size: .78rem; }
.breadcrumbs a { color: var(--accent-dark); font-weight: 800; text-decoration: none; }
.workspace-section { margin-bottom: 1rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.section-heading h2 { margin-bottom: 0; }

.button { display: inline-flex; min-height: var(--touch-target); align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .7rem; padding: .62rem .9rem; font-weight: 820; line-height: 1.15; text-align: center; text-decoration: none; cursor: pointer; }
.button.primary { border-color: var(--accent-dark); background: var(--accent-dark); color: white; box-shadow: 0 4px 12px rgba(83,55,106,.15); }
.button.secondary { border-color: var(--border); background: white; color: var(--accent-dark); }
.button.small { min-height: 2.25rem; padding: .4rem .65rem; font-size: .78rem; }
.button.full { width: 100%; }
.button:hover { filter: brightness(.97); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(118,85,143,.25); outline-offset: 2px; }

.message-stack { display: grid; gap: .5rem; margin-bottom: .8rem; }
.alert { border: 1px solid #bbd8c5; border-radius: .75rem; background: var(--success-soft); padding: .72rem .85rem; color: #185531; font-weight: 700; }
.alert-error { border-color: #ecc2bf; background: var(--danger-soft); color: #7f2020; }
.errorlist { margin: .25rem 0 0; padding: 0; color: var(--danger); font-size: .78rem; font-weight: 750; list-style: none; }

.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); overflow: hidden; margin-bottom: 1.1rem; border: 1px solid var(--border); border-radius: 1rem; background: white; box-shadow: 0 4px 16px rgba(31,41,51,.04); }
.summary-strip > div { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; padding: .75rem .5rem; text-align: center; }
.summary-strip > div + div { border-left: 1px solid var(--border); }
.summary-strip strong { color: var(--accent-dark); font-size: 1.35rem; line-height: 1; }
.summary-strip span { margin-top: .25rem; color: var(--muted); font-size: .72rem; }
.summary-strip .summary-attention { background: var(--warning-soft); }
.summary-strip .summary-attention strong { color: var(--warning); }

.compact-filter { display: flex; align-items: center; gap: .55rem; margin-bottom: .65rem; border: 1px solid var(--border); border-radius: .85rem; background: white; padding: .45rem .55rem; }
.compact-filter label { padding-left: .25rem; color: var(--muted); font-size: .78rem; font-weight: 800; }
.compact-filter select { min-width: 0; min-height: var(--touch-target); flex: 1 1 13rem; border: 1px solid var(--field-border); border-radius: .6rem; background: white; padding: .45rem .65rem; }
.compact-filter > a { color: var(--accent-dark); font-size: .78rem; font-weight: 800; white-space: nowrap; }

.case-list { overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: white; box-shadow: 0 5px 20px rgba(31,41,51,.04); }
.case-row { display: grid; min-height: 4.65rem; grid-template-columns: 2.3rem minmax(0,1fr) auto .7rem; align-items: center; gap: .7rem; padding: .62rem .75rem; text-decoration: none; }
.case-row + .case-row { border-top: 1px solid var(--border); }
.case-row:hover { background: var(--accent-pale); }
.case-symbol { display: grid; width: 2.3rem; height: 2.3rem; place-items: center; border-radius: .7rem; background: var(--accent-soft); color: var(--accent-dark); font-size: 1rem; font-weight: 900; }
.case-symbol.electrical { background: #edf0f8; color: #4f5c8f; }
.case-main, .case-state { display: flex; min-width: 0; flex-direction: column; gap: .18rem; }
.case-line { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: .25rem .55rem; }
.case-line strong { overflow: hidden; text-overflow: ellipsis; }
.case-line small, .case-main > small, .case-state small { color: var(--muted); font-size: .72rem; }
.case-state { align-items: flex-end; text-align: right; }
.case-arrow { color: var(--accent); font-size: 1.3rem; }
.action-flag { color: var(--warning); font-size: .68rem; font-weight: 850; }
.status { display: inline-flex; width: fit-content; min-height: 1.55rem; align-items: center; border-radius: 999px; background: #edf0f2; padding: .22rem .55rem; color: #52606b; font-size: .68rem; font-weight: 850; white-space: nowrap; }
.status-received { background: var(--accent-soft); color: var(--accent-dark); }
.status-under_review { background: #eceafa; color: #544a8a; }
.status-waiting_client { background: var(--warning-soft); color: var(--warning); }
.status-delivered { background: var(--success-soft); color: var(--success); }
.status-closed { background: #edf0f2; color: #59636d; }
.pagination { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .8rem; color: var(--muted); font-size: .8rem; }

.empty-state { display: grid; place-items: center; padding: 2.2rem 1rem; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; width: 2.4rem; height: 2.4rem; place-items: center; margin-bottom: .45rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 1.2rem; }
.empty-state strong { color: var(--ink); }
.empty-state p { max-width: 28rem; margin: .25rem 0 0; font-size: .82rem; }
.empty-state.compact { padding: 1.3rem .7rem; }

.model-form, .panel { border: 1px solid var(--border); border-radius: 1rem; background: white; box-shadow: 0 5px 20px rgba(31,41,51,.04); }
.model-form { overflow: hidden; }
.form-section { display: grid; grid-template-columns: 2.35rem minmax(0,1fr); gap: .8rem; padding: 1rem; }
.form-section + .form-section { border-top: 1px solid var(--border); }
.step-number { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; border-radius: .7rem; background: var(--accent-dark); color: white; font-weight: 900; }
.form-section-body > h2 { margin-top: .2rem; }
.form-section-body > p { margin: 0 0 .85rem; color: var(--muted); font-size: .86rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.field-wide { grid-column: 1 / -1; }
.field { display: grid; min-width: 0; gap: .32rem; margin-top: .72rem; }
.field:first-child { margin-top: 0; }
.field label, .inline-form label, .internal-strip label { color: #3a4751; font-size: .8rem; font-weight: 820; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select, textarea { width: 100%; max-width: 100%; min-height: var(--touch-target); border: 1px solid var(--field-border); border-radius: .68rem; background: white; padding: .65rem .72rem; color: var(--ink); }
textarea { resize: vertical; }
input[type="file"] { min-height: 3rem; padding: .55rem; background: #fafbfc; }
.field-help { display: block; font-size: .74rem; line-height: 1.4; }
.service-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.service-option { display: grid; min-height: 7rem; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: .65rem; border: 1px solid var(--field-border); border-radius: .85rem; background: white; padding: .85rem; cursor: pointer; }
.service-option:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); box-shadow: 0 0 0 2px rgba(118,85,143,.13); }
.service-option input { width: 1.1rem; height: 1.1rem; margin: .08rem 0 0; accent-color: var(--accent); }
.service-option span { display: flex; min-width: 0; flex-direction: column; gap: .35rem; }
.service-option small { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.file-drop { display: grid; min-height: 7.5rem; place-items: center; border: 1px dashed #8ea5b5; border-radius: .85rem; background: var(--accent-pale); padding: 1rem; text-align: center; }
.file-drop > label { color: var(--accent-dark); font-weight: 850; }
.file-drop input { max-width: 32rem; }
.file-drop small { color: var(--muted); font-size: .75rem; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; border-top: 1px solid var(--border); background: #fafbfc; padding: .8rem 1rem; }
.form-actions.compact { border: 0; background: transparent; padding: .5rem 0 0; }

.case-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.case-header h1 { margin-bottom: .55rem; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; color: var(--muted); font-size: .78rem; }
.reference { border-radius: 999px; background: var(--accent-soft); padding: .25rem .55rem; color: var(--accent-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 850; }
.case-summary { margin: 0 0 .9rem; border-left: 3px solid var(--accent); padding: .2rem 0 .2rem .75rem; color: #45535e; }
.next-action { display: grid; grid-template-columns: 2.65rem minmax(0,1fr) auto; align-items: center; gap: .8rem; margin-bottom: .9rem; border: 1px solid var(--border); border-radius: 1rem; background: white; padding: .8rem .9rem; box-shadow: 0 4px 16px rgba(31,41,51,.04); }
.next-action.attention { border-color: #e7d4a5; background: var(--warning-soft); }
.next-action.delivered { border-color: #bbd8c5; background: var(--success-soft); }
.next-action-icon { display: grid; width: 2.65rem; height: 2.65rem; place-items: center; border-radius: .8rem; background: var(--accent-soft); color: var(--accent-dark); font-weight: 950; }
.attention .next-action-icon { background: #f2d996; color: #684100; }
.delivered .next-action-icon { background: #cbe8d4; color: var(--success); }
.next-action strong { display: block; margin-top: .12rem; }
.next-action p { margin: .15rem 0 0; color: var(--muted); font-size: .78rem; }
.next-action > a { color: var(--accent-dark); font-size: .78rem; font-weight: 850; white-space: nowrap; }

.internal-strip { display: grid; grid-template-columns: minmax(0,1fr) minmax(18rem,.8fr); gap: 1rem; margin-bottom: .9rem; border: 1px dashed #9db0be; border-radius: .85rem; background: #edf3f6; padding: .7rem .8rem; }
.internal-strip > div { display: flex; min-width: 0; flex-direction: column; gap: .1rem; }
.internal-strip small, .internal-strip a { color: var(--muted); font-size: .72rem; }
.inline-controls { display: flex; gap: .45rem; }
.inline-controls select { min-width: 0; min-height: var(--touch-target); padding: .35rem .55rem; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(18rem,.85fr); align-items: start; gap: .9rem; }
.detail-primary, .detail-secondary { min-width: 0; }
.panel { padding: .9rem; }

.inline-form { margin: .65rem 0; border: 1px solid #c9d6df; border-radius: .78rem; background: var(--accent-pale); }
.inline-form > summary { display: flex; min-height: var(--touch-target); align-items: center; padding: .55rem .75rem; color: var(--accent-dark); font-size: .8rem; font-weight: 850; cursor: pointer; }
.inline-form[open] > summary { border-bottom: 1px solid #c9d6df; }
.inline-form > form { padding: .75rem; }
.inline-form .field { margin-top: 0; }
.request-list { display: grid; gap: .55rem; }
.request-item { overflow: hidden; border: 1px solid var(--border); border-radius: .82rem; background: white; }
.request-item.status-request-pending { border-left: 4px solid #bf7c10; }
.request-item.status-request-answered { border-left: 4px solid var(--accent); }
.request-topline { display: grid; grid-template-columns: 2rem minmax(0,1fr) auto; align-items: start; gap: .55rem; padding: .7rem; }
.request-topline > div { display: flex; min-width: 0; flex-direction: column; gap: .2rem; }
.request-topline small { color: var(--muted); font-size: .7rem; }
.request-mark { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .62rem; background: var(--warning-soft); color: var(--warning); font-weight: 950; }
.status-request-answered .request-mark { background: var(--accent-soft); color: var(--accent-dark); }
.request-status { border-radius: 999px; background: #eef1f3; padding: .22rem .45rem; color: var(--muted); font-size: .65rem; font-weight: 850; white-space: nowrap; }
.response-copy { margin: 0 .7rem .65rem 3.25rem; border-radius: .6rem; background: #f4f6f8; padding: .55rem .65rem; }
.response-copy small { color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.response-copy p { margin: .15rem 0 0; font-size: .8rem; }
.request-files { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 .7rem .65rem 3.25rem; }
.request-files a { color: var(--accent-dark); font-size: .72rem; font-weight: 750; }
.response-form { margin: 0 .7rem .7rem 3.25rem; }
.request-review { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .45rem; border-top: 1px solid var(--border); background: #fafbfc; padding: .5rem .65rem; }
.all-clear { display: flex; align-items: center; gap: .65rem; border-radius: .75rem; background: var(--success-soft); padding: .75rem; }
.all-clear > span { display: grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--success); color: white; font-weight: 900; }
.all-clear > div { display: flex; flex-direction: column; gap: .12rem; }
.all-clear small { color: var(--muted); font-size: .72rem; }
.resolved-requests, .previous-versions { margin-top: .65rem; border-top: 1px solid var(--border); padding-top: .6rem; color: var(--muted); font-size: .75rem; }
.resolved-requests summary, .previous-versions summary { color: var(--accent-dark); font-weight: 800; cursor: pointer; }
.resolved-requests > div, .previous-versions > a { display: flex; flex-direction: column; gap: .15rem; margin-top: .45rem; padding-left: .4rem; }
.previous-versions > a { color: var(--accent-dark); }

.document-list { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: .8rem; }
.document-row { display: grid; min-width: 0; grid-template-columns: 2.15rem minmax(0,1fr) auto; align-items: center; gap: .55rem; min-height: 3.55rem; padding: .55rem .65rem; text-decoration: none; }
.document-row + .document-row { border-top: 1px solid var(--border); }
.document-row:hover { background: var(--accent-pale); }
.document-row > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: .15rem; }
.document-row strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.document-row small { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.document-icon { display: grid; width: 2.15rem; height: 2.15rem; place-items: center; border-radius: .62rem; background: var(--success-soft); color: var(--success); font-weight: 900; }
.document-icon.muted-icon { background: var(--accent-soft); color: var(--accent-dark); }
.download-label { color: var(--accent-dark); font-size: .72rem; font-weight: 850; }
.source-list .document-row { grid-template-columns: 2.15rem minmax(0,1fr); }
.timeline-panel h2 { margin-bottom: .7rem; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: .8rem minmax(0,1fr); gap: .55rem; min-height: 3.15rem; }
.timeline li::before { position: absolute; top: .7rem; bottom: -.2rem; left: .335rem; width: 1px; background: #cbd5dc; content: ""; }
.timeline li:last-child::before { display: none; }
.timeline li > span { position: relative; z-index: 1; width: .72rem; height: .72rem; margin-top: .22rem; border: 2px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px #afc2cf; }
.timeline li > div { display: flex; min-width: 0; flex-direction: column; gap: .14rem; padding-bottom: .65rem; }
.timeline strong { font-size: .76rem; }
.timeline small { color: var(--muted); font-size: .66rem; }

/* El expediente es una carpeta, no un panel operativo. */
.simple-case-header, .staff-tools, .case-sheet, .history-disclosure { width: min(100%,56rem); margin-right: auto; margin-left: auto; }
.simple-case-header { margin-bottom: .85rem; }
.simple-case-header .case-summary { max-width: 48rem; margin: .75rem 0 0; }
.case-sheet { overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: white; box-shadow: 0 5px 20px rgba(31,41,51,.04); }
.case-section { padding: 1rem; }
.case-section + .case-section { border-top: 1px solid var(--border); }
.case-section .section-heading { align-items: center; margin-bottom: .65rem; }
.case-section .section-heading h2 { margin-top: .22rem; }
.section-empty { margin: .1rem 0 0; color: var(--muted); font-size: .8rem; }
.staff-tools { margin-bottom: .7rem; border: 1px dashed #9db0be; border-radius: .8rem; background: #edf3f6; }
.staff-tools > summary { display: flex; min-height: var(--touch-target); align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .75rem; color: var(--accent-dark); font-size: .78rem; font-weight: 850; cursor: pointer; }
.staff-tools > summary span { overflow: hidden; color: var(--muted); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.staff-tools-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(18rem,.8fr); gap: 1rem; border-top: 1px dashed #9db0be; padding: .7rem .8rem; }
.staff-contact { display: flex; min-width: 0; flex-direction: column; gap: .1rem; }
.staff-contact small, .staff-contact a { color: var(--muted); font-size: .72rem; }
.compact-requests { gap: .45rem; }
.request-compact { border: 1px solid var(--border); border-left: 4px solid #bf7c10; border-radius: .75rem; background: white; padding: .7rem .75rem; }
.request-compact.status-request-answered { border-left-color: var(--accent); }
.request-copy { display: flex; min-width: 0; flex-direction: column; gap: .18rem; }
.request-copy strong { line-height: 1.35; }
.request-copy small { color: var(--muted); font-size: .7rem; }
.response-inline { margin: .55rem 0 0; border-radius: .55rem; background: #f4f6f8; padding: .5rem .6rem; font-size: .78rem; }
.response-inline span { color: var(--muted); font-size: .67rem; font-weight: 850; text-transform: uppercase; }
.compact-files { margin: .5rem 0 0; }
.compact-response-form { margin: .6rem 0 0; }
.compact-review { margin: .65rem -.75rem -.7rem; }
.history-disclosure { margin-top: .7rem; border: 1px solid var(--border); border-radius: .8rem; background: rgba(255,255,255,.7); }
.history-disclosure > summary { min-height: var(--touch-target); padding: .7rem .8rem; color: var(--accent-dark); font-size: .78rem; font-weight: 850; cursor: pointer; }
.history-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.history-disclosure .timeline { padding: .8rem .85rem .3rem; }

body.auth-page { padding-bottom: 0; background: #edf1f3; }
.auth-page .offline-banner { position: fixed; right: 0; left: 0; }
.auth-shell { position: relative; display: grid; width: 100%; min-height: 100vh; min-height: 100dvh; place-items: center; overflow: hidden; padding: clamp(1rem,3vw,2rem); isolation: isolate; }
.auth-shell::before, .auth-shell::after { position: absolute; z-index: -1; width: min(35rem,54vw); aspect-ratio: 1; border-radius: 50%; content: ""; }
.auth-shell::before { top: -24%; right: -13%; background: rgba(118,85,143,.11); }
.auth-shell::after { bottom: -35%; left: -16%; background: rgba(37,62,80,.08); }
.auth-layout { display: grid; width: min(100%,70rem); min-height: min(42rem,calc(100dvh - 2rem)); grid-template-columns: minmax(22rem,.95fr) minmax(24rem,1.05fr); overflow: hidden; border: 1px solid rgba(62,76,87,.12); border-radius: 1.5rem; background: white; box-shadow: 0 28px 75px rgba(31,41,51,.18); }
.auth-brand-panel { position: relative; display: flex; min-width: 0; flex-direction: column; overflow: hidden; padding: clamp(1.6rem,3.5vw,3.25rem); color: white; background: radial-gradient(circle at 15% 15%,rgba(255,255,255,.16),transparent 28%),linear-gradient(145deg,#9674ac 0%,#76558f 50%,#53376a 100%); }
.auth-brand-lockup { position: relative; z-index: 2; display: flex; align-items: center; gap: .85rem; }
.auth-brand-lockup img { width: 3.15rem; height: 3.15rem; border: 2px solid rgba(255,255,255,.68); border-radius: .9rem; box-shadow: 0 7px 20px rgba(8,46,70,.25); }
.auth-brand-lockup > span { display: flex; flex-direction: column; line-height: 1.1; }
.auth-product-name strong { font-size: 1.38rem; letter-spacing: -.02em; }
.auth-product-name span { margin-top: .18rem; color: rgba(255,255,255,.78); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.auth-brand-copy { position: relative; z-index: 2; max-width: 28rem; margin: auto 0; padding-bottom: 5.5rem; }
.auth-brand-copy .eyebrow { color: #d7edf8; }
.auth-brand-copy h1 { margin: .65rem 0 .9rem; color: white; font-size: clamp(2.2rem,3.2vw,3.35rem); line-height: 1.02; letter-spacing: -.045em; }
.auth-brand-copy p { max-width: 25rem; margin: 0; color: rgba(255,255,255,.83); line-height: 1.55; }
.auth-brand-visual { display: block; flex-shrink: 0; width: calc(100% + 2 * clamp(1.6rem, 3.5vw, 3.25rem)); max-width: none; height: auto; margin: auto calc(0px - clamp(1.6rem, 3.5vw, 3.25rem)) 0; object-fit: contain; pointer-events: none; }
.auth-brand-pulse { position: absolute; z-index: 2; top: calc(clamp(1.6rem,3.5vw,3.25rem) + .75rem); right: clamp(1.6rem,3.5vw,3.25rem); display: block; width: min(36%,10rem); height: auto; overflow: visible; color: #f6effa; opacity: .82; pointer-events: none; }
.auth-brand-pulse path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.auth-form-panel { display: grid; min-width: 0; place-items: center; padding: clamp(2rem,5vw,4.5rem); background: linear-gradient(rgba(255,255,255,.96),rgba(255,255,255,.96)),repeating-linear-gradient(135deg,#edf1f3 0 1px,transparent 1px 14px); }
.auth-form-inner { width: min(100%,25rem); }
.auth-form-heading { margin-bottom: 1.65rem; }
.auth-form-heading h2 { margin: .45rem 0 .55rem; font-size: clamp(2rem,2.8vw,2.65rem); }
.auth-form-heading p { margin: 0; color: var(--muted); }
.stacked-form { display: grid; gap: .9rem; }
.stacked-form .field { margin: 0; }
.password-field { position: relative; }
.password-field input { padding-right: 5.4rem; }
.password-toggle { position: absolute; top: 50%; right: .3rem; min-width: 4.7rem; min-height: var(--touch-target); transform: translateY(-50%); border: 0; border-radius: .55rem; background: transparent; color: var(--accent-dark); font-size: .76rem; font-weight: 850; cursor: pointer; }
.auth-submit { min-height: 3.15rem; margin-top: .25rem; }
.auth-help { margin: 1.3rem 0 0; border-top: 1px solid var(--border); padding-top: 1rem; color: var(--muted); font-size: .75rem; line-height: 1.45; text-align: center; }
.auth-help a { color: var(--accent-dark); font-weight: 800; }
.auth-install-button { display: block; min-height: var(--touch-target); margin: .5rem auto 0; border: 0; background: transparent; color: var(--accent-dark); font-size: .78rem; font-weight: 850; text-decoration: underline; text-underline-offset: .18rem; cursor: pointer; }
.auth-install-button[hidden] { display: none; }
.auth-install-help { max-width: 22rem; margin: .25rem auto 0; color: var(--muted); font-size: .68rem; line-height: 1.35; text-align: center; }

.offline-page { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 1rem; }
.offline-shell { display: grid; width: min(100%,32rem); place-items: center; border: 1px solid var(--border); border-radius: 1.2rem; background: white; padding: clamp(1.4rem,5vw,2.5rem); box-shadow: 0 18px 45px rgba(31,41,51,.12); text-align: center; }
.offline-shell img { margin-bottom: .8rem; border-radius: .85rem; }
.offline-shell h1 { margin-top: .45rem; }
.offline-shell p { margin: 0 0 1rem; color: var(--muted); }

@media (min-width: 701px) {
  .auth-brand-panel { padding-bottom: 0; }
  .auth-brand-copy { margin: 1.75rem 0 1.5rem; padding-bottom: 0; }
  .auth-brand-pulse { width: min(25%,8rem); }
}

@media (min-width: 760px) {
  body { padding-bottom: 1rem; }
  .app-header { position: static; }
  .workspace-badge { display: inline-flex; }
  .bottom-nav { position: static; justify-content: center; gap: 2rem; box-shadow: none; }
  .bottom-nav a { min-width: 6rem; flex: 0 0 auto; flex-direction: row; gap: .32rem; font-size: .88rem; }
  .bottom-nav a span { font-size: 1.05rem; }
}

@media (max-width: 820px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-secondary { display: contents; }
  .detail-secondary .workspace-section:first-child { order: 1; }
  .detail-primary { order: 0; }
  .timeline-panel { order: 2; }
}

@media (max-width: 700px) {
  .button.small { min-height: var(--touch-target); }
  .hero { align-items: stretch; flex-direction: column; }
  .hero-action { width: 100%; }
  .case-row { grid-template-columns: 2.15rem minmax(0,1fr) .65rem; gap: .55rem; }
  .case-symbol { width: 2.15rem; height: 2.15rem; }
  .case-state { grid-column: 2; grid-row: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; text-align: left; }
  .case-state small { margin-left: auto; }
  .case-arrow { grid-column: 3; grid-row: 1 / 3; }
  .compact-filter { align-items: stretch; flex-wrap: wrap; }
  .compact-filter label { display: flex; align-items: center; }
  .compact-filter select { flex-basis: calc(100% - 4rem); }
  .compact-filter .button { flex: 1 1 auto; }
  .service-options, .form-grid { grid-template-columns: 1fr; }
  .next-action { grid-template-columns: 2.4rem minmax(0,1fr); }
  .next-action-icon { width: 2.4rem; height: 2.4rem; }
  .next-action > a { grid-column: 2; }
  .internal-strip { grid-template-columns: 1fr; }
  .request-topline { grid-template-columns: 2rem minmax(0,1fr); }
  .request-status { grid-column: 2; width: fit-content; }
  .response-copy, .request-files, .response-form { margin-left: .7rem; }
  .download-label { display: none; }
  .document-row { grid-template-columns: 2.15rem minmax(0,1fr); }
  .staff-tools-body { grid-template-columns: 1fr; }
  .case-section { padding: .85rem; }
  .auth-shell { align-items: center; overflow: auto; padding: .7rem; }
  .auth-layout { width: min(100%,32rem); min-height: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr; margin: auto; border-radius: 1.2rem; }
  .auth-brand-panel { min-height: 16rem; padding: 1.15rem 1.25rem; }
  .auth-brand-lockup img { width: 2.45rem; height: 2.45rem; }
  .auth-product-name strong { font-size: 1.14rem; }
  .auth-product-name span { font-size: .69rem; }
  .auth-brand-copy { margin: 1.2rem 0 0; padding-bottom: 0; }
  .auth-brand-copy h1 { margin: .35rem 0 .4rem; font-size: 1.75rem; }
  .auth-brand-copy p { max-width: 19rem; font-size: .83rem; }
  .auth-brand-visual { display: none; }
  .auth-brand-pulse { top: 1.45rem; right: 1.25rem; width: min(36%,8.5rem); }
  .auth-form-panel { align-items: start; padding: 1.4rem 1.25rem 1.5rem; }
  .auth-form-heading { margin-bottom: 1.1rem; }
  .auth-form-heading h2 { margin: .3rem 0 .35rem; font-size: 1.72rem; }
}

@media (orientation: portrait) and (max-width: 700px) and (max-height: 760px) {
  .auth-shell { padding: .35rem; }
  .auth-layout { border-radius: 1rem; }
  .auth-brand-panel { min-height: clamp(12.25rem,calc(9.5rem + 9dvh),14rem); padding: .75rem 1rem; }
  .auth-brand-lockup { gap: .5rem; }
  .auth-brand-lockup img { width: 2rem; height: 2rem; border-radius: .6rem; }
  .auth-product-name strong { font-size: .98rem; }
  .auth-product-name span { margin-top: .1rem; font-size: .59rem; }
  .auth-brand-copy { margin-top: .5rem; }
  .auth-brand-copy .eyebrow, .auth-form-heading .eyebrow { font-size: .62rem; }
  .auth-brand-copy h1 { margin: .22rem 0 .28rem; font-size: 1.38rem; line-height: .98; }
  .auth-brand-copy p { font-size: .73rem; line-height: 1.3; }
  .auth-brand-pulse { top: 1rem; right: 1rem; width: min(35%,7rem); }
  .auth-form-panel { padding: .75rem 1rem .8rem; }
  .auth-form-heading { margin-bottom: .55rem; }
  .auth-form-heading h2 { margin: .18rem 0 .22rem; font-size: 1.42rem; }
  .auth-form-heading p { font-size: .75rem; line-height: 1.3; }
  .stacked-form { gap: .4rem; }
  .stacked-form .field { gap: .18rem; }
  .auth-submit { min-height: var(--touch-target); margin-top: 0; }
  .auth-help { margin-top: .5rem; padding-top: .45rem; font-size: .66rem; }
  .auth-install-button { margin-top: .05rem; font-size: .68rem; }
}

@media (max-width: 430px) {
  .summary-strip span { font-size: .66rem; }
  .form-section { grid-template-columns: 1fr; }
  .step-number { width: 1.9rem; height: 1.9rem; border-radius: .6rem; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .pagination { align-items: stretch; flex-direction: column; text-align: center; }
}

@media (orientation: landscape) and (max-height: 540px) and (max-width: 960px) {
  :root { --page-inline: .75rem; }
  body { padding-bottom: calc(3.25rem + env(safe-area-inset-bottom)); }
  .app-header { position: sticky; min-height: 3.1rem; padding-top: .3rem; padding-bottom: .3rem; }
  .brand { font-size: .95rem; }
  .brand img { width: 30px; height: 30px; border-radius: .55rem; }
  .workspace-badge { display: none; }
  .bottom-nav { position: fixed; padding: .15rem max(.35rem,env(safe-area-inset-right)) max(.15rem,env(safe-area-inset-bottom)) max(.35rem,env(safe-area-inset-left)); }
  .bottom-nav a { flex: 1 1 0; flex-direction: row; gap: .25rem; font-size: .72rem; }
  .button.small { min-height: var(--touch-target); }
  .page-shell { padding-top: .55rem; }
  .hero, .page-heading { align-items: center; flex-direction: row; margin-bottom: .55rem; }
  .hero-action { width: auto; }
  h1 { font-size: 1.45rem; }
  .summary-strip { margin-bottom: .65rem; }
  .case-row { min-height: 3.9rem; }
  .auth-shell { padding: .35rem; }
  .auth-layout { width: min(100%,52rem); min-height: calc(100dvh - .7rem); grid-template-columns: minmax(18rem,.9fr) minmax(20rem,1.1fr); grid-template-rows: 1fr; border-radius: 1rem; }
  .auth-brand-panel { min-height: 0; padding: 1rem 1.25rem; }
  .auth-product-name strong { font-size: 1rem; }
  .auth-product-name span { margin-top: .1rem; font-size: .59rem; }
  .auth-brand-copy { margin: auto 0; padding-bottom: 3.5rem; }
  .auth-brand-copy h1 { font-size: 1.65rem; }
  .auth-brand-copy p { font-size: .75rem; }
  .auth-brand-visual { display: none; }
  .auth-brand-pulse { top: auto; right: auto; bottom: .7rem; left: 1.15rem; width: min(46%,9.5rem); }
  .auth-form-panel { align-items: center; padding: .8rem 1.25rem; }
  .auth-form-heading { margin-bottom: .55rem; }
  .auth-form-heading h2 { font-size: 1.45rem; }
  .stacked-form { gap: .4rem; }
  .auth-help { margin-top: .5rem; padding-top: .45rem; }
  .auth-install-button { margin-top: .05rem; font-size: .68rem; }
  .service-options, .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .case-section { padding: .75rem; }
}
