:root {
    color-scheme: light;
    --bg: #f6f7f4;
    --panel: #ffffff;
    --text: #172f3b;
    --muted: #62747c;
    --accent: #176b68;
    --accent-hover: #10534f;
    --accent-soft: #eaf4f0;
    --danger: #a93635;
    --border: #dde4e3;
    --radius: 16px;
    --shadow: 0 4px 24px rgb(23 47 59 / 3%);
    --body-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    --control-corner-radius: 8;
    --layer-corner-radius: 16;
    --base-height-multiplier: 10;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body-font); font-size: 14px; line-height: 1.6; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; }
button, a, fluent-button, fluent-anchor { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #27948e; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--text); line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 2.6vw, 2.2rem); font-weight: 650; letter-spacing: -1.1px; }
h2 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.35px; }
h3 { font-size: 1rem; font-weight: 650; }
.app-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 2000; padding: .75rem 1.25rem; background: white; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* Workspace shell */
.page { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; padding: 2.25rem 1.25rem 1.5rem; background: #142e3a; color: #e4edee; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 .5rem; color: #fff; text-decoration: none; }
.brand:hover { color: white; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 46px; border: 1px solid #527878; border-radius: 16px 16px 5px 5px; color: #acd4c8; }
.brand-name { display: block; font-size: 22px; font-weight: 650; letter-spacing: -0.8px; line-height: 1.15; }
.brand-dot { color: #a3c4b2; }
.brand-caption { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; letter-spacing: 1.8px; color: #a6bbbf; }
.nav-section-label { margin: 3.3rem .9rem .8rem; font-size: 12px; font-weight: 600; letter-spacing: 1.7px; color: #92aeb6; text-transform: uppercase; }
.sidebar-links, .sidebar-bottom { display: flex; flex-direction: column; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: .8rem .9rem; border-radius: 8px; color: #bccdd2; text-decoration: none; font-size: 13px; line-height: 1.5; transition: background-color .15s, color .15s; }
.nav-link:hover { background: #203d48; color: white; }
.nav-link.active { color: #fff; background: #294b54; box-shadow: inset 3px 0 #a5cbbb; font-weight: 600; }
.nav-link.active .app-icon { color: #b7dfd0; }
.nav-register { margin-top: 4px; border: 1px solid #3b5963; }
.sidebar-note { display: flex; gap: 12px; padding: 1.25rem .65rem; margin-bottom: .8rem; border-bottom: 1px solid #2b4651; }
.sidebar-note > .app-icon { color: #aacbbc; margin-top: 3px; }
.sidebar-note strong, .sidebar-note span { display: block; }
.sidebar-note strong { font-size: 12px; font-weight: 500; }
.sidebar-note span { font-size: 13px; margin-top: 4px; color: #9ab2bb; }
.account-summary { display: flex; gap: 10px; align-items: center; padding: .5rem; }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; background: #dceae2; color: #254e51; border-radius: 50%; font-size: 13px; font-weight: 700; }
.account-details { min-width: 0; }
.account-label { display: block; color: #94adb5; font-size: 12px; }
.nav-user { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sidebar-logout { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #c3d2d6; padding: .6rem; text-align: left; border-radius: 8px; font-size: 12px; }
.sidebar-logout:hover { background: #203d48; color: white; }
.workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; padding: 1rem 3rem; border-bottom: 1px solid var(--border); background: rgb(255 255 255 / 55%); }
.workspace-label { font-size: 12px; font-weight: 600; }
.workspace-label > span { display: inline-block; margin: 0 12px; color: #a4b0b4; font-weight: 400; }
.workspace-tag { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.status-dot { width: 6px; height: 6px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #609781; }
.app-main { flex: 1; padding: 2.5rem 3rem 3rem; min-width: 0; }
.app-main:focus { outline: none; }
.content { width: 100%; max-width: 1200px; margin: 0 auto; }
.workspace-footer { display: flex; justify-content: space-between; gap: 1rem; margin: 0 3rem; padding: 1.25rem 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.page-stack, .schedules-page { display: flex; flex-direction: column; gap: 24px; }
.page-header, .schedules-header { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.eyebrow { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1.9px; color: var(--accent); text-transform: uppercase; }
.page-description { color: var(--muted); margin-top: 10px; max-width: 640px; font-size: 14px; }
.header-note { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.section-title { display: flex; align-items: center; gap: 10px; }
.hint { font-size: 12px; color: var(--muted); }
.panel, fluent-card { display: block; min-width: 0; padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button-link { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 40px; padding: 10px 18px; border-radius: 8px; background: var(--accent); color: white; font-weight: 600; font-size: 12px; text-decoration: none; transition: background .15s; }
.button-link:hover { color: white; background: var(--accent-hover); }
.button-light { background: #f4f5e9; color: #20433f; }
.button-light:hover { background: white; color: #20433f; }
fluent-button::part(control), fluent-anchor::part(control) { font-weight: 600; font-family: var(--body-font); font-size: 12px; min-height: 38px; padding-inline: 16px; border-radius: 8px; }
.dialog-heading fluent-button::part(control) { padding-inline: 10px; }
fluent-button .app-icon, fluent-anchor .app-icon { margin-right: 7px; }
fluent-button.button-danger::part(control) { color: var(--danger); }
fluent-button.button-danger::part(control):hover { background: #fbedeb; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: inherit; }
.icon-button:hover { background: rgb(0 0 0 / 5%); }

/* Overview */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 332px; padding: 40px; border-radius: 18px; overflow: hidden; background: #1d4148; color: #d4e3df; }
.hero-content { position: relative; z-index: 1; max-width: 540px; width: 66%; }
.hero-kicker { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; letter-spacing: 1.7px; color: #c2d4c7; }
.hero-kicker .status-dot { background: #c2d4c7; }
.hero h2 { margin: 18px 0 16px; font-size: clamp(2.4rem, 3.8vw, 3.4rem); letter-spacing: -1.8px; line-height: 1.08; font-weight: 550; color: #fff; }
.hero h2 span { color: #bdd5c6; }
.hero p { max-width: 410px; margin-bottom: 24px; font-size: 13px; line-height: 1.8; color: #bed1d2; }
.hero-login { color: #e0ebe6; font-size: 13px; }
.hero-login:hover { color: white; }
.coastal-art { position: absolute; right: 36px; bottom: 0; width: 280px; height: 308px; }
.arch { position: absolute; bottom: 0; border-radius: 150px 150px 0 0; }
.arch-outer { inset: 0 0 0; border: 1px solid #628482; }
.arch-middle { inset: 18px 18px 0; border: 1px solid #628482; }
.arch-inner { inset: 36px 36px 0; overflow: hidden; background: #b3c7b9; }
.art-sun { position: absolute; top: 41px; right: 37px; width: 56px; height: 56px; border-radius: 50%; background: #f1d9a2; }
.art-sea { position: absolute; inset: 132px -70px -30px; border-radius: 48% 48% 0 0; background: #477f7b; transform: rotate(-15deg); }
.art-sea::after { content: ""; position: absolute; inset: 39px -20px -40px; border-radius: 45%; background: #285d62; transform: rotate(28deg); }
.art-caption { position: absolute; right: 45px; bottom: 21px; z-index: 1; color: #c5d9ce; font-size: 12px; letter-spacing: 1px; }
/* Use case highlight: the DIEM day/night flip */
.usecase-panel { padding: 36px 40px; border: 1px solid #d8c9a8; border-radius: 18px; background: #fbf6ea; }
.usecase-badge { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; letter-spacing: 1.7px; color: #917040; }
.usecase-badge .status-dot { background: #917040; }
.usecase-panel h2 { margin: 14px 0 12px; font-size: clamp(1.7rem, 2.6vw, 2.3rem); letter-spacing: -1.2px; line-height: 1.12; font-weight: 550; color: var(--text); }
.usecase-panel p { max-width: 640px; font-size: 13px; line-height: 1.8; color: #4c5a56; }
.usecase-panel a { color: var(--accent); font-weight: 600; }
.usecase-panel a:hover { text-decoration: underline; }
.usecase-hint { margin-top: 12px; font-size: 12px; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature-card { position: relative; display: flex; flex-direction: column; padding: 24px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: white; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.feature-card:hover { color: var(--text); border-color: #adc4bb; transform: translateY(-3px); box-shadow: 0 8px 24px rgb(23 47 59 / 6%); }
.feature-icon, .empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 22px; background: var(--accent-soft); color: var(--accent); border-radius: 13px; }
.feature-icon-blue { background: #ebf0f7; color: #506b8e; }
.feature-icon-sand { background: #f6efe1; color: #917040; }
.feature-step { font-size: 12px; color: var(--muted); letter-spacing: 1.3px; font-weight: 600; margin-bottom: 8px; }
.feature-card h3 { font-size: 17px; letter-spacing: -.3px; margin-bottom: 10px; }
.feature-card p { color: var(--muted); font-size: 12px; line-height: 1.8; margin-bottom: 24px; }
.feature-link { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: auto; font-size: 13px; color: var(--accent); font-weight: 650; }
.getting-started { display: grid; grid-template-columns: 1fr 1.55fr; gap: 32px; padding: 30px; }
.getting-started-intro h2 { font-size: 25px; font-weight: 550; letter-spacing: -.7px; }
.getting-started-intro p:last-child { font-size: 12px; color: var(--muted); max-width: 220px; margin-top: 12px; }
.setup-steps { display: flex; flex-direction: column; gap: 20px; list-style: none; padding: 0; margin: 0; }
.setup-steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-number { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 50%; background: #f1f4f0; border: 1px solid #dfe7df; color: var(--accent); font-size: 13px; font-weight: 650; }
.setup-steps h3 { font-size: 12px; margin: 2px 0 4px; }
.setup-steps p { font-size: 13px; color: var(--muted); }

/* Forms and authentication */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); max-width: 1000px; margin: 1.5rem auto; border-radius: 20px; border: 1px solid var(--border); background: white; overflow: hidden; box-shadow: var(--shadow); }
.auth-aside { padding: 48px 36px; background: #eaf0e9; display: flex; flex-direction: column; align-items: flex-start; }
.auth-aside h2 { font-size: 35px; line-height: 1.17; letter-spacing: -1.1px; font-weight: 550; margin: 32px 0 18px; }
.auth-aside > p { color: #506963; font-size: 13px; max-width: 260px; }
.auth-benefits { list-style: none; display: flex; flex-direction: column; gap: 18px; padding: 0; margin: 36px 0; font-size: 12px; }
.auth-benefits li { display: flex; align-items: center; gap: 10px; color: #315951; }
.auth-aside-footer { margin-top: auto; padding-top: 24px; border-top: 1px solid #cfdcd0; width: 100%; font-size: 12px; color: #506963; }
.auth-card { padding: 44px 36px; min-width: 0; }
.auth-card h1 { font-size: 28px; letter-spacing: -.8px; }
.auth-card .page-description { font-size: 12px; }
.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.form-field, .auth-form fluent-text-field, .form-group > fluent-text-field { width: 100%; min-width: 0; }
fluent-text-field::part(root), fluent-select::part(control) { border-radius: 8px; min-height: 40px; }
fluent-text-field::part(label), fluent-select::part(label) { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
fluent-text-field::part(control) { font-size: 13px; font-family: var(--body-font); }
.form-group { min-width: 0; }
.field-help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-submit::part(control) { min-height: 44px; }
.auth-alt { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; text-align: center; }
.auth-alt a { font-weight: 650; margin-left: 4px; }
.validation-message { color: var(--danger); font-size: 13px; margin-top: 5px; }
.validation-errors { list-style: none; margin: 0; padding: 12px; color: var(--danger); background: #fff3f0; border-radius: 8px; font-size: 12px; }
.auth-form + .notice, .add-key-form + .notice { margin-top: 20px; }
.add-key-form { display: grid; grid-template-columns: minmax(140px, .9fr) minmax(200px, 1.5fr) auto; align-items: start; gap: 18px; margin-top: 24px; }
.add-key-submit { margin-top: 25px; margin-inline: 12px; }
.page-header fluent-button, .collection-heading fluent-button { margin-inline: 12px; }
.add-key-form .field-help { min-height: 18px; }
.panel-heading { display: flex; align-items: flex-start; gap: 12px; }
.panel-heading > .feature-icon { width: 38px; height: 38px; margin: 0; border-radius: 10px; }
.panel-heading p { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Feedback and collections */
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border: 1px solid #cee2dc; background: #eef5f1; color: #315e53; border-radius: 12px; min-width: 0; width: 100%; }
.notice-error { color: #8d3431; border-color: #edcfca; background: #fff3f0; }
.notice-success { color: #2d624d; border-color: #cce1d3; background: #eff7ef; }
.notice-warning { color: #80602c; border-color: #e8dcb8; background: #fbf7e9; }
.notice-icon { display: flex; flex-shrink: 0; padding-top: 1px; }
.notice-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice-title { display: block; font-size: 12px; font-weight: 650; line-height: 1.6; }
.notice-description { font-size: 12px; line-height: 1.7; margin-top: 3px; }
.notice-description a { color: inherit; font-weight: 600; }
.notice-description .button-row { margin-top: 12px; }
.loading-state, .empty-state { display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; padding: 52px 24px; background: white; border: 1px solid var(--border); border-radius: var(--radius); min-height: 230px; }
.loading-state { gap: 16px; color: var(--muted); font-size: 13px; }
.loading-state fluent-progress-ring { width: 30px; height: 30px; }
.empty-state .empty-icon { margin-bottom: 18px; width: 56px; height: 56px; }
.empty-state h2 { font-size: 19px; }
.empty-state p { max-width: 430px; color: var(--muted); margin: 10px auto 22px; font-size: 13px; }
.empty-state .button-row { justify-content: center; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-card { display: flex; gap: 16px; align-items: center; padding: 20px 24px; }
.stat-card .feature-icon { margin: 0; width: 42px; height: 42px; border-radius: 11px; }
.stat-value { display: block; font-size: 25px; font-weight: 600; letter-spacing: -.8px; line-height: 1.2; }
.stat-label { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.collection-panel { padding: 0; overflow: hidden; }
.collection-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 22px 24px; }
.collection-heading p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px; background: #edf1ef; border-radius: 5px; font-size: 12px; font-weight: 600; color: #536b68; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.keys-grid { width: 100%; min-width: 640px; --fluent-data-grid-row-border-color: var(--border); --fluent-data-grid-header-opacity: 1; font-size: 12px; }
.keys-grid thead th { background: #f7f9f7; }
.keys-grid th { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.keys-grid th.column-header,
.keys-grid th.column-header > div,
.keys-grid th.column-header .col-title-text { text-align: left !important; }
.keys-grid th.column-header .col-sort-button::part(control) { justify-content: flex-start !important; }
.keys-grid td, .keys-grid th { height: auto !important; min-height: 52px; padding: 14px 20px !important; vertical-align: middle; }
.keys-grid td { overflow: visible !important; }
.keys-grid td:first-child, .keys-grid th:first-child { padding-left: 24px !important; }
.keys-grid tbody tr:last-child td { border-bottom: 0; }
.keys-grid tbody tr:hover td { background: #f9fbf8; }
.key-name { font-weight: 600; overflow-wrap: anywhere; display: block; }
.key-description { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.key-code, .keys-grid code { display: inline-block; padding: 4px 8px; background: #f1f4f2; color: #506765; border: 1px solid #e2e9e5; border-radius: 5px; font-size: 13px; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; background: #edf2f0; color: #546967; border-radius: 5px; white-space: nowrap; font-size: 12px; font-weight: 600; }
.badge-success { background: #eaf5ee; color: #2d7351; }
.badge-muted { background: #f0f1f2; color: #657078; }
.badge-sand { background: #f8f0e1; color: #89662b; }
.badge-trigger-manual { background: #fff1dc; color: #8a5a00; }
.badge-trigger-automatic { background: #e8f1fb; color: #1d5b8e; }
.schedules-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.schedules-link:hover { text-decoration: underline; }
.row-actions { display: flex; align-items: center; gap: 2px; }
.collection-footer { padding: 13px 24px; background: #fafbf9; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.confirmation-panel { padding: 18px; margin: 0 24px 20px; border: 1px solid #edcfca; border-radius: 10px; background: #fff6f3; }
.confirmation-panel p { font-size: 12px; margin: 6px 0 14px; color: var(--muted); overflow-wrap: anywhere; }

/* Admin page */
.admin-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.admin-search { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f4f7f5; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.admin-search input { border: 0; background: transparent; outline: none; font-size: 12px; color: var(--text); min-width: 200px; }
.feature-icon-green { background: #eaf5ee; color: #2d7351; }
.panel-inline { display: flex; padding: 20px 24px; }
.signup-chart { width: 100%; }
.signup-chart svg { display: block; width: 100%; height: 150px; }
.signup-chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* About page */
.about-panel { max-width: 640px; }
.about-lead { font-size: 15px; color: var(--muted); margin-top: 14px; }
.about-facts { display: flex; flex-direction: column; gap: 14px; margin: 24px 0; }
.about-fact { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: #fafbf9; border: 1px solid var(--border); border-radius: 10px; }
.about-fact .app-icon { flex: 0 0 auto; margin-top: 2px; color: var(--accent); }
.about-fact strong { display: block; font-size: 13px; }
.about-fact span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.about-contact { border-top: 1px solid var(--border); padding-top: 20px; }
.about-contact p { margin-top: 8px; color: var(--muted); }

/* Schedules and editor */
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-size: 12px; }
.back-link:hover { color: var(--accent); }
.key-subtitle { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; overflow-wrap: anywhere; }
.schedule-list { display: flex; flex-direction: column; gap: 14px; }
.schedule-item-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.schedule-when { display: flex; gap: 12px; min-width: 0; }
.schedule-when > .app-icon { color: var(--muted); margin-top: 2px; }
.schedule-when > div { min-width: 0; }
.schedule-days { border: 0; padding: 0; margin: 0; min-width: 0; }
.delete-schedule-summary { padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fafbf9; }
.delete-schedule-summary strong { font-size: 13px; }
.run-history-empty { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 24px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 12px; }
.empty-state h1 { font-size: 22px; letter-spacing: -.4px; }
.schedule-when-primary { font-size: 15px; font-weight: 650; }
.schedule-when-secondary { font-size: 12px; color: var(--muted); margin-top: 8px; }
.schedule-meta { font-size: 13px; color: var(--muted); margin-top: 12px; }
/* Key overview: prominently identifies the API key schedules are managed for. */
.key-overview { display: flex; flex-direction: column; gap: 14px; }
.key-overview-main { display: flex; align-items: flex-start; gap: 14px; }
.key-overview-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: #edf5ef; color: var(--accent); flex-shrink: 0; }
.key-overview-text { min-width: 0; }
.key-overview-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 2px; }
.key-overview-name { font-size: 22px; font-weight: 680; letter-spacing: -.3px; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.key-overview-id { font-size: 12px; color: var(--muted); margin: 5px 0 0; overflow-wrap: anywhere; }
.key-overview-id code { font-size: 13px; }
.key-overview-settings { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.live-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.live-setting { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; background: #fafbf9; border: 1px solid var(--border); border-radius: 8px; }
.live-setting-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.live-setting-value { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.schedule-item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
fluent-accordion { border: 1px solid var(--border); border-radius: var(--radius); background: white; overflow: hidden; }
fluent-accordion-item::part(heading) { padding: 10px 18px; }
fluent-accordion-item::part(panel) { padding: 0 24px 24px; }
.dialog-card { background: white; color: var(--text); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 90px rgb(15 40 49 / 25%); padding: 28px; width: min(600px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; overflow-y: auto; }
.dialog-card::backdrop { background: rgb(13 34 44 / 55%); backdrop-filter: blur(4px); }
/* Keep long option lists (e.g. the 96 time entries in the schedule editor) scrollable while the dialog stays on screen. */
.dialog-card fluent-select::part(listbox) { max-height: min(320px, 45dvh); overflow-y: auto; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.dialog-heading h2 { font-size: 23px; }
.dialog-heading p { font-size: 12px; color: var(--muted); margin-top: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.field-label { min-width: 80px; font-size: 12px; font-weight: 600; }
.form-row-top { align-items: flex-start; }
.schedule-form { width: 100%; }
.dialog-utc-clock { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; color: var(--muted); }
.dialog-utc-clock strong { color: var(--text); font-variant-numeric: tabular-nums; }
.w-160 { width: 160px; max-width: 100%; }
.w-120 { width: 120px; max-width: 100%; }
.limits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.limit-box { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fafbf9; }
.limit-box.limit-on { border-color: #8fb9a9; background: #f1f7f1; }
.limit-box fluent-text-field { width: 100%; }
.day-checkboxes { display: flex; flex-wrap: wrap; gap: 6px; }
.day-checkbox { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 7px; padding: 9px 10px; cursor: pointer; font-size: 13px; user-select: none; }
.day-checkbox:has(input:checked) { border-color: var(--accent); color: var(--accent); background: #edf5ef; }
.day-checkbox input { accent-color: var(--accent); cursor: pointer; margin: 0; }
.run-log-list { display: flex; flex-direction: column; gap: 12px; }
.run-log-item { border: 1px solid var(--border); border-left: 3px solid #669780; border-radius: 8px; padding: 14px 16px; background: #fcfdfb; }
.run-log-fail { border-left-color: var(--danger); }
.run-log-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
.run-log-status { font-size: 12px; font-weight: 650; color: #2d7351; }
.run-log-fail .run-log-status { color: var(--danger); }
.run-log-details { font-size: 12px; color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.run-log-error { color: var(--danger); background: #fff3f0; border-radius: 5px; padding: 8px 10px; font-size: 13px; margin-top: 10px; overflow-wrap: anywhere; }

/* Startup and recovery */
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; background: var(--bg); }
.boot-mark { width: 56px; height: 64px; padding: 14px; border-radius: 24px 24px 8px 8px; background: #1d4148; color: #c2d8c8; }
.boot-title { font-size: 20px; font-weight: 650; color: var(--text); }
.boot-caption { color: var(--muted); font-size: 12px; }
.boot-progress { width: 160px; height: 3px; overflow: hidden; border-radius: 3px; background: #dfe7e1; }
.boot-progress::after { content: ""; display: block; height: 100%; width: var(--blazor-load-percentage, 10%); background: var(--accent); transition: width .2s; }
#blazor-error-ui { display: none; position: fixed; z-index: 2100; left: 16px; right: 16px; bottom: 16px; max-width: 740px; margin: auto; padding: 18px 44px 18px 20px; border: 1px solid #edcfca; border-radius: 12px; box-shadow: 0 8px 30px rgb(23 47 59 / 15%); background: #fff3f0; color: #8d3431; font-size: 12px; }
#blazor-error-ui strong { display: block; margin-bottom: 4px; }
#blazor-error-ui a { color: inherit; font-weight: 600; margin-left: 6px; }
#blazor-error-ui .dismiss { position: absolute; right: 8px; top: 8px; font-size: 20px; }

@media (min-width: 1600px) {
    .app-main { padding-top: 3rem; }
    .hero { min-height: 360px; padding: 44px; }
    .coastal-art { right: 64px; width: 300px; height: 330px; }
}

@media (max-width: 1150px) {
    .sidebar { width: 222px; padding-left: 14px; padding-right: 14px; }
    .workspace-header { padding-left: 28px; padding-right: 28px; }
    .app-main { padding: 28px; }
    .workspace-footer { margin: 0 28px; }
    .hero { padding: 30px; }
    .coastal-art { right: 20px; width: 220px; height: 268px; }
    .hero-content { width: 65%; }
    .hero p { max-width: 320px; }
    .feature-grid { gap: 12px; }
    .feature-card { padding: 20px; }
    .auth-aside, .auth-card { padding: 32px 26px; }
    .add-key-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
    .add-key-submit { margin: 0; grid-column: 1 / -1; justify-self: start; }
    .stat-card { padding: 18px; gap: 12px; }
}

@media (max-width: 800px) {
    .page { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; padding: 18px 20px 14px; gap: 12px; }
    .sidebar-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
    .brand { padding: 0; }
    .brand-mark { width: 33px; height: 37px; border-radius: 12px 12px 4px 4px; }
    .brand-mark svg { width: 22px; }
    .brand-name { font-size: 19px; }
    .brand-caption { font-size: 8px; letter-spacing: 1.4px; margin-top: 3px; }
    .nav-section-label, .sidebar-note { display: none; }
    .sidebar-links { flex-direction: row; flex-wrap: wrap; gap: 5px; }
    .nav-link { font-size: 12px; padding: 10px 12px; gap: 8px; }
    .nav-link .app-icon { width: 17px; height: 17px; }
    .sidebar-bottom { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: center; border-top: 1px solid #2b4651; padding-top: 10px; }
    .nav-register { margin: 0; }
    .account-summary { margin-right: auto; max-width: calc(100% - 90px); padding: 0; }
    .account-avatar { width: 27px; height: 27px; font-size: 13px; }
    .account-label { display: none; }
    .workspace-header { min-height: 52px; padding: 14px 24px; }
    .app-main { padding: 28px 24px; }
    .workspace-footer { margin: 0 24px; }
    .auth-layout { margin: 0 auto; }
    .hero-content { width: 63%; }
    .coastal-art { right: 24px; }
    .getting-started { gap: 24px; padding: 24px; }
    .header-note { display: none; }
}

@media (max-width: 600px) {
    .sidebar { padding: 16px; }
    .sidebar-top { gap: 18px; }
    .sidebar-links { width: 100%; }
    .nav-link { font-size: 13px; padding: 9px 10px; }
    .workspace-header { padding: 12px 20px; }
    .workspace-label { font-size: 13px; }
    .workspace-tag { font-size: 12px; }
    .workspace-tag .status-dot { display: none; }
    .app-main { padding: 24px 16px; }
    .page-stack, .schedules-page { gap: 20px; }
    .page-description { font-size: 12px; }
    .page-header, .schedules-header { align-items: flex-start; }
    .hero { padding: 28px 24px; min-height: 330px; }
    .hero-content { width: 100%; }
    .hero h2 { font-size: 42px; }
    .hero p { max-width: 90%; }
    .hero .button-row { align-items: flex-start; flex-direction: column; gap: 16px; }
    .coastal-art { opacity: .12; right: -80px; bottom: -40px; width: 250px; height: 310px; }
    .art-caption { display: none; }
    .feature-grid { grid-template-columns: 1fr; gap: 14px; }
    .feature-card { padding: 24px; }
    .feature-icon { margin-bottom: 16px; }
    .feature-card p { max-width: 100%; margin-bottom: 18px; }
    .getting-started { grid-template-columns: 1fr; }
    .getting-started-intro h2 br { display: none; }
    .getting-started-intro p:last-child { max-width: none; }
    .setup-steps { border-top: 1px solid var(--border); padding-top: 24px; }
    .workspace-footer { margin: 0 16px; font-size: 12px; }
    .workspace-footer span:last-child { display: none; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-aside { padding: 24px; }
    .auth-aside h2 { font-size: 25px; margin: 10px 0; }
    .auth-aside > p { max-width: none; font-size: 12px; }
    .auth-aside .feature-icon, .auth-benefits, .auth-aside-footer { display: none; }
    .auth-card { padding: 28px 24px; }
    .auth-card h1 { font-size: 26px; }
    .panel, fluent-card { padding: 20px; }
    .collection-panel { padding: 0; }
    .collection-heading { padding: 20px; }
    .add-key-form { grid-template-columns: 1fr; gap: 16px; }
    .add-key-submit { justify-self: stretch; }
    .stat-grid { gap: 8px; }
    .stat-card { padding: 14px 10px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .stat-card .feature-icon { width: 30px; height: 30px; border-radius: 8px; }
    .stat-card .feature-icon .app-icon { width: 18px; }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 12px; }
    .notice { padding: 14px; gap: 10px; }
    .notice-title, .notice-description { font-size: 13px; }
    .dialog-card { padding: 22px; width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
    .dialog-heading h2 { font-size: 21px; }
    .field-label { min-width: 100%; }
    .limits-grid { grid-template-columns: 1fr; }
    .schedule-item-main { flex-wrap: wrap; }
    .schedule-when-primary { font-size: 14px; }
    .schedule-item-actions { justify-content: flex-start; }
    .schedule-meta { line-height: 1.8; }
    .confirmation-panel { margin: 0 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
    .nav-link.active { border-left: 3px solid Highlight; }
    .status-badge, .notice, .button-link, .feature-icon { border: 1px solid CanvasText; }
}
