:root {
    color-scheme: light;
    --ink: #193c3d;
    --muted: #607575;
    --accent: #157b78;
    --line: #dce7e3;
    --surface: #fff;
    --soft: #edf6f2;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: #f4f7f5;
    font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100svh; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { flex-shrink: 0; }
.logo { display: block; width: 138px; max-width: 100%; height: auto; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.2; font-weight: 600; letter-spacing: -.035em; }
.intro { margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

/* Sign in */
.login-page { display: grid; place-items: center; padding: 40px 24px; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 1000px); min-height: 620px; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; background: var(--surface); box-shadow: 0 24px 80px #193c3d08; }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; overflow: hidden; background: #e8f1ed; }
.story-content { position: relative; z-index: 1; margin-top: 76px; }
.story-title { margin: 0; max-width: 330px; font-size: clamp(30px, 3.5vw, 42px); font-weight: 500; letter-spacing: -.04em; line-height: 1.2; }
.story-copy { max-width: 300px; margin: 20px 0 0; color: #486963; line-height: 1.7; }
.story-art { width: 100%; max-width: 300px; height: 130px; margin-top: 32px; color: #609b87; }
.login { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 32px; text-align: center; }
.login h1 { font-size: 32px; }
.login .intro { max-width: 280px; font-size: 15px; }
.login-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px; border: 1px solid #d9e8e2; border-radius: 14px; background: var(--soft); color: var(--accent); }
.login-mark svg { width: 24px; height: 24px; }
.auth-buttons { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 32px; }
.g_id_signin { display: flex; justify-content: center; }
.apple-signin { display: flex; align-items: center; justify-content: center; gap: 10px; width: 240px; height: 40px; padding: 0 16px; border: 1px solid #172c2c; border-radius: 4px; background: #172c2c; color: #fff; font-size: 14px; font-weight: 500; }
.apple-signin svg { width: 18px; height: 20px; fill: currentColor; }
.login-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.license-consent { width: 100%; max-width: 320px; margin-top: 28px; text-align: left; }
.license-consent-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.6; }
.license-consent-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; }
.license-consent-row label { cursor: pointer; }
.license-link { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.license-hint { margin: 10px 0 0 28px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.license-consent + .auth-buttons { margin-top: 24px; }
.auth-buttons[aria-disabled="true"] { opacity: .45; pointer-events: none; user-select: none; }
.license-dialog { width: min(920px, calc(100% - 32px)); height: min(820px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #193c3d26; }
.license-dialog[open] { display: flex; flex-direction: column; }
.license-dialog::backdrop { background: #193c3d80; }
.license-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--line); }
.license-dialog-header h2 { margin: 0; font-size: 21px; font-weight: 600; }
.license-dialog-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.license-close { flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 24px; }
.license-dialog-content { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; padding: 0; font-size: 14px; line-height: 1.7; }
.license-dialog-content h3 { margin: 20px 0 8px; font-size: 15px; }
.license-dialog-content p { margin: 0; }
.license-frame { width: 100%; min-height: 0; flex: 1; border: 0; background: #fff; }
.license-new-window { margin: 0; padding: 10px 24px; border-top: 1px solid var(--line); text-align: right; }
.license-new-window a { color: var(--accent); }
.license-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 24px; border-top: 1px solid var(--line); }
.license-dialog-actions p { max-width: 560px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.license-accept { min-height: 44px; padding: 10px 18px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; }
.license-accept:hover { background: #105d5b; }

/* Legal documents */
.legal-page { min-height: 100%; padding: 36px 20px 64px; background: #f5f7f6; }
.legal-document { width: min(100%, 880px); margin: 0 auto; padding: 54px 64px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 16px 48px #193c3d08; color: #263b36; }
.legal-brand { display: inline-block; margin-bottom: 36px; color: var(--accent); font-size: 24px; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.legal-header h1 { max-width: 720px; margin: 10px 0 20px; font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -.04em; }
.legal-header > p:last-of-type { font-size: 16px; line-height: 1.75; }
.legal-document section { margin-top: 42px; scroll-margin-top: 24px; }
.legal-document h2 { margin: 0 0 16px; color: #244c40; font-size: 21px; line-height: 1.3; }
.legal-document h3 { margin: 28px 0 10px; color: #315c4e; font-size: 16px; }
.legal-document p, .legal-document dd { line-height: 1.75; }
.legal-document p { margin: 12px 0 0; }
.legal-document a { color: var(--accent); text-underline-offset: 3px; }
.legal-parties, .legal-processing { display: grid; gap: 0; margin: 30px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.legal-parties > div, .legal-processing > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; padding: 14px 18px; }
.legal-parties > div + div, .legal-processing > div + div { border-top: 1px solid var(--line); }
.legal-parties dt, .legal-processing dt { color: #557068; font-weight: 600; }
.legal-parties dd, .legal-processing dd { margin: 0; overflow-wrap: anywhere; }
.legal-annex { padding-top: 42px; border-top: 2px solid #b9d0c6; }
.legal-annex > .eyebrow { margin-bottom: 8px; }
.legal-footer { display: flex; justify-content: space-between; gap: 24px; margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 680px) {
    .license-dialog-actions { align-items: stretch; flex-direction: column; gap: 12px; }
    .license-dialog-actions .license-accept { width: 100%; }
    .legal-page { padding: 0; }
    .legal-document { padding: 32px 22px 48px; border: 0; border-radius: 0; box-shadow: none; }
    .legal-parties > div, .legal-processing > div { grid-template-columns: 1fr; gap: 4px; }
    .legal-footer { flex-direction: column; gap: 4px; }
}

@media print {
    .legal-page { padding: 0; background: #fff; }
    .legal-document { width: auto; padding: 0; border: 0; box-shadow: none; }
    .legal-brand { display: none; }
}

/* Organization selection */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1200px; margin: 0 auto; padding: 28px 40px; }
.logout { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; text-decoration: none; }
.logout:hover { color: var(--accent); }
.logout svg { width: 18px; height: 18px; }
.onboarding { width: min(100% - 48px, 820px); margin: 40px auto 64px; }
.welcome { margin-bottom: 32px; }
.setup-panel { padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 16px 48px #193c3d05; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-size: 15px; font-weight: 600; }
.section-number { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 11px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 220px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); text-align: left; transition: border-color .18s, background .18s, box-shadow .18s; }
.card:hover { border-color: #86afa1; background: #f9fcfa; }
.card[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 1px var(--accent); }
.card-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 26px; border: 1px solid #e3eae6; border-radius: 12px; background: #f4f7f5; color: #55746e; }
.card-icon svg { width: 26px; height: 26px; }
.card[aria-pressed="true"] .card-icon { border-color: var(--accent); background: var(--accent); color: #fff; }
.card-indicator { position: absolute; top: 24px; right: 24px; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #b6c8c1; border-radius: 50%; }
.card-indicator svg { width: 14px; height: 14px; visibility: hidden; }
.card[aria-pressed="true"] .card-indicator { border-color: var(--accent); background: var(--accent); color: #fff; }
.card[aria-pressed="true"] .card-indicator svg { visibility: visible; }
.card-title { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.card-description { display: block; max-width: 245px; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.selection-hint { margin: 24px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
.name-field { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.name-field label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.name-field input { display: block; width: 100%; height: 52px; padding: 0 16px; border: 1px solid #b7cbc2; border-radius: 10px; background: #fff; color: var(--ink); font-size: 16px; }
.name-field input::placeholder { color: #7c8d88; }
.field-hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.next { display: inline-flex; align-items: center; justify-content: center; gap: 32px; min-height: 48px; padding: 12px 22px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; transition: background .18s; }
.next svg { width: 18px; height: 18px; }
.next:hover:not(:disabled) { background: #10635f; }
.next:disabled { border-color: #e7efeb; background: #e7efeb; color: #63786f; }
.page-note { margin: 24px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.form-error { color: #a52b2b; font-size: 14px; line-height: 1.5; }
.card:disabled { cursor: wait; }

/* Shared controls */
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--soft); color: var(--accent); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.text-button:hover { color: #105d5b; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 16px; border: 1px solid #bfd3ca; border-radius: 9px; background: white; color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.secondary-button:hover { border-color: var(--accent); color: var(--accent); }
.input-label { display: block; margin-bottom: 10px; color: var(--ink); font-size: 13px; font-weight: 600; }
.text-input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #b7cbc2; border-radius: 9px; color: var(--ink); background: #fff; }
.text-input::placeholder { color: #7c8d88; font-size: 14px; }
.text-input:focus, .room-counter:focus-within { border-color: var(--accent); }

/* Optional clinic setup */
.clinic-onboarding { max-width: 780px; margin-top: 20px; }
.setup-progress { display: flex; align-items: center; gap: 18px; margin: 0 0 44px; padding: 0; list-style: none; }
.setup-progress li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.setup-progress li + li::before { content: ""; width: 36px; height: 1px; margin-right: 10px; background: #d1ded7; }
.progress-check, .progress-current { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 10px; }
.progress-check { background: #dfede5; color: var(--accent); }
.progress-check .icon { width: 14px; height: 14px; }
.progress-current { background: var(--accent); color: white; }
.setup-progress li[aria-current] { color: var(--ink); font-weight: 600; }
.clinic-onboarding .intro strong { font-weight: 600; overflow-wrap: anywhere; }
.optional-notice { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; margin-bottom: 22px; border: 1px solid #d7e6df; border-radius: 12px; background: #eaf3ee; color: #486d61; }
.optional-notice .icon { margin-top: 1px; }
.optional-notice p { margin: 0; font-size: 13px; line-height: 1.65; }
.clinic-panel { border-radius: 18px; }
.setup-section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 25px; }
.setup-section-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 11px; background: #f5f8f6; color: var(--accent); }
.setup-section-heading h2 { margin: 1px 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.setup-section-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.optional-badge, .subtle-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 6px; background: #f0f4f1; color: #667c70; font-size: 11px; font-weight: 500; white-space: nowrap; }
.optional-badge { margin-left: auto; }
.dentist-list { display: grid; gap: 16px; }
.dentist-row { display: flex; align-items: flex-end; gap: 10px; }
.dentist-field { flex: 1; min-width: 0; }
.dentist-field input:disabled { opacity: 1; color: var(--ink); background: #f1f5f3; cursor: default; }
.doctor-color-field { display: flex; flex-direction: column; gap: 7px; flex: 0 0 48px; font-size: 12px; color: var(--muted); }
.doctor-color-field input { width: 48px; height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.remove-dentist { width: 48px; height: 48px; flex-shrink: 0; border-color: var(--line); }
.remove-dentist:hover { background: #fff2f0; color: #a52b2b; border-color: #e8c6c3; }
.add-dentist { margin-top: 10px; }
.room-counter { display: inline-flex; align-items: center; padding: 4px; border: 1px solid #b7cbc2; border-radius: 10px; }
.room-counter button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 7px; background: #f2f6f3; color: var(--ink); }
.room-counter button:hover { background: #e3eee7; }
.room-counter input { width: 76px; padding: 4px; border: 0; background: transparent; color: var(--ink); text-align: center; font-size: 18px; font-weight: 600; appearance: textfield; -moz-appearance: textfield; }
.room-counter input::-webkit-inner-spin-button, .room-counter input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.setup-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; }
.skip-button { color: var(--muted); font-weight: 500; }

/* Organisation details */
.setup-panel.company-details { margin-bottom: 22px; padding: 0; border-radius: 18px; }
.company-details > summary { display: flex; align-items: center; gap: 14px; padding: 24px 32px; cursor: pointer; list-style: none; border-radius: 18px; }
.company-details > summary::-webkit-details-marker { display: none; }
.company-summary { flex: 1; min-width: 0; }
.company-summary strong { display: block; font-size: 17px; font-weight: 600; }
.company-summary > span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.company-chevron { color: var(--muted); }
.company-details[open] .company-chevron { transform: rotate(180deg); }
#organisation-details-form { padding: 0 32px 26px; }
.company-autosave-hint { margin: 0 0 22px; }
.company-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.company-field-wide { grid-column: 1 / -1; }
.company-fields .text-input { min-width: 0; font-size: 16px; }
.company-fields [aria-invalid="true"] { border-color: #a52b2b; }
.company-workplace { min-width: 0; margin: 28px 0 0; padding: 0; border: 0; }
.company-workplace legend { padding: 0; font-size: 15px; font-weight: 600; }
.company-workplace > .field-hint { margin: 8px 0 20px; }
.company-address-fields { margin-top: 20px; }
.company-address-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: 13px; line-height: 1.6; }
.company-address-toggle input { appearance: none; flex: 0 0 42px; width: 42px; height: 24px; margin: 0; padding: 2px; border: 1px solid #8ca69c; border-radius: 20px; background: #e6eee9; cursor: pointer; }
.company-address-toggle input::before { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #193c3d30; }
.company-address-toggle input:checked { border-color: var(--accent); background: var(--accent); }
.company-address-toggle input:checked::before { transform: translateX(18px); }
@media (forced-colors: active) {
    .company-address-toggle input { appearance: auto; }
    .company-address-toggle input::before { display: none; }
}
.company-save-status { min-height: 18px; margin-top: 22px; color: var(--accent); }
@media (max-width: 560px) {
    .company-details > summary { padding: 20px; gap: 10px; }
    #organisation-details-form { padding: 0 20px 20px; }
    .company-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Platform shell */
.platform-page { background: #f5f7f6; overflow: hidden; }
.platform-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100svh; }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 0 16px; border-right: 1px solid var(--line); background: #fff; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: 88px; padding: 0 14px; }
.sidebar-brand .logo { width: 122px; }
.organisation-switcher { display: flex; align-items: center; gap: 10px; margin: 5px 0 30px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.organisation-avatar { display: grid; place-items: center; width: 34px; height: 36px; flex-shrink: 0; border: 1px solid #cbded3; border-radius: 8px; background: #e8f1eb; color: var(--accent); }
.organisation-switcher > div { min-width: 0; }
.organisation-switcher strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.organisation-switcher div > span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.nav-caption { margin: 0 12px 12px; color: #7b8981; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.primary-nav { display: grid; gap: 5px; }
.primary-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 11px 13px; border-radius: 8px; color: #63756d; font-size: 13px; font-weight: 500; text-decoration: none; }
.primary-nav a:hover { background: #f4f8f5; color: var(--accent); }
.primary-nav a[aria-current="page"] { background: #e8f2ec; color: #146b59; font-weight: 600; }
.sidebar-bottom { margin-top: auto; padding-top: 36px; }
.sidebar-clock { margin: 18px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f6faf8; }
.sidebar-clock-time { display: flex; justify-content: center; align-items: center; gap: 4px; min-height: 32px; color: var(--accent); font: 28px monospace; font-variant-numeric: tabular-nums; }
.clock-digit { display: block; width: 18px; height: 34px; flex-shrink: 0; }
.clock-segment { fill: currentColor; opacity: .08; }
.clock-segment.is-on { opacity: 1; }
.clock-colon { display: flex; flex-direction: column; justify-content: center; gap: 9px; width: 6px; height: 34px; align-items: center; }
.clock-colon::before, .clock-colon::after { content: ""; width: 3px; height: 3px; background: currentColor; }
.sidebar-clock-calendar { display: flex; justify-content: space-between; gap: 8px; margin-top: 11px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.status-dot { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #80ac94; }
.platform-main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 72px minmax(0, 1fr); min-width: 0; min-height: 0; }
.platform-header { z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; border-bottom: 1px solid var(--line); background: white; }
.header-location { display: flex; align-items: center; gap: 14px; min-width: 0; font-size: 12px; white-space: nowrap; }
.header-location h1 { min-width: 0; font: inherit; letter-spacing: normal; overflow: hidden; text-overflow: ellipsis; }
.header-app-name { color: var(--muted); }
.header-divider { color: #c5d1ca; }
.header-controls { display: flex; align-items: center; gap: 17px; flex-shrink: 0; }
.header-sms { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid #dce9e2; border-radius: 9px; background: #f2f8f5; color: var(--accent); white-space: nowrap; }
.header-sms .icon { width: 18px; height: 18px; margin-right: 2px; }
.header-sms strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.header-sms-label { color: var(--muted); font-size: 10px; font-weight: 500; }
.control-divider { width: 1px; height: 27px; background: var(--line); }
.header-dropdown { position: relative; }
.header-dropdown summary { list-style: none; }
.header-dropdown summary::-webkit-details-marker { display: none; }
.profile-control { display: flex; align-items: center; gap: 10px; border-radius: 8px; cursor: pointer; }
.profile-avatar { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #d4e1d8; border-radius: 50%; background: #e7f0e8; color: #427058; font-size: 13px; font-weight: 600; }
.profile-label strong { display: block; max-width: 140px; overflow: hidden; font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.profile-label small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.profile-control > .icon { width: 16px; color: var(--muted); }
.dropdown-panel { position: absolute; top: calc(100% + 16px); right: 0; width: 270px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 12px 40px #193c3d12; font-size: 13px; }
.dropdown-panel strong, .dropdown-panel p { overflow-wrap: anywhere; }
.dropdown-panel p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.dropdown-panel a { display: flex; align-items: center; gap: 10px; padding: 12px 0 4px; color: var(--ink); text-decoration: none; }
.dropdown-panel a:hover { color: var(--accent); }
.profile-panel a:first-of-type { margin-top: 15px; border-top: 1px solid var(--line); }
.workspace { overflow-y: auto; min-width: 0; padding: 38px 36px 0; }
.workspace-inner { max-width: 1240px; margin: 0 auto; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(255px, 1fr); gap: 24px; }
.workspace-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 21px 24px; }
.panel-heading h2, .quick-heading h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.panel-heading > .icon { color: #7a9787; }
.activity-panel { display: flex; flex-direction: column; }
.activity-panel .panel-heading { border-bottom: 1px solid #edf1ee; }
.empty-state { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 18px; border: 1px solid #dde9e1; border-radius: 17px; background: #f0f6f2; color: #719b82; }
.empty-state-icon .icon { width: 27px; height: 27px; }
.empty-state h3 { margin: 0; font-size: 15px; font-weight: 500; }
.empty-state p { max-width: 310px; margin: 11px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.empty-state .text-button { font-size: 12px; }
.empty-state .text-button .icon { width: 15px; }
.panel-footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-top: 1px solid #edf1ee; color: #7a8a80; font-size: 10px; }
.organisation-panel { padding: 0 24px 24px; background: #fafcf9; }
.organisation-panel .panel-heading { padding-right: 0; padding-left: 0; }
.organisation-type { display: block; margin: 16px 0 7px; color: #7d9183; font-size: 11px; }
.organisation-panel h3 { margin: 0; color: #305444; font-size: 21px; font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.organisation-stats { display: grid; gap: 15px; margin: 24px 0 20px; padding: 19px 0; border-top: 1px solid #e3ebe2; border-bottom: 1px solid #e3ebe2; }
.organisation-stats > div { display: flex; align-items: center; justify-content: space-between; }
.organisation-stats dt { color: #6a7d70; font-size: 12px; }
.organisation-stats dd { margin: 0; color: #355443; font-size: 16px; font-weight: 600; }
.organisation-note { margin: 18px 0; color: #798a7d; font-size: 11px; line-height: 1.8; }
.organisation-panel .secondary-button { width: 100%; }
.quick-access { margin-top: 29px; }
.quick-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.quick-heading > span { color: #849187; font-size: 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.quick-grid > a { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 18px 16px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-decoration: none; }
.quick-grid > a:hover { border-color: #a9c9b8; background: #fafcfb; }
.quick-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 9px; background: #f0f5f1; color: #718e7d; }
.quick-grid strong { display: block; font-size: 12px; font-weight: 600; }
.quick-grid div > span { display: block; margin-top: 5px; color: #839087; font-size: 10px; line-height: 1.5; }
.quick-grid a > .icon { width: 15px; margin-left: auto; color: #8da597; }
.section-placeholder .empty-state { min-height: 420px; }
.section-placeholder h2 { margin: 18px 0 0; font-size: 23px; font-weight: 500; }
.section-placeholder .empty-state p { max-width: 440px; }
.mobile-menu-toggle, .mobile-menu-close, .sidebar-backdrop { display: none; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 20; padding: 12px 18px; border-radius: 8px; background: var(--accent); color: white; }
.skip-link:focus { top: 12px; }

@media (max-width: 1180px) {
    .platform-shell { grid-template-columns: 220px minmax(0, 1fr); }
    .workspace { padding: 30px 24px 0; }
    .platform-header { padding: 0 24px; }
    .quick-grid { grid-template-columns: 1fr; gap: 10px; }
    .quick-grid > a { padding: 14px 18px; }
    .quick-grid div > span { font-size: 11px; }
}

@media (max-width: 1000px) {
    .header-app-name, .header-divider { display: none; }
    .overview-grid { grid-template-columns: 1fr; gap: 20px; }
    .organisation-panel .secondary-button { width: auto; }
}

@media (max-width: 800px) {
    .platform-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; width: 268px; max-width: calc(100% - 48px); transform: translateX(-100%); visibility: hidden; }
    .sidebar.is-open { transform: translateX(0); visibility: visible; }
    .mobile-menu-toggle, .mobile-menu-close { display: inline-flex; }
    .sidebar-backdrop { position: fixed; z-index: 9; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #193c3d55; }
    .platform-main { grid-template-rows: 64px minmax(0, 1fr); }
    .platform-header { gap: 12px; padding: 0 20px 0 12px; }
    .header-location { gap: 8px; }
    .header-controls { position: relative; gap: 12px; }
    .notifications-dropdown { position: static; }
    .workspace { padding: 26px 20px 0; }
}

@media (max-width: 720px) {
    .login-page { padding: 24px 16px; }
    .login-layout { grid-template-columns: 1fr; min-height: auto; border-radius: 20px; }
    .login-story { padding: 28px; }
    .story-content { margin-top: 32px; }
    .story-title { max-width: 420px; font-size: 30px; }
    .story-copy, .story-art { display: none; }
    .login { padding: 36px 24px; }
    .site-header { padding: 24px; }
    .onboarding { margin-top: 24px; }
    .setup-panel { padding: 24px; }
}

@media (max-width: 520px) {
    .site-header { padding: 20px; }
    .logo { width: 120px; }
    .onboarding { width: calc(100% - 32px); margin-bottom: 32px; }
    .welcome { padding: 0 4px; margin-bottom: 24px; }
    .setup-panel { padding: 20px; border-radius: 18px; }
    .cards { grid-template-columns: 1fr; gap: 12px; }
    .card { min-height: auto; padding: 20px; }
    .card-icon { width: 40px; height: 40px; margin-bottom: 16px; }
    .card-description { max-width: none; }
    .card-indicator { top: 20px; right: 20px; }
    .next { width: 100%; justify-content: space-between; }
    .setup-progress { gap: 10px; margin-bottom: 28px; justify-content: space-between; }
    .setup-progress li { flex-direction: column; gap: 7px; font-size: 10px; }
    .setup-progress li + li::before { display: none; }
    .setup-section-heading { flex-wrap: wrap; gap: 12px; }
    .setup-section-heading > div { flex: 1; min-width: 180px; }
    .setup-section-heading .optional-badge { margin: 0 0 0 54px; }
    .setup-section-heading h2 { font-size: 16px; }
    .setup-actions { flex-direction: column-reverse; gap: 9px; }
    .setup-actions .next { justify-content: center; gap: 16px; }
    .input-label { font-size: 12px; line-height: 1.6; }
    .profile-label, .profile-control > .icon, .control-divider { display: none; }
    .header-controls { gap: 8px; }
    .header-location { font-size: 11px; }
    .notifications-panel { right: 0; }
    .dropdown-panel { width: min(270px, calc(100vw - 32px)); }
    .workspace { padding: 26px 16px 0; }
    .workspace h1 { font-size: 26px; }
    .panel-heading { padding: 20px; }
    .organisation-panel { padding: 0 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
#rooms-settings-form { padding: 0 30px 22px; }
#rooms-settings-form .text-input { max-width: 180px; }
#settings-room-names { padding: 0 30px; }
#settings-room-names form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-bottom: 16px; }
#settings-room-names label { font-size: 13px; font-weight: 600; }
#settings-room-names input { margin-top: 7px; }
#settings-room-names button { min-height: 44px; }
#settings-rooms-status { padding: 0 30px 22px; font-size: 13px; }
@media (max-width: 480px) {
  #rooms-settings-form, #settings-room-names, #settings-rooms-status { padding-left: 18px; padding-right: 18px; }
  #settings-room-names form { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #settings-room-names button { justify-self: start; }
}
