:root {
  color-scheme: dark;
  --ink: #edf1eb;
  --muted: #a8b1a7;
  --paper: #151a18;
  --surface: #1d2421;
  --surface-2: #252d29;
  --line: #37413c;
  --green: #83c9aa;
  --green-dark: #a4ddc2;
  --gold: #e3b86b;
  --red: #ff9b91;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
  --preview-panel-width: min(520px, 42vw);
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border: 2px solid var(--green);
  border-radius: 8px;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 0 clamp(1rem, 4vw, 3.5rem);
  background: rgba(21, 26, 24, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #102019;
  background: var(--green);
  border-radius: 9px 9px 9px 2px;
}
.main-nav {
  display: flex;
  justify-content: center;
  gap: .3rem;
}
.main-nav a {
  padding: .55rem .8rem;
  color: var(--muted);
  border-radius: 7px;
  font-weight: 600;
  text-decoration: none;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--green-dark);
  background: var(--surface-2);
}
.mobile-nav-extras { display: none; }
.account-menu { display: flex; align-items: center; gap: .8rem; }
.campaign-switcher { position: relative; }
.campaign-switcher summary {
  display: flex;
  min-width: 150px;
  flex-direction: column;
  padding: .35rem .75rem;
  border-radius: 8px;
  list-style: none;
  cursor: pointer;
}
.campaign-switcher summary::-webkit-details-marker { display: none; }
.campaign-switcher summary:hover { background: var(--surface-2); }
.campaign-switcher summary strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-popover {
  position: absolute;
  top: calc(100% + .6rem);
  right: 0;
  display: grid;
  min-width: 220px;
  padding: .45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.menu-popover a {
  display: flex;
  justify-content: space-between;
  padding: .65rem .75rem;
  border-radius: 6px;
  text-decoration: none;
}
.menu-popover a:hover, .menu-popover a[aria-current] { background: var(--surface-2); }
.menu-popover .menu-action { margin-top: .35rem; color: var(--green); border-top: 1px solid var(--line); border-radius: 0; font-weight: 700; }
.nav-toggle { display: none; }

.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 3.25rem 0 5rem; transition: width .2s ease, margin .2s ease; }
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}
.compact-header { width: min(760px, 100%); margin-right: auto; margin-left: auto; }
.page-header h1, .section-header h2, .auth-intro h1, .auth-form h2, .detail-title {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.05;
}
.page-header h1 { max-width: 780px; font-size: clamp(2.25rem, 6vw, 4rem); }
.page-header p:not(.eyebrow) { max-width: 650px; margin: .65rem 0 0; color: var(--muted); font-size: 1rem; }
.page-actions, .form-actions, .card-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.eyebrow {
  margin: 0 0 .35rem;
  color: var(--green);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.text-link { color: var(--green); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rich-text { white-space: pre-line; }

.button {
  display: inline-flex;
  min-height: 42px;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #102019; background: var(--green); border-color: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green-dark); background: #263b32; border-color: #365346; }
.button-ghost { background: transparent; border-color: var(--line); }
.button-ghost:hover { background: var(--surface-2); }
.button-danger { color: var(--red); background: #3b2928; border-color: #65403d; }
.button-small { min-height: 34px; padding: .48rem .7rem; font-size: .82rem; }
.button-full { width: 100%; }

.panel, .card, .form-card, .detail-panel, .room-row, .empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 1px rgba(38, 42, 34, .02);
}
.panel { padding: 1.4rem; }
.card { position: relative; padding: 1.25rem; transition: border-color .15s, transform .15s; }
.card:hover { border-color: #53635b; transform: translateY(-2px); }
.card-link { position: absolute; inset: 0; border-radius: inherit; }
.card-content, .card-actions { position: relative; z-index: 1; pointer-events: none; }
.card-actions a, .card-actions button, .card-actions form { pointer-events: auto; }
.card h3 { margin: .1rem 0 .45rem; font-family: var(--serif); font-size: 1.4rem; line-height: 1.15; }
.card p { margin: 0; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card-meta { display: flex; gap: .55rem; align-items: center; margin-bottom: .8rem; color: var(--muted); font-size: .8rem; }
.section { margin-top: 3rem; }
.section-header { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.8rem; }
.section-header p { margin: .25rem 0 0; color: var(--muted); }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1.25rem; }
.stack { display: grid; gap: .75rem; }
.rule { height: 1px; margin: 1.25rem 0; background: var(--line); border: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .5rem;
  color: var(--green-dark);
  background: #263b32;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
}
.color-dot { width: .6rem; height: .6rem; flex: none; background: var(--category-color, var(--green)); border-radius: 50%; }
.pin { color: var(--gold); }

.form-card { width: min(760px, 100%); margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.25rem); box-shadow: var(--shadow); }
.stack-form { display: grid; gap: 1.2rem; }
.field-group { display: grid; gap: .42rem; }
.field-group label { font-weight: 700; }
.field-group input:not([type="checkbox"]):not([type="color"]), .field-group textarea, .field-group select,
.search-field, .quick-form input:not([type="checkbox"]), .quick-form textarea {
  width: 100%;
  padding: .72rem .8rem;
  color: var(--ink);
  background: #151b18;
  border: 1px solid #46534c;
  border-radius: 7px;
  outline: none;
}
.field-group input:focus, .field-group textarea:focus, .field-group select:focus,
.search-field:focus, .quick-form input:focus, .quick-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(49, 88, 74, .13);
}
.field-group textarea { min-height: 150px; resize: vertical; }
.field-group input[type="color"] { width: 80px; height: 44px; padding: .2rem; border: 1px solid var(--line); border-radius: 7px; }
.checkbox-group { grid-template-columns: auto 1fr; align-items: start; }
.checkbox-group input { width: 18px; height: 18px; margin-top: .18rem; accent-color: var(--green); }
.checkbox-group .error-text { grid-column: 1 / -1; }
.help-text { margin: 0; color: var(--muted); font-size: .83rem; }
.error-text, .errorlist { margin: 0; padding: 0; color: var(--red); font-size: .84rem; list-style: none; }
.field-error input, .field-error textarea, .field-error select { border-color: var(--red); }
.form-alert { padding: .8rem 1rem; color: #ffc2bc; background: #3b2928; border-left: 3px solid var(--red); border-radius: 6px; }
.quick-form { display: grid; gap: .8rem; }
.quick-form textarea { min-height: 130px; resize: vertical; }
.quick-form .inline-fields { display: flex; justify-content: space-between; gap: .8rem; align-items: center; }
.search-bar { display: flex; gap: .6rem; margin-bottom: 1.4rem; }
.search-bar .search-field { flex: 1; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.4rem; }
.filter-tabs a { padding: .42rem .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; font-size: .82rem; font-weight: 700; text-decoration: none; }
.filter-tabs a:hover, .filter-tabs a[aria-current="true"] { color: var(--green-dark); background: #263b32; border-color: #365346; }

.empty-state { padding: clamp(2rem, 7vw, 4.5rem); text-align: center; border-style: dashed; }
.empty-state-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 1rem; place-items: center; color: var(--green); background: #263b32; border-radius: 50%; font-family: var(--serif); font-size: 1.8rem; }
.empty-state h2 { margin: 0; font-family: var(--serif); font-size: 1.65rem; }
.empty-state p { max-width: 460px; margin: .5rem auto 1.25rem; color: var(--muted); }
.message-stack { position: fixed; z-index: 40; top: 5.5rem; right: 1.25rem; display: grid; gap: .5rem; width: min(360px, calc(100% - 2rem)); }
.message { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; color: #102019; background: var(--green); border-radius: 8px; box-shadow: var(--shadow); }
.message button { color: inherit; background: transparent; border: 0; font-size: 1.2rem; line-height: 1; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 2rem; }
.detail-panel { padding: clamp(1.3rem, 4vw, 2.25rem); }
.detail-panel + .detail-panel { margin-top: 1rem; }
.detail-panel h2 { margin: 0 0 .7rem; font-family: var(--serif); font-size: 1.55rem; }
.detail-panel p:last-child { margin-bottom: 0; }
.detail-sidebar { display: grid; align-content: start; gap: 1rem; }
.sidebar-block { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.sidebar-block:first-child { padding-top: 0; }
.sidebar-block h3 { margin: 0 0 .5rem; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-block p { margin: 0; color: var(--muted); }

.room-list { display: grid; gap: .65rem; }
.room-row {
  display: grid;
  grid-template-columns: 90px minmax(180px, .7fr) minmax(260px, 1.3fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
}
.room-number { font-family: var(--serif); font-size: 1.55rem; font-weight: 700; }
.room-name { margin: .1rem 0 .25rem; font-weight: 700; }
.room-preview { color: var(--muted); white-space: pre-line; }
.room-preview strong { color: var(--ink); }
.connection-list { display: grid; gap: .55rem; }
.connection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  padding: .75rem;
  background: var(--surface-2);
  border-radius: 8px;
}
.connection-arrow { color: var(--green); font-weight: 700; }
.category-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.category-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.category-row:last-child { border-bottom: 0; }
.category-row > div:first-child { display: flex; gap: .65rem; align-items: center; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: #101411; }
.auth-panel { display: grid; width: min(940px, 100%); grid-template-columns: 1.1fr .9fr; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.auth-intro { display: flex; min-height: 570px; flex-direction: column; justify-content: end; padding: clamp(2rem, 6vw, 4rem); color: #f4f2e9; background: linear-gradient(150deg, rgba(27, 50, 42, .87), rgba(20, 27, 23, .98)), radial-gradient(circle at top right, #8e754b, #31584a); }
.auth-intro .brand { margin-bottom: auto; color: #fff; }
.auth-intro .brand-mark { color: var(--green-dark); background: #f0e5cb; }
.auth-intro .eyebrow { color: #dfc391; }
.auth-intro h1 { max-width: 430px; font-size: clamp(2.8rem, 6vw, 4.6rem); }
.auth-intro p:last-child { max-width: 430px; margin-bottom: 0; color: #d8ddd8; font-size: 1rem; }
.auth-form { align-self: center; padding: clamp(2rem, 6vw, 4rem); }
.auth-form h2 { font-size: 2.2rem; }
.auth-form > p { margin: .4rem 0 1.6rem; }

.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.badge-accent { color: #f1c778; background: #403522; }
.external-link { color: var(--green); font-size: .82rem; font-weight: 700; text-decoration: none; }
.external-link:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.card-footer-actions { justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.card-footer-actions .button { max-width: 100%; }
select option { color: var(--ink); background: var(--surface); }

.side-dialog {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  width: min(500px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, .42);
}
.side-dialog[open] { display: grid; grid-template-rows: auto 1fr auto; }
.side-dialog::backdrop { background: rgba(4, 7, 5, .76); backdrop-filter: blur(2px); }
.side-panel {
  position: fixed;
  z-index: 40;
  top: 72px;
  right: 0;
  display: grid;
  width: var(--preview-panel-width);
  height: calc(100dvh - 72px);
  grid-template-rows: auto 1fr auto;
  color: var(--ink);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, .42);
}
.side-panel[hidden] { display: none; }
.preview-drawer-header, .preview-drawer-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.preview-drawer-header h2 { margin: 0; font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.preview-drawer-body { overflow-y: auto; padding: 1.5rem; }
.preview-drawer-body > .badge { border-left: 3px solid var(--category-color, var(--green)); }
.preview-status { margin: 1rem 0 0; color: var(--muted); font-size: .85rem; }
.authenticated-preview-image { width: 100%; margin-top: 1rem; border: 1px solid var(--line); border-radius: 8px; }
.monster-stat-preview { margin-top: 1rem; padding: 1rem; color: #29180f; background: #f3ead5; border: 2px solid #b7472a; border-radius: 8px; }
.monster-stat-heading { padding-bottom: .65rem; border-bottom: 3px solid #b7472a; }
.monster-stat-heading h3 { margin: 0; color: #7d2619; font-family: var(--serif); font-size: 1.8rem; }
.monster-stat-heading p { margin: .1rem 0 0; font-style: italic; }
.monster-stat-attributes, .monster-stat-tidbits { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .45rem; margin: .7rem 0; }
.monster-stat-attributes dt, .monster-stat-tidbits dt { color: #7d2619; font-weight: 700; }
.monster-stat-attributes dd, .monster-stat-tidbits dd { margin: 0; }
.monster-abilities { display: grid; grid-template-columns: repeat(6, 1fr); gap: .25rem; padding: .65rem 0; border-top: 3px solid #b7472a; border-bottom: 3px solid #b7472a; }
.monster-ability { display: grid; text-align: center; }
.monster-ability strong { color: #7d2619; }
.monster-stat-sections section { margin-top: 1rem; }
.monster-stat-sections h4 { margin: 0 0 .4rem; padding-bottom: .15rem; color: #7d2619; border-bottom: 1px solid #b7472a; font-family: var(--serif); font-size: 1.35rem; }
.monster-stat-sections p { margin: .45rem 0; }
.character-reference-section { margin-top: 1.5rem; }
.character-reference-list { display: grid; gap: .55rem; }
.character-reference-list details { padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-raised); }
.character-reference-list summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; cursor: pointer; }
.character-reference-list summary a { position: relative; z-index: 1; flex: 0 0 auto; font-size: .85rem; }
.character-reference-list details p { margin: .75rem 0 0; white-space: pre-line; }
.preview-drawer-footer { flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 0; }
.preview-section { margin-top: 1.75rem; }
.preview-section h3 { margin: 0 0 .5rem; color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.preview-section p, .preview-section div { margin: 0; }
.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.5rem;
}
.quick-note-global-form { display: grid; align-content: start; gap: 1rem; overflow-y: auto; padding: 1.5rem; }
.quick-note-global-form input:not([type="checkbox"]), .quick-note-global-form textarea {
  width: 100%;
  padding: .72rem .8rem;
  color: var(--ink);
  background: #151b18;
  border: 1px solid #46534c;
  border-radius: 7px;
}
.quick-note-global-form textarea { min-height: 180px; resize: vertical; }
.quick-note-fab {
  position: fixed;
  z-index: 30;
  right: 1.25rem;
  bottom: 1.25rem;
  min-height: 48px;
  padding: .7rem 1rem;
  color: #102019;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 99px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.initiative-header { margin-bottom: .75rem; }
.initiative-header h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.initiative-header p:not(.eyebrow) { margin-top: .35rem; }
.button-next { min-width: 140px; min-height: 42px; }
.round-bar {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: .65rem .85rem;
  background: linear-gradient(120deg, #24362e, var(--surface));
  border: 1px solid #3b5749;
  border-radius: 12px;
}
.round-bar > div:first-child { display: flex; gap: .7rem; align-items: center; }
.round-bar .eyebrow { margin: 0; }
.round-number { font-family: var(--serif); font-size: 1.9rem; line-height: 1; }
.initiative-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .45fr); gap: 1rem; align-items: start; }
.initiative-sidebar { display: grid; gap: .75rem; position: sticky; top: 82px; }
.initiative-sidebar .panel { padding: 1rem; }
.initiative-sidebar .section-header { margin-bottom: .65rem; }
.initiative-sidebar .section-header h2 { font-size: 1.5rem; }
.initiative-list { display: grid; gap: .45rem; }
.initiative-participant {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(130px, .5fr) minmax(0, 1.5fr) auto;
  gap: .6rem;
  align-items: center;
  padding: .65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.initiative-participant.is-active { background: linear-gradient(100deg, #25392f, var(--surface)); border-color: var(--green); box-shadow: 0 0 0 1px rgba(131, 201, 170, .2); }
.initiative-participant.is-active::before { position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--green); border-radius: 12px 0 0 12px; content: ""; }
.initiative-score { display: grid; width: 42px; height: 42px; place-items: center; color: var(--green-dark); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-family: var(--serif); font-size: 1.45rem; font-weight: 700; }
.participant-heading h3 { margin: .08rem 0; font-family: var(--serif); font-size: 1.15rem; line-height: 1.1; }
.participant-source { font-size: .75rem; }
.active-turn { color: var(--gold); font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.participant-form { display: grid; grid-template-columns: minmax(80px, 1fr) 62px 72px 56px minmax(100px, 1fr); gap: .3rem; align-items: end; }
.participant-form label { display: grid; gap: .1rem; }
.participant-form label span { color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.participant-form input {
  min-width: 0;
  width: 100%;
  height: 30px;
  padding: .25rem .35rem;
  color: var(--ink);
  background: #151b18;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.participant-actions { display: flex; gap: .3rem; align-items: end; }
.participant-actions .button { min-height: 30px; padding: .35rem .55rem; }
.compact-form { gap: .55rem; }
.compact-form .field-group { gap: .25rem; }
.compact-form .field-group textarea { min-height: 90px; }
.compact-search { margin-bottom: .6rem; }
.source-list { display: grid; max-height: 420px; overflow-y: auto; }
.source-row { display: flex; gap: .4rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--line); }
.source-add-form { display: flex; min-width: 0; flex: 1; justify-content: space-between; gap: .75rem; align-items: center; }
.source-add-form > div { display: grid; min-width: 0; }
.source-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row span { display: flex; gap: .35rem; align-items: center; color: var(--muted); font-size: .75rem; }

@media (min-width: 901px) {
  body.preview-panel-open .page-shell {
    width: min(1180px, calc(100% - var(--preview-panel-width) - 2rem));
    margin-right: 0;
    margin-left: max(1rem, calc((100% - var(--preview-panel-width) - 1180px) / 2));
  }
  body.preview-panel-open .initiative-layout { grid-template-columns: 1fr; }
  body.preview-panel-open .initiative-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1250px) {
  .initiative-layout { grid-template-columns: 1fr; }
  .initiative-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .initiative-participant { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; }
  .participant-form { grid-column: 1 / -2; }
  .participant-actions { grid-column: -2 / -1; justify-self: end; }
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 64px; }
  .nav-toggle { display: grid; width: 40px; height: 40px; place-content: center; gap: 4px; background: transparent; border: 1px solid var(--line); border-radius: 7px; }
  .nav-toggle span:not(.sr-only) { display: block; width: 18px; height: 2px; background: var(--ink); }
  .main-nav { position: absolute; top: 63px; left: 0; display: none; width: 100%; flex-direction: column; padding: .75rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line); }
  .main-nav.is-open { display: flex; }
  .mobile-nav-extras { display: grid; gap: .35rem; margin-top: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
  .mobile-nav-extras .eyebrow { padding: .35rem .8rem 0; }
  .mobile-nav-extras form { margin-top: .5rem; }
  .account-menu { display: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid, .detail-layout { grid-template-columns: 1fr; }
  .room-row { grid-template-columns: 65px minmax(0, 1fr) auto; }
  .room-preview { grid-column: 2 / -1; }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 1.25rem, 1180px); padding-top: 2rem; }
  .page-header { display: grid; gap: 1.2rem; }
  .page-actions .button { flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .search-bar { display: grid; grid-template-columns: 1fr auto; }
  .search-bar .button-ghost { display: none; }
  .room-row { grid-template-columns: 55px minmax(0, 1fr); }
  .room-row .card-actions, .room-preview { grid-column: 1 / -1; }
  .connection { grid-template-columns: 1fr auto 1fr; }
  .connection form { grid-column: 1 / -1; }
  .category-row { align-items: flex-start; }
  .category-row > div:first-child { display: grid; }
  .auth-panel { grid-template-columns: 1fr; }
  .auth-intro { min-height: 280px; padding: 1.5rem; }
  .auth-intro .brand { margin-bottom: 3rem; }
  .auth-intro h1 { font-size: 2.7rem; }
  .auth-form { padding: 1.5rem; }
  .round-bar { display: grid; }
  .round-bar .page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .round-bar .page-actions form:last-child { grid-column: 1 / -1; }
  .round-bar .button { width: 100%; }
  .initiative-sidebar { grid-template-columns: 1fr; }
  .initiative-participant { grid-template-columns: 48px minmax(0, 1fr) auto; padding: .8rem; }
  .participant-form { grid-template-columns: 1fr 1fr; }
  .participant-form label:first-child, .participant-conditions { grid-column: 1 / -1; }
  .participant-form, .participant-actions { grid-column: 1 / -1; }
  .participant-actions { width: 100%; }
  .participant-actions .button { flex: 1; }
  .preview-drawer-footer .button { flex: 1; }
  .side-panel { top: 64px; width: min(620px, 70vw); height: calc(100dvh - 64px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
