/* YNG ACE Admin — same tokens and typefaces as the public site (obsidian, off-white, lime; Outfit + Inter Tight). */
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Variable-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight-Variable-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --obsidian: #080808; --charcoal: #151515; --charcoal-2: #1e1e1d; --line: #2a2a28;
  --off-white: #f5f5f0; --stone: #a3a39b; --lime: #d4ff00; --lime-press: #bfe600;
  --danger: #ff6b5e; --warn: #ffc857; --ok: #9be15d;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-text: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 6px; --r-lg: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--obsidian); color: var(--off-white); font: 400 15px/1.55 var(--font-text); -webkit-font-smoothing: antialiased; }
a { color: var(--off-white); text-decoration-color: color-mix(in srgb, var(--lime) 70%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--lime); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--lime); color: var(--obsidian); padding: 8px 14px; border-radius: var(--r); z-index: 10; }
.skip:focus { top: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; letter-spacing: 0.02em; }
.muted { color: var(--stone); }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 17px/1 var(--font-display); letter-spacing: -0.01em; }
.brand__mark { width: 14px; height: 14px; border-radius: 0 0 0 14px; background: var(--lime); }
.brand__sub { color: var(--stone); font-weight: 400; }

/* Type */
.h1 { margin: 0 0 8px; font: 600 clamp(26px, 3vw, 32px)/1.1 var(--font-display); letter-spacing: -0.02em; }
.h2 { margin: 0 0 14px; font: 600 18px/1.2 var(--font-display); letter-spacing: -0.01em; }
.lede { margin: 0 0 22px; color: var(--stone); }
.aside { margin: 16px 0 0; color: var(--stone); font-size: 14px; }

/* Surfaces */
.card { background: var(--charcoal); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel { padding: clamp(18px, 2.4vw, 28px); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel__head .h2 { margin: 0; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid--two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.content > .card { margin-bottom: 16px; }

/* Forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font-weight: 600; font-size: 14px; }
.field__hint { color: var(--stone); font-size: 13px; }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--obsidian); color: var(--off-white); font: inherit; font-size: 16px; transition: border-color 0.2s var(--ease); }
.input:hover { border-color: #3a3a37; }
.input:focus { border-color: var(--lime); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 22%, transparent); }
.input--code { font: 600 22px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.3em; text-align: center; }

/* Buttons (rounded 6px, like the public site) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: var(--r); border: 1px solid transparent; font: 600 15px/1 var(--font-text); cursor: pointer; text-decoration: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.12s var(--ease); }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--lime); color: var(--obsidian); }
.btn--primary:hover { background: var(--lime-press); color: var(--obsidian); }
.btn--ghost { background: transparent; color: var(--off-white); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--off-white); color: var(--off-white); }
.btn--small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }

/* Notes */
.note { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--charcoal-2); font-size: 14px; }
.note ul { margin: 0; padding-left: 18px; }
.note--error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: #ffd7d2; }
.note--success { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.note--warning { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }

/* Auth pages */
.auth__wrap { min-height: 100vh; min-height: 100svh; display: grid; place-content: center; gap: 22px; padding: 32px 16px; width: min(440px, 100%); margin: 0 auto; }
.auth__card { padding: clamp(22px, 4vw, 34px); }
.auth__foot { margin: 0; color: var(--stone); font-size: 13px; text-align: center; }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--stone); }
.qr { margin: 0 0 14px; padding: 14px; background: #fff; border-radius: var(--r); width: fit-content; }
.qr img { display: block; }
.disclose { margin: 0 0 18px; }
.disclose summary { cursor: pointer; color: var(--stone); }
.key { word-break: break-all; margin: 10px 0; }
.codes { columns: 2; column-gap: 28px; margin: 0 0 16px; padding: 14px 16px 14px 40px; background: var(--obsidian); border: 1px solid var(--line); border-radius: var(--r); font-size: 16px; line-height: 2; }
.codes li { white-space: nowrap; }
@media (max-width: 420px) { .codes { columns: 1; } }

/* App shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 24px 18px; border-right: 1px solid var(--line); background: var(--obsidian); }
.side__nav { display: grid; gap: 2px; }
.side__nav a { padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--stone); font-weight: 500; }
.side__nav a:hover { color: var(--off-white); background: var(--charcoal); }
.side__nav a[aria-current="page"] { color: var(--off-white); background: var(--charcoal); box-shadow: inset 3px 0 0 var(--lime); }
.side__foot { margin-top: auto; display: grid; gap: 12px; }
.side__who { margin: 0; font-weight: 600; display: grid; }
.side__who span { color: var(--stone); font-weight: 400; font-size: 13px; overflow-wrap: anywhere; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 22px clamp(16px, 3vw, 36px) 6px; }
.top__title { margin: 0; font: 600 clamp(24px, 2.6vw, 30px)/1.1 var(--font-display); letter-spacing: -0.02em; }
.top__menu { display: none; }
.content { padding: 14px clamp(16px, 3vw, 36px) 48px; max-width: 1200px; }

/* Stats */
.stat { padding: 18px 20px; }
.stat__label { margin: 0 0 10px; color: var(--stone); font: 500 13px/1.3 var(--font-text); }
.stat__value { margin: 0; font: 600 30px/1 var(--font-display); letter-spacing: -0.02em; }
.stat__value--ok { color: var(--lime); }
.stat__value--warn { color: var(--warn); }
.stat__value--bad { color: var(--danger); }
.stat__meta { margin: 10px 0 0; color: var(--stone); font-size: 13px; }

/* Tables and lists */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--stone); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row--warn td { color: #ffe3a8; }
.tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag--lime { background: var(--lime); color: var(--obsidian); }
.checks, .plain { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.checks li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--stone); vertical-align: middle; }
.checks .ok::before { background: var(--ok); }
.checks .warn::before { background: var(--warn); }
.checks .bad::before { background: var(--danger); }
.plain li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); z-index: 5; transform: translateX(-100%); transition: transform 0.35s var(--ease); }
  .side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.55); }
  .top__menu { display: inline-flex; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r); background: none; color: var(--off-white); font: inherit; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print {
  body { background: #fff; color: #000; }
  .auth__foot, .row, .btn, .brand, .lede { display: none !important; }
  .card, .codes { border: 0; background: none; }
}

/* Publish: preview frame at device widths */
.form--inline { grid-template-columns: 1fr auto; align-items: end; margin-top: 18px; }
@media (max-width: 640px) { .form--inline { grid-template-columns: 1fr; } }
.segmented { display: flex; gap: 6px; }
.segmented [aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }
.preview { margin: 12px 0 0; padding: 12px; background: var(--obsidian); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
.preview__frame { display: block; width: 100%; height: 72vh; margin: 0 auto; border: 0; border-radius: 4px; background: #000; transition: width 0.35s var(--ease); }
.preview[data-device-size="tablet"] .preview__frame { width: 768px; }
.preview[data-device-size="phone"] .preview__frame { width: 390px; }

/* Content editors */
.note--info { border-color: var(--line); }
.crumbs { margin: 0 0 6px; color: var(--stone); font-size: 13px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; background: var(--charcoal-2); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.tile:hover { border-color: var(--lime); color: var(--off-white); }
.tile:active { transform: scale(0.99); }
.tile__title { font: 600 15px/1.3 var(--font-display); }
.tile__text { font-size: 13px; line-height: 1.45; }
.editor { display: grid; gap: 14px; }
.editor__fields { display: grid; gap: 14px; }
.savebar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; background: color-mix(in srgb, var(--obsidian) 88%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r); }
.savebar__status { flex: 1 1 240px; font-size: 13px; }
.savebar__status[data-state="error"] { color: var(--danger); }
.savebar__status[data-state="ok"] { color: var(--ok); }
.savebar--end { position: static; background: none; border: 0; padding: 0; }
.group { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--r); display: grid; gap: 12px; min-width: 0; }
.group__title { padding: 0 6px; font: 600 14px/1 var(--font-display); color: var(--stone); }
.list { display: grid; gap: 8px; }
.list__title { margin: 6px 0 2px; font: 600 15px/1.3 var(--font-display); }
.list__add { justify-self: start; }
.item { border: 1px solid var(--line); border-radius: var(--r); background: var(--charcoal-2); }
.item[open] { border-color: color-mix(in srgb, var(--lime) 35%, var(--line)); }
.item--hidden .item__name { color: var(--stone); text-decoration: line-through; }
.item__sum { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; }
.item__sum::-webkit-details-marker { display: none; }
.item__sum::after { content: "+"; margin-left: auto; color: var(--stone); }
.item[open] > .item__sum::after { content: "–"; }
.item__num { color: var(--stone); min-width: 1.6em; }
.item__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.item__body { display: grid; gap: 12px; padding: 4px 14px 16px; }
.btn--danger:hover { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.input--area { min-height: 72px; resize: vertical; line-height: 1.5; }
.input--num { max-width: 160px; }
.input[readonly] { color: var(--stone); background: transparent; }
.field--check { padding: 2px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--lime); }

/* Media library */
.media-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.media-card { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; background: var(--charcoal-2); height: 100%; }
.media-card:hover { border-color: var(--lime); color: var(--off-white); }
.media-card img, .media-card__film { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: var(--obsidian); }
.media-card__film { display: grid; place-items: center; color: var(--lime); font-size: 22px; }
.media-card__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card__meta { font-size: 12px; line-height: 1.4; }
.media-detail { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .media-detail { grid-template-columns: 1fr; } }
.media-detail__preview { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--r); background: var(--obsidian); }
.facts { margin: 0; display: grid; gap: 4px 14px; grid-template-columns: auto 1fr; }
.facts dt { color: var(--stone); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
progress { accent-color: var(--lime); width: 160px; }
select.input { appearance: auto; }
.pre { white-space: pre-wrap; }
.segmented a[aria-current="page"] { border-color: var(--lime); color: var(--lime); }
/* Narrow screens: grid and flex children may shrink below their content width. */
.editor > *, .editor__fields > *, .item__body > *, .group > * { min-width: 0; }
.item__name { min-width: 0; }
@media (max-width: 640px) {
  .savebar__status { flex-basis: 100%; }
  .group { padding: 12px; }
  .item__body, .item__bar { padding-left: 10px; padding-right: 10px; }
}
.editor, .editor__fields, .item__body, .group, .list { grid-template-columns: minmax(0, 1fr); }
