.admin-body { background: var(--cream); min-height: 100vh; }
[hidden] { display: none !important; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 10; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.admin-header { display: flex; align-items: center; gap: 24px; background: white; border-bottom: 1px solid var(--line); padding: 20px clamp(22px,4vw,64px); }
.admin-header img { width: 176px; }
.admin-label { padding-left: 24px; border-left: 1px solid var(--line); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#sign-out { margin-left: auto; }
.admin-main { max-width: 1440px; margin: auto; padding: 36px clamp(20px,4vw,64px) 80px; }
.login-panel { max-width: 730px; padding: 9vh 0 36px; }
.login-panel h1 { font-size: clamp(38px,5vw,64px); }
.small { font-size: 13px; color: var(--muted); margin-top: 16px; }
.notice { padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: white; overflow-wrap: anywhere; }
.notice.error, .form-status.error { color: #9b2823; }
.workspace { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 28px; align-items: start; }
.hospital-sidebar { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.section-heading { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.round-button { border: 1px solid var(--line); background: var(--cream); border-radius: 50%; font-size: 26px; width: 40px; height: 40px; line-height: 1; flex-shrink: 0; }
.admin-body label { display: block; font-size: 13px; font-weight: bold; margin: 18px 0 7px; }
.admin-body input:not([type=checkbox]), .admin-body select { width: 100%; border: 1px solid #959ab0; border-radius: 7px; padding: 11px 12px; color: var(--navy); background: white; min-width: 0; }
.admin-body input[type=file] { font-size: 13px; }
.hospital-list { margin: 18px -10px 0; display: grid; gap: 7px; }
.hospital-item { text-align: left; border: 1px solid transparent; background: white; border-radius: 8px; padding: 12px 10px; width: 100%; overflow-wrap: anywhere; }
.hospital-item[aria-current=true] { background: var(--peach); border-color: #d9aa94; }
.hospital-item strong, .hospital-item span { display: block; }
.hospital-item span { font-size: 12px; color: var(--muted); }
.detail { min-width: 0; }
.empty-state { padding: 60px 24px; }
.empty-state h1 { font-size: clamp(34px,4vw,48px); }
.hospital-summary { padding: 28px; background: var(--navy); color: white; border-radius: 16px; margin-bottom: 24px; }
.hospital-summary h1 { font-size: clamp(28px,3.4vw,40px); margin: 12px 0 10px; overflow-wrap: anywhere; }
.hospital-summary .summary-top { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.hospital-summary .secondary { color: white; border-color: #8d95b1; }
.badge { background: var(--cream); color: var(--navy); border-radius: 5px; display: inline-block; padding: 3px 10px; font-size: 12px; }
.clinic { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: white; margin-bottom: 20px; }
.clinic h3 { font-size: 22px; margin-bottom: 4px; overflow-wrap: anywhere; }
.clinic-location { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 14px; margin-top: 22px; }
.hospital-references { margin-top: 24px; }
.reference { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; min-width: 0; }
.reference-image, .reference-placeholder { aspect-ratio: 4/3; width: 100%; object-fit: cover; background: var(--cream); }
.reference-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 10px; text-align: center; }
.reference-content { padding: 12px; }
.reference-content h4 { font-family: var(--heading); margin: 0 0 8px; font-size: 15px; }
.reference-content p { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; margin-bottom: 12px; }
.reference .secondary { font-size: 12px; width: 100%; }
.reference .secondary + .secondary { margin-top: 8px; }
.secondary { border: 1px solid #959ab0; background: transparent; color: var(--navy); padding: 9px 13px; min-height: 42px; border-radius: 7px; font-size: 13px; line-height: 1.5; }
.secondary:hover { background: var(--peach); color: var(--navy); }
.admin-body button:disabled { cursor: wait; opacity: .65; }
.ready-state { color: #22613a; font-size: 13px; margin-top: 16px; }
.run-state { background: var(--cream); padding: 10px 12px; border-radius: 7px; font-size: 12px; margin-top: 10px; }
dialog { width: min(560px,calc(100% - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 28px; max-height: calc(100dvh - 40px); overflow-y: auto; color: var(--navy); }
dialog::backdrop { background: rgb(18 27 52 / .58); backdrop-filter: blur(4px); }
dialog h2 { font-size: 28px; margin-bottom: 18px; letter-spacing: -.025em; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.form-status { margin-top: 18px; font-size: 13px; overflow-wrap: anywhere; }
.checkbox-label { display: flex !important; align-items: flex-start; gap: 10px; font-weight: normal !important; }
.checkbox-label input { flex-shrink: 0; margin-top: 5px; width: 18px; height: 18px; accent-color: var(--orange-ink); }
.upload-preview { max-height: 230px; width: 100%; object-fit: contain; margin-top: 14px; background: var(--cream); border-radius: 8px; }
progress { width: 100%; accent-color: var(--orange-ink); margin-top: 18px; }
@media (max-width: 1050px) { .workspace { grid-template-columns: 230px minmax(0,1fr); gap: 20px; } .reference-grid { grid-template-columns: 1fr; } .reference { display: grid; grid-template-columns: 120px 1fr; } .reference-image,.reference-placeholder { height: 100%; min-height: 120px; } }
@media (max-width: 700px) { .admin-header { gap: 12px; flex-wrap: wrap; } .admin-header img { width: 140px; } .admin-label { padding-left: 12px; font-size: 11px; } .workspace { grid-template-columns: 1fr; } .hospital-list { max-height: 210px; overflow-y: auto; } .hospital-summary,.clinic { padding: 20px; } .section-heading { align-items: flex-start; } .empty-state { padding: 24px 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

#reference-page { max-width: 1140px; margin-inline: auto; }
.reference-page-header { margin-bottom: 28px; }
.reference-page-header h1 { font-size: clamp(32px, 5vw, 56px); margin: 12px 0 6px; overflow-wrap: anywhere; }
.reference-page-header p { margin: 0; color: var(--muted); }
.reference-back, .reference-sources a { color: var(--orange-ink); text-decoration: underline; text-underline-offset: 3px; }
.reference-panel { min-width: 0; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.reference-panel h2 { font-size: clamp(21px, 3vw, 26px); margin: 0 0 10px; }
.reference-panel h3 { font-size: 17px; margin: 18px 0 6px; }
.reference-panel p { margin: 0 0 12px; }
.reference-panel > :last-child { margin-bottom: 0; }
.reference-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.reference-actions .form-status { margin: 0; }
.reference-sources { padding-left: 20px; margin: 0; }
.reference-sources li + li { margin-top: 6px; }
.reference-meta { color: var(--muted); font-size: 14px; }
.email-style-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.email-example { display: block; width: 100%; height: 660px; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; background: var(--cream); }
.reference-email-subject { color: var(--muted); }
.email-source { width: 100%; min-height: 120px; margin-top: 10px; }
.email-colors { list-style: none; padding: 0; margin: 0; }
.email-colors li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; }
.email-colors li::before { content: ''; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); }
.email-colors li:nth-child(1)::before { background: var(--navy); }
.email-colors li:nth-child(2)::before { background: var(--orange); }
.email-colors li:nth-child(3)::before { background: var(--orange-ink); }
.email-colors li:nth-child(4)::before { background: var(--cream); }
.email-colors li:nth-child(5)::before { background: var(--peach); }
.reference-note { padding: 12px; background: var(--peach); border-radius: 8px; }
.onboarding-form { display: grid; gap: 16px; margin-bottom: 24px; }
.onboarding-progress { border-left: 4px solid var(--orange); }
.onboarding-progress progress { display: block; height: 12px; margin: 0 0 12px; }
.admin-body .onboarding-option { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 12px; margin: 0; padding: 14px 0; font-size: 15px; font-weight: 400; cursor: pointer; }
.onboarding-option + .onboarding-option { border-top: 1px solid var(--line); }
.onboarding-option input { width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--orange-ink); }
.onboarding-option-text { display: grid; gap: 3px; }

@media (max-width: 800px) { .email-style-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .email-example { height: 730px; } .hospital-summary .summary-top { flex-wrap: wrap; } }
