:root {
  color-scheme: dark;
  --ink: #071012;
  --ink-soft: #0b1719;
  --panel: rgba(13, 31, 33, 0.9);
  --panel-soft: rgba(15, 36, 38, 0.66);
  --cream: #f5f0e5;
  --muted: rgba(245, 240, 229, 0.62);
  --faint: rgba(245, 240, 229, 0.4);
  --gold: #e6a84f;
  --gold-light: #f3c778;
  --green: #80d5b1;
  --red: #ee7d72;
  --line: rgba(245, 240, 229, 0.12);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background:
    linear-gradient(rgba(245, 240, 229, 0.022) 1px, transparent 1px) 0 0 / 58px 58px,
    linear-gradient(90deg, rgba(245, 240, 229, 0.022) 1px, transparent 1px) 0 0 / 58px 58px,
    radial-gradient(circle at 48% 28%, #16282a 0, #0b1719 38%, var(--ink) 78%);
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(243, 199, 120, 0.56);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.page-glow {
  position: fixed;
  z-index: -1;
  inset: 6% auto auto 50%;
  width: min(92vw, 1100px);
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(230, 168, 79, 0.12), transparent 68%);
  filter: blur(45px);
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(100%, 460px);
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(18, 42, 44, 0.98), rgba(7, 16, 18, 0.98));
  box-shadow: var(--shadow);
}
.mini-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  margin-bottom: 26px;
  border: 1px solid rgba(230, 168, 79, 0.38);
  border-radius: 50%;
  background: rgba(230, 168, 79, 0.08);
}
.mini-logo span { font-family: Georgia, serif; font-size: 1.55rem; color: var(--gold-light); }
.mini-logo i { position: absolute; right: -8px; width: 3px; border-radius: 3px; background: var(--gold); }
.mini-logo i:nth-of-type(1) { height: 14px; transform: translateX(-24px); }
.mini-logo i:nth-of-type(2) { height: 28px; transform: translateX(-18px); }
.mini-logo i:nth-of-type(3) { height: 42px; transform: translateX(-12px); }
.mini-logo i:nth-of-type(4) { height: 25px; transform: translateX(-6px); }
.mini-logo i:nth-of-type(5) { height: 10px; }
h1, h2, h3, p { margin-top: 0; }
.login-card h1 { margin-bottom: 12px; font: 500 clamp(2rem, 8vw, 3rem)/1 Georgia, serif; }
.lede { color: var(--muted); line-height: 1.65; }
form label { display: grid; gap: 8px; margin: 18px 0; }
label > span { color: var(--muted); font-size: 0.84rem; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--cream);
  background: rgba(4, 12, 14, 0.72);
}
textarea { resize: vertical; min-height: 100px; }
button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}
button:disabled { cursor: wait; opacity: 0.55; }
.primary { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #211609; }
.publish { background: var(--green); color: #082018; }
.danger { border: 1px solid rgba(238, 125, 114, 0.5); background: rgba(238, 125, 114, 0.1); color: #ffaaa2; }
.quiet { border: 1px solid var(--line); background: rgba(245, 240, 229, 0.04); }
.full { width: 100%; margin-top: 10px; }
.form-message { min-height: 1.3em; margin: 16px 0 0; color: #ffaaa2; font-size: 0.88rem; }
.app-shell { min-height: 100vh; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 14px max(20px, calc((100vw - 1260px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 18, 0.84);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand > span:not(.brand-signal) { display: grid; }
.brand strong { font: 500 1.35rem/1 Georgia, serif; }
.brand small { margin-top: 3px; color: var(--gold-light); font-size: 0.65rem; }
.brand em { padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-style: normal; }
.brand-signal { position: relative; width: 38px; height: 38px; border: 1px solid rgba(230,168,79,.45); border-radius: 50%; }
.brand-signal span, .brand-signal::before, .brand-signal::after {
  position: absolute; content: ""; top: 50%; width: 3px; border-radius: 3px; background: var(--gold); transform: translateY(-50%);
}
.brand-signal span { left: 17px; height: 20px; }
.brand-signal::before { left: 11px; height: 10px; }
.brand-signal::after { left: 23px; height: 14px; }
.account { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.content { width: min(1260px, calc(100% - 40px)); margin: 34px auto 70px; }
.broadcast-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(110deg, rgba(17, 42, 44, .96), rgba(10, 24, 26, .86));
  box-shadow: var(--shadow);
}
.broadcast-strip h1 { margin-bottom: 5px; font: 500 clamp(1.45rem, 4vw, 2.15rem)/1.1 Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.broadcast-strip p:last-child { margin: 0; color: var(--muted); }
.mode-orb { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(128,213,177,.38); border-radius: 50%; background: rgba(128,213,177,.08); }
.mode-orb span { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 7px rgba(128,213,177,.12), 0 0 22px var(--green); }
.mode-orb.live span { background: #ff7165; box-shadow: 0 0 0 7px rgba(255,113,101,.14), 0 0 24px #ff7165; animation: pulse 1.15s infinite; }
@keyframes pulse { 50% { transform: scale(.7); opacity: .7; } }
.stat-block { min-width: 105px; padding-left: 22px; border-left: 1px solid var(--line); }
.stat-block strong { display: block; font-size: 1.1rem; }
.stat-block span { display: block; margin-top: 4px; color: var(--faint); font-size: .73rem; text-transform: uppercase; letter-spacing: .08em; }
.notice { margin: 18px 0; padding: 12px 16px; border: 1px solid rgba(128,213,177,.3); border-radius: 12px; background: rgba(128,213,177,.08); color: var(--green); }
.notice.error { border-color: rgba(238,125,114,.4); background: rgba(238,125,114,.08); color: #ffaaa2; }
.tabs { display: flex; gap: 8px; margin: 30px 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { flex: 0 0 auto; background: transparent; color: var(--muted); }
.tab.active { background: rgba(230,168,79,.13); color: var(--gold-light); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin: 26px 0 18px; }
.section-heading h2 { margin-bottom: 6px; font: 500 clamp(1.55rem, 4vw, 2.25rem)/1.1 Georgia, serif; }
.section-heading p:last-child { max-width: 650px; margin-bottom: 0; color: var(--muted); }
.recording-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(440px, 1.3fr); gap: 18px; }
.recording-list, .editor, .track-table-wrap, .connection-card, .library-summary {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}
.recording-list { min-height: 430px; max-height: 690px; padding: 8px; overflow-y: auto; }
.recording-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  text-align: left;
  background: transparent;
}
.recording-item:hover, .recording-item.active { background: rgba(230,168,79,.1); }
.recording-item .dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--gold); }
.recording-item .published { background: var(--green); }
.recording-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recording-item small { display: block; margin-top: 5px; color: var(--muted); }
.editor { min-height: 430px; padding: clamp(20px, 4vw, 32px); }
.editor.empty { display: grid; place-items: center; }
.empty-state { max-width: 390px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--cream); }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 18px; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-size: 2rem; }
.editor-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.editor-head h3 { margin: 9px 0 0; font: 500 1.55rem/1.1 Georgia, serif; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: rgba(230,168,79,.12); color: var(--gold-light); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.duration { color: var(--muted); font-variant-numeric: tabular-nums; }
audio { width: 100%; margin: 22px 0 6px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-grid .wide { grid-column: 1 / -1; }
.artwork-preview { width: 150px; aspect-ratio: 1; margin: 12px 0; border-radius: 14px; overflow: hidden; }
.artwork-preview img { width: 100%; height: 100%; object-fit: cover; }
.rights-check { grid-template-columns: auto 1fr; align-items: start; margin-top: 24px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.rights-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); }
.rights-check span { line-height: 1.5; }
.legal-note { color: var(--faint); font-size: .79rem; line-height: 1.55; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.library-summary { display: flex; flex-wrap: wrap; gap: 26px; margin-bottom: 16px; padding: 18px 22px; color: var(--muted); }
.library-summary strong { color: var(--cream); }
.track-table-wrap { overflow: auto; }
.track-table { width: 100%; border-collapse: collapse; }
.track-table th, .track-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; }
.track-table th { color: var(--faint); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.track-table td { color: var(--muted); font-size: .86rem; }
.track-table td:first-child { color: var(--cream); font-weight: 700; }
.track-table select { min-width: 110px; padding: 8px; }
.track-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }
.connection-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.connection-card { padding: clamp(24px, 5vw, 40px); }
.connection-card.featured { background: linear-gradient(135deg, rgba(31,66,66,.88), rgba(12,27,29,.9)); }
.connection-card h2 { font: 500 2.2rem/1 Georgia, serif; }
.connection-card ol { margin: 24px 0 0; padding-left: 22px; color: var(--muted); line-height: 1.75; }
.connection-card li::marker { color: var(--gold); font-weight: 800; }
.connection-card dl { margin: 20px 0; }
.connection-card dl div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.connection-card dt { color: var(--muted); }
.connection-card dd { margin: 0; text-align: right; font-weight: 700; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(20px, calc((100vw - 1260px) / 2)); border-top: 1px solid var(--line); color: var(--faint); font-size: .78rem; }

@media (max-width: 820px) {
  .broadcast-strip { grid-template-columns: auto 1fr; }
  .stat-block { padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .recording-layout, .connection-grid { grid-template-columns: 1fr; }
  .recording-list { min-height: auto; max-height: 290px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; }
  .brand em, .account > span { display: none; }
  .content { width: min(100% - 24px, 1260px); margin-top: 16px; }
  .broadcast-strip { gap: 14px; padding: 20px; }
  .mode-orb { width: 44px; height: 44px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading button { width: 100%; }
  .editor { padding: 18px; }
  .form-actions button { width: 100%; }
  footer { flex-direction: column; }
}
