:root {
  color-scheme: light;
  --bg: #f3eddf;
  --surface: #fffaf0;
  --surface-2: #eee6d7;
  --surface-3: #e3d8c3;
  --input: #fbf7ee;
  --text: #1c3426;
  --text-rgb: 28, 52, 38;
  --muted: #68766c;
  --accent: #24563a;
  --accent-strong: #173d28;
  --accent-rgb: 36, 86, 58;
  --on-accent: #fffdf7;
  --border: rgba(var(--text-rgb), 0.12);
  --border-strong: rgba(var(--text-rgb), 0.2);
  --subtle: rgba(var(--text-rgb), 0.045);
  --accent-soft: rgba(var(--accent-rgb), 0.13);
  --purple: var(--accent);
  --purple-strong: var(--accent-strong);
  --purple-soft: var(--accent-soft);
  --green: #37724f;
  --amber: #9a681f;
  --red: #a63e42;
  --sidebar: 304px;
  --server-rail: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 70% -20%, rgba(var(--accent-rgb), 0.11), transparent 35%), var(--bg); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); display: grid; grid-template-columns: var(--server-rail) minmax(0, 1fr); border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--on-accent); font-weight: 850; font-size: 18px; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.24); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -0.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.server-rail { min-height: 0; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 9px; background: var(--accent-strong); }
.rail-home { flex: 0 0 auto; display: block; }
.rail-home .brand-mark { width: 48px; height: 48px; border-radius: 16px; color: var(--accent-strong); background: var(--surface); box-shadow: 0 6px 20px rgba(0,0,0,0.16); transition: border-radius 150ms ease, transform 150ms ease; }
.rail-home:hover .brand-mark { border-radius: 13px; transform: translateY(-1px); }
.rail-divider { flex: 0 0 auto; width: 32px; height: 1px; background: rgba(255,255,255,0.18); }
.server-rail-list { min-height: 0; padding: 1px 4px; display: flex; flex: 1; flex-direction: column; align-items: center; gap: 9px; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
.server-rail-list::-webkit-scrollbar { display: none; }
.server-icon { position: relative; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; overflow: visible; border: 0; border-radius: 50%; color: var(--accent-strong); background: var(--surface-2); cursor: pointer; font-size: 11px; font-weight: 850; transition: border-radius 160ms ease, transform 130ms ease, background 130ms ease; }
.server-icon-image { width: 100%; height: 100%; box-sizing: border-box; display: block; border: 2px solid color-mix(in srgb, var(--surface) 82%, var(--accent-strong)); border-radius: inherit; background-position: center; background-size: cover; }
.server-icon:hover, .server-icon[aria-pressed="true"] { border-radius: 15px; background: var(--surface); transform: translateY(-1px); }
.server-icon::before { content: ""; position: absolute; left: -14px; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--surface); transition: height 160ms ease; }
.server-icon:hover::before { height: 20px; }
.server-icon[aria-pressed="true"]::before { height: 38px; }
.server-icon:focus-visible { outline: 3px solid var(--surface); outline-offset: 2px; }
.server-add { flex-basis: 44px; width: 44px; height: 44px; color: var(--accent-strong); background: color-mix(in srgb, var(--surface) 90%, transparent); font-size: 24px; font-weight: 500; }
.server-add:hover { border-radius: 14px; color: var(--on-accent); background: var(--accent); }
.server-add::before { display: none; }
.sidebar-panel { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 96%, transparent); }
.sidebar-server-header { min-height: 86px; padding: 17px 17px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.sidebar-server-header div { min-width: 0; }
.sidebar-server-header small, .sidebar-server-header strong, .sidebar-server-header span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-server-header small { margin-bottom: 5px; color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: 0.1em; }
.sidebar-server-header strong { font-size: 13px; }
.sidebar-server-header div > span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.main-nav { padding: 18px 13px; display: grid; gap: 6px; }
.nav-item { width: 100%; padding: 11px 12px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 13px; font-weight: 650; transition: 150ms ease; }
.nav-item span { width: 20px; color: var(--muted); font-size: 17px; text-align: center; }
.nav-item:hover { color: var(--text); background: var(--subtle); }
.nav-item.active { color: var(--accent-strong); background: var(--accent-soft); }
.nav-item.active span { color: var(--purple); }
.live-dot { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1); }
.sidebar-footer { margin-top: auto; padding: 15px 17px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); background: var(--subtle); }
.avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 800; font-size: 13px; background: var(--purple-strong); }
.avatar-image { background-position: center; background-size: cover; box-shadow: inset 0 0 0 1px var(--border); }
.identity { min-width: 0; }
.identity strong, .identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity strong { font-size: 12px; }
.identity small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.main-content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { min-height: 104px; padding: 27px clamp(24px, 4vw, 58px) 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0 0 6px; color: var(--purple); font-size: 9px; font-weight: 850; letter-spacing: 0.15em; }
h1 { margin: 0; font-size: clamp(24px, 3vw, 31px); line-height: 1.1; letter-spacing: -0.04em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.theme-button span { font-size: 14px; }
.mobile-server-switcher { display: none; }
.mobile-server-switcher select { max-width: 150px; height: 38px; padding: 0 28px 0 10px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--surface); outline: 0; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.mobile-server-switcher > span { display: none; }
.demo-switcher { height: 38px; padding: 0 8px 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 11px; }
.demo-switcher select { max-width: 110px; border: 0; color: var(--text); background: transparent; font-size: 12px; font-weight: 700; outline: 0; }
.demo-switcher option { background: var(--surface); }
.view { padding: 34px clamp(24px, 4vw, 58px) 64px; }
.view > * { max-width: 1240px; margin-right: auto; margin-left: auto; }

.button { min-height: 38px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 750; transition: transform 120ms ease, background 120ms ease, border 120ms ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: var(--on-accent); background: var(--accent-strong); box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.2); }
.button-primary:hover { background: var(--accent); }
.button-secondary { border-color: var(--border); background: var(--surface-2); }
.button-secondary:hover { border-color: var(--border-strong); background: var(--surface-3); }
.button-discord { color: white; background: #5865f2; box-shadow: 0 7px 20px rgba(88,101,242,0.22); }
.button-discord:hover { background: #6773f4; }
.button-danger { border-color: color-mix(in srgb, var(--red) 28%, transparent); color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); }
.button-quiet { padding: 6px 9px; min-height: 30px; color: var(--muted); background: transparent; }
.button-quiet:hover { color: var(--text); background: var(--subtle); }
.button:disabled { cursor: wait; opacity: 0.55; transform: none; }
.hidden, [hidden] { display: none !important; }

.auth-shell { min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; background: radial-gradient(circle at 50% 10%, rgba(var(--accent-rgb), 0.17), transparent 35%); }
.auth-card { position: relative; overflow: hidden; width: min(100%, 540px); padding: clamp(28px, 6vw, 48px); border: 1px solid var(--border-strong); border-radius: 22px; background: linear-gradient(155deg, var(--surface), var(--surface-2)); box-shadow: 0 28px 90px rgba(var(--text-rgb), 0.18); }
.auth-card::before { content: ""; position: absolute; width: 260px; height: 260px; top: -145px; right: -100px; border-radius: 50%; background: rgba(var(--accent-rgb), 0.16); filter: blur(2px); }
.auth-brand { position: relative; width: max-content; padding: 0 0 42px; }
.auth-orbit { position: relative; height: 72px; margin-bottom: 30px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.auth-orbit span { display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--subtle); font-size: 7px; font-weight: 850; }
.auth-orbit span:nth-child(2), .auth-orbit span:nth-child(5), .auth-orbit span:nth-child(6) { color: var(--accent-strong); border-color: rgba(var(--accent-rgb), 0.28); background: var(--accent-soft); }
.auth-card h1 { max-width: 420px; font-size: clamp(32px, 8vw, 48px); line-height: 1.02; }
.auth-copy { max-width: 440px; margin: 18px 0 25px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-button { width: 100%; min-height: 48px; font-size: 13px; }
.auth-fine-print { margin: 17px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; text-align: center; }
.auth-notice { margin: 0 0 18px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--amber) 24%, transparent); border-radius: 10px; color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, transparent); font-size: 10px; line-height: 1.5; }
.auth-notice code { color: var(--text); }

.hero { position: relative; overflow: hidden; padding: clamp(28px, 4vw, 46px); border: 1px solid rgba(var(--accent-rgb), 0.19); border-radius: 19px; background: linear-gradient(110deg, var(--surface), var(--surface-2)); }
.hero::after { content: ""; position: absolute; top: -90px; right: -20px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2), transparent 66%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 640px; }
.hero h2 { margin: 0 0 12px; max-width: 590px; font-size: clamp(26px, 4vw, 42px); line-height: 1.08; letter-spacing: -0.045em; }
.hero p { max-width: 570px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.hero-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.section-header { margin: 30px 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-header h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.section-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-header a, .section-header button.link { border: 0; color: var(--purple); background: none; cursor: pointer; font-size: 11px; font-weight: 700; }

.stat-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--purple); background: var(--purple-soft); font-size: 13px; }
.stat-value { margin-top: 10px; font-size: 27px; font-weight: 820; letter-spacing: -0.04em; }
.stat-note { margin-top: 4px; color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr); gap: 14px; }
.panel { border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.panel-body { padding: 18px; }
.panel-title { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.panel-title h3 { margin: 0; font-size: 13px; }
.panel-title small { color: var(--muted); font-size: 10px; }

.availability-preview { display: grid; gap: 8px; }
.preview-row { min-height: 35px; display: grid; grid-template-columns: 75px 1fr; align-items: center; gap: 10px; }
.preview-row > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.time-track { position: relative; min-height: 7px; overflow: hidden; border-radius: 99px; background: var(--subtle); }
.time-track i { position: absolute; top: 0; bottom: 0; display: block; min-width: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.preview-empty { color: var(--muted); font-size: 10px; }
.crew-list { display: grid; gap: 12px; }
.crew-member { display: flex; align-items: center; gap: 9px; }
.crew-member .avatar { width: 29px; height: 29px; font-size: 10px; }
.crew-member div:nth-child(2) { min-width: 0; flex: 1; }
.crew-member strong, .crew-member small { display: block; }
.crew-member strong { font-size: 11px; }
.crew-member small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.status-pill { padding: 4px 7px; border-radius: 20px; color: var(--green); background: rgba(var(--accent-rgb), 0.09); font-size: 8px; font-weight: 800; text-transform: uppercase; }

.form-page { max-width: 960px !important; }
.intro-row { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 20px; }
.intro-row h2 { margin: 0 0 7px; font-size: 20px; }
.intro-row p { max-width: 620px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.profile-library .intro-row { flex-wrap: wrap; }
.game-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 20px; }
.game-cover-card, .game-cover-add { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface-2); box-shadow: 0 8px 20px rgba(var(--text-rgb), .1); }
.game-cover-card > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.game-cover-placeholder { width: 100%; height: 100%; padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; background: linear-gradient(145deg, var(--surface-3), var(--accent-soft)); }
.game-cover-placeholder > span { color: var(--accent); font-size: 42px; }
.game-cover-placeholder small { color: var(--muted); font-size: 10px; }
.game-cover-caption { position: absolute; inset: auto 0 0; padding: 30px 13px 13px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.9)); font-size: 13px; font-weight: 750; }
.game-cover-remove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; color: #fff; background: rgba(0,0,0,.55); cursor: pointer; font-size: 20px; }
.game-cover-remove:hover { background: var(--red); }
.game-cover-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border: 2px dashed rgba(var(--accent-rgb), .3); background: rgba(var(--accent-rgb), .06); color: var(--accent-strong); box-shadow: none; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.game-cover-add:hover { background: rgba(var(--accent-rgb), .13); transform: translateY(-3px); }
.game-cover-add > span { font-size: 64px; font-weight: 250; line-height: 1; }
.game-cover-add small { color: var(--muted); }
.game-search-results { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; margin: 18px 0; }
.game-search-results p { color: var(--muted); font-size: 12px; }
.game-search-result { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); text-align: left; cursor: pointer; }
.game-search-result:hover { border-color: var(--accent); }
.game-search-result img { width: 100px; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 5px; }
.game-search-result strong { flex: 1; font-size: 12px; }
.game-search-result > span { font-size: 23px; }
.popular-game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.popular-game-card { position: relative; aspect-ratio: 2 / 3; padding: 0; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 9px; color: #fff; background: var(--accent-strong); cursor: pointer; text-align: left; }
.popular-game-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popular-game-card strong { position: absolute; inset: auto 0 0; padding: 26px 8px 8px; background: linear-gradient(transparent, rgba(0,0,0,.92)); font-size: 10px; }
.popular-game-card > span { position: absolute; top: 5px; right: 5px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; background: rgba(0,0,0,.6); font-size: 20px; }
.popular-game-card:hover, .popular-game-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#add-game-dialog .game-search-results { max-height: 55vh; }
.availability-intro { flex-wrap: wrap; }
.availability-intro > .button { flex-shrink: 0; }
.form-card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.form-card + .form-card { margin-top: 14px; }
.form-section { padding: 20px; }
.form-section + .form-section { border-top: 1px solid var(--border); }
.form-section-header { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.form-section-header h3 { margin: 0; font-size: 13px; }
.form-section-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: var(--muted); font-size: 10px; font-weight: 750; }
.field input, .field select, .field textarea, .compact-input { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--input); outline: 0; transition: border 120ms ease, box-shadow 120ms ease; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .compact-input:focus { border-color: rgba(var(--accent-rgb), 0.65); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.11); }
.field small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.schedule-days { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--border); }
.day-row { min-height: 64px; padding: 12px 14px; display: grid; grid-template-columns: 100px 1fr auto; align-items: start; gap: 14px; background: var(--surface); }
.day-name { padding-top: 9px; font-size: 11px; font-weight: 750; }
.interval-list { display: flex; flex-wrap: wrap; gap: 8px; }
.interval { display: flex; align-items: center; gap: 7px; }
.interval input { width: 104px; min-height: 34px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--input); }
.interval span { color: var(--muted); font-size: 10px; }
.remove-interval { width: 27px; height: 27px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.remove-interval:hover { color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.add-interval { min-height: 32px; padding: 7px 9px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--purple); background: transparent; cursor: pointer; font-size: 10px; font-weight: 750; }
.form-actions { padding: 14px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); background: var(--subtle); }
.exception-list { display: flex; flex-wrap: wrap; gap: 8px; }
.exception-chip { padding: 7px 9px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid color-mix(in srgb, var(--red) 20%, transparent); border-radius: 8px; color: var(--red); background: color-mix(in srgb, var(--red) 7%, transparent); font-size: 10px; }
.exception-chip button { border: 0; color: inherit; background: transparent; cursor: pointer; }
.exception-add { display: flex; align-items: center; gap: 7px; }
.exception-add input { min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--input); }
.week-picker { display: flex; align-items: end; gap: 6px; }
.week-picker label { display: grid; gap: 4px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.week-picker input { min-height: 36px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--input); }
.week-step { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; color: var(--accent-strong); background: var(--input); cursor: pointer; font-size: 20px; }
.week-step:hover { border-color: rgba(var(--accent-rgb), 0.42); background: var(--accent-soft); }
.specific-week-toolbar { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.specific-week-toolbar > strong { font-size: 11px; }
.specific-day-row.has-override { background: color-mix(in srgb, var(--surface) 91%, var(--amber)); }
.specific-day-row .day-name { display: grid; gap: 3px; }
.specific-day-row .day-name small { color: var(--muted); font-size: 8px; font-weight: 550; }
.day-source { width: max-content; margin-top: 3px; padding: 3px 5px; border-radius: 99px; color: var(--muted); background: var(--subtle); font-size: 7px; line-height: 1; text-transform: uppercase; }
.day-source.override { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.day-source.off { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.specific-day-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 160px; }
.specific-day-actions button { min-height: 29px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: var(--input); cursor: pointer; font-size: 8px; font-weight: 750; }
.specific-day-actions button:hover { color: var(--accent-strong); border-color: rgba(var(--accent-rgb), 0.34); }
.specific-day-actions .mark-specific-day-off:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 32%, transparent); }
.specific-day-actions button:disabled { opacity: 0.38; cursor: default; }
.specific-week-legend { padding-top: 10px; display: flex; justify-content: flex-end; gap: 14px; color: var(--muted); font-size: 8px; }
.specific-week-legend span { display: inline-flex; align-items: center; gap: 5px; }
.specific-week-legend i { width: 15px; height: 7px; display: block; border-radius: 2px; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); }
.specific-week-legend .override-key { background: linear-gradient(145deg, color-mix(in srgb, var(--amber) 82%, var(--accent)), var(--amber)); }
.view-toggle { flex: 0 0 auto; padding: 3px; display: inline-flex; gap: 2px; border: 1px solid var(--border); border-radius: 9px; background: var(--input); }
.view-toggle button { min-height: 29px; padding: 6px 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.view-toggle button:hover { color: var(--text); }
.view-toggle button[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.12); }

.calendar-section-header { align-items: center; }
.calendar-scroll { overflow: auto; max-height: 720px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); scrollbar-color: var(--accent) var(--surface-2); }
.weekly-calendar { min-width: 800px; background: var(--surface); }
.calendar-header { position: sticky; top: 0; z-index: 8; display: grid; grid-template-columns: 58px repeat(7, minmax(96px, 1fr)); border-bottom: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 97%, transparent); backdrop-filter: blur(12px); }
.calendar-corner { position: sticky; left: 0; z-index: 9; min-height: 53px; padding: 20px 7px 0; overflow: hidden; border-right: 1px solid var(--border); color: var(--muted); background: var(--surface); font-size: 7px; font-weight: 750; text-align: center; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.calendar-day-heading { min-height: 53px; padding: 10px 7px 8px; display: grid; place-content: center; border-right: 1px solid var(--border); text-align: center; }
.calendar-day-heading:last-child { border-right: 0; }
.calendar-day-heading strong, .calendar-day-heading small { display: block; }
.calendar-day-heading strong { font-size: 10px; }
.calendar-day-heading small { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; }
.calendar-day-heading.has-override { background: color-mix(in srgb, var(--surface) 86%, var(--amber)); }
.calendar-day-heading.has-override small { color: var(--amber); font-weight: 750; }
.calendar-body { display: grid; grid-template-columns: 58px 1fr; }
.calendar-axis { position: sticky; left: 0; z-index: 6; border-right: 1px solid var(--border); background: var(--surface); }
.calendar-axis span { position: absolute; right: 9px; color: var(--muted); font-size: 8px; transform: translateY(-50%); }
.calendar-axis span:first-child { transform: translateY(4px); }
.calendar-axis span:last-child { transform: translateY(-12px); }
.calendar-columns { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); }
.calendar-day-column { position: relative; height: 100%; border-right: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, rgba(var(--text-rgb),0.025) 24px, transparent 25px, transparent 47px, rgba(var(--text-rgb),0.07) 48px); }
.calendar-day-column:last-child { border-right: 0; }
.availability-calendar-block { position: absolute; left: 5px; right: 5px; z-index: 2; overflow: hidden; padding: 6px 7px; border: 1px solid rgba(var(--accent-rgb),0.35); border-radius: 7px; color: var(--on-accent); background: linear-gradient(145deg, var(--accent), var(--accent-strong)); box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.18); }
.availability-calendar-block strong, .availability-calendar-block small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.availability-calendar-block strong { font-size: 8px; }
.availability-calendar-block small { margin-top: 3px; color: rgba(255,255,255,0.72); font-size: 7px; }
.availability-calendar-block.is-override { border-color: color-mix(in srgb, var(--amber) 65%, var(--surface)); background: linear-gradient(145deg, color-mix(in srgb, var(--amber) 82%, var(--accent)), var(--amber)); }
.personal-calendar .calendar-day-column, .specific-calendar .calendar-day-column { touch-action: none; cursor: crosshair; }
.personal-calendar .availability-calendar-block, .specific-calendar .availability-calendar-block { cursor: grab; user-select: none; }
.personal-calendar .availability-calendar-block::after, .specific-calendar .availability-calendar-block::after { content: ""; position: absolute; bottom: 3px; left: 40%; right: 40%; height: 3px; border-radius: 3px; background: rgba(255,255,255,.6); cursor: ns-resize; }
.availability-calendar-block.drag-preview { z-index: 10; opacity: .75; pointer-events: none; outline: 2px solid var(--on-accent); }
.availability-calendar-block > strong { padding-right: 17px; }
.remove-calendar-slot { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 4px; color: inherit; background: rgba(0,0,0,.16); font-size: 16px; line-height: 1; cursor: pointer; }
.remove-calendar-slot:hover { background: rgba(0,0,0,.35); }
.remove-calendar-slot:focus-visible { outline: 2px solid var(--on-accent); outline-offset: 1px; }
.calendar-edit-help { color: var(--muted); font-size: 10px; line-height: 1.5; }
.overlap-calendar-slot { position: absolute; left: 4px; right: 4px; z-index: 2; overflow: hidden; padding: 2px 5px; display: flex; align-items: center; justify-content: space-between; gap: 3px; border: 1px solid rgba(var(--accent-rgb),0.2); border-radius: 5px; color: var(--on-accent); font-size: 7px; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
button.overlap-calendar-slot { width: calc(100% - 8px); cursor: pointer; font-family: inherit; }
.overlap-calendar-slot strong { color: white; font-size: 9px; }
.overlap-calendar-slot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlap-calendar-slot.meets-minimum { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.overlap-calendar-slot.schedulable { border-color: color-mix(in srgb, var(--on-accent) 72%, transparent); }
button.overlap-calendar-slot:hover, button.overlap-calendar-slot:focus-visible { z-index: 4; border-color: var(--on-accent); outline: 2px solid rgba(var(--accent-rgb),0.5); outline-offset: 1px; filter: brightness(1.08); }
.calendar-legend { padding: 10px 4px 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 8px; }
.calendar-legend i { width: 19px; height: 7px; display: block; border-radius: 2px; }
.calendar-legend small { margin-left: 12px; color: var(--purple); font-size: 8px; }

.filters { padding: 13px; display: flex; align-items: end; flex-wrap: wrap; gap: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.filters .field { min-width: 145px; }
.filters .field label { font-size: 9px; }
.filters .field input, .filters .field select { min-height: 35px; padding: 7px 9px; }
.heat-summary { margin: 16px 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.heat-day { min-height: 74px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: center; }
.heat-day strong, .heat-day small { display: block; }
.heat-day strong { font-size: 10px; }
.heat-day small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.heat-meter { height: 6px; margin-top: 13px; overflow: hidden; border-radius: 20px; background: var(--subtle); }
.heat-meter i { height: 100%; display: block; border-radius: 20px; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.window-list { display: grid; gap: 9px; }
.window-card { padding: 16px; display: grid; grid-template-columns: 75px minmax(0,1fr) auto; align-items: center; gap: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border 120ms ease, transform 120ms ease; }
.window-card:hover { border-color: rgba(var(--accent-rgb),0.32); transform: translateY(-1px); }
.window-date { padding-right: 14px; border-right: 1px solid var(--border); text-align: center; }
.window-date strong, .window-date span { display: block; }
.window-date strong { color: var(--purple); font-size: 17px; }
.window-date span { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.window-info strong { display: block; font-size: 13px; }
.window-info p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.people-stack { margin-top: 8px; display: flex; }
.people-stack .avatar { width: 22px; height: 22px; margin-left: -5px; border: 2px solid var(--surface); font-size: 8px; }
.people-stack .avatar:first-child { margin-left: 0; }
.count-badge { padding: 5px 8px; border-radius: 20px; color: var(--green); background: rgba(var(--accent-rgb),0.09); font-size: 9px; font-weight: 750; }

.gathering-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: 16px; align-items: start; }
.gathering-list { display: grid; gap: 10px; }
.gathering-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.gathering-card.cancelled { opacity: 0.62; }
.gathering-main { padding: 18px; display: grid; grid-template-columns: 54px 1fr; gap: 14px; }
.date-tile { width: 54px; height: 58px; display: grid; place-content: center; border-radius: 10px; color: var(--accent-strong); background: var(--accent-soft); text-align: center; }
.date-tile span, .date-tile strong { display: block; }
.date-tile span { font-size: 8px; font-weight: 800; text-transform: uppercase; }
.date-tile strong { font-size: 20px; line-height: 1.1; }
.gathering-heading { display: flex; justify-content: space-between; gap: 10px; }
.gathering-heading h3 { margin: 1px 0 4px; font-size: 14px; }
.gathering-heading p, .gathering-meta { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.game-tag { color: var(--purple); }
.rsvp-summary { margin-top: 12px; display: flex; gap: 10px; color: var(--muted); font-size: 9px; }
.gathering-actions { padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); background: var(--subtle); }
.rsvp-buttons { display: flex; gap: 6px; }
.rsvp-button { min-height: 31px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.rsvp-button:hover, .rsvp-button.selected { color: var(--text); border-color: rgba(var(--accent-rgb),0.35); background: var(--accent-soft); }
.empty-state { padding: 46px 20px; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--muted); text-align: center; }
.empty-state .empty-icon { width: 44px; height: 44px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 13px; color: var(--purple); background: var(--purple-soft); font-size: 20px; }
.empty-state h3 { margin: 0 0 7px; color: var(--text); font-size: 14px; }
.empty-state p { max-width: 360px; margin: 0 auto 16px; font-size: 11px; line-height: 1.55; }
.role-note { padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--amber) 24%, transparent); border-radius: 10px; color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, transparent); font-size: 10px; line-height: 1.5; }

.theme-dialog { width: min(92vw, 620px); max-height: 88vh; padding: 0; overflow: auto; border: 1px solid var(--border-strong); border-radius: 20px; color: var(--text); background: var(--surface); box-shadow: 0 28px 90px rgba(var(--text-rgb),0.25); }
.theme-dialog::backdrop { background: rgba(12, 25, 17, 0.44); backdrop-filter: blur(5px); }
.theme-dialog-card { padding: 24px; }
.theme-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.theme-dialog-header h2 { margin: 0; font-size: 21px; letter-spacing: -0.03em; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 21px; line-height: 1; }
.dialog-close:hover { color: var(--text); border-color: var(--border-strong); }
.theme-description { margin: 12px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.theme-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-presets button { padding: 10px; display: grid; gap: 5px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); cursor: pointer; text-align: left; }
.theme-presets button:hover, .theme-presets button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-presets strong { font-size: 10px; }
.theme-presets small { color: var(--muted); font-size: 8px; }
.theme-swatch { height: 54px; border: 1px solid rgba(0,0,0,0.09); border-radius: 8px; }
.cream-swatch { background: linear-gradient(135deg, #fffaf0 0 58%, #24563a 58%); }
.midnight-swatch { background: linear-gradient(135deg, #12101c 0 58%, #7c5cff 58%); }
.slate-swatch { background: linear-gradient(135deg, #f8faf8 0 58%, #3d6256 58%); }
.custom-theme-fields { margin-top: 18px; padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--subtle); }
.custom-theme-fields > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.custom-theme-fields label { color: var(--muted); font-size: 10px; font-weight: 750; }
.custom-theme-fields input { width: 48px; height: 34px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.theme-dialog-footer { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-dialog-footer small { color: var(--muted); font-size: 9px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 240px; max-width: 390px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); background: var(--surface-3); box-shadow: 0 14px 40px rgba(var(--text-rgb),0.2); font-size: 11px; animation: toast-in 180ms ease-out; }
.toast.error { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.loading-card { min-height: 420px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loader { width: 25px; height: 25px; border: 2px solid var(--border-strong); border-top-color: var(--purple); border-radius: 50%; animation: spin 700ms linear infinite; }
.loading-card p { font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  :root { --sidebar: 78px; }
  .sidebar { display: block; }
  .server-rail, .sidebar-server-header { display: none; }
  .sidebar-panel { min-height: 100vh; align-items: center; }
  .main-nav { width: 100%; padding: 22px 11px; }
  .nav-item { font-size: 0; }
  .nav-item { width: 46px; height: 43px; padding: 0; justify-content: center; }
  .nav-item span { font-size: 18px; }
  .identity { display: none; }
  .sidebar-footer { margin-top: auto; padding: 13px 0; background: transparent; }
  .mobile-server-switcher { display: block; }
  .dashboard-grid, .gathering-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --sidebar: 0px; }
  .sidebar { inset: auto 0 0; width: 100%; height: 63px; padding: 8px 12px; display: block; border: 0; border-top: 1px solid var(--border); }
  .sidebar-panel { min-height: 0; height: 100%; display: block; background: transparent; }
  .sidebar-footer { display: none; }
  .main-nav { height: 100%; padding: 0; display: flex; justify-content: space-around; }
  .nav-item { width: 54px; height: 46px; }
  .main-content { margin: 0 0 63px; }
  .topbar { min-height: 86px; padding: 19px 17px 15px; align-items: flex-end; }
  .topbar .manager-only[data-action="new-gathering"] { display: none !important; }
  .theme-button { width: 38px; padding: 8px; font-size: 0; }
  .theme-button span { font-size: 15px; }
  .demo-switcher span { display: none; }
  .mobile-server-switcher select { max-width: 116px; }
  .view { padding: 22px 16px 42px; }
  .hero { padding: 26px 22px; }
  .stat-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .day-row { grid-template-columns: 1fr auto; }
  .day-name { grid-column: 1; padding-top: 7px; }
  .interval-list { grid-column: 1 / -1; grid-row: 2; }
  .week-picker { width: 100%; flex-wrap: wrap; }
  .week-picker label { flex: 1; }
  .week-picker input { width: 100%; }
  .specific-week-toolbar { align-items: flex-start; flex-direction: column; }
  .specific-day-actions { grid-column: 2; grid-row: 1; }
  .specific-week-legend { justify-content: flex-start; flex-wrap: wrap; }
  .heat-summary { grid-template-columns: repeat(4, 1fr); }
  .form-section-header, .calendar-section-header { align-items: flex-start; flex-direction: column; }
  .calendar-scroll { max-height: 610px; }
  .weekly-calendar { min-width: 740px; }
  .calendar-legend { justify-content: flex-start; flex-wrap: wrap; }
  .calendar-legend small { width: 100%; margin-left: 0; }
  .window-card { grid-template-columns: 56px 1fr; }
  .window-card > .button { grid-column: 1 / -1; }
  .window-date { padding-right: 8px; }
  .gathering-actions { align-items: flex-start; flex-direction: column; }
  .rsvp-buttons { width: 100%; }
  .rsvp-button { flex: 1; }
  .theme-dialog-card { padding: 20px; }
  .theme-presets { grid-template-columns: 1fr; }
  .theme-swatch { height: 38px; }
  .custom-theme-fields { grid-template-columns: 1fr; }
}
