:root {
  --ink: #292d28;
  --muted: #6d736b;
  --paper: #f3efe5;
  --panel: #fffdf7;
  --panel-muted: #f8f4ea;
  --line: #ddd6c8;
  --line-strong: #c8bead;
  --forest: #285a46;
  --forest-dark: #173b2e;
  --gold: #a77b35;
  --red: #9a3e35;
  --sidebar-panel: #24493a;
  --sidebar-muted: #9aafa2;
  --button-primary: #285a46;
  --button-primary-hover: #173b2e;
  --button-primary-text: #fff;
  --focus-ring: rgba(40, 90, 70, .16);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 14px;
  --shadow: 0 6px 20px rgba(46, 42, 32, .055);
  --shadow-hover: 0 12px 28px rgba(46, 42, 32, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-size: 15px; }
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--forest-dark); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.15rem, 3.8vw, 3.2rem); line-height: 1.06; font-weight: 500; letter-spacing: -.032em; }
h2 { margin-bottom: .9rem; font-size: 1.08rem; line-height: 1.35; }
h3 { line-height: 1.4; }
p { line-height: 1.62; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
label { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; color: var(--ink); font-size: .8rem; font-weight: 700; letter-spacing: .015em; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); padding: .72rem .8rem; outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { border-color: var(--forest); box-shadow: 0 0 0 3px var(--focus-ring); }
textarea { resize: vertical; line-height: 1.5; }
select[multiple] { min-height: 8rem; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 20; display: flex; flex-direction: column; padding: 1.65rem 1rem 1rem; background: var(--forest-dark); color: #edf2ec; }
.brand { display: inline-flex; align-items: center; gap: .72rem; color: #fff; font-family: Georgia, serif; font-size: 1.55rem; letter-spacing: -.025em; }
.brand:hover { color: #fff; }
.brand img, .landing-brand img { flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.sidebar .brand img { width: 3.35rem; height: 3.35rem; box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 4px 12px rgba(0,0,0,.18); }
.sidebar nav { display: flex; flex: 1; flex-direction: column; gap: .18rem; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sidebar nav a { padding: .54rem .72rem; border-radius: var(--radius-sm); color: #c5d2ca; font-size: .84rem; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.sidebar nav a:hover { background: rgba(255,255,255,.075); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.15); color: #fff; box-shadow: inset 3px 0 0 var(--gold), 0 1px 0 rgba(255,255,255,.04); font-weight: 750; }
.nav-section { flex: 0 0 auto; }
.nav-section summary { position: relative; list-style: none; border-radius: var(--radius-sm); padding: .66rem .72rem; color: var(--sidebar-muted); cursor: pointer; font-size: .66rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary::after { position: absolute; right: .72rem; content: '\203A'; font-size: 1rem; line-height: .65; transition: transform .15s ease; }
.nav-section[open] summary::after { transform: rotate(90deg); }
.nav-section summary:hover, .nav-section summary.active-section { color: #fff; }
.nav-section summary.active-section { background: rgba(255,255,255,.065); }
.nav-section-links { display: grid; gap: .08rem; padding: .12rem 0 .42rem .35rem; }
.sidebar-note { margin: auto 0 0; color: #82978a; font-family: Georgia, serif; font-size: .78rem; font-style: italic; }
.campaign-context { margin: 1.35rem 0 1rem; border: 1px solid rgba(255,255,255,.11); border-radius: var(--radius-md); background: rgba(255,255,255,.045); padding: .78rem; }
.context-label { display: block; margin-bottom: .48rem; color: var(--sidebar-muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.campaign-switcher { margin: 0; }
.campaign-switcher label { margin: 0; }
.campaign-switcher select { border-color: rgba(255,255,255,.16); background: var(--sidebar-panel); color: #fff; padding: .62rem .68rem; font-size: .82rem; text-transform: none; letter-spacing: 0; }
.campaign-time { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .55rem; color: #9eb0a5; font-size: .67rem; }
.campaign-time:hover { color: #fff; }
.campaign-time span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-time strong { color: #d7dfda; white-space: nowrap; }
.choose-campaign { display: block; border: 1px solid rgba(255,255,255,.16); border-radius: 6px; background: var(--sidebar-panel); padding: .62rem .65rem; color: #fff; font-size: .82rem; }
.sidebar-account { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: .5rem; margin-top: .65rem; border-top: 1px solid rgba(255,255,255,.1); padding: .8rem .25rem 0 .75rem; }
.sidebar-user { display: grid; flex: 1; gap: .12rem; min-width: 0; font-size: .74rem; }
.sidebar-user span { color: #82978a; }
.mobile-header { display: none; }
.mobile-header-actions { display: flex; align-items: center; gap: .55rem; }
.news-widget { position: relative; }
.news-trigger { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(255,255,255,.06); color: #dce8df; }
.news-trigger:hover, .news-trigger[aria-expanded="true"] { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; }
.news-trigger:focus-visible, .news-close:focus-visible { outline: 3px solid rgba(199,157,83,.32); outline-offset: 2px; }
.news-trigger svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.news-count { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; border: 2px solid var(--forest-dark); border-radius: 99px; background: #b33f35; padding: 0 3px; color: #fff; font-size: .61rem; font-weight: 800; line-height: 14px; text-align: center; }
.news-panel { position: absolute; bottom: 0; left: calc(100% + 12px); z-index: 60; width: min(390px, calc(100vw - 2rem)); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--panel); box-shadow: 0 18px 45px rgba(18,35,27,.24); color: var(--ink); overflow: hidden; }
.news-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 1rem 1rem .8rem; }
.news-panel-heading .eyebrow { margin-bottom: .25rem; font-size: .59rem; }
.news-panel-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 500; }
.news-close { border: 0; background: transparent; padding: 0 .2rem; color: var(--muted); font-family: Georgia, serif; font-size: 1.5rem; line-height: 1; }
.news-panel-list { max-height: min(55vh, 420px); overflow-y: auto; }
.news-panel-state { margin: 0; padding: 1.5rem 1rem; color: var(--muted); font-family: Georgia, serif; font-size: .9rem; text-align: center; }
.news-panel-item { position: relative; display: grid; gap: .28rem; border-bottom: 1px solid var(--line); padding: .85rem 1rem .9rem; }
.news-panel-item.is-unread { background: #fbf6e9; box-shadow: inset 3px 0 0 var(--gold); }
.news-panel-item h3 { margin: 0; padding-right: .5rem; font-family: Georgia, serif; font-size: .98rem; font-weight: 600; }
.news-panel-item p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.news-item-meta { display: flex; align-items: center; gap: .5rem; margin-top: .15rem; }
.news-item-meta time { color: var(--muted); font-size: .65rem; }
.news-category { display: inline-flex; border-radius: 99px; background: #eee7d8; padding: .18rem .45rem; color: #765724; font-size: .58rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.news-category.category-fix, .news-category.category-maintenance { background: #e6eeea; color: #32604d; }
.news-category.category-announcement { background: #efe5cf; color: #805d22; }
.news-view-all { display: flex; justify-content: space-between; padding: .82rem 1rem; background: var(--panel-muted); color: var(--forest); font-size: .76rem; font-weight: 800; }
.news-view-all:hover { background: #eee8dc; }
.news-feed { display: grid; gap: 1rem; max-width: 900px; }
.news-article { position: relative; padding: 1.7rem; overflow: hidden; }
.news-article.was-unread::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--gold); content: ""; }
.news-article-meta { display: flex; align-items: center; gap: .7rem; margin-bottom: .85rem; }
.news-article-meta time { color: var(--muted); font-size: .72rem; }
.news-article h2 { margin-bottom: .5rem; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.news-summary { margin-bottom: .75rem; color: var(--muted); font-size: .92rem; font-weight: 600; }
.news-body { border-top: 1px solid var(--line); padding-top: .9rem; font-family: Georgia, serif; line-height: 1.7; }
.news-pagination { display: flex; align-items: center; gap: .8rem; max-width: 900px; margin-top: 1.3rem; }
.news-pagination span { color: var(--muted); font-size: .75rem; }
.news-pagination a:last-child { margin-left: auto; }
.admin-news-list { display: grid; gap: .8rem; max-width: 1000px; }
.admin-news-card { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.2rem 1.35rem; }
.admin-news-copy { min-width: 0; }
.admin-news-copy h2 { margin: 0 0 .35rem; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 500; }
.admin-news-copy p { margin: 0; color: var(--muted); font-size: .8rem; }
.admin-news-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .7rem; }
.admin-news-actions form { margin: 0; }
.admin-news-form { max-width: 900px; }
.main-content { margin-left: 272px; max-width: 1500px; min-height: 100vh; padding: 3.5rem clamp(1.25rem, 4vw, 4.5rem) 5rem; }
.readonly-banner { margin: -1.2rem 0 2rem; border: 1px solid #d9cba8; border-radius: 7px; background: #fbf6e9; padding: .72rem 1rem; color: #715b2d; font-size: .8rem; }
.readonly a[href*="/new"] { display: none !important; }
.readonly form[method="post"]:not(.campaign-switcher) button, .readonly .danger-zone, .readonly .form-actions { display: none !important; }
.readonly form[method="post"]:not(.campaign-switcher) input:disabled, .readonly form[method="post"]:not(.campaign-switcher) textarea:disabled, .readonly form[method="post"]:not(.campaign-switcher) select:disabled { background: #f7f6f1; color: var(--ink); opacity: 1; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.page-heading > div:first-child { max-width: 780px; }
.eyebrow { margin-bottom: .58rem; color: var(--gold); font-size: .72rem; font-weight: 800; letter-spacing: .145em; text-transform: uppercase; }
.lede { max-width: 720px; margin: .7rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.button, .text-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); font-weight: 750; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease; }
.button { min-height: 42px; padding: .68rem 1.05rem; font-size: .82rem; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button.primary { background: var(--button-primary); color: var(--button-primary-text); box-shadow: 0 1px 2px rgba(20,42,32,.14); }
.button.primary:hover { background: var(--button-primary-hover); color: var(--button-primary-text); box-shadow: 0 4px 12px rgba(20,42,32,.16); }
.button.secondary { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); }
.button.secondary:hover { border-color: var(--forest); background: var(--panel-muted); color: var(--forest-dark); }
.button-group { display: flex; align-items: center; gap: .65rem; }
.button-group.center { justify-content: center; }
.text-button { padding: .35rem .25rem; background: transparent; color: var(--forest); font-size: .8rem; }
.danger { color: var(--red); }
.danger-button { background: var(--red); color: #fff; }
.large-button { align-self: flex-start; margin-top: .5rem; padding-inline: 1.4rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 1.45rem; box-shadow: var(--shadow); }
.panel > h2, .panel > .section-heading h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; font-weight: 500; color: var(--ink); }
.section-heading, .card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin-bottom: 1rem; }
.section-heading a, .section-heading span { font-size: .78rem; }
.muted { color: var(--muted); }
.preline { white-space: pre-line; }
.flash-stack { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 50; display: grid; gap: .5rem; }
.flash { max-width: 430px; border: 1px solid #b8cbbb; border-radius: 7px; background: #f1faf2; padding: .78rem 1rem; box-shadow: var(--shadow); color: #24502e; font-size: .85rem; }
.flash.error { border-color: #ddbbb5; background: #fff4f1; color: #8e342b; }
.flash.info { border-color: #c5cfdb; background: #f2f7fc; color: #34506c; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.stat-strip.six { grid-template-columns: repeat(6, 1fr); }
.stat-strip div { display: flex; flex-direction: column; gap: .15rem; padding: 1.1rem 1.25rem; border-right: 1px solid var(--line); }
.stat-strip div:last-child { border: 0; }
.stat-strip strong { font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; }
.stat-strip span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.dashboard-grid, .detail-grid, .settings-grid, .form-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.span-two { grid-column: span 2; }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 220px); align-items: center; gap: 1rem; margin: 0 -.3rem; padding: .72rem .3rem; border-top: 1px solid #ecebe5; color: var(--ink); }
.project-row:first-of-type { border-top: 0; }
.project-row > div:first-child { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.project-row span { color: var(--muted); font-size: .76rem; }
.progress-compact { display: grid; gap: .3rem; text-align: right; }
.progress { height: 4px; border-radius: 4px; background: #e7e8e2; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); }
.compact-card { border-top: 1px solid #ecebe5; padding: .75rem 0 .1rem; }
.compact-card:first-of-type { border-top: 0; }
.compact-card strong { margin-right: .5rem; }
.compact-card p { margin: .35rem 0 .6rem; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.badge { display: inline-block; border-radius: 99px; background: var(--panel-muted); padding: .22rem .52rem; color: var(--muted); font-size: .65rem; font-style: normal; font-weight: 700; text-transform: capitalize; }
.badge.strong, .badge.catastrophic, .badge.status-failed { background: #f7e6df; color: #8a3d32; }
.badge.medium, .badge.status-paused { background: #f7eedc; color: #785522; }
.badge.status-completed { background: #e1efe5; color: #27613b; }
.timeline { display: grid; }
.timeline article { display: grid; grid-template-columns: 120px 1fr; gap: 1.15rem; border-top: 1px solid #ebeae4; padding: 1rem 0; }
.timeline article:first-child { border-top: 0; padding-top: .3rem; }
.timeline article > span { color: var(--gold); font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.timeline strong { font-size: .9rem; }
.timeline p { margin: .28rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.timeline small { color: #898f87; }
.timeline.mini article { grid-template-columns: 46px 1fr; padding: .72rem 0; }
.empty-state { width: 100%; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: color-mix(in srgb, var(--panel) 58%, transparent); padding: 1.8rem; text-align: center; }
.empty-state.large { margin-bottom: 1.5rem; padding: 2.75rem 2rem; }
.empty-state h2 { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.empty-state p { max-width: 560px; margin: 0 auto 1.3rem; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.entity-card { display: flex; flex-direction: column; min-height: 230px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 1.3rem; box-shadow: var(--shadow); color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s; }
.entity-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-hover); color: var(--ink); }
.entity-card h2 { margin: 1.4rem 0 .4rem; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.entity-card > p { flex: 1; color: var(--muted); font-size: .82rem; }
.entity-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .4rem 0 .8rem; }
.entity-card dl div, .detail-list div { display: grid; gap: .15rem; }
dt { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; }
dd { margin: 0; font-size: .8rem; }
.type-label { color: var(--gold); font-size: .67rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; }
.status-dot { color: var(--muted); font-size: .7rem; }
.mini-stats { display: flex; flex-wrap: wrap; gap: .35rem; }
.mini-stats span { border: 1px solid #e0e0d8; border-radius: 4px; padding: .2rem .34rem; color: #5e655d; font-size: .62rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
.field-grid.single { grid-template-columns: 1fr; }
.field-grid .wide { grid-column: span 2; }
.form-section h2 { padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.stats-inputs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 .8rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; padding-top: .4rem; }
.danger-zone { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid #e0d1ce; text-align: right; }
.detail-grid .panel > p:last-child { margin-bottom: 0; }
.detail-list { display: grid; gap: .85rem; margin: 0; }
.detail-list.inline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-bar { display: flex; align-items: flex-end; gap: .7rem; margin-bottom: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-muted); padding: .85rem; }
.filter-bar.wrap { flex-wrap: wrap; }
.filter-bar label { min-width: 150px; margin: 0; }
.filter-bar input, .filter-bar select { padding-block: .58rem; }
.table-panel { overflow-x: auto; }
.data-table { min-width: 850px; }
.table-head, .table-row { display: grid; grid-template-columns: 2fr 1.2fr .7fr 1fr .8fr .35fr; gap: 1rem; align-items: center; padding: .75rem .35rem; }
.table-head { border-bottom: 1px solid var(--line); color: var(--muted); font-size: .67rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.table-row { border-bottom: 1px solid #ebeae4; font-size: .82rem; }
.table-row:last-child { border-bottom: 0; }
.table-row > div:first-child { display: flex; flex-direction: column; gap: .2rem; }
.table-row small { color: var(--muted); }
.action-budget { display: flex; gap: .55rem; margin: -1rem 0 1.2rem; padding-bottom: .25rem; overflow-x: auto; }
.budget-chip { min-width: 165px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); padding: .65rem .75rem; text-align: left; }
.budget-chip strong, .budget-chip span { display: block; }
.budget-chip strong { font-size: .78rem; }
.budget-chip span { margin-top: .2rem; color: var(--muted); font-size: .68rem; }
.turn-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.step-number { float: right; color: #c6c8bf; font-family: Georgia, serif; font-size: 1.2rem; }
.hidden { display: none !important; }
.modifier-guide { margin: .5rem 0; color: var(--muted); font-size: .75rem; }
.modifier-guide p { margin: .5rem 0; }
.turn-result-fields { display: flex; flex-direction: column; }
.turn-history { margin-top: 1rem; }
.event-generator { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; margin-bottom: 1rem; padding: 1.7rem; }
.check-label { display: flex; flex-direction: row; align-items: center; font-weight: 500; }
.check-label input { width: auto; }
.publication-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,1fr); align-items: center; gap: 1.5rem; border-left: 4px solid var(--gold); }
.publication-panel h2, .publication-panel p { margin-bottom: .35rem; }
.share-toggle { display: flex; flex-direction: row; align-items: flex-start; gap: .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 1rem; cursor: pointer; }
.share-toggle input { width: auto; margin-top: .25rem; }
.share-toggle span { display: grid; gap: .22rem; }
.share-toggle small { color: var(--muted); font-weight: 400; line-height: 1.45; }
.creature-share { align-items: center; gap: .55rem; margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; color: var(--ink) !important; font-size: .78rem !important; }
.creature-share small { margin-left: .25rem; font-weight: 400; }
.community-heading { margin-bottom: 1.1rem; }
.category-tabs { display: flex; gap: .45rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: .25rem; }
.category-tabs a { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); padding: .48rem .78rem; color: var(--muted); font-size: .76rem; font-weight: 700; }
.category-tabs a:hover, .category-tabs a.active { border-color: var(--button-primary); background: var(--button-primary); color: var(--button-primary-text); }
.community-search { margin-bottom: 1.25rem; }
.community-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.community-card { display: flex; flex-direction: column; min-height: 220px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 1.3rem; box-shadow: var(--shadow); color: var(--ink); transition: transform .15s,border-color .15s,box-shadow .15s; }
.community-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.community-card .card-top { color: var(--muted); font-size: .7rem; }
.community-card h2 { margin: 1rem 0 .45rem; font-family: Georgia,serif; font-size: 1.38rem; font-weight: 500; }
.community-card p { color: var(--muted); line-height: 1.55; }
.community-card footer { display: flex; justify-content: space-between; gap: .75rem; margin-top: auto; border-top: 1px solid var(--line); padding-top: .9rem; color: var(--muted); font-size: .73rem; }
.community-card footer strong { color: var(--forest); }
.community-card-image { width: calc(100% + 2.6rem); height: 170px; margin: -1.3rem -1.3rem .9rem; border-radius: 9px 9px 0 0; object-fit: cover; }
.community-card-image.symbol { object-fit: contain; padding: 1rem; background: var(--panel-muted); }
.map-community-card > img { width: calc(100% + 2.4rem); height: 170px; margin: -1.2rem -1.2rem .9rem; border-radius: 9px 9px 0 0; object-fit: cover; }
.community-empty { grid-column: 1/-1; }
.community-detail-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.65fr); align-items: start; gap: 1.25rem; }
.community-preview h2, .import-panel h2 { font-family: Georgia,serif; font-size: 1.45rem; font-weight: 500; }
.community-image { display: block; width: min(100%,420px); max-height: 520px; margin: 0 auto 1.4rem; border-radius: 9px; object-fit: contain; }
.community-image.symbol { width: min(100%,220px); }
.community-field-list { display: grid; gap: 0; }
.community-field-list div { display: grid; grid-template-columns: minmax(110px,.28fr) 1fr; gap: 1rem; border-top: 1px solid var(--line); padding: .85rem 0; }
.community-field-list dt { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.community-field-list dd { margin: 0; overflow-wrap: anywhere; }
.library-note { border-radius: 7px; background: var(--paper); padding: .9rem; color: var(--muted); }
.import-panel { position: sticky; top: 1.5rem; border-top: 4px solid var(--gold); }
.import-panel form { display: grid; gap: .75rem; }
.wide-button { width: 100%; }
.library-meta { display: grid; gap: .25rem; margin: 1.25rem 0; border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); font-size: .7rem; }
.community-nav-label { margin-top: 1.35rem; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; }
.event-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.event-card.resolved, .event-card.expired { opacity: .68; }
.event-card h2 { margin: 1rem 0 .5rem; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.event-card > p { color: var(--muted); font-size: .82rem; }
.mechanical-note { border-left: 3px solid var(--gold); background: #f6f1e7; padding: .65rem .8rem; color: #5e513a !important; }
.settings-grid { align-items: start; }
.danger-panel { border-color: #dfc9c4; }
.grow { flex: 1; }
.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.note-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.note-card { min-height: 205px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 1.25rem; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; }
.note-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-hover); color: var(--ink); }
.note-card.pinned { border-top: 3px solid var(--gold); }
.note-card > div { display: flex; justify-content: space-between; gap: .7rem; color: var(--muted); font-size: .68rem; }
.note-card h2, .note-card h3 { margin: 1.3rem 0 .55rem; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.note-card h3 { font-size: 1.08rem; }
.note-card p { color: var(--muted); font-size: .82rem; }
.note-card small { color: #8b9088; }
.note-grid.compact .note-card { min-height: 170px; box-shadow: none; }
.quest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.quest-card { display: flex; min-height: 265px; flex-direction: column; color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s; }
.quest-card:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-hover); }
.quest-card h2 { margin: 1rem 0 .55rem; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.quest-card > p { color: var(--muted); font-size: .82rem; }
.quest-card dl { display: grid; gap: .45rem; margin: auto 0 0; border-top: 1px solid var(--line); padding-top: .8rem; }
.quest-card dl div { display: grid; grid-template-columns: 82px 1fr; gap: .65rem; }
.quest-card dt { color: var(--muted); font-size: .65rem; font-weight: 750; text-transform: uppercase; }
.quest-card dd { margin: 0; font-size: .75rem; }
.note-editor { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, .8fr); gap: 1rem; align-items: start; }
.note-editor aside { position: sticky; top: 1rem; }
.notepad { min-height: 430px; padding: 1rem; line-height: 1.7; }
.quick-links { display: grid; }
.quick-links a, .list-link { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #ebeae4; padding: .72rem 0; font-size: .85rem; }
.quick-links a:first-child, .list-link:first-of-type { border-top: 0; }
.quick-links span, .list-link span { color: var(--muted); font-size: .75rem; }
.city-card dl { grid-template-columns: 1fr 1fr; }
.character-title { flex: 0 !important; margin: -.2rem 0 .75rem; color: var(--gold) !important; font-family: Georgia, serif; font-style: italic; }
.item-editor .form-section > h2 { margin: 0 0 1rem; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.item-editor .section-help { margin: -.55rem 0 1rem; color: var(--muted); font-size: .78rem; }
.item-editor [hidden] { display: none !important; }
.item-editor select[multiple] { min-height: 9rem; padding: .35rem; }
.selector-search { margin-bottom: .4rem; }
.item-filter-bar { flex-wrap: wrap; }
.item-filter-bar .grow { min-width: 260px; }
.item-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .8rem; }
.item-tags span { border: 1px solid var(--line); border-radius: 99px; background: var(--panel-muted); padding: .22rem .5rem; color: var(--muted); font-size: .62rem; }
.landing-content { min-height: 100vh; overflow: hidden; background: var(--paper); }
.landing-shell { --landing-max: 1180px; }
.landing-header { display: flex; align-items: center; justify-content: space-between; width: min(calc(100% - 3rem), var(--landing-max)); margin: 0 auto; padding: 1.35rem 0; border-bottom: 1px solid var(--line); }
.landing-brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--forest-dark); font-family: Georgia, serif; font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; }
.landing-brand:hover { color: var(--forest); }
.landing-brand img { width: 2.65rem; height: 2.65rem; border: 1px solid var(--gold); background: #fff; }
.landing-nav { display: flex; align-items: center; gap: 1.25rem; }
.landing-username { color: var(--muted); font-size: .84rem; font-weight: 700; }
.landing-signin { color: var(--ink); font-size: .84rem; font-weight: 700; }
.landing-signin:hover { color: var(--forest); }
.landing-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); align-items: center; gap: clamp(3rem, 8vw, 7rem); width: min(calc(100% - 3rem), var(--landing-max)); min-height: 660px; margin: 0 auto; padding: 5.5rem 0 6.5rem; }
.landing-hero::before { content: ''; position: absolute; top: 13%; left: -24%; width: 480px; height: 480px; border: 1px solid rgba(181,135,59,.13); border-radius: 50%; box-shadow: 0 0 0 70px rgba(181,135,59,.035), 0 0 0 140px rgba(181,135,59,.025); pointer-events: none; }
.landing-hero-copy { position: relative; z-index: 1; }
.landing-hero h1 { max-width: 720px; margin-bottom: 1.4rem; color: var(--forest-dark); font-size: clamp(3rem, 6.5vw, 5.5rem); line-height: .98; letter-spacing: -.055em; }
.landing-lede { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.7; }
.landing-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.landing-button { min-width: 136px; min-height: 48px; padding-inline: 1.35rem; }
.world-preview { position: relative; z-index: 1; border: 1px solid #cfd2c8; border-radius: 3px; background: var(--panel); padding: 1.5rem; box-shadow: 0 28px 70px rgba(27,49,38,.13); transform: rotate(1.25deg); }
.world-preview::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(181,135,59,.18); pointer-events: none; }
.preview-heading { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .35rem 1.25rem; border-bottom: 1px solid var(--line); }
.preview-heading > div { display: grid; gap: .25rem; }
.preview-kicker { color: var(--gold); font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.preview-heading strong { color: var(--forest-dark); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.preview-week { align-self: center; border: 1px solid var(--line); border-radius: 99px; padding: .35rem .65rem; color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.preview-date { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem .35rem; color: var(--muted); font-size: .68rem; }
.preview-date strong { color: var(--ink); font-weight: 650; }
.preview-timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0 .35rem; list-style: none; }
.preview-timeline::before { content: ''; position: absolute; top: 1.35rem; bottom: 1.35rem; left: .68rem; width: 1px; background: var(--line); }
.preview-timeline li { position: relative; display: grid; grid-template-columns: 1rem 1fr; gap: .85rem; padding: .85rem 0; }
.timeline-mark { z-index: 1; width: .68rem; height: .68rem; margin-top: .28rem; border: 2px solid var(--panel); border-radius: 50%; box-shadow: 0 0 0 1px currentColor; }
.timeline-mark.gold { color: var(--gold); background: var(--gold); }
.timeline-mark.green { color: var(--forest); background: var(--forest); }
.timeline-mark.red { color: var(--red); background: var(--red); }
.preview-timeline div { display: grid; gap: .22rem; }
.preview-timeline small { color: var(--muted); font-size: .58rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.preview-timeline strong { color: var(--ink); font-family: Georgia, serif; font-size: .9rem; font-weight: 500; }
.preview-timeline i { height: 3px; margin-top: .35rem; background: #e8e8e1; }
.preview-timeline i span { display: block; height: 100%; background: var(--gold); }
.preview-footer { display: flex; justify-content: space-between; gap: .7rem; margin: .65rem .35rem 0; border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); font-size: .59rem; }
.landing-features { position: relative; padding: 7rem max(1.5rem, calc((100vw - var(--landing-max)) / 2)); background: var(--forest-dark); color: #f6f3e9; }
.landing-features::after { content: 'SAGAQUILL'; position: absolute; top: 2rem; right: -1rem; color: rgba(255,255,255,.025); font-family: Georgia, serif; font-size: clamp(5rem, 14vw, 12rem); line-height: 1; pointer-events: none; }
.landing-section-heading { position: relative; z-index: 1; max-width: 700px; margin-bottom: 3rem; }
.landing-section-heading h2, .landing-final-cta h2 { margin: 0 0 1rem; font-family: Georgia, serif; font-size: clamp(2.1rem, 4vw, 3.5rem); font-weight: 500; line-height: 1.08; letter-spacing: -.035em; }
.landing-section-heading > p:last-child { max-width: 590px; margin: 0; color: #acbbb1; }
.feature-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.13); }
.feature-card { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 1.25rem; min-height: 340px; background: var(--forest-dark); padding: clamp(1.5rem, 4vw, 2.8rem); }
.feature-card-wide { grid-column: 1 / -1; min-height: 300px; padding-right: clamp(2rem, 15vw, 11rem); }
.feature-number { color: #6e8878; font-size: .67rem; font-weight: 750; letter-spacing: .1em; }
.feature-label { margin: 0 0 2.3rem; color: #d1a75e; font-size: .68rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.feature-card h3 { max-width: 540px; margin: 0 0 1rem; color: #fffdf5; font-family: Georgia, serif; font-size: clamp(1.5rem, 2.3vw, 2rem); font-weight: 500; line-height: 1.2; }
.feature-card div > p:last-of-type { max-width: 650px; margin: 0; color: #acbbb1; font-size: .9rem; }
.feature-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.7rem 0 0; padding: 0; list-style: none; }
.feature-tags li { border: 1px solid rgba(255,255,255,.15); border-radius: 99px; padding: .42rem .7rem; color: #cbd5ce; font-size: .64rem; }
.feature-card-creations { grid-template-columns: 52px minmax(0, 1fr) minmax(250px, .7fr); align-items: center; gap: 1.25rem; padding-right: clamp(1.5rem, 4vw, 2.8rem); }
.creation-stack { display: grid; gap: .55rem; margin-left: 1.5rem; transform: rotate(-1deg); }
.creation-stack span { display: grid; gap: .3rem; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.045); padding: .85rem 1rem; color: #eef2ed; font-family: Georgia, serif; font-size: .9rem; }
.creation-stack span:nth-child(2) { margin-left: 1rem; }
.creation-stack b { color: #82998b; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: .54rem; letter-spacing: .12em; }
.landing-final-cta { display: grid; justify-items: center; padding: 7.5rem 1.5rem; text-align: center; }
.landing-final-cta h2 { color: var(--forest-dark); }
.landing-final-cta > p:not(.eyebrow) { max-width: 590px; margin: 0; color: var(--muted); }
.landing-final-cta .landing-actions { justify-content: center; }
.landing-final-cta .landing-signin { margin-left: .5rem; }
.landing-footer { display: flex; align-items: center; justify-content: space-between; gap: 2rem; width: min(calc(100% - 3rem), var(--landing-max)); margin: 0 auto; border-top: 1px solid var(--line); padding: 1.6rem 0 2rem; }
.landing-footer p { margin: 0; color: var(--muted); font-family: Georgia, serif; font-size: .8rem; font-style: italic; }
.auth-content { display: grid; place-items: center; min-height: 100vh; padding: 2rem 1rem; background: radial-gradient(circle at 20% 10%, #365c4b 0, #17362a 38%, #10271e 100%); }
.auth-card { width: min(100%, 440px); border: 1px solid rgba(255,255,255,.45); border-radius: 16px; background: var(--panel); padding: 2.4rem; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.wide-auth-card { width: min(100%, 620px); }
.auth-brand { margin-bottom: 2.2rem; color: var(--forest); font-family: Georgia, serif; font-size: 1.25rem; }
.auth-card h1 { font-size: 2.45rem; }
.auth-form { margin-top: 1.8rem; }
.full-button { width: 100%; }
.google-signin-wrap { display: flex; justify-content: center; min-height: 44px; overflow: hidden; }
.auth-divider { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0; color: var(--muted); font-size: .72rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-foot { margin: 1.4rem 0 0; text-align: center; color: var(--muted); font-size: .83rem; }
.forgot-link { margin: -.5rem 0 .9rem; text-align: right; font-size: .78rem; }
.campaign-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.campaign-card { display: flex; flex-direction: column; min-height: 250px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 1.4rem; box-shadow: var(--shadow); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.campaign-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.campaign-card.current { border-top: 3px solid var(--gold); }
.campaign-card h2 { margin: 1.4rem 0 .5rem; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.campaign-card > p { flex: 1; color: var(--muted); font-size: .84rem; }
.campaign-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: 1.2rem; }
.campaign-upgrade-note { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.campaign-upgrade-note p { margin: .25rem 0 0; color: var(--muted); }
.campaign-calendar-heading { margin-top: 2rem; }
.campaign-date-fields.campaign-settings-date { grid-template-columns: repeat(5, minmax(100px, 1fr)); }
.campaign-form { width: min(100%, 720px); margin-bottom: 1rem; }
.inline-form { display: flex; align-items: end; gap: .8rem; }
.inline-form label { margin: 0; }
.member-invite { margin-bottom: 1rem; }
.member-list { padding-top: .5rem; }
.member-row { display: grid; grid-template-columns: minmax(220px,2fr) minmax(220px,1fr) 100px; align-items: center; gap: 1rem; border-top: 1px solid #ebeae4; padding: .85rem .25rem; }
.member-row:first-child { border-top: 0; }
.member-row > div:first-child { display: grid; gap: .2rem; }
.member-row small, .user-row small { color: var(--muted); }
.role-form { display: flex; align-items: center; gap: .5rem; }
.role-form select { padding: .5rem; }
.check-stack { margin: .5rem 0 1.5rem; }
.user-row { display: grid; grid-template-columns: 1.5fr 1.8fr 1fr .7fr .35fr; align-items: center; gap: 1rem; border-bottom: 1px solid #ebeae4; padding: .8rem .35rem; font-size: .82rem; }
.user-row:last-child { border-bottom: 0; }
.user-row > div:first-child { display: grid; gap: .2rem; }
.user-row > span { display: grid; gap: .18rem; }
.email-row { display: grid; grid-template-columns: 125px minmax(260px,2fr) minmax(140px,1fr) minmax(180px,1fr) 110px; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); padding: .85rem .35rem; font-size: .8rem; }
.email-row:last-child { border-bottom: 0; }
.email-row > span { display: grid; gap: .2rem; min-width: 0; }
.email-row small { color: var(--muted); overflow-wrap: anywhere; }
.email-actions { display: flex !important; align-items: center; justify-content: flex-end; gap: .5rem; }
.email-actions form { margin: 0; }
.email-template-card { display: flex; flex-direction: column; min-height: 250px; }
.email-template-card h2 { margin: 0 0 .7rem; }
.email-template-card p:not(.eyebrow) { flex: 1; color: var(--muted); }
.email-template-card small { margin-bottom: 1rem; color: var(--muted); }
.email-template-editor { display: grid; grid-template-columns: minmax(240px,.65fr) minmax(0,2fr); align-items: start; gap: 1rem; }
.template-help { position: sticky; top: 1rem; }
.template-help p { color: var(--muted); font-size: .8rem; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0; }
.placeholder-list code { border: 1px solid var(--line); border-radius: 5px; background: var(--paper); padding: .35rem .5rem; color: var(--forest); }
.code-editor { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: .76rem; tab-size: 2; }
.template-actions { flex-wrap: wrap; }
.compact-auth-foot { margin-top: .5rem; }
.premium-profile-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,1fr); align-items: center; gap: 2rem; border-top: 4px solid var(--gold); }
.premium-profile-panel h2 { font-family: Georgia,serif; font-size: 1.65rem; }
.premium-profile-panel p { margin-bottom: 0; color: var(--muted); }
.premium-profile-actions { display: grid; gap: 1rem; }
.premium-profile-actions > .button { justify-self: start; }
.storage-panel { display: grid; grid-template-columns: 180px minmax(0,1fr); align-items: center; gap: 2rem; }
.storage-chart { display: grid; place-items: center; width: 160px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--button-primary) var(--storage-percent), var(--panel-muted) 0); }
.storage-chart::before { content: ''; grid-area: 1/1; width: 116px; aspect-ratio: 1; border-radius: 50%; background: var(--panel); }
.storage-chart span { z-index: 1; grid-area: 1/1; display: grid; justify-items: center; color: var(--muted); font-size: .7rem; }
.storage-chart strong { color: var(--ink); font-family: Georgia,serif; font-size: 1.55rem; font-weight: 500; }
.map-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.map-card { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(0,1fr); gap: 1.2rem; color: var(--ink); overflow: hidden; }
.map-card > img { width: calc(100% + 1.2rem); height: calc(100% + 2.4rem); min-height: 220px; margin: -1.2rem 0 -1.2rem -1.2rem; object-fit: cover; }
.map-card h2 { margin: .8rem 0 .4rem; font-family: Georgia,serif; font-size: 1.35rem; font-weight: 500; }
.map-card p, .map-card small { color: var(--muted); }
.map-detail-grid { display: grid; gap: 1rem; }
.map-view img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: var(--panel-muted); }
.map-upload-preview { width: 100%; max-height: 340px; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; background: var(--panel-muted); }
.location-preview { width: 100%; height: 230px; }
.entity-detail-artwork { display: block; width: min(100%,1050px); max-height: 520px; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); object-fit: cover; background: var(--panel-muted); }
.creature-detail-artwork { width: min(100%,780px); object-position: center 25%; }
.required-label, .optional-label { color: var(--muted); font-family: Inter,ui-sans-serif,sans-serif; font-size: .62rem; font-weight: 700; text-transform: uppercase; }
.redeem-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: .6rem; }
.redeem-form label { margin: 0; }
.premium-admin-panel { border-top: 4px solid var(--gold); }
.premium-admin-actions { display: grid; grid-template-columns: minmax(180px,1fr) auto auto; align-items: end; gap: .7rem; }
.premium-admin-actions label { margin: 0; }
.pricing-heading { justify-content: center; text-align: center; }
.pricing-heading > div:first-child { max-width: 820px; }
.pricing-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.2rem; width: min(100%,980px); margin: 0 auto; }
.pricing-card { display: flex; flex-direction: column; min-height: 510px; padding: clamp(1.4rem,3vw,2.4rem); }
.pricing-card h2 { font-family: Georgia,serif; font-size: 1.75rem; }
.premium-pricing-card { border-top: 6px solid var(--gold); }
.price { display: flex; align-items: baseline; gap: .65rem; margin: 1rem 0 1.6rem; }
.price strong { font-family: Georgia,serif; font-size: 3.6rem; font-weight: 500; }
.price span { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.pricing-card ul { display: grid; gap: .9rem; flex: 1; margin: 0 0 2rem; padding-left: 1.2rem; color: var(--muted); }
.current-plan { align-self: flex-start; border-radius: 99px; background: #e8ece8; padding: .45rem .75rem; color: #4d5d52; font-size: .72rem; font-weight: 700; }
.premium-current { background: #f4ead4; color: #74521e; }
.pricing-card form { margin-top: .7rem; }
.code-row { display: grid; grid-template-columns: minmax(210px,1.5fr) 110px 100px 150px 90px 60px; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); padding: .85rem .35rem; font-size: .8rem; }
.code-row:last-child { border-bottom: 0; }
.code-row > span { display: grid; gap: .2rem; }
.code-row small, .redemption-row small { color: var(--muted); }
.redemption-row { display: grid; grid-template-columns: minmax(220px,1fr) 180px minmax(180px,1fr); gap: 1rem; border-top: 1px solid var(--line); padding: .85rem .2rem; font-size: .8rem; }
.redemption-row:first-child { border-top: 0; }
.redemption-row > span:first-child { display: grid; gap: .2rem; }
.profile-grid { max-width: 1050px; }
.profile-details { grid-template-columns: repeat(2,minmax(0,1fr)); }
.profile-note { margin: 1.2rem 0 0; font-size: .78rem; }
.profile-password-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 1rem; }
.profile-password-form label { margin: 0; }
.theme-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; margin: 1rem 0 1.2rem; }
.theme-option { position: relative; display: grid; gap: .45rem; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: .65rem; cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 2px color-mix(in srgb,var(--forest) 22%,transparent); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option strong { color: var(--ink); font-size: .72rem; }
.theme-swatch { display: grid; grid-template-columns: 26% 1fr; grid-template-rows: 1fr 1fr; height: 50px; border: 1px solid rgba(0,0,0,.12); border-radius: 5px; overflow: hidden; }
.theme-swatch i:first-child { grid-row: 1 / 3; background: #173b2e; }
.theme-swatch i:nth-child(2) { background: #f3efe5; }
.theme-swatch i:nth-child(3) { background: #fffdf7; }
.theme-option-dark .theme-swatch i:first-child { background: #090f0c; }
.theme-option-dark .theme-swatch i:nth-child(2) { background: #0e1411; }
.theme-option-dark .theme-swatch i:nth-child(3) { background: #18201b; }
.theme-option-dungeons-dragons .theme-swatch i:first-child { background: #3d1a17; }
.theme-option-dungeons-dragons .theme-swatch i:nth-child(2) { background: #e9dfca; }
.theme-option-dungeons-dragons .theme-swatch i:nth-child(3) { background: #faf3e2; border-top: 3px solid #812d28; }

/* User themes. The default values above remain the original SagaQuill look. */
body[data-theme="dark"] {
  --ink: #edf0e9;
  --muted: #a3aea6;
  --paper: #0e1411;
  --panel: #18201b;
  --panel-muted: #121a16;
  --line: #334039;
  --line-strong: #4a5a51;
  --forest: #8fc4a5;
  --forest-dark: #b7dbc4;
  --gold: #c9a663;
  --red: #d37769;
  --sidebar-panel: #151e19;
  --sidebar-muted: #82958a;
  --button-primary: #75ad8b;
  --button-primary-hover: #91c5a5;
  --button-primary-text: #0b1710;
  --focus-ring: rgba(143,196,165,.2);
  --shadow: 0 8px 24px rgba(0,0,0,.22);
  --shadow-hover: 0 14px 34px rgba(0,0,0,.32);
  color-scheme: dark;
}
body[data-theme="dark"] .sidebar, body[data-theme="dark"] .mobile-header { background: #090f0c; }
body[data-theme="dark"] :is(input,textarea,select,.button.secondary) { border-color: var(--line); background: var(--panel-muted); color: var(--ink); }
body[data-theme="dark"] :is(label,.goal-stack p,.entity-card > p,.event-card > p,.character-card p) { color: var(--muted); }
body[data-theme="dark"] :is(.filter-bar,.budget-chip,.calendar-day,.upload-preview,.upload-placeholder) { border-color: var(--line); background: var(--panel); }
body[data-theme="dark"] :is(.project-row,.compact-card,.timeline article,.quick-links a,.list-link,.member-row,.user-row,.report-action) { border-color: var(--line); }
body[data-theme="dark"] :is(.badge,.action-count) { background: #2b332d; color: #c5cec7; }
body[data-theme="dark"] .flash { border-color: #3d6149; background: #18281e; color: #bce0c5; }
body[data-theme="dark"] .flash.error { border-color: #70433d; background: #2b1b19; color: #e7b2aa; }
body[data-theme="dark"] .flash.info { border-color: #3d5264; background: #17232d; color: #b8ccdd; }
body[data-theme="dark"] :is(.current-plan,.premium-current) { background: #2d3027; color: #ddc891; }
body[data-theme="dark"] .mechanical-note { background: #302a1d; color: #e2cfaa !important; }
body[data-theme="dark"] .readonly-banner { border-color: #5d5135; background: #262318; color: #dbc792; }
body[data-theme="dark"] .calendar-day.outside { background: #141814; }
body[data-theme="dark"] .calendar-day.current-day { background: #18251c; }
body[data-theme="dark"] .calendar-event { background: #30291d; }
body[data-theme="dark"] .calendar-event.type-note { background: #1c2b21; }
body[data-theme="dark"] .week-state { border-color: #3a5943; background: #1b2b20; color: #aed2b7; }
body[data-theme="dark"] .week-state p { color: #8fa698; }
body[data-theme="dark"] .week-state.finished { border-color: #5d5135; background: #2a261b; color: #dec68e; }
body[data-theme="dark"] .report-action.gain { background: linear-gradient(90deg,#17271b,transparent 35%); }
body[data-theme="dark"] .report-action.loss { background: linear-gradient(90deg,#2b1b19,transparent 35%); }

body[data-theme="dungeons-dragons"] {
  --ink: #30271f;
  --muted: #756655;
  --paper: #e9dfca;
  --panel: #faf3e2;
  --panel-muted: #f1e5cc;
  --line: #cdbd9e;
  --line-strong: #b69e78;
  --forest: #762c27;
  --forest-dark: #541d1a;
  --gold: #9c712d;
  --red: #812d28;
  --sidebar-panel: #4a211d;
  --sidebar-muted: #c3a784;
  --button-primary: #762c27;
  --button-primary-hover: #541d1a;
  --button-primary-text: #fffaf0;
  --focus-ring: rgba(118,44,39,.17);
  --shadow: 0 6px 20px rgba(71,48,21,.09);
  --shadow-hover: 0 12px 28px rgba(71,48,21,.14);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(105,76,35,.055) .65px,transparent .65px), linear-gradient(120deg,rgba(255,255,255,.2),transparent 48%);
  background-size: 8px 8px,100% 100%;
}
body[data-theme="dungeons-dragons"] .sidebar, body[data-theme="dungeons-dragons"] .mobile-header { background: linear-gradient(165deg,#3d1a17,#21110f); }
body[data-theme="dungeons-dragons"] .sidebar nav a { color: #e5d8c0; }
body[data-theme="dungeons-dragons"] :is(.panel,.entity-card,.note-card,.campaign-card,.creature-card,.community-card,.faction-sim-card,.report-list-card,.filter-bar) { border-color: var(--line); background: linear-gradient(135deg,rgba(255,255,255,.22),transparent 48%),var(--panel); }
body[data-theme="dungeons-dragons"] :is(h1,.panel h2,.entity-card h2,.note-card h2,.note-card h3,.campaign-card h2,.event-card h2) { color: #6f2723; }
body[data-theme="dungeons-dragons"] :is(input,textarea,select,.button.secondary) { border-color: var(--line-strong); background: #fffaf0; color: var(--ink); }
body[data-theme="dungeons-dragons"] .campaign-switcher select { border-color: rgba(255,255,255,.16); background: var(--sidebar-panel); color: #fffaf0; }
body[data-theme="dungeons-dragons"] .stat-strip { border-top: 3px solid var(--red); }
body[data-theme="dungeons-dragons"] .eyebrow { color: #8a2e27; }
body[data-theme="dungeons-dragons"] .flash { border-color: #ad986f; background: #f5ead1; color: #593f20; }
body[data-theme="dungeons-dragons"] .flash.error { border-color: #b9796f; background: #f2ded3; color: #762c27; }
body[data-theme="dungeons-dragons"] .progress i { background: var(--red); }
body[data-theme="dungeons-dragons"] .calendar-day { background: rgba(255,250,240,.78); }
body[data-theme="dungeons-dragons"] .calendar-day.outside { background: rgba(221,207,175,.72); }
body[data-theme="dungeons-dragons"] .calendar-event { border-left-color: var(--red); background: #eee0bd; }
body[data-theme="dungeons-dragons"] .week-state { border-radius: 2px; border-color: #baa16c; background: #f2e6c8; color: #6f2b24; }
body[data-theme="dungeons-dragons"] .week-state.finished { background: #ead9b2; }
.creature-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.creature-card { display: flex; flex-direction: column; min-height: 210px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 1.3rem; box-shadow: var(--shadow); color: var(--ink); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.creature-card.with-artwork, .entity-card.with-artwork { overflow: hidden; }
.entity-card-artwork { width: calc(100% + 2.6rem); height: 175px; margin: -1.3rem -1.3rem 1rem; object-fit: cover; }
.creature-card.with-artwork h2 { margin-top: 1rem; }
.creature-card:hover { border-color: var(--gold); box-shadow: var(--shadow-hover); color: var(--ink); transform: translateY(-2px); }
.creature-card-top { display: flex; justify-content: space-between; color: var(--gold); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.creature-card h2 { margin: 2rem 0 .4rem; color: var(--forest); font-family: Georgia,serif; font-size: 1.65rem; font-weight: 500; }
.creature-card p { flex: 1; color: var(--muted); font-size: .8rem; }
.view-mark { color: var(--gold); font-size: .76rem; }
.creature-workbench { margin: -1.5rem -1rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: clamp(1rem,3vw,2rem); color: var(--ink); box-shadow: var(--shadow); }
.creature-editor-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.creature-editor-header h1 { color: var(--ink); }
.creature-editor-header p:not(.eyebrow) { max-width: 660px; margin: .6rem 0 0; color: var(--muted); }
.creature-header-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; }
.button.ghost-dark { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.button.ghost-dark:hover { border-color: var(--gold); color: var(--ink); }
.button.amber { background: var(--gold); color: #17140f; }
.creature-tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.creature-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: .75rem 1rem; color: var(--muted); font-size: .8rem; font-weight: 700; }
.creature-tabs button.active { border-color: var(--gold); color: var(--forest); }
.creature-tab-panel { display: none; }
.creature-tab-panel.active { display: block; }
.dark-hint { margin: .35rem 0 0; color: var(--muted); font-size: .78rem; }
.loot-entry { display: flex; align-items: end; gap: .65rem; margin-top: .75rem; }
.loot-entry label { min-width: 130px; }
.loot-entry .grow { flex: 1; }
.loot-roller { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.loot-roller > div:first-child { flex: 1; }
.loot-roller > label { margin: 0; }
.loot-roller .loot-results { flex-basis: 100%; }
.loot-results:empty { display: none; }
.loot-results { margin-top: 1rem; border-left: 3px solid var(--gold); padding: .75rem 1rem; background: color-mix(in srgb, var(--gold) 8%, transparent); }
.loot-results h3 { margin: 0 0 .5rem; }
.loot-results ol { margin: 0; padding-left: 1.5rem; }
.loot-results li small { display: block; color: var(--muted); }
.creature-loot-card { max-width: 760px; margin: 1.5rem auto; }
.loot-table-readonly > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: .65rem 0; }
.loot-detail-roller { display: flex; align-items: end; gap: .75rem; margin-top: 1rem; }
.creature-editor-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.dark-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 1rem; }
.dark-panel h2 { margin-bottom: .9rem; color: var(--gold); font-family: Georgia,serif; font-size: 1rem; font-weight: 500; letter-spacing: .03em; }
.dark-panel label { color: var(--muted); font-size: .7rem; }
.dark-panel input, .dark-panel textarea, .dark-panel select { border-color: var(--line); background: var(--panel); color: var(--ink); padding: .56rem .62rem; }
.dark-panel input:focus, .dark-panel textarea:focus, .dark-panel select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb,var(--gold) 18%,transparent); }
.dark-panel small { color: var(--muted); }
.dark-section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mini-add, .remove-chip { border: 1px solid var(--line); border-radius: 5px; background: var(--panel); padding: .35rem .55rem; color: var(--gold); font-size: .68rem; font-weight: 700; }
.remove-chip { border-color: #65453f; color: #d18d7d; }
.compact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 .7rem; }
.compact-grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.compact-grid.six { grid-template-columns: repeat(6,minmax(0,1fr)); }
.compact-grid .wide { grid-column: 1 / -1; }
.repeat-row { display: grid; grid-template-columns: 180px 130px minmax(180px,1fr) auto; align-items: end; gap: .6rem; border-top: 1px solid var(--line); padding: .75rem 0; }
.repeat-row:first-child { border-top: 0; padding-top: 0; }
.repeat-row label { margin: 0; }
.skill-row { grid-template-columns: minmax(160px,1fr) minmax(160px,1fr) 110px 110px auto; }
.tiny-check, .dark-check { flex-direction: row; align-items: center; }
.tiny-check { margin: 0; font-weight: 500; }
.tiny-check input, .dark-check input { width: auto; }
.dark-check { margin: .2rem 0 1rem; color: var(--ink) !important; }
.ability-table { min-width: 720px; }
.ability-head, .ability-row { display: grid; grid-template-columns: .7fr .7fr .7fr 1.3fr 1fr .8fr; align-items: center; gap: .6rem; padding: .55rem .25rem; }
.ability-head { border-bottom: 1px solid var(--line); color: var(--muted); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.ability-row { border-bottom: 1px solid var(--line); }
.ability-row:last-child { border-bottom: 0; }
.ability-row input { padding: .45rem; }
.ability-row output { color: var(--gold); font-weight: 700; }
.dark-empty { margin: 0; border: 1px dashed var(--line); border-radius: 6px; padding: .85rem; color: var(--muted); font-size: .75rem; text-align: center; }
.subsection-title { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.action-editor { margin-top: .7rem; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 6px; background: var(--panel); padding: .8rem; }
.action-editor-top { display: grid; grid-template-columns: 1fr 220px auto; align-items: end; gap: .6rem; }
.action-editor label { margin-bottom: .65rem; }
.spell-level-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; margin-top: .8rem; }
.spell-entry { display: grid; grid-template-columns: minmax(150px,1.5fr) 70px 80px 90px minmax(130px,1fr) auto; align-items: end; gap: .5rem; border-top: 1px solid var(--line); padding: .65rem 0; }
.spell-entry label { margin: 0; }
.stat-preview-dialog { width: min(760px,calc(100vw - 2rem)); max-height: calc(100vh - 2rem); border: 1px solid #8e774b; border-radius: 8px; background: #eee6d1; padding: 2rem; box-shadow: 0 24px 90px rgba(0,0,0,.55); }
.stat-preview-dialog::backdrop { background: rgba(8,12,10,.78); }
.dialog-close { position: absolute; top: .6rem; right: .7rem; border: 0; background: transparent; color: #6e2d26; font-size: 1.6rem; }
.dnd-stat-block { width: min(100%,780px); border: 1px solid #d2b47a; border-top: 6px solid #8a2e27; border-bottom: 6px solid #8a2e27; background: #f5eedc; padding: 1.5rem; color: #211e19; box-shadow: 0 10px 34px rgba(47,35,20,.12); }
.dnd-stat-block > header h1 { margin: 0; color: #721f1b; font-family: Georgia,serif; font-size: 2rem; font-weight: 600; }
.dnd-stat-block > header p { margin: .15rem 0 .6rem; font-style: italic; }
.dnd-stat-block p { margin: .65rem 0; font-size: .88rem; line-height: 1.5; }
.stat-rule { height: 4px; margin: .55rem 0; background: #8a2e27; clip-path: polygon(0 0,100% 0,98% 100%,2% 100%); }
.stat-abilities { display: grid; grid-template-columns: repeat(6,1fr); gap: .4rem; text-align: center; }
.stat-abilities div { display: grid; gap: .2rem; }
.stat-abilities strong { color: #721f1b; font-size: .75rem; }
.stat-abilities span { font-size: .8rem; }
.stat-block-section h2 { margin: 1rem 0 .4rem; border-bottom: 1px solid #8a2e27; color: #721f1b; font-family: Georgia,serif; font-size: 1.25rem; font-weight: 500; }
.stat-block-section h3 { display: inline; margin: 0; font-size: .88rem; font-style: italic; }
.stat-block-section article p { display: inline; }
.stat-block-section article { margin: .55rem 0; }
.stat-block-section small { display: block; color: #695d4a; }
.campaign-date-fields { display: grid; grid-template-columns: .7fr 1fr 1.2fr .8fr; gap: .7rem; margin-bottom: 1rem; }
.campaign-date-fields label { margin: 0; }
.heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.heading-actions form { margin: 0; }
.week-state { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin: -1rem 0 2rem; border: 1px solid #cbd5cd; border-radius: 10px; background: #eef5ef; padding: .9rem 1.1rem; color: #31533e; }
.week-state > div { display: grid; grid-template-columns: auto auto; align-items: center; gap: .15rem .55rem; }
.week-state p { grid-column: 2; margin: 0; color: #607268; font-size: .76rem; }
.week-state.finished { border-color: #ddd2b9; background: #f7f2e7; color: #70582c; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: #4d8a61; }
.finished .state-dot { background: var(--gold); }
.faction-simulation-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.faction-sim-card { display: flex; flex-direction: column; min-height: 390px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); padding: 1.2rem; box-shadow: var(--shadow); }
.faction-sim-card.complete { border-top: 3px solid #5c8d69; }
.faction-sim-card header, .report-faction header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.action-count { border-radius: 99px; background: #f0eee7; padding: .3rem .55rem; color: #656b63; font-size: .65rem; font-weight: 750; }
.goal-stack { display: grid; gap: .75rem; margin: 1.15rem 0; }
.goal-stack > div { border-left: 2px solid #d7c49d; padding-left: .65rem; }
.goal-stack span, .faction-work > span { color: var(--muted); font-size: .62rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.goal-stack p { margin: .22rem 0 0; color: #4d554d; font-size: .76rem; }
.faction-work { display: grid; gap: .5rem; margin-top: auto; padding-top: .8rem; border-top: 1px solid #ebeae4; }
.work-item { display: grid; grid-template-columns: minmax(0,1fr) 85px; align-items: center; gap: .8rem; }
.roll-workspace { display: grid; grid-template-columns: minmax(240px,.7fr) minmax(0,1.8fr); align-items: start; gap: 1.25rem; margin: 2.5rem 0 1rem; }
.roll-workspace-intro { position: sticky; top: 1rem; }
.roll-form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.report-list { display: grid; gap: .75rem; }
.report-list-card { display: grid; grid-template-columns: minmax(0,1fr) 100px 130px; align-items: center; gap: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 1.15rem 1.3rem; box-shadow: var(--shadow); color: var(--ink); }
.report-summary-strip { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 1.2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.report-summary-strip > div { display: grid; gap: .15rem; border-right: 1px solid var(--line); padding: 1rem 1.2rem; }
.report-factions { display: grid; gap: 1rem; }
.report-action { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 1.5rem; border-top: 1px solid #ecebe5; padding: 1.1rem .8rem; }
.report-action.gain { border-left: 4px solid #5b9a6d; background: linear-gradient(90deg,#f0f8f2,transparent 35%); }
.report-action.loss { border-left: 4px solid #bd685d; background: linear-gradient(90deg,#fcf1ef,transparent 35%); }
.progress-change { display: grid; align-content: center; justify-items: end; gap: .35rem; }
.image-upload-field { display: grid; grid-template-columns: 130px minmax(0,1fr); align-items: center; gap: 1rem; margin-top: .5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.upload-preview, .upload-placeholder { display: block; border: 1px solid var(--line); border-radius: 8px; background: #f3f2ed; object-fit: cover; }
.upload-placeholder { display: grid; place-items: center; color: var(--muted); font-size: .72rem; }
.symbol-preview { width: 110px; height: 110px; object-fit: contain; }
.artwork-preview { width: 100%; height: 330px; }
.token-preview { width: min(210px,100%); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; }
.creature-media-panel .artwork-preview { height: 240px; margin-bottom: 1rem; }
.creature-media-panel .token-preview { width: 180px; height: 180px; margin-bottom: 1rem; }
.entity-heading { display: flex; align-items: center; gap: 1.25rem; }
.entity-symbol { width: 68px; height: 68px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: .35rem; object-fit: contain; }
.entity-symbol.large { width: 104px; height: 104px; flex: 0 0 auto; }
.character-artwork { width: calc(100% + 2.5rem); height: 175px; margin: -1.25rem -1.25rem 1rem; object-fit: cover; }
.character-card { position: relative; overflow: hidden; }
.character-token { position: absolute; top: 1rem; right: 1rem; width: 62px; height: 62px; border: 3px solid #fff; border-radius: 50%; object-fit: cover; }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -1rem 0 1rem; }
.calendar-panel { padding: 0; overflow: hidden; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekdays span { padding: .7rem; color: var(--muted); font-size: .65rem; font-weight: 750; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 145px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .65rem; background: #fff; }
.calendar-day.outside { background: #f5f4ef; }
.calendar-day.current-day { background: #f1f7f2; box-shadow: inset 0 0 0 2px var(--forest); }
.calendar-day-number { display: flex; justify-content: space-between; margin-bottom: .55rem; }
.calendar-events { display: grid; gap: .35rem; }
.calendar-event { display: grid; gap: .1rem; border-left: 3px solid var(--gold); border-radius: 3px; background: #f7f2e8; padding: .38rem .45rem; color: var(--ink); }
.calendar-event strong { overflow: hidden; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { color: var(--muted); font-size: .56rem; text-transform: uppercase; }
.calendar-event.type-note { border-left-color: var(--forest); background: #edf3ee; }
.undated-events { margin-top: 1rem; }

@media (max-width: 1100px) {
  .card-grid, .community-grid { grid-template-columns: repeat(2, 1fr); }
  .community-detail-grid { grid-template-columns: 1fr; }
  .import-panel { position: static; }
  .note-grid, .note-grid.compact, .quest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-generator { grid-template-columns: 1fr; }
  .stat-strip.six { grid-template-columns: repeat(3, 1fr); }
  .stat-strip.six div:nth-child(3) { border-right: 0; }
  .stat-strip.six div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .campaign-grid { grid-template-columns: repeat(2, 1fr); }
  .creature-grid { grid-template-columns: repeat(2,1fr); }
  .compact-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact-grid.six { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .repeat-row, .skill-row, .spell-entry { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .action-editor-top { grid-template-columns: 1fr 180px auto; }
  .faction-simulation-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
  .landing-header { width: min(calc(100% - 2rem), var(--landing-max)); }
  .landing-nav .landing-signin { display: none; }
  .landing-hero { grid-template-columns: 1fr; gap: 3.5rem; width: min(calc(100% - 2rem), var(--landing-max)); min-height: auto; padding: 4.5rem 0; }
  .landing-hero h1 { font-size: clamp(2.8rem, 14vw, 4.2rem); }
  .world-preview { width: min(100%, 460px); justify-self: center; transform: none; }
  .landing-features { padding: 5rem 1rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card, .feature-card-wide, .feature-card-creations { grid-column: auto; grid-template-columns: 36px 1fr; min-height: auto; padding: 2rem 1.25rem; }
  .feature-card-creations .creation-stack { grid-column: 2; margin: 1.4rem 0 0; }
  .landing-final-cta { padding: 5rem 1rem; }
  .landing-final-cta .landing-actions { flex-direction: column; }
  .landing-final-cta .landing-signin { margin: .5rem 0 0; }
  .landing-footer { align-items: flex-start; flex-direction: column; width: min(calc(100% - 2rem), var(--landing-max)); }
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; height: 58px; padding: 0 1rem; background: var(--forest-dark); }
  .mobile-header .brand { font-size: 1.15rem; }
  .mobile-header .brand img { width: 2.35rem; height: 2.35rem; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
  .mobile-header .news-panel { position: fixed; top: 66px; right: 1rem; bottom: auto; left: auto; }
  .menu-button { border: 1px solid rgba(255,255,255,.3); border-radius: 5px; background: transparent; padding: .35rem .55rem; color: #fff; }
  .sidebar { top: 58px; width: 250px; transform: translateX(-100%); transition: transform .2s; box-shadow: 8px 10px 30px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand { display: none; }
  .main-content { margin-left: 0; padding: 2rem 1rem 4rem; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 1.5rem; }
  .admin-news-card { align-items: flex-start; flex-direction: column; }
  .dashboard-grid, .detail-grid, .settings-grid, .form-layout, .turn-layout, .event-list { grid-template-columns: 1fr; }
  .span-two { grid-column: span 1; }
  .card-grid, .community-grid { grid-template-columns: 1fr; }
  .publication-panel { grid-template-columns: 1fr; }
  .community-field-list div { grid-template-columns: 1fr; gap: .25rem; }
  .note-grid, .note-grid.compact, .note-editor, .quest-grid { grid-template-columns: 1fr; }
  .note-editor aside { position: static; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip div:nth-child(2) { border-right: 0; }
  .stat-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: span 1; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { width: 100%; }
  .detail-list.inline { grid-template-columns: repeat(2, 1fr); }
  .project-row { grid-template-columns: 1fr; }
  .event-generator { padding: 1.25rem; }
  .timeline article { grid-template-columns: 72px 1fr; }
  .flash-stack { left: 1rem; right: 1rem; }
  .flash { max-width: none; }
  .campaign-grid { grid-template-columns: 1fr; }
  .inline-form, .member-row { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .member-head { display: none; }
  .auth-card { padding: 1.6rem; }
  .creature-grid, .creature-editor-grid, .spell-level-grid { grid-template-columns: 1fr; }
  .loot-entry, .loot-roller { align-items: stretch; flex-direction: column; }
  .creature-editor-header { align-items: flex-start; flex-direction: column; }
  .creature-header-actions { justify-content: flex-start; }
  .creature-workbench { margin-inline: 0; padding: .8rem; }
  .compact-grid, .compact-grid.four, .compact-grid.six, .repeat-row, .skill-row, .spell-entry, .action-editor-top { grid-template-columns: 1fr; }
  .ability-table { min-width: 620px; }
  .dark-panel:has(.ability-table) { overflow-x: auto; }
  .stat-abilities { grid-template-columns: repeat(3,1fr); row-gap: .8rem; }
  .campaign-date-fields, .campaign-date-fields.campaign-settings-date { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .campaign-upgrade-note { align-items: flex-start; flex-direction: column; }
  .calendar-nav, .week-state { align-items: stretch; flex-direction: column; }
  .calendar-panel { overflow-x: auto; }
  .calendar-weekdays, .calendar-grid { min-width: 760px; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .faction-simulation-grid, .roll-workspace, .roll-form-grid { grid-template-columns: 1fr; }
  .roll-workspace-intro { position: static; }
  .report-list-card { grid-template-columns: 1fr auto; }
  .report-summary-strip { grid-template-columns: repeat(2,1fr); }
  .report-action { grid-template-columns: 1fr; }
  .progress-change { justify-items: start; }
  .image-upload-field { grid-template-columns: 1fr; }
  .profile-details, .profile-password-form, .theme-picker { grid-template-columns: 1fr; }
  .premium-profile-panel, .storage-panel, .pricing-grid, .premium-admin-actions, .redeem-form { grid-template-columns: 1fr; }
  .map-grid, .map-card { grid-template-columns: 1fr; }
  .map-card > img { width: calc(100% + 2.4rem); height: 220px; margin: -1.2rem -1.2rem 0; }
  .code-row, .redemption-row { grid-template-columns: 1fr; gap: .4rem; }
  .code-row.table-head { display: none; }
  .email-template-editor { grid-template-columns: 1fr; }
  .template-help { position: static; }
  .email-row { grid-template-columns: 1fr; gap: .45rem; }
  .email-row.table-head { display: none; }
  .email-actions { justify-content: flex-start; }
}
