/* Aion 2 Market Italia — the tracker (market.html): Market, Crafting, Database and Personaggi views.
   Layout: heading strip, then three columns (categories · table · details). The details column becomes a second row
   under 1400 px and a bottom sheet on phones. Class names are the ones the scripts in js/ generate. */
.win { width: min(1760px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 28px; }

/* ---------- heading strip: where you are + four readings of the server ---------- */
.strip { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 40px; flex-wrap: wrap; margin-bottom: 18px; }
.strip h1 { font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -.025em; }
.upd { margin-top: 6px; color: var(--dim); font-size: 13.5px; }
.upd b { color: var(--text); font-weight: 600; }
.upd.late b { color: var(--down); }
.stats { display: flex; gap: 0; }
.kpi { display: flex; flex-direction: column; gap: 1px; padding: 0 22px; color: var(--dim); font-size: 13px; white-space: nowrap; border-left: 1px solid var(--line); }
.kpi:last-of-type, .kpi:nth-last-of-type(2) { padding-right: 0; }
.kpi b { font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.05; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi.buy b { color: var(--up); } .kpi.sell b { color: var(--kinah); }
.win.dbview .stats, .win.charview .stats { display: none; }
.take { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); font-size: 14px; }
.take.err { border-color: var(--down); }
.dealfilter { display: inline-flex; padding: 3px; gap: 3px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); }
.dealfilter button, .ranges button { all: unset; cursor: pointer; padding: 5px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--dim); }
.dealfilter button:hover, .ranges button:hover { color: var(--text); }
.dealfilter button[aria-pressed="true"], .ranges button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.dealfilter button:focus-visible, .ranges button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- three columns ---------- */
.body { display: grid; grid-template-columns: 216px minmax(0, 1fr) 372px; gap: 14px; align-items: start; }
.win.noside .body { grid-template-columns: minmax(0, 1fr) 372px; }
.win.noside .side { display: none; }
.win.craftview:not(.noside) .body { grid-template-columns: 216px minmax(0, 1fr) 420px; }
.win.craftview.noside .body { grid-template-columns: minmax(0, 1fr) 420px; }
.win.charview .side { display: none; }
.win.charview .body, .win.charview.noside .body { grid-template-columns: minmax(0, 1fr) 420px; }
.side, .main, .aside { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }

/* categories */
.side { position: sticky; top: 74px; max-height: calc(100vh - 88px); overflow: auto; padding: 8px; }
.side .all, .grp > .head, .sub button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: var(--r-sm); }
.side .all, .grp > .head { padding: 9px 12px; font-weight: 600; font-size: 14.5px; }
.side .all { color: var(--dim); }
.side .all span, .grp .head .n, .sub button span { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--dim); font-variant-numeric: tabular-nums; }
.grp > .head .chev { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 3px 0 1px; opacity: .6; }
.grp.open > .head .chev { transform: rotate(45deg); }
.sub { display: none; padding: 0 0 6px; }
.grp.open .sub { display: block; }
.sub button { padding: 6px 12px 6px 31px; font-size: 14px; color: var(--dim); }
.side .all:hover, .grp > .head:hover, .sub button:hover { color: var(--text); background: var(--faint); }
.side [aria-pressed="true"] { color: var(--on-accent); background: var(--accent-fill); }
.side [aria-pressed="true"] span, .side [aria-pressed="true"] .n { color: inherit; opacity: .75; }
.side button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* table column */
.main { padding: 12px; min-width: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.search { flex: 1; min-width: 180px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); }
.search::placeholder { color: var(--dim); }
.search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 999px; }
.tbtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--dim); font-size: 13.5px; font-weight: 600; }
.tbtn:hover { color: var(--text); border-color: var(--accent); }
.tbtn[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
.tbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tbtn svg { width: 16px; height: 16px; flex: none; }
.tbtn.wide { width: 100%; justify-content: center; color: var(--text); }
.charsrv { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); max-width: 230px; }
.grades { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 0 8px; font-size: 13px; }
.grades .lbl { color: var(--dim); margin-right: 4px; }
.grades button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; }
.grades button::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); flex: none; }
.grades button[aria-pressed="false"] { opacity: .4; }
.grades button[aria-pressed="false"]::before { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.grades button:hover { opacity: 1; border-color: currentColor; }
.grades button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grades .reset { color: var(--dim); border: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.grades .reset::before { display: none; }
.grades .g-white { color: var(--g-white); } .grades .g-green { color: var(--g-green); } .grades .g-blue { color: var(--g-blue); } .grades .g-gold { color: var(--g-gold); } .grades .g-orange { color: var(--g-orange); } .grades .g-teal { color: var(--g-teal); }
.win.dbview #grades .g-teal { display: none; }

.scroll { height: calc(100vh - 292px); min-height: 440px; overflow: auto; border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; background: var(--panel); color: var(--dim); font-size: 12.5px; font-weight: 600; text-align: right; padding: 9px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th button { all: unset; cursor: pointer; min-height: 24px; display: inline-flex; align-items: center; }
th button:hover, th button.on { color: var(--text); }
th button.on::after { content: ''; margin-left: 5px; border: 4px solid transparent; border-top-color: var(--accent); transform: translateY(2px); }
th[aria-sort="ascending"] button.on::after { border-top-color: transparent; border-bottom-color: var(--accent); transform: translateY(-2px); }
th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
th .thsep { margin: 0 6px; opacity: .5; }
th:first-child, td:first-child { text-align: left; }
td { padding: 8px 7px; text-align: right; border-bottom: 1px solid var(--faint); font-size: 14.5px; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--faint); }
tbody tr.sel td { background: color-mix(in srgb, var(--accent) 13%, transparent); }
tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.na td { opacity: .5; }
tbody tr.na:hover td, tbody tr.na.sel td { opacity: .85; }
td.up { color: var(--up); } td.down { color: var(--down); } td.dim { color: var(--dim); }
.it { display: flex; align-items: center; gap: 11px; }
.slot { width: 40px; height: 40px; flex: none; border-radius: 10px; overflow: hidden; border: 1.5px solid color-mix(in srgb, currentColor 70%, transparent);
  background: radial-gradient(120% 120% at 50% 100%, color-mix(in srgb, currentColor 38%, #0b0810) 0%, #0b0810 78%); }
:root[data-theme="elysea"] .slot { background: radial-gradient(120% 120% at 50% 100%, color-mix(in srgb, currentColor 30%, #20232e) 0%, #20232e 80%); }
.slot img { width: 100%; height: 100%; display: block; }
.nm { font-size: 15px; font-weight: 600; white-space: normal; line-height: 1.2; }
.ct { display: block; font-size: 12.5px; color: var(--dim); font-weight: 400; }
.pv { display: block; font-size: 12px; line-height: 1.1; margin-top: 2px; }
.sig { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.sig.buy { color: var(--up); border-color: currentColor; background: color-mix(in srgb, var(--up) 12%, transparent); }
.sig.sell { color: var(--kinah); border-color: currentColor; background: color-mix(in srgb, var(--kinah) 12%, transparent); }
.sig.na { border-style: dashed; }
.sig.warn { color: var(--down); border-color: currentColor; border-style: dashed; }
.sig.craftit { color: var(--up); border-color: currentColor; }
.sig.buyit { color: var(--kinah); border-color: currentColor; }
.conf { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.conf.alta { background: var(--up); } .conf.media { background: var(--kinah); } .conf.bassa { background: var(--down); }
.empty { padding: 36px 12px; color: var(--dim); text-align: center; white-space: normal; }
.fav { all: unset; cursor: pointer; flex: none; width: 28px; height: 28px; display: grid; place-items: center; color: var(--dim); opacity: .7; border-radius: 50%; }
.fav svg { width: 19px; height: 19px; }
.fav:hover, .fav[aria-pressed="true"] { opacity: 1; color: var(--g-gold); }
.fav:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
#crows .vs7 { font-size: 12px; font-weight: 600; }
#dbtab td.dbst { color: var(--dim); font-size: 13px; white-space: normal; max-width: 420px; text-align: left; }
#dbtab th:nth-child(2) { text-align: left; }
#chartab td:nth-child(n+2), #chartab th:nth-child(n+2) { text-align: left; }
.dbmore { display: flex; margin: 14px auto 16px; }
@media (max-width: 1700px) { #crafttab .hsk { display: none; } }

/* ---------- details column ---------- */
.aside { position: sticky; top: 74px; max-height: calc(100vh - 88px); overflow: auto; padding: 18px; }
.aside h2 { font-size: 15px; font-weight: 600; color: var(--dim); font-family: var(--font); letter-spacing: 0; }
.aside p { margin: 6px 0 10px; color: var(--dim); font-size: 13.5px; }
.sheetclose, .sheetbg { display: none; }
.pick { display: flex; gap: 12px; align-items: center; margin: 8px 0 12px; }
.pick .slot { width: 56px; height: 56px; border-radius: 13px; }
.pick .nm { font-family: var(--display); font-size: 23px; font-weight: 600; letter-spacing: -.015em; line-height: 1.12; }
.pick .slot.face.big { width: 64px; height: 64px; }
.favbig { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); font-size: 13.5px; font-weight: 600; }
.favbig.fav { width: auto; height: auto; opacity: 1; color: var(--text); }
.favbig svg { width: 17px; height: 17px; color: var(--g-gold); }
.favbig:hover { border-color: var(--g-gold); }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin: 0 0 14px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--card); }
.hero div { color: var(--dim); font-size: 13px; }
.hero b { display: block; font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -.02em; color: var(--text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.hero b.up { color: var(--up); } .hero b.down { color: var(--down); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 14px; }
.facts div { color: var(--dim); font-size: 13px; }
.facts b { display: block; color: var(--text); font-weight: 600; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.facts b.up { color: var(--up); } .facts b.down { color: var(--down); }
.facts .meter, .facts .range { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.facts .meter::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--accent); border-radius: 3px; }
.facts .range { overflow: visible; background: linear-gradient(90deg, var(--up), var(--line) 50%, var(--kinah)); }
.facts .range::after { content: ''; position: absolute; top: -3px; left: calc(var(--v) - 2px); width: 4px; height: 12px; border-radius: 2px; background: var(--text); }
.facts .rlh { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--dim); }
.ranges { display: inline-flex; padding: 3px; gap: 2px; margin: 2px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); }
.ranges button { padding: 3px 11px; font-size: 13px; }
.chart { position: relative; min-height: 210px; }
.tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px; white-space: nowrap; box-shadow: var(--shadow); }
.tip .d { color: var(--dim); }

/* the same item on the other servers */
.xserver { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.xserver h3, .craft h3, .alertbox h3 { font-family: var(--font); font-size: 13.5px; font-weight: 700; letter-spacing: 0; margin: 0 0 8px; }
.xs { list-style: none; margin: 0 0 8px; padding: 0; }
.xs button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; font-size: 13.5px; }
.xs button:hover { background: var(--faint); }
.xs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.xs .xn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.xs .xbar { height: 6px; border-radius: 3px; background: var(--faint); position: relative; }
.xs .xbar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 3px; background: var(--dim); }
.xs .xp { font-variant-numeric: tabular-nums; font-weight: 600; }
.xs button[aria-current="true"] { cursor: default; } .xs button[aria-current="true"] .xn { color: var(--text); font-weight: 700; } .xs button[aria-current="true"] .xbar::after { background: var(--accent); }

/* price alerts */
.alertbox { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field); font-size: 13.5px; }
.alertbox p { margin: 0; color: var(--dim); }
.alertbox ul { list-style: none; margin: 0 0 8px; padding: 0; } .alertbox li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.alertbox li button { all: unset; cursor: pointer; color: var(--dim); padding: 0 6px; } .alertbox li button:hover { color: var(--text); }
.alertbox form { display: flex; gap: 6px; flex-wrap: wrap; }
.alertbox select, .alertbox input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; min-width: 0; }
.alertbox input { width: 110px; flex: 1; }
.alertbox form > button { cursor: pointer; border: 0; border-radius: 8px; padding: 6px 14px; background: var(--accent-fill); color: var(--on-accent); font-weight: 700; }
.alertbox .prev { flex-basis: 100%; font-size: 12px; margin-top: 2px; }
.alertbox .chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.alertbox .chips button { all: unset; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--dim); line-height: 1.25; }
.alertbox .chips button b { font-size: 13px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.alertbox .chips button:hover, .alertbox .chips button:focus-visible { border-color: var(--accent); color: var(--text); }
.alertbox .err { margin-top: 6px; }

/* help */
details.help { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; font-size: 13.5px; color: var(--dim); line-height: 1.5; }
details.help summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 28px; font-weight: 600; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary::before { content: "?"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; }
details.help summary:hover { color: var(--text); }
details.help[open] summary { margin-bottom: 8px; }
.help p { margin: 0 0 8px; } .help b { color: var(--text); font-weight: 600; }

/* crafting chain, database and character details (all drawn inside #craftdetail) */
.craft .step { --gc: var(--g-white); margin: 12px 0 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--field); }
.craft .stephead { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.craft .stephead::-webkit-details-marker { display: none; }
.craft .step:not([open]) .stephead { border-bottom-color: transparent; }
.craft .badge { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: #14101a; background: var(--gc); }
:root[data-theme="elysea"] .craft .badge { color: #fff; }
.craft .res { font-weight: 700; font-size: 15px; color: var(--gc); line-height: 1.2; }
.craft .stephead:hover .res { text-decoration: underline; text-underline-offset: 3px; }
.craft .schev { flex: none; width: 7px; height: 7px; border-right: 2px solid var(--gc); border-bottom: 2px solid var(--gc); transform: rotate(45deg); margin: 0 2px 3px; transition: transform .15s; }
.craft .step:not([open]) .schev { transform: rotate(-45deg); margin-bottom: 0; }
.craft .stot { margin-left: auto; color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.craft .step[open] .stot { visibility: hidden; }
.craft .stepinfo { margin: 0; padding: 7px 12px 8px; color: var(--dim); font-size: 13px; }
.craft table { table-layout: fixed; font-size: 14px; }
.craft td { padding: 6px 12px; border-bottom: 1px solid var(--faint); vertical-align: middle; font-size: 14px; }
.craft td:first-child { width: 70%; white-space: normal; }
.craft td.n { text-align: right; white-space: nowrap; }
.craft .mat { display: flex; align-items: center; gap: 8px; min-width: 0; }
.craft .mat > div { min-width: 0; }
.craft .mat .slot { width: 28px; height: 28px; border-radius: 7px; }
.craft .mat .nm { font-size: 14px; overflow-wrap: anywhere; }
.craft .via { display: block; color: var(--dim); font-size: 12.5px; overflow-wrap: anywhere; }
.craft tr.est td { color: var(--dim); font-size: 13px; }
.craft .tot td { border-bottom: 0; font-weight: 700; color: var(--gc); }
.craft .note { color: var(--dim); font-size: 13px; margin-top: 14px; }
.craft .dbgo { width: 100%; justify-content: center; margin: 0 0 12px; color: var(--text); }
.craft h3 { margin: 16px 0 8px; color: var(--dim); }
.dbstats { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.dbstats li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; font-size: 14px; }
.dbstats li + li { border-top: 1px solid var(--line); }
.dbstats b { font-variant-numeric: tabular-nums; font-weight: 600; }
.dbdesc { white-space: pre-line; font-size: 14px; line-height: 1.5; margin: 0; }
.slot.face { border-radius: 50%; border-color: var(--line); background: var(--field); }
.slot.face img { object-fit: cover; }
.gear { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.gear li { display: flex; align-items: center; gap: 10px; }
.gear .slot { width: 34px; height: 34px; border-radius: 8px; }
.gear .nm { background: none; border: 0; padding: 0; margin: 0; text-align: left; cursor: pointer; font-weight: 600; font-size: 14px; display: block; }
.gear .nm:hover { text-decoration: underline; }
.boards li { align-items: center; }
.boards .bbar { flex: 1; height: 6px; border-radius: 3px; background: var(--faint); position: relative; overflow: hidden; margin: 0 4px; }
.boards .bbar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--accent); border-radius: 3px; }
.spark { margin: 6px 0 14px; }
.spark .sparkh { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--dim); }
.spark .sparkh b { color: var(--text); }
.spark svg { width: 100%; height: 90px; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- narrower screens ---------- */
@media (max-width: 1640px) {
  .body { grid-template-columns: 196px minmax(0, 1fr) 340px; gap: 12px; } .win.noside .body { grid-template-columns: minmax(0, 1fr) 340px; } .aside { padding: 16px; }
  .win.craftview:not(.noside) .body { grid-template-columns: 196px minmax(0, 1fr) 360px; } .win.craftview.noside .body, .win.charview .body, .win.charview.noside .body { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1400px) {
  .body, .win.craftview:not(.noside) .body { grid-template-columns: 216px minmax(0, 1fr); }
  .win.noside .body, .win.craftview.noside .body, .win.charview .body, .win.charview.noside .body { grid-template-columns: minmax(0, 1fr); }
  .aside { grid-column: 1 / -1; position: static; max-height: none; }
  .aside > section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
  .aside > section > h2, .aside > section > .pick, .aside > section > #craftdetail { grid-column: 1 / -1; }
}
@media (max-width: 1100px) { .hm { display: none; } .strip { align-items: flex-start; flex-direction: column; } .kpi:first-child { padding-left: 0; border-left: 0; } }
@media (max-width: 760px) {
  .win { width: 100%; padding: 14px 10px 24px; }
  .strip { gap: 12px; margin-bottom: 12px; }
  .stats { width: 100%; }
  .kpi { flex: 1; padding: 0 10px; font-size: 12px; white-space: normal; line-height: 1.25; } .kpi b { font-size: 21px; }
  .body, .win.noside .body, .win.craftview:not(.noside) .body { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .side { position: static; max-height: none; }
  .main { padding: 10px 8px; }
  .scroll { height: auto; max-height: 76vh; min-height: 0; }
  .hn { display: none; }
  .tbtn span { display: none; } .tbtn { padding: 0 11px; }
  td, th { padding: 7px 5px; } th { white-space: normal; } td { font-size: 14px; }
  .slot { width: 34px; height: 34px; border-radius: 8px; } .it { gap: 8px; } .nm { font-size: 14.5px; }
  /* details as a sheet sliding up from the bottom */
  .aside { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 71; max-height: 86vh; overflow-y: auto; margin: 0; border-radius: 20px 20px 0 0; border-bottom: 0;
    box-shadow: 0 -12px 34px rgba(0, 0, 0, .5); transform: translateY(105%); transition: transform .25s ease; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .aside > section { display: block; }
  body.sheet-open .aside { transform: none; }
  body.sheet-open { overflow: hidden; }
  .sheetbg { position: fixed; inset: 0; z-index: 70; background: rgba(8, 4, 14, .6); }
  body.sheet-open .sheetbg { display: block; }
  .sheetclose { display: grid; place-items: center; position: sticky; top: 0; float: right; z-index: 2; width: 38px; height: 38px; margin: -4px -4px 0 8px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--text); cursor: pointer; }
  .sheetclose svg { width: 14px; height: 14px; }
  .hero b { font-size: 23px; }
}
