:root {
  color-scheme: dark;
  font: 15px/1.5 "Inter", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: #f5f2fa;
  background: #14121a;
  --sidebar: #191620;
  --card: #201c29;
  --raised: #262131;
  --border: #363042;
  --muted: #b5a9c4;
  --accent: #f2aad1;
  --bright: #f8bee0;
}
* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 4px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 30px 17px 20px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 5px 36px; }
.brand strong, .brand small { display: block; }
.brand small, .local, .muted, .crumb { color: var(--muted); }
.brand-mark { display: grid; place-items: center; flex: 0 0 39px; height: 39px; border-radius: 11px; color: #281827; background: linear-gradient(140deg, #f6a9d8, #f8cfac); font-size: 23px; }
nav { display: grid; gap: 6px; }
nav a { display: flex; align-items: center; gap: 12px; border: 1px solid transparent; color: var(--muted); border-radius: 8px; padding: 10px 12px; }
nav a:hover, nav a[aria-current="page"] { color: var(--bright); background: #342538; border-color: #49344e; }
nav .glyph { width: 20px; text-align: center; }
nav .group-end { margin-bottom: 16px; }
.local { margin-top: auto; border-top: 1px solid var(--border); padding: 18px 5px 0; font-size: 12px; }
.local i { display: inline-block; background: #8ee6c0; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.topbar { height: 69px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; color: var(--muted); }
.shell { max-width: 1400px; margin: auto; padding: 32px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 4vw, 40px); line-height: 1.18; letter-spacing: -.045em; }
h2 { font-size: 18px; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 25px; }
.heading p { color: var(--muted); margin-top: 9px; }
.panel, .stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.panel { padding: 20px; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; min-height: 148px; margin-bottom: 22px; padding: 25px; background: radial-gradient(ellipse at 95% 20%, #4a2d49, transparent 75%), var(--card); }
.hero p, .release-info p { color: var(--muted); margin-top: 7px; }
.hero h2 { font-size: 25px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 14px 0 24px; }
.stat { padding: 14px; min-height: 113px; display: grid; align-content: space-between; color: var(--muted); }
.stat:hover { border-color: var(--accent); }
.stat strong { font-size: 28px; color: #fff; }
.stat .glyph { color: var(--accent); margin-right: 6px; }
.button { border-radius: 8px; padding: 8px 13px; border: 1px solid transparent; min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 650; white-space: nowrap; background: var(--accent); color: #251827; }
.button:hover { filter: brightness(1.12); }
.ghost { background: var(--raised); color: #f4e9f7; border-color: var(--border); }
.danger { color: #ffc0ca; }
button:disabled { opacity: .55; cursor: wait; }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input, select, textarea { width: 100%; background: #17141f; color: #fff; border: 1px solid #41394e; border-radius: 7px; padding: 9px 10px; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
input:read-only { color: var(--muted); }
textarea { min-height: 78px; resize: vertical; }
.workspace { display: grid; grid-template-columns: minmax(190px, 290px) minmax(0, 1fr); gap: 16px; align-items: start; }
.list .search { margin-bottom: 12px; }
.entry, .release { display: flex; align-items: center; gap: 10px; padding: 10px; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; color: inherit; text-align: left; }
.entry:hover, .entry[aria-current="true"] { background: #35263d; border-color: #513956; }
.entry strong, .entry small { display: block; overflow-wrap: anywhere; }
.entry small, .release small { color: var(--muted); }
.thumbnail { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: #191520; color: var(--accent); object-fit: contain; }
.edit-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 19px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.control { display: grid; align-content: start; gap: 6px; min-width: 0; }
.control > label, .control > span { color: var(--muted); font-size: 13px; }
.control.full, .rows { grid-column: 1 / -1; }
.image-input { display: flex; align-items: center; gap: 9px; min-width: 0; }
.image-input input { min-width: 0; }
.image-input .thumbnail { width: 44px; height: 44px; flex-basis: 44px; }
.rows { min-width: 0; margin: 1px 0; border: 1px solid var(--border); border-radius: 9px; padding: 13px; }
.rows legend { padding: 0 6px; font-weight: 650; }
.rows-list { display: grid; gap: 8px; }
.subrow { padding: 11px; background: #1a1722; border: 1px solid var(--border); border-radius: 8px; }
.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--muted); }
.row-head button { min-height: 30px; padding: 4px 8px; }
.rows > button { margin-top: 9px; }
.release { justify-content: space-between; border-bottom: 1px solid var(--border); border-radius: 0; }
.release:last-child { border-bottom: none; }
.release strong, .release small { display: block; }
#notice { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #536d61; background: #23352e; border-radius: 8px; white-space: pre-wrap; }
#notice.error { background: #3e252f; border-color: #825161; color: #ffcbd5; }
@media (max-width: 850px) {
  body { grid-template-columns: 165px minmax(0, 1fr); }
  .shell, .topbar { padding-left: 16px; padding-right: 16px; }
  .workspace { grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
}
@media (max-width: 630px) {
  body { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 0 10px; }
  nav { display: flex; flex-wrap: wrap; }
  nav a { padding: 5px 8px; }
  nav .group-end { margin-bottom: 0; }
  .local { display: none; }
  .topbar { height: 51px; }
  .shell { padding-top: 22px; }
  .workspace, .hero { grid-template-columns: 1fr; }
  .list-items { max-height: 170px; overflow: auto; }
  .fields { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
body.signed-out { display: block; }
.signed-out main { min-height: 100vh; display: grid; place-items: center; }
.signed-out .shell { width: min(100%, 460px); }
.login-card { padding: clamp(24px, 5vw, 48px); }
.credentials { display: grid; gap: 14px; }
.credentials label { display: grid; gap: 6px; }
.credentials .button { justify-self: start; }
.form-error { color: #ff9ba8; margin: 0; }
.form-error:empty { display: none; }
.account-panel { max-width: 540px; margin-bottom: 20px; }
.account-row { display: flex; flex-wrap: wrap; align-items: start; gap: 16px; padding: 14px 0; }
.account-row details { min-width: 130px; }
.account-row summary { cursor: pointer; }
.boot-workspace { display: grid; grid-template-columns: minmax(140px, 290px) minmax(0, 1fr); gap: 22px; }
.boot-preview { width: 100%; aspect-ratio: 9 / 16; position: relative; overflow: hidden; border-radius: 10px; box-shadow: 0 0 0 1px #56657d; }
.boot-logo { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; touch-action: none; cursor: grab; outline: 1px dashed #fff9; color: white; text-align: center; user-select: none; }
.boot-logo:active { cursor: grabbing; }
.boot-logo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; pointer-events: none; }
@media (max-width: 680px) {
  .boot-workspace { grid-template-columns: 1fr; }
  .boot-preview { max-width: 260px; margin: auto; }
}

.crop-dialog { width: min(92vw, 550px); max-height: 90vh; overflow: auto; color: inherit; }
.crop-dialog::backdrop { background: #090b15b8; }
.crop-dialog canvas { display: block; max-width: 100%; max-height: 35vh; margin: 0 auto 16px; background: #344057; }
.crop-dialog .tools { margin-top: 14px; }
