:root {
  color-scheme: light;
  --paper: #f8f4e7;
  --panel: #fffdf4;
  --ink: #233d35;
  --muted: #607168;
  --line: #d8dbca;
  --forest: #28745c;
  --forest-dark: #1d533f;
  --sage: #deedcf;
  --amber: #f7e5b7;
  --blue: #dbeef4;
  --violet: #eee2f3;
  --red: #a95142;
  --shadow: 0 2px 1px #3c44260a, 0 12px 26px #555e3610;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; background-image: radial-gradient(#45543713 .65px, transparent .65px); background-size: 7px 7px; }
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #528f8e; outline-offset: 3px; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .wordmark, .timer-value { font-family: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif; }
h2, h3 { letter-spacing: -.028em; }
small { color: var(--muted); }
canvas { display: block; width: 100%; }
.shell { width: min(1280px, calc(100% - 72px)); margin-inline: auto; }
.site-header { background: #fffcf3; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px; }
.wordmark { border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; gap: 11px; justify-self: start; min-width: 0; font-size: 23px; font-weight: 800; letter-spacing: -.05em; text-align: left; }
.wordmark > span:last-child { overflow-wrap: anywhere; }
.guild-mark { display: inline-grid; place-items: center; width: 37px; height: 37px; flex: none; border: 1px solid #b9c8aa; border-radius: 12px; background: #e7edd8; overflow: hidden; position: relative; }
.guild-mark::before, .guild-mark::after, .guild-mark i { content: ""; position: absolute; }
.guild-mark::before { width: 26px; height: 19px; background: #7d9f79; clip-path: polygon(0 100%, 36% 9%, 75% 85%, 100% 100%); left: 2px; bottom: 6px; }
.guild-mark::after { width: 20px; height: 15px; background: #3f6756; clip-path: polygon(0 100%, 62% 3%, 100% 100%); right: 2px; bottom: 6px; }
.guild-mark i { width: 6px; height: 6px; border-radius: 50%; background: #d9a95f; top: 6px; right: 8px; }
.main-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid #e3e3d5; border-radius: 12px; background: #f3f2e8; }
.main-nav button { border: 0; background: transparent; padding: 8px 16px; font-size: .89rem; font-weight: 650; border-radius: 8px; color: var(--muted); }
.main-nav button:hover { background: #e9edde; color: var(--ink); }
.main-nav button[aria-current="page"] { background: #d4ebd8; color: #255944; }
.header-actions, .page-actions { display: flex; justify-content: end; align-items: center; flex-wrap: wrap; gap: 8px; }
.header-actions { justify-self: end; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; min-height: 42px; background: transparent; font-size: .9rem; font-weight: 700; line-height: 1.15; white-space: nowrap; transition: background .16s, border-color .16s, transform .16s, box-shadow .16s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button.small { min-height: 35px; padding: 7px 10px; font-size: .8rem; }
.button.primary { background: var(--forest); color: #fffdf2; border-color: var(--forest-dark); box-shadow: 0 2px #224535; }
.button.primary:not(:disabled):hover { background: #35856a; box-shadow: 0 3px #224535; transform: translateY(-1px); }
.button.paper { background: #fffdf4; border-color: #d4dac6; }
.button.paper:not(:disabled):hover { background: #eff2e4; border-color: #bacbad; }
.button.quiet { color: var(--muted); }
.button.text { color: #426552; }
.button.quiet:not(:disabled):hover, .button.text:not(:disabled):hover { background: #e8eddf; color: var(--forest-dark); }
.button.active { background: #e3edda; border-color: #aac19d; color: #2f5b44; }
.core-button { font-size: .83rem; }
.core-button > span:first-child { color: #477b67; font-size: 1.2rem; }
.main-shell { padding-block: 33px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.presence { display: flex; align-items: center; gap: 7px; font-weight: 700; color: #587260; font-size: .79rem; margin-bottom: 6px; }
.presence i, .route-pill i { width: 7px; height: 7px; border-radius: 50%; background: #63966e; box-shadow: 0 0 0 3px #63966e28; margin-inline: 3px; }
h1 { font-size: clamp(2.45rem, 4.2vw, 3.8rem); line-height: .98; font-weight: 800; letter-spacing: -.058em; }
.page-actions { padding-bottom: 3px; }
.dashboard { display: grid; grid-template-columns: minmax(250px, .78fr) minmax(0, 1.94fr); gap: 18px; align-items: start; }
.sidebar { display: grid; gap: 18px; min-width: 0; }
.guild-board { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); gap: 18px; align-items: stretch; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 16px 16px 12px; }
.section-head h2 { display: flex; align-items: center; gap: 9px; font-size: clamp(1.08rem, 1.6vw, 1.38rem); font-weight: 750; line-height: 1.1; }
.section-mark { width: 29px; height: 29px; flex: none; display: inline-grid; place-items: center; background: #e7ecdf; color: #47705b; border-radius: 9px; font-size: 1.05rem; line-height: 1; font-weight: 700; }
.section-mark.amber, .section-mark.sale, .section-mark.quest { background: #f4e7cc; color: #91672d; }
.section-mark.blue, .section-mark.travel, .section-mark.search { background: #e0eeeb; color: #507d7b; }
.section-mark.violet, .section-mark.refine, .section-mark.transfer { background: #eee8f2; color: #736385; }
.section-mark.harvest, .section-mark.risk { background: #f4e2d7; color: #955a45; }
.section-mark.green { background: #e4edda; color: #4d7655; }
.pill { display: inline-flex; align-items: center; width: fit-content; gap: 4px; padding: 5px 8px; border-radius: 100px; font-size: .69rem; font-weight: 750; line-height: 1.05; white-space: nowrap; }
.pill.sage { background: #e0ead3; color: #44644b; }
.pill.amber { background: #f2e3c2; color: #815f2e; }
.pill.violet { background: #e7e0ee; color: #685a7a; }
.balance { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; white-space: nowrap; background: #f2ead3; border: 1px solid #e9ddbe; border-radius: 10px; color: #6f542e; font-size: .84rem; font-weight: 750; }
.coin-icon { flex: none; width: 14px; height: 14px; display: inline-block; background: #e9b760; border: 2px solid #c58b3e; border-radius: 50%; box-shadow: inset 0 0 0 1px #f5d794; vertical-align: -2px; }
.log-card { min-height: 232px; background: #f8fcf8; border-color: #d4e1d8; }
.log-card .section-head { flex-wrap: wrap; }
.log-actions { display: flex; gap: 3px; margin-left: auto; }
.log-actions .button { padding-inline: 7px; min-height: 31px; }
.log-body { padding: 0 12px 12px; }
.log-empty { min-height: 150px; border: 1px dashed #c9ddcf; border-radius: 12px; display: grid; align-content: center; justify-items: center; text-align: center; gap: 8px; padding: 12px; color: var(--muted); background: #edf5eb; font-size: .86rem; }
.log-empty > span { width: 34px; height: 34px; border-radius: 10px; background: #ecf0e3; color: #64816e; display: grid; place-items: center; font-size: 1.22rem; }
.journal-row { appearance: none; display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-bottom: 1px solid #e7eadc; padding: 9px 4px; text-align: left; background: transparent; min-height: 52px; border-radius: 4px; }
.journal-row:last-child { border-bottom-color: transparent; }
.journal-row:hover { background: #eff3e5; }
.journal-row .section-mark { width: 26px; height: 26px; font-size: .85rem; border-radius: 8px; }
.journal-copy { flex: 1; min-width: 0; }
.journal-copy strong, .journal-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal-copy strong { font-size: .81rem; }
.journal-copy small, .journal-row time { font-size: .7rem; color: var(--muted); }
.journal-row time { align-self: start; white-space: nowrap; padding-top: 2px; }
.village { background: #dfeecf; border-color: #cbdcb8; }
.village-art { height: clamp(145px, 17vw, 235px); overflow: hidden; }
.village-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 14px; }
.village-footer small { font-size: .72rem; font-weight: 650; }
.village-footer h2 { font-size: 1.22rem; }
.quest-card { min-height: 229px; background: #fff7e2; border-color: #eaddbd; }
.quest-list { padding: 0 15px 15px; }
.quest-row { display: block; text-align: left; width: 100%; background: #f9eac6; border: 1px solid #e9d5aa; border-radius: 12px; padding: 12px; }
.quest-row + .quest-row { margin-top: 9px; }
.quest-row:hover { background: #f7e1b1; border-color: #d7be89; }
.quest-row-top, .quest-row-bottom, .xp-line, .quest-total { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.quest-row-top { margin-bottom: 10px; }
.quest-row-top strong { font-size: .91rem; }
.quest-reward { color: #83632f; font-size: .73rem; font-weight: 750; }
.quest-row-bottom { margin-top: 6px; color: var(--muted); font-size: .74rem; }
.meter { height: 7px; background: #dce3ce; border-radius: 50px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #658e67; border-radius: inherit; transition: width .2s linear; }
.quest-row .meter { background: #e7ddc1; }
.quest-row .meter > i { background: #b98d51; }
.quest-completion { position: relative; background: #e8efcd; border-color: #c7d7ad; animation: quest-out .28s 1.13s ease-in both; }
.quest-completion:hover { background: #e8efcd; border-color: #c7d7ad; }
.quest-completion .quest-reward { color: #3c6f42; }
.quest-completion .celebration-meter { position: relative; overflow: visible; background: #d7e2bc; }
.quest-completion .celebration-meter > i { width: 100%; background: #6caa6b; animation: fill-request .4s ease-out both; }
.quest-confetti { position: absolute; inset: 0; pointer-events: none; }
.quest-confetti i { position: absolute; left: 50%; top: 0; width: 8px; height: 7px; opacity: 0; background: #e8a64f; border-radius: 0; clip-path: polygon(0 23%, 69% 0, 100% 68%, 40% 100%); animation: quest-burst .73s .4s ease-out both; }
.quest-confetti i:nth-child(1) { --dx: -119px; --dy: -26px; --turn: -176deg; }
.quest-confetti i:nth-child(2) { --dx: -85px; --dy: -48px; --turn: -120deg; background: #79ad85; }
.quest-confetti i:nth-child(3) { --dx: -60px; --dy: -26px; --turn: -205deg; background: #dd8971; }
.quest-confetti i:nth-child(4) { --dx: -38px; --dy: -61px; --turn: -145deg; background: #7fb6c9; }
.quest-confetti i:nth-child(5) { --dx: -14px; --dy: -45px; --turn: 139deg; }
.quest-confetti i:nth-child(6) { --dx: 16px; --dy: -57px; --turn: 138deg; background: #a787bc; }
.quest-confetti i:nth-child(7) { --dx: 37px; --dy: -29px; --turn: 115deg; }
.quest-confetti i:nth-child(8) { --dx: 59px; --dy: -48px; --turn: 198deg; background: #dd8971; }
.quest-confetti i:nth-child(9) { --dx: 86px; --dy: -38px; --turn: 174deg; background: #7fb6c9; }
.quest-confetti i:nth-child(10) { --dx: 117px; --dy: -19px; --turn: 170deg; background: #79ad85; }
.quest-arriving { animation: quest-in .3s cubic-bezier(.2,.8,.32,1.16) both; }
@keyframes fill-request { from { width: var(--start); } to { width: 100%; } }
@keyframes quest-burst {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10% { opacity: 1; }
  64% { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(var(--turn)); }
  100% { opacity: 0; transform: translate(var(--dx), 25px) rotate(var(--turn)); }
}
@keyframes quest-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes quest-in { from { opacity: 0; transform: translateY(9px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.echo-card { background: #e0efe4; border-color: #c9decf; padding-bottom: 14px; }
.echo-profile { display: flex; align-items: center; gap: 13px; padding: 0 15px 9px; }
.portrait { width: 89px; height: 91px; flex: none; display: grid; place-items: center; background: #bedfe8; border: 1px solid #accfd9; border-radius: 28px 28px 19px 19px; overflow: hidden; }
.portrait canvas { width: 74px; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.14rem; }
.profile-copy small { font-size: .78rem; margin-top: 2px; }
.profile-bonuses { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.profile-bonuses span { background: #f9fbf3; border: 1px solid #d5decb; border-radius: 6px; padding: 3px 5px; font-size: .67rem; font-weight: 700; }
.xp-line { margin: 3px 16px 5px; font-size: .75rem; color: var(--muted); }
.xp-line strong { color: #355543; }
.echo-card > .meter { margin-inline: 16px; }
.gathering-card { padding-bottom: 14px; background: #f3f8e5; border-color: #d2dfbf; }
.gathering-open { display: block; width: calc(100% - 28px); margin-inline: 14px; padding: 0; border: 0; border-radius: 11px; background: transparent; text-align: left; }
.route-art { display: block; height: 115px; overflow: hidden; border-radius: 11px; border: 1px solid #c5d8bf; }
.route-art img { object-position: center 61%; transition: transform .2s ease-out; }
.gathering-open:hover .route-art img { transform: scale(1.035); }
.route-pill { position: absolute; top: 8px; left: 8px; background: #f1f5e7; border: 1px solid #cbdcc0; color: #375b40; }
.route-pill.route-yellow { background: #fff0c6; border-color: #dfc78e; color: #785620; }
.route-pill.route-yellow i { background: #c69436; }
.route-pill.route-red { background: #f9e1da; border-color: #e8bbaf; color: #8a493c; }
.route-pill.route-red i { background: #b7644c; }
.route-pill.route-black { background: #38465e; border-color: #455772; color: #f7eff9; }
.route-pill.route-black i { background: #dec3f2; }
.route-body { padding-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.route-body strong { display: block; font: 750 1.2rem "Bricolage Grotesque", "DM Sans", sans-serif; letter-spacing: -.025em; }
.route-body small { display: block; margin-top: 3px; font-size: .76rem; }
.route-arrow { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--forest); color: #fffdf2; border: 1px solid var(--forest-dark); box-shadow: 0 2px #224535; font-size: 1.15rem; transition: background .18s, transform .18s; }
.gathering-open:hover .route-arrow { background: #35856a; transform: translateX(2px); }
.special-card { background: #f1e7f5; border-color: #e0cfe8; }
.special-card > .quest-row { width: calc(100% - 30px); margin: 0 15px 15px; }
.special-empty { display: grid; place-items: center; align-content: center; min-height: 161px; gap: 6px; margin: 0 14px 14px; padding: 12px; background: #faf3fb; border: 1px dashed #d9c7e2; border-radius: 12px; text-align: center; }
.special-empty strong { font-size: .88rem; }
.special-empty small { font-size: .76rem; }
.special-star { width: 41px; height: 41px; display: grid; place-items: center; background: #efe8f4; border-radius: 13px; color: #8d74a1; font-size: 1.5rem; line-height: 1; }
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; list-style: none; margin: 0; padding: 0; }
.route-grid > li { display: flex; min-width: 0; }
.route-option { display: flex; flex-direction: column; width: 100%; padding: 0; overflow: hidden; border: 1px solid #d3deca; border-radius: 12px; background: #f5f7eb; text-align: left; transition: border-color .18s, background .18s, transform .18s; }
button.route-option:not(:disabled):hover { border-color: #8fa68a; background: #eef4e1; transform: translateY(-1px); }
.route-option.closed { background: #f0edf4; border-color: #ded6e6; }
.route-preview-art { position: relative; display: block; width: 100%; aspect-ratio: 2; overflow: hidden; background: #d4dfce; }
.route-option-copy { display: grid; gap: 4px; padding: 10px 11px 7px; }
.route-option-copy strong { font: 750 1.1rem "Bricolage Grotesque", "DM Sans", sans-serif; }
.route-option-copy small { font-size: .74rem; line-height: 1.3; }
.route-option-action { display: block; margin-top: auto; padding: 0 11px 10px; font-size: .79rem; color: #33604c; font-weight: 750; }
.route-option.closed .route-option-action { color: #6c567f; }
.station-tabs { display: flex; align-items: center; gap: 3px; overflow: auto; background: #f0f1e6; padding: 7px; border-bottom: 1px solid var(--line); }
.station-tabs button { min-height: 37px; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 7px 14px; color: var(--muted); font-size: .87rem; font-weight: 700; white-space: nowrap; }
.station-tabs button:hover { background: #e6eddd; }
.station-tabs button.selected { background: #fffdf5; color: var(--forest-dark); border-color: #d4dac7; box-shadow: 0 2px 3px #44503d0e; }
.station-body { padding: 20px; min-height: 400px; }
.station-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.station-heading h2 { font-size: 1.55rem; }
.station-heading p { margin-top: 3px; color: var(--muted); font-size: .88rem; }
.station-empty { display: grid; justify-items: center; gap: 9px; border: 1px dashed var(--line); background: #f7f8ee; border-radius: 13px; padding: 22px 14px; min-height: 189px; align-content: center; text-align: center; }
.station-empty p, .empty-line { color: var(--muted); font-size: .86rem; }
.empty-line { padding: 12px 0; }
.shop-row, .stock-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e7eadc; padding: 10px 0; }
.shop-row:last-child, .stock-row:last-child { border-bottom: 0; }
.shop-row input { width: 68px; }
.shop-item { flex: 1; min-width: 0; }
.shop-item strong, .shop-item small, .stock-row > span > strong, .stock-row > span > small { display: block; }
.shop-item strong, .stock-row strong { font-size: .9rem; }
.shop-item small, .stock-row small { font-size: .75rem; }
.stock-count { margin-left: auto; }
.item-icon { position: relative; width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 10px; background: #f2e5d9; --item-dark: #b96c51; --item-light: #dfa47f; --item-edge: #96533e; }
.item-icon.silver { background: #e7eceb; --item-dark: #829b9d; --item-light: #bccccc; --item-edge: #677d81; }
.item-icon.gold { background: #f3e9cc; --item-dark: #be8d43; --item-light: #e7ba64; --item-edge: #a3743b; }
.item-icon.violet { background: #eee8f3; --item-dark: #8c73a0; --item-light: #b4a0c3; --item-edge: #755d8b; }
.item-icon.linen { background: #f1e9d3; --item-dark: #b0956b; --item-light: #eee1ba; --item-edge: #9b815d; }
.item-icon.fiber { background: #e9eddc; --item-dark: #7d9b70; --item-light: #b5c99a; --item-edge: #607d55; }
.item-icon.wood { background: #f0e1d2; --item-dark: #a66e48; --item-light: #d8a66f; --item-edge: #835638; }
.item-icon i, .item-icon i::after { content: ""; display: block; background: var(--item-dark); width: 23px; height: 21px; }
.item-icon .ore { clip-path: polygon(15% 75%, 5% 52%, 28% 15%, 69% 6%, 94% 38%, 99% 68%, 70% 93%, 34% 92%); }
.item-icon .ore::after { background: var(--item-light); clip-path: polygon(0 47%, 28% 15%, 69% 6%, 94% 38%, 55% 53%, 41% 80%, 15% 75%); }
.item-icon .bar { clip-path: polygon(0 78%, 13% 32%, 81% 14%, 96% 51%, 96% 70%, 17% 93%); }
.item-icon .bar::after { background: var(--item-light); clip-path: polygon(0 78%, 13% 32%, 81% 14%, 96% 51%, 17% 72%); }
.item-icon .star { clip-path: polygon(50% 0, 64% 35%, 100% 50%, 65% 64%, 50% 100%, 36% 65%, 0 50%, 36% 34%); }
.item-icon .fiber { clip-path: polygon(0 46%, 22% 26%, 37% 37%, 46% 10%, 66% 11%, 68% 35%, 95% 31%, 100% 51%, 58% 91%, 39% 94%, 42% 74%); }
.item-icon .fiber::after { background: var(--item-light); clip-path: polygon(0 46%, 22% 26%, 37% 37%, 46% 10%, 66% 11%, 65% 43%, 33% 69%); }
.item-icon .cloth { clip-path: polygon(7% 22%, 74% 9%, 100% 25%, 95% 71%, 66% 93%, 4% 82%); }
.item-icon .cloth::after { background: var(--item-light); clip-path: polygon(7% 22%, 74% 9%, 100% 25%, 72% 43%, 4% 50%); }
.item-icon .wood { clip-path: polygon(7% 61%, 22% 36%, 71% 14%, 93% 29%, 99% 54%, 76% 79%, 22% 96%); }
.item-icon .wood::after { background: var(--item-light); clip-path: polygon(71% 14%, 93% 29%, 99% 54%, 77% 68%, 61% 47%); }
input, select { border: 1px solid #cbd4bf; border-radius: 8px; background: #fffef8; color: var(--ink); min-width: 0; padding: 7px 8px; min-height: 36px; font-size: .86rem; }
input:disabled { background: #f1f2e8; opacity: .72; }
label { display: grid; gap: 5px; color: #3f594a; font-size: .78rem; font-weight: 700; min-width: 0; }
label input, label select { width: 100%; font-weight: 500; }
.optional { color: var(--muted); font-size: .7rem; font-weight: 500; }
.bank-balances { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.bank-balances > div { display: grid; gap: 4px; padding: 12px; background: #eff2e5; border-radius: 10px; border: 1px solid #dde4d1; }
.bank-balances small { font-size: .75rem; }
.station-form { display: grid; grid-template-columns: 1fr 1.3fr .85fr; align-items: end; gap: 10px; }
.station-submit { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.bank-stock, .station-history { border-top: 1px solid #e5e7da; margin-top: 16px; padding-top: 12px; }
.bank-stock h3 { font-size: 1.04rem; }
.recipe { display: flex; align-items: center; gap: 14px; border: 1px solid #e8e1c9; background: #f7f0dc; border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.recipe > div { display: flex; align-items: center; gap: 8px; }
.recipe strong, .recipe small { display: block; font-size: .8rem; }
.recipe small { font-size: .73rem; }
.metal-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.refine-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.refine-form input { width: 74px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 5px; }
.refine-form > .primary { margin-left: auto; }
.form-hint { color: var(--muted); font-size: .78rem; margin-top: 8px; }
.refine-progress { padding: 12px; background: #edf1e3; border-radius: 12px; text-align: center; }
.refine-progress .timer-value { font-size: 2rem; }
.refine-progress .timer-block { max-width: 360px; margin-inline: auto; }
.working-scene { position: relative; height: clamp(135px, 22vw, 214px); margin-bottom: 10px; overflow: hidden; border-radius: 10px; background: #d2b58e; }
.working-scene > canvas { height: 100%; object-fit: cover; object-position: center 63%; }
.work-stage { position: absolute; width: 168px; height: 105px; left: calc(50% - 78px); bottom: 12%; }
.work-stage > canvas { width: 88px; position: absolute; bottom: 0; left: 0; }
.work-bench { width: 62px; height: 42px; position: absolute; left: 89px; bottom: 2px; background: #5c666b; clip-path: polygon(0 14%, 99% 14%, 91% 38%, 64% 43%, 59% 60%, 70% 78%, 86% 80%, 90% 100%, 21% 100%, 24% 82%, 41% 79%, 45% 58%, 39% 45%, 18% 40%); }
.work-bench::before { content: ""; position: absolute; inset: 0 0 auto; height: 15px; background: #929fa1; }
.work-tool { width: 43px; height: 7px; border-radius: 3px; position: absolute; left: 55px; bottom: 49px; background: #8d6748; transform-origin: 4px center; animation: hammer 1.04s ease-in-out infinite; }
.work-tool::after { content: ""; position: absolute; right: -4px; top: -7px; width: 15px; height: 21px; border-radius: 3px; background: #56666f; border-top: 3px solid #929fa1; }
.work-spark { position: absolute; left: 100px; bottom: 41px; width: 7px; height: 7px; clip-path: polygon(50% 0, 66% 36%, 100% 50%, 68% 67%, 50% 100%, 34% 67%, 0 50%, 34% 36%); background: #ffe48b; animation: ore-chip 1.04s ease-out infinite; }
.work-spark.one { --chip-x: 12px; --chip-y: -22px; --chip-end: 25px; --spin: 150deg; }
.work-spark.two { --chip-x: -15px; --chip-y: -22px; --chip-end: -27px; --spin: -100deg; }
.work-spark.three { --chip-x: 24px; --chip-y: -10px; --chip-end: 32px; --spin: 140deg; }
@keyframes hammer { 0%, 19%, 100% { transform: rotate(-66deg); } 45% { transform: rotate(17deg); } 56% { transform: rotate(-9deg); } 73% { transform: rotate(-60deg); } }
.work-loom .work-bench { height: 57px; width: 51px; bottom: 7px; clip-path: none; border: 6px solid #886043; border-radius: 5px; background: repeating-linear-gradient(90deg, #dfc49a 0 4px, #a98b6a 4px 5px); }
.work-loom .work-bench::before { height: 20px; top: 18px; background: #a1b9ab; }
.work-loom .work-tool { left: 77px; bottom: 35px; width: 21px; height: 6px; animation: shuttle 1.25s ease-in-out infinite; background: #754d37; }
.work-loom .work-tool::after, .work-loom .work-spark { display: none; }
@keyframes shuttle { 50% { transform: translateX(42px); } }
.work-sawmill .work-bench { height: 32px; width: 58px; left: 86px; bottom: 5px; clip-path: polygon(0 24%, 86% 0, 100% 36%, 93% 78%, 16% 100%, 0 71%); background: #a96c42; }
.work-sawmill .work-bench::before { height: 13px; background: #d3a16d; }
.work-sawmill .work-tool { left: 64px; bottom: 32px; width: 38px; height: 9px; background: #72848a; clip-path: polygon(0 0, 100% 0, 100% 80%, 87% 100%, 75% 80%, 63% 100%, 50% 80%, 38% 100%, 25% 80%, 13% 100%, 0 80%); animation: saw 0.84s ease-in-out infinite; }
.work-sawmill .work-spark { background: #e9b57b; }
@keyframes saw { 50% { transform: translateX(21px) rotate(12deg); } }
.session-banner { background: #f1e5c4; border: 1px solid #d9c79d; border-radius: 10px; color: #654d2c; padding: 10px; margin-bottom: 14px; font-size: .86rem; }
.panel { position: fixed; width: min(555px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #cfd7bf; border-radius: 17px; background: var(--panel); color: var(--ink); box-shadow: 0 22px 75px #23382b50; overflow: auto; }
.panel::backdrop { background: #24372fc7; backdrop-filter: blur(4px); }
.panel[open] { animation: enter .17s ease-out; }
@keyframes enter { from { opacity: .65; } to { opacity: 1; } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px 13px; gap: 10px; border-bottom: 1px solid var(--line); background: #f0f2e5; }
.dialog-head h2 { font-size: 1.6rem; line-height: 1.12; }
.dialog-head small { font-size: .75rem; font-weight: 700; display: block; margin-bottom: 2px; }
.dialog-head .close { width: 36px; height: 36px; padding: 0; min-height: 0; font-size: 1.55rem; font-weight: 500; }
.dialog-body { padding: 16px 17px 18px; }
.core-usage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.core-usage > div > div { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 6px; font-size: .8rem; }
.core-wallet { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; border-radius: 8px; padding: 10px; background: #f5ebd0; color: #69502f; font-size: .86rem; }
.core-wallet .coin-icon { margin-right: 4px; }
.stock-list { margin-top: 5px; }
.quest-detail > p, .record-body > p { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.quest-total { margin-bottom: 8px; font-size: .86rem; }
.quest-total span { color: #886432; font-weight: 750; }
.hand-in { display: flex; align-items: end; gap: 9px; margin-top: 15px; }
.hand-in input { width: min(130px, 100%); }
.success-message { margin-top: 14px; padding: 9px; border-radius: 9px; background: #e5efdc; color: #426846; }
.full-log { min-height: 120px; }
.summary-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.summary-stats > div { border-radius: 11px; padding: 10px; background: var(--sage); }
.summary-stats > .blue { background: var(--blue); }
.summary-stats > .amber { background: var(--amber); }
.summary-stats > .violet { background: var(--violet); }
.summary-stats dt { font-size: .78rem; font-weight: 700; color: var(--muted); }
.summary-stats dd { margin: 2px 0 0; font: 750 clamp(1.16rem, 4vw, 1.65rem) "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -.03em; }
.summary-materials { font-size: 1.04rem; }
.summary-breakdown { display: grid; gap: 7px; }
.summary-breakdown:empty { display: none; }
.report-character > .summary-stats { margin-block: 10px; }
.report-character > .button { margin-top: 8px; }
.roll-table { border-collapse: collapse; width: 100%; margin-block: 10px; font-size: .81rem; text-align: left; }
.roll-table td, .roll-table th { padding: 7px 5px; border-bottom: 1px solid #e2e8d9; }
.roll-table th { color: var(--muted); }
.roll-table .pass { color: #3d724e; font-weight: 750; }
.roll-table .miss { color: #a04d40; font-weight: 750; }
.panel-routes { width: min(870px, calc(100vw - 24px)); }
.panel-edit { width: min(760px, calc(100vw - 24px)); }
.editor-tabs { padding-inline: 12px; }
.edit-form { display: grid; gap: 12px; }
.edit-form [data-quest-part][hidden] { display: none; }
.hunt-editor-checks, .hunt-checks { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hunt-editor-checks { margin-top: 10px; }
.hunt-editor-checks > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(40px, .42fr); gap: 5px; }
.hunt-checks { padding: 0; list-style: none; margin: 8px 0; }
.hunt-checks li { display: grid; gap: 3px; padding: 8px; border-radius: 8px; background: var(--violet); font-size: .85rem; overflow-wrap: anywhere; }
.hunt-detail { margin-bottom: 12px; }
.quest-detail > .event-time { font-size: .82rem; margin: 9px 0; }
@media (max-width: 570px) { .hunt-editor-checks { grid-template-columns: 1fr; } }
.edit-form > .button { justify-self: start; }
fieldset { min-width: 0; margin: 0; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #f9f9ef; }
fieldset > .button { margin-top: 9px; }
legend { padding-inline: 4px; font-size: .87rem; font-weight: 750; }
.edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.checkbox { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.checkbox input { width: auto; min-height: 0; accent-color: var(--forest); }
.editor-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.route-materials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 11px; margin-top: 8px; }
.route-materials > div { display: grid; grid-template-columns: minmax(0, 1fr) 63px; gap: 6px; align-items: end; background: #f1f3e7; border-radius: 8px; padding: 6px; }
.route-materials .checkbox { align-self: center; margin-top: 0; }
.reset-tools .button.danger { color: #94493d; border-color: #deb8ad; }
.panel-travel { width: min(790px, calc(100vw - 20px)); }
.travel-scene { aspect-ratio: 2; overflow: hidden; background: #acc8ae; position: relative; }
.travel-position { position: absolute; transform: translate(-50%, -94%); }
.travel-echo { display: block; position: relative; width: clamp(54px, 9.5vw, 97px); transform-origin: center bottom; }
.walking .travel-position { transition: left .21s linear, top .21s linear; }
.walking .travel-position::before { content: ""; position: absolute; left: 16%; right: 16%; top: 92%; height: 8%; border-radius: 50%; background: #253b3328; }
.walking .travel-echo { animation: walk .58s infinite ease-in-out; }
@keyframes walk { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.mining .travel-echo > canvas { animation: walk 1.15s infinite ease-in-out; }
.gathering .travel-echo > canvas { animation: walk 1.35s infinite ease-in-out; }
.gather-material { position: absolute; left: 72%; bottom: 3%; }
.travel-echo > .pickaxe { display: none; width: clamp(28px, 4.8vw, 54px); height: 7px; border-radius: 3px; background: #856c50; position: absolute; left: 66%; bottom: 35%; transform-origin: 3px center; }
.travel-echo > .pickaxe::before { content: ""; position: absolute; right: -3px; top: -14px; width: 11px; height: 33px; background: #6d7d78; border-radius: 2px 5px 5px 2px; clip-path: polygon(0 0, 90% 21%, 100% 46%, 85% 80%, 12% 100%, 35% 50%); }
.mining .travel-echo > .pickaxe { display: block; animation: pick 1.15s infinite ease-in-out; }
@keyframes pick { 0%, 20%, 100% { transform: rotate(-72deg); } 44% { transform: rotate(19deg); } 58% { transform: rotate(-13deg); } 74% { transform: rotate(-68deg); } }
.mining-target { position: absolute; left: calc(66% + clamp(15px, 3.4vw, 37px)); bottom: 14%; width: clamp(34px, 5.7vw, 64px); height: clamp(25px, 4.6vw, 44px); --vein: #e7a36d; --chip: #eac097; }
.mining-target.silver { --vein: #c6dbe2; --chip: #e0edf0; }
.mining-target.gold { --vein: #f7cd60; --chip: #ffdc8a; }
.mine-rock { position: absolute; inset: 0; background: #798880; clip-path: polygon(0 76%, 13% 35%, 36% 9%, 71% 4%, 94% 45%, 100% 83%, 78% 100%, 25% 98%); animation: rock-hit 1.15s infinite ease-in-out; }
.mine-rock::before, .mine-rock::after { content: ""; position: absolute; inset: 0; }
.mine-rock::before { background: #a5b29a; clip-path: polygon(0 76%, 13% 35%, 36% 9%, 71% 4%, 83% 35%, 48% 50%, 23% 88%); }
.mine-rock::after { background: var(--vein); clip-path: polygon(22% 60%, 39% 37%, 49% 44%, 46% 53%, 54% 59%, 42% 69%, 35% 61%, 31% 73%); }
.mine-chip { position: absolute; left: 22%; top: 35%; width: 7px; height: 6px; opacity: 0; background: var(--chip); clip-path: polygon(18% 14%, 89% 0, 100% 61%, 57% 100%, 0 77%); animation: ore-chip 1.15s infinite ease-out; }
.chip-one { --chip-x: -12px; --chip-y: -27px; --chip-end: -27px; --spin: -115deg; }
.chip-two { --chip-x: 16px; --chip-y: -30px; --chip-end: 29px; --spin: 130deg; }
.chip-three { --chip-x: 29px; --chip-y: -13px; --chip-end: 39px; --spin: 175deg; width: 6px; height: 5px; }
.chip-four { --chip-x: -24px; --chip-y: -10px; --chip-end: -34px; --spin: -140deg; width: 5px; height: 5px; }
@keyframes rock-hit { 0%, 42%, 55%, 100% { transform: translateX(0); } 46% { transform: translateX(2px); } 50% { transform: translateX(-1px); } }
@keyframes ore-chip {
  0%, 42% { opacity: 0; transform: translate(0, 0); }
  45% { opacity: 1; transform: translate(0, 0); }
  68% { opacity: 1; transform: translate(var(--chip-x), var(--chip-y)) rotate(var(--spin)); }
  96%, 100% { opacity: 0; transform: translate(var(--chip-end), 14px) rotate(var(--spin)); }
}
.timer-block { text-align: center; margin-block: 3px 11px; }
.timer-value { display: block; font-size: clamp(2rem, 6vw, 3.05rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.16; letter-spacing: -.04em; }
.timer-meter { height: 8px; margin-top: 8px; }
.timer-speed { display: inline-block; color: var(--muted); font-size: .75rem; margin-top: 6px; }
.travel-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.travel-instruction { font-size: .9rem; color: var(--muted); }
.deposits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.deposit-card { display: grid; gap: 5px; justify-items: start; border: 1px solid #dbe3cf; background: #f2f5e9; border-radius: 10px; padding: 9px; min-width: 0; }
.deposit-card.unfound { background: #f7f6ee; border-color: #e6e7da; }
.deposit-card.unfound .item-icon { opacity: .58; }
.deposit-card strong { font-size: .91rem; }
.deposit-card small { font-size: .71rem; }
.deposit-card .button { margin-top: 2px; }
.trip-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.trip-footer > div { display: flex; gap: 7px; }
.trip-footer small { font-size: .76rem; }
.panel-penalty { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; background: #242b3b; color: #f2e9ef; }
.penalty-body { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; padding: 22px; }
.penalty-mark { font-size: 3.7rem; color: #d5a5a9; }
.penalty-body h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.penalty-body small, .penalty-body p, .penalty-body .timer-speed { color: #ded1df; }
.penalty-body .timer-block { width: min(390px, 95%); }
.penalty-body .button { color: var(--ink); }
.penalty-body .meter { background: #514d5c; }
.penalty-body .meter i { background: #cc8e98; }
#toast { position: fixed; z-index: 20; left: 50%; bottom: 18px; transform: translate(-50%, 10px); width: max-content; max-width: calc(100vw - 24px); border-radius: 9px; padding: 9px 13px; background: #315447; color: #fffef4; box-shadow: 0 6px 20px #192e2850; font-size: .83rem; font-weight: 650; opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind="error"] { background: #8d453c; }
@media (max-width: 1060px) {
  .shell { width: calc(100% - 36px); }
  .dashboard { grid-template-columns: minmax(225px, .83fr) minmax(0, 2fr); gap: 13px; }
  .guild-board, .sidebar { gap: 13px; }
  .section-head { padding-inline: 12px; }
  .echo-profile { gap: 8px; }
  .portrait { width: 70px; height: 77px; border-radius: 20px 20px 13px 13px; }
  .portrait canvas { width: 60px; }
}
@media (max-width: 820px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { order: 2; grid-template-columns: 1fr 1fr; align-items: start; }
  .village-art { height: 170px; }
  .guild-board { grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); }
}
@media (max-width: 590px) {
  .shell { width: calc(100% - 22px); }
  .header-inner { grid-template-columns: 1fr auto; gap: 7px; padding-block: 8px; min-height: 0; }
  .wordmark { font-size: 1.19rem; gap: 6px; }
  .guild-mark { width: 32px; height: 32px; }
  .header-actions { gap: 2px; }
  .header-actions .button { min-height: 32px; padding: 5px 7px; font-size: .73rem; gap: 4px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .main-nav button { flex: 1; padding-block: 6px; }
  .main-shell { padding-block: 20px 28px; }
  .page-head { display: grid; gap: 9px; margin-bottom: 13px; }
  .page-actions { justify-content: start; gap: 6px; }
  .page-head h1 { font-size: 2.45rem; }
  .dashboard, .guild-board, .sidebar { gap: 10px; }
  .guild-board, .sidebar { grid-template-columns: 1fr; }
  .gathering-card { order: -1; }
  .quest-card { min-height: auto; }
  .special-empty { min-height: 112px; }
  .log-card { min-height: 0; }
  .log-empty { min-height: 92px; }
  .village-art { height: 174px; }
  .station-body { padding: 12px; }
  .station-tabs button { padding-inline: 9px; font-size: .79rem; }
  .shop-row { flex-wrap: wrap; gap: 6px; }
  .shop-row input { width: 56px; }
  .shop-row .button { padding-inline: 7px; }
  .shop-row .item-icon { width: 30px; height: 30px; }
  .station-form, .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .station-submit { grid-column: 1 / -1; }
  .refine-form > .primary { margin-left: 0; }
  .dialog-body, .dialog-head { padding-inline: 12px; }
  .trip-footer { align-items: start; flex-direction: column; }
  .trip-footer > div { flex-wrap: wrap; }
  .deposits { gap: 5px; }
  .deposit-card { padding: 7px 5px; }
  .deposit-card .button { padding-inline: 6px; }
  .core-usage { grid-template-columns: 1fr; gap: 8px; }
  .roll-table { font-size: .73rem; }
  .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-materials { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


.scene-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.village-art { position: relative; height: auto; aspect-ratio: 2; }
.village-echo { position: absolute; left: 33.25%; top: 87.67%; width: 9.075%; transform: translate(-50%, -94%); }
.phase-label { color: var(--muted); font-weight: 550; }
.phase-label::before { content: "·"; padding-inline: 2px 6px; }
.section-mark.craft { background: var(--violet); color: #736385; }
.item-icon .tool { clip-path: polygon(0 24%, 30% 12%, 60% 17%, 92% 34%, 100% 54%, 62% 34%, 41% 95%, 21% 89%, 45% 29%, 20% 28%); }
.item-icon .shield { clip-path: polygon(8% 15%, 50% 0, 92% 15%, 87% 62%, 69% 86%, 50% 100%, 29% 86%, 13% 62%); }
.craft-recipe { display: grid; gap: 9px; margin-block: 10px 14px; }
.craft-ingredients { display: flex; flex-wrap: wrap; gap: 8px; }
.craft-ingredients > div, .craft-output { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 8px; }
.craft-ingredients > div { background: var(--panel); flex: 1 1 142px; }
.craft-ingredients span, .craft-output span { display: grid; gap: 2px; }
.craft-ingredients strong, .craft-output strong { font-size: .85rem; }
.craft-ingredients small, .craft-output small { font-size: .76rem; }
.craft-output { background: var(--amber); }
.work-craft .work-bench { width: 72px; height: 36px; background: #8a5b3e; clip-path: polygon(0 7%, 100% 7%, 100% 35%, 88% 35%, 88% 100%, 75% 100%, 75% 35%, 23% 35%, 23% 100%, 10% 100%, 10% 35%, 0 35%); }
.work-craft .work-bench::before { background: #c79562; height: 11px; }
.work-craft .work-spark { background: #e9bb88; }
.editor-toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: end; }
.editor-toolbar > label { flex: 1 1 180px; }
.editor-toolbar > h3 { flex: 1; align-self: center; }
.editor-toolbar > .button { flex: none; }
.editor-toolbar input, .editor-toolbar select { min-width: 0; }
.edit-form .button.danger { color: var(--red); }
.lighting-times { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.art-slots { display: grid; gap: 9px; }
.art-slots.route-art-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.art-preview { position: relative; aspect-ratio: 2; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; margin: 2px 0 9px; }
.art-preview .travel-echo { width: clamp(36px, 6vw, 64px); }
.art-upload { display: grid; gap: 5px; }
.art-upload input[type="file"] { padding-block: 5px; }
.art-upload input::file-selector-button { font: inherit; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; margin-inline-end: 7px; }
a.button { text-decoration: none; color: inherit; }
a.button:focus-visible { outline: 3px solid #528f8e; outline-offset: 3px; }
.ingredient-editor { display: grid; grid-template-columns: minmax(0, 2fr) minmax(64px, 1fr); gap: 8px; }
.panel-admin, .panel-session { width: min(740px, calc(100vw - 24px)); }
.admin-body { display: grid; gap: 12px; }
.admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.admin-stats dd { font-size: clamp(1rem, 3vw, 1.35rem); overflow-wrap: anywhere; }
.admin-body .form-hint, .admin-body .bank-balances { margin: 0; }
.admin-body .editor-toolbar > h3 + label { flex: 0 1 175px; }
.admin-materials { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: .86rem; }
.admin-materials summary { cursor: pointer; font-weight: 700; }
.admin-log { max-height: 42dvh; overflow: auto; }
.admin-add { padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 590px) {
  .art-slots.route-art-slots, .admin-stats, .lighting-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .art-slots.route-art-slots { grid-template-columns: 1fr; }
}

.portrait img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.portrait [hidden] { display: none; }
.portrait-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; }
.portrait-upload .art-upload { min-width: 0; flex: 1 1 240px; }
.special-editor-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--violet); }
.special-editor-status p { margin-top: 4px; font-size: .85rem; }
.treasure-rows { display: grid; gap: 7px; }
.treasure-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(116px, .74fr) auto; align-items: end; gap: 8px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.treasure-row.find-row { grid-template-columns: minmax(0, 1fr) minmax(110px, .55fr) auto; }
.treasure-row:last-child { border-bottom: 0; }
.treasure-rows:not(:empty) + .treasure-empty { display: none; }
.deposit-card .treasure-found { color: var(--warm-ink, #795133); font-weight: 750; }
.editor-confirm > p { font-size: .95rem; color: var(--muted); margin-bottom: 17px; }
.editor-confirm .editor-buttons { justify-content: end; }
.button.danger-primary { color: #fff8f0; background: #983f36; border-color: #86362f; }
.button.danger-primary:hover { background: #ac4a3e; }

.dice-reveal {
  position: fixed;
  z-index: 21;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(332px, calc(100vw - 32px));
  padding: 9px 11px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 38px #17262b36;
  animation: dice-pop .2s ease-out;
}
.dice-reveal[hidden] { display: none; }
.panel .dice-reveal { top: max(16px, env(safe-area-inset-top)); bottom: auto; }
.dice-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .89rem; }
.dice-dismiss.button { min-height: 29px; width: 29px; padding: 0; font-size: 1.22rem; font-weight: 500; }
.dice-wait, .dice-rolls li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.dice-wait { min-height: 56px; color: var(--muted); font-size: .85rem; }
.dice-rolls { display: grid; gap: 3px; list-style: none; margin: 3px 0 0; padding: 0; max-height: min(210px, 42dvh); overflow: auto; }
.dice-rolls li + li { border-top: 1px solid var(--line); }
.die-face { display: grid; place-items: center; width: 46px; height: 48px; flex: none; clip-path: polygon(50% 0, 96% 26%, 96% 74%, 50% 100%, 4% 74%, 4% 26%); background: linear-gradient(143deg, #4a8b74 12%, #2d614f 64%); color: #fffdf2; font: 800 1.35rem "Bricolage Grotesque", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.die-face.natural { background: linear-gradient(143deg, #ffe6a8 9%, #daa651 68%); color: #543818; }
.die-rolling { animation: dice-tumble .32s ease-in-out infinite alternate; }
.dice-copy { display: grid; gap: 1px; min-width: 0; }
.dice-copy strong { font-variant-numeric: tabular-nums; font-size: 1.04rem; line-height: 1.16; }
.dice-copy small { font-size: .73rem; }
.dice-copy .dice-pass { color: var(--accent, var(--forest-dark)); }
.dice-copy .dice-miss { color: var(--red); }
.dice-note { margin-top: 5px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.dice-note.dice-treasure { color: var(--warm-ink, #795133); font-weight: 750; }
@keyframes dice-pop { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dice-tumble { from { transform: rotate(-18deg) scale(.92); } to { transform: rotate(19deg) scale(1.05); } }
@media (max-width: 610px) {
  .treasure-row, .treasure-row.find-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .treasure-row .button { justify-self: end; }
  .panel .dice-reveal { top: 55px; right: 12px; width: min(304px, calc(100vw - 24px)); }
}

.sheets-layout { display: grid; grid-template-columns: minmax(155px, .75fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.sheet-roster { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--panel); }
.sheet-roster-head, .sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.sheet-roster-head { margin-bottom: 7px; }
.sheet-roster-head h3 { font-size: .93rem; }
.sheet-heading h3 { margin: 1px 0 2px; font-size: 1.15rem; overflow-wrap: anywhere; }
.sheet-heading small { font-size: .74rem; }
.sheet-list { display: grid; gap: 4px; }
.sheet-row { display: flex; justify-content: space-between; align-items: center; gap: 5px; width: 100%; padding: 7px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: .81rem; text-align: start; }
.sheet-row:hover { background: var(--surface, #f2f3e8); }
.sheet-row.selected { background: var(--sage); border-color: var(--line); }
.sheet-row strong { overflow-wrap: anywhere; }
.sheet-row small { display: block; font-size: .71rem; }
.sheet-archive { margin-top: 9px; border-top: 1px solid var(--line); padding-top: 7px; }
.sheet-archive summary { cursor: pointer; font-size: .76rem; color: var(--muted); padding: 3px 2px 5px; }
.sheet-editor .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-editor .editor-buttons { margin-top: 0; }
.sheet-editor .portrait-upload .art-upload { flex-basis: 160px; }
.penalty-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.penalty-rules .checkbox { font-weight: 600; }
.backup-list { display: grid; gap: 5px; padding: 0; margin: 8px 0 0; list-style: none; }
.backup-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 5px; border-top: 1px solid var(--line); }
.backup-list time { font-size: .79rem; color: var(--muted); }
.item-look-preview { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: .9rem; }
.item-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 5px; }
.item-choice { display: block; position: relative; cursor: pointer; }
.item-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.item-choice-tile { display: grid; justify-items: center; align-content: start; gap: 4px; height: 100%; min-height: 55px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); text-align: center; font-size: .69rem; line-height: 1.15; }
.item-choice-tile .item-icon { width: 31px; height: 31px; border-radius: 7px; }
.item-choice input:checked + .item-choice-tile { border-color: var(--forest); background: var(--sage); box-shadow: inset 0 0 0 1px var(--forest); }
.item-choice input:focus-visible + .item-choice-tile { outline: 2px solid var(--forest-dark); outline-offset: 1px; }
.item-choice:hover .item-choice-tile { border-color: var(--forest); }
@media (max-width: 590px) {
  .sheets-layout { grid-template-columns: 1fr; }
  .sheet-list { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
}
@media (max-width: 420px) {
  .penalty-rules { grid-template-columns: 1fr; }
}
