:root {
  color-scheme: light;
  --background: #f3f4f1;
  --surface: #ffffff;
  --text: #222622;
  --muted: #717870;
  --border: #dde1da;
  --track: #e8ebe6;
  --fill: #59615a;
  --boost: #ccebd4;
  --boost-strong: #5d7f65;
  --boost-yellow: #eef1b1;
  --danger-bg: #f6eded;
  --danger-border: #e8cccc;
  --danger-text: #704e4e;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--background);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.01em;
}

button, input { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.setup {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup__panel {
  width: min(420px, 100%);
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(35, 42, 35, 0.06);
}

.app-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 10px;
  background: #edf0ec;
  border-radius: 11px;
}

.app-icon span {
  flex: 1;
  background: #596159;
  border-radius: 2px 2px 1px 1px;
}
.app-icon span:nth-child(1) { height: 40%; }
.app-icon span:nth-child(2) { height: 85%; }
.app-icon span:nth-child(3) { height: 62%; }

h1, h2, p { margin-top: 0; }
.setup h1 { margin: 24px 0 8px; font-size: 27px; letter-spacing: -0.04em; }
.setup__description { margin-bottom: 28px; color: var(--muted); line-height: 1.55; }

.boost-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
  padding: 15px;
  cursor: pointer;
  background: #fafbf9;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.boost-option:has(input:checked) {
  background: linear-gradient(90deg, rgba(204, 235, 212, .62), rgba(238, 241, 177, .52));
  border-color: #c7d9bd;
}

.boost-option input { position: absolute; opacity: 0; pointer-events: none; }
.boost-option__copy { min-width: 0; }
.boost-option__copy strong, .boost-option__copy small { display: block; }
.boost-option__copy strong { font-size: 14px; }
.boost-option__copy small { margin-top: 4px; color: #667064; font-size: 12px; line-height: 1.4; }

.switch {
  width: 39px;
  height: 23px;
  flex: 0 0 auto;
  padding: 3px;
  background: #c7ccc5;
  border-radius: 999px;
  transition: background .15s ease;
}
.switch span {
  display: block;
  width: 17px;
  height: 17px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  transition: transform .15s ease;
}
.boost-option input:checked + .switch { background: #729478; }
.boost-option input:checked + .switch span { transform: translateX(16px); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}
.button--primary { width: 100%; color: white; background: #303630; }
.button--primary:hover { background: #242924; }
.button--secondary { color: #333933; background: #f7f8f6; border-color: var(--border); }
.button--secondary:hover { background: #f0f2ee; }
.button--text { min-height: 34px; padding: 0 10px; color: var(--muted); background: transparent; border-color: var(--border); }

.app {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 30px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.header h1 { margin-bottom: 6px; font-size: 28px; letter-spacing: -0.04em; }
.header p { margin-bottom: 0; color: var(--muted); }
.status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status > span:first-child { width: 7px; height: 7px; background: #b5bbb4; border-radius: 50%; }
.status.live > span:first-child { background: #76a27f; }
.status.degraded > span:first-child { background: #bd8585; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.volume-card { padding: 28px; }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.label { margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 600; }
.volume-card h2 { margin-bottom: 0; font-size: clamp(56px, 10vw, 88px); font-weight: 520; line-height: .95; letter-spacing: -0.07em; }
.volume-card h2 small { margin-left: 5px; color: var(--muted); font-size: 23px; font-weight: 500; letter-spacing: 0; }

.volume-track {
  --volume: 0;
  position: relative;
  height: 12px;
  margin-top: 38px;
  overflow: hidden;
  background: var(--track);
  border-radius: 999px;
}
.volume-track span {
  display: block;
  width: calc(var(--volume) * 1%);
  height: 100%;
  background: var(--fill);
  border-radius: inherit;
  transition: width .15s linear, background .15s ease;
}
body.boost-active .volume-track span {
  background: linear-gradient(90deg, #9fcfaa, #dadd83);
}
.automatic-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.preview {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid #eceeea;
}
.preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.preview strong, .preview span { display: block; }
.preview strong { margin-bottom: 4px; font-size: 14px; }
.preview span { max-width: 300px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.youtube-frame {
  width: 100%;
  min-width: 200px;
  min-height: 200px;
  margin-top: 16px;
  aspect-ratio: 16 / 9;
  background: #171917;
}
#youtube-player, #youtube-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 200px;
  min-height: 200px;
  border: 0;
}

.source-card { padding: 24px; }
.source-card__title { min-height: 38px; display: flex; justify-content: space-between; align-items: flex-start; }
.boost-badge { padding: 5px 8px; color: #4e6a55; background: var(--boost); border-radius: 999px; font-size: 11px; font-weight: 650; }
.source-card:not(.is-boost) .boost-badge { display: none; }
.details { margin: 12px 0 0; }
.details div { padding: 14px 0; border-bottom: 1px solid #eceeea; }
.details dt { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.details dd { margin: 0; font-size: 14px; font-weight: 560; overflow-wrap: anywhere; }
.details a { color: inherit; text-decoration: none; }
.details a:hover { text-decoration: underline; text-underline-offset: 3px; }
.technical-details { display: flex; flex-wrap: wrap; gap: 7px 12px; padding-top: 15px; color: #8a9189; font-size: 10px; }

.notice {
  margin-top: 14px;
  padding: 16px 18px;
  color: var(--danger-text);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 11px;
}
.notice strong { font-size: 13px; }
.notice p { margin: 4px 0 0; font-size: 12px; }

.recent { margin-top: 24px; padding: 0 4px; }
.recent ol { margin: 0; padding: 0; list-style: none; }
.recent li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 8px 0; color: var(--muted); border-top: 1px solid var(--border); font-size: 12px; }
.recent time { color: #8a9189; font-variant-numeric: tabular-nums; }

footer { margin-top: 32px; color: #969c95; font-size: 11px; text-align: center; }

@media (max-width: 720px) {
  .app { width: min(100% - 24px, 920px); padding-top: 30px; }
  .content-grid { grid-template-columns: 1fr; }
  .header { align-items: center; }
  .volume-card { padding: 22px; }
}

@media (max-width: 480px) {
  .setup { padding: 12px; }
  .setup__panel { padding: 26px 22px; }
  .header p { display: none; }
  .preview__header { align-items: flex-start; }
  .volume-card h2 { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
