@font-face {
  font-family: InterPanel;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: InterPanel;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: InterPanel;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: InterPanel;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: InterPanel;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: InterPanel;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #07080c;
  --rail: #0c0e14;
  --card: #12141c;
  --elev: #1a1d28;
  --line: rgba(255,255,255,.07);
  --line2: rgba(255,255,255,.13);
  --txt: #f4f5f8;
  --dim: #c6cad6;
  --mute: #8d93a5;
  --acc: #4ade80;
  --sky: #7dd3fc;
  --warn: #facc15;
  --bad: #fb7185;
  --gold: #e4c36a;
  --gold2: #f6e7b8;
  --accent: #e4c36a;
  --accent-2: #f6e7b8;
  --accent-bg: #2c2412;
  --accent-line: #8a7340;
  --shadow: 0 18px 48px rgba(0,0,0,.42);
  --r: 16px;
  --r-sm: 11px;
  --font: InterPanel, "Segoe UI", Tahoma, Arial, "Noto Sans", sans-serif;
}
body.up, body.app {
  --accent: #34d399; --accent-2: #bbf7d0; --accent-bg: #063226; --accent-line: #147857;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background:
    radial-gradient(920px 460px at 6% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 56%),
    radial-gradient(720px 360px at 100% 0%, rgba(56,189,248,.07), transparent 48%),
    var(--bg);
  color: var(--txt);
  font: 14px/1.5 var(--font);
}
button, input, select, textarea { font: inherit; color: inherit; }
body.up, body.app { display: flex; min-height: 100vh; }
aside {
  width: 256px; flex: none;
  background: linear-gradient(180deg, #11141c 0%, #0a0c11 100%);
  border-right: 1px solid var(--line);
  height: 100vh; position: sticky; top: 0;
  display: flex; flex-direction: column; z-index: 12;
}
.brand {
  display: flex; gap: 12px; align-items: center;
  padding: 18px 16px 16px; border-bottom: 1px solid var(--line);
}
.mark-img { width:56px; height:56px; padding:5px; border-radius:14px; object-fit:contain; background:#fff; box-sizing:border-box; border:1px solid var(--accent-line); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.brand h1 { margin: 0; font-size: 15px; letter-spacing: -.02em; font-weight: 700; }
.brand small { color: var(--mute); display: block; margin-top: 3px; font-size: 11px; }
aside nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; overflow: auto; }
.nav-l {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute);
  padding: 14px 10px 6px; font-weight: 700;
}
aside nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--dim);
  border-radius: 11px; padding: 9px 11px; cursor: pointer; font-weight: 600;
}
aside nav button svg { width: 16px; height: 16px; opacity: .72; flex: none; }
aside nav button:hover { background: var(--elev); color: var(--txt); }
aside nav button.on {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-2);
  box-shadow: inset 3px 0 0 var(--accent);
}
aside nav button.on svg { opacity: 1; }
.foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12px; }
.foot b { color: var(--txt); display: block; font-weight: 600; }
.wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 22px;
  border-bottom: 1px solid var(--line); background: rgba(10,12,18,.9);
  backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 8; min-height: 60px;
}
.crumb { font-weight: 700; font-size: 14px; white-space: nowrap; }
.crumb span { color: var(--mute); font-weight: 500; margin-left: 8px; font-size: 12.5px; }
.topbar .grow { flex: 1; }
.topbar .search {
  flex: 1; max-width: 420px; background: #0b0d12; border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.acct { display: flex; align-items: center; gap: 8px; }
.acct .who { text-align: right; }
.acct .who b { display: block; font-size: 13px; }
.acct .who small { color: var(--accent-2); font-size: 11.5px; }
.nav-toggle { display: none; }
.clock { color: var(--mute); font-variant-numeric: tabular-nums; font-size: 12px; }
.pill {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); background: var(--elev);
}
.pill.run { color: var(--warn); border-color: #854d0e; }
.pill.ok { color: var(--acc); border-color: #166534; }
main { padding: 22px 24px 96px; }
.panel { display: none; }
.panel.show { display: block; }
body.app .panel { display: none !important; }
body.app .panel.show { display: block !important; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.ph h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; font-weight: 700; }
.ph p { margin: 6px 0 0; color: var(--mute); max-width: 760px; }
.btn {
  background: var(--elev); color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 13px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--line2); background: #222633; }
.btn:active { transform: translateY(1px); }
.btn.acc { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent-2); }
.btn.sky { background: #0c4a6e; border-color: #0369a1; color: #e0f2fe; }
.btn.bad { background: #4c0519; border-color: #881337; color: #fecdd3; }
.btn.ghost { background: transparent; }
.btn.lg { padding: 11px 16px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn a, a.btn { text-decoration: none; display: inline-block; }
.btn.on { border-color: var(--accent); color: var(--accent-2); background: var(--accent-bg); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: 0 1px 0 rgba(255,255,255,.03);
}
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.card.pad0 { padding: 0; overflow: hidden; }
.card.pad0 h3 { padding: 14px 16px 0; }
.toolbar-card, .tb-card {
  display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 14px;
}
.tb-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 360px; }
.tb-search .find, .tb-search input, .tb-search select { min-width: min(280px, 70vw); }
.tb-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tb-l {
  display: block; width: 100%; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mute); font-weight: 700; margin-bottom: 2px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 10px; margin-bottom: 16px; }
.m {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 15px; cursor: pointer; transition: border-color .15s, transform .15s;
  position: relative; overflow: hidden;
}
.m:before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: .55;
}
.m:hover { border-color: var(--accent); transform: translateY(-1px); }
.m .k { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); font-weight: 700; }
.m .v { font-size: 26px; font-weight: 700; letter-spacing: -.04em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.m .s { font-size: 12px; color: var(--dim); margin-top: 3px; }
.m .t { height: 3px; background: #27272a; margin-top: 10px; border-radius: 99px; overflow: hidden; }
.m .t i { display: block; height: 100%; background: var(--accent); }
.m.warn .v { color: var(--warn); } .m.bad .v { color: var(--bad); } .m.sky .v { color: var(--sky); }
.find {
  width: 220px; background: #0b0d12; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.banner {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), #111114);
  border: 1px solid var(--accent-line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px;
}
.banner[hidden] { display: none; }
.banner p { margin: 4px 0 0; color: var(--dim); }
.row, .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
#fresh-html-panel.card { background: transparent; border: 0; padding: 0; box-shadow: none; }
.fh-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.fh-bar h3 { margin: 0; }
.fh-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; margin: 0 0 14px;
}
.fh-card h4 { margin: 0 0 10px; font-size: 15px; }
.fh-card.fh-bulk {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}
.fh-split { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(280px, 1.2fr); gap: 14px; align-items: start; }
.fh-title-row {
  display: grid; grid-template-columns: minmax(110px, .7fr) 1fr; gap: 8px; align-items: center;
  margin: 0 0 8px;
}
.fh-title-row label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--txt); }
.fh-title-row input, .fresh-bulk-title, .html-only-batch-title, .html-only-admin-batch-title {
  min-height: 42px; font-size: 15px; border-color: var(--accent-line);
}
#fresh-bulk-purchases, #html-only-batch-purchases, #html-only-admin-batch-purchases { min-height: 240px; }
#fresh-bulk-titles, #html-only-batch-titles, #html-only-admin-batch-titles { min-height: 160px; font-size: 15px; }
@media (max-width: 900px) {
  .fh-split, .fh-title-row { grid-template-columns: 1fr; }
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
.layout { display: grid; grid-template-columns: 1.35fr .85fr; gap: 12px; }
.layout3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
label { display: block; color: var(--mute); font-size: 11px; margin: 10px 0 5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
input, select, textarea {
  width: 100%; background: #0b0d12; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tbl-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--line); }
th {
  color: var(--mute); font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  background: #10131a; position: sticky; top: 0; z-index: 1;
}
tr:hover td { background: #181b24; }
.badge {
  display: inline-flex; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim);
}
.badge.ok { color: #bbf7d0; border-color: #166534; background: #052e16; }
.badge.sky { color: #e0f2fe; border-color: #0369a1; background: #0c4a6e; }
.badge.warn { color: #fde68a; border-color: #854d0e; background: #422006; }
.badge.bad { color: #fecdd3; border-color: #881337; background: #4c0519; }
.muted { color: var(--mute); }
.empty { color: var(--mute); padding: 20px 6px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 280px; background: #171a22; border: 1px solid var(--line2);
  border-radius: 12px; padding: 11px 13px; box-shadow: var(--shadow);
}
.toast.err { border-color: #881337; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.steps { margin: 0; padding-left: 18px; color: var(--dim); }
.steps li { margin: 8px 0; }
.steps li.done { color: var(--acc); }
.steps li.now { color: var(--accent-2); }
.log {
  background: #07080c; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; max-height: 240px; overflow: auto;
  font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; color: var(--dim);
}
a { color: #7dd3fc; text-decoration: none; }
a:hover { text-decoration: underline; }

body.login {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 18px 40px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; border: 1px solid var(--accent-line); }
.login-brand h1 { margin: 0; font-size: 1.5rem; }
.login-sub { color: var(--mute); margin: 0 0 26px; text-align: center; max-width: 640px; }
.login-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; width: min(880px, 100%); }
.login-grid .card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.login-grid .card p { margin: 0 0 8px; color: var(--mute); }
.login-grid .btn { width: 100%; margin-top: 16px; padding: 12px 14px; }
.login-grid .err, .gate-card .err { color: var(--bad); min-height: 1.2em; margin-top: 8px; font-size: .9rem; }
.login-links { margin-top: 22px; color: var(--mute); font-size: .92rem; }
.lang-bar.fixed, body.login .lang-bar { position: fixed; top: 18px; right: 18px; }

@media (max-width: 1100px) {
  .layout, .layout3, .two, .three { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .nav-toggle { display: inline-block; }
  aside {
    position: fixed; left: 0; top: 0; transform: translateX(-105%);
    transition: transform .2s ease; height: 100vh; box-shadow: 8px 0 24px #0008;
  }
  aside.open { transform: none; }
  .find { width: 100%; }
  .ph { align-items: stretch; }
  .top-actions { width: 100%; }
}
