:root {
  color-scheme: light;
  --link: var(--brand);
  --focus: #a75100;
  --control-border: #8fa4b7;
  --button-border: transparent;
  --day-outside: #f0f4f8;
  --success-surface: #e6f5eb;
  --success-line: #a7cead;
  --error-ink: #872337;
  --error-surface: #fcebf0;
  --error-line: #e6a9b5;
  --diff-old: #fae5e8;
  --diff-new: #e4f3e7;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9f2fa;
  --muted: #abbfd0;
  --line: #354e63;
  --surface: #152a3c;
  --paper: #0c1c29;
  --soft: #20384c;
  --link: #a4d4ff;
  --focus: #ffbf61;
  --control-border: #658097;
  --button-border: #547a9b;
  --day-outside: #102131;
  --success-surface: #18392e;
  --success-line: #4b846c;
  --error-ink: #ffb5c3;
  --error-surface: #422433;
  --error-line: #8e4e64;
  --diff-old: #492837;
  --diff-new: #1c4034;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0 0 .8rem; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2.2rem, 5vw, 4.1rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
.shell { width: min(100% - 2.5rem, 75rem); margin-inline: auto; }
.skip { position: absolute; top: -10rem; }
.skip:focus { top: .5rem; left: .5rem; z-index: 3; background: var(--surface); padding: .7rem; }
.top { background: var(--surface); border-top: .3rem solid var(--brand); border-bottom: 1px solid var(--line); }
.topbar, .navlinks, .actions, .section-head, .pagination, .footer { display: flex; gap: .85rem; align-items: center; flex-wrap: wrap; }
.topbar, .section-head, .footer { justify-content: space-between; }
.topbar { min-height: 4.6rem; padding-block: .65rem; }
.brand { color: var(--ink); font-size: 1.15rem; font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: .55rem; }
.brand-logo, .brand-logo-dark { width: clamp(6.5rem, 13vw, 9.1rem); height: auto; flex: 0 0 auto; }
.brand-logo-dark, [data-theme="dark"] .brand-logo { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
button.theme-toggle { padding: .4rem .6rem; font-size: .85rem; }
.theme-toggle[aria-pressed="true"] { background: var(--soft); }
.brand-name { border-left: 1px solid var(--line); padding-left: .65rem; }
.navlinks a { color: var(--ink); font-weight: 650; text-decoration: none; }
.navlinks a { padding-block: .45rem; border-bottom: .18rem solid transparent; }
.navlinks a:hover, .navlinks a[aria-current] { color: var(--link); border-color: var(--accent); }
.content { min-height: 70vh; padding-block: 2rem 4rem; }
.footer { border-top: 1px solid var(--line); padding-block: 1.4rem; color: var(--muted); font-size: .9rem; }
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius); border-bottom: .32rem solid var(--accent); padding: clamp(1.6rem, 5vw, 4.5rem); color: white; background: linear-gradient(115deg, var(--brand-deep), var(--brand) 75%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(135deg, transparent 0 2.6rem, #ffffff15 2.6rem 2.7rem, transparent 2.7rem 5.2rem); mask-image: linear-gradient(90deg, transparent 40%, black); }
.hero h1 { max-width: 16ch; }
.hero p { max-width: 34rem; color: #e8f1fa; margin-bottom: 1.5rem; }
.eyebrow { font-size: .79rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--link); margin-bottom: .65rem; overflow-wrap: anywhere; }
.hero .eyebrow { color: var(--accent-light); }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid var(--button-border); border-radius: .65rem; padding: .62rem .95rem; font: inherit; font-weight: 750; text-decoration: none; color: white; background: var(--brand); cursor: pointer; }
.button:hover, button:hover { filter: brightness(.88); }
.button.secondary, button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.light { background: var(--accent); color: var(--brand-deep); }
button[disabled] { opacity: .7; cursor: wait; }
button.danger { background: #9a293d; }
.panel { padding: clamp(1rem, 2.5vw, 1.55rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem; margin-top: 1.1rem; }
.filters label { flex: 1 1 8.5rem; }
label { font-weight: 650; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .58rem .65rem; min-height: 2.65rem; color: var(--ink); font: inherit; background: var(--surface); border: 1px solid var(--control-border); border-radius: .48rem; }
textarea { resize: vertical; min-height: 6rem; }
input[type="checkbox"] { accent-color: var(--link); width: 1.1rem; height: 1.1rem; }
.section { margin-top: 2rem; }
.section-head { margin-bottom: .75rem; }
.section-head h2 { margin: 0; }
.section > h2, .section-head h2 { border-left: .25rem solid var(--accent); padding-left: .65rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; align-items: start; }
.event-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 .25rem .75rem #0829450a;
}
.card-art, .detail-art { display: grid; place-items: center; position: relative; overflow: hidden; color: white; background: linear-gradient(138deg, var(--brand-deep), var(--brand) 70%, #24648c); }
.card-art { aspect-ratio: 5 / 4; text-decoration: none; border-bottom: 1px solid var(--line); }
.card-art.has-poster { display: block; aspect-ratio: auto; border-bottom: 0; }
.card-art img { display: block; width: 100%; height: auto; }
.feature-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .feature-grid .event-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .feature-grid .card-art { aspect-ratio: auto; min-height: 16rem; border-bottom: 0; border-right: 1px solid var(--line); }
  .feature-grid .card-art.has-poster { align-self: start; min-height: 0; border-right: 0; }
  .feature-grid h3 { font-size: clamp(1.65rem, 3vw, 2.75rem); }
}
.detail-art img { width: 100%; height: 100%; object-fit: contain; }
.art-symbol, .detail-art span { color: var(--accent-light); font-size: 8rem; opacity: .8; line-height: 1; }
.art-label { position: absolute; bottom: .8rem; left: 1rem; font-weight: 750; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 1.1rem 1.2rem 1.2rem; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; margin-bottom: .65rem; font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.card-category { padding: .17rem .5rem; border-radius: .35rem; color: var(--link); background: var(--soft); font-weight: 750; }
.card-body h3 { margin: 0 0 1rem; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--link); text-decoration: underline; }
.card-footer { display: flex; align-items: center; gap: .75rem; margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--line); }
.card-date { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 3.65rem; padding: .3rem .35rem; border-radius: .4rem; border-left: .18rem solid var(--accent); background: var(--soft); color: var(--link); font-size: .7rem; font-weight: 700; }
.card-date-day { font-size: 1.3rem; line-height: 1.1; }
.card-place { flex: 1; min-width: 0; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.card-place strong, .card-place span { display: block; }
.card-place strong { color: var(--ink); }
.card-open { display: grid; place-items: center; flex: 0 0 auto; width: 2.55rem; height: 2.55rem; border: 1px solid var(--line); border-radius: 50%; color: var(--link); font-size: 1.2rem; text-decoration: none; }
.card-open:hover { background: var(--brand); border-color: var(--link); color: white; }
@media (min-width: 640px) {
  .feature-grid .card-body { justify-content: center; padding: clamp(1.5rem, 4vw, 3.5rem); }
  .feature-grid .card-footer { margin-top: 0; }
}
.muted { color: var(--muted); }
.empty { grid-column: 1 / -1; text-align: center; padding: 2.4rem 1rem; background: var(--soft); border: 1px dashed var(--control-border); border-radius: var(--radius); }
.empty span { display: inline-block; font-weight: 800; color: var(--link); font-size: 1.6rem; margin-bottom: .55rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; background: var(--soft); padding: .25rem; border-radius: .7rem; }
.tabs a { padding: .4rem .65rem; font-weight: 700; border-radius: .5rem; text-decoration: none; }
.tabs a[aria-current] { background: var(--surface); color: var(--ink); }
.pagination { margin-block: .85rem; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; }
.calendar.list { grid-template-columns: 1fr; }
.day { background: var(--surface); min-height: 7rem; padding: .65rem; overflow-wrap: anywhere; }
.day.outside { background: var(--day-outside); }
.day.today { box-shadow: inset 0 3px var(--accent); }
.day h3 { font-size: .9rem; }
.day ul { padding: 0; margin: 0; list-style: none; }
.day li { font-size: .86rem; margin-block: .38rem; }
.day li span { font-size: .74rem; display: block; color: var(--muted); }
summary { cursor: pointer; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; gap: clamp(1rem, 4vw, 3.8rem); }
.detail-art { min-height: 15rem; border-radius: var(--radius); }
.detail-art img { max-height: 40rem; }
.facts { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; row-gap: .55rem; }
.facts dt { font-weight: 750; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: 1.3rem; }
.qr { margin: 1rem 0; color: var(--muted); }
.notice { padding: .75rem 1rem; border-radius: .65rem; background: var(--success-surface); border: 1px solid var(--success-line); }
.notice.error, .errorlist { color: var(--error-ink); }
.notice.error { background: var(--error-surface); border-color: var(--error-line); }
.narrow { max-width: 40rem; margin-inline: auto; }
@media (max-width: 850px) {
  .calendar:not(.list) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .shell { width: calc(100% - 1.5rem); }
  .content { padding-top: 1rem; }
  .calendar:not(.list) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar.week { grid-template-columns: 1fr; }
  .day { min-height: 5rem; }
  .detail-grid { grid-template-columns: 1fr; }
}
.dashboard { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); align-items: start; gap: 1.4rem; }
.dashboard-side { position: sticky; top: 1rem; padding: .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dashboard-side nav a { display: block; padding: .42rem .3rem; border-radius: .4rem; font-weight: 650; text-decoration: none; }
.dashboard-side nav a:hover { background: var(--soft); }
.dashboard-side form { margin-top: .7rem; }
.dashboard-main h1 { font-size: clamp(1.9rem, 4vw, 3.3rem); }
.metrics, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; }
.metrics a { color: var(--ink); text-decoration: none; }
.metrics strong { display: block; color: var(--link); font-size: 2.2rem; }
.item-list { display: grid; gap: .65rem; }
.item { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem 1.2rem; overflow-wrap: anywhere; }
.item h3 { margin: .2rem 0 .4rem; }
.badge { display: inline-block; border-radius: 1rem; padding: .18rem .6rem; background: var(--soft); color: var(--ink); font-size: .82rem; font-weight: 700; }
.wide { grid-column: 1 / -1; }
.field { min-width: 0; }
.field small, .helptext { display: block; color: var(--muted); margin-top: .3rem; font-size: .85rem; }
.drop-zone { border: 1px dashed var(--control-border); border-radius: .6rem; margin-top: .5rem; padding: .9rem; color: var(--muted); }
.drop-zone.dragging { background: var(--soft); }
.form-image { max-height: 22rem; object-fit: contain; border-radius: .45rem; margin-block: .65rem; }
[hidden] { display: none !important; }
.diff del, .diff ins { display: block; white-space: pre-wrap; }
.diff del { background: var(--diff-old); }
.diff ins { background: var(--diff-new); }
.screen-preview { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: .65rem; }
@media (max-width: 750px) {
  .dashboard { grid-template-columns: 1fr; }
  .dashboard-side { position: static; }
  .dashboard-side nav { display: flex; gap: .25rem .55rem; align-items: center; flex-wrap: wrap; }
  .dashboard-side .eyebrow { width: 100%; margin-bottom: 0; }
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
