:root {
  --client-ink: #171511;
  --client-muted: #6d6559;
  --client-paper: #f4efe6;
  --client-card: #fffdf9;
  --client-line: #ded4c5;
  --client-gold: #b8892f;
  --client-gold-dark: #7e5b1f;
  --client-forest: #173a31;
  --client-danger: #9d3e35;
  --client-shadow: 0 22px 60px rgba(52, 42, 26, .1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { max-width: 100%; overflow-x: hidden; background: var(--client-paper); color: var(--client-ink); }
body { max-width: 100%; overflow-x: hidden; margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at 85% 0, rgba(184, 137, 47, .11), transparent 30rem), var(--client-paper); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #246caa; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 100; padding: .7rem 1rem; background: #fff; border-radius: .5rem; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.client-login { min-width: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(18rem, 1fr) minmax(24rem, 34rem); }
.client-login-card { width: 100%; min-width: 0; padding: clamp(2rem, 7vw, 6rem); display: flex; flex-direction: column; justify-content: center; background: rgba(255, 253, 249, .94); border-left: 1px solid var(--client-line); }
.login-visual { position: relative; overflow: hidden; display: grid; align-content: end; padding: clamp(2rem, 7vw, 7rem); color: #f7f1e5; background: linear-gradient(135deg, rgba(13, 26, 23, .64), rgba(8, 18, 16, .9)), radial-gradient(circle at 30% 15%, #b8892f, #173a31 45%, #101b18 100%); }
.login-visual::before { content: "O"; position: absolute; inset: auto auto -18vw -4vw; font: 700 min(70vw, 44rem)/.7 Georgia, serif; color: rgba(255, 255, 255, .055); }
.login-visual p { position: relative; max-width: 26rem; font: 400 clamp(1.8rem, 3.4vw, 3.5rem)/1.06 Georgia, serif; }
.route-line { display: flex; align-items: center; width: min(26rem, 80%); }
.route-line::before { content: ""; height: 1px; flex: 1; background: rgba(255,255,255,.55); }
.route-line span { width: .65rem; height: .65rem; border: 2px solid #efd999; border-radius: 50%; margin-left: clamp(2rem, 8vw, 6rem); animation: routePulse 3.6s ease-in-out infinite; }
.route-line span:nth-child(2) { animation-delay: .45s; }.route-line span:nth-child(3) { animation-delay: .9s; }
@keyframes routePulse { 0%, 60%, 100% { background: transparent; transform: scale(.8); } 20% { background: #efd999; transform: scale(1.15); } }

.client-brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; width: fit-content; }
.brand-seal { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--client-gold); color: var(--client-gold-dark); font: 700 1.45rem Georgia, serif; }
.client-brand strong, .client-brand small { display: block; }.client-brand strong { font: 700 1rem Georgia, serif; letter-spacing: .04em; }.client-brand small { color: var(--client-muted); margin-top: .12rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; }
.eyebrow { margin: 0 0 .6rem; color: var(--client-gold-dark); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.client-login-card > .eyebrow { margin-top: clamp(2.5rem, 8vh, 5rem); }
.client-login-card h1 { margin: 0; font: 500 clamp(2.4rem, 5vw, 4.4rem)/.95 Georgia, serif; letter-spacing: -.035em; }
.login-copy { color: var(--client-muted); line-height: 1.6; margin: 1.25rem 0 2rem; }
.client-login-card label, .form-grid > label:not(.check-row), .request-form > label { margin: .9rem 0 .35rem; font-size: .78rem; font-weight: 760; }
input, select, textarea { width: 100%; border: 1px solid var(--client-line); border-radius: .65rem; padding: .82rem .9rem; background: #fff; color: var(--client-ink); }
textarea { resize: vertical; }
input:disabled { background: #eee9df; color: #756d61; }
.form-help, .support-copy, .form-grid small { color: var(--client-muted); font-size: .78rem; line-height: 1.5; }
.form-error { min-height: 1.25rem; color: var(--client-danger); font-weight: 700; font-size: .82rem; }
.client-button { border: 1px solid transparent; border-radius: .65rem; min-height: 2.8rem; padding: .72rem 1.1rem; font-weight: 780; cursor: pointer; }
.client-button.primary { background: var(--client-forest); color: #fff; box-shadow: 0 8px 20px rgba(23, 58, 49, .16); }
.client-button:disabled { opacity: .55; cursor: wait; }
.quiet-button { border: 0; background: transparent; color: var(--client-gold-dark); padding: .55rem; font-weight: 750; cursor: pointer; }

.client-locked .client-shell { display: none; }.client-locked .client-login { display: grid; }body:not(.client-locked) .client-login { display: none; }
.client-shell { min-height: 100vh; }
.client-header { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 5vw, 4rem); border-bottom: 1px solid var(--client-line); background: rgba(255, 253, 249, .85); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.header-actions { display: flex; align-items: center; gap: .8rem; color: var(--client-muted); font-size: .82rem; }
.client-nav { display: flex; gap: .35rem; padding: .65rem clamp(1rem, 5vw, 4rem); border-bottom: 1px solid var(--client-line); background: rgba(244, 239, 230, .92); overflow-x: auto; position: sticky; top: 5rem; z-index: 9; }
.nav-item { border: 0; border-radius: 2rem; padding: .62rem .95rem; background: transparent; color: var(--client-muted); font-weight: 720; cursor: pointer; white-space: nowrap; }
.nav-item.active { background: var(--client-ink); color: #fff; }
.network-notice, .portal-notice { padding: .75rem clamp(1rem, 5vw, 4rem); text-align: center; font-size: .83rem; }
.network-notice { background: #fff1c9; }.portal-notice:not(:empty) { background: #e3efe8; color: #174f3c; }
main { width: min(82rem, 100%); margin: 0 auto; padding: clamp(1.2rem, 4vw, 3.5rem); }
.portal-view.active { animation: viewIn .28s ease-out both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(.45rem); } to { opacity: 1; transform: none; } }
.hero-card { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding: clamp(1.5rem, 5vw, 4rem); border-radius: 1.25rem; color: #fff; background: linear-gradient(130deg, #173a31, #102820 70%, #0c211a); box-shadow: var(--client-shadow); }
.hero-card h1, .section-intro h1 { margin: 0; font: 500 clamp(2rem, 5vw, 4rem)/1 Georgia, serif; letter-spacing: -.035em; }.hero-card .eyebrow { color: #efd999; }.hero-card p:last-of-type { max-width: 38rem; color: #d8e1dd; line-height: 1.6; }
.hero-card .primary { background: #efd999; color: #1f271f; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; }
.metric-grid article { padding: 1.25rem; border: 1px solid var(--client-line); border-radius: 1rem; background: rgba(255,253,249,.8); }
.metric-grid span, .metric-grid small { display: block; color: var(--client-muted); font-size: .76rem; }.metric-grid strong { display: block; font: 500 2.2rem Georgia, serif; margin: .35rem 0 .1rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(18rem, .85fr); gap: 1rem; }
.client-panel, .message-panel { border: 1px solid var(--client-line); border-radius: 1rem; padding: clamp(1rem, 3vw, 1.5rem); background: rgba(255,253,249,.88); box-shadow: 0 9px 30px rgba(52,42,26,.035); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }.panel-heading h2 { margin: 0; font: 500 1.45rem Georgia, serif; }
.empty-card { padding: 2.5rem 1rem; text-align: center; color: var(--client-muted); border: 1px dashed var(--client-line); border-radius: .75rem; }
.quick-actions { display: grid; gap: .55rem; }.quick-actions button { text-align: left; border: 1px solid var(--client-line); border-radius: .75rem; background: #fff; padding: .85rem; font-weight: 760; cursor: pointer; }.quick-actions span { display: block; margin-top: .25rem; color: var(--client-muted); font-size: .76rem; font-weight: 500; }
.section-intro { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }.section-intro p:last-child { color: var(--client-muted); }
.segmented { display: inline-flex; padding: .25rem; background: #e9e1d5; border-radius: .75rem; margin-bottom: 1rem; }.segmented button { border: 0; background: transparent; border-radius: .55rem; padding: .55rem 1rem; color: var(--client-muted); font-weight: 750; cursor: pointer; }.segmented button.active { background: #fff; color: var(--client-ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.card-list, .stack-list { display: grid; gap: .7rem; }.trip-card, .stack-item { padding: 1rem; border: 1px solid var(--client-line); border-radius: .8rem; background: #fff; }.trip-top, .stack-top { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }.trip-card h2, .stack-item strong { margin: 0; font-size: 1rem; }.trip-route { margin: .7rem 0; font: 500 1.15rem Georgia, serif; }.trip-meta, .stack-meta { color: var(--client-muted); font-size: .78rem; line-height: 1.55; }.status-pill { display: inline-flex; border-radius: 2rem; padding: .3rem .6rem; background: #e3efe8; color: #174f3c; font-size: .7rem; font-weight: 800; text-transform: capitalize; }.trip-actions { display: flex; gap: .45rem; margin-top: .8rem; }
.request-history { margin-top: 1rem; }
.message-panel { max-width: 54rem; margin: 0 auto; }.message-list { min-height: 20rem; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column-reverse; gap: .7rem; padding: .5rem; }.message-bubble { align-self: flex-start; max-width: min(34rem, 86%); padding: .75rem .9rem; border-radius: .85rem .85rem .85rem .2rem; background: #ebe3d7; }.message-bubble.outbound { align-self: flex-end; border-radius: .85rem .85rem .2rem .85rem; background: var(--client-forest); color: #fff; }.message-bubble p { margin: 0; white-space: pre-wrap; }.message-bubble time { display: block; margin-top: .4rem; opacity: .7; font-size: .68rem; }.composer { display: grid; grid-template-columns: 1fr auto; gap: .7rem; align-items: end; margin-top: 1rem; }
.billing-handoff { color: var(--client-muted); font-size: .8rem; line-height: 1.55; }.profile-grid { align-items: start; }.form-grid { display: grid; }.check-row { display: flex; gap: .6rem; align-items: center; margin-top: .8rem; font-size: .82rem; }.check-row input { width: auto; }.profile-side { display: grid; gap: 1rem; }.mini-form { display: grid; gap: .55rem; margin-bottom: .8rem; padding: .8rem; border-radius: .75rem; background: #f2ede4; }
.client-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1rem, 5vw, 4rem); color: var(--client-muted); font-size: .78rem; }
dialog { width: min(38rem, calc(100% - 2rem)); border: 1px solid var(--client-line); border-radius: 1rem; padding: 0; box-shadow: 0 35px 100px rgba(16,23,19,.35); background: var(--client-card); }dialog::backdrop { background: rgba(10,18,15,.65); backdrop-filter: blur(3px); }.request-form { padding: 1.4rem; }.dialog-heading, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }.dialog-heading h2 { margin: 0; font: 500 1.8rem Georgia, serif; }.dialog-close { border: 0; background: transparent; font-size: 1.8rem; cursor: pointer; }.dialog-actions { margin-top: 1rem; justify-content: flex-end; }

@media (max-width: 760px) {
  .client-login { width: 100%; grid-template-columns: minmax(0, 1fr); }.login-visual { display: none; }.client-login-card { min-height: 100vh; padding: 2rem 1.2rem; border: 0; }.client-login-card h1 { font-size: 2.8rem; }
  .client-header { min-height: 4.5rem; }.client-nav { top: 4.5rem; }.header-actions > span { display: none; }
  main { padding: 1rem; }.hero-card, .section-intro { align-items: stretch; flex-direction: column; }.hero-card { padding: 1.5rem; }.hero-card h1 { font-size: 2.4rem; }.hero-card .client-button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }.metric-grid article { padding: .8rem .55rem; }.metric-grid strong { font-size: 1.7rem; }
  .content-grid { grid-template-columns: 1fr; }.composer { grid-template-columns: 1fr; }.message-list { min-height: 18rem; }.client-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --client-line: #625b51; }.client-panel, .trip-card, .stack-item, input, select, textarea { border-width: 2px; }
}
