*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--surface); line-height: 1.5; }
a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 1rem; background: var(--primary); color: var(--primary-text); }
.topbar a, .topbar .link { color: var(--primary-text); text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.brand { font-weight: 700; font-size: 1.15rem; }
.container { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.card { background: #fff; border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; }
.narrow { max-width: 440px; margin: 2rem auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; }
label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
label.check { font-weight: 400; display: flex; gap: .5rem; align-items: center; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], select { width: 100%; padding: .6rem .7rem; font-size: 1rem; border: 1px solid #ccc; border-radius: 6px; background: #fff; }
input.short { width: 6rem; }
.button { display: inline-block; margin-top: 1rem; padding: .65rem 1.1rem; font-size: 1rem; font-weight: 600; color: var(--primary-text); background: var(--primary); border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
form.inline { display: inline; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form label { margin: 0; }
.inline-form .button { margin-top: 0; }
.inline-form select, .inline-form input[type=text] { width: auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row-between .button { margin-top: 0; }
.flash { background: #e8f3ea; border-left: 4px solid #2e7d32; padding: .6rem .9rem; border-radius: 4px; }
.error { color: #b42318; margin: .3rem 0 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid #eee; vertical-align: middle; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.avatar { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; display: block; margin-bottom: .5rem; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; }
.codes li { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface); padding: .4rem; text-align: center; border-radius: 4px; }
.pager { display: flex; gap: 1rem; justify-content: space-between; margin-top: 1rem; }
.small { font-size: .85rem; }
.impersonating { background: var(--accent); color: #1a1a1a; padding: .5rem 1rem; text-align: center; font-size: .95rem; }
.impersonating .link { text-decoration: underline; font-weight: 600; }
.button.secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.link.danger { color: #b42318; }
button.link { color: var(--primary); }
.topbar button.link { color: var(--primary-text); }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill-active { background: #e8f3ea; color: #1e6b2a; }
.pill-inactive { background: #eee; color: #555; }
.listing-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.listing-head h1 { margin-bottom: .25rem; }
.listing-hero { width: 180px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.room-input { width: 12rem !important; padding: .35rem .5rem !important; }
.assign-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .75rem; align-items: end; }
.assign-form label { margin-top: 0; }
@media (max-width: 600px) { .assign-form { grid-template-columns: 1fr; } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border-radius: 8px; padding: .75rem; display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; border-bottom: 1px solid #ddd; }
.bar { flex: 1; height: max(var(--h), 1px); background: var(--primary); border-radius: 2px 2px 0 0; opacity: .85; }
.bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .25rem; }
details.card summary { cursor: pointer; }
.actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.tips { padding-left: 1.2rem; line-height: 1.5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#progress-wrap { margin-top: 1rem; display: flex; align-items: center; gap: .75rem; }
#progress-wrap[hidden] { display: none; }
#progress { flex: 1; height: 1rem; }
.player { display: block; width: 100%; max-width: 640px; height: auto; background: #000; border-radius: 8px; }
.player.portrait { max-width: 360px; }
.player-audio { width: 100%; max-width: 480px; }
.pill-ready { background: #e8f3ea; color: #1e6b2a; }
.pill-processing, .pill-uploading { background: #fff4e0; color: #8a5300; }
.pill-failed { background: #fdecea; color: #b42318; }
.pill-none { background: #eee; color: #555; }
.embed { position: relative; max-width: 640px; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.embed.portrait { max-width: 360px; aspect-ratio: 9 / 16; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pill-link { background: #e6eefc; color: #1d4ed8; }
td button.link.small { display: block; font-size: .8rem; margin-top: .15rem; }
