* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: #12110e;
  color: #f3efe6;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: #a39b8d; }
.error { color: #e08b7d; min-height: 1.2em; }
.eyebrow { letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: #c4a46a; margin: 0 0 8px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card, .sheet {
  width: min(420px, 100%);
  background: #1c1a16;
  border: 1px solid #343027;
  border-radius: 18px;
  padding: 28px;
}
.card h1, .sheet h3 { margin: 0 0 8px; font-weight: 650; letter-spacing: -.02em; }
.card .primary, .sheet .primary { width: 100%; margin-top: 8px; }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
aside {
  background: #181612;
  border-right: 1px solid #2e2a24;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand { padding: 4px 12px 16px; }
.brand strong { display: block; font-size: 18px; }
.brand span { color: #a39b8d; font-size: 13px; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav button, .nav-quiet {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #c9c1b4;
}
nav button.active { background: #2a241c; color: #f6f1e7; }
.aside-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
main { padding: 28px 32px 72px; }
header h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
header p { margin: 6px 0 0; color: #a39b8d; }

.banner {
  background: #3a2e1c;
  color: #f0d7a6;
  border: 1px solid #c4a46a;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 16px 0;
}
.urls {
  font-family: Consolas, ui-monospace, monospace;
  color: #e6d3a8;
  margin: 0 0 16px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.device, .panel {
  background: #1c1a16;
  border: 1px solid #343027;
  border-radius: 16px;
  padding: 16px;
}
.device h3 { margin: 0; font-size: 18px; }
.topline { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6d675e; display: inline-block; }
.dot.on { background: #7dba8a; }
.pill {
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #2a241c;
  color: #e6d3a8;
}
.pill.warn { background: #3a2622; color: #f0b2a8; }
.meta { color: #a39b8d; font-size: 13px; line-height: 1.45; margin: 10px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

button.primary, button.ghost, button.danger, button.small {
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid transparent;
}
button.primary { background: #c4a46a; color: #1a1612; }
button.ghost { background: transparent; color: #f3efe6; border-color: #4a4338; }
button.danger { background: transparent; color: #e08b7d; border-color: #6a3a32; }
button.small { padding: 6px 8px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }

label.field { display: block; margin: 12px 0; color: #c9c1b4; font-size: 13px; }
input, select {
  width: 100%;
  background: #14120f;
  border: 1px solid #3a342c;
  border-radius: 10px;
  padding: 10px 12px;
}
label.field input, label.field select { margin-top: 6px; }
.row { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.row > input, .row > select { flex: 1; }
.row > button { flex: 0 0 auto; }
.check { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; }
.check input { width: auto; }
.days { margin: 8px 0 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #2e2a24; vertical-align: middle; }
th { color: #a39b8d; font-size: 12px; font-weight: 650; }
.split { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.plist button.item-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px;
  color: #f3efe6;
}
.plist button.item-link.active { background: #2a241c; }
.item {
  display: grid;
  grid-template-columns: 1fr 88px auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #2e2a24;
}
.item input { padding: 8px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media-card {
  background: #1c1a16;
  border: 1px solid #343027;
  border-radius: 12px;
  overflow: hidden;
}
.media-card img, .media-card video { width: 100%; height: 120px; object-fit: cover; background: #000; display: block; }
.media-card .meta { padding: 10px; }
.media-card button.pick {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  color: inherit;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 24px;
}
.sheet { width: min(640px, 100%); max-height: min(86vh, 820px); overflow: auto; }
.sheet.narrow { width: min(440px, 100%); }
pre {
  background: #14120f;
  border: 1px solid #3a342c;
  border-radius: 12px;
  padding: 14px;
  overflow: auto;
  color: #f0d7a6;
  font-family: Consolas, ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
}
.steps { line-height: 1.55; }
.steps li { margin: 8px 0; }
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2a241c;
  color: #f3efe6;
  border: 1px solid #c4a46a;
  padding: 12px 14px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  max-width: 360px;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }

.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.volume-row input[type="range"] { flex: 1; padding: 0; }
.volume-row strong { min-width: 48px; color: #e6d3a8; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.stat {
  background: #1c1a16;
  border: 1px solid #343027;
  border-radius: 14px;
  padding: 14px 16px;
}
.stat strong { display: block; font-size: 22px; letter-spacing: -.02em; }
.stat span { color: #a39b8d; font-size: 13px; }
.reports-split { margin-top: 14px; }
.reports-split h3 { margin: 0 0 10px; font-size: 16px; }

.preview-sheet { width: min(760px, 100%); }
.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.preview-orient { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-orient .active { border-color: #c4a46a; color: #f0d7a6; }
.preview-wrap {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 8px 0 18px;
  background:
    radial-gradient(ellipse at center, rgba(196,164,106,.08), transparent 60%),
    #14120f;
  border: 1px solid #343027;
  border-radius: 16px;
}
.tablet {
  background: #0a0908;
  border: 3px solid #4a4338;
  border-radius: 28px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.tablet.portrait { width: min(280px, 72vw); aspect-ratio: 9 / 16; }
.tablet.landscape { width: min(520px, 88vw); aspect-ratio: 16 / 9; }
.tablet-screen {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  position: relative;
}
.tablet-screen img,
.tablet-screen video,
.tablet-screen iframe.preview-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
  background: #000;
}
.tablet-screen iframe.preview-frame { object-fit: unset; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: sticky; top: 0; z-index: 5; }
  nav { flex-direction: row; overflow: auto; }
  nav button { width: auto; white-space: nowrap; }
  .aside-foot { margin-top: 8px; flex-direction: row; }
  main { padding: 20px 16px 64px; }
  .split, .item { grid-template-columns: 1fr; }
}
