:root {
    --ink: #102a2e;
    --muted: #6d7f81;
    --line: #dfe9e7;
    --soft: #f4f8f7;
    --paper: #ffffff;
    --green: #09a976;
    --green-dark: #087b5c;
    --green-soft: #dff6ec;
    --nav: #102d31;
    --nav-soft: #173b3e;
    --blue: #3478f6;
    --amber: #e49a24;
    --red: #db4f5b;
    --shadow: 0 14px 40px rgba(20, 58, 57, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--soft); }
body { margin: 0; color: var(--ink); background: var(--soft); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 244px; flex-direction: column; padding: 24px 16px 16px; color: #d7e9e6; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand-mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #08cf72, #06b964); box-shadow: 0 9px 22px rgba(9, 190, 133, .24); font-weight: 800; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-mark.compact { width: 29px; height: 29px; border-radius: 9px; box-shadow: none; }
.brand-mark.compact img { width: 100%; height: 100%; }
.brand strong { display: block; color: #fff; font-size: 20px; letter-spacing: .03em; }
.brand strong em, .story-brand strong em { color: #10ce7c; font-style: normal; }
.brand small { display: block; margin-top: 1px; color: #78999a; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.nav-list { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 5px; overflow: auto; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; color: #aac0c0; font-weight: 600; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: var(--nav-soft); box-shadow: inset 3px 0 var(--green); }
.nav-icon { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; font-size: 11px; }
.nav-item.active .nav-icon { color: #51e2b1; border-color: rgba(81,226,177,.25); background: rgba(13,169,118,.12); }
.nav-label { margin: 21px 12px 4px; color: #59797b; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 8px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #0d5e48; background: #ccefe3; font-weight: 800; }
.avatar.small { width: 32px; height: 32px; }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { color: #eef8f6; font-size: 12px; }
.sidebar-user-copy small { margin-top: 2px; color: #708e8f; font-size: 10px; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 8px; color: #819d9e; background: transparent; cursor: pointer; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.07); }
.logout-button { width: auto; min-width: 42px; padding: 0 7px; white-space: nowrap; }

.main-area { min-height: 100vh; margin-left: 244px; }
.page-wrap { width: min(1460px, 100%); margin: 0 auto; padding: 34px 38px 48px; }
.mobile-header { display: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 3px 0 5px; font-family: Georgia, "Songti SC", serif; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -.025em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 !important; color: var(--green-dark) !important; font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow.light { color: #6fe5bb !important; }
.heading-actions { display: flex; gap: 10px; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green); box-shadow: 0 8px 20px rgba(9,169,118,.18); }
.button.primary:hover { background: #07966a; }
.button.secondary { color: #245b54; border-color: #c9dcda; background: #fff; }
.button.secondary:hover, .button.ghost:hover { background: #edf5f3; }
.button.ghost { color: #55706f; background: transparent; }
.button.danger-outline { color: var(--red); border-color: #f1c7cb; background: #fff; }
.button.wide { width: 100%; }
.button.is-loading, .mini-button.is-loading { cursor: wait; opacity: .72; pointer-events: none; }
.button.is-loading::before, .mini-button.is-loading::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.mini-button.is-loading { display: inline-flex; align-items: center; gap: 5px; }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-summary { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 30px; min-height: 202px; margin-bottom: 18px; padding: 30px 34px; overflow: hidden; border-radius: 22px; color: #fff; background: linear-gradient(125deg, #123d3d 0%, #0c5c4e 65%, #087a5a 100%); box-shadow: 0 18px 44px rgba(14,70,65,.16); }
.hero-summary::after { content: ""; position: absolute; right: -60px; bottom: -110px; width: 300px; height: 300px; border: 45px solid rgba(106,235,188,.08); border-radius: 50%; }
.hero-label { margin: 0 0 7px; color: #a8d3ca; font-weight: 700; }
.hero-number { font-family: Georgia, serif; font-size: 66px; font-weight: 500; line-height: .95; }
.hero-unit { margin-left: 7px; color: #c6e3dc; }
.hero-note { margin: 14px 0 0; color: #9fc9c1; font-size: 12px; }
.hero-progress { display: flex; align-items: center; gap: 16px; padding-left: 28px; border-left: 1px solid rgba(255,255,255,.14); }
.hero-progress b { display: block; margin-bottom: 4px; }
.hero-progress p { margin: 0; color: #9fc9c1; font-size: 11px; }
.ring { --progress: 0; display: grid; width: 84px; height: 84px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(#5ee2b4 calc(var(--progress) * 1%), rgba(255,255,255,.1) 0); }
.ring::before { content: ""; grid-area: 1/1; width: 66px; height: 66px; border-radius: 50%; background: #12584e; }
.ring span { z-index: 1; grid-area: 1/1; font-size: 21px; font-weight: 800; }
.ring small { font-size: 10px; }
.hero-bars { position: relative; z-index: 1; display: grid; gap: 7px; }
.hero-bars div { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 9px; background: rgba(255,255,255,.07); }
.hero-bars span { color: #b8d8d1; font-size: 11px; }
.hero-bars b { font-size: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: 0 7px 24px rgba(29,71,68,.045); }
.stat-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; font-weight: 800; }
.stat-card.blue .stat-icon { color: #2865c7; background: #e7f0ff; }
.stat-card.amber .stat-icon { color: #a66c11; background: #fff1d9; }
.stat-card.green .stat-icon { color: #087b5c; background: var(--green-soft); }
.stat-card.red .stat-icon { color: #b43a46; background: #ffe7e9; }
.stat-card p { margin: 0 0 2px; color: var(--muted); font-size: 11px; }
.stat-card strong { font-family: Georgia, serif; font-size: 28px; font-weight: 600; }
.stat-card > small { align-self: end; color: #9aabab; font-size: 9px; text-align: right; }

.panel { margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 23px 17px; }
.panel-header h2, .import-panel h2, .guide-panel h2 { margin: 0; font-size: 17px; }
.panel-header p, .import-panel > p, .guide-panel > p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.count-pill { padding: 4px 9px; border-radius: 999px; color: #51706c; background: #edf4f2; font-size: 10px; font-weight: 800; }
.text-link { color: var(--green-dark); font-size: 12px; font-weight: 800; }
.table-wrap { overflow-x: auto; border-top: 1px solid #edf1f0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 16px; color: #819292; background: #fbfcfc; font-size: 9px; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 16px; border-top: 1px solid #eff3f2; vertical-align: middle; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.data-table .platform-group-row td { padding: 9px 16px; border-top: 10px solid #f2f7f5; background: #edf8f4; color: #0b6956; }
.data-table .platform-group:first-of-type .platform-group-row td { border-top-width: 0; }
.platform-group-row div { display: flex; align-items: center; gap: 9px; }
.platform-group-row .platform-dot { width: 25px; height: 25px; border-radius: 8px; font-size: 11px; }
.platform-group-row strong { font-size: 13px; }
.platform-group-row [data-platform-visible-count], .platform-group-row [data-admin-platform-visible-count] { margin-left: auto; color: #6d8b85; font-size: 10px; font-weight: 700; }
.platform-summary-row td.number-cell { font-weight: 900; }
.date-sync-form { display: flex; align-items: end; gap: 9px; }
.date-sync-form label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.date-sync-form .button { min-height: 34px; }
.date-sync-form select.compact-field { max-width: 190px; }
.account-cell { display: flex; min-width: 190px; align-items: center; gap: 10px; }
.account-cell strong, .account-cell small { display: block; }
.account-cell small { max-width: 230px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.platform-dot { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #08664e; background: #dff4ec; font-weight: 900; }
.platform-dot.large { width: 42px; height: 42px; }
.badge { display: inline-flex; align-items: center; gap: 5px; margin: 2px 4px 2px 0; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.success { color: #087651; background: #ddf5ea; }
.badge.danger { color: #b83c49; background: #ffe5e8; }
.badge.warning { color: #96600b; background: #fff0d5; }
.badge.neutral { color: #647778; background: #edf2f1; }
.number-cell { font-variant-numeric: tabular-nums; font-weight: 800; }
.number-cell.positive { color: var(--green-dark); }
.number-cell.negative { color: var(--red); }
.number-cell.warning { color: var(--amber); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.block { display: block; margin-top: 3px; font-size: 10px; }
.align-right { text-align: right !important; }
.row-muted { opacity: .58; }
.error-hint { display: block; max-width: 170px; margin-top: 4px; overflow: hidden; color: var(--red); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.error-hint.expanded { max-width: 260px; white-space: normal; }
.warning-text { color: #b87a18; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.row-actions form { display: inline-flex; }
.mini-button { padding: 5px 8px; border: 1px solid #dce7e5; border-radius: 7px; color: #4f6867; background: #fff; cursor: pointer; font-size: 10px; font-weight: 700; }
.mini-button:hover { border-color: #b9d1cd; background: #f2f8f6; }
.mini-button:disabled { cursor: not-allowed; opacity: .4; }
.compact-field { width: auto; min-width: 92px; padding: 5px 28px 5px 8px; font-size: 11px; }
.danger-text { color: var(--red) !important; }

.empty-state { padding: 58px 24px 65px; text-align: center; }
.empty-state > span { display: grid; width: 52px; height: 52px; margin: 0 auto 13px; place-items: center; border-radius: 15px; color: var(--green-dark); background: var(--green-soft); font-weight: 900; }
.empty-state h3 { margin: 0 0 7px; }
.empty-state p { margin: 0 auto 19px; color: var(--muted); font-size: 12px; }
.device-strip, .api-hint { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 20px; border: 1px solid #d6e7e2; border-radius: 14px; background: #eaf7f2; }
.device-strip > div { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 8px; }
.device-strip small { grid-column: 2; color: #6e8682; font-size: 10px; }
.live-pulse, .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(9,169,118,.11); }

.form-panel { max-width: 820px; padding: 26px; }
.narrow-panel { max-width: 560px; padding: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; }
.form-stack { display: grid; gap: 16px; }
.management-create-form { padding: 0 23px 23px; }
.management-create-form .field { width: 100%; }
.field-label { display: grid; gap: 7px; color: #354d4e; font-size: 11px; font-weight: 800; }
.field-label small { color: #829293; font-size: 9px; font-weight: 500; }
.full { grid-column: 1 / -1; }
.field { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #cfdddb; border-radius: 9px; outline: none; color: var(--ink); background: #fbfdfc; transition: border .15s, box-shadow .15s; }
.field:focus { border-color: #53b99a; background: #fff; box-shadow: 0 0 0 3px rgba(9,169,118,.09); }
.textarea { resize: vertical; }
.password-field { position: relative; display: block; }
.password-field .field { padding-right: 58px; }
.password-toggle { position: absolute; top: 50%; right: 8px; padding: 4px 6px; transform: translateY(-50%); border: 0; color: var(--green-dark); background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; }
.switch-line { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid #dce7e5; border-radius: 11px; background: #f8fbfa; cursor: pointer; }
.switch-line input { display: none; }
.switch-line > span { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: #b9c7c5; transition: .2s; }
.switch-line > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.14); transition: .2s; }
.switch-line input:checked + span { background: var(--green); }
.switch-line input:checked + span::after { transform: translateX(16px); }
.switch-line strong, .switch-line small { display: block; }
.switch-line small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 5px; }
.form-save-status { min-height: 20px; margin-right: auto; align-self: center; color: var(--muted); font-size: 13px; }
.form-save-status.success { color: var(--green); }
.form-save-status.error { color: var(--red); }

.split-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 18px; }
.import-panel, .guide-panel { padding: 28px; }
.upload-icon { display: grid; width: 52px; height: 52px; margin-bottom: 17px; place-items: center; border-radius: 14px; color: #087658; background: var(--green-soft); font-size: 11px; font-weight: 900; }
.file-drop { display: grid; min-height: 130px; margin-top: 8px; place-items: center; align-content: center; gap: 5px; border: 1px dashed #9fc7bd; border-radius: 13px; color: #33645a; background: #f3faf7; cursor: pointer; text-align: center; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop span { color: var(--muted); font-size: 10px; }
.notice { display: flex; flex-direction: column; gap: 3px; padding: 13px 14px; border-left: 3px solid var(--amber); border-radius: 4px 9px 9px 4px; color: #69512d; background: #fff8ea; }
.notice span { font-size: 10px; }
code { padding: 2px 5px; border-radius: 5px; color: #215a50; background: #e7f2ef; font-family: Consolas, monospace; font-size: .9em; }
.result-list { padding: 0 22px 22px; }
.result-item { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #edf2f1; }
.result-item > span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; font-size: 10px; }
.result-item.ok > span { color: #087658; background: var(--green-soft); }
.result-item.bad > span { color: #b63846; background: #ffe3e6; }
.result-item p { margin: 0; color: var(--muted); }

.filter-panel { padding: 15px 18px; }
.filter-row { display: flex; align-items: end; gap: 12px; }
.filter-row label { display: grid; gap: 5px; color: #647879; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.compact-field { min-width: 170px; min-height: 38px; padding: 8px 10px; }
.account-query-select { min-width: 300px; }
.result-pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 18px; border-top: 1px solid #edf1f0; color: var(--muted); font-size: 10px; }
.result-pagination > div { display: flex; gap: 7px; }
.result-pagination .mini-button { display: inline-block; text-decoration: none; }
.danger-state > span { color: var(--red); background: #ffe7e9; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; padding: 0 22px 24px; }
.device-card { padding: 18px; border: 1px solid #dae6e4; border-radius: 14px; background: #fbfdfc; }
.device-card.offline { opacity: .62; }
.device-card-head { display: flex; align-items: center; justify-content: space-between; }
.phone-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: #087658; background: var(--green-soft); font-weight: 900; }
.device-card h3 { margin: 16px 0 3px; }
.device-card > p { margin: 0; color: var(--muted); font-size: 10px; }
.device-account { margin: 15px 0 0; padding: 10px 12px; border-radius: 9px; background: #f0f5f4; }
.device-account small, .device-account strong { display: block; }
.device-account small { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.block-sub { display: block; margin-top: 3px; }
.device-name-strong { color: var(--ink); }
.api-hint { justify-content: flex-start; }
.api-hint > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; color: #fff; background: var(--nav); font-size: 10px; font-weight: 900; }
.api-hint strong, .api-hint p { display: block; margin: 0; }
.api-hint p { margin-top: 3px; color: var(--muted); font-size: 10px; }

.platform-layout { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); }
.platform-list { padding: 0 22px 22px; }
.platform-list article { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 13px; padding: 15px 0; border-top: 1px solid #edf2f1; }
.platform-list h3, .platform-list p, .platform-list small { display: block; margin: 0; }
.platform-list p { margin: 3px 0; color: #4a6663; font-size: 11px; }
.platform-list small { color: var(--muted); font-size: 9px; }

.flash-stack { display: grid; gap: 7px; margin-bottom: 16px; }
.flash-stack.dynamic { position: fixed; z-index: 60; top: 18px; right: 22px; width: min(520px, calc(100vw - 36px)); }
.flash-stack.dynamic .flash { box-shadow: 0 12px 35px rgba(20,58,57,.14); }
.flash { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid; border-radius: 10px; font-size: 11px; font-weight: 700; }
.flash > span { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; font-size: 10px; }
.flash.success { color: #116a51; border-color: #bce3d6; background: #e8f7f1; }
.flash.success > span { color: white; background: var(--green); }
.flash.error { color: #a43c48; border-color: #f1c6ca; background: #fff0f1; }
.flash.error > span { color: white; background: var(--red); }

.modal { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 25px 80px rgba(9,36,36,.25); }
.modal::backdrop { background: rgba(9,29,31,.55); backdrop-filter: blur(2px); }
.modal form { display: grid; gap: 15px; padding: 25px; }
.modal h3, .modal p { margin: 0; }
.modal p { color: var(--muted); font-size: 11px; }
.account-editor-modal { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 0; border-radius: 22px; background: transparent; box-shadow: 0 28px 90px rgba(6,35,34,.28); }
.account-editor-modal[open] { animation: account-editor-in .2s cubic-bezier(.2,.8,.2,1); }
.account-editor-modal::backdrop { background: rgba(8,29,31,.52); backdrop-filter: blur(4px); animation: account-editor-backdrop .18s ease-out; }
.account-editor-content { min-height: 300px; background: #fff; }
.account-editor-card { display: flex; max-height: calc(100vh - 32px); flex-direction: column; background: #fff; }
.account-editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px 27px 19px; border-bottom: 1px solid #edf2f1; background: linear-gradient(135deg, #fff 30%, #f1faf7); }
.account-editor-header h2 { margin: 4px 0 4px; font-family: Georgia, "Songti SC", serif; font-size: 27px; }
.account-editor-header p { margin: 0; color: var(--muted); font-size: 10px; }
.account-editor-close { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; color: #627574; background: #edf4f2; cursor: pointer; font-size: 22px; line-height: 1; transition: transform .15s, background .15s; }
.account-editor-close:hover { transform: rotate(5deg) scale(1.04); background: #e2efeb; }
.account-editor-body { padding: 22px 27px 27px; overflow-y: auto; }
.account-editor-body .form-grid { gap: 15px; }
.account-editor-loading, .account-editor-load-error { display: grid; min-height: 330px; place-items: center; align-content: center; gap: 14px; color: #526d69; text-align: center; }
.account-editor-loading span { width: 34px; height: 34px; border: 3px solid #d8ebe5; border-right-color: var(--green); border-radius: 50%; animation: spin .75s linear infinite; }
.account-editor-load-error strong { color: var(--red); font-size: 18px; }
.account-editor-load-error p { margin: -5px 0 3px; color: var(--muted); }
@keyframes account-editor-in { from { opacity: 0; transform: translateY(18px) scale(.975); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes account-editor-backdrop { from { opacity: 0; } to { opacity: 1; } }
.error-page { display: grid; min-height: 65vh; place-items: center; align-content: center; text-align: center; }
.error-page > span { color: #c5d7d4; font-family: Georgia, serif; font-size: 86px; line-height: 1; }
.error-page h1 { margin: 7px 0; }
.error-page p { margin: 0 0 20px; color: var(--muted); }

.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(440px, 1.15fr) minmax(420px, .85fr); background: #fff; }
.login-story { position: relative; display: grid; min-height: 100vh; overflow: hidden; place-items: center; color: #fff; background: radial-gradient(circle at 78% 25%, rgba(30,177,131,.28), transparent 33%), linear-gradient(140deg, #0e2d31, #0a5549); }
.story-grid { position: absolute; inset: 0; opacity: .1; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom right, black, transparent 82%); }
.story-content { position: relative; z-index: 1; width: min(620px, 80%); }
.story-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 90px; font-size: 22px; letter-spacing: .03em; }
.story-content h1 { margin: 13px 0 20px; font-family: Georgia, "Songti SC", serif; font-size: clamp(44px, 5vw, 72px); font-weight: 500; line-height: 1.14; letter-spacing: -.04em; }
.story-content h1 span { color: #69e2b7; }
.story-lead { max-width: 530px; color: #acd0ca; font-size: 15px; line-height: 1.8; }
.story-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 54px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.1); }
.story-metrics div { padding: 17px; background: rgba(9,43,44,.5); }
.story-metrics b, .story-metrics span { display: block; }
.story-metrics b { color: #6de4ba; font-size: 15px; }
.story-metrics span { margin-top: 3px; color: #8fb9b4; font-size: 9px; }
.login-panel { display: grid; min-height: 100vh; place-items: center; padding: 40px; }
.login-card { width: min(400px, 100%); }
.login-card h2 { margin: 8px 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 32px; font-weight: 600; }
.login-card > .muted { margin: 0 0 28px; }
.login-form { margin-top: 20px; }
.login-form .button { min-height: 47px; margin-top: 4px; }
.login-help { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 25px; color: #879898; font-size: 10px; }
.login-help .status-dot { width: 6px; height: 6px; }

@media (max-width: 1100px) {
    .hero-summary { grid-template-columns: 1fr 1fr; }
    .hero-bars { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .login-story { display: none; }
    .login-shell { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 25; display: none; background: rgba(8,30,32,.5); }
    .sidebar-scrim.show { display: block; }
    .main-area { margin-left: 0; }
    .mobile-header { position: sticky; top: 0; z-index: 20; display: flex; height: 56px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
    .menu-button { border: 0; color: var(--ink); background: none; font-size: 21px; }
    .mobile-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 900; letter-spacing: .04em; }
    .page-wrap { padding: 24px 17px 40px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .date-sync-form { width: 100%; align-items: stretch; flex-direction: column; }
    .hero-summary { grid-template-columns: 1fr; padding: 26px; }
    .hero-progress { padding: 20px 0 0; border-top: 1px solid rgba(255,255,255,.12); border-left: 0; }
    .hero-bars { grid-column: auto; grid-template-columns: 1fr; }
    .split-layout, .platform-layout { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .full { grid-column: auto; }
}

@media (max-width: 540px) {
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card > small { display: none; }
    .hero-number { font-size: 54px; }
    .filter-row { align-items: stretch; flex-direction: column; }
    .compact-field { width: 100%; }
    .login-panel { padding: 28px 22px; }
    .page-heading h1 { font-size: 30px; }
    .platform-list article { grid-template-columns: auto 1fr auto; }
    .platform-list article form { grid-column: 2 / -1; }
    .account-editor-modal { width: calc(100vw - 20px); max-height: calc(100vh - 20px); border-radius: 18px; }
    .account-editor-card { max-height: calc(100vh - 20px); }
    .account-editor-header { padding: 20px 19px 16px; }
    .account-editor-header h2 { font-size: 23px; }
    .account-editor-body { padding: 18px 19px 21px; }
    .account-editor-body .form-actions { flex-wrap: wrap; }
    .account-editor-body .form-save-status { width: 100%; }
}
