:root {
  color-scheme: light;
  --ink: #252a24;
  --muted: #5e6257;
  --red: #8a372d;
  --red-dark: #69271f;
  --green: #2f5140;
  --line: #c9bfad;
  --line-light: #ded5c4;
  --desk: #eee8da;
  --paper: #fffaf0;
  --field: #fffdf7;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --shadow: 0 2px 3px #513d2520, 0 12px 27px #41362213;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 1rem/1.55 var(--sans);
  background-color: var(--desk);
  background-image: radial-gradient(ellipse at 21% 0, #fffbf147, transparent 62%),
    repeating-linear-gradient(90deg, #735b2c06 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, #735b2c06 0 1px, transparent 1px 7px);
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
button:disabled { opacity: .52; cursor: wait; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
button, .button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); }
h1 { font-size: clamp(2.22rem, 4vw, 3.75rem); letter-spacing: .055em; line-height: 1.1; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.25rem); line-height: 1.18; }
h3 { font-size: 1rem; }
.masthead { background: #f7f2e7; border-bottom: 1px solid var(--line); }
body:is([data-view="room"],[data-view="editor"]) > .masthead { display: none; }
.mast-inner, .page, .page-foot { width: min(1168px, calc(100% - 52px)); margin-inline: auto; }
.mast-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; text-decoration: none; letter-spacing: .07em; white-space: nowrap; }
.brand small { display: block; color: var(--muted); letter-spacing: .095em; font: 650 .66rem/1.3 var(--mono); }
.brand-icon { flex: none; width: 42px; height: auto; }
.header-actions, #account, .button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.header-actions { justify-content: end; gap: 17px; }
.account-name { font-size: .88rem; color: var(--muted); }
.quiet-link, .link-button { color: var(--red-dark); font-weight: 650; text-underline-offset: 4px; font-size: .875rem; }
.link-button { background: none; border: 0; padding: 3px 0; text-decoration: underline; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 1px solid var(--line); padding: 7px 15px; background: var(--paper); font-weight: 650; font-size: .9rem; text-decoration: none; }
.button:hover { background: #f2e8d7; }
.button.primary { background: var(--red); border-color: var(--red); color: #fffdf7; }
.button.primary:hover { background: var(--red-dark); }
.button.small { min-height: 37px; padding: 5px 11px; }
.button.ghost { background: transparent; border-color: transparent; }
.button.ghost:hover { background: #e4dbc9; }
.page { min-height: calc(100vh - 132px); padding: 39px 0 51px; }
.page-foot { border-top: 1px solid var(--line); min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .77rem; color: var(--muted); }
.eyebrow { font: 700 .75rem/1.35 var(--mono); letter-spacing: .15em; color: var(--red); display: block; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: center; min-height: 171px; padding: 1px 0 31px; }
.hero h1 { margin: 7px 0 12px; }
.hero p, .muted { color: var(--muted); }
.hero-aside { position: relative; justify-self: end; width: min(310px, 100%); filter: drop-shadow(0 6px 9px #453b2115); }
.hero-aside::before { content: ""; height: 2px; background: #9b4a3c; position: absolute; width: calc(100% + 64px); top: 38%; right: 12px; transform: rotate(-10deg); transform-origin: right; box-shadow: 0 2px 2px #4e2e2020; }
.hero-note { position: relative; transform: rotate(-2deg); background: #fffaf0; border: 1px solid #d4c5aa; box-shadow: var(--shadow); padding: 15px 20px 15px 28px; }
.hero-note::before, .pin::before { content: ""; border-radius: 50%; width: 11px; height: 11px; position: absolute; background: radial-gradient(circle at 35% 30%, #c88371, #85382d 67%, #57291e); box-shadow: 0 2px 3px #49251a65; }
.hero-note::before { top: 9px; left: 9px; }
.hero-note strong { color: var(--red-dark); display: block; margin-bottom: 1px; }
.hero-note p { font-size: .875rem; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; border-top: 1px solid var(--line); padding-top: 19px; margin-bottom: 16px; }
.section-head h2 { font-size: 1.77rem; }
.counter, .code { font: 650 .8rem/1.3 var(--mono); color: var(--muted); letter-spacing: .045em; white-space: nowrap; }
.slots { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 17px; }
.warehouse-head { flex-wrap: wrap; }
.warehouse-head .button-row { justify-content: flex-end; }
.slot-cell { display: grid; position: relative; min-width: 0; }
.slot-actions {
  position: absolute; z-index: 3; display: flex; gap: 4px;
  top: clamp(6px,2vw,17px); right: clamp(6px,2vw,17px);
}
.slot-actions .button { min-width: 44px; min-height: 44px; padding: 4px 7px; font-size: .86rem; white-space: nowrap; }
.slot { display: block; text-align: left; width: 100%; background: var(--paper); padding: 9px; border: 1px solid var(--line); text-decoration: none; position: relative; box-shadow: var(--shadow); min-width: 0; transition: transform .2s ease, border-color .2s ease; }
.slot:is(a,button):hover { border-color: var(--red); transform: translateY(-3px); }
.slot-media { height: clamp(111px, 16vw, 190px); position: relative; background: #e7e4db; border: 1px solid #cecbbf; display: grid; place-items: center; overflow: hidden; }
.slot-media::before { content: ""; position: absolute; inset: 7px; border: 1px solid #fcf9efae; pointer-events: none; z-index: 1; }
.slot-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.silhouette { display: block; position: relative; flex: 0 0 auto; width: 80px; height: 80px; color: #abaea5; }
.silhouette::before { content:""; position: absolute; width: 34%; height: 34%; top: 14%; left: 33%; border-radius: 50%; background: currentColor; }
.silhouette::after { content:""; position: absolute; width: 72%; height: 37%; top: 53%; left: 14%; border-radius: 52% 52% 12% 12%; background: currentColor; }
.plus { position: absolute; display: grid; place-items: center; left: calc(50% + 22px); top: calc(50% + 13px); width: 27px; height: 27px; border-radius: 50%; background: var(--paper); color: var(--red); border: 1px solid #c0b0a0; font: 700 1.18rem/1 var(--sans); z-index: 2; }
.slot-caption { min-height: 57px; display: flex; flex-direction: column; justify-content: center; padding: 6px 5px 3px; }
.slot-caption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.blank .slot-caption { color: #52584e; }
.slot.blank:hover .slot-caption { color: var(--red-dark); }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.wizard-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 11px; }
.wizard-title h1 { font-size: clamp(2rem,3.6vw,2.95rem); }
.wizard-layout { max-width: 970px; margin-inline: auto; }
.trail { list-style: none; position: relative; padding: 0 0 5px; margin: 0 0 24px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 18px; }
.trail::before { content:""; position: absolute; top: 48%; left: 5%; right: 5%; height: 2px; background: #984b3c; box-shadow: 0 2px 2px #452f263b; transform: rotate(.5deg); }
.trail li { position: relative; min-width: 0; }
.trail li:nth-child(even) { transform: translateY(4px) rotate(-1deg); }
.trail li:nth-child(odd) { transform: rotate(1deg); }
.trail-card { min-height: 55px; width: 100%; padding: 11px 9px 8px; position: relative; background: #fbf4e7; border: 1px solid var(--line); box-shadow: 0 2px 4px #4c302118; font-size: .88rem; font-weight: 700; }
.pin::before { top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; }
.trail-card[aria-current=step] { color: #fffdf7; background: var(--red); border-color: var(--red-dark); }
.trail-card:disabled { cursor: default; opacity: .75; }
.paper { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.step-head { margin-bottom: 25px; }
.step-head p { color: var(--muted); }
.grid { display: grid; gap: 15px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.identity-module { display:grid; align-content:start; gap:10px; min-width:0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .88rem; font-weight: 680; }
.field small { font-size: .83rem; color: var(--muted); }
input:not([type=checkbox],[type=radio]), select, textarea {
  width: 100%; min-height: 43px; padding: 7px 10px; color: var(--ink); background: var(--field);
  border: 1px solid #bdb3a0; border-radius: 2px; min-width: 0;
}
input[type=checkbox], input[type=radio] { accent-color: var(--red); }
input:disabled, select:disabled { background: #eae4d6; }
textarea { resize: vertical; min-height: 72px; }
select { appearance: none; padding-right: 31px; background: linear-gradient(45deg,transparent 50%,var(--muted) 50%) calc(100% - 15px) 53% / 5px 5px no-repeat, linear-gradient(135deg,var(--muted) 50%,transparent 50%) calc(100% - 10px) 53% / 5px 5px no-repeat, var(--field); }
.subsection { margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line-light); }
.subsection h3 { margin-bottom: 10px; }
.portrait-box { aspect-ratio: 4/5; display: grid; place-items: center; overflow: hidden; background: #e8e5dc; border: 1px solid var(--line); }
.portrait-box img { width: 100%; height: 100%; object-fit: cover; }
.portrait-picker { align-self:start; width:min(100%,clamp(108px,30vw,150px)); display:grid; gap:8px; }
.portrait-picker .portrait-box { width:100%; padding:0; cursor:pointer; aspect-ratio:1; grid-template:minmax(0,1fr) / minmax(0,1fr); }
.portrait-picker .portrait-box:focus-visible { outline:2px solid #c59759; outline-offset:2px; }
.portrait-picker .portrait-box .silhouette { width: min(80px,100%); height: auto; aspect-ratio: 1; }
.portrait-picker .portrait-box img { min-width: 0; min-height: 0; }
.split { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.hint { color: var(--muted); font-size: .875rem; }
.hint.ok { color: var(--green); }
.hint.bad, .error { color: #902e26; }
.error { padding: 8px 0; font-weight: 650; overflow-wrap: anywhere; }
.inline-check { display: flex; min-height: 41px; align-items: center; gap: 8px; }
.inset { background: #f1eee0; border: 1px solid #d6cab0; padding: 10px 13px; margin-top: 12px; }
.chip, .tag { background: #e9e5d4; color: #3b4b40; padding: 3px 8px; font-size: .78rem; }
.chip + .chip { margin-left: 4px; }
.step-actions { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line-light); margin-top: 23px; padding-top: 17px; }
.roll-grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 9px; }
.attribute-toolbar, .attribute-heading, .attribute-actions { display: flex; align-items: center; gap: 8px; }
.attribute-toolbar { flex-wrap: wrap; justify-content: space-between; margin-bottom: 9px; }
.attribute-heading h3 { margin: 0; }
.attribute-heading { white-space: nowrap; }
.attribute-actions { margin-inline-start: auto; }
.attribute-actions [aria-pressed="true"] { box-shadow: inset 0 0 0 1px currentColor; }
.attribute-actions button:disabled,.luck-allocation button:disabled { cursor: default; }
.luck-allocation { display: grid; grid-template-columns: minmax(76px,100px) auto; align-items: end; justify-content: start; gap: 9px; margin-top: 12px; }
.luck-allocation [role=status] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:is(.roll-grid,.luck-allocation) input { text-align: center; padding: 5px; font: 700 1.13rem var(--mono); background: #f7f1df; }
.roll-grid input:read-only { background: #eae4d6; }
.luck-allocation .luck-score { height: 43px; }
.luck-score-winner { animation: luck-score-winner .62s ease-in-out; }
@keyframes luck-score-winner {
  45% { color: #fff; background: #843b35; font-size: 1.43rem; }
}
:is(.roll-grid,.luck-allocation) span small { color: var(--muted); font: .69rem var(--mono); }
#editor input[aria-invalid="true"] { border-color: var(--red-dark); }
.job-skill-picks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.job-choice { display: flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid var(--line-light); background: var(--field); font-size: .87rem; }
.skill-toolbar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 9px; }
.skill-toolbar h3 { margin-bottom: 4px; font-size: 1rem; }
.skill-toolbar .button { flex: none; white-space: nowrap; }
.skill-points { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0; }
.skill-points > div { display: flex; gap: 5px; align-items: baseline; }
.skill-points dt { color: var(--muted); font-size: .8rem; font-weight: 650; }
.skill-points dd { margin: 0; font: 750 1.35rem/1.1 var(--mono); color: var(--ink); }
.skill-points dd.over-budget { color: #902e26; }
.skill-points #skill-credit { font-size: 1.05rem; }
.skill-list {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line-light); scrollbar-color: #9c8866 #d8cbb0; scrollbar-width: thin;
}
.skill-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.skill-table th, .skill-table td { padding: 5px 9px; text-align: right; border-bottom: 1px solid var(--line-light); }
.skill-table th:first-child, .skill-table td:first-child { text-align: left; }
.skill-table th { position: sticky; top: 0; z-index: 1; font-size: .8rem; color: var(--muted); background: #efe8d7; }
.skill-table tr:nth-child(even) { background: #f7f1e5; }
.skill-table input { max-width: 72px; min-height: 34px; padding: 3px 4px; text-align: right; font-size: .88rem; }
.skill-table small { display: inline-block; color: var(--red-dark); font-size: .7rem; margin-left: 4px; }
.skill-result { white-space: nowrap; }
.skill-result .skill-cap { color: var(--muted); margin-left: 0; }
.skill-over-limit .skill-total { color: var(--red-dark); font-weight: 750; }
@media (max-width: 700px), (pointer: coarse) {
  .skill-table input { appearance: textfield; font-size: 16px; }
  .skill-table input::-webkit-inner-spin-button { appearance: none; }
}
.item-row { border-bottom: 1px solid var(--line-light); padding: 11px 0; }
.item-row > .grid { grid-template-columns: minmax(0,1fr) 64px auto; align-items: end; }
.item-field { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 5px 0; }
.item-field > label { grid-column: 1 / -1; font-size: .84rem; font-weight: 680; }
.item-field > input { border-inline-end: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.item-field > .item-presets {
  padding-inline: 0;
  color: transparent;
  cursor: pointer;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  background-position: calc(50% - 2.5px) center, calc(50% + 2.5px) center;
}
.item-presets option { color: var(--ink); }
.item-field > :focus-visible { z-index: 1; }
.item-row .hint { padding-top: 4px; overflow-wrap: anywhere; }
.item-row .hint:empty { display: none; }
.archive-card { background: #fffaf0; border: 1px solid var(--line); padding: clamp(16px, 4vw, 30px); margin-top: 14px; }
.archive-head { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 14px; align-items: start; padding-bottom: 14px; border-bottom: 2px solid #858881; }
.archive-head h2 { margin: 3px 0 5px; font-size: clamp(1.69rem,4vw,2.48rem); overflow-wrap: anywhere; }
.archive-head .portrait-box { aspect-ratio: 1/1; border: 4px solid #f4ecd9; outline: 1px solid #827861; background: #ccc3ad; }
.identity-fields { display: flex; flex-wrap: wrap; gap: 3px 16px; margin: 4px 0 0; }
.identity-fields div { display: flex; align-items: baseline; gap: 6px; max-width: 100%; }
.identity-fields dt { color: var(--muted); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.identity-fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.archive-overview { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: start; gap: 14px; margin-top: 14px; }
.archive-attribute-column, .archive-skill-column { display: grid; min-width: 0; gap: 10px; }
.archive-section { min-width: 0; }
.archive-card > .archive-section { margin-top: 14px; }
.archive-band { display: flex; justify-content: space-between; gap: 5px; padding: 4px 8px; background: #535d66; color: #fff9ee; font-size: .9rem; letter-spacing: .04em; }
.archive-band small { color: #f0eee6; font-size: .7rem; font-weight: 500; white-space: nowrap; }
.archive-values { margin: 0; display: grid; border-left: 1px solid #9b947675; }
.archive-values > div { padding: 4px 6px 5px; min-width: 0; border: solid #9b947675; border-width: 0 1px 1px 0; background: #fff8e03a; }
.archive-values dt { color: #3c403c; font-size: .77rem; font-weight: 650; overflow-wrap: anywhere; }
.archive-values dt small { margin-left: 4px; font: 600 .66rem/1.2 var(--mono); color: #5c5d59; }
.archive-values dd { margin: 0; font: 700 1.02rem/1.25 var(--mono); color: #793a34; font-variant-numeric: tabular-nums; }
.archive-gauges { grid-template-columns: repeat(2,minmax(0,1fr)); }
.archive-gauges > div { padding: 6px 8px; background: #c7c9c04d; }
.archive-gauges dd strong { font-size: 1.27rem; }
.archive-limit { margin-left: 5px; color: #545751; font-size: .85rem; white-space: nowrap; }
.archive-characteristics, .archive-derived { grid-template-columns: repeat(3,minmax(0,1fr)); }
.archive-birth-data { padding: 7px 9px 4px; font-size: .87rem; }
.archive-skills { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 13px; }
.archive-skill-table th, .archive-skill-table td { position: static; font-size: .78rem; line-height: 1.33; padding: 4px 5px; white-space: nowrap; border-color: #b6ac90a1; }
.archive-skill-table thead th { background: #bec1ba64; color: #3b4143; }
.archive-skill-table tbody tr:nth-child(even) { background: #fff8e060; }
.archive-skill-table tbody th { background: transparent; color: var(--ink); font-weight: 550; white-space: normal; overflow-wrap: anywhere; }
.archive-skill-table td { color: #555a54; font-family: var(--mono); }
.archive-skill-table td:nth-child(2) { color: #793a34; font-weight: 700; }
.archives-notes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; padding: 6px 9px; }
.keeper-card-actions { margin-top: 14px; padding: 12px 16px; color: var(--ink); }
.keeper-card-actions h3 { margin-bottom: 7px; }
.keeper-card-actions details { margin-top: 7px; }
.keeper-card-actions textarea { margin-top: 4px; }
.archives-notes p, .inventory p, .preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.inventory > div { padding: 6px 0; border-bottom: 1px solid var(--line-light); }
.inventory p { font-size: .88rem; color: var(--muted); }
.toast { position: fixed; right: max(17px,calc((100vw - 1168px)/2)); bottom: 22px; z-index: 10; background: var(--ink); color: #fffaf0; padding: 10px 15px; max-width: min(425px,calc(100vw - 34px)); box-shadow: var(--shadow); }
.loading { padding: 32px 0; color: var(--muted); }
.kp-content { padding: clamp(15px,3vw,28px); }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.tabs a[aria-current=page] { background: var(--green); border-color: var(--green); color: white; }
.entry-list { display: grid; gap: 9px; }
.entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line-light); text-decoration: none; background: var(--field); overflow-wrap: anywhere; }
.entry:hover { border-color: var(--red); }
.entry-meta { color: var(--muted); font-size: .82rem; }
.entry .avatar-thumb { flex: 0 0 46px; height: 46px; }
.entry-body { min-width: 0; flex: 1; }
.manage-entry { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
.manage-entry .button.danger, .rule-actions .button.danger { color: var(--red-dark); border-color: var(--red); }
.rules-content .section-head { margin-bottom: 12px; }
.rule-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.rule-controls .field { flex: 1 1 160px; }
.rule-controls .counter { align-self: center; margin-inline: 4px; }
.rule-entry { width: 100%; text-align: start; }
.rule-entry .entry-meta { display: block; }
.rules-dialog { width: min(680px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 18px; }
.rules-dialog h2 { font-size: 1.5rem; }
.rules-dialog form { display: grid; gap: 12px; margin-top: 10px; }
.rule-skills { min-width: 0; border: 1px solid var(--line); margin: 0; padding: 6px 9px 9px; }
.rule-skills .job-skill-picks { max-height: 175px; overflow: auto; }
.module-form { margin-bottom: 19px; }
.module-form form { display: grid; gap: 12px; padding: 12px 0; }
#module-editor textarea[name="description"] { height: 144px; }
.invite-code, .invite-tail { font-family: var(--mono); letter-spacing: .035em; }
.invite-entry { display: flex; gap: 15px; justify-content: space-between; align-items: center; padding: 11px 14px; background: var(--field); border: 1px solid var(--line-light); }
.invite-status { color: var(--green); font-size: .85rem; overflow-wrap: anywhere; }
.invite-status.used { color: var(--muted); }
details > summary { cursor: pointer; font-weight: 650; }
@media (max-width: 830px) {
  .slots { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .roll-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (max-width: 580px) {
  .mast-inner, .page, .page-foot { width: calc(100% - 28px); }
  .mast-inner { min-height: 64px; gap: 8px; }
  .header-actions, #account { gap: 7px; }
  .header-actions .account-name { display: none; }
  .brand { font-size: .87rem; letter-spacing: .03em; gap: 7px; }
  .brand small { font-size: .54rem; }
  .brand-icon { width: 36px; }
  .quiet-link { font-size: .78rem; }
  .page { padding-top: 23px; }
  .hero { grid-template-columns: 1fr; gap: 14px; padding-bottom: 22px; }
  .hero-aside { justify-self: start; width: min(270px,100%); margin-left: 8px; }
  .hero-aside::before { display: none; }
  .hero-note { padding: 8px 13px 9px 26px; }
  .slots { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .slot { padding: 6px; }
  .trail { gap: 4px; margin-bottom: 15px; }
  .trail-card { padding: 10px 3px 6px; font-size: .72rem; min-height: 43px; }
  .grid.four, .grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .roll-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .archive-skills, .archives-notes, .archive-overview { grid-template-columns: 1fr; }
  .archive-head { grid-template-columns: 66px minmax(0,1fr); gap: 10px; }
  .archive-head .silhouette { width: 45px; height: 45px; }
  .skill-table td, .skill-table th { padding: 4px 3px; }
  .skill-table input { max-width: 49px; }
  .skill-table small { margin-left: 2px; }
  .skill-list .skill-table { table-layout: fixed; }
  .skill-list .skill-table th { white-space: nowrap; }
  .skill-list .skill-table th:first-child { width: 29%; }
  .skill-list .skill-table td:first-child { overflow-wrap: anywhere; }
  .skill-result { font-size: .84rem; }
  .skill-points { gap: 3px 9px; }
  .skill-points dd { font-size: 1.2rem; }
  .kp-content .grid.two { grid-template-columns: 1fr; }
  .rules-content .rule-controls .field { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
