:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #eef3fb;
  background: #10141b;
  --sidebar: #151b24;
  --surface: #181f2a;
  --raised: #202937;
  --border: #2d394a;
  --text: #eef3fb;
  --muted: #a7b5c8;
  --blue: #81b4ff;
  --action: #83b6ff;
  --ink: #111a28;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
a { color: var(--blue); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, video:focus-visible {
  outline: 2px solid #9fc7ff;
  outline-offset: 3px;
}
.skip { position: fixed; inset: .75rem auto auto .75rem; z-index: 5; padding: .6rem; background: var(--surface); transform: translateY(-180%); }
.skip:focus { transform: none; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.site-header { background: var(--sidebar); border-right: 1px solid var(--border); }
.header-inner { display: flex; flex-direction: column; gap: .55rem; padding: 1.6rem 1rem; }
.workspace .header-inner { min-height: 100vh; position: sticky; top: 0; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .25rem; color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 760; line-height: 1.3; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; margin-top: .1rem; }
.brand-mark { width: 2rem; height: 2rem; flex: 0 0 2rem; border: 2px solid var(--blue); border-radius: 50%; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: .42rem auto auto .66rem; border: .43rem solid transparent; border-left-color: var(--blue); }
.nav-title { color: var(--muted); font-size: .73rem; letter-spacing: .08em; text-transform: uppercase; margin: 2rem .55rem .2rem; }
.header-inner nav { display: grid; gap: .3rem; }
.header-inner nav a { display: flex; min-height: 43px; align-items: center; padding: .45rem .65rem; color: var(--muted); border: 1px solid transparent; border-radius: .45rem; text-decoration: none; }
.header-inner nav a:hover { background: var(--raised); color: var(--text); }
.header-inner nav a[aria-current] { color: #b8d6ff; background: #22354f; border-color: #354e72; font-weight: 700; }
.header-inner form { margin-top: auto; }
.header-inner form button { width: 100%; text-align: left; }
.signin .site-header { border-right: 0; border-bottom: 1px solid var(--border); }
.signin .header-inner { width: min(100%, 64rem); margin-inline: auto; padding: .9rem 1.25rem; }
.signin main { max-width: 31rem; margin-top: 2.5rem; }

main { width: min(100%, 96rem); min-width: 0; margin-inline: auto; padding: 2rem clamp(1.1rem, 3vw, 2.75rem) 3rem; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.12; letter-spacing: -.04em; margin: 0 0 1.45rem; }
h2 { margin: 0; font-size: 1.05rem; line-height: 1.35; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.panel, .metric, .circle-card { background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; }
.panel, .metric { padding: 1rem 1.15rem; }
.empty { padding: 1.4rem; color: var(--muted); margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; }
.metric { display: grid; gap: .22rem; }
.metric span { color: var(--muted); font-size: .88rem; }
.metric strong { font-size: 2rem; line-height: 1.25; letter-spacing: -.04em; }
.notice { color: #c7e0ff; background: #21324b; border-left: 3px solid var(--blue); border-radius: .35rem; padding: .75rem 1rem; }
.error { background: #3a2028; border-color: #ff949b; color: #ffc2c6; }
.shortcuts { margin-bottom: 1rem; }

.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: .75rem; margin-bottom: 1.1rem; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .45rem; grid-column: span 2; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.circle-card { display: flex; flex-direction: column; min-width: 0; overflow: clip; }
.video-stage { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 11; min-width: 0; background: #0b1018; }
.video-stage video { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.video-stage.unavailable { color: var(--muted); text-align: center; padding: 1rem; font-size: .87rem; }
.video-stage.unavailable::before { content: ""; width: 2rem; height: 2rem; border: 1px dashed #61748f; border-radius: 50%; align-self: end; margin-bottom: .5rem; }
.video-stage.unavailable span { align-self: start; }
.circle-body { display: flex; flex-direction: column; align-items: stretch; flex: 1; gap: .65rem; padding: 1rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem; }
.card-title h2 a { color: var(--text); text-decoration: none; }
.card-title h2 a:hover { text-decoration: underline; }
.card-title .muted, .card-meta { font-size: .81rem; }
.badges { display: flex; flex-wrap: wrap; gap: .38rem; }
.badge { display: inline-flex; align-items: center; width: fit-content; background: #293545; border: 1px solid #3c4c60; color: #c9d5e6; border-radius: 2rem; padding: .14rem .55rem; font-size: .75rem; font-weight: 680; }
.status-approved, .label-normal { background: #18362f; border-color: #2b574b; color: #a4e7c9; }
.status-rejected, .label-graphic { background: #40242f; border-color: #633747; color: #ffc1cd; }
.label-empty, .status-pending { background: #3b3020; border-color: #5e4a31; color: #ffdc9d; }
.label-nsfw, .status-quarantined { background: #392d43; border-color: #59466b; color: #e8cbfb; }
.circle-description { color: #cbd6e5; margin: 0; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: .3rem .75rem; color: var(--muted); margin-top: auto; }
.card-open { display: flex; justify-content: space-between; align-items: center; min-height: 39px; padding-top: .45rem; border-top: 1px solid var(--border); font-size: .9rem; font-weight: 650; text-decoration: none; }
.card-open:hover { text-decoration: underline; }
.card-open span { font-size: 1.2rem; }
.back-link { display: inline-block; margin: -.45rem 0 1rem; }
.viewer { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.viewer .video-stage { aspect-ratio: 1; max-height: 70vh; border: 1px solid var(--border); border-radius: .75rem; overflow: clip; }
.viewer-info { display: grid; gap: .9rem; }
.viewer-meta { display: grid; gap: .55rem; margin: 0; }
.viewer-meta > div { display: grid; grid-template-columns: minmax(5rem, .75fr) minmax(0, 1fr); gap: .5rem; border-top: 1px solid var(--border); padding-top: .5rem; }
.viewer-meta dt { color: var(--muted); }
.viewer-meta dd { margin: 0; overflow-wrap: anywhere; }

.people { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 1rem; align-items: start; }
.roster h2 { margin-bottom: .65rem; }
.participant { display: grid; gap: .15rem; padding: .65rem .6rem; border: 1px solid transparent; border-bottom-color: var(--border); text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.participant span { color: var(--muted); font-size: .8rem; }
.participant:hover, .participant[aria-current] { background: #22354f; border-color: #354e72; border-radius: .35rem; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .7rem; margin: 1rem 0; }
.details dt { font-size: .83rem; color: var(--muted); }
.details dd { margin: 0; font-weight: 680; overflow-wrap: anywhere; }
.queue-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin-bottom: .65rem; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; color: var(--muted); font-size: .87rem; }
.actions, .user-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: end; }
.user-actions input { max-width: 7rem; }
.promo-link { overflow-wrap: anywhere; user-select: all; }
.search { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; margin-bottom: .9rem; }
.search > div { flex: 1 1 12rem; min-width: 0; max-width: 22rem; }
.login-panel p:first-child { margin-top: 0; }
.login-panel button { margin-top: .8rem; }

label { display: block; font-size: .83rem; font-weight: 670; margin-bottom: .25rem; color: #c3d0e2; }
button, .button, input, select { font: inherit; min-height: 43px; border: 1px solid #43546c; border-radius: .42rem; }
input, select { width: 100%; min-width: 0; background: #121923; color: var(--text); padding: .48rem .63rem; }
input::placeholder { color: #a3afc1; }
button, .button { display: inline-flex; align-items: center; justify-content: center; color: var(--text); background: #253141; padding: .45rem .68rem; font-size: .87rem; font-weight: 660; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #30435a; }
.primary { color: var(--ink); background: var(--action); border-color: var(--action); }
.primary:hover { background: #a6ccff; }
.danger { color: #ffc1cb; border-color: #67414f; background: #36232c; }
.danger:hover { background: #4b2e3a; }
.quiet { color: var(--muted); background: transparent; }

@media (max-width: 1150px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .workspace { display: block; }
  .site-header { border-right: 0; border-bottom: 1px solid var(--border); }
  .workspace .header-inner { min-height: 0; position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .45rem; padding: .75rem 1rem; }
  .nav-title { display: none; }
  .header-inner nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; }
  .header-inner nav a { padding: .35rem .5rem; min-height: 36px; font-size: .85rem; }
  .header-inner form { margin: 0; }
}
@media (max-width: 620px) {
  main { padding-top: 1.25rem; }
  .gallery, .viewer, .people { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .participant-profile { grid-row: 1; }
  .viewer .video-stage { max-height: none; }
  .panel, .metric, .circle-body { padding: .82rem; }
}
