@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@400;450;500;550;600;650;700&display=swap');

/* Parchment, walnut leather, candlelit brass. The data and interaction contracts
   are unchanged; visual assets are supplied separately by the app renderer. */
:root {
  color-scheme: light;
  --bg: #e6dcc8;
  --panel: #f3ead8;
  --panel2: #e6d6ba;
  --edge: #c4b293;
  --muted: #7c6b55;
  --text: #362b21;
  --gold: #98723e;
  --green: #936145;
  --rare: #7791a2;
  --uncommon: #b7985f;
  --epic: #ae8aaf;
  --legendary: #dcac56;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; color: inherit; background: none; border: 0; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #af7839; outline-offset: 4px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a27742; outline-offset: 1px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 500; }
svg { display: block; }
.app-shell { display: grid; grid-template-columns: 228px minmax(0,1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; min-height: 720px;
  display: flex; flex-direction: column; padding: 32px 20px 20px;
  color: #dfd0b7; border-right: 1px solid #574231;
  background:
    radial-gradient(ellipse at 12% 0, #6d4c3026, transparent 58%),
    repeating-linear-gradient(105deg, #fff1d502 0 1px, transparent 1px 5px),
    linear-gradient(130deg, #30251d, #211a15 72%);
  box-shadow: inset -4px 0 10px #0002;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 3px 36px; color: #e0c390; }
.brand svg { height: 40px; width: 34px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.4; }
.brand > span { font: 23px/1.02 var(--serif); letter-spacing: .1px; }
.brand small { display: block; font: 8px/1 var(--sans); letter-spacing: 2.7px; margin-top: 9px; color: #aa9474; }
.campaign-label { padding: 0 10px; margin-bottom: 12px; color: #a38a6b; font-size: 9px; letter-spacing: 1.8px; font-weight: 600; }
.campaign-card { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; min-width: 0; margin-bottom: 28px; padding: 0 7px; font-size: 12px; white-space: nowrap; }
.campaign-card > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.campaign-card small { display: block; color: #aa947b; font-size: 9px; margin-top: 3px; }
.campaign-mark { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 38px; border: 1px solid #866443; border-radius: 3px; background: linear-gradient(135deg,#69482d,#3f2e21); color: #e4c795; font: 22px var(--serif); box-shadow: inset 0 1px #d5b47a16; }
nav { display: flex; flex-direction: column; gap: 7px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid transparent; border-radius: 3px; color: #c2af94; font-size: 13px; }
nav a.active { color: #f4dfb8; background: linear-gradient(90deg,#6c4c2c88,#5b3f262b); border-color: #87623f77; box-shadow: inset 2px 0 #d3a364; }
nav a:hover, .sidebar-link:hover { color: #fff0d3; background-color: #ae804519; }
.nav-symbol { display: inline-flex; justify-content: center; width: 20px; font-size: 20px; line-height: 18px; color: #c7a679; }
.nav-number { margin-left: auto; padding: 1px 6px; border-radius: 3px; color: #dcc49b; background: #815d343d; font-size: 10px; }
.nav-dot { width: 5px; height: 5px; margin-left: auto; background: #c7a169; border-radius: 50%; }
.sidebar-rule { border-top: 1px solid #8f6c423a; margin: 26px 10px 23px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; color: #bba88d; font-size: 12px; border-radius: 3px; }
kbd { margin-left: auto; border: 1px solid #795c3e77; padding: 1px 5px; border-radius: 3px; color: #b8a07d; font: 9px var(--sans); }
.sidebar-bottom { margin-top: auto; padding-top: 28px; }
.edition-tag { display: flex; align-items: center; gap: 7px; padding-left: 10px; color: #cfb88e; font-size: 9px; letter-spacing: 1.1px; }
.edition-tag > span:first-child { width: 5px; height: 5px; background: #c99b5e; border-radius: 50%; }
.sidebar-bottom p { padding: 10px 10px 20px; color: #9f896e; font-size: 11px; line-height: 1.8; }
.account-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 18px 3px 15px; border-top: 1px solid #86603b55; text-align: left; font-size: 12px; }
.account-button small { display: block; margin-top: 3px; color: #ad9678; font-size: 10px; }
.account-button > span:last-child { margin-left: auto; color: #aa8c65; }
.avatar-mini { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border: 1px solid #927149; border-radius: 50%; background: #4d3826; color: #e0c591; font: 21px var(--serif); }
.babcock { display: block; text-align: center; color: #a58b67; font-size: 8px; letter-spacing: 1px; }
.workspace {
  min-width: 0;
  background:
    radial-gradient(ellipse at 43% 0, #fff6df80, transparent 64%),
    repeating-linear-gradient(7deg,#8e6d3e03 0 1px,transparent 1px 4px),
    #e7ddca;
}
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-bottom: 1px solid #b9a27d66; background: #d9c8a838; }
.breadcrumb { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #887258; font-size: 11px; }
.breadcrumb span { margin: 0 12px; color: #aa9270; }
.breadcrumb strong { font-weight: 500; color: #5f4933; }
.topbar-right { display: flex; flex-shrink: 0; align-items: center; gap: 18px; }
.save-status { display: flex; align-items: center; gap: 7px; color: #7a664b; font-size: 10px; }
.save-status i { width: 5px; height: 5px; background: #9e7544; border-radius: 50%; }
.save-status.error { color: #983e2d; }
.icon-button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid #ad926a; border-radius: 50%; color: #83623d; font-size: 12px; }
main { max-width: 1510px; margin: auto; padding: 29px 34px 35px; }
.character-banner { display: flex; align-items: center; gap: 17px; padding-bottom: 25px; border-bottom: 1px solid #b59c766e; }
.character-banner > div:nth-child(2) { min-width: 0; }
.character-portrait { flex-shrink: 0; position: relative; width: 70px; height: 70px; overflow: hidden; border: 2px solid #b08a56; border-radius: 50%; background: #3a2c21; box-shadow: 0 0 0 3px #f9f0dc,0 0 0 4px #b9a07b66; }
.character-portrait img { position: absolute; width: 280%; height: auto; max-width: none; left: -90%; top: -6%; object-fit: contain; transform: none; }
.character-name { font: 600 33px/1.1 var(--serif); letter-spacing: -.2px; color: #3c2c20; overflow-wrap: anywhere; }
.character-meta { margin-top: 8px; color: #7e6850; font-size: 11px; overflow-wrap: anywhere; }
.level-badge { margin-right: 7px; color: #906031; font-size: 10px; font-weight: 650; letter-spacing: .8px; }
.character-overview { display: flex; align-items: center; margin-left: auto; }
.overview-stat { padding: 0 19px; border-left: 1px solid #bfa9868a; min-width: 78px; }
.overview-stat:first-child { border-left: 0; }
.overview-stat > span { font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: #8e7455; }
.overview-stat strong { display: block; margin-top: 5px; font: 600 30px/1.2 var(--serif); color: #4e3524; white-space: nowrap; }
.overview-stat strong small { color: #947b5e; font: 12px var(--sans); }
.overview-stat.hp strong { color: #8d4534; }
.health-line { height: 3px; width: 95px; margin-top: 7px; background: #cfbda1; }
.health-line i { display: block; height: 100%; background: linear-gradient(90deg,#793e31,#b16847); }
.edit-profile { width: 31px; height: 31px; margin-left: 3px; border: 1px solid #b59a71; border-radius: 3px; color: #7a5b37; font-size: 16px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 28px 0 24px; }
.eyebrow { margin-bottom: 6px; color: #9b7140; font-size: 9px; font-weight: 650; letter-spacing: 2px; }
.page-heading h1 { color: #3c2d21; font: 600 38px/1.05 var(--serif); letter-spacing: -.5px; }
.page-heading p { margin-top: 8px; color: #887157; font-size: 12px; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 10px 16px; border-radius: 3px; font-size: 12px; transition: background .15s, border-color .15s, transform .15s; }
.primary-button { color: #fff0d5; background: linear-gradient(#91673d,#79502e); border: 1px solid #785130; box-shadow: inset 0 1px #f5d5a428,0 2px 3px #4c2f1710; font-weight: 600; }
.primary-button:hover { background: linear-gradient(#a77945,#896038); border-color: #9d713e; }
.secondary-button { color: #735332; background: #f1e5cd; border: 1px solid #baa07a; }
.secondary-button:hover { background: #e6d4b5; border-color: #9f794a; }
.primary-button .plus { font-size: 18px; line-height: 12px; }
.inventory-layout { display: grid; grid-template-columns: minmax(238px,.9fr) minmax(340px,1.25fr) minmax(225px,.83fr); align-items: start; gap: 18px; }
.panel { overflow: hidden; border: 1px solid #bba582; border-radius: 4px; background: #f2e8d5; box-shadow: 0 3px 10px #62421b09; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 16px; border-bottom: 1px solid #c3ae8c; background: #dcc6a53b; }
.panel-title h2 { color: #5a412b; font-size: 13px; font-weight: 600; letter-spacing: .1px; }
.panel-title .micro { color: #927552; font-size: 10px; white-space: nowrap; }
.panel-title .rune { margin-right: 7px; color: #a17945; }
.equipment-panel { background: #2a211a; border-color: #766043; color: #d7c0a0; }
.equipment-panel .panel-title { background: linear-gradient(#403022,#33271d); border-color: #755739; }
.equipment-panel .panel-title h2 { color: #e5cfaa; }
.equipment-panel .panel-title .micro { color: #b99b71; }
.paperdoll { height: 407px; position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 50% 32%,#8c5f3345,transparent 70%),#241c17; }
.paperdoll > img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center top; opacity: .96; }
.paperdoll::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#17100b80,transparent 24%,transparent 76%,#17100b80),linear-gradient(0deg,#21180dcc,transparent 18%,transparent 88%,#21180d22); }
.equipment-slots { display: grid; grid-template-columns: 54px 1fr 54px; grid-template-rows: repeat(4,64px); gap: 23px 0; padding: 26px 14px; }
.equipment-slot { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 6px; border: 1px solid #b088526e; border-radius: 3px; background: linear-gradient(145deg,#4c3824df,#211a14ed); box-shadow: 0 3px 6px #0005,inset 0 0 0 2px #0f0a0638; transition: border-color .15s, background .15s; }
.equipment-slot:hover, .equipment-slot.drop-ok { border-color: #e2b974; background: #5a402be8; }
.equipment-slot:nth-child(odd) { grid-column: 1; }
.equipment-slot:nth-child(even) { grid-column: 3; }
.equipment-slot .item-art { width: 42px; height: 48px; filter: drop-shadow(0 3px 2px #0009); }
.equipment-slot.empty { border-color: #9d7a4e66; background: #251d14b3; }
.equipment-slot.empty .item-art { opacity: .24; filter: sepia(.8) saturate(.25); }
.slot-label { position: absolute; bottom: -16px; color: #e1c8a1; font-size: 7px; font-weight: 550; letter-spacing: .9px; text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 3px #000; pointer-events: none; }
.equipment-foot { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 14px 10px; border-top: 1px solid #79593a6b; color: #c1a17c; font-size: 10px; }
.equipment-foot span { color: #ce9c57; }
.attunement-note { color: #9b7f5c; font-size: 10px; text-align: center; padding-top: 10px; }
.bag-panel { padding-bottom: 17px; background: linear-gradient(135deg,#33271f,#261f19); border-color: #7f6242; color-scheme: dark; }
.bag-panel .panel-title { background: linear-gradient(#493526,#37291f); border-color: #84614177; }
.bag-panel .panel-title h2 { color: #e9d5b2; }
.bag-panel .panel-title .micro { color: #c0a079; }
.bag-tools { display: flex; gap: 9px; padding: 15px 15px 13px; }
.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-wrap > span { position: absolute; top: 7px; left: 10px; color: #b19674; font-size: 17px; }
.search-wrap input { width: 100%; padding: 9px 10px 9px 30px; border-color: #80634470; background: #211a14; color: #ead7b8; font-size: 11px; }
.search-wrap input::placeholder { color: #b19776; }
.bag-tools select { min-width: 94px; width: 94px; padding: 7px 6px; background: #211a14; color: #d9c4a1; border-color: #80634470; font-size: 10px; }
.inventory-grid { position: relative; display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 3px; margin: 0 15px; isolation: isolate; aspect-ratio: 8/6; }
.grid-cell { grid-row: var(--y); grid-column: var(--x); min-width: 0; min-height: 0; padding: 0; border: 1px solid #6950385e; border-radius: 2px; background: radial-gradient(ellipse at 50% 0,#7652350b,transparent),#1d1712; box-shadow: inset 0 1px 4px #0003; transition: background .1s,border-color .1s; }
.grid-cell:hover { border-color: #b68b4e; background: #473421; }
.grid-cell.target-good { background: #98724166; border-color: #deb674; }
.grid-cell.target-bad { background: #913c356b; border-color: #c9806a; }
.grid-item { position: relative; z-index: 2; display: grid; place-items: center; grid-row: var(--y)/span var(--h); grid-column: var(--x)/span var(--w); min-width: 0; min-height: 0; overflow: hidden; padding: 4px; border: 1px solid #b38b4b88; border-radius: 2px; background: radial-gradient(ellipse at 50% 38%,#8c642d40,#372819c9); cursor: grab; transition: filter .15s,border-color .15s; }
.grid-item::after { content: ""; position: absolute; inset: 2px; border: 1px solid #dfb9750d; pointer-events: none; }
.grid-item.common { border-color: #89715377; background: radial-gradient(ellipse,#76573535,#30251ac9); }
.grid-item.rare { border-color: #7994a388; background: radial-gradient(ellipse,#687f8730,#292727cc); }
.grid-item.epic { border-color: #a48aa380; background: radial-gradient(ellipse,#9b6e9630,#31232ccc); }
.grid-item.legendary { border-color: #d7a355ad; background: radial-gradient(ellipse,#9d6b304f,#3d2918cc); }
.grid-item:hover { filter: brightness(1.23); }
.grid-item.selected { outline: 2px solid #e2bf80; outline-offset: -2px; background-color: #7d592638; filter: brightness(1.12); }
.grid-item.dimmed { opacity: .25; }
.grid-item.dragging { opacity: .3; }
.item-art { display: block; flex-shrink: 0; overflow: hidden; }
.grid-item .item-art { width: 100%; height: 100%; max-width: 140px; max-height: 190px; filter: drop-shadow(0 4px 3px #0009); pointer-events: none; }
.quantity { position: absolute; right: 5px; bottom: 3px; color: #f4dfb8; font-size: 11px; font-weight: 500; text-shadow: 0 1px 3px #000; pointer-events: none; }
.rarity-tick { position: absolute; top: 4px; left: 4px; width: 4px; height: 4px; background: var(--uncommon); }
.common .rarity-tick { background: #aa9b83; }
.rare .rarity-tick { background: var(--rare); }
.epic .rarity-tick { background: var(--epic); }
.legendary .rarity-tick { background: var(--legendary); }
.bag-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 15px 15px; color: #b49b79; font-size: 9px; line-height: 1.6; }
.text-button { padding: 3px 0; border-bottom: 1px solid #9e774c66; color: #8b602d; font-size: 11px; }
.bag-hint .text-button { flex-shrink: 0; color: #d9b884; font-size: 10px; }
.bag-measures { display: grid; gap: 12px; padding: 14px 15px 0; border-top: 1px solid #8c6d4640; }
.measure-label { display: flex; justify-content: space-between; gap: 8px; color: #bfa582; font-size: 10px; }
.measure-label strong { color: #ead6b0; font-weight: 500; }
.measure-label strong span { color: #a88e6b; }
.measure-track { height: 3px; margin-top: 8px; background: #5a442a8c; }
.measure-track i { display: block; height: 3px; max-width: 100%; background: linear-gradient(90deg,#a97539,#d4b07b); }
.measure-track i.over { background: #bb6c4d; }
.currency { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 14px 15px; border: 1px solid #c2ab86; border-radius: 3px; background: #eee1c7; }
.currency > span { color: #8a6a44; font-size: 11px; }
.currency button { display: flex; align-items: center; gap: 14px; font: 14px var(--serif); }
.currency b { margin-right: 3px; color: #654522; font-weight: 600; font-size: 19px; }
.currency small { color: #967955; font: 9px var(--sans); }
.coin-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: #bc8b42; box-shadow: inset 0 0 0 2px #dfb970; }
.coin-dot.silver { background: #8d8a80; box-shadow: inset 0 0 0 2px #b9b4a7; }
.coin-dot.copper { background: #b16b3e; box-shadow: inset 0 0 0 2px #d09266; }
.inspector { overflow: hidden; border: 1px solid #b7a07a; border-radius: 4px; background: radial-gradient(ellipse at 30% 0,#fff8e5ba,transparent 60%),linear-gradient(125deg,#f4ead6,#e9d9ba); box-shadow: 0 4px 10px #7451250b; }
.inspector-top { position: relative; height: 167px; display: grid; place-items: center; border-bottom: 1px solid #bca07466; background: radial-gradient(ellipse at 50% 55%,#ba94532a,transparent 60%),#dfc89e20; }
.inspector-top::before, .inspector-top::after { content: ""; position: absolute; width: 85px; height: 85px; border: 1px solid #a487541d; transform: rotate(45deg); }
.inspector-top::after { width: 110px; height: 110px; border-color: #a4875412; }
.inspector-top .item-art { z-index: 1; width: 125px; height: 125px; filter: drop-shadow(2px 6px 4px #66461e35); }
.inspector .item-rarity { position: absolute; left: 15px; top: 14px; color: #927044; font-size: 9px; font-weight: 650; letter-spacing: 1.3px; text-transform: uppercase; }
.item-rarity.rare { color: #4f738b; }
.item-rarity.epic { color: #87628a; }
.item-rarity.common { color: #84765f; }
.item-rarity.legendary { color: #aa7226; }
.size-badge { position: absolute; right: 14px; top: 13px; color: #9a8059; font-size: 10px; }
.inspector-body { padding: 20px 18px; }
.inspector h3 { color: #594027; font: 600 29px/1.05 var(--serif); overflow-wrap: anywhere; }
.item-category { margin-top: 8px; color: #987954; font-size: 10px; text-transform: capitalize; }
.inspector-divider { height: 1px; margin: 19px 0; background: linear-gradient(90deg,#b0925e90,transparent); }
.item-properties { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; color: #6e5637; font-size: 12px; }
.item-properties li { list-style: none; position: relative; padding-left: 14px; }
.item-properties li::before { content: "◆"; position: absolute; top: 5px; left: 0; color: #a98044; font-size: 6px; }
.item-lore { margin-top: 19px; color: #897151; font: italic 17px/1.5 var(--serif); overflow-wrap: anywhere; }
.item-weight { display: flex; justify-content: space-between; gap: 7px; margin-top: 20px; padding-top: 15px; border-top: 1px solid #bea67c77; color: #8a6e49; font-size: 11px; }
.inspector-actions { display: grid; gap: 8px; margin-top: 19px; }
.inspector-actions button { width: 100%; padding: 9px 12px; min-height: 37px; font-size: 11px; }
.manual-note { margin-top: 16px; color: #927957; font-size: 10px; line-height: 1.7; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; margin: 14px 2px; color: #927a59; font-size: 9px; }
.legend span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #a88b50; }
.legend .common::before { background: #a2967e; }
.legend .rare::before { background: #668499; }
.legend .epic::before { background: #aa86aa; }
.legend .legendary::before { background: #be8c3f; }
.bottom-note { display: flex; align-items: center; gap: 13px; margin-top: 23px; padding: 17px 18px; border-top: 1px solid #b89c7180; border-bottom: 1px solid #b89c7140; background: #e2cfaa30; }
.bottom-note .note-mark { color: #b68b4c; font: 25px var(--serif); }
.bottom-note strong { display: block; color: #785a37; font-size: 11px; font-weight: 550; }
.bottom-note p { margin-top: 4px; color: #927957; font-size: 10px; }
.bottom-note .text-button { margin-left: auto; white-space: nowrap; font-size: 10px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 12px; max-width: 1510px; padding: 0 34px 23px; margin: auto; color: #a68b65; font-size: 9px; letter-spacing: .7px; }
.workspace-footer > span:first-child { font: italic 15px var(--serif); }
.workspace-footer b { margin: 0 7px; font-weight: 400; }
.sheet-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; }
.ability-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; padding: 22px; }
.ability { padding: 18px; border: 1px solid #c1a67b; border-radius: 3px; background: linear-gradient(140deg,#f9f0dc,#e9d7b5); text-align: center; }
.ability small { color: #8f7048; text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
.ability strong { display: block; color: #72502c; font: 600 39px var(--serif); }
.ability span { display: inline-block; min-width: 40px; padding-top: 5px; border-top: 1px solid #c6ac7f; color: #a27d49; font-size: 11px; }
.sheet-body { padding: 22px; }
.sheet-body dl { display: grid; grid-template-columns: 1fr auto; gap: 15px; margin: 0; }
.sheet-body dt { color: #927553; font-size: 12px; }
.sheet-body dd { margin: 0; color: #5f4328; font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.sheet-note { white-space: pre-wrap; color: #7b6241; font-size: 13px; line-height: 1.8; }
.hp-controls { display: flex; align-items: center; gap: 14px; padding: 19px 22px; border-top: 1px solid #cab38c; color: #8b6746; }
.hp-controls strong { margin-right: auto; color: #944f3d; font: 600 29px var(--serif); }
.hp-controls button { width: 36px; height: 34px; border: 1px solid #b48f60; border-radius: 3px; background: #e8d3ad; }
.quest-tabs { display: flex; gap: 9px; margin-bottom: 21px; }
.quest-tabs button { padding: 8px 15px; border: 1px solid #bba077; border-radius: 3px; color: #8f704a; font-size: 12px; }
.quest-tabs button.active { color: #f5e4c4; background: #84603b; border-color: #84603b; }
.quest-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.quest-card { padding: 25px; border: 1px solid #bea37b; border-radius: 4px; background: linear-gradient(135deg,#f6eddc,#ecdfc4); }
.quest-card .quest-kind { color: #a67c43; font-size: 9px; letter-spacing: 1.4px; text-transform: uppercase; }
.quest-card h2 { margin-top: 11px; color: #62452b; font: 600 30px var(--serif); overflow-wrap: anywhere; }
.quest-card p { margin-top: 10px; color: #8b6f4a; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.objectives { display: grid; gap: 13px; margin: 22px 0; }
.objective { display: flex; align-items: flex-start; gap: 11px; color: #725435; font-size: 12px; }
.objective input { accent-color: #976b38; width: 15px; height: 15px; flex-shrink: 0; margin: 2px 0; }
.objective.done > span { color: #ad9270; text-decoration: line-through; }
.quest-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid #c8ac7b77; }
.quest-reward { color: #9a733e; font-size: 11px; overflow-wrap: anywhere; }
.quest-actions { display: flex; flex-shrink: 0; gap: 13px; }
.empty-state { grid-column: 1/-1; padding: 45px; border: 1px dashed #bca178; color: #93734b; text-align: center; }
.notes-editor { width: 100%; min-height: 390px; resize: vertical; padding: 25px; border: 1px solid #bea47c; border-radius: 3px; background: repeating-linear-gradient(transparent 0 31px,#b4945a19 31px 32px),#f4e9d3; color: #674c30; font-size: 14px; line-height: 32px; }
.notes-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: #987e58; font-size: 11px; }
dialog { width: 620px; max-width: min(620px,calc(100vw - 28px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #b79a6b; border-radius: 5px; color: var(--text); background: #efe3cd; box-shadow: 0 25px 100px #180f0aa1; }
dialog::backdrop { background: #1a100bbe; backdrop-filter: blur(4px); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 25px 17px; border-bottom: 1px solid #c6ac81; background: #e3cda93b; }
.modal-heading h2 { color: #62432a; font: 600 31px var(--serif); }
.modal-close { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; padding: 0; color: #9b7546; font-size: 25px; }
.modal-body { padding: 22px 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .wide { grid-column: 1/-1; }
label.field { display: flex; flex-direction: column; gap: 7px; color: #80603d; font-size: 12px; }
input, select, textarea { min-width: 0; padding: 10px 11px; border: 1px solid #bca078; border-radius: 3px; color: #5a412b; background: #f8efdf; }
input::placeholder, textarea::placeholder { color: #a88d69; }
textarea { resize: vertical; line-height: 1.7; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; font-size: 13px; }
.form-section { grid-column: 1/-1; margin-top: 6px; padding-top: 17px; border-top: 1px solid #c2a77b; color: #9d723e; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.form-abilities { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; grid-column: 1/-1; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 18px 25px; border-top: 1px solid #c6ac81; }
.help-text { color: #83633f; font-size: 13px; line-height: 1.8; }
.help-text p + p { margin-top: 15px; }
.help-text strong { color: #624125; }
.form-error { grid-column: 1/-1; color: #9d4030; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; left: calc(50% + 80px); bottom: 24px; z-index: 10; max-width: calc(100vw - 30px); padding: 13px 19px; transform: translate(-50%,15px); border: 1px solid #bb9056; border-radius: 4px; color: #f1dab3; background: #4d3523; box-shadow: 0 6px 30px #29190b55; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
.skip-link { position: fixed; z-index: 20; top: -80px; left: 20px; padding: 10px; color: #342312; background: #e3bb78; }
.skip-link:focus { top: 10px; }
.die-result { padding: 30px; text-align: center; }
.die-result .die { color: #a27132; font: 95px/1.2 var(--serif); }
.die-result p { color: #8f6b43; font-size: 13px; }
.die-result .roll-history { margin-top: 20px; color: #a18761; font-size: 12px; }
.connection-note { margin-bottom: 13px; padding: 14px 16px; border: 1px solid #c2a274; border-radius: 3px; color: #86613b; background: #e4cda64d; font-size: 12px; }
.mobile-title { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media(min-width:1600px) {
  .paperdoll { height: 470px; }
  .equipment-slots { padding: 32px 20px; grid-template-columns: 62px 1fr 62px; grid-template-rows: repeat(4,73px); gap: 26px 0; }
  .equipment-slot .item-art { width: 49px; height: 56px; }
  .slot-label { bottom: -18px; font-size: 8px; }
  .inspector-top { height: 190px; }
  .inspector-top .item-art { width: 145px; height: 145px; }
  .inspector-body { padding: 23px; }
}
@media(max-width:1250px) {
  .app-shell { grid-template-columns: 204px minmax(0,1fr); }
  .sidebar { padding: 28px 14px 18px; }
  .brand { gap: 8px; }
  .brand > span { font-size: 21px; }
  .brand svg { width: 30px; }
  .brand small { font-size: 7px; letter-spacing: 2.3px; }
  main { padding: 25px 24px 32px; }
  .topbar { padding: 0 24px; }
  .inventory-layout { grid-template-columns: minmax(220px,.9fr) minmax(315px,1.25fr) minmax(210px,.84fr); gap: 14px; }
  .character-name { font-size: 29px; }
  .character-portrait { width: 60px; height: 60px; }
  .character-meta { font-size: 10px; }
  .overview-stat { padding: 0 12px; min-width: 66px; }
  .overview-stat strong { font-size: 28px; }
  .overview-stat > span { font-size: 8px; }
  .paperdoll { height: 375px; }
  .equipment-slots { grid-template-columns: 48px 1fr 48px; grid-template-rows: repeat(4,58px); padding: 24px 11px; gap: 22px 0; }
  .equipment-slot .item-art { width: 37px; height: 44px; }
  .inspector-body { padding: 18px 15px; }
  .inspector h3 { font-size: 27px; }
  .item-lore { font-size: 16px; }
  .bag-tools { gap: 6px; padding: 12px 11px; }
  .bag-tools select { width: 83px; min-width: 83px; font-size: 9px; }
  .inventory-grid { margin: 0 11px; }
  .bag-hint { margin-left: 11px; margin-right: 11px; font-size: 8px; }
  .bag-measures { padding-left: 11px; padding-right: 11px; }
  .currency { padding: 13px 11px; }
  .currency button { gap: 10px; }
  .workspace-footer { padding-left: 24px; padding-right: 24px; }
}
@media(max-width:1100px) {
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { align-items: center; min-height: 600px; padding: 26px 10px 18px; }
  .brand { padding-bottom: 34px; }
  .brand > span, .campaign-label, .campaign-card, .sidebar-rule, .sidebar-link, .sidebar-bottom p, .edition-tag, .babcock { display: none; }
  .brand svg { width: 32px; }
  .sidebar nav { width: 100%; gap: 15px; }
  nav a { position: relative; justify-content: center; gap: 0; padding: 13px 0; font-size: 0; }
  .nav-symbol { font-size: 22px; }
  nav .nav-number { position: absolute; top: 2px; right: 0; padding: 0 3px; font-size: 7px; }
  nav .nav-dot { position: absolute; top: 8px; right: 7px; }
  .sidebar-bottom { width: 100%; }
  .account-button { justify-content: center; padding: 18px 0; }
  .account-button > span:not(:first-child) { display: none; }
  .toast { left: 50%; }
}
@media(max-width:1000px) {
  .inventory-layout { grid-template-columns: minmax(240px,.85fr) minmax(330px,1.15fr); gap: 18px; }
  .paperdoll { height: 407px; }
  .equipment-slots { grid-template-columns: 55px 1fr 55px; grid-template-rows: repeat(4,64px); padding: 26px 14px; gap: 23px 0; }
  .inspector { grid-column: 1/-1; display: grid; grid-template-columns: 160px minmax(0,1fr); }
  .inspector-top { height: 100%; min-height: 240px; border-bottom: 0; border-right: 1px solid #bca07466; }
  .inspector-body { display: grid; grid-template-columns: minmax(0,1fr) 170px; column-gap: 25px; padding: 22px; }
  .inspector h3, .inspector .item-category, .item-properties, .item-lore { grid-column: 1; }
  .inspector-divider { display: none; }
  .item-properties { margin-top: 14px; }
  .item-lore { margin-top: 13px; }
  .item-weight { grid-column: 2; grid-row: 1/3; align-self: start; margin: 0; padding: 0; border: 0; }
  .inspector-actions { grid-column: 2; grid-row: 3/6; align-self: start; margin-top: 12px; }
  .manual-note { grid-column: 1/-1; text-align: left; margin-top: 15px; }
  .bottom-note { margin-top: 18px; }
  .overview-stat { padding: 0 13px; }
  .character-overview { gap: 0; }
}
@media(max-width:780px) {
  main { padding: 23px 18px 30px; }
  .topbar { padding: 0 18px; }
  .topbar-right { gap: 10px; }
  .breadcrumb { font-size: 10px; }
  .save-status { font-size: 9px; }
  .character-banner { gap: 13px; }
  .character-name { font-size: 28px; }
  .character-meta { font-size: 9px; }
  .overview-stat:nth-child(3), .overview-stat:nth-child(4) { display: none; }
  .overview-stat { padding: 0 13px; }
  .inventory-layout { grid-template-columns: minmax(208px,.8fr) minmax(275px,1.2fr); gap: 13px; }
  .paperdoll { height: 365px; }
  .equipment-slots { grid-template-columns: 45px 1fr 45px; grid-template-rows: repeat(4,55px); gap: 23px 0; padding: 25px 10px; }
  .equipment-slot .item-art { width: 35px; height: 42px; }
  .panel-title { padding: 15px 12px; }
  .panel-title h2 { font-size: 12px; }
  .panel-title .micro { font-size: 9px; }
  .page-heading h1 { font-size: 35px; }
  .page-heading p { font-size: 11px; }
  .bag-tools select { min-width: 77px; width: 77px; }
  .search-wrap input { font-size: 10px; padding-left: 25px; }
  .search-wrap > span { left: 7px; }
  .bag-hint { align-items: flex-start; font-size: 8px; }
  .bag-hint .text-button { font-size: 9px; }
  .currency > span { font-size: 10px; }
  .currency button { gap: 9px; }
  .currency b { font-size: 16px; }
  .currency small { font-size: 8px; }
  .coin-dot { width: 7px; height: 7px; margin-right: 3px; }
  .inspector { grid-template-columns: 120px minmax(0,1fr); }
  .inspector-top .item-art { width: 100px; height: 120px; }
  .inspector-body { grid-template-columns: minmax(0,1fr) 140px; padding: 18px; column-gap: 17px; }
  .inspector .item-rarity { font-size: 8px; left: 11px; }
  .inspector .size-badge { top: 34px; left: 11px; right: auto; }
  .sheet-layout, .quest-list { grid-template-columns: 1fr; }
}
@media(max-width:660px) {
  .app-shell { display: block; }
  .sidebar { position: relative; display: flex; flex-direction: row; justify-content: space-between; align-items: center; height: auto; min-height: 0; padding: 14px 16px; border-right: 0; border-bottom: 1px solid #735335; }
  .brand { gap: 7px; padding: 0; }
  .brand svg { width: 25px; height: 31px; }
  .brand > span { display: block; max-width: 98px; font-size: 18px; line-height: .95; }
  .brand small { display: none; }
  .sidebar nav { flex-direction: row; width: auto; gap: 3px; }
  .sidebar nav a { padding: 9px 10px; }
  .nav-symbol { font-size: 22px; }
  .sidebar-bottom, .nav-number, .nav-dot { display: none !important; }
  .topbar { height: 46px; padding: 0 16px; gap: 10px; }
  .breadcrumb { font-size: 9px; }
  .breadcrumb span { margin: 0 7px; }
  .save-status { font-size: 8px; max-width: 135px; line-height: 1.3; }
  .save-status i { flex-shrink: 0; }
  .icon-button { width: 23px; height: 23px; }
  main { padding: 23px 16px 29px; }
  .character-banner { flex-wrap: wrap; gap: 13px; padding-bottom: 20px; }
  .character-portrait { width: 54px; height: 54px; }
  .character-name { font-size: 30px; }
  .character-meta { font-size: 10px; }
  .level-badge { font-size: 9px; }
  .character-overview { justify-content: space-between; width: 100%; margin-left: 0; padding-top: 11px; }
  .overview-stat { flex: 1; min-width: 0; padding: 0 12px; }
  .overview-stat:first-child { padding-left: 0; }
  .overview-stat:nth-child(3), .overview-stat:nth-child(4) { display: block; }
  .overview-stat > span { display: block; min-height: 22px; font-size: 8px; letter-spacing: .8px; }
  .overview-stat strong { font-size: 28px; margin-top: 4px; }
  .overview-stat strong small { font-size: 11px; }
  .health-line { width: 72px; margin-top: 6px; }
  .edit-profile { width: 29px; height: 29px; margin-left: auto; }
  .page-heading { margin: 25px 0 21px; gap: 12px; }
  .page-heading h1 { font-size: 35px; }
  .page-heading p { max-width: 210px; font-size: 11px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.6px; }
  .page-heading .primary-button { min-width: 96px; padding: 9px 11px; font-size: 11px; }
  .inventory-layout { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .bag-column { order: 1; }
  .equipment-panel { order: 2; }
  .inspector { order: 3; grid-column: 1; grid-template-columns: 100px minmax(0,1fr); }
  .bag-panel .panel-title { padding: 17px 15px; }
  .bag-panel .panel-title h2 { font-size: 13px; }
  .bag-tools { gap: 9px; padding: 14px; }
  .search-wrap input { padding-left: 29px; font-size: 12px; }
  .search-wrap > span { left: 9px; }
  .bag-tools select { width: 100px; min-width: 100px; font-size: 10px; }
  .inventory-grid { margin: 0 14px; gap: 3px; }
  .grid-item { padding: 3px; }
  .bag-hint { align-items: center; margin: 12px 14px 16px; font-size: 9px; }
  .bag-hint .text-button { font-size: 10px; }
  .bag-measures { padding: 14px 14px 0; }
  .measure-label { font-size: 10px; }
  .currency { padding: 14px; }
  .currency > span { font-size: 11px; }
  .currency button { gap: 14px; }
  .currency b { font-size: 18px; }
  .currency small { font-size: 9px; }
  .coin-dot { width: 8px; height: 8px; margin-right: 4px; }
  .legend { font-size: 9px; gap: 13px; margin-bottom: 0; }
  .paperdoll { height: 405px; }
  .paperdoll > img { object-fit: contain; object-position: center top; }
  .equipment-slots { max-width: 430px; margin: auto; grid-template-columns: 57px 1fr 57px; grid-template-rows: repeat(4,64px); gap: 23px 0; padding: 26px 20px; }
  .equipment-slot .item-art { width: 45px; height: 52px; }
  .slot-label { bottom: -16px; font-size: 8px; }
  .equipment-foot { font-size: 11px; padding: 15px; }
  .inspector-top { min-height: 260px; }
  .inspector-top .item-art { width: 89px; height: 130px; }
  .inspector-body { display: block; padding: 20px 15px; }
  .inspector h3 { font-size: 28px; }
  .inspector .item-category { font-size: 10px; }
  .item-properties { font-size: 11px; gap: 9px; margin-top: 16px; }
  .item-lore { margin-top: 16px; font-size: 17px; }
  .inspector .item-weight { display: flex; margin-top: 18px; padding-top: 13px; border-top: 1px solid #bea67c77; font-size: 10px; }
  .inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
  .inspector-actions button { min-height: 39px; padding: 8px 5px; font-size: 10px; }
  .inspector-actions button:last-child { grid-column: 1/-1; }
  .inspector .manual-note { font-size: 9px; margin-top: 15px; }
  .bottom-note { align-items: flex-start; padding: 16px 3px; gap: 10px; }
  .bottom-note strong { font-size: 10px; }
  .bottom-note p { font-size: 10px; }
  .bottom-note .text-button { font-size: 9px; }
  .workspace-footer { padding: 0 16px 22px; font-size: 8px; }
  .workspace-footer > span:first-child { font-size: 14px; }
  .form-grid { gap: 13px; }
  .modal-body { padding: 21px 18px; }
  .modal-heading { padding: 20px 18px 16px; }
  .modal-heading h2 { font-size: 29px; }
  .modal-footer { gap: 8px; padding: 17px 18px; }
  .modal-footer button { flex: 1 1 auto; }
  .form-abilities { gap: 10px; }
  .form-grid input, .form-grid select, .form-grid textarea { font-size: 16px; }
  label.field { font-size: 11px; }
  .ability-grid { padding: 16px; gap: 10px; }
  .ability { padding: 15px 8px; }
  .ability small { font-size: 9px; }
  .sheet-body { padding: 20px; }
  .quest-card { padding: 21px; }
  .quest-tabs { gap: 6px; }
  .quest-tabs button { padding: 8px 11px; font-size: 11px; }
  .quest-bottom { flex-wrap: wrap; }
  .notes-meta { font-size: 10px; }
  .notes-editor { padding: 20px; font-size: 16px; }
  .toast { max-width: calc(100vw - 24px); min-width: min(320px,calc(100vw - 24px)); bottom: 15px; font-size: 12px; }
  .account-mobile { display: inline-flex !important; }
  .mobile-title { display: block; }
}
@media(max-width:380px) {
  .sidebar { padding: 13px 12px; }
  .brand > span { font-size: 17px; max-width: 89px; }
  .brand svg { width: 22px; }
  .sidebar nav a { padding: 8px; }
  .character-name { font-size: 27px; }
  .overview-stat { padding: 0 9px; }
  .overview-stat strong { font-size: 25px; }
  .inspector { grid-template-columns: 85px minmax(0,1fr); }
  .inspector-top .item-art { width: 75px; height: 120px; }
  .inspector-body { padding: 18px 13px; }
  .inspector h3 { font-size: 26px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media(max-width:640px){.inspector{order:2}.equipment-panel{order:3}}