:root {
  color-scheme: dark;
  --ink: #f6f2e8;
  --muted: #a8a7b4;
  --canvas: #12131b;
  --surface: rgba(27, 29, 42, .84);
  --border: rgba(224, 217, 197, .14);
  --gold: #efc778;
  --violet: #a99dff;
  --teal: #78d5cc;
  --good: #86d8a3;
  --warn: #efc778;
  --bad: #ef8f91;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
a { color: inherit; }
button, select, input, textarea { font: inherit; }
.skip-link { position: fixed; left: .75rem; top: -4rem; z-index: 10; padding: .7rem 1rem; background: var(--ink); color: #14141b; border-radius: .5rem; }
.skip-link:focus { top: .75rem; }
.atmosphere { position: fixed; z-index: -1; inset: 0; pointer-events: none; background: radial-gradient(circle at 83% 10%, rgba(134, 108, 255, .18), transparent 31rem), radial-gradient(circle at 8% 27%, rgba(42, 150, 142, .14), transparent 29rem), linear-gradient(145deg, #12131b, #171422 55%, #11171e); }
.site-header, main, footer { width: min(1180px, calc(100% - 2.5rem)); margin-inline: auto; }
.site-header { min-height: 5.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { width: 2.45rem; height: 2.45rem; display: grid; place-items: center; border: 1px solid rgba(239, 199, 120, .65); border-radius: .75rem; color: var(--gold); font-family: Georgia, serif; font-size: 1.45rem; background: linear-gradient(135deg, rgba(239, 199, 120, .16), rgba(169, 157, 255, .1)); }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.025em; }
.brand small, .eyebrow { color: var(--gold); font-size: .66rem; line-height: 1.3; letter-spacing: .14em; font-weight: 800; }
.brand small { margin-top: .18rem; }
nav { display: flex; align-items: center; gap: 1.25rem; font-size: .88rem; color: var(--muted); }
nav a { text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--ink); }
.nav-pro { color: var(--ink); padding: .55rem .8rem; border: 1px solid rgba(239, 199, 120, .35); border-radius: .5rem; }
main { padding: 4.8rem 0 4rem; }
.hero { min-height: 20rem; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(16rem, .7fr); align-items: center; gap: 4rem; padding-bottom: 4.5rem; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 13ch; margin-bottom: 1.1rem; font: 600 clamp(2.65rem, 5vw, 4.8rem)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.048em; }
h2 { font: 600 clamp(1.45rem, 2vw, 2rem)/1.08 Georgia, "Times New Roman", serif; letter-spacing: -.03em; }
.lede { max-width: 56ch; color: #d2ced1; font-size: 1.05rem; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.button { display: inline-flex; align-items: center; min-height: 2.8rem; padding: .7rem 1rem; border-radius: .55rem; text-decoration: none; font-weight: 700; font-size: .9rem; }
.primary { background: var(--gold); color: #201b18; box-shadow: 0 .6rem 1.8rem rgba(0,0,0,.19); }
.secondary { border: 1px solid var(--border); color: var(--ink); }
.session-pulse, .context-panel, .workspace-card, .workflow { border: 1px solid var(--border); background: var(--surface); box-shadow: 0 1.2rem 3.7rem rgba(0,0,0,.13); backdrop-filter: blur(13px); }
.session-pulse { padding: 1.4rem; border-radius: 1rem; }
.pulse-heading { display: flex; gap: .55rem; align-items: center; font-weight: 700; font-size: .91rem; }
.status-dot { width: .65rem; height: .65rem; flex: 0 0 auto; border-radius: 99px; background: var(--warn); box-shadow: 0 0 0 .24rem rgba(239, 199, 120, .13); }
.status-dot[data-state="ready"] { background: var(--good); box-shadow: 0 0 0 .24rem rgba(134, 216, 163, .13); }
.status-dot[data-state="degraded"] { background: var(--bad); box-shadow: 0 0 0 .24rem rgba(239, 143, 145, .13); }
.session-pulse p { margin: .9rem 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--gold); cursor: pointer; font-weight: 750; }
.text-button:hover, .text-button:focus-visible { text-decoration: underline; }
.context-panel { display: grid; grid-template-columns: 1fr minmax(16rem, .5fr); gap: 1.4rem 2rem; align-items: end; padding: 1.5rem; border-radius: 1rem; }
.section-heading h2 { margin: .25rem 0 0; }
.context-summary, .context-note { color: var(--muted); font-size: .87rem; line-height: 1.5; }
.campaign-picker { display: grid; gap: .4rem; color: var(--muted); font-size: .76rem; font-weight: 700; }
select { width: 100%; padding: .72rem .75rem; color: var(--ink); background: rgba(7, 8, 14, .48); border: 1px solid rgba(224,217,197,.22); border-radius: .5rem; }
select:disabled { cursor: wait; opacity: .75; }
.context-note { grid-column: 1 / -1; margin: 0; border-top: 1px solid var(--border); padding-top: .85rem; }
.workspace-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.1rem 0 4.5rem; }
.workspace-card { min-height: 25rem; display: flex; flex-direction: column; padding: 1.45rem; border-radius: 1rem; }
.workspace-card h2 { margin: 1rem 0 .65rem; }
.workspace-card p { color: var(--muted); font-size: .91rem; line-height: 1.6; }
.workspace-card ul { flex: 1; padding-left: 1.2rem; color: #d9d5db; font-size: .82rem; line-height: 1.75; }
.card-kicker { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.source-badge { display: inline-flex; padding: .25rem .42rem; border-radius: .35rem; font-size: .65rem; font-weight: 800; letter-spacing: .1em; }
.gmc { color: #201c14; background: var(--gold); }
.vcs { color: #102324; background: var(--teal); }
.pro { color: #1b1730; background: var(--violet); }
.availability { color: var(--warn); font-size: .69rem; font-weight: 750; }
.availability[data-state="ready"] { color: var(--good); }
.availability[data-state="degraded"] { color: var(--bad); }
.card-action { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--ink); text-decoration: none; font-weight: 750; font-size: .86rem; }
.card-action:hover, .card-action:focus-visible { color: var(--gold); }
.pro-card { border-color: rgba(169, 157, 255, .38); background: linear-gradient(155deg, rgba(75, 63, 143, .36), rgba(27,29,42,.9)); }
.prominent { color: var(--gold); }
.workflow { padding: 1.5rem; border-radius: 1rem; }
.workflow ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; list-style: none; padding: 0; margin: 2rem 0 1rem; }
.workflow li { display: flex; gap: .8rem; align-items: flex-start; }
.workflow li > span { color: var(--gold); font-weight: 800; font-size: .75rem; }
.workflow strong { display: block; margin-bottom: .28rem; }
.workflow p { color: var(--muted); line-height: 1.5; font-size: .84rem; }
.workflow-note { margin: 0; padding-top: 1rem; border-top: 1px solid var(--border); color: #d4d0d7; font-size: .88rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.6rem 0 2.5rem; color: var(--muted); border-top: 1px solid var(--border); font-size: .75rem; }
@media (max-width: 800px) { .site-header { padding: 1rem 0; align-items: flex-start; } nav { gap: .8rem; flex-wrap: wrap; justify-content: flex-end; } .hero { grid-template-columns: 1fr; gap: 1.8rem; } .context-panel { grid-template-columns: 1fr; } .workspace-grid, .workflow ol { grid-template-columns: 1fr; } .workspace-card { min-height: auto; } }
@media (max-width: 530px) { .site-header, main, footer { width: min(100% - 1.5rem, 1180px); } .site-header { display: block; } nav { margin-top: 1rem; justify-content: flex-start; } main { padding-top: 3rem; } h1 { font-size: 2.7rem; } footer { display: block; } footer span + span { display: block; margin-top: .4rem; } }

/* Encounter Workshop */
:root {
  --canvas: #0c1017;
  --surface-solid: #171c26;
  --surface-raised: #1c222e;
  --blue: #7dd3fc;
  --danger: #fb7185;
}

body { min-height: 100vh; }
[hidden] { display: none !important; }
.atmosphere { background: radial-gradient(circle at 80% 0%, rgba(88, 69, 160, .2), transparent 34rem), radial-gradient(circle at 4% 38%, rgba(18, 137, 125, .13), transparent 32rem), linear-gradient(145deg, #0c1017, #12131d 58%, #0c1318); }
.site-header { width: min(1440px, calc(100% - 3rem)); min-height: 4.7rem; }
.site-header nav { margin-left: auto; }
.site-header nav a[aria-current="page"] { color: var(--ink); }
.header-status { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.account-pill { display: flex; align-items: center; min-width: 0; max-width: 18rem; gap: .5rem; padding: .5rem .7rem; color: var(--muted); background: rgba(10, 13, 20, .56); border: 1px solid rgba(134, 216, 163, .3); border-radius: 999px; font-size: .72rem; white-space: nowrap; }
.account-pill .status-dot { width: .5rem; height: .5rem; }
.account-pill span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.account-pill strong { color: var(--ink); font-weight: 750; }
.authority-pill { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; color: var(--muted); background: rgba(10, 13, 20, .56); border: 1px solid var(--border); border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.authority-pill .status-dot { width: .5rem; height: .5rem; }
main { width: min(1440px, calc(100% - 3rem)); padding: 3.2rem 0 4rem; }
.view[hidden], .tab-panel[hidden] { display: none !important; }
.workshop-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(17rem, .55fr); align-items: end; gap: 4rem; padding: 1.4rem 0 3.2rem; }
.workshop-hero h1 { max-width: 14ch; margin: .6rem 0 1rem; font-size: clamp(2.7rem, 5vw, 4.7rem); }
.campaign-control { padding: 1.2rem; border: 1px solid var(--border); border-radius: .9rem; background: rgba(24, 29, 41, .7); }
.campaign-control label { display: block; margin-bottom: .5rem; color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.campaign-control p { margin: .55rem 0 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.1rem; border: 1px solid var(--border); border-radius: .9rem; background: rgba(22, 27, 37, .76); overflow: hidden; }
.summary-strip article { display: flex; align-items: center; justify-content: space-between; min-height: 4.7rem; padding: 1rem 1.2rem; border-right: 1px solid var(--border); }
.summary-strip article:last-child { border-right: 0; }
.summary-label { color: var(--muted); font-size: .76rem; }
.summary-strip strong { font-family: Georgia, serif; color: var(--ink); font-size: 1.45rem; }
.connection-summary strong { color: var(--good); font: 750 .82rem/1 Inter, sans-serif; }
.encounter-library { min-height: 25rem; padding: 1.4rem; border: 1px solid var(--border); border-radius: 1rem; background: rgba(22, 27, 37, .7); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.section-heading.compact { margin-bottom: 1rem; }
.section-heading.compact h2 { font-size: 1.55rem; }
.filter-row { display: flex; gap: .4rem; margin: 1.35rem 0 1rem; }
.filter-chip { padding: .42rem .72rem; border: 1px solid transparent; border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; font-size: .76rem; }
.filter-chip:hover, .filter-chip:focus-visible { color: var(--ink); }
.filter-chip.active { color: var(--ink); border-color: rgba(239, 199, 120, .3); background: rgba(239, 199, 120, .1); }
.encounter-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.encounter-card { display: flex; flex-direction: column; min-height: 16.5rem; padding: 1rem; border: 1px solid var(--border); border-radius: .8rem; background: linear-gradient(155deg, rgba(32, 38, 51, .9), rgba(19, 23, 32, .92)); cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.encounter-card:hover, .encounter-card:focus-visible { transform: translateY(-2px); border-color: rgba(239, 199, 120, .38); outline: none; }
.encounter-card-top { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.encounter-date { color: var(--muted); font-size: .68rem; }
.encounter-card h3 { margin: 1.05rem 0 .5rem; font: 600 1.22rem/1.2 Georgia, serif; }
.encounter-card > p { flex: 1; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .8rem; line-height: 1.55; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.encounter-metrics { display: flex; flex-wrap: wrap; gap: .38rem; margin: .5rem 0 .85rem; }
.encounter-metrics span { padding: .24rem .4rem; color: #c4c2cc; background: rgba(255,255,255,.035); border-radius: .3rem; font-size: .62rem; }
.encounter-card-action { display: flex; justify-content: space-between; padding-top: .75rem; border-top: 1px solid var(--border); color: var(--gold); font-size: .72rem; font-weight: 750; }
.status-badge { display: inline-flex; width: fit-content; padding: .27rem .48rem; border-radius: .35rem; color: var(--gold); background: rgba(239, 199, 120, .12); font-size: .65rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.status-badge.ready { color: var(--good); background: rgba(134, 216, 163, .12); }
.status-badge.active { color: var(--danger); background: rgba(251, 113, 133, .12); }
.status-badge.closed { color: var(--muted); background: rgba(168, 167, 180, .1); }
.skeleton-card { min-height: 12rem; border: 1px solid var(--border); border-radius: .8rem; background: linear-gradient(100deg, rgba(255,255,255,.025) 30%, rgba(255,255,255,.07) 45%, rgba(255,255,255,.025) 60%); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }
.empty-state { grid-column: 1 / -1; padding: 4rem 1rem; text-align: center; border: 1px dashed rgba(224, 217, 197, .18); border-radius: .8rem; }
.empty-state h3 { margin: .6rem 0 .4rem; font: 600 1.35rem Georgia, serif; }
.empty-state p { max-width: 46ch; margin: 0 auto 1.2rem; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.empty-icon { color: var(--gold); font-size: 1.8rem; }
.compact-empty { padding: 2rem 1rem; }
.back-link { display: inline-flex; gap: .4rem; margin-bottom: 1.25rem; color: var(--muted); text-decoration: none; font-size: .78rem; }
.back-link:hover { color: var(--ink); }
.editor-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; padding-bottom: 1.5rem; }
.editor-header h1 { max-width: none; margin: .5rem 0 .25rem; font-size: clamp(2.2rem, 4vw, 3.7rem); }
.editor-header p { margin: 0; color: var(--muted); font-size: .8rem; }
.status-line { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .68rem; }
#save-state[data-state="dirty"] { color: var(--warn); }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .48rem; }
button.button { border: 0; cursor: pointer; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.accent { color: #111d1d; background: var(--teal); }
.danger { color: #2b1116; background: var(--danger); }
.button.full { width: 100%; justify-content: center; }
.readiness-panel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid rgba(239, 199, 120, .2); border-radius: .8rem; background: rgba(239, 199, 120, .055); }
.readiness-panel[data-state="ready"] { border-color: rgba(134, 216, 163, .26); background: rgba(134, 216, 163, .055); }
.readiness-score { display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border: 3px solid rgba(239, 199, 120, .4); border-radius: 50%; color: var(--gold); font-size: .72rem; font-weight: 800; }
.readiness-panel[data-state="ready"] .readiness-score { border-color: rgba(134, 216, 163, .55); color: var(--good); }
.readiness-panel strong { display: block; font-size: .84rem; }
.readiness-panel p { margin: .2rem 0 0; color: var(--muted); font-size: .73rem; }
.editor-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); }
.editor-tabs button { padding: .8rem 1rem; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-size: .8rem; }
.editor-tabs button[aria-selected="true"] { border-bottom-color: var(--gold); color: var(--ink); }
.editor-tabs span { display: inline-grid; min-width: 1.25rem; margin-left: .25rem; padding: .08rem .25rem; place-items: center; border-radius: 999px; background: rgba(255,255,255,.07); font-size: .62rem; }
.tab-panel { padding-top: 1rem; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .3fr); gap: 1rem; }
.form-card, .authority-card, .quick-create, .map-stage-card, .map-settings { border: 1px solid var(--border); border-radius: .9rem; background: rgba(22, 27, 37, .72); }
.form-card { padding: 1.25rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .38rem; color: var(--muted); font-size: .7rem; font-weight: 700; }
.field > span { display: flex; align-items: baseline; justify-content: space-between; }
.field small { color: #737584; font-weight: 500; }
.field.span-2 { grid-column: span 2; }
input, textarea, .field select { width: 100%; padding: .67rem .72rem; border: 1px solid rgba(224, 217, 197, .16); border-radius: .48rem; outline: 0; color: var(--ink); background: rgba(7, 9, 14, .48); font-size: .8rem; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: rgba(239, 199, 120, .55); box-shadow: 0 0 0 3px rgba(239, 199, 120, .08); }
.authority-card { padding: 1.2rem; }
.authority-card h3, .quick-create h3 { margin: .55rem 0 .9rem; font: 600 1.15rem Georgia, serif; }
.authority-card dl { margin: 0 0 1rem; }
.authority-card dl div { padding: .58rem 0; border-bottom: 1px solid var(--border); }
.authority-card dt { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; }
.authority-card dd { overflow-wrap: anywhere; margin: .25rem 0 0; color: #d8d5dd; font: .67rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.authority-card > p:last-child, .quick-create > p { color: var(--muted); font-size: .72rem; line-height: 1.55; }
.roster-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, .31fr); gap: 1rem; align-items: start; }
.roster-list { display: grid; gap: .62rem; }
.roster-card { display: grid; grid-template-columns: auto 1fr; gap: .85rem; padding: .85rem; border: 1px solid var(--border); border-radius: .75rem; background: rgba(22, 27, 37, .72); }
.token-swatch, .content-avatar { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; flex: 0 0 auto; border: 2px solid color-mix(in srgb, var(--token-color), white 20%); border-radius: 50%; color: #0c1017; background-color: var(--token-color); background-position: center; background-size: cover; font-weight: 900; }
.roster-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: .65rem; }
.roster-heading strong, .roster-heading span { display: block; }
.roster-heading strong { font-size: .88rem; }
.roster-heading span { margin-top: .18rem; color: var(--muted); font-size: .62rem; }
.icon-button { width: 1.8rem; height: 1.8rem; padding: 0; border: 0; border-radius: .35rem; color: var(--muted); background: transparent; cursor: pointer; font-size: 1.25rem; }
.icon-button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.roster-fields { display: grid; grid-template-columns: 1.1fr repeat(5, .7fr); gap: .55rem; }
.roster-fields label { color: var(--muted); font-size: .6rem; }
.roster-fields label span { display: block; margin-bottom: .26rem; }
.roster-fields input, .roster-fields select { padding: .47rem .5rem; font-size: .72rem; }
.roster-fields .token-url { grid-column: span 6; }
.mini-upload { grid-column: span 6; }
.mini-upload span { display: inline-flex !important; width: fit-content; padding: .35rem .55rem; border: 1px dashed rgba(125,211,252,.32); border-radius: .35rem; color: var(--blue); cursor: pointer; }
.mini-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.quick-create { position: sticky; top: 1rem; padding: 1rem; }
.quick-create .field { margin-top: .72rem; }
.two-column, .three-column { display: grid; gap: .6rem; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-create .button { margin-top: .85rem; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(18rem, .45fr); gap: 1rem; align-items: start; }
.map-stage-card { padding: 1rem; }
.map-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.map-toolbar p { margin-bottom: .25rem; }
.map-preview { position: relative; min-height: 33rem; overflow: hidden; border: 1px solid rgba(224, 217, 197, .16); border-radius: .65rem; background-color: #0a0d13; background-position: center; background-size: contain; background-repeat: no-repeat; }
.map-preview::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .11; background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px); background-size: 5% 5%; }
.map-preview[data-has-map="false"]::after { display: none; }
.map-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: .4rem; text-align: center; color: var(--muted); }
.map-empty[hidden] { display: none; }
.map-empty strong { color: var(--ink); font-family: Georgia, serif; font-size: 1.25rem; }
.map-empty span { font-size: .72rem; }
.token-layer { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.map-token { position: absolute; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; transform: translate(-50%, -50%); border: 2px solid #e9f6ff; border-radius: 50%; color: #071015; background-color: var(--token-color); background-position: center; background-size: cover; box-shadow: 0 4px 12px rgba(0,0,0,.5); font-size: .7rem; font-weight: 900; }
.map-token.hostile, .map-token.hazard { border-color: #fecdd3; }
.map-token.ally { border-color: #bbf7d0; }
.map-settings { padding: 1rem; }
.map-settings .field { margin-top: .72rem; }
.upload-drop { display: grid; gap: .2rem; margin-top: .75rem; padding: .8rem; border: 1px dashed rgba(125,211,252,.3); border-radius: .5rem; color: var(--blue); background: rgba(125,211,252,.04); cursor: pointer; font-size: .72rem; font-weight: 750; text-align: center; }
.upload-drop:hover { border-color: rgba(125,211,252,.6); }
.upload-drop small { color: var(--muted); font-size: .62rem; font-weight: 500; }
.upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle-field { display: flex; align-items: center; gap: .5rem; margin-top: 1.45rem; color: var(--muted); font-size: .72rem; }
.toggle-field input { width: auto; }
.setting-note { margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .68rem; line-height: 1.55; }
.notice { margin-bottom: 1rem; padding: .9rem 1rem; border-radius: .65rem; }
.error-notice { border: 1px solid rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .08); }
.error-notice strong { display: block; color: #fecdd3; font-size: .83rem; }
.error-notice p { margin: .35rem 0 0; color: #d9c4ca; font-size: .73rem; line-height: 1.5; }
.error-notice .notice-action { margin-top: .7rem; margin-right: .75rem; }
.error-notice code { display: inline-block; margin-top: .55rem; color: #fda4af; font-size: .65rem; }
.error-notice[data-kind="warning"] { border-color: rgba(250, 204, 21, .34); background: rgba(250, 204, 21, .08); }
.error-notice[data-kind="warning"] strong { color: #fde68a; }
.error-notice[data-kind="warning"] p { color: #ddd2ad; }
.error-notice[data-kind="warning"] code { color: #fcd34d; }
dialog { width: min(34rem, calc(100% - 2rem)); padding: 1.2rem; border: 1px solid rgba(224, 217, 197, .18); border-radius: .9rem; color: var(--ink); background: #171c26; box-shadow: 0 2rem 6rem rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(4, 6, 10, .75); backdrop-filter: blur(5px); }
dialog .field { margin-top: .8rem; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { margin-top: .35rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.content-dialog { width: min(47rem, calc(100% - 2rem)); }
.content-filters { display: grid; grid-template-columns: 1fr 12rem; gap: .6rem; padding: .9rem 0; }
.content-list { display: grid; gap: .45rem; max-height: 55vh; overflow: auto; }
.content-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .65rem; border: 1px solid var(--border); border-radius: .55rem; }
.content-avatar { width: 2.2rem; height: 2.2rem; --token-color: #a99dff; font-size: .75rem; }
.content-avatar.player { --token-color: #7dd3fc; }
.content-avatar.hostile { --token-color: #fb7185; }
.content-card strong, .content-card span { display: block; }
.content-card strong { font-size: .78rem; }
.content-card span { margin-top: .15rem; color: var(--muted); font-size: .62rem; }
.content-actions { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; }
.quantity-stepper { display: grid; grid-template-columns: 1.75rem 2.6rem 1.75rem; align-items: stretch; min-height: 2rem; overflow: hidden; border: 1px solid var(--border); border-radius: .45rem; background: #10151e; }
.quantity-stepper label { display: block; }
.quantity-stepper input { width: 100%; height: 100%; min-height: 2rem; padding: .2rem; border: 0; border-right: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 0; text-align: center; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.quantity-step { border: 0; color: var(--ink); background: transparent; cursor: pointer; font-size: 1rem; }
.quantity-step:hover, .quantity-step:focus-visible { color: var(--gold); background: rgba(239,199,120,.08); outline: none; }
.content-card .button { min-width: 3.7rem; min-height: 2rem; padding: .4rem .65rem; font-size: .68rem; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.readiness-list { display: grid; gap: .45rem; padding-top: .8rem; }
.check-row { display: grid; grid-template-columns: auto 1fr; gap: .65rem; padding: .7rem; border: 1px solid var(--border); border-radius: .55rem; }
.check-row > span { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: rgba(251,113,133,.14); color: var(--danger); font-size: .7rem; font-weight: 900; }
.check-row.warning > span { color: var(--warn); background: rgba(239,199,120,.13); }
.check-row.complete > span { color: var(--good); background: rgba(134,216,163,.13); }
.check-row strong { font-size: .76rem; }
.check-row p { margin: .2rem 0 0; color: var(--muted); font-size: .68rem; }
.toast { position: fixed; z-index: 20; right: 1rem; bottom: 1rem; max-width: 26rem; padding: .75rem .9rem; border: 1px solid rgba(134,216,163,.28); border-radius: .55rem; color: #d7f8e1; background: #173126; box-shadow: 0 1rem 3rem rgba(0,0,0,.3); font-size: .75rem; }
footer { width: min(1440px, calc(100% - 3rem)); }

@media (max-width: 1080px) {
  .encounter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-header { align-items: flex-start; flex-direction: column; }
  .editor-actions { justify-content: flex-start; }
  .form-layout, .roster-layout, .map-layout { grid-template-columns: 1fr; }
  .quick-create { position: static; }
  .roster-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roster-fields .token-url { grid-column: span 3; }
  .mini-upload { grid-column: span 3; }
}

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 1.25rem, 1440px); }
  .site-header { flex-wrap: wrap; padding: .75rem 0; }
  .site-header nav { order: 3; width: 100%; margin: 0; }
  .header-status { margin-left: auto; }
  .workshop-hero { grid-template-columns: 1fr; gap: 1rem; padding-top: .5rem; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip article:nth-child(2) { border-right: 0; }
  .summary-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .encounter-list { grid-template-columns: 1fr; }
  .editor-actions .button { flex: 1 1 9rem; justify-content: center; }
  .readiness-panel { grid-template-columns: auto 1fr; }
  .readiness-panel .text-button { grid-column: 1 / -1; }
  .field-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .roster-card { grid-template-columns: 1fr; }
  .roster-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-fields .token-url { grid-column: span 2; }
  .mini-upload { grid-column: span 2; }
  .map-preview { min-height: 23rem; }
  .content-filters { grid-template-columns: 1fr; }
  .content-card { grid-template-columns: auto 1fr; }
  .content-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .header-status { width: 100%; margin-left: 0; justify-content: space-between; }
  .account-pill { max-width: min(18rem, 58vw); }
}

/* Living Story Workspace */
.story-hero h1 { max-width: 17ch; font-size: clamp(2.5rem, 4.5vw, 4.35rem); }
.story-empty { padding: 5rem 1.5rem; text-align: center; border: 1px dashed rgba(239, 199, 120, .28); border-radius: 1rem; background: rgba(22, 27, 37, .68); }
.story-empty h2 { margin: .8rem 0 .55rem; }
.story-empty p { max-width: 55ch; margin: 0 auto 1.4rem; color: var(--muted); line-height: 1.6; }
.story-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; padding: 1rem 0; }
.story-toolbar h2 { margin: .55rem 0 .2rem; font-size: clamp(2rem, 3vw, 3rem); }
.story-toolbar p { margin: 0; color: var(--muted); font-size: .72rem; }
#story-save-state[data-state="dirty"] { color: var(--warn); }
.story-summary strong { color: var(--gold); }
.current-scene-card { margin-bottom: 1rem; border-color: rgba(125, 211, 252, .28); background: linear-gradient(135deg, rgba(19, 32, 42, .9), rgba(22, 27, 37, .76)); }
.canonical-anchor-line { display: flex; align-items: baseline; gap: .65rem; margin: -.15rem 0 1rem; }
.canonical-anchor-line .story-guidance { margin: 0; }
.current-scene-grid, .story-impact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.current-scene-grid > div, .story-impact-grid > div { min-width: 0; padding: .85rem; border: 1px solid rgba(224, 217, 197, .11); border-radius: .65rem; background: rgba(7, 9, 14, .24); }
.current-scene-grid strong { display: block; margin-top: .35rem; color: #f0eadb; }
.current-scene-grid p { margin: .35rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.story-impact-grid { margin-top: .8rem; }
.story-readiness-inspection { margin-top: .9rem; padding: .85rem; border: 1px solid rgba(239, 199, 120, .2); border-radius: .7rem; background: rgba(7, 9, 14, .2); }
.story-readiness-inspection > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.story-readiness-inspection > summary::-webkit-details-marker { display: none; }
.story-readiness-inspection > summary::before { content: "▸"; color: var(--gold); }
.story-readiness-inspection[open] > summary::before { content: "▾"; }
.story-readiness-inspection > summary strong { flex: 1; font: 600 1rem Georgia, serif; }
.story-readiness-inspection > .story-guidance { margin: .75rem 0; }
.story-readiness-detail-grid { margin-top: .8rem; }
.story-readiness-inspection .status-badge[data-state="ready"] { color: var(--good); background: rgba(134, 216, 163, .12); }
.story-readiness-inspection .status-badge[data-state="warning"] { color: var(--warn); background: rgba(239, 199, 120, .12); }
.story-chip-list, .story-state-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.story-chip-list span, .story-state-list span { padding: .32rem .5rem; border: 1px solid rgba(224, 217, 197, .14); border-radius: 999px; color: #d9d5ca; background: rgba(255, 255, 255, .035); font-size: .64rem; line-height: 1.3; }
.story-state-list span[data-truth="scene"] { border-color: rgba(125, 211, 252, .32); }
.story-state-list span[data-truth="possibility"] { border-color: rgba(239, 199, 120, .32); }
.story-state-list span[data-truth="undetermined"] { border-style: dashed; color: var(--muted); }
.story-turn-workflow { margin-bottom: 1rem; }
.workflow-stage-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; padding: 0; list-style: none; counter-reset: story-stage; }
.workflow-stage-list li { counter-increment: story-stage; min-width: 0; padding: .75rem; border: 1px solid rgba(224,217,197,.12); border-radius: .65rem; background: rgba(7,9,14,.24); }
.workflow-stage-list strong, .workflow-stage-list span { display: block; }
.workflow-stage-list strong::before { content: counter(story-stage) ". "; color: var(--gold); }
.workflow-stage-list span { margin-top: .35rem; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.story-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, .32fr); gap: 1rem; align-items: start; }
.story-main, .story-side { display: grid; gap: 1rem; }
.story-card { padding: 1.2rem; border: 1px solid var(--border); border-radius: .9rem; background: rgba(22, 27, 37, .74); }
.story-card > h3 { margin: .55rem 0 1rem; font: 600 1.25rem Georgia, serif; }
.sticky-card { position: sticky; top: 1rem; }
.story-guidance { margin: -.2rem 0 1rem; color: var(--muted); font-size: .74rem; line-height: 1.55; }
.story-record-list { display: grid; gap: .75rem; }
.story-record { padding: 1rem; border: 1px solid rgba(224, 217, 197, .13); border-radius: .75rem; background: rgba(7, 9, 14, .28); }
.story-record-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.story-record-heading > strong, .story-record-heading > div > strong { display: block; margin-top: .35rem; font: 600 1.05rem/1.25 Georgia, serif; }
.story-truth-legend { display: flex; flex-wrap: wrap; gap: .45rem; margin: -.15rem 0 1rem; }
.story-truth-legend span { padding: .3rem .55rem; border: 1px solid rgba(224,217,197,.16); border-radius: 999px; color: #d8d5dd; font-size: .62rem; }
.story-truth-legend [data-truth="scene"] { border-color: rgba(125,211,252,.35); }
.story-truth-legend [data-truth="possibility"] { border-color: rgba(239,199,120,.35); }
.story-truth-legend [data-truth="undetermined"] { border-style: dashed; color: var(--muted); }
.story-graph { display: grid; gap: .65rem; }
.story-graph-branch { display: grid; gap: .55rem; }
.story-graph-children { display: grid; gap: .55rem; margin-left: 1rem; padding-left: .75rem; border-left: 1px solid rgba(125,211,252,.22); }
.story-related-links { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.story-related-links span { padding: .25rem .45rem; border-radius: 999px; background: rgba(125,211,252,.08); color: #bddfee; font-size: .6rem; }
.record-actions { display: flex; align-items: center; gap: .7rem; }
.scene-kit-record { border-color: rgba(125, 211, 252, .18); }
.scene-kit-section { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--border); }
.scene-kit-section summary { display: flex; align-items: center; gap: .5rem; color: #dedbe3; cursor: pointer; font-size: .76rem; font-weight: 750; }
.scene-kit-section summary span { display: inline-grid; min-width: 1.3rem; padding: .1rem .3rem; place-items: center; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.06); font-size: .62rem; }
.scene-kit-section > .text-button { margin-top: .65rem; font-size: .72rem; }
.story-subrecords { display: grid; gap: .5rem; margin-top: .65rem; }
.story-subrecord { display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: .65rem; border: 1px solid rgba(224,217,197,.1); border-radius: .55rem; background: rgba(255,255,255,.018); }
.story-subrecord-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.story-list-empty { display: grid; gap: .25rem; padding: 1.1rem; border: 1px dashed rgba(224,217,197,.14); border-radius: .55rem; color: var(--muted); font-size: .7rem; text-align: center; }
.story-list-empty strong { color: #cfccd4; font-size: .75rem; }
.story-checklist { display: grid; gap: .55rem; }
.checklist-item { display: grid; grid-template-columns: 1fr minmax(7rem, auto) auto; gap: .5rem; align-items: center; padding: .65rem; border: 1px solid rgba(239,199,120,.2); border-radius: .55rem; background: rgba(239,199,120,.045); }
.checklist-item.complete { opacity: .68; border-color: rgba(134,216,163,.18); background: rgba(134,216,163,.04); }
.checklist-item strong, .checklist-item span { display: block; }
.checklist-item strong { color: #ded9cc; font-size: .72rem; text-transform: capitalize; }
.checklist-item span { margin-top: .2rem; overflow-wrap: anywhere; color: var(--muted); font-size: .62rem; }
.checklist-item select { padding: .45rem; font-size: .65rem; }
.story-side > .story-card > .text-button { margin-top: .75rem; font-size: .7rem; }
.readiness-item { padding: .75rem; border: 1px solid rgba(125,211,252,.18); border-radius: .6rem; background: rgba(125,211,252,.035); }
.readiness-item-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.readiness-item-heading strong { font-size: .78rem; }
.readiness-item dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .7rem 0; }
.readiness-item dl div { min-width: 0; }
.readiness-item dt { color: var(--muted); font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; }
.readiness-item dd { overflow-wrap: anywhere; margin: .15rem 0 0; color: #d8d5dd; font-size: .65rem; }

@media (max-width: 980px) {
  .story-layout { grid-template-columns: 1fr; }
  .story-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sticky-card { position: static; }
  .workflow-stage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .story-toolbar { display: block; }
  .story-toolbar .editor-actions { margin-top: 1rem; justify-content: stretch; }
  .story-toolbar .button { flex: 1; justify-content: center; }
  .story-side { grid-template-columns: 1fr; }
  .current-scene-grid, .story-impact-grid, .workflow-stage-list { grid-template-columns: 1fr; }
  .story-subrecord-fields { grid-template-columns: 1fr; }
  .checklist-item { grid-template-columns: 1fr auto; }
  .checklist-item select { grid-column: 1 / -1; }
}
