:root {
  --portal-bg: #f4f6f5;
  --portal-card: #ffffff;
  --portal-ink: #17211d;
  --portal-muted: #68756f;
  --portal-line: #dde4e0;
  --portal-soft: #f7f9f8;
  --portal-green: #287258;
  --portal-green-dark: #1d5b45;
  --portal-green-soft: #eaf4ef;
  --portal-danger: #a23c32;
}

body { background: var(--portal-bg); color: var(--portal-ink); }
h1, h2 { color: var(--portal-ink); }
.admin-shell { grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { padding: 18px 12px; background: #fff; border-color: var(--portal-line); }
.admin-brand { height: 52px; margin-bottom: 24px; padding: 5px 9px; }
.admin-brand > span { width: 34px; height: 34px; border-radius: 10px; background: var(--portal-ink); box-shadow: none; }
.admin-brand strong { color: var(--portal-ink); font-size: 12px; }
.admin-brand small { color: #8a958f; }
.sidebar nav { gap: 22px; }
.nav-group > small { color: #9ca6a1; }
.nav-item { height: 39px; border-radius: 8px; color: #5e6b65; }
.nav-item:hover { background: var(--portal-soft); color: var(--portal-ink); }
.nav-item.active { background: #eef2f0; color: var(--portal-ink); box-shadow: none; }
.nav-item.active svg { color: var(--portal-green); }
.profile { border-color: var(--portal-line); }
.profile.profile-wordmark { grid-template-columns: minmax(0, 1fr) 30px; }
.profile-wordmark > strong { color: var(--portal-ink); font: 700 9px Manrope, sans-serif; letter-spacing: .22em; }
.topbar { height: 64px; padding: 0 34px; border-color: var(--portal-line); background: rgb(255 255 255 / 88%); }
.topbar-link { min-height: 34px; padding: 0 12px; border-color: var(--portal-line); border-radius: 8px; }
.content { width: min(100%, 1480px); margin: 0 auto; padding: 42px clamp(26px, 4vw, 56px) 80px; }
.page-title { align-items: center; margin-bottom: 26px; }
.page-title h1 { font-size: 31px; }
.page-subtitle { max-width: 620px; margin-top: 7px; color: var(--portal-muted); font-size: 12px; }
.eyebrow, .panel-kicker { color: var(--portal-green); font-size: 9px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.page-status { border-color: #cfe1d8; background: #f7fbf9; color: #396451; }
.flash { position: relative; margin: 0 0 18px; padding: 13px 15px; border-color: #acd3ba; border-radius: 10px; background: #edf8f2; color: #285840; box-shadow: 0 4px 16px rgb(30 75 55 / 6%); transition: opacity .18s ease, transform .18s ease; }
.flash.error { border-color: #e6c1bc; background: #fff5f3; color: #8f2f26; }
.admin-shell .flash { position: fixed; z-index: 80; top: 72px; right: 24px; width: min(360px, calc(100vw - 32px)); margin: 0; box-shadow: 0 12px 32px rgb(27 39 33 / 14%); }
.flash.is-leaving { opacity: 0; transform: translateY(-6px); }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-card { min-width: 0; padding: 18px 19px; border: 1px solid var(--portal-line); border-radius: 13px; background: var(--portal-card); box-shadow: 0 5px 20px rgb(27 43 36 / 4%); }
.summary-card > span { display: block; margin-bottom: 13px; color: var(--portal-muted); font-size: 10px; font-weight: 600; }
.summary-card > strong { display: block; overflow: hidden; color: var(--portal-ink); font: 650 25px/1.05 Manrope, sans-serif; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.summary-card > strong em { margin-left: 2px; color: #94a09a; font-size: 14px; font-style: normal; font-weight: 550; }
.summary-card > strong.summary-version { font-size: 18px; line-height: 1.45; }
.summary-card > small { display: block; margin-top: 8px; color: #8b9690; font-size: 9px; }
.grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.panel { border-color: var(--portal-line); border-radius: 14px; box-shadow: 0 5px 24px rgb(27 43 36 / 4%); }
.panel.upload { grid-column: span 7; }
.channels-panel { grid-column: span 5; overflow: hidden; }
.overview-view .channels-panel { grid-column: 1 / -1; }
.table-wrap { grid-column: 1 / -1; }
.panel-header { min-height: 78px; padding: 19px 20px; border-color: #e9eeeb; }
.panel-header h2 { font-size: 15px; }
.panel-header p:not(.panel-kicker) { max-width: 660px; margin-top: 6px; color: var(--portal-muted); }
.panel-kicker { margin: 0 0 5px !important; }
.panel-body { padding: 20px; }
.upload-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.upload-grid .primary { grid-column: 1 / -1; justify-self: end; margin-top: 2px; }
.releases-view { grid-template-columns: 1fr; gap: 0; overflow: hidden; border: 1px solid var(--portal-line); border-radius: 14px; background: #fff; box-shadow: 0 5px 24px rgb(27 43 36 / 4%); }
.releases-view .panel { grid-column: 1; border: 0; border-radius: 0; box-shadow: none; }
.releases-view .panel + .panel { border-top: 1px solid #e9eeeb; }
.releases-view .upload-grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.releases-view .upload-grid .primary { grid-column: auto; align-self: start; margin-top: 17px; }
label { color: #4e5c55; font-size: 10px; }
input[type=file], input[type=password], input[type=text] { min-height: 42px; border-color: #ccd5d0; border-radius: 8px; background: #fff; }
input[type=file] { padding: 5px 7px; color: #7d8983; cursor: pointer; }
input[type=file]::file-selector-button { min-height: 30px; margin-right: 11px; padding: 0 12px; border: 0; border-radius: 6px; background: #edf2ef; color: #34463e; font: 550 10px Inter, sans-serif; cursor: pointer; transition: background .15s ease, color .15s ease; }
input[type=file]:hover::file-selector-button { background: #dfe9e4; color: #1f382d; }
.field-note { color: #89948e; font-size: 9px; font-weight: 400; }
.upload-progress { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 5px; }
.upload-progress[hidden] { display: none; }
.upload-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #59665f; font-size: 10px; }
.upload-progress-copy strong { color: var(--portal-ink); font-size: 10px; font-weight: 600; }
.upload-progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e6ece8; }
.upload-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--portal-green); transition: width .15s ease; }
.upload-progress.is-verifying .upload-progress-track span { animation: verify-pulse 1.1s ease-in-out infinite alternate; }
.upload-progress.has-error .upload-progress-track span { background: var(--portal-danger); animation: none; }
input:focus { border-color: var(--portal-green); box-shadow: 0 0 0 3px rgb(40 114 88 / 12%); }
.primary, .secondary, .small-button { border-radius: 8px; box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.primary { min-height: 38px; padding: 0 16px; border-color: var(--portal-ink); background: var(--portal-ink); }
.primary:hover { border-color: #26342e; background: #26342e; }
.small-button { min-height: 32px; border-color: #d3dbd7; color: #3d4b44; }
.channel-state { gap: 10px; }
.channel-row { min-height: 79px; padding: 13px 14px; border-color: #e1e7e4; border-radius: 10px; background: var(--portal-soft); }
.channels-panel .channel-state { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; }
.channels-panel .panel-header { min-height: 52px; padding-top: 14px; padding-bottom: 14px; }
.channels-panel .panel-header h2 { font-weight: 550; }
.channels-panel .channel-row { min-height: 62px; padding: 13px 18px; border: 0; border-radius: 0; background: #fff; }
.channels-panel .channel-row + .channel-row { border-left: 1px solid #e9eeeb; }
.channel-copy { min-width: 0; display: flex; align-items: center; gap: 10px; }
.channel-copy .channel-name { display: inline-block; margin: 0; padding: 3px 6px; border-radius: 5px; background: var(--portal-green-soft); color: var(--portal-green-dark); font-size: 8px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.channel-copy .channel-name.beta { background: #f0ecfb; color: #6550a5; }
.channel-copy strong { overflow: hidden; color: #46534d; font-size: 10px; font-weight: 500; text-transform: none; text-overflow: ellipsis; white-space: nowrap; }
.channel-copy strong + span { color: var(--portal-muted); }
.site-create { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; padding: 18px 20px; background: #fbfcfb; }
.site-list { border-color: #e9eeeb; }
.site-table-head, .site-row { display: grid; grid-template-columns: minmax(240px, 1.5fr) minmax(120px, .6fr) minmax(160px, .8fr) auto; align-items: center; gap: 18px; padding-right: 20px; padding-left: 20px; }
.site-table-head { min-height: 38px; border-bottom: 1px solid #e9eeeb; background: #f8faf9; color: #8a958f; font-size: 8px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.site-table-head span:last-child { text-align: right; }
.site-row { min-height: 66px; padding-top: 12px; padding-bottom: 12px; border-color: #edf0ee; }
.site-row:hover, .release:hover { background: #fbfcfb; }
.site-name strong { color: var(--portal-ink); font-size: 11px; }
.site-name small { display: block; margin-top: 5px; color: #9aa39e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; font-weight: 400; letter-spacing: .02em; }
.badge { padding: 4px 7px; background: #eff2f0; color: #59665f; font-size: 8px; }
.badge.enabled { background: #e9f5ef; color: #276449; }
.badge.blocked, .badge.required { background: #fff0ed; color: #984138; }
.release { min-height: 78px; grid-template-columns: minmax(130px, .7fr) minmax(170px, 1fr) minmax(260px, 1.7fr) auto; padding: 15px 20px; border-color: #edf0ee; }
.release-version strong { color: var(--portal-ink); font-size: 14px; }
.release-notes { color: #5e6a64; }
.actions, .site-actions { gap: 6px; }
.danger { color: var(--portal-danger); }
.site-toggle { position: relative; width: 38px; height: 22px; padding: 0; border: 1px solid #cbd3cf; border-radius: 999px; background: #dfe4e1; cursor: pointer; transition: border-color .16s ease, background-color .16s ease; }
.site-toggle span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #1e292333; transition: transform .16s ease; }
.site-toggle:hover { border-color: #aeb9b3; }
.site-toggle.is-enabled { border-color: #2f7656; background: #3b8966; }
.site-toggle.is-enabled span { transform: translateX(16px); }
.site-toggle:focus-visible { outline: 2px solid #1f6b4a; outline-offset: 3px; }
.site-toggle:disabled { cursor: wait; opacity: .6; }
.empty { padding: 32px 20px; color: #7e8983; text-align: center; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr); padding: 0; background: #fff; }
.login-art { padding: 60px; display: flex; align-items: flex-end; background: radial-gradient(circle at 75% 20%, #52525b55, transparent 28%), linear-gradient(145deg, #18181b, #27272a); color: #fff; }
.login-art > div { max-width: 650px; }
.login-art span { color: #d4d4d8; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.login-art h2 { max-width: 560px; margin: 20px 0; color: #fff; font-size: clamp(38px, 4.5vw, 60px); line-height: 1; }
.login-art p { max-width: 530px; margin: 0; color: #c4b5d2; line-height: 1.7; }
.login-card { width: auto; padding: clamp(50px, 7vw, 110px) clamp(32px, 5vw, 80px); display: flex; flex-direction: column; justify-content: center; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.login-card > p:not(.eyebrow) { margin: 10px 0 30px; color: #71717a; font-size: 12px; }
.login-card form { display: grid; gap: 15px; }
.login-card label { display: grid; gap: 7px; margin: 0; color: #3f3f46; font-size: 10px; font-weight: 600; }
.login-card input[type=password] { min-height: 39px; padding: 9px 10px; font-size: 11px; }
.login-card .primary { min-height: 36px; margin-top: 6px; width: 100%; font-size: 11px; }
@media (max-width: 1120px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel.upload, .channels-panel { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-art { min-height: 38vh; padding: 36px; }
  .login-card { padding: 42px 28px; }
  .admin-shell { display: block; }
  .sidebar { position: static; height: auto; }
  .content { padding: 28px 16px 56px; }
  .topbar { padding: 0 16px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .upload-grid, .site-create { grid-template-columns: 1fr; }
  .upload-grid .primary { grid-column: auto; width: 100%; }
  .channels-panel .channel-state { grid-template-columns: 1fr; }
  .channels-panel .channel-row + .channel-row { border-top: 1px solid #e9eeeb; border-left: 0; }
  .site-table-head { display: none; }
  .site-row, .release { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 520px) {
  .summary-grid { grid-template-columns: 1fr; }
  .page-title h1 { font-size: 26px; }
  .summary-card { padding: 16px; }
  .login-card { padding: 42px 28px; }
}
@media (prefers-reduced-motion: no-preference) {
  .summary-card, .panel { animation: portal-arrive .3s ease both; }
  .summary-card:nth-child(2) { animation-delay: .035s; }
  .summary-card:nth-child(3) { animation-delay: .07s; }
  .summary-card:nth-child(4) { animation-delay: .105s; }
  .grid .panel:nth-child(1) { animation-delay: .12s; }
  .grid .panel:nth-child(2) { animation-delay: .155s; }
  @keyframes portal-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
  @keyframes verify-pulse { from { opacity: .45; } to { opacity: 1; } }
}
