:root {
  --bg: #f7f5f0;
  --ink: #201c18;
  --wood: #7a4a26;
  --wood-deep: #4e2e18;
  --brass: #b08a53;
  --muted: #8b8377;
  --line: #e7e2d6;
  --cab-hi: #5c3a22;
  --cab-lo: #241609;
  --cab-panel: #3d2717;
  --cab-cream: #f5f1e8;
  --cab-muted: #cabfa9;
  --success: #28623b;
  --danger: #a63827;
  --font-ui: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 1000; padding: 12px 16px; background: var(--brass); color: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; box-shadow: 0 0 0 5px rgba(32,28,24,.2); }

.app-shell { height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 28px 20px 20px; overflow: hidden; color: var(--cab-cream); border-right: 1px solid rgba(176,138,83,.48); background: repeating-linear-gradient(90deg, transparent 0 56px, rgba(176,138,83,.075) 56px 57px), repeating-linear-gradient(0deg, transparent 0 56px, rgba(176,138,83,.055) 56px 57px), radial-gradient(ellipse 130% 58% at 50% 108%, #2c1b0d 0%, #100b07 58%, #080605 100%); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--cab-cream); font-family: var(--font-display); font-size: 1.02rem; font-weight: 800; letter-spacing: .06em; line-height: 1; text-decoration: none; }
.brand span span { display: block; margin-top: 5px; color: var(--cab-muted); font-family: var(--font-ui); font-size: .55rem; font-weight: 600; letter-spacing: .26em; line-height: 1; }
.brand-mark { position: relative; display: inline-flex; width: 27px; height: 31px; border: 1px solid var(--brass); }
.brand-mark i { display: block; width: 50%; height: 100%; border-right: 1px solid rgba(176,138,83,.72); }
.brand-mark i:last-child { border: 0; }
.brand-mark::after { content: "↑"; position: absolute; top: -9px; left: 7px; padding-inline: 2px; background: #432914; color: var(--brass); font-size: .74rem; }
.environment-chip { display: inline-flex; align-items: center; align-self: flex-start; gap: 8px; margin-top: 42px; padding: 7px 9px; border: 1px solid rgba(176,138,83,.32); background: rgba(20,10,4,.28); color: var(--cab-muted); font-size: .62rem; font-weight: 700; letter-spacing: .14em; }
.pulse { width: 7px; height: 7px; background: var(--brass); border: 1px solid var(--cab-cream); border-radius: 50%; }
.nav-list { display: grid; gap: 5px; margin-top: 34px; }
.nav-link { display: flex; align-items: center; min-height: 46px; gap: 12px; padding: 10px 12px; border: 1px solid transparent; color: var(--cab-muted); font-size: .9rem; font-weight: 600; text-decoration: none; transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease); }
.nav-link span { color: rgba(202,191,169,.55); font-size: .65rem; font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.nav-link:hover { color: var(--cab-cream); background: rgba(245,241,232,.06); }
.nav-link.is-active { border-color: rgba(176,138,83,.65); background: rgba(20,10,4,.34); color: var(--cab-cream); }
.nav-link.is-active span { color: var(--brass); }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(176,138,83,.35); padding-top: 18px; }
.sidebar-footer p { margin: 0 0 8px; color: rgba(202,191,169,.72); font-size: .65rem; font-weight: 700; letter-spacing: .13em; }
.sidebar-footer a { color: var(--cab-cream); font-size: .78rem; text-decoration: none; }
.sidebar-footer a:hover { color: var(--brass); }
.sidebar-footer a span { color: var(--brass); }

.login-screen { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; padding: clamp(24px, 5vw, 72px); color: var(--cab-cream); background: repeating-linear-gradient(90deg, transparent 0 8vw, rgba(176,138,83,.075) 8vw calc(8vw + 1px)), repeating-linear-gradient(0deg, transparent 0 8vw, rgba(176,138,83,.055) 8vw calc(8vw + 1px)), radial-gradient(ellipse 90% 62% at 50% 108%, #2c1b0d 0%, #100b07 57%, #080605 100%); }
.login-brand { position: absolute; top: 28px; left: clamp(24px, 4vw, 64px); display: inline-flex; align-items: center; gap: 12px; color: var(--cab-cream); font-family: var(--font-display); font-size: 1.02rem; font-weight: 800; letter-spacing: .06em; line-height: 1; }
.login-brand > span:last-child > span { display: block; margin-top: 5px; color: var(--cab-muted); font-family: var(--font-ui); font-size: .55rem; font-weight: 600; letter-spacing: .26em; line-height: 1; }
.login-brand .brand-mark::after { background: #100b07; }
.login-panel { width: min(100%, 510px); padding: clamp(30px, 5vw, 52px); border: 1px solid rgba(176,138,83,.62); background: rgba(30,17,8,.86); }
.login-panel .floor-label { color: var(--brass); }
.login-panel h1 { max-width: 10ch; margin: 16px 0; font-family: var(--font-display); font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.06em; line-height: .94; }
.login-panel > p:not(.floor-label) { max-width: 39ch; margin: 0; color: var(--cab-muted); line-height: 1.65; }
.login-panel .auth-form { margin-top: 30px; }
.login-panel .field-group label { color: var(--cab-cream); }
.login-panel input { border-color: rgba(202,191,169,.36); background: rgba(245,241,232,.07); color: var(--cab-cream); }
.login-panel input::placeholder { color: rgba(202,191,169,.62); }
.login-panel .secondary-button { border-color: rgba(245,241,232,.72); color: var(--cab-cream); }
.login-panel .secondary-button:hover { border-color: var(--brass); background: var(--brass); color: var(--ink); }
.login-panel .form-message { color: var(--cab-muted); }
.login-foot { position: absolute; right: clamp(24px, 4vw, 64px); bottom: 28px; margin: 0; color: rgba(202,191,169,.72); font-size: .63rem; font-weight: 700; letter-spacing: .16em; }

.main-content { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: 0 clamp(24px,4vw,64px); border-bottom: 1px solid var(--line); }
.crumb, .top-actions { display: flex; align-items: center; gap: 12px; }
.crumb { color: var(--muted); font-size: .78rem; font-weight: 600; }
.crumb-dot { width: 8px; height: 8px; border: 1px solid var(--wood-deep); background: var(--brass); border-radius: 50%; }
.top-actions { font-size: .8rem; }
.user-label { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.text-button { border: 0; background: none; color: var(--wood); font-weight: 700; }
.docs-button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--ink); color: var(--ink); font-size: .77rem; font-weight: 700; letter-spacing: .03em; text-decoration: none; transition: background 180ms var(--ease), color 180ms var(--ease); }
.docs-button:hover { background: var(--ink); color: var(--cab-cream); }
.docs-button span { color: var(--brass); }

.page-section { display: none; max-width: 1500px; padding: clamp(40px,6vw,86px) clamp(24px,4vw,64px); }
.page-section.is-visible { display: block; flex: 1; min-height: 0; overflow-y: auto; animation: enter 400ms var(--ease) both; }
#overview.page-section.is-visible { display: flex; flex-direction: column; }
#overview .platform-console { order: 1; }
#overview .page-heading { order: 2; margin-top: clamp(48px, 7vw, 92px); }
#overview .overview-layout { order: 3; }
#overview .sequence { order: 4; }
#overview .platform-access-note { order: 5; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { max-width: 760px; margin-bottom: clamp(42px,6vw,72px); }
.page-heading h1 { max-width: 16ch; margin: 13px 0 17px; font-family: var(--font-display); font-size: clamp(2.3rem,4.2vw,4.5rem); font-weight: 800; letter-spacing: -.055em; line-height: .96; text-wrap: balance; }
.page-heading p:not(.floor-label) { max-width: 63ch; margin: 0; color: var(--muted); font-size: 1.03rem; line-height: 1.65; }
.page-heading strong { color: var(--ink); }
.compact-heading { margin-bottom: 46px; }
.compact-heading h1 { font-size: clamp(2.15rem,3.5vw,3.45rem); }
.floor-label, .eyebrow { margin: 0; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .15em; line-height: 1.2; }
.floor-label b { color: var(--wood); }

.overview-layout { display: grid; grid-template-columns: 1fr; border: 1px solid var(--ink); }
.arrival-panel { display: flex; flex-direction: column; justify-content: space-between; min-height: 300px; padding: clamp(26px,4vw,48px); background: linear-gradient(150deg, #56351f, #241609 82%); color: var(--cab-cream); }
.arrival-panel .eyebrow { color: var(--brass); }
.arrival-panel h2 { display: flex; align-items: center; gap: 12px; margin: 18px 0 11px; font-family: var(--font-display); font-size: clamp(1.7rem,2.5vw,2.5rem); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.arrival-panel p:not(.eyebrow) { max-width: 35ch; margin: 0; color: var(--cab-muted); }
.status-dot { width: 14px; height: 14px; flex: 0 0 auto; border: 2px solid var(--cab-cream); background: var(--brass); border-radius: 50%; }
.status-dot.error { background: #d26a50; }
.arrow-button { align-self: flex-start; min-height: 44px; padding: 0 14px; border: 1px solid rgba(245,241,232,.7); background: transparent; color: var(--cab-cream); font-size: .78rem; font-weight: 700; transition: background 180ms var(--ease), color 180ms var(--ease); }
.arrow-button:hover { background: var(--cab-cream); color: var(--wood-deep); }
.auth-panel, .tenant-list-panel, .create-panel, .request-composer { background: #fbfaf6; }
.auth-panel { padding: clamp(26px,4vw,48px); border-left: 1px solid var(--ink); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2, .response-toolbar h2, .create-panel h2 { margin: 9px 0 0; font-family: var(--font-display); font-size: 1.34rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.status-label, .tenant-badge, .response-status { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .11em; white-space: nowrap; }
.status-label.is-authenticated { border-color: var(--success); background: #edf5ed; color: var(--success); }
.auth-form { display: grid; gap: 16px; margin-top: 27px; }
.field-group { display: grid; gap: 7px; }
.field-group label, .tenant-picker-wrap label { font-size: .77rem; font-weight: 700; }
.field-group label span { color: var(--muted); font-weight: 500; }
.field-group small { color: var(--muted); font-size: .71rem; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #d8d0c3; border-radius: 0; background: var(--bg); color: var(--ink); }
textarea { min-height: 88px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9d9589; }
input:focus, select:focus, textarea:focus { border-color: var(--wood); outline: 0; box-shadow: 0 0 0 3px rgba(176,138,83,.2); }
.auth-actions, .quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 0; font-size: .8rem; font-weight: 700; letter-spacing: .02em; transition: transform 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease); }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: var(--cab-cream); }
.primary-button:hover { background: var(--wood-deep); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.secondary-button:hover { border-color: var(--wood); background: var(--wood); color: var(--cab-cream); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .45; transform: none !important; }
.form-message { min-height: 21px; margin: 0; color: var(--muted); font-size: .75rem; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }
.sequence { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 20px; border-top: 1px solid var(--line); }
.sequence div { display: flex; gap: 12px; padding: 18px 18px 0 0; }
.sequence div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.sequence span { color: var(--wood); font-size: .7rem; font-weight: 700; }
.sequence p { margin: 0; color: var(--muted); font-size: .82rem; }

.platform-console { margin-top: clamp(54px, 8vw, 96px); padding-top: clamp(26px, 4vw, 42px); border-top: 1px solid var(--ink); }
#overview .platform-console { width: 100%; margin-top: 0; padding-top: 0; border-top: 0; }
.platform-console-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.platform-console-heading h2 { margin: 9px 0 0; font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.75rem); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.telemetry-note { max-width: 31ch; margin: 0; color: var(--muted); font-size: .75rem; text-align: right; }
.platform-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.platform-metrics article { display: grid; gap: 5px; min-height: 150px; align-content: center; padding: 20px; }
.platform-metrics article + article { border-left: 1px solid var(--line); }
.platform-metrics span, .traffic-panel .panel-heading > span, .request-stream .panel-heading > span { color: var(--muted); font-size: .63rem; font-weight: 700; letter-spacing: .13em; }
.platform-metrics strong { font-family: var(--font-display); font-size: clamp(2rem, 3.1vw, 3.2rem); font-weight: 800; letter-spacing: -.06em; line-height: .95; }
.platform-metrics small { color: var(--muted); font-size: .72rem; }
.platform-data-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); margin-top: 20px; border: 1px solid var(--ink); }
.traffic-panel, .live-tenants-panel { min-height: 304px; padding: 26px; }
.live-tenants-panel { border-left: 1px solid var(--ink); background: #fbfaf6; }
.traffic-panel .panel-heading > span { margin-top: 4px; }
.live-tenants-panel .panel-heading a { color: var(--wood); font-size: .75rem; font-weight: 700; text-decoration: none; }
.traffic-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: clamp(4px, .8vw, 10px); height: 185px; margin-top: 28px; padding-top: 12px; border-bottom: 1px solid var(--line); }
.traffic-column { display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; min-width: 0; }
.traffic-column i { display: block; align-self: end; min-height: 2px; background: var(--brass); transition: height 260ms var(--ease); }
.traffic-column:first-child i, .traffic-column:nth-child(6n) i { background: var(--wood); }
.traffic-column span { overflow: hidden; color: var(--muted); font-size: .58rem; text-align: center; white-space: nowrap; }
.platform-tenant-list { display: grid; margin-top: 22px; border-top: 1px solid var(--line); }
.platform-tenant { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 55px; border-bottom: 1px solid var(--line); }
.tenant-presence { width: 8px; height: 8px; border: 1px solid var(--wood-deep); border-radius: 50%; background: transparent; }
.tenant-presence.is-online { background: var(--brass); box-shadow: 0 0 0 3px rgba(176,138,83,.16); }
.platform-tenant strong { display: block; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.platform-tenant small { color: var(--muted); font-size: .68rem; }
.platform-tenant em { color: var(--muted); font-size: .61rem; font-style: normal; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.request-stream { margin-top: 20px; border: 1px solid var(--ink); background: linear-gradient(145deg, #3d2717, #1c0f06); color: var(--cab-cream); }
.request-stream .panel-heading { padding: 24px 26px; border-bottom: 1px solid rgba(176,138,83,.35); }
.request-stream .eyebrow { color: var(--brass); }
.request-stream .panel-heading > span { color: var(--cab-muted); }
.request-stream-body { display: grid; }
.stream-row { display: grid; grid-template-columns: 75px minmax(0, 1fr) 62px 65px; gap: 14px; align-items: center; min-height: 44px; padding: 0 26px; border-bottom: 1px solid rgba(176,138,83,.18); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; }
.stream-row:last-child { border-bottom: 0; }
.stream-row time { color: var(--cab-muted); }
.stream-method { color: var(--brass); font-weight: 700; }
.stream-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-status { color: #c8e0c9; text-align: right; }
.stream-status.is-error { color: #ffc0ae; }
.stream-latency { color: var(--cab-muted); text-align: right; }
.platform-access-note { display: grid; gap: 7px; max-width: 720px; margin-top: 46px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.platform-access-note strong { color: var(--ink); font-size: 1rem; }
.platform-access-note code { padding: .1em .35em; background: #eee6da; color: var(--wood-deep); }

.tenant-layout { display: grid; grid-template-columns: minmax(390px,1.35fr) minmax(300px,.65fr); border-top: 2px solid var(--ink); }
.tenant-list-panel { min-height: 410px; padding: 30px 0 0; }
.tenant-list-panel .panel-heading { padding: 0 30px 22px; }
.icon-button { display: inline-grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1rem; transition: background 180ms var(--ease), color 180ms var(--ease); }
.icon-button:hover { background: var(--ink); color: var(--cab-cream); }
.tenant-list { border-top: 1px solid var(--line); }
.tenant-row { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 14px; width: 100%; min-height: 78px; padding: 14px 30px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; transition: background 180ms var(--ease); }
.tenant-row:hover, .tenant-row.is-selected { background: #f1e9de; }
.tenant-index { color: var(--wood); font-size: .67rem; font-weight: 700; letter-spacing: .1em; }
.tenant-row strong { display: block; font-size: .93rem; }
.tenant-row small { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; }
.tenant-role { color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.empty-state { display: grid; gap: 5px; padding: 32px 30px; color: var(--muted); font-size: .83rem; }
.empty-state strong { color: var(--ink); }
.create-panel { padding: 30px; border-left: 1px solid var(--line); }
.stack-form { display: grid; gap: 16px; margin-top: 26px; }

.workbench-layout { display: grid; grid-template-columns: minmax(320px,.78fr) minmax(420px,1.22fr); min-height: 520px; border: 1px solid var(--ink); }
.request-composer { padding: 30px; }
.tenant-picker-wrap { display: grid; gap: 7px; margin-top: 28px; }
.response-panel { display: grid; grid-template-rows: auto minmax(260px,1fr) auto; border-left: 1px solid var(--ink); background: linear-gradient(145deg, #3d2717, #1c0f06); color: var(--cab-cream); }
.response-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 30px; border-bottom: 1px solid rgba(176,138,83,.35); }
.response-toolbar .eyebrow { color: var(--brass); }
.response-status { border-color: rgba(176,138,83,.42); background: rgba(20,10,4,.3); color: var(--cab-muted); }
.response-status.success { border-color: #6da477; color: #c2e2c5; }
.response-status.error { border-color: #c96c59; color: #ffc0ae; }
pre { min-width: 0; max-width: 100%; margin: 0; padding: 30px; overflow: auto; color: #f0e8da; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.response-meta { display: flex; justify-content: space-between; gap: 12px; padding: 15px 30px; border-top: 1px solid rgba(176,138,83,.35); color: var(--cab-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(390px,calc(100vw - 48px)); padding: 13px 16px; border: 1px solid var(--ink); background: var(--brass); color: var(--ink); box-shadow: 0 18px 60px rgba(32,28,24,.2); font-size: .84rem; font-weight: 650; opacity: 0; pointer-events: none; transform: translateY(14px); transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #f8e3dc; color: var(--danger); }


/* Tenant-view mode ---------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.view-as-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 13px clamp(24px,4vw,64px); border-bottom: 1px solid var(--ink); background: linear-gradient(120deg, #56351f, #241609 78%); color: var(--cab-cream); font-size: .84rem; }
.view-as-flag { padding: 4px 8px; border: 1px solid var(--brass); color: var(--brass); font-size: .61rem; font-weight: 700; letter-spacing: .14em; }
.view-as-bar strong { font-size: .93rem; }
.view-as-copy { color: var(--cab-muted); font-size: .78rem; }
.view-as-exit { margin-left: auto; border: 1px solid rgba(245,241,232,.68); background: transparent; color: var(--cab-cream); min-height: 36px; padding: 0 12px; font-size: .76rem; font-weight: 700; transition: background 180ms var(--ease), color 180ms var(--ease); }
.view-as-exit:hover { background: var(--cab-cream); color: var(--wood-deep); }
.view-as-exit span { color: var(--brass); }
.view-as-exit:hover span { color: var(--wood); }
.view-as-panel { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: clamp(20px,3vw,40px); align-items: center; margin-top: 20px; padding: 26px; border: 1px solid var(--ink); background: #fbfaf6; }
.view-as-panel h3 { margin: 9px 0 8px; font-family: var(--font-display); font-size: 1.34rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.view-as-panel p:not(.eyebrow) { max-width: 52ch; margin: 0; color: var(--muted); font-size: .85rem; }
.view-as-controls { display: grid; gap: 9px; }
.view-as-controls label { font-size: .77rem; font-weight: 700; }

/* Booking templates --------------------------------------------------------- */
.business-type-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: clamp(20px,3vw,44px); align-items: center; padding: 26px 30px; border: 1px solid var(--ink); background: linear-gradient(150deg, #56351f, #241609 84%); color: var(--cab-cream); }
.business-type-panel .eyebrow { color: var(--brass); }
.business-type-panel h2 { margin: 9px 0 7px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.business-type-panel p:not(.eyebrow) { max-width: 60ch; margin: 0; color: var(--cab-muted); font-size: .85rem; }
.inline-form { display: grid; gap: 8px; min-width: 260px; }
.inline-form label { color: var(--cab-cream); font-size: .74rem; font-weight: 700; }
.inline-form select { border-color: rgba(202,191,169,.45); background: rgba(245,241,232,.08); color: var(--cab-cream); }
.inline-form select option { color: var(--ink); }
.inline-form .primary-button { border-color: var(--cab-cream); background: var(--cab-cream); color: var(--wood-deep); }
.inline-form .primary-button:hover { background: var(--brass); color: var(--ink); }

.services-layout { display: grid; grid-template-columns: minmax(300px,.82fr) minmax(400px,1.18fr); margin-top: 22px; border: 1px solid var(--ink); }
.catalog-panel, .services-panel { padding: 28px 30px; }
.catalog-panel { background: #fbfaf6; }
.services-panel { border-left: 1px solid var(--ink); }
.panel-note { margin: 16px 0 0; color: var(--muted); font-size: .78rem; }
.catalog-list, .service-list { display: grid; margin-top: 20px; border-top: 1px solid var(--line); }
.catalog-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.catalog-row strong { display: block; font-size: .87rem; }
.catalog-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .74rem; }
.catalog-add { min-height: 36px; padding: 0 11px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: .73rem; font-weight: 700; transition: background 180ms var(--ease), color 180ms var(--ease); }
.catalog-add:hover:not(:disabled) { background: var(--ink); color: var(--cab-cream); }
.catalog-add:disabled { border-color: var(--line); background: #efe9dd; color: var(--muted); cursor: default; }
.catalog-default { margin-left: 7px; padding: 1px 5px; border: 1px solid var(--brass); color: var(--wood); font-size: .58rem; font-weight: 700; letter-spacing: .1em; vertical-align: middle; }

.service-row { display: grid; gap: 11px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.service-row.is-inactive { opacity: .62; }
.service-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.service-origin { color: var(--muted); font-size: .61rem; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.service-fields { display: grid; grid-template-columns: minmax(0,1.6fr) 92px 104px; gap: 10px; }
.service-fields label { display: grid; gap: 5px; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .06em; }
.service-fields input { min-height: 42px; }
.service-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.service-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .76rem; font-weight: 600; }
.service-toggle input { width: auto; min-height: 0; accent-color: var(--wood); }
.service-save { min-height: 38px; padding: 0 12px; border: 1px solid var(--ink); background: var(--ink); color: var(--cab-cream); font-size: .74rem; font-weight: 700; }
.service-save:hover:not(:disabled) { background: var(--wood-deep); }
.service-delete { margin-left: auto; border: 0; background: none; color: var(--danger); font-size: .74rem; font-weight: 700; }
.service-save:disabled, .service-delete:disabled, .catalog-add:disabled, .booking-action:disabled { cursor: default; opacity: .55; }
.custom-service { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.custom-service summary { color: var(--wood); font-size: .82rem; font-weight: 700; cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Shell ---------------------------------------------------------------------- */
/* The shell owns the viewport; each section scrolls inside it, so the calendar can
   always claim exactly the height that is left. */
.main-content { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.topbar, .view-as-bar { flex: 0 0 auto; }
.nav-link[hidden] { display: none !important; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 1px solid rgba(176,138,83,.6); color: var(--brass); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* Calendar ------------------------------------------------------------------- */
.page-section--calendar.is-visible { display: flex; flex-direction: column; max-width: none; overflow: hidden; padding: 22px clamp(20px,3vw,44px) 14px; animation: none; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; }
.cal-toolbar-left, .cal-toolbar-right, .cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav .icon-button { width: 38px; height: 38px; }
.cal-nav .secondary-button { min-height: 38px; padding-inline: 12px; font-size: .74rem; }
#cal-label { font-family: var(--font-display); font-size: clamp(1.05rem,1.6vw,1.4rem); font-weight: 800; letter-spacing: -.035em; }
.cal-views { display: inline-flex; border: 1px solid var(--ink); }
.cal-view-button { min-height: 38px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font-size: .76rem; font-weight: 700; transition: background 160ms var(--ease), color 160ms var(--ease); }
.cal-view-button + .cal-view-button { border-left: 1px solid var(--line); }
.cal-view-button:hover { background: #efe9dd; }
.cal-view-button.is-active { background: var(--ink); color: var(--cab-cream); }
.cal-toolbar-right .primary-button { min-height: 38px; font-size: .76rem; }
.cal-shell { flex: 1; min-height: 0; border: 1px solid var(--ink); background: #fbfaf6; }
.cal-hint { margin: 10px 0 0; color: var(--muted); font-size: .74rem; }

.cal { display: flex; flex-direction: column; height: 100%; }
.cal-head { display: flex; border-bottom: 1px solid var(--ink); background: var(--bg); }
.cal-gutter-head { flex: 0 0 62px; border-right: 1px solid var(--line); }
.cal-head-days { flex: 1; display: grid; grid-template-columns: repeat(var(--day-count), minmax(0,1fr)); }
.cal-head-day { padding: 9px 6px; border-left: 1px solid var(--line); text-align: center; }
.cal-head-day span { display: block; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.cal-head-day b { display: block; font-family: var(--font-display); font-size: 1.16rem; font-weight: 800; letter-spacing: -.03em; }
.cal-head-day.is-today { background: #f1e9de; }
.cal-head-day.is-today b { color: var(--wood); }
.cal-scroll { flex: 1; display: flex; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cal-gutter { flex: 0 0 62px; border-right: 1px solid var(--line); }
.cal-hour { position: relative; height: var(--hour-height); }
.cal-hour span { position: absolute; top: -7px; right: 7px; color: var(--muted); font-size: .63rem; font-variant-numeric: tabular-nums; }
.cal-cols { flex: 1; display: grid; grid-template-columns: repeat(var(--day-count), minmax(0,1fr)); }
.cal-col { position: relative; border-left: 1px solid var(--line); touch-action: none; }
.cal-slot { height: var(--hour-height); border-bottom: 1px solid var(--line); }
.cal-slot:nth-child(even) { background: rgba(231,226,214,.22); }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #b4402c; pointer-events: none; z-index: 4; }
.cal-now i { position: absolute; top: -5px; left: -4px; width: 8px; height: 8px; background: #b4402c; border-radius: 50%; }

.cal-event { position: absolute; z-index: 3; display: grid; align-content: start; overflow: hidden; padding: 4px 7px; border: 1px solid var(--wood-deep); border-radius: 3px; background: var(--wood); color: var(--cab-cream); text-align: left; cursor: grab; transition: box-shadow 160ms var(--ease), filter 160ms var(--ease); }
.cal-event:hover { box-shadow: 0 4px 14px rgba(32,28,24,.24); filter: brightness(1.06); }
.cal-event b { display: block; overflow: hidden; font-size: .7rem; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.cal-event small { display: block; overflow: hidden; color: rgba(245,241,232,.82); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.is-tight { padding-block: 1px; }
.cal-event.is-tight small { display: none; }
.cal-event.is-dragging { z-index: 8; cursor: grabbing; box-shadow: 0 10px 26px rgba(32,28,24,.32); transition: none; }
.cal-event.is-pending { background: var(--brass); border-color: #8a6a3c; color: var(--ink); }
.cal-event.is-pending small { color: rgba(32,28,24,.72); }
.cal-event.is-completed { background: #d8cdb8; border-color: #b6a98f; color: var(--ink); }
.cal-event.is-completed small { color: rgba(32,28,24,.68); }
.cal-event.is-cancelled, .cal-event.is-no_show { background: repeating-linear-gradient(45deg,#efe9dd 0 5px,#e5dcca 5px 10px); border-color: #cfc4ae; color: var(--muted); }
.cal-event.is-cancelled b, .cal-event.is-no_show b { text-decoration: line-through; }
.cal-event.is-cancelled small, .cal-event.is-no_show small { color: var(--muted); }
.cal-resize { position: absolute; right: 0; bottom: 0; left: 0; height: 8px; cursor: ns-resize; }
.cal-resize::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 22px; height: 2px; background: currentColor; opacity: 0; transform: translateX(-50%); transition: opacity 160ms var(--ease); }
.cal-event:hover .cal-resize::after { opacity: .55; }
.cal-ghost { position: absolute; left: 2px; right: 2px; z-index: 6; display: grid; place-items: center; border: 1px dashed var(--wood); border-radius: 3px; background: rgba(122,74,38,.16); color: var(--wood); font-size: .68rem; font-weight: 700; pointer-events: none; }
body.is-dragging { cursor: grabbing; user-select: none; }

.cal--month { display: flex; flex-direction: column; height: 100%; }
.cal-month-head { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border-bottom: 1px solid var(--ink); background: var(--bg); }
.cal-month-weekday { padding: 9px 8px; border-left: 1px solid var(--line); color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cal-month-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); grid-auto-rows: minmax(0,1fr); min-height: 0; overflow: auto; }
.cal-month-cell { display: flex; flex-direction: column; gap: 3px; min-height: 96px; padding: 6px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); overflow: hidden; transition: background 160ms var(--ease); }
.cal-month-cell:hover { background: #f4eee4; }
.cal-month-cell.is-outside { background: rgba(231,226,214,.28); color: var(--muted); }
.cal-month-cell.is-today { box-shadow: inset 0 3px 0 var(--brass); }
.cal-month-cell.is-drop-target { background: rgba(176,138,83,.22); }
.cal-month-day { font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-month-cell.is-today .cal-month-day { color: var(--wood); }
.cal-chip { display: flex; align-items: center; gap: 5px; width: 100%; padding: 2px 5px; border: 0; border-radius: 3px; background: #efe7d9; color: var(--ink); font-size: .66rem; text-align: left; cursor: grab; transition: background 160ms var(--ease); }
.cal-chip:hover { background: #e4d7c1; }
.cal-chip.is-dragging { opacity: .6; cursor: grabbing; }
.cal-chip i { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--wood); }
.cal-chip.is-pending i { background: var(--brass); }
.cal-chip.is-completed i { background: #b6a98f; }
.cal-chip.is-cancelled i, .cal-chip.is-no_show i { background: #cfc4ae; }
.cal-chip time { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { color: var(--muted); font-size: .62rem; font-weight: 700; }

/* Drawer --------------------------------------------------------------------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(32,28,24,.3); opacity: 0; transition: opacity 260ms var(--ease); }
.drawer-scrim.is-open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; z-index: 40; display: flex; flex-direction: column; width: min(430px, 94vw); height: 100dvh; border-left: 1px solid var(--ink); background: var(--bg); box-shadow: -28px 0 64px rgba(32,28,24,.2); transform: translateX(101%); transition: transform 280ms var(--ease); }
.drawer.is-open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 8px 0 0; font-family: var(--font-display); font-size: 1.34rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; }
.drawer-head .icon-button { width: 36px; height: 36px; flex: 0 0 auto; }
.drawer-body { flex: 1; padding: 20px 22px 32px; overflow-y: auto; }
.drawer-summary { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-when { display: grid; gap: 3px; margin: 0 0 14px; color: var(--muted); font-size: .78rem; }
.drawer-when b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.drawer-summary dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 14px; margin: 0; }
.drawer-summary dt { color: var(--muted); font-size: .71rem; font-weight: 700; letter-spacing: .05em; }
.drawer-summary dd { margin: 0; font-size: .84rem; overflow-wrap: anywhere; }
.drawer-summary a { color: var(--wood); }
.drawer-block { padding: 18px 0; border-bottom: 1px solid var(--line); }
.status-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.status-pill { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: .73rem; font-weight: 700; transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease); }
.status-pill:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.status-pill.is-active { border-color: var(--ink); background: var(--ink); color: var(--cab-cream); }
.status-pill:disabled { cursor: default; }
.drawer-edit { margin: 18px 0; }
.drawer-edit summary { color: var(--wood); font-size: .82rem; font-weight: 700; cursor: pointer; }
.drawer-form { display: grid; gap: 14px; margin-top: 16px; }
.booking-action { min-height: 40px; width: 100%; padding: 0 12px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: .76rem; font-weight: 700; }
.booking-action.is-danger { border-color: var(--danger); color: var(--danger); }
.booking-action.is-danger:hover { background: var(--danger); color: var(--cab-cream); }

/* Tenant home ---------------------------------------------------------------- */
.today-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.today-hero h1 { margin: 12px 0 10px; font-family: var(--font-display); font-size: clamp(2.1rem,3.6vw,3.5rem); font-weight: 800; letter-spacing: -.055em; line-height: .98; }
.today-hero p:not(.eyebrow) { max-width: 52ch; margin: 0; color: var(--muted); font-size: 1rem; }
.today-hero-side { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.today-hero-side .arrow-button { border-color: var(--ink); color: var(--ink); }
.today-hero-side .arrow-button:hover { background: var(--ink); color: var(--cab-cream); }
.kpi-row { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.kpi-row article { display: grid; gap: 5px; align-content: center; min-height: 132px; padding: 18px 20px; }
.kpi-row article + article { border-left: 1px solid var(--line); }
.kpi-row span { color: var(--muted); font-size: .63rem; font-weight: 700; letter-spacing: .13em; }
.kpi-row strong { font-family: var(--font-display); font-size: clamp(1.9rem,2.8vw,2.9rem); font-weight: 800; letter-spacing: -.06em; line-height: .95; }
.kpi-row small { color: var(--muted); font-size: .72rem; }
.today-layout { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(320px,.95fr); gap: 20px; margin-top: 20px; }
.today-agenda, .next-booking, .today-services, .website-card { padding: 22px; border: 1px solid var(--ink); background: #fbfaf6; }
.today-agenda { display: flex; flex-direction: column; min-height: 520px; }
.today-agenda .panel-heading a, .today-services .panel-heading a, .website-card .panel-heading a { color: var(--wood); font-size: .75rem; font-weight: 700; text-decoration: none; }
.today-calendar { flex: 1; min-height: 0; margin-top: 16px; border: 1px solid var(--line); }
.today-column { display: grid; gap: 20px; align-content: start; }
.next-booking { background: linear-gradient(150deg,#56351f,#241609 84%); color: var(--cab-cream); }
.next-booking .eyebrow { color: var(--brass); }
.next-booking h2 { margin: 8px 0 14px; font-family: var(--font-display); font-size: 1.34rem; font-weight: 800; letter-spacing: -.035em; }
.next-booking .empty-state { padding: 0 0 14px; color: var(--cab-muted); }
.next-booking .empty-state strong { color: var(--cab-cream); }
.next-booking .secondary-button { border-color: rgba(245,241,232,.7); color: var(--cab-cream); }
.next-booking .secondary-button:hover { background: var(--cab-cream); color: var(--wood-deep); }
.next-booking-card { display: grid; gap: 5px; width: 100%; padding: 16px; border: 1px solid rgba(176,138,83,.55); background: rgba(20,10,4,.3); color: inherit; text-align: left; transition: background 180ms var(--ease), border-color 180ms var(--ease); }
.next-booking-card:hover { border-color: var(--brass); background: rgba(20,10,4,.5); }
.next-when { color: var(--brass); font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.next-booking-card strong { font-family: var(--font-display); font-size: 1.32rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; }
.next-meta, .next-customer { color: var(--cab-muted); font-size: .8rem; }
.next-price { margin-top: 6px; font-size: .92rem; font-weight: 700; }
.today-service-list { display: grid; margin-top: 16px; border-top: 1px solid var(--line); }
.today-service { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.today-service strong { display: block; font-size: .84rem; }
.today-service small { color: var(--muted); font-size: .72rem; }
.today-service em { font-style: normal; font-weight: 700; font-size: .84rem; }

.website-preview { margin-top: 16px; }
.website-frame { border: 1px solid var(--line); background: var(--bg); }
.website-bar { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #efe9dd; }
.website-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--brass); }
.website-bar code { flex: 1; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.website-bar a { color: var(--wood); font-size: .7rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.website-frame iframe { display: block; width: 100%; height: 320px; border: 0; background: #fff; }
.website-note { margin: 0; padding: 8px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; }

/* Settings ------------------------------------------------------------------- */
.settings-layout { display: grid; grid-template-columns: minmax(320px,1fr) minmax(300px,.85fr); border: 1px solid var(--ink); }
.settings-panel, .settings-side { padding: 28px 30px; }
.settings-side { border-left: 1px solid var(--ink); background: #fbfaf6; }
.endpoint-list { display: grid; gap: 4px; margin: 18px 0 0; }
.endpoint-list dt { color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.endpoint-list dd { margin: 0 0 12px; }
.endpoint-list code { display: block; padding: 8px 10px; border: 1px solid var(--line); background: var(--bg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; overflow-wrap: anywhere; }


/* Closed time in the calendar ------------------------------------------------ */
.cal-closed { position: absolute; left: 0; right: 0; z-index: 1; display: grid; place-items: center; background: repeating-linear-gradient(45deg, rgba(231,226,214,.5) 0 6px, rgba(247,245,240,.5) 6px 12px); pointer-events: none; }
.cal-closed.is-closure { background: repeating-linear-gradient(45deg, rgba(176,138,83,.2) 0 7px, rgba(247,245,240,.55) 7px 14px); }
.cal-closed span { padding: 3px 8px; border: 1px solid rgba(122,74,38,.35); background: var(--bg); color: var(--wood); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cal-month-cell.is-shut { background: repeating-linear-gradient(45deg, rgba(231,226,214,.45) 0 6px, rgba(247,245,240,.45) 6px 12px); }
.cal-month-cell.is-shut.is-outside { opacity: .7; }

/* Opening hours and closures -------------------------------------------------- */
.settings-layout { grid-template-columns: repeat(2, minmax(300px, 1fr)); }
.settings-hours, .settings-closures { padding: 28px 30px; border-top: 1px solid var(--ink); }
.settings-hours { border-right: 1px solid var(--ink); }
.settings-side { border-top: 1px solid var(--ink); }
.hours-form { display: grid; gap: 18px; margin-top: 18px; }
.hours-rows { display: grid; gap: 8px; }
.hours-row { display: grid; grid-template-columns: minmax(0,1fr) 108px auto 108px; align-items: center; gap: 10px; }
.hours-row.is-closed { opacity: .55; }
.hours-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: .84rem; font-weight: 600; }
.hours-toggle input { width: auto; min-height: 0; accent-color: var(--wood); }
.hours-row input[type=time] { min-height: 42px; padding-inline: 8px; font-variant-numeric: tabular-nums; }
.hours-dash { color: var(--muted); }
.rules-row { grid-template-columns: repeat(3, minmax(0,1fr)); padding-top: 16px; border-top: 1px solid var(--line); }
.rules-row input { min-height: 44px; }
.closure-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.closure-form .field-group:nth-child(3) { grid-column: 1 / -1; }
.closure-form button { grid-column: 1 / -1; }
.closure-list { display: grid; margin-top: 8px; border-top: 1px solid var(--line); }
.closure-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.closure-row strong { display: block; font-size: .86rem; }
.closure-row small { color: var(--muted); font-size: .74rem; }
.closure-delete { width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; color: var(--muted); transition: border-color 160ms var(--ease), color 160ms var(--ease); }
.closure-delete:hover { border-color: var(--danger); color: var(--danger); }
.booking-link { display: grid; gap: 8px; margin-top: 18px; padding: 16px; border: 1px solid var(--brass); background: var(--bg); }
.booking-link a { overflow-wrap: anywhere; color: var(--wood); font-size: .84rem; font-weight: 700; }
.booking-link .secondary-button { min-height: 40px; justify-self: start; font-size: .74rem; }

/* Onboarding checklist -------------------------------------------------------- */
.today-checklist { padding: 22px; border: 1px solid var(--brass); background: #fdf6ea; }
.today-checklist h2 { margin: 8px 0 6px; font-family: var(--font-display); font-size: 1.28rem; font-weight: 800; letter-spacing: -.035em; }
.checklist { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.checklist li i { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid var(--wood); border-radius: 50%; color: var(--wood); font-size: .7rem; font-style: normal; }
.checklist li.is-done { color: var(--muted); }
.checklist li.is-done i { border-color: var(--success); background: var(--success); color: var(--cab-cream); }
.checklist button { padding: 0; border: 0; background: none; color: var(--wood); font-size: .86rem; font-weight: 700; text-align: left; }
.checklist button:hover { text-decoration: underline; }

/* Customers -------------------------------------------------------------------- */
.customer-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.customer-toolbar .field-group { min-width: min(320px, 100%); }
.customer-stats { display: flex; flex-wrap: wrap; gap: 22px; color: var(--muted); font-size: .8rem; }
.customer-stats strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.customer-list { display: grid; }
.customer-row { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1.4fr) 130px 120px 120px; align-items: center; gap: 16px; min-height: 62px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.customer-row.is-head { min-height: 42px; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.customer-name strong { font-size: .92rem; }
.customer-badge { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--brass); color: var(--wood); font-size: .56rem; font-style: normal; font-weight: 700; letter-spacing: .1em; vertical-align: middle; }
.customer-contact { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.customer-flag { display: block; color: var(--danger); font-size: .68rem; font-style: normal; }
.customer-last { color: var(--muted); }

/* Insights --------------------------------------------------------------------- */
.insight-range { display: inline-flex; margin-bottom: 22px; border: 1px solid var(--ink); }
.range-button { min-height: 40px; padding: 0 16px; border: 0; background: transparent; color: var(--ink); font-size: .78rem; font-weight: 700; transition: background 160ms var(--ease), color 160ms var(--ease); }
.range-button + .range-button { border-left: 1px solid var(--line); }
.range-button:hover { background: #efe9dd; }
.range-button.is-active { background: var(--ink); color: var(--cab-cream); }
.insight-kpis { margin-bottom: 20px; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.insight-panel { padding: 24px; border: 1px solid var(--ink); background: #fbfaf6; }
.insight-panel .panel-heading > span { color: var(--muted); font-size: .63rem; font-weight: 700; letter-spacing: .12em; }
.insight-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); align-items: end; gap: 6px; height: 190px; margin-top: 22px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.trend-column { display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; min-width: 0; }
.trend-column i { display: block; align-self: end; min-height: 2px; background: var(--wood); transition: height 300ms var(--ease); }
.trend-column:last-child i { background: var(--brass); }
.trend-column span { overflow: hidden; color: var(--muted); font-size: .58rem; text-align: center; white-space: nowrap; }
.insight-bars { display: grid; gap: 12px; margin-top: 22px; }
.insight-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 12px; }
.insight-bar span { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.insight-bar em { color: var(--muted); font-size: .74rem; font-style: normal; font-variant-numeric: tabular-nums; }
.insight-bar i { grid-column: 1 / -1; height: 8px; background: var(--brass); transition: width 300ms var(--ease); }
.insight-heatmap { display: grid; grid-template-columns: 34px repeat(7, minmax(0,1fr)); gap: 3px; margin-top: 22px; }
.heat-cell { display: grid; min-height: 30px; place-items: center; background: color-mix(in srgb, var(--wood) calc(var(--heat, 0) * 100%), #f1ece1); color: color-mix(in srgb, var(--cab-cream) calc(var(--heat, 0) * 100%), var(--ink)); font-size: .68rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.heat-cell.is-label { background: transparent; color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }


/* Booking-page editor --------------------------------------------------------- */
.page-section--page.is-visible { display: flex; flex-direction: column; max-width: none; overflow: hidden; padding: 22px clamp(20px,3vw,44px) 22px; animation: none; }
.brand-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; padding-bottom: 16px; }
.brand-head h1 { margin: 10px 0 0; font-family: var(--font-display); font-size: clamp(1.7rem,2.8vw,2.5rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.brand-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.brand-head-actions .secondary-button { min-height: 40px; font-size: .76rem; }
.brand-devices { display: inline-flex; border: 1px solid var(--ink); }
.device-button { min-height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font-size: .76rem; font-weight: 700; transition: background 160ms var(--ease), color 160ms var(--ease); }
.device-button + .device-button { border-left: 1px solid var(--line); }
.device-button:hover { background: #efe9dd; }
.device-button.is-active { background: var(--ink); color: var(--cab-cream); }

.brand-layout { display: grid; grid-template-columns: minmax(340px, .82fr) minmax(0, 1.18fr); flex: 1; min-height: 0; border: 1px solid var(--ink); }
.brand-editor { min-height: 0; padding: 24px 26px 32px; overflow-y: auto; background: #fbfaf6; }
.brand-group { display: grid; gap: 16px; margin: 0 0 24px; padding: 0 0 22px; border: 0; border-bottom: 1px solid var(--line); }
.brand-group:last-of-type { border-bottom: 0; }
.brand-group legend { padding: 0; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.field-legend { font-size: .77rem; font-weight: 700; }
.colour-row { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 10px; }
.colour-row input[type=color] { min-height: 46px; padding: 3px; border: 1px solid #d8d0c3; background: var(--bg); cursor: pointer; }
.colour-row input[type=text], .colour-row input:not([type=color]) { min-height: 46px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 30px; height: 30px; border: 1px solid rgba(32,28,24,.28); background: var(--swatch); transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.swatch:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(32,28,24,.22); }
.option-row { display: flex; flex-wrap: wrap; gap: 7px; }
.option-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: .78rem; font-weight: 700; transition: border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease); }
.option-button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.option-button.is-active { border-color: var(--ink); background: var(--ink); color: var(--cab-cream); }
.brand-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.brand-preview { display: grid; min-height: 0; padding: 22px; border-left: 1px solid var(--ink); background: repeating-linear-gradient(45deg,#efe9dd 0 8px,#f4efe5 8px 16px); }
.brand-frame { position: relative; width: 100%; min-height: 0; margin: 0 auto; border: 1px solid var(--ink); background: #fff; box-shadow: 0 20px 50px rgba(32,28,24,.16); transition: max-width 260ms var(--ease); }
.brand-frame.is-mobile { max-width: 390px; }
.brand-frame iframe { display: block; width: 100%; height: 100%; border: 0; }


/* Media library --------------------------------------------------------------- */
.link-button { padding: 0; border: 0; background: none; color: var(--wood); font-size: .78rem; font-weight: 700; }
.link-button:hover { text-decoration: underline; }
.media-slot { display: grid; gap: 8px; }
.media-slot-body { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 12px; align-items: start; }
.media-thumb { display: grid; width: 74px; height: 74px; place-items: center; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb.is-empty { background: repeating-linear-gradient(45deg,#efe9dd 0 5px,#f7f5f0 5px 10px); }
.media-slot-actions { display: grid; gap: 8px; min-width: 0; }
.media-slot-actions input { min-height: 42px; }
.media-slot-actions small { color: var(--muted); font-size: .71rem; }
.media-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.media-buttons .secondary-button { min-height: 36px; padding-inline: 12px; font-size: .74rem; }

.media-drop { display: grid; gap: 5px; padding: 26px 20px; border: 2px dashed var(--line); background: var(--bg); text-align: center; transition: border-color 180ms var(--ease), background 180ms var(--ease); }
.media-drop.is-over { border-color: var(--wood); background: #f4ece0; }
.media-drop.is-disabled { opacity: .5; pointer-events: none; }
.media-drop strong { font-size: .92rem; }
.media-drop span, .media-drop small { color: var(--muted); font-size: .78rem; }
.media-drop small { font-size: .7rem; }
.media-progress { display: grid; gap: 6px; margin-top: 12px; }
.media-progress-label { color: var(--muted); font-size: .74rem; }
.media-progress i { display: block; height: 6px; background: var(--brass); transition: width 160ms linear; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; margin-top: 16px; }
.media-card { display: grid; gap: 8px; margin: 0; padding: 8px; border: 1px solid var(--line); background: var(--bg); }
.media-card-preview { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #efe9dd; }
.media-card-preview img, .media-card-preview video { width: 100%; height: 100%; object-fit: cover; }
.media-kind { position: absolute; top: 6px; left: 6px; padding: 1px 5px; background: rgba(12,8,5,.7); color: var(--cab-cream); font-size: .55rem; font-weight: 700; letter-spacing: .1em; }
.media-card figcaption { display: grid; gap: 4px; }
.media-title { min-height: 34px; padding: 5px 8px; font-size: .76rem; }
.media-meta { color: var(--muted); font-size: .66rem; }
.media-card-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.media-card-actions button { min-height: 30px; padding: 0 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .66rem; font-weight: 700; transition: border-color 160ms var(--ease), color 160ms var(--ease); }
.media-card-actions button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.media-card-actions button.is-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.media-card-actions button:disabled { opacity: .4; cursor: default; }


/* Deposits ---------------------------------------------------------------------- */
.settings-payments { padding: 28px 30px; border-top: 1px solid var(--ink); border-right: 1px solid var(--ink); }
.settings-payments .stack-form { margin-top: 18px; }
.connection-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: .8rem; }
.service-deposit { display: grid; grid-template-columns: minmax(0,1.6fr) 104px; gap: 10px; }
.service-deposit label { display: grid; gap: 5px; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .06em; }
.service-deposit select, .service-deposit input { min-height: 42px; }
.deposit-notice { border-left: 3px solid var(--brass); padding-left: 14px; background: #fdf6ea; }
.deposit-notice p:not(.eyebrow) { margin: 8px 0 12px; color: var(--muted); font-size: .82rem; }
.cal-event.is-awaiting_payment { background: repeating-linear-gradient(135deg, var(--brass) 0 8px, #c79c62 8px 16px); border-color: #8a6a3c; color: var(--ink); }
.cal-event.is-awaiting_payment small { color: rgba(32,28,24,.72); }
.cal-chip.is-awaiting_payment i { background: repeating-linear-gradient(135deg, var(--brass) 0 3px, #efe7d9 3px 6px); }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; min-height: 0; padding: 18px 20px; }
  .environment-chip, .sidebar-footer { display: none; }
  .nav-list { display: flex; margin: 18px 0 0; overflow-x: auto; }
  .nav-link { flex: 0 0 auto; min-height: 40px; padding: 8px 10px; }
  .topbar { min-height: 64px; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; gap: 14px; padding-block: 13px; }
  .top-actions { justify-content: flex-end; flex-wrap: wrap; }
  .user-label { display: none; }
  .overview-layout, .tenant-layout, .workbench-layout, .services-layout, .settings-layout, .today-layout, .view-as-panel, .business-type-panel, .insight-grid, .brand-layout { grid-template-columns: 1fr; }
  .page-section--page.is-visible { overflow-y: auto; }
  .brand-editor { overflow: visible; }
  .brand-preview { border-left: 0; border-top: 1px solid var(--ink); min-height: 70vh; }
  .settings-hours { border-right: 0; }
  .customer-row { grid-template-columns: minmax(0,1.3fr) 110px 110px; }
  .customer-row > :nth-child(2), .customer-row > :nth-child(5) { display: none; }
  .kpi-row { grid-template-columns: repeat(2,1fr); }
  .kpi-row article:nth-child(3) { border-left: 0; }
  .kpi-row article:nth-child(n+3) { border-top: 1px solid var(--line); }
  .auth-panel, .create-panel, .response-panel, .services-panel, .settings-side { border-left: 0; border-top: 1px solid var(--ink); }
  .settings-payments { border-right: 0; }
  .service-deposit { grid-template-columns: minmax(0,1fr) 92px; }
  .service-fields { grid-template-columns: minmax(0,1fr) 88px 96px; }
  .app-shell { height: auto; }
  body { overflow: auto; }
  .main-content { height: auto; min-height: 100vh; overflow: visible; }
  .page-section.is-visible { overflow: visible; }
  .cal-shell { min-height: 70vh; }
  .cal-toolbar-right { flex-wrap: wrap; }
  .sequence { grid-template-columns: 1fr; }
  .sequence div + div { padding-left: 0; border-left: 0; }
  .page-heading h1 { max-width: 17ch; }
  .tenant-list-panel { min-height: 0; }
  .response-panel { min-height: 400px; }
  .login-brand { top: 22px; left: 20px; }
  .login-foot { right: 20px; bottom: 22px; left: 20px; }
  .platform-console-heading { align-items: flex-start; flex-direction: column; }
  .telemetry-note { text-align: left; }
  .platform-metrics { grid-template-columns: repeat(2, 1fr); }
  .platform-metrics article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .platform-metrics article:nth-child(4) { border-top: 1px solid var(--line); }
  .platform-data-grid { grid-template-columns: 1fr; }
  .live-tenants-panel { border-top: 1px solid var(--ink); border-left: 0; }
}
@media (max-width: 450px) {
  .page-section { padding-inline: 18px; }
  .topbar { padding-inline: 18px; }
  .auth-panel, .arrival-panel, .create-panel, .request-composer, .catalog-panel, .services-panel, .settings-panel, .settings-side, .settings-hours, .settings-closures, .insight-panel, .business-type-panel, .view-as-panel { padding: 22px; }
  .hours-row { grid-template-columns: minmax(0,1fr) 84px auto 84px; gap: 6px; }
  .rules-row, .closure-form { grid-template-columns: 1fr; }
  .cal-gutter, .cal-gutter-head { flex-basis: 46px; }
  .service-fields, .field-row { grid-template-columns: 1fr; }
  .tenant-list-panel .panel-heading, .tenant-row { padding-inline: 20px; }
  .response-toolbar, pre, .response-meta { padding-inline: 20px; }
  .traffic-panel, .live-tenants-panel { padding: 20px; }
  .request-stream .panel-heading, .stream-row { padding-inline: 20px; }
  .stream-row { grid-template-columns: 58px minmax(0, 1fr) 42px; gap: 8px; }
  .stream-latency { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
