/* Shared mobile-first interface. Scene rendering remains in styles.css. */
.forge-launch { min-height: 100vh; min-height: 100svh; display: grid; justify-items: center; align-content: center; gap: 5px; padding: 20px; background: #11191f; }
.forge-launch img { width: min(100%, 540px); height: auto; aspect-ratio: 16/9; border-radius: 14px; }
.forge-launch strong { margin-top: 12px; color: var(--gold); font: 600 32px/1.2 'Grenze Gotisch', Georgia, serif; }
.forge-launch span { color: var(--muted); font-size: 15px; }
:root { --ui-surface: #19262c; --ui-border: #bbccc325; --ui-soft: #aebfbe; }
:root {
  --screen-left: max(env(safe-area-inset-left, 0px), var(--tg-safe-left, 0px));
  --screen-right: max(env(safe-area-inset-right, 0px), var(--tg-safe-right, 0px));
  --screen-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px));
}
body { padding-inline: var(--screen-left) var(--screen-right); }
.sidebar { left: var(--screen-left); }
[hidden] { display: none !important; }
button:disabled { opacity: 1; color: #acb5b5; background: #253137; border-color: #71817d38; cursor: not-allowed; box-shadow: none; }
.btn:disabled { opacity: 1; }
.btn.gold:disabled, .btn.outline:disabled { color: #b1bdbb; background: #253137; border-color: #71817d38; box-shadow: none; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; border: 1px solid var(--ui-border); border-radius: 10px; font-size: 24px; color: var(--gold); }
.icon-button svg { width: 22px; height: 22px; }
.text-button { min-height: 44px; padding: 8px 0; color: var(--gold); font-size: 15px; text-align: left; }
.cost-hint { color: #d6c6ad; font-size: 14px; line-height: 1.4; margin: 8px 0 0; }
.btn, .slot, .portrait, .equipment-card, .icon-button, .back-button { touch-action: manipulation; }
.back-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #c5a56a60;
  border-radius: 10px;
  background: linear-gradient(180deg, #2b3434, #202b2e);
  color: #f2d7a2;
  box-shadow: inset 0 1px #ffffff0a;
  font: 600 16px/1 Rajdhani, sans-serif;
}
.back-button svg { width: 18px; height: 18px; stroke-width: 2; }
.back-button:hover { border-color: #eac276; background: #39403a; }
.back-button:active { background: #45443a; }
.save-state { font-size: 13px; color: var(--green); white-space: nowrap; line-height: 1.2; }
.save-state::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.save-state[data-state=saving] { color: var(--gold); }
.save-state[data-state=offline], .save-state[data-state=pending] { color: #efb897; white-space: normal; max-width: 150px; }
.topbar { height: 76px; top: var(--tg-safe-top, 0px); }
.topbar .breadcrumb { margin-inline-end: auto; font-size: 14px; }
.topbar .account { gap: 18px; min-width: 0; }
.wallet strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar .wallet strong[data-length="medium"] { font-size: clamp(16px, 3.2vw, 22px); }
.topbar .wallet strong[data-length="long"] { font-size: clamp(14px, 2.9vw, 20px); letter-spacing: -.025em; }
.workshop-intro { color: var(--muted); max-width: 62ch; line-height: 1.5; }
.part-family { border-bottom: 1px solid var(--line); }
.part-family summary { cursor: pointer; display: flex; gap: 14px; align-items: center; padding: 16px 8px; }
.part-family summary::after { content: '+'; margin-left: auto; font-size: 22px; color: var(--gold); }
.part-family[open] summary::after { content: '−'; }
.part-family summary svg { width: 26px; height: 26px; color: var(--gold); }
.part-family summary strong,.part-family summary small,.part-family li small { display: block; }
.part-family small { color: var(--muted); font-size: 14px; }
.part-family ul { padding: 0; margin: 0 0 12px; list-style: none; }
.part-family li { display:grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 12px; align-items:center; padding: 12px; background: var(--panel); }
.part-family li + li { border-top: 1px solid var(--line); }
.part-family .recipe-hint { grid-column: 1 / -1; }
.tonic-title { margin: 24px 0 8px; }
.tonic-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 12px; }
.tonic-card { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: start; }
.tonic-card h3 { margin: 0; } .tonic-card p { color: var(--muted); margin: 6px 0 14px; flex: 1; }
.wallet small { font-size: 12px; }
.wallet { padding: 0; min-height: 44px; text-align: left; }
.nav button { position: relative; }
.nav-badge { position: absolute; top: 4px; right: 7px; min-width: 16px; height: 16px; border-radius: 9px; background: var(--gold); color: #231e14; font: 600 11px/16px Rajdhani, sans-serif; text-align: center; font-style: normal; }
.forge-intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 0 18px; }
.forge-intro h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.15; margin: 4px 0 0; }
.forge-intro .eyebrow { font-size: 10px; }
.forge-card { min-height: 0; }
.forge-top { padding: 16px 20px; }
.forge-top strong { font-size: 28px; }
.forge-top small { margin-top: 1px; }
.forge-motto { color: #c1ae87; font-size: 12px; line-height: 1.3; text-align: right; }
.forge-art { width: 100%; height: auto; min-height: 0; aspect-ratio: 1672 / 941; margin: 0; border-radius: 0; }
.forge-invitation {
  left: 12px;
  bottom: 9px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #11191fc9;
  color: #f1dfbd;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .04em;
}
.forge-chain { font-size: 12px; letter-spacing: .055em; }
.tap-button { margin: 16px 18px 12px; width: calc(100% - 36px); font-size: 18px; min-height: 52px; }
.tap-button span { padding-left: 12px; border-left: 1px solid #6f542a55; font-size: 15px; white-space: nowrap; }
.energy-bar { padding: 0 18px 16px; }
.energy-label { align-items: center; font-size: 14px; margin-bottom: 6px; }
.energy-label > span { display: flex; gap: 4px; align-items: center; }
.energy-label svg { width: 15px; height: 15px; }
.energy-bar .status-line { font-size: 13px; margin-top: 5px; }
.next-goal { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; margin-top: 12px; border: 1px solid #bda17438; border-radius: 12px; background: #c29e5010; }
.next-goal .card-icon { width: 36px; height: 36px; flex: none; border-radius: 8px; }
.next-goal .card-icon svg { width: 21px; height: 21px; }
.next-goal small, .next-goal strong { display: block; }
.next-goal small { font-size: 12px; letter-spacing: .04em; color: #cfb786; }
.next-goal strong { font-size: 16px; font-weight: 600; }
.next-goal > span:last-child { margin-left: auto; color: var(--gold); }
.stat-box { padding: 12px; }
.stat-box small { font-size: 12px; line-height: 1.2; letter-spacing: .025em; }
.stat-box b { font-size: 25px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.section-heading h2, .section-heading h3 { font: 600 20px/1.3 Rajdhani, sans-serif; margin: 0; letter-spacing: 0; }
.section-heading > span, .section-heading h2 span { color: var(--ui-soft); font-size: 14px; font-weight: 500; }
.segmented { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px; background: #0c151a; border: 1px solid var(--ui-border); border-radius: 12px; margin: 0 0 16px; }
.segmented button { min-height: 42px; padding: 7px 8px; border-radius: 8px; color: var(--ui-soft); font-size: 16px; }
.segmented button[aria-pressed=true] { background: #eac27619; color: #f5d698; box-shadow: inset 0 0 0 1px #eac27640; }
.upgrade-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.upgrade-row { border: 1px solid var(--ui-border); background: var(--ui-surface); border-radius: 12px; padding: 16px; }
.upgrade-title { display: flex; align-items: center; gap: 12px; }
.upgrade-title .card-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; }
.upgrade-title .icon-button { margin-left: auto; border: 0; color: #a4b6b7; font-size: 22px; }
.upgrade-title h2 { font: 600 20px/1.15 Rajdhani, sans-serif; margin: 0 0 3px; }
.upgrade-title span { font-size: 13px; color: var(--ui-soft); }
.upgrade-row > p { font-size: 14px; margin: 10px 0; color: var(--ui-soft); }
.upgrade-purchase { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.upgrade-purchase .btn { min-width: 98px; font-size: 15px; }
.value-change { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 18px; }
.value-change span { color: var(--ui-soft); }
.value-change strong { font-weight: 600; color: #f0d3a1; }
.balance-note, .footnote { font-size: 13px; }
.balance-note { margin-top: 8px; }
.compact-loadout .slots { margin: 0; }
.compact-loadout .slot { padding: 9px 4px; gap: 2px; }
.compact-loadout .slot b, .compact-loadout .slot small { font-size: 13px; line-height: 1.2; }
.compact-loadout .slot > svg, .compact-loadout .item-art { height: 44px; width: 44px; }
.inventory-heading { margin: 22px 0 12px; }
details > summary { cursor: pointer; font-size: 16px; min-height: 44px; padding: 10px 0; color: #e9e9df; }
details > summary span { color: var(--ui-soft); font-size: 13px; margin-left: 12px; }
.filter-panel { border-top: 1px solid var(--ui-border); border-bottom: 1px solid var(--ui-border); margin-bottom: 16px; }
.inventory-toolbar { margin: 6px 0 16px; }
.inventory-toolbar label { font-size: 14px; }
.equipment-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.equipment-card { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-surface); overflow: hidden; padding: 12px; min-width: 0; }
.equipment-card.UNCOMMON { border-color: #82c8ad55; }
.equipment-card.RARE { border-color: #83afd755; }
.equipment-card.LEGENDARY { border-color: #d5ab5c88; }
.equipment-art { position: relative; display: grid; place-items: center; background: radial-gradient(ellipse, #eac27616, transparent 72%); min-height: 90px; }
.equipment-art .item-art { height: 82px; width: 82px; }
.equipment-card h3 { font-size: 17px; line-height: 1.2; margin: 7px 0; }
.equipment-card .rarity { font-size: 12px; letter-spacing: .02em; }
.equipment-card p { font-size: 14px; line-height: 1.35; color: #bbceca; margin: 6px 0 12px; }
.item-detail-link { font-size: 14px; color: var(--gold); border-top: 1px solid var(--ui-border); padding-top: 9px; margin-top: auto; }
.equipped-mark { position: absolute; top: 0; right: 0; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: #82c8ad17; }
.equipped-mark svg { width: 15px; height: 15px; }
.empty { grid-column: 1/-1; padding: 24px 12px; }
.empty .btn { display: flex; margin-top: 12px; }
.daily-gift { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(110deg, #4b402a55, #19262c); border-color: #caa65b40; }
.daily-gift h2 { font: 600 28px/1.2 Rajdhani, sans-serif; color: #f0d3a1; margin: 6px 0; }
.daily-gift p { margin: 0; font-size: 14px; color: var(--ui-soft); }
.daily-gift .btn { flex: none; }
.milestones { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.milestones .btn { min-width: 0; flex-direction: column; gap: 3px; padding: 9px 4px; font-size: 14px; line-height: 1.2; }
.milestones .btn b { font-size: 13px; }
.milestones .btn span { font-size: 16px; color: #e8d1a4; }
.milestones small { font-size: 12px; }
.quest-list { margin-top: 18px; }
.quest-row { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--ui-border); }
.quest-row > div { min-width: 0; flex: 1; }
.quest-row h3 { font-size: 16px; line-height: 1.25; margin: 0 0 5px; }
.quest-row small { font-size: 14px; color: var(--ui-soft); }
.quest-row .bar { height: 3px; margin-top: 8px; }
.quest-check { color: var(--gold); flex: none; }
.quest-row .btn { min-width: 62px; padding: 8px 10px; font-size: 14px; }
.quest-row.complete .quest-check, .complete-label { color: var(--green); }
.complete-label { font-size: 14px; min-width: 62px; text-align: center; }
.calendar { margin-top: 14px; }
.calendar .day { font-size: 12px; }
.shop-wallet { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 12px; font-size: 15px; }
.shop-wallet b { color: var(--gold); margin-left: 8px; }
.supply-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.supply-card { border: 1px solid var(--ui-border); border-radius: 14px; background: var(--ui-surface); overflow: hidden; }
.supply-art { display: flex; justify-content: center; align-items: center; position: relative; background: radial-gradient(ellipse, #e6ad4d20, transparent 75%); padding: 12px; }
.supply-art .tag { position: absolute; top: 12px; right: 12px; background: #172127; font-size: 12px; letter-spacing: .045em; }
.supply-body { padding: 0 18px 12px; }
.supply-body h2 { font: 600 22px/1.25 Rajdhani, sans-serif; margin: 0 0 8px; }
.supply-body p { font-size: 15px; color: var(--ui-soft); line-height: 1.45; margin: 6px 0; }
.supply-body .text-button { width: 100%; text-align: center; }
.supply-card .chest-art { height: 120px; width: 150px; }
.boost-card .boost-art { height: 100px; width: 100px; }
.setting-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ui-border); padding: 16px 0; }
.setting-row .btn { flex: none; }
.setting-row p { margin: 5px 0; font-size: 14px; }
dialog { padding: 0; max-height: min(88dvh, 900px); width: min(600px, calc(100% - 40px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-radius: 18px; }
.sheet-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 24px; background: #1c282ff7; border-bottom: 1px solid var(--ui-border); backdrop-filter: blur(10px); }
.sheet-top > span { color: #c5af84; font-size: 12px; letter-spacing: .1em; }
dialog .close { float: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 10px; font-size: 28px; background: #ffffff06; }
.sheet-content { padding: 20px 24px 0; }
.sheet-content::after { content: ''; display: block; height: 20px; }
dialog h2 { margin: 6px 0 14px; }
.sheet-content label { display: block; color: var(--ui-soft); font-size: 15px; font-weight: 600; }
#account-form label { margin: 12px 0 5px; }
.sheet-content input, .sheet-content textarea { font-size: 16px; }
.sheet-actions, dialog .dialog-actions { position: sticky; bottom: 0; display: flex; align-items: stretch; gap: 10px; padding: 14px 0 max(14px, var(--tg-safe-bottom, 0px), env(safe-area-inset-bottom, 0px)); background: #1c282ff7; border-top: 1px solid var(--ui-border); margin-top: 20px; z-index: 2; backdrop-filter: blur(10px); }
.sheet-actions .btn { flex: 1; }
.sheet-actions .full { margin-top: 0; }
dialog .meta-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.item-detail-hero { display: flex; align-items: center; gap: 16px; }
.item-detail-hero .item-art { height: 88px; width: 88px; flex: none; }
.item-detail-hero h2 { font-size: 28px; }
.item-detail-hero span { font-size: 14px; color: var(--ui-soft); }
.effect-highlight { margin: 20px 0; padding: 14px; border: 1px solid #eac27644; background: #eac2760c; border-radius: 10px; font-size: 20px; color: #f0d3a1; }
.compare-row { padding: 14px; margin-bottom: 14px; background: #102026; border-radius: 10px; }
.compare-row > * { display: block; }
.compare-row small { font-size: 13px; color: var(--ui-soft); letter-spacing: .025em; }
.compare-row strong { font-size: 18px; margin: 6px 0 4px; }
.compare-row span, .compare-row p { font-size: 14px; margin: 0; }
.detail-fold { border-top: 1px solid var(--ui-border); margin-top: 12px; }
.detail-fold p { font-size: 14px; }
.profile-summary { display: flex; align-items: center; gap: 14px; margin: 16px 0 20px; }
.profile-summary .avatar-image { width: 64px; height: 64px; border: 1px solid #eac27670; border-radius: 50%; }
.profile-summary strong, .profile-summary span { display: block; }
.profile-summary strong { font-size: 20px; }
.profile-summary span { font-size: 14px; color: var(--ui-soft); }
.name-row { display: flex; gap: 10px; margin-top: 6px; }
.account-summary { padding: 14px 0; margin: 14px 0; border-block: 1px solid var(--ui-border); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.account-summary > span { color: var(--green); }
.account-summary p { flex: 1; font-size: 14px; line-height: 1.5; margin: 0; }
.account-summary .text-button { flex-basis: 100%; min-height: 34px; }
.profile-sheet { height: min(90dvh, 850px); }
.avatar-catalog { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portrait small { font-size: 13px; min-height: 31px; }
.avatar-catalog .portrait.premium {
  background: #382921;
  border-color: #bb8b51;
  color: #fff0d4;
}
.avatar-catalog .portrait.premium.selected { border-color: var(--gold); }
.avatar-preview { display: block; width: 150px; height: 150px; object-fit: cover; border-radius: 14px; margin: 0 auto 20px; }
.ref-link input { font-size: 14px; }
.leader { grid-template-columns: 2ch minmax(0, 1fr) max-content; gap: 10px; align-items: baseline; }
.leader span { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.leader small, .journal-item { font-size: 15px; }
.journal-item small { font-size: 14px; line-height: 1.4; }
.world-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
.world-tabs .btn { min-width: 0; min-height: 44px; white-space: normal; font-size: 15px; line-height: 1.2; text-align: center; }
.world-tabs .btn svg { flex: none; }
.plot small, .plot.occupied span, .plot .btn { font-size: 14px; line-height: 1.3; }
.chapter { align-items: flex-start; }
.chapter-number { line-height: 1; }
.chapter h3 { font-size: 19px; line-height: 1.2; }
.chapter p { font-size: 15px; line-height: 1.55; }
footer { align-items: center; font-size: 13px; color: var(--ui-soft); }
footer button { min-height: 44px; text-align: right; }
@media (max-width: 1100px) { .equipment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .sidebar { right: var(--screen-right); }
  .workspace { padding-inline: 16px; }
  .topbar { height: 64px; gap: 10px; }
  .topbar .account { gap: 10px; width: auto; flex: 1; }
  .topbar .wallet { margin-right: auto; min-width: 0; }
  .wallet strong { font-size: 21px; }
  .wallet small { font-size: 12px; }
  .avatar { flex: none; width: 44px; height: 44px; }
  .save-state { font-size: 12px; }
  .save-state[data-state=offline], .save-state[data-state=pending] { max-width: 90px; }
  .page-head { margin: 20px 0 18px; }
  .page-head h1 { font-size: 30px; margin: 4px 0 7px; }
  .page-head .eyebrow { font-size: 10px; }
  .page-head .sub { font-size: 14px; line-height: 1.4; }
  .forge-intro { padding: 10px 0; }
  .forge-intro h1 { font-size: 27px; }
  .forge-layout { gap: 16px; }
  .forge-top { flex-wrap: nowrap; padding: 8px 16px; min-height: 58px; }
  .forge-top strong { font-size: 25px; line-height: 1.05; }
  .forge-top small { display: block; font-size: 12px; line-height: 1.2; margin-top: 2px; }
  .forge-motto { font-size: 12px; }
  .tap-button { min-height: 50px; margin: 12px 12px 10px; width: calc(100% - 24px); font-size: 17px; gap: 8px; }
  .tap-button span { font-size: 14px; padding-left: 8px; }
  .energy-bar { padding: 0 14px 12px; }
  .energy-label { font-size: 13px; }
  .energy-bar .status-line { font-size: 12px; }
  .next-goal { padding: 6px 12px; margin-top: 8px; }
  .under-stats { margin-top: 12px; gap: 8px; }
  .stat-box { padding: 12px 8px; }
  .stat-box small { min-height: 2.4em; }
  .stat-box b { font-size: 24px; }
  .aside { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .upgrade-list { grid-template-columns: 1fr; gap: 12px; }
  .upgrade-row { padding: 14px; }
  .upgrade-title h2 { font-size: 19px; }
  .equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .equipment-card { padding: 12px; }
  .compact-loadout .slots { gap: 6px; }
  .equipment-card h3 { font-size: 16px; }
  .supply-grid { grid-template-columns: 1fr; }
  .supply-card { display: grid; grid-template-columns: 100px minmax(0, 1fr); }
  .supply-art { padding: 30px 4px 8px; }
  .supply-card .chest-art { width: 95px; height: 95px; }
  .supply-art .tag { top: 12px; left: 8px; right: 8px; padding: 3px 4px; text-align: center; }
  .supply-body { padding: 16px 14px 8px 4px; }
  .supply-body h2 { font-size: 21px; }
  .boost-card .boost-art { width: 84px; height: 84px; }
  .boost-card .supply-art { padding: 12px 4px; }
  .boost-card .supply-body { padding-bottom: 16px; }
  .daily-gift { gap: 10px; }
  .daily-gift h2 { font-size: 26px; }
  .sidebar .nav button { font-size: 13px; }
  .world-tabs { gap: 6px; }
  .world-tabs .btn { font-size: 14px; padding: 8px 4px; flex-direction: column; }
  dialog { width: calc(100% - var(--screen-left) - var(--screen-right)); max-width: 100%; max-height: calc(var(--tg-viewport-stable-height, 100dvh) - var(--tg-safe-top, 0px) - 18px); margin: auto var(--screen-right) 0 var(--screen-left); border-radius: 20px 20px 0 0; border-bottom: 0; scrollbar-gutter: auto; }
  .sheet-top { padding: 7px 12px 7px 20px; }
  .sheet-content { padding: 18px 20px 0; }
  .sheet-content::after { height: max(16px, var(--tg-safe-bottom, 0px), env(safe-area-inset-bottom, 0px)); }
  .profile-sheet { height: calc(var(--tg-viewport-stable-height, 100dvh) - var(--tg-safe-top, 0px) - 18px); }
  .sheet-actions .btn { font-size: 15px; padding: 10px; }
  .item-detail-hero { gap: 12px; }
  .item-detail-hero h2 { font-size: 28px; }
  .item-detail-hero .item-art { width: 76px; height: 76px; }
  #toast { font-size: 14px; bottom: calc(84px + max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px))); }
}
/* Forge instrumentation and section navigation */
.smith-plate {
 position: absolute; top: 10px; left: 12px; z-index: 2; pointer-events: none;
 display: inline-flex; align-items: baseline; gap: 9px; padding: 3px 9px;
 border: 1px solid #bb986a70; border-radius: 5px; background: #141a1dea; color: #fff0cf;
}
.smith-plate strong { font: 600 17px/1.3 'Grenze Gotisch', Georgia, serif; }
.smith-plate span { font: 600 12px/1.2 system-ui, sans-serif; color: #f1d394; }
.smith-plate b { font-weight: inherit; }
.forge-card .forge-art { border-radius: 0; }
.forge-intro h1 { margin: 0; }
.forge-gauges { display: grid; grid-template-columns: 1.25fr 1fr; padding: 0 18px 16px; gap: 18px; }
.forge-gauge { min-width: 0; }
.gauge-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 5px; }
.gauge-heading label { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.gauge-heading svg { width: 15px; height: 15px; color: var(--gold); }
.heat-gauge .gauge-heading svg { color: #8ed7d1; }
.gauge-heading strong, .forge-gauge small { font: 500 12px/1.35 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.gauge-heading strong { color: #eee6d5; white-space: nowrap; }
.forge-gauge small { display: block; color: #b9c6c6; }
.forge-gauge progress { --meter: #e2bb79; appearance: none; display: block; width: 100%; height: 6px; margin: 5px 0; border: 0; border-radius: 4px; overflow: hidden; color: var(--meter); background: #344147; }
.forge-gauge progress::-webkit-progress-bar { background: #344147; border-radius: 4px; }
.forge-gauge progress::-webkit-progress-value { background: var(--meter); border-radius: 4px; }
.forge-gauge progress::-moz-progress-bar { background: var(--meter); border-radius: 4px; }
.heat-gauge progress { --meter: #85cbc5; }
.heat-gauge.hot progress { --meter: #ffa673; }
.heat-gauge.hot .gauge-heading svg { color: #ffa673; }
.sidebar .nav button svg { width: 23px; height: 23px; stroke-width: 1.7; }
.sidebar .nav button.active svg { fill: #cfa05d24; color: #ffda94; }
.sidebar .nav button:focus-visible, .menu-destination:focus-visible, .part-family summary:focus-visible { outline: 2px solid #a9e1d5; outline-offset: -2px; }
.nav-badge { font-family: system-ui,sans-serif; font-style: normal; }
.navigation-sheet .sheet-top { padding-inline-start: 20px; }
.navigation-sheet .sheet-top h2 { margin: 0; font-size: 25px; }
.navigation-sheet .sheet-content { padding: 6px 14px 0; }
.destination-list { display: grid; }
.menu-destination { display: grid; grid-template-columns: 37px minmax(0,1fr) 20px; gap: 12px; align-items: center; min-height: 56px; padding: 6px 8px; text-align: left; color: var(--ink); font: 600 17px/1.2 Rajdhani, sans-serif; border-bottom: 1px solid var(--ui-border); }
.menu-destination:last-child { border: 0; }
.preferences { display: grid; }
.preference-row { display: flex; width: 100%; min-height: 64px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px; text-align: left; border-bottom: 1px solid var(--ui-border); }
.preference-row strong, .preference-row small { display: block; }
.preference-row strong { font-size: 18px; line-height: 1.25; }
.preference-row small { margin-top: 3px; color: var(--ui-soft); font-size: 15px; }
.switch-track { flex: none; display: flex; align-items: center; width: 44px; height: 26px; padding: 3px; border: 1px solid #829396; border-radius: 15px; background: #28353a; }
.switch-track i { width: 18px; height: 18px; border-radius: 50%; background: #c2cdce; }
.preference-row[aria-checked=true] .switch-track { background: #ebc887; border-color: #ebc887; }
.preference-row[aria-checked=true] .switch-track i { transform: translateX(18px); background: #36301f; }
@media (prefers-reduced-motion:no-preference) { .switch-track i { transition: transform .14s ease-out; } }
.menu-glyph { display: grid; place-items: center; height: 36px; border: 1px solid #b89e6a4a; border-radius: 8px; background: #c8a66b0b; color: #e8c98d; }
.menu-glyph svg { width: 21px; height: 21px; }
.menu-destination > svg { justify-self: end; color: var(--ui-soft); width: 17px; height: 17px; }
.menu-destination[aria-current="page"] { color: #f7d395; }
.menu-destination[aria-current="page"] > svg { color: #9addc8; }
@media (hover:hover) { .menu-destination:hover { background: #dbbf7a0c; } }
.close svg { width: 19px; height: 19px; stroke-width: 2; }
.telegram-native-back [data-back] { display: none; }
@media (min-width:701px) {
 .sidebar { top: var(--tg-safe-top,0px); padding-bottom: max(16px,var(--screen-bottom)); overflow-y: auto; }
 .sidebar .nav button { min-height: 46px; }
 .sidebar .nav button.active { box-shadow: inset 3px 0 #dfb676; }
}
@media (min-width:701px) and (max-width:900px) {
 .sidebar { padding-inline: 7px; }
 .sidebar .brand { justify-content: center; }
 .sidebar .brand-mark { margin: 0; }
 .sidebar .nav { margin-top: 22px; gap: 3px; }
 .sidebar .nav button { min-height: 54px; display: flex; flex-direction: column; gap: 4px; padding: 6px 2px; }
 .sidebar .nav button.nav-more { display: none; }
 .sidebar .nav .nav-short { display: block; font: 500 12px/1.15 system-ui,sans-serif; }
 .sidebar .side-bottom .btn span { display: none; }
}
@media (min-width:701px) and (max-width:900px) and (max-height:540px) {
 .sidebar .nav { margin-top: 8px; }
 .sidebar .nav button { min-height: 44px; padding-block: 3px; }
 .sidebar .nav button.nav-secondary,.sidebar .side-bottom { display: none; }
 .sidebar .nav button.nav-more,.sidebar .nav .nav-more span { display: flex; }
 .sidebar .nav .nav-more span { font: 500 12px/1.15 system-ui,sans-serif; }
}
@media (max-width:700px) {
 .forge-intro { padding-block: 10px; }
 .forge-gauges { padding: 0 12px 13px; gap: 12px; }
 .gauge-heading label { font-size: 15px; line-height: 1.2; }
 .sidebar .nav { height: 64px; padding-block: 4px; }
 .sidebar .nav button { min-height: 54px; height: 54px; gap: 3px; font: 500 12px/1.25 system-ui,sans-serif; }
 .sidebar .nav button.active { background: #d9af6c15; }
 .sidebar .nav button.active:before { top: auto; bottom: 1px; width: 14px; }
 .nav-badge { right: max(3px,calc(50% - 25px)); top: 1px; }
 .smith-plate { top: 8px; left: 8px; }
 .forge-art .forge-chain { left: auto; right: 8px; transform: none; }
 .forge-art .forge-chain.visible { transform: none; }
}
@media (max-width:360px) {
 .forge-gauges { grid-template-columns: 1.35fr 1fr; gap: 9px; }
 .sidebar .nav { grid-template-columns: minmax(44px,.95fr) minmax(44px,.84fr) minmax(54px,1.22fr) minmax(44px,1fr) minmax(48px,1.06fr); gap: 2px; padding-inline: 5px; }
 .gauge-heading strong { font-size: 11px; }
}
@media (max-width: 420px) {
  .milestones { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .milestones .btn { grid-column: span 2; }
  .milestones .btn:nth-last-child(-n+2) { grid-column: span 3; }
}
@media (max-width: 395px) {
  :root:not(.telegram-native-back) .topbar:has(.back-button:not([hidden])) { min-height: 64px; height: auto; padding-block: 4px; }
  :root:not(.telegram-native-back) .topbar:has(.back-button:not([hidden])) .account {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-areas: 'wallet avatar' 'save avatar';
    gap: 0 8px;
  }
  :root:not(.telegram-native-back) .topbar:has(.back-button:not([hidden])) .wallet { grid-area: wallet; }
  :root:not(.telegram-native-back) .topbar:has(.back-button:not([hidden])) .save-state { grid-area: save; margin-inline-start: 39px; }
  :root:not(.telegram-native-back) .topbar:has(.back-button:not([hidden])) .avatar { grid-area: avatar; }
}
@media (max-width: 360px) {
  .workspace { padding-inline: 12px; }
  .forge-intro h1 { font-size: 27px; }
  .segmented button { font-size: 15px; }
  .supply-card { grid-template-columns: 88px minmax(0, 1fr); }
  .supply-card .chest-art { width: 85px; }
  .milestones { gap: 3px; }
  .sheet-content { padding-inline: 16px; }
}

@media (min-width: 701px) and (max-height: 600px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; padding-block: 12px; }
  .sidebar .nav { margin-top: 14px; gap: 4px; }
  .sidebar .nav button { min-height: 44px; padding-block: 8px; }
  .side-bottom { flex: none; margin-top: 16px; }
}

@media (orientation: landscape) and (max-height: 540px) {
  .topbar { height: 52px; }
  .forge-intro { padding-block: 5px 8px; }
  .forge-intro .eyebrow { display: none; }
  .forge-intro h1 { margin: 0; font-size: 27px; }
  .forge-top { min-height: 42px; padding: 5px 12px; }
  .forge-top strong { font-size: 22px; }
  .tap-button { min-height: 44px; margin: 8px 12px; width: calc(100% - 24px); }
  .energy-bar { padding-bottom: 8px; }
}

@media (max-width: 700px) and (orientation: landscape) and (max-height: 540px) {
  .sidebar .nav { height: 54px; padding-block: 3px; }
  .sidebar .nav button { min-height: 48px; height: 48px; gap: 2px; font-size: 12px; }
  .sidebar .nav button svg { width: 20px; height: 20px; min-width: 20px; min-height: 20px; flex-basis: 20px; }
}

@media (min-width: 568px) and (orientation: landscape) and (max-height: 540px) {
  .forge-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
  .forge-layout > .aside { grid-template-columns: minmax(0, 1fr); }
}
