:root {
  color-scheme: dark;
  --bg: #12110e;
  --paper: #1c1a16;
  --paper-2: #262219;
  --line: #3c362c;
  --text: #f3eee4;
  --muted: #a89c8c;
  --accent: #e24b2a;
  --accent-2: #c6d36b;
  --warn: #e2b15a;
  --danger: #c94b4b;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(226, 75, 42, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button, .ghost, .danger {
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #fffaf6;
  cursor: pointer;
}
button:hover { filter: brightness(1.05); }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.danger { background: transparent; border: 1px solid var(--danger); color: #ffd4d4; }
.hidden { display: none !important; }
h1, h2 { font-family: Palatino, "Iowan Old Style", Georgia, serif; font-weight: 500; margin: 0; }
h1 { font-size: 2rem; letter-spacing: -0.03em; }
h2 { font-size: 1.25rem; }
.eyebrow { margin: 0 0 0.2rem; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; }
.hint, .meta, .empty { color: var(--muted); }
.error { color: #ffb4a8; min-height: 1.2em; }
.top, .accounts, .settings, .toolbar, .grid, .log-wrap { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.top { display: flex; justify-content: space-between; gap: 1rem; align-items: end; padding: 1.6rem 0 1rem; }
.top-side { display: flex; gap: 0.6rem; align-items: center; }
.pill { margin: 0; padding: 0.4rem 0.75rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); color: var(--muted); }
.banner { width: min(1180px, calc(100% - 2rem)); margin: 0 auto 1rem; padding: 0.75rem 1rem; border-radius: 12px; background: rgba(226, 177, 90, 0.12); color: var(--warn); }
.accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 1rem; box-shadow: var(--shadow); }
.panel-head { margin-bottom: 0.8rem; }
.panel-head p, .hint { margin: 0.25rem 0 0; }
label { display: grid; gap: 0.35rem; margin: 0.7rem 0; font-size: 0.92rem; }
input, textarea, select {
  width: 100%;
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
textarea { resize: vertical; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.account-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.5rem; }
.account {
  display: flex; justify-content: space-between; gap: 0.6rem; align-items: center;
  padding: 0.55rem 0.6rem; border-radius: 12px; background: var(--paper-2);
}
.account b { font-weight: 600; }
.account small { display: block; color: var(--muted); }
.account-actions { display: flex; gap: 0.4rem; align-items: center; }
.account-actions input { width: 4.2rem; padding: 0.4rem; }
.settings { margin-top: 1rem; }
.settings-grid { display: grid; grid-template-columns: 1.6fr 0.5fr auto; gap: 0.8rem; align-items: end; }
.settings-grid label { margin: 0; }
.toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin: 1rem auto; flex-wrap: wrap; }
.filters, .actions { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.filters button { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.filters button.on { background: var(--text); color: #1a1612; }
.check { display: flex; align-items: center; gap: 0.35rem; margin: 0; }
.check input, .tick input { width: auto; }
.actions select { width: 12rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; padding-bottom: 1rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 0.55rem; display: grid; gap: 0.4rem; }
.frame { position: relative; overflow: hidden; border-radius: 12px; }
.preview, .placeholder {
  display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border: 0; border-radius: 12px;
  background: #090807; padding: 0; cursor: pointer;
}
.placeholder { display: grid; place-items: center; color: var(--muted); }
.tick { position: absolute; top: 0.45rem; left: 0.45rem; background: rgba(0,0,0,0.55); border-radius: 8px; padding: 0.2rem 0.3rem; margin: 0; }
.badges { position: absolute; right: 0.45rem; bottom: 0.45rem; display: flex; flex-direction: column; gap: 0.25rem; align-items: end; }
.badge { background: rgba(18, 17, 14, 0.82); border-radius: 999px; padding: 0.15rem 0.45rem; font-size: 0.75rem; }
.badge.ok { color: var(--accent-2); }
.badge.warn { color: var(--warn); }
.card input, .card textarea { margin: 0; }
.card textarea { min-height: 3.2rem; }
.meta { margin: 0; font-size: 0.82rem; }
.card .error { margin: 0; font-size: 0.82rem; }
.card a { color: var(--accent-2); }
.log-wrap { padding-bottom: 2rem; }
.log-wrap h2 { margin-bottom: 0.4rem; }
pre {
  margin: 0; white-space: pre-wrap; background: #0d0c0a; border-radius: 14px; padding: 0.9rem 1rem;
  border: 1px solid var(--line); min-height: 7rem; color: #d9d0c3;
}
.login { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10, 9, 8, 0.72); }
.login-card { width: min(420px, calc(100% - 2rem)); background: var(--paper); padding: 1.3rem; border-radius: 18px; border: 1px solid var(--line); }
dialog {
  border: 0; padding: 0; background: transparent; width: min(420px, calc(100% - 2rem));
}
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
#player-video { width: 100%; max-height: 82vh; background: black; border-radius: 16px; }
#player-close { margin-top: 0.6rem; }
.toast {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #1a1612; padding: 0.7rem 1rem; border-radius: 999px;
}
.empty { text-align: center; margin: 2rem 0; }
@media (max-width: 860px) {
  .accounts, .settings-grid, .split { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}
