@font-face {
  font-family: Nunito Sans;
  src: url(fonts/NunitoSans-Variable.ttf) format("truetype");
  font-display: swap;
  font-weight: 400 900;
}
@font-face {
  font-family: Lilita One;
  src: url(fonts/LilitaOne-Regular.ttf) format("truetype");
  font-display: swap;
}
:root {
  --night: #1e0d1b;
  --plum: #481135;
  --bright: #7b2455;
  --gold: #e8b75a;
  --ivory: #fff1d0;
  --mint: #2ba7a0;
  --wine: #3a152e;
  --dark-muted: #69462e;
  --dock: 76px;
  color-scheme: dark;
  color: var(--ivory);
  background: var(--night);
  font: 400 100%/1.5 "Nunito Sans", sans-serif;
  font-variant-numeric: tabular-nums;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 34% 10%, #421431 0%, var(--night) 53%); }
body:has(.dock) { padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom) + 32px); }
img { max-width: 100%; }
h1, h2, h3, .button, .brand { font-family: "Lilita One", sans-serif; font-weight: 400; line-height: 1.12; }
h1, h2, h3 { margin: 0 0 .45em; }
h1 { font-size: clamp(2rem, 3.8vw, 3.25rem); }
h2 { font-size: clamp(1.48rem, 2.8vw, 1.95rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 .8rem; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #228a83; outline-offset: 3px; }
.topbar :focus-visible, .dock :focus-visible { outline-color: var(--ivory); }
.skip, .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { top: 8px; left: 8px; width: auto; height: auto; clip-path: none; z-index: 20; padding: 8px; background: var(--night); }
.topbar { background: #28101f; border-bottom: 1px solid #805632; }
.topbar-inner { max-width: 1120px; margin: auto; min-height: 67px; padding: 5px 16px; display: flex; align-items: center; gap: clamp(8px,2vw,24px); }
.brand { display: flex; align-items: center; gap: .55rem; margin-right: auto; font-size: clamp(.91rem, 2.7vw, 1.25rem); text-decoration: none; }
.brand img { aspect-ratio: 1; object-fit: contain; width: clamp(32px, 8vw, 50px); height: auto; }
.brand small { display: block; font: 800 .78rem "Nunito Sans", sans-serif; color: var(--gold); }
.balance { border: 1px solid #8e6530; border-radius: 20px; padding: .3rem .66rem; display: flex; align-items: center; gap: .28rem; text-decoration: none; white-space: nowrap; font-size: .85rem; }
.coin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--night); }
.account-menu { position: relative; font-size: .88rem; z-index: 4; }
.account-menu > div { position: absolute; top: 2rem; right: 0; background: var(--night); border: 1px solid var(--gold); padding: 1rem; border-radius: .6rem; width: max-content; }
.account-menu form { margin-top: .75rem; }
.shell { width: min(1120px, 100%); margin: 0 auto; padding: 18px 18px 26px; }
.standalone { min-height: 96dvh; display: grid; align-content: center; }
.agency-hero, .entry-art {
  background: linear-gradient(90deg, #1d0e1cec 0%, #1d0e1ca0 34%, #1d0e1c0c 80%), url(art/bureau.webp) 50% 49% / cover;
  border: 1px solid #aa7742; border-radius: 16px; overflow: hidden;
}
.agency-hero { position: relative; min-height: clamp(230px, 33vw, 400px); display: grid; align-content: space-between; justify-items: start; padding: clamp(20px,4vw,47px); }
.agency-hero img { display: block; width: clamp(210px, 36vw, 390px); }
.agency-hero h1 { margin: 0; color: var(--ivory); text-shadow: 1px 3px 4px var(--night); }
.agency-hero p, .entry-art p { color: var(--ivory); font-weight: 800; text-shadow: 1px 2px 4px var(--night); }
.intro-line, .section-head { display: flex; align-items: center; justify-content: space-between; gap: .55rem 1rem; flex-wrap: wrap; }
.intro-line { padding: .9rem .25rem .25rem; }
.intro-line p, .section-head h2 { margin: 0; }
.section-head { margin-bottom: .9rem; }
.simulation { font-size: .86rem; font-weight: 800; }
.intro-line .simulation { color: #ffe4a8; background: #502036; border-radius: 6px; padding: .3rem .55rem; }
.page-head { margin: .25rem 0 1.2rem; }
.page-head p { color: #eed5ae; }
.panel {
  background: linear-gradient(140deg, #fff5dc, #f8e6bf);
  color: var(--night); border: 1px solid #b8894b; border-radius: 13px;
  padding: clamp(16px, 2.6vw, 28px); margin: 0 0 16px; box-shadow: 0 3px 0 #120911;
  color-scheme: light;
}
.panel.plum { background: linear-gradient(148deg, #581a43, #350f2a); color: var(--ivory); color-scheme: dark; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.dashboard-grid > .panel { margin: 0; }
.full { grid-column: 1 / -1; }
.stats { display: flex; flex-wrap: wrap; gap: .65rem; margin: .75rem 0 1rem; }
.stats > div { flex: 1 1 120px; background: #ecdaae; border: 1px solid #c9ab73; padding: .55rem .72rem; border-radius: 8px; }
.stats dt { font-weight: 800; font-size: .83rem; color: #513420; }
.stats dd { margin: .1rem 0; font-size: clamp(1.22rem, 2.4vw, 1.7rem); font-weight: 900; }
.stats dd small { font-size: .8rem; }
.offline { border-radius: 8px; border: 1px solid #76aaa0; background: #d7eee0; padding: .65rem .85rem; }
.offline p { margin: .25rem 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 12px; }
.artist-tile { display: flex; align-items: center; gap: .7rem; border: 1px solid #c9a974; background: #faebcb; border-radius: 9px; color: var(--night); padding: .55rem; text-decoration: none; min-height: 93px; }
.artist-tile:hover, .artist-tile:focus-visible { background: #f3dfa9; }
.artist-tile img { border-radius: 6px; object-fit: cover; }
.artist-tile small { display: block; color: var(--dark-muted); font-weight: 700; }
.mission-tile, .run-tile { border: 1px solid #c7a670; border-radius: 9px; background: #faebcb; padding: .9rem; min-width: 0; }
.run-tile { background: #331029; border-color: #9c6577; margin: .2rem 0; }
.run-tile p { margin: .3rem 0; }
.terms { display: flex; flex-wrap: wrap; gap: .2rem .65rem; font-size: .91rem; }
.eyebrow { color: #6d2c52; font-weight: 900; font-size: .85rem; letter-spacing: .035em; margin-bottom: .3rem; }
.profile { display: flex; align-items: center; gap: clamp(15px,3vw,26px); }
.profile img { width: min(32%, 190px); height: auto; border: 2px solid #af784d; border-radius: 10px; }
.back { color: var(--gold); }
.narrow { width: min(100%, 650px); margin-inline: auto; }
.row, .stack { display: flex; gap: .6rem; }
.row { flex-wrap: wrap; align-items: flex-end; }
.stack { flex-direction: column; align-items: stretch; }
.stack .button { align-self: flex-start; }
.spaced { margin-top: .9rem; }
.find { margin-bottom: .9rem; }
.find label { flex: 1 1 14rem; }
label { display: grid; gap: .2rem; font-weight: 800; min-width: 0; }
input, select, textarea {
  min-height: 44px; max-width: 100%; padding: .5rem .65rem;
  color: #261321; background: #fffae9; border: 1px solid #8c644a; border-radius: 7px;
  scroll-margin-bottom: calc(var(--dock) + 35px);
}
select { width: 100%; text-overflow: ellipsis; }
textarea { min-height: 7rem; resize: vertical; font: .9rem/1.6 ui-monospace, monospace; }
.check { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.check input { width: 19px; height: 19px; min-height: 0; flex: 0 0 auto; accent-color: var(--plum); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .53rem .92rem; max-width: 100%; text-align: center; text-decoration: none; font-size: 1rem; color: var(--night); border: 1px solid #926132; border-radius: 8px; background: linear-gradient(#f7ce79, var(--gold)); box-shadow: 0 2px 0 #8e572b; }
.button:hover:enabled, a.button:hover { filter: brightness(1.08); }
.button.secondary { background: #eedbb1; }
.button:disabled { opacity: .58; cursor: default; }
summary { cursor: pointer; }
.notice { padding: .65rem .8rem; border: 1px solid #6c8c76; border-radius: 8px; color: var(--night); background: #f2e4bf; }
.notice.success { background: #ceebd7; }
.notice.error { background: #ffdae0; border-color: #9f5166; }
.plain { padding: 0; margin: .65rem 0 0; list-style: none; }
.plain li { border-top: 1px solid #d2b988; padding: .55rem 0; overflow-wrap: anywhere; }
.plain strong { margin-inline-start: .25rem; }
.fact { display: inline-block; font-size: .83rem; background: #e8d2a3; border-radius: 5px; padding: .02rem .45rem; }
.chat { padding: 0; list-style: none; }
.chat li { border-radius: 7px; background: #f1dfb8; padding: .65rem .85rem; margin-bottom: .5rem; }
.chat li small { margin-inline-start: .55rem; }
.chat p { margin: .2rem 0 0; overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
progress { width: 100%; accent-color: var(--gold); }
.scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; vertical-align: top; border-bottom: 1px solid #c9ad7b; padding: .6rem .5rem; }
td small { display: block; }
.negative { color: #8d2247; }
.dock { position: fixed; z-index: 5; inset: auto 0 0; padding-bottom: env(safe-area-inset-bottom); background: #260e23; border-top: 1px solid #b58145; }
.dock-inner { width: min(900px, 100%); height: var(--dock); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: auto; padding: 6px 5px; }
.dock a { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ivory); background: #481135; border: 1px solid #742e56; border-radius: 8px; text-decoration: none; font-size: clamp(.67rem, 2.3vw, .9rem); font-weight: 900; line-height: 1.2; }
.dock a:hover { background: var(--bright); }
.dock a[aria-current] { background: linear-gradient(#f6cc78, #dca247); color: var(--night); border-color: #e8b75a; }
.tab-icon { font: 700 27px/1 system-ui, sans-serif; }
.keyboard-open .dock { visibility: hidden; }
.entry { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; max-width: 950px; margin: 0 auto; align-items: stretch; }
.entry-art { display: flex; flex-direction: column; justify-content: end; padding: 22px; min-height: 350px; }
.entry-art img { max-width: 420px; width: 100%; }
.entry-form { display: flex; flex-direction: column; justify-content: center; margin: 0; }
.admin-links { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-bottom: 1.05rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 660px) {
  .shell { padding-inline: 12px; }
  .dashboard-grid, .entry { grid-template-columns: 1fr; }
  .agency-hero { background-position: 57% 51%; }
  .entry-art { min-height: 190px; }
  .entry-art img { max-width: 270px; }
  .profile { align-items: flex-start; }
  .profile h1 { font-size: 1.75rem; }
  .stats > div { flex-basis: 92px; }
}
@media (max-width: 380px) {
  .balance > span:last-child { display: none; }
  .topbar-inner { padding-inline: 9px; }
}

.button.submitting::before {
  content: "";
  margin-inline-end: .45rem;
  width: .9rem;
  height: .9rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex: 0 0 auto;
}
@media (prefers-reduced-motion: no-preference) {
  .button.submitting::before { animation: mt-load .7s linear infinite; }
}
@keyframes mt-load {
  to { transform: rotate(360deg); }
}
