/* Stay Unexposed Manager: the app's own dark palette (v1.2.1). */
:root {
  --bg: #1b1c2e;
  --panel: #23243a;
  --panel-2: #2a2c45;
  --line: #34365a;
  --ink: #ecedf7;
  --muted: #9a9cbd;
  --accent: #6c6ff6;
  --brand-blue: #3b6ff5;
  --accent-ink: #ffffff;
  --green: #2fbf62;
  --red: #ef5b5f;
  --r: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
.muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.brand__mark { width: 34px; height: auto; flex: none; color: var(--ink); }
.brand__word { display: flex; flex-direction: column; line-height: 1; text-transform: uppercase; font-weight: 800; letter-spacing: 0.01em; }
.brand__stay { color: var(--ink); font-size: 12px; }
.brand__unexposed { color: var(--brand-blue); font-size: 15px; }
.brand--stack { gap: 12px; flex-wrap: wrap; }
.brand--stack .brand__mark { width: 64px; }
.brand--stack .brand__stay { font-size: 22px; }
.brand--stack .brand__unexposed { font-size: 26px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in oklab, var(--accent) 22%, transparent); color: #c7c8ff; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover:not(:disabled) { background: #7d80f8; }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover:not(:disabled) { background: var(--panel-2); }
.btn--wide { width: 100%; height: 42px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }
input, select, textarea { height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); min-width: 0; }
textarea { height: auto; min-height: 72px; padding: 8px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #6f7196; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field__error { color: #ff9c9f; font-size: 12.5px; }
.form-error { margin: 0; color: #ff9c9f; }

/* sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login__card { width: min(380px, 100%); display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login__card p { margin: -8px 0 4px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top__right { display: flex; align-items: center; gap: 12px; }
.top__left { display: flex; align-items: center; gap: 28px; min-width: 0; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ink); background: var(--panel-2); }
.tab[aria-current="page"] { color: var(--ink); background: var(--panel-2); }

/* app updates */
.release-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.release-hero > div { display: grid; gap: 2px; }
.release-hero__ver { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; font-family: var(--mono); }
.release-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel--pad { padding: 20px; display: grid; gap: 14px; }
.panel--pad > p { margin: -6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); padding: 0; }
.check > span { display: grid; }
.check .muted { font-size: 12.5px; }
.releases { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.release { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; background: var(--bg); }
.release.is-editing { border-color: var(--accent); }
.release__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release__ver { font-family: var(--mono); font-weight: 600; font-size: 15px; }
.release__when { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.release__notes { margin: 0; white-space: pre-line; font-size: 13px; }
.release__link { font-size: 12.5px; color: #a9abff; overflow-wrap: anywhere; }
.release__actions { display: flex; gap: 8px; }
.release__actions .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--danger:hover:not(:disabled) { border-color: var(--red); color: #ff9c9f; background: transparent; }
.drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, var(--bg)); }
.drop:focus-within { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--panel-2); color: #c7c8ff; font-size: 18px; font-weight: 600; }
.drop .muted { font-size: 12.5px; }
.upload { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.upload__row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.upload__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.upload__row .link-btn { margin-left: auto; font-size: 13px; }
.upload__sha { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.upload.is-done .bar i { background: var(--green); }
.upload.is-error .bar i { background: var(--red); }
.release__file { font-size: 12.5px; color: var(--muted); }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag--latest { color: #c7c8ff; background: color-mix(in oklab, var(--accent) 22%, transparent); }
.tag--must { color: #ffcf8a; background: color-mix(in oklab, #f5a524 18%, transparent); }
.main { max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; gap: 20px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 2px; }
.stat__label { color: var(--muted); font-size: 12.5px; }
.stat__value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__sub { color: var(--muted); font-size: 12.5px; min-height: 1.5em; }

/* panel, toolbar, table */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 0; flex-wrap: wrap; }
.find { display: flex; gap: 8px; }
.find input { width: 170px; font-family: var(--mono); text-transform: uppercase; }
.find input::placeholder { text-transform: none; }
.toolbar { display: flex; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar input { flex: 1 1 260px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover, .table tbody tr:focus-visible { background: var(--panel-2); outline: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .note-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.code { font-family: var(--mono); font-size: 13px; color: #c7c8ff; }
.dash { color: #6f7196; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--active { color: #6fe39a; background: color-mix(in oklab, var(--green) 16%, transparent); }
.pill--blocked { color: #ff9c9f; background: color-mix(in oklab, var(--red) 16%, transparent); }
.reward { color: #6fe39a; }
.empty { margin: 0; padding: 40px 16px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.pager__btns { display: flex; gap: 8px; }
.skeleton td::after { content: ""; display: block; height: 12px; border-radius: 6px; background: var(--panel-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* drawer and dialog */
.scrim { position: fixed; inset: 0; background: rgb(8 9 20 / .55); z-index: 9; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--panel); border-left: 1px solid var(--line); z-index: 10; display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer__body, .dialog__body { padding: 20px; overflow-y: auto; display: grid; gap: 20px; align-content: start; }
.drawer__body { flex: 1; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fact { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; }
.fact span { color: var(--muted); font-size: 12px; }
.fact b { font-size: 17px; font-variant-numeric: tabular-nums; }
.edit { display: grid; gap: 14px; }
.edit__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.edit__actions { display: flex; justify-content: flex-end; gap: 8px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.list button { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; background: transparent; border: 0; cursor: pointer; }
.list button:hover { background: var(--panel-2); }
.list .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.list .when { color: var(--muted); font-size: 12.5px; }
.list__empty { color: var(--muted); margin: 0; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history li { font-size: 13px; }
.history .when { color: var(--muted); font-size: 12px; }
.copy { margin-left: 6px; font-size: 12px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--muted); }
.copy:hover { color: var(--ink); }
.dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); }
.dialog::backdrop { background: rgb(8 9 20 / .55); }
.owner { display: grid; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.owner .code { font-size: 15px; }
.link-btn { background: none; border: 0; padding: 0; color: #a9abff; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2f3150; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 20; box-shadow: 0 10px 30px rgb(0 0 0 / .35); }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .top__left { gap: 12px; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .main { padding: 16px; }
  .top { padding: 10px 16px; }
  .top__right .muted { display: none; }
  .panel__head, .find { width: 100%; }
  .find input { flex: 1; width: auto; }
  .edit__row, .facts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
