@font-face {
  font-family: "Geist";
  src: url("vendor/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("vendor/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #111418;
  --surface: #181c22;
  --surface-2: #1d222a;
  --raised: #20252d;
  --field: #111418;
  --line: #262c34;
  --line-strong: #333b45;
  --fill: #262c34;
  --fill-strong: #2a313a;
  --fg: #e8eaed;
  --fg-2: #aab3be;
  --muted: #98a2ae;
  --faint: #7d8792;
  --disabled: #5f6873;
  --accent: #f4b860;
  --on-accent: #16110a;
  --danger: #ff9d90;
  --danger-line: #5c2b27;
  --danger-bg: #2c1614;
  --danger-fg: #ffc2b9;
  --danger-edge: #4a2320;
  --warning-bg: #2b2410;
  --warning-fg: #f1d58c;
  --success: #7fd6b0;
  --success-bg: #14261f;
  --success-fg: #b5e8cf;
  --notice-bg: #1d2530;
  --notice-fg: #c4d4ea;
  --radius-card: 16px;
  --radius-field: 10px;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tabbar-height: calc(80px + env(safe-area-inset-bottom));
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Components set display, which would otherwise win over the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fg); }

a:hover { color: #ffffff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

svg { flex-shrink: 0; }

.muted { color: var(--muted); }

.mono { font-family: var(--mono); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-station {
  font-size: 14px;
  color: var(--muted);
}

/* Negative block margins keep the header as tall as on pages without the link. */
.login-link { margin: -4px 0 -4px auto; }

main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}

main > h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead {
  margin: -8px 0 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-2);
}

/* Signed-in pages: a bottom tab bar on phones, and the account menu beside the page title. */

.signed-in main { padding-bottom: calc(var(--tabbar-height) + 32px); }

.signed-in main > h1 {
  font-size: 28px;
  padding-right: 48px;
}

.tabs {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px 8px calc(22px + env(safe-area-inset-bottom));
  background: #15181d;
  border-top: 1px solid var(--line);
}

.tabs a {
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  color: var(--muted);
}

.tabs a:hover { color: var(--fg); }

.tabs a[aria-current="page"] {
  color: var(--accent);
  font-weight: 500;
}

@media (max-width: 899px) {
  .signed-in .topbar {
    position: absolute;
    top: 0;
    right: 0;
    padding: 12px 8px 0 0;
  }

  .signed-in .topbar .brand { display: none; }

  .signed-in main { padding-top: 16px; }
}

@media (min-width: 900px) {
  .signed-in .topbar {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 24px;
    gap: 24px;
  }

  .signed-in .brand-station { display: none; }

  .tabs {
    position: static;
    display: flex;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
  }

  .tabs a {
    height: 40px;
    flex-direction: row;
    gap: 8px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--fg-2);
  }

  .tabs a svg { width: 18px; height: 18px; }

  .tabs a[aria-current="page"] {
    background: var(--fill-strong);
    color: var(--fg);
  }

  .tabs a[aria-current="page"] svg { color: var(--accent); }

  .topbar .account { margin-left: auto; }

  main { padding-top: 24px; }

  .signed-in main { padding-bottom: 64px; }

  .signed-in main > h1 { padding-right: 0; }
}

/* Menus: a details element whose summary is the trigger. */

.menu { position: relative; }

.menu > summary {
  list-style: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--fg-2);
  cursor: pointer;
}

.menu > summary::-webkit-details-marker { display: none; }

.menu > summary:hover { color: var(--fg); }

.menu[open] > summary {
  background: var(--fill-strong);
  color: var(--fg);
}

.menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  width: 220px;
  padding: 6px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  display: flex;
  flex-direction: column;
}

.menu-panel form { display: contents; }

.menu-panel a,
.menu-panel button {
  width: 100%;
  height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border-radius: 8px;
  background: none;
  border: 0;
  color: var(--fg);
  font: 400 15px var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-panel a:hover,
.menu-panel button:hover:not(:disabled) { background: var(--fill-strong); }

.menu-panel button:disabled {
  color: var(--disabled);
  cursor: default;
}

.menu-panel .danger {
  border: 0;
  color: var(--danger);
  font-weight: 400;
}

.menu-panel hr {
  width: calc(100% - 12px);
  height: 1px;
  margin: 4px 6px;
  border: 0;
  background: var(--line-strong);
}

.menu-head {
  margin: 0;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-head strong {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.menu-head span {
  font-size: 13px;
  color: var(--muted);
}

.account > summary {
  width: 44px;
  height: 44px;
  border-radius: 22px;
}

.account[open] > summary { background: none; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--fill);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.account[open] .avatar {
  background: var(--accent);
  color: var(--on-accent);
}

.account .menu-panel { width: 240px; }

/* Section navigation: a segmented control that marks the section scrolled to. */

.section-menu {
  position: sticky;
  z-index: 5;
  top: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 0 0 8px var(--bg);
}

.section-menu a {
  flex: 1 1 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  color: var(--fg-2);
}

.section-menu a[aria-current] {
  background: var(--fill-strong);
  color: var(--fg);
  font-weight: 500;
}

.count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--fill);
  font-size: 12px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.section-menu a[aria-current] .count { background: #3a424d; }

.count.bad {
  background: var(--danger-edge);
  color: #ffb4a9;
}

[data-section] {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: 72px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head .bulk {
  display: flex;
  gap: 4px;
}

.empty {
  margin: 0;
  padding: 20px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* Cards and forms */

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.card > h2,
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

form { margin: 0; }

label,
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 14px;
  font-weight: 500;
}

.label .muted,
.optional {
  font-weight: 400;
  color: var(--muted);
}

small,
.help {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

input, select, button, textarea {
  font: inherit;
  color: inherit;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  color: var(--fg);
  font: 400 16px var(--sans);
}

input[type="date"] { color-scheme: dark; }

input:focus,
select:focus {
  outline: none;
  border: 2px solid var(--accent);
  padding: 0 13px;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2398a2ae' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select:focus { padding-right: 39px; }

[aria-invalid="true"] { border-color: #f29c8f !important; }

/* A number field with its unit inside the box. */
.unit-input {
  height: 48px;
  display: flex;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
}

.unit-input:focus-within {
  border: 2px solid var(--accent);
}

.unit-input:has([aria-invalid="true"]) { border-color: #f29c8f; }

.unit-input input:not([type]),
.unit-input input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100% !important;
  border: 0 !important;
  padding: 0 14px !important;
  background: none !important;
  outline: none;
  font-family: var(--mono) !important;
}

.unit-input .unit {
  padding: 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.field-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--danger-fg);
}

.field-error svg { margin-top: 1px; }

/* Checkbox as a switch; the input stays in place, invisible, so it keeps focus and form semantics. */
.switch {
  position: relative;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  cursor: pointer;
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
}

.switch-text > span:first-child { font-size: 15px; font-weight: 500; }

.switch input {
  position: absolute;
  right: 0;
  top: 8px;
  width: 46px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  flex-shrink: 0;
  width: 46px;
  height: 28px;
  margin-top: 8px;
  padding: 3px;
  border-radius: 14px;
  background: var(--line-strong);
  display: flex;
  transition: background-color 0.15s;
}

.switch-track::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: var(--fg-2);
  transition: transform 0.15s, background-color 0.15s;
}

.switch input:checked + .switch-track { background: var(--accent); }

.switch input:checked + .switch-track::before {
  transform: translateX(18px);
  background: var(--on-accent);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch input:disabled + .switch-track { opacity: 0.5; }

/* Radio buttons as a segmented control. */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
}

.segmented label {
  position: relative;
  flex: 1 1 0;
  height: 38px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 14px;
  color: var(--fg-2);
  cursor: pointer;
}

.segmented input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  background: var(--fill-strong);
  color: var(--fg);
  font-weight: 500;
}

.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend { padding: 0; }

/* Buttons */

button,
.button {
  height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 16px var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.button:hover { color: var(--on-accent); }

button:hover:not(:disabled),
.button:hover { filter: brightness(1.06); }

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button.secondary,
.button.secondary {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--fg);
  font-weight: 500;
}

button.danger,
.button.danger {
  background: none;
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-weight: 500;
}

button.small,
.button.small {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

button.medium,
.button.medium {
  height: 44px;
  border-radius: 10px;
  font-size: 15px;
}

.icon-button {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  background: none;
  color: var(--fg-2);
}

.icon-button:hover:not(:disabled) {
  color: var(--fg);
  filter: none;
}

.icon-button.accent { color: var(--accent); }

.round-button {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 22px;
  background: var(--fill);
  color: var(--fg);
}

.round-button.playing,
.round-button.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.round-button .i-pause,
.round-button.playing .i-play { display: none; }

.round-button.playing .i-pause { display: block; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions > * { flex: 1 1 0; }

/* Alerts */

.alert {
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-field);
  background: var(--notice-bg);
  color: var(--notice-fg);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.alert::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: currentColor;
  mask: var(--alert-icon) center / contain no-repeat;
}

.alert.notice { --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 7.5h0'/%3E%3C/svg%3E"); }

.alert.success {
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
  background: var(--success-bg);
  color: var(--success-fg);
}

.alert.error {
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5h0'/%3E%3C/svg%3E");
  background: var(--danger-bg);
  color: var(--danger-fg);
}

.alert.warning {
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3z'/%3E%3Cpath d='M12 10v4M12 17h0'/%3E%3C/svg%3E");
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.alert a { color: inherit; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--fill);
  color: #c9d0d8;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.badge.warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.badge.danger {
  background: var(--danger-bg);
  color: var(--danger-fg);
}

a.badge { text-decoration: none; }

.badge [data-hearthis-percent] { margin-left: 4px; font-variant-numeric: tabular-nums; }

.error-text { color: var(--danger-fg); }

/* Progress bars */

progress {
  width: 100%;
  height: 8px;
  appearance: none;
  border: 0;
  border-radius: 4px;
  background: var(--fill-strong);
  overflow: hidden;
}

progress::-webkit-progress-bar { background: var(--fill-strong); }

progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 4px;
}

progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 4px;
}

progress.thin { height: 4px; }

/* Lists of rows inside one card */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.rows > li + li { border-top: 1px solid var(--line); }

.rows > li:first-child { border-radius: var(--radius-card) var(--radius-card) 0 0; }

.rows > li:last-child { border-radius: 0 0 var(--radius-card) var(--radius-card); }

.rows > li:only-child { border-radius: var(--radius-card); }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 4px 10px 12px;
}

.row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.row-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  font-size: 13px;
  color: var(--muted);
}

.row-meta .dot::before { content: "·"; }

.row-controls {
  display: flex;
  align-items: center;
}

/* Tracks */

.track {
  scroll-margin-top: 72px;
}

.track-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.track-card.failed { border-color: var(--danger-edge); }

.track-name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.track-card .track-name { font-size: 16px; font-weight: 500; }

.track-card.now .track-name { font-size: 17px; font-weight: 600; }

.track-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 14px;
  color: var(--fg-2);
}

.track-meta .dot::before { content: "·"; }

.track-meta.small { font-size: 13px; color: var(--muted); }

.track:target .track-card,
.track.targeted .track-card,
.rows > .track:target,
.rows > .track.targeted { box-shadow: inset 0 0 0 1px var(--accent); }

.track.targeted .track-card,
.track:target .track-card { border-color: var(--accent); }

.duplicate {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning-fg);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.duplicate svg { margin-top: 1px; }

.duplicate a { color: #fff0c4; }

.duplicate .state { opacity: 0.8; }

.step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.step-name { font-weight: 500; }

.step-count {
  color: var(--muted);
  font-weight: 400;
}

.elapsed {
  flex-shrink: 0;
  font-family: var(--mono);
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}

.live {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

details > summary { cursor: pointer; }

.disclosure > summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  font-size: 13px;
  color: var(--fg-2);
  overflow-wrap: anywhere;
}

.disclosure > summary::-webkit-details-marker { display: none; }

.disclosure > summary::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s;
}

.disclosure[open] > summary::before { transform: rotate(90deg); }

.disclosure > summary:hover { color: var(--fg); }

.live > summary { font-size: 14px; }

.log {
  max-height: 320px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 12px;
  background: #0c0e11;
  border-radius: var(--radius-field);
  font: 11.5px/1.6 var(--mono);
  color: var(--fg-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log:empty::before {
  content: "Waiting for log output…";
  color: var(--muted);
}

.attempts {
  display: flex;
  flex-direction: column;
}

.page-sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cards {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 4px 10px 12px;
}

.queue-item .row {
  min-height: 44px;
  padding: 0;
  gap: 4px;
}

.queue-item .duplicate { margin: 0 8px 0 26px; }

.queue-item.paused { background: #15181d; }

.queue-item.paused .row-title { color: var(--fg-2); }

.position {
  width: 22px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
}

/* Archive */

.archive-summary {
  margin: -12px 0 4px;
  font-size: 14px;
  color: var(--muted);
}

.archive-row .row { padding-left: 10px; }

.archive-row.expanded {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.archive-row .chevron { transition: transform 0.15s; }

.archive-row.expanded .chevron { transform: rotate(180deg); }

.archive-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 16px 16px;
}

.processed-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-2);
  overflow-wrap: anywhere;
}

.player-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg);
}

.player-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.seek {
  width: 100%;
  height: 24px;
  margin: 0;
  background: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.seek:disabled { cursor: default; opacity: 0.6; }

.time {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.details-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  font-size: 14px;
}

.details-grid dt {
  font-size: 12px;
  color: var(--muted);
}

.details-grid dd { margin: 2px 0 0; }

.details-grid .wide { grid-column: 1 / -1; }

.edit-metadata {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.archive-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-actions .secondary-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pages a,
.pages span {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  text-decoration: none;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.pages .gap {
  min-width: 0;
  padding: 0 4px;
  border: 0;
  color: var(--muted);
}

.pages [aria-current="page"] {
  background: var(--fill-strong);
  border-color: var(--fill-strong);
  font-weight: 600;
}

/* Upload page */

.dropzone {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px dashed #3a424d;
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.1s, background-color 0.1s;
}

.dropzone.stacked {
  flex-direction: column;
  padding: 20px 14px;
  text-align: center;
}

.dropzone:hover { border-color: var(--line-strong); border-color: #4a535f; }

.dropzone:focus-within {
  border-color: var(--accent);
  border-style: solid;
}

.dropzone.dragging {
  border-color: var(--accent);
  border-style: solid;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

.dropzone.chosen { border-style: solid; border-color: var(--line-strong); }

.dropzone:has(input:disabled) {
  opacity: 0.7;
  cursor: default;
}

/* Hidden from view but not from the form: required, focus and label activation keep working. */
.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.dropzone-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--fill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropzone-prompt {
  font-size: 15px;
  font-weight: 500;
}

.dropzone-prompt u {
  color: var(--accent);
  text-underline-offset: 3px;
}

.dropzone.chosen .dropzone-prompt {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.dropzone-files {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.dropzone-files:empty { display: none; }

.status {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status p { margin: 0; }

#status-detail {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.guide {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.guide h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.guide ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
}

.guide-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* Settings */

.settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.settings legend {
  float: left;
  font-size: 16px;
  font-weight: 600;
}

.settings legend + * { clear: both; }

@media (min-width: 640px) {
  .settings fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .settings legend,
  .settings .switch,
  .settings .wide { grid-column: 1 / -1; }
}

/* It follows the page only while there is something to save; settings.js marks that. */
.save-bar {
  position: static;
  z-index: 5;
  bottom: var(--tabbar-height);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
}

.save-bar.dirty {
  position: sticky;
  box-shadow: 0 -8px 24px rgb(0 0 0 / 0.35);
}

.save-bar .changes {
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--fg-2);
}

@media (min-width: 900px) {
  .save-bar {
    bottom: 16px;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
  }
}

/* Jingles */

.jingle-results {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jingle-results li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.jingle-results .line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.jingle-results .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jingle-results .text {
  flex-shrink: 1;
  min-width: 0;
  text-align: right;
  color: var(--fg-2);
}

.jingle-results li.success .text { color: var(--success); }

.jingle-results li.error .text,
.jingle-results li.warning .text { color: var(--danger-fg); }

.jingle-results li.warning .text { color: var(--warning-fg); }

.jingle-results li.success progress::-webkit-progress-value { background: var(--success); }
.jingle-results li.success progress::-moz-progress-bar { background: var(--success); }
.jingle-results li.error progress::-webkit-progress-value { background: var(--danger); }
.jingle-results li.error progress::-moz-progress-bar { background: var(--danger); }

.jingle {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 4px 12px 10px;
}

.jingle .row {
  min-height: 0;
  padding: 0;
  gap: 10px;
}

.jingle .duration {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.jingle .broken-icon {
  background: var(--danger-bg);
  color: var(--danger-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Users */

.block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row.static { padding-right: 12px; }

.user .avatar,
.row.static .avatar {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  font-size: 14px;
}

.user-panel button { width: 100%; }

.user > summary {
  list-style: none;
}

.user > summary::-webkit-details-marker { display: none; }

.user[open] {
  background: #1b1f26;
}

.user[open] .chevron { transform: rotate(180deg); }

.user .chevron {
  margin: 12px;
  color: var(--muted);
  transition: transform 0.15s;
}

.user > summary.row { padding-right: 0; cursor: pointer; }

.user-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 12px 16px 60px;
}

.row-title .badge { margin-left: 2px; }

.user .row-title,
.row.static .row-title {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Confirmation dialog */

dialog.confirm {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  background: var(--raised);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.5);
}

dialog.confirm::backdrop { background: rgb(0 0 0 / 0.6); }

.confirm-body { padding: 20px; }

.confirm-message {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.confirm-body .actions { justify-content: flex-end; }

.confirm-body .actions button { height: 44px; border-radius: 10px; font-size: 15px; }

.confirm-body button.danger {
  background: #b3261e;
  border: 0;
  color: #ffffff;
}

/* HearThis upload: the status in the archive panel and the upload form */

.hearthis-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.hearthis-status p { margin: 0; }

.hearthis-linked {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.hearthis-linked div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hearthis-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--fill);
}

dialog.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  background: var(--raised);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.5);
}

dialog.modal::backdrop { background: rgb(0 0 0 / 0.6); }

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.modal-body h2 { margin: 0; font-size: 18px; }

.modal-body p { margin: 0; }

.modal-body input[type="file"] { font-size: 14px; }

/* Anonymous pages: a narrower column. */

body:not(.signed-in) main { max-width: 480px; }
