:root {
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: #20332d;
  background: #f2f6f3;
  font-size: 16px;
  --forest: #164439;
  --deep: #122e27;
  --faint: #e8f0eb;
  --muted: #52685e;
  --line: #d6e1da;
  --paper: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select, input { border: 1px solid #a8bcb0; border-radius: 8px; }
button { background: var(--paper); color: var(--forest); cursor: pointer; font-weight: 650; padding: .55rem .85rem; }
button:hover { background: var(--faint); }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #aa632c; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
small { font-size: .875rem; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; background: radial-gradient(ellipse at top left, #508479, #173b31 60%); }
.login-panel { width: min(100%, 29rem); padding: clamp(1.5rem, 6vw, 3rem); border-radius: 20px; background: #fff; }
.login-panel img, .brand img { object-fit: contain; }
.login h1 { font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.07; margin: 1rem 0; letter-spacing: -.04em; }
.login p { color: var(--muted); }
#login-status { margin: 1rem 0; min-height: 1.5rem; }
#email-sign-in { display: grid; gap: .6rem; }
#email-sign-in label { font-weight: 650; }
#email { width: 100%; padding: .65rem .75rem; }
#email-submit, #redeem-link { background: var(--forest); color: white; }
#email-submit:hover, #redeem-link:hover { background: var(--deep); }
.dashboard { min-height: 100dvh; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
aside { color: #f7fbf8; background: var(--deep); min-height: 100dvh; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 2rem; }
.brand { display: flex; gap: .7rem; align-items: center; font-weight: 700; }
.brand small { display: block; font-weight: 500; color: #b9d5c8; }
nav { display: grid; gap: .25rem; }
nav a { border-radius: 8px; color: inherit; text-decoration: none; padding: .65rem .85rem; }
nav a:hover, nav a[aria-current="page"] { background: #2c5b4e; }
.account { margin-top: auto; display: grid; align-items: start; justify-items: start; gap: .6rem; padding: .4rem; }
.workspace { padding: clamp(1.15rem, 4vw, 3.5rem); max-width: 105rem; width: 100%; }
.workspace-header, .radio-panel, dialog header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.workspace h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.03; letter-spacing: -.035em; }
.workspace-header p, #radio-status { margin-top: .45rem; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
#search-form { display: flex; gap: .5rem; width: min(100%, 27rem); }
#search, select { padding: .65rem .75rem; background: var(--paper); color: inherit; }
#search { width: 100%; min-width: 0; }
#status { min-height: 1.5rem; margin: .85rem 0; color: var(--muted); }
.table-scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .85rem 1rem; vertical-align: top; }
th { background: var(--faint); font-weight: 700; white-space: nowrap; }
th button, .record { background: transparent; border: 0; padding: 0; text-align: left; border-radius: 2px; }
.record { text-decoration: underline; text-underline-offset: .18em; }
tr + tr td { border-top: 1px solid var(--line); }
td { min-width: 7rem; overflow-wrap: anywhere; }
td:first-child { min-width: 10rem; }
tr:hover td { background: #f7fbf8; }
#more { margin-top: 1rem; }
.radio-panel { margin-top: 1.5rem; background: #e0eee7; border: 1px solid #b9d0c2; border-radius: 12px; padding: 1rem; flex-wrap: wrap; }
meter { flex: 1; min-width: 5rem; max-width: 16rem; }
dialog { max-width: min(48rem, calc(100% - 2rem)); width: 100%; max-height: 85dvh; padding: 1.5rem; border: 1px solid var(--line); border-radius: 14px; color: inherit; }
dialog::backdrop { background: #0c2a23aa; }
.detail-group, .settings-section { padding: 1rem 0; border-top: 1px solid var(--line); }
#detail-body { margin-top: 1rem; }
#detail-body p, .settings-section p { white-space: pre-wrap; overflow-wrap: anywhere; }
dl { display: grid; grid-template-columns: minmax(6rem, max-content) 1fr; gap: .4rem 1rem; margin: 1rem 0; }
dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
audio { width: 100%; margin: .75rem 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 740px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  aside { min-height: 0; gap: .7rem; padding: .8rem; }
  nav { display: flex; flex-wrap: wrap; }
  nav a { padding: .35rem .6rem; }
  .account { display: flex; align-items: center; }
}
