.ax-root {
    --ax-panel-a: #193329;
    --ax-panel-b: #0d1d18;
    --ax-edge: rgba(106, 157, 132, 0.28);
    --ax-card: rgba(255, 255, 255, 0.024);
    --ax-card-edge: #456454;
    --ax-title: #f0deb3;
    --ax-name: #dfc58d;
    --ax-label: #b9c9bc;
    --ax-text: #dbe7dd;
    --ax-dim: #8fa596;
    --ax-btn: #10241e;
    --ax-btn-edge: #78937d;
    --ax-input: #091c15;
    --ax-input-edge: #55765e;
    --ax-gold: #e9c46a;
    --ax-gold-hi: #ffe08a;
    --ax-jade: #5fd3b0;
    --ax-red: #e26d5a;
    --ax-pair: #f2c14e;
    --ax-mod: #b48cff;
    --ax-feed: #4fd1c5;
    --ax-calm: #7fb2ff;
    --ax-wux: #9ad07a;
    position: relative;
    width: 100%;
    color: var(--ax-text);
    font-size: 14px;
    padding: 0 4px 80px;
}

.ax-root *, .ax-root *::before, .ax-root *::after { box-sizing: border-box; }
.ax-root button, .ax-root input { font: inherit; color: inherit; }
.ax-root button { cursor: pointer; }
.ax-root button:disabled { cursor: default; opacity: 0.5; }

.ax-window {
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--ax-edge);
    background: linear-gradient(140deg, var(--ax-panel-a), var(--ax-panel-b));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 18px 22px 22px;
}

.ax-titlebar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid rgba(201, 162, 39, 0.28); }
.ax-titlebar h1 { margin: 0; font-family: Georgia, serif; font-weight: 600; font-size: 22px; color: var(--ax-title); letter-spacing: 0.3px; }
.ax-close { width: 40px; height: 40px; border-radius: 8px; background: #142b21; border: 1px solid #638168; color: var(--ax-title); font-size: 20px; }

.ax-tabs { display: flex; gap: 8px; justify-content: center; margin: 0 0 12px; }
.ax-tabs button { min-width: 150px; padding: 9px 18px; border-radius: 7px; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--ax-card-edge); color: var(--ax-label); font-family: Georgia, serif; font-size: 16px; }
.ax-tabs button.is-active { color: var(--ax-title); border-color: var(--ax-gold); background: linear-gradient(180deg, rgba(233, 196, 106, 0.14), rgba(233, 196, 106, 0.03)); box-shadow: inset 0 0 0 1px rgba(233, 196, 106, 0.25); }

.ax-panel { border-radius: 10px; border: 1px solid var(--ax-card-edge); background: var(--ax-card); padding: 14px; min-width: 0; }
.ax-label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ax-label); }
.ax-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ax-label-row--center { justify-content: center; margin-top: 12px; }
.ax-label-row b { font-variant-numeric: tabular-nums; color: var(--ax-text); }
.ax-root .is-bad { color: var(--ax-red); }

.ax-root [data-tip] { position: relative; }
.ax-root [data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; padding: 5px 9px; border-radius: 6px; background: #0a1712; border: 1px solid var(--ax-btn-edge); color: var(--ax-title); font-size: 12px; z-index: 20; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }

.ax-tile { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; border-radius: 8px; background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.28)); border: 1px solid var(--ax-card-edge); }
.ax-tile::before { content: ''; position: absolute; top: 3px; right: 3px; width: 0; height: 0; border-top: 9px solid var(--w); border-left: 9px solid transparent; border-top-right-radius: 4px; opacity: 0.9; }
.ax-tile img { width: 78%; height: 78%; object-fit: contain; image-rendering: pixelated; }
.ax-tile img.is-tinted { filter: hue-rotate(var(--hue)) saturate(1.35) brightness(1.05); }
.ax-tile--md { width: 58px; height: 58px; }
.ax-tile--sm { width: 40px; height: 40px; }
.ax-tile--xs { width: 30px; height: 30px; border-radius: 6px; }
.ax-tile--xs::before { display: none; }
.ax-tile--ring { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(201, 162, 39, 0.55); background: radial-gradient(circle at 50% 40%, rgba(80, 140, 100, 0.25), rgba(5, 15, 10, 0.85)); box-shadow: 0 0 14px rgba(0, 0, 0, 0.5); }
.ax-tile--ring::before { top: auto; bottom: -1px; right: 50%; transform: translateX(50%); border: 0; width: 22px; height: 3px; border-radius: 2px; background: var(--w); }
.ax-tile.is-empty { border-style: dashed; opacity: 0.45; }
.ax-tile.is-empty::before { display: none; }
.ax-tile.is-target { opacity: 1; border-color: var(--ax-gold); box-shadow: 0 0 12px rgba(233, 196, 106, 0.45); }
.ax-tile.is-lacking { opacity: 0.4; }
.ax-tile__count { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 700; color: #f3ead2; text-shadow: 0 1px 2px #000, 0 0 3px #000; font-variant-numeric: tabular-nums; }
.ax-role { position: absolute; left: 3px; top: 3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 4px; font-style: normal; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; color: #0b1611; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.ax-tile--ring .ax-role { left: -2px; top: -2px; }
.ax-role--E { background: #a8bfae; }
.ax-role--D { background: var(--ax-pair); }
.ax-role--M { background: var(--ax-mod); }
.ax-role--L { background: linear-gradient(135deg, #ffb347, #ff7b5c); }

.ax-cauldron-layout { display: grid; grid-template-columns: minmax(0, 600px) 340px; gap: 16px; align-items: stretch; justify-content: center; }

.ax-bag { margin-top: 16px; }
.ax-bag__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ax-bag__filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ax-facet { position: relative; }
.ax-facet__btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--ax-gold); background: var(--ax-btn); color: var(--ax-title); font-size: 12px; font-weight: 600; }
.ax-facet__btn.is-open { box-shadow: 0 0 0 1px rgba(233, 196, 106, 0.35), 0 0 10px rgba(233, 196, 106, 0.2); }
.ax-facet__caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.ax-facet__btn.is-open .ax-facet__caret { transform: rotate(180deg); }
.ax-facet__menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; min-width: 210px; padding: 10px; border-radius: 9px; border: 1px solid var(--ax-gold); background: linear-gradient(140deg, var(--ax-panel-a), var(--ax-panel-b)); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.ax-facet__bulk { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--ax-card-edge); }
.ax-facet__bulk button { padding: 3px 10px; border-radius: 6px; border: 1px solid var(--ax-card-edge); background: transparent; color: var(--ax-label); font-size: 12px; }
.ax-facet__row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 2px; border: 0; background: transparent; color: var(--ax-dim); font-size: 13px; text-align: left; }
.ax-facet__row.is-on { color: var(--ax-text); }
.ax-facet__row span { flex: 1; white-space: nowrap; }
.ax-facet__row small { color: var(--ax-dim); font-variant-numeric: tabular-nums; }
.ax-facet__check { width: 14px; height: 14px; flex: none; border-radius: 3px; border: 1px solid var(--ax-btn-edge); background: var(--ax-input); }
.ax-facet__row.is-on .ax-facet__check { border-color: var(--ax-jade); background: radial-gradient(circle, var(--ax-jade) 45%, transparent 50%), var(--ax-input); }
.ax-facet__dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--w) 70%, #fff), var(--w) 55%, color-mix(in srgb, var(--w) 60%, #000)); }
.ax-role--inline { position: static; flex: none; }
.ax-bag__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; padding: 2px; align-content: start; }
.ax-herb { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 10px 6px 7px; border-radius: 9px; border: 1px solid var(--ax-card-edge); background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.28)); text-align: left; }
.ax-herb::before { content: ''; position: absolute; top: 3px; right: 3px; width: 0; height: 0; border-top: 10px solid var(--w); border-left: 10px solid transparent; border-top-right-radius: 5px; opacity: 0.9; }
.ax-herb:hover { border-color: var(--ax-gold); }
.ax-herb.is-lacking { opacity: 0.4; }
.ax-herb__art { position: relative; display: flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; }
.ax-herb__art img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.ax-herb__art img.is-tinted { filter: hue-rotate(var(--hue)) saturate(1.35) brightness(1.05); }
.ax-herb__art .ax-role { left: -3px; top: -3px; }
.ax-herb__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ax-herb__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ax-name); font-size: 12px; font-weight: 600; line-height: 1.2; }
.ax-herb__meta { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 10.5px; }
.ax-herb__count { color: #f3ead2; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ax-herbtip { --ax-pair: #f2c14e; --ax-mod: #b48cff; position: fixed; z-index: 1000010; width: 270px; max-width: calc(100vw - 16px); padding: 10px 12px; border-radius: 8px; border: 1px solid #78937d; background: linear-gradient(140deg, #193329, #0d1d18); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55); color: #dbe7dd; font-size: 12.5px; line-height: 1.4; pointer-events: none; }
.ax-herbtip__name { display: block; margin-bottom: 4px; font-family: Georgia, serif; font-size: 15px; font-weight: 600; }
.ax-herbtip__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid #456454; color: #b9c9bc; font-size: 11.5px; }
.ax-herbtip p { margin: 0 0 3px; }
.ax-herbtip p:last-child { margin-bottom: 0; }
.ax-herbtip__mech { color: #b48cff; font-weight: 600; }
.ax-herbtip__heat.is-hot { color: #ffb86b; }
.ax-herbtip__heat.is-cold { color: #7fb2ff; }
.ax-empty { grid-column: 1 / -1; text-align: center; color: var(--ax-dim); padding: 18px 0; }

.ax-ring-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 560px; }
.ax-ring-box { display: flex; justify-content: center; width: 100%; }
.ax-ring { position: relative; width: min(560px, 100%); aspect-ratio: 1; }
.ax-ring__glyph { position: absolute; inset: 24%; border-radius: 50%; border: 1px solid rgba(95, 211, 176, 0.25); box-shadow: inset 0 0 0 10px rgba(95, 211, 176, 0.04), inset 0 0 0 11px rgba(95, 211, 176, 0.18), 0 0 80px rgba(95, 211, 176, 0.18); background: radial-gradient(circle, rgba(95, 211, 176, 0.18), transparent 65%); }
.ax-cauldron { position: absolute; left: 50%; top: 50%; width: 42%; transform: translate(-50%, -46%); image-rendering: pixelated; filter: drop-shadow(0 0 24px rgba(120, 220, 120, 0.35)); pointer-events: none; }
.ax-slot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.ax-slot__num { position: absolute; top: -22px; width: 22px; height: 22px; border-radius: 50%; background: #0c1a14; border: 1px solid rgba(201, 162, 39, 0.6); color: var(--ax-title); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; }
.ax-bead { position: absolute; width: 14px; height: 14px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--b) 45%, color-mix(in srgb, var(--b) 50%, #000)); box-shadow: 0 0 10px var(--b), 0 0 3px var(--b); z-index: 1; }
.ax-bead--pair { --b: var(--ax-pair); width: 18px; height: 18px; }
.ax-bead--mod { --b: var(--ax-mod); width: 16px; height: 16px; }
.ax-bead--feed { --b: var(--ax-feed); }
.ax-bead--calm { --b: var(--ax-calm); }
.ax-bead--wux { --b: var(--ax-wux); width: 11px; height: 11px; }
.ax-bead--clash { --b: var(--ax-red); }
.ax-bead--none { --b: #50685a; width: 7px; height: 7px; box-shadow: none; opacity: 0.7; }
.ax-ring-actions { display: flex; gap: 8px; justify-content: center; }

.ax-result { display: flex; flex-direction: column; gap: 10px; }
.ax-meters { display: flex; flex-direction: column; gap: 10px; }
.ax-result__card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ax-card-edge); background: radial-gradient(circle at 50% 30%, rgba(233, 196, 106, 0.08), rgba(0, 0, 0, 0.15) 70%); }
.ax-result__head { display: flex; align-items: center; gap: 12px; }
.ax-result__info { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.ax-result__info .ax-pill-name { text-align: left; font-size: 18px; }
.ax-result__chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ax-result__head .ax-pill { flex: none; width: 64px; height: 64px; }
.ax-result__head .ax-pill--unknown { width: 58px; height: 58px; margin: 3px; }
.ax-result__head .ax-pill--unknown b { font-size: 26px; }
.ax-pill { width: 92px; height: 92px; image-rendering: pixelated; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--g) 70%, transparent)); }
.ax-pill--unknown { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; width: 80px; height: 80px; margin: 6px; background: radial-gradient(circle at 40% 35%, #23332c, #050b08 70%); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 22px rgba(95, 211, 176, 0.25); filter: none; }
.ax-pill--unknown b { font-family: Georgia, serif; font-size: 34px; color: #4c6658; }
.ax-pill--card { width: 54px; height: 54px; margin: 0; }
.ax-pill--card b { font-size: 24px; }
.ax-pill--lg { width: 96px; height: 96px; }
.ax-pill--xl { width: 120px; height: 120px; margin: 8px auto; }
.ax-pill--xl b { font-size: 48px; }
.ax-pill-name { margin: 0; font-family: Georgia, serif; font-weight: 600; font-size: 20px; color: var(--ax-name); text-align: center; }
.ax-pill-name.is-unknown { color: #6f8a7a; letter-spacing: 3px; }
.ax-grade { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--g); padding: 2px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--g) 55%, transparent); background: color-mix(in srgb, var(--g) 10%, transparent); }
.ax-wchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--w); border: 1px solid color-mix(in srgb, var(--w) 40%, transparent); background: color-mix(in srgb, var(--w) 8%, transparent); }
.ax-wchip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--w); box-shadow: 0 0 6px var(--w); }
.ax-sim { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 4px; }
.ax-sim__bar { position: relative; flex: 1; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(201, 162, 39, 0.35); }
.ax-sim__bar i { position: absolute; inset: 1px auto 1px 1px; border-radius: 4px; background: linear-gradient(90deg, #b8892a, var(--ax-gold-hi)); }
.ax-sim.is-unknown .ax-sim__bar i { background: linear-gradient(90deg, #2c7f6c, #6fe3c8); }
.ax-sim__bar em { position: absolute; left: 75%; top: -4px; bottom: -4px; width: 2px; background: #f7efd8; border-radius: 1px; }
.ax-sim b { font-variant-numeric: tabular-nums; color: var(--ax-title); min-width: 40px; text-align: right; }

.ax-effects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ax-effects li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; background: rgba(0, 0, 0, 0.18); border: 1px solid rgba(69, 100, 84, 0.6); }
.ax-effects b { color: #9be7a9; font-variant-numeric: tabular-nums; }
.ax-dotstat { width: 9px; height: 9px; border-radius: 2px; background: var(--s); transform: rotate(45deg); }
.ax-perm { display: inline-block; width: 10px; height: 10px; margin-left: 7px; border: 2px solid var(--ax-gold); border-radius: 2px; transform: rotate(45deg); vertical-align: 1px; }

.ax-cells { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.ax-cells i { height: 16px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.25); }
.ax-cells i.is-on { background: linear-gradient(180deg, #ffe08a, #c9962e); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.ax-cells i.is-over { background: repeating-linear-gradient(45deg, #b8473a 0 4px, #5a201b 4px 8px); }
.ax-bar { position: relative; display: block; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(69, 100, 84, 0.8); overflow: hidden; }
.ax-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b8892a, var(--ax-gold-hi)); }
.ax-bar--impurity i { background: linear-gradient(90deg, #6b5bd6, #b48cff); }
.ax-fire { position: relative; display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #3a7bd5, #2c4a5a 35%, #4a3a20 60%, #ff8a3d 85%, #ffd166); border: 1px solid rgba(0, 0, 0, 0.4); }
.ax-fire i { position: absolute; top: 50%; width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #ffb347 60%, #c46a1c); border: 2px solid #3a1d08; box-shadow: 0 0 8px rgba(255, 160, 60, 0.7); }
.ax-fire-input { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
.ax-fire-input::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.45); background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(247, 239, 216, 0.75) calc(50% - 1px), rgba(247, 239, 216, 0.75) calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(90deg, #3a7bd5, #2c4a5a 35%, #4a3a20 60%, #ff8a3d 85%, #ffd166); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.ax-fire-input::-moz-range-track { height: 8px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.45); background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(247, 239, 216, 0.75) calc(50% - 1px), rgba(247, 239, 216, 0.75) calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(90deg, #3a7bd5, #2c4a5a 35%, #4a3a20 60%, #ff8a3d 85%, #ffd166); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.ax-fire-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #ffb347 60%, #c46a1c); border: 2px solid #3a1d08; box-shadow: 0 0 8px rgba(255, 160, 60, 0.7); transition: transform 0.12s ease; }
.ax-fire-input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #ffb347 60%, #c46a1c); border: 2px solid #3a1d08; box-shadow: 0 0 8px rgba(255, 160, 60, 0.7); }
.ax-fire-input:hover::-webkit-slider-thumb { transform: scale(1.12); }
.ax-fire-input:focus-visible { outline: 2px solid var(--ax-gold); outline-offset: 3px; border-radius: 6px; }
.ax-fire-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.ax-upgrade { padding: 4px 10px; font-size: 12px; }

.ax-bake { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: auto; }
.ax-bake small { text-align: center; color: var(--ax-dim); font-variant-numeric: tabular-nums; }
.ax-btn { padding: 9px 16px; border-radius: 7px; border: 1px solid var(--ax-btn-edge); background: var(--ax-btn); color: #c8d9cc; }
.ax-btn--gold { border-color: var(--ax-gold); color: var(--ax-title); background: linear-gradient(180deg, #1f3b2e, #10241e); box-shadow: inset 0 0 0 1px rgba(233, 196, 106, 0.2); font-family: Georgia, serif; font-weight: 600; }
.ax-btn--big { min-height: 50px; font-size: 19px; }
.ax-btn--jade { margin-top: 6px; width: 100%; border-color: var(--ax-jade); color: #bff3e2; background: linear-gradient(180deg, #1b4636, #10281f); font-family: Georgia, serif; font-size: 16px; }
.ax-btn--danger { border-color: #9e5246; color: #f2b3a6; }
.ax-btn--load { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: 1; }
.ax-btn--load img { width: 34px; height: 34px; image-rendering: pixelated; }

.ax-backdrop { position: absolute; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 60px; background: rgba(3, 8, 6, 0.72); border-radius: 12px; }
.ax-window--modal { width: 440px; max-width: calc(100% - 24px); }
.ax-save { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; }
.ax-input { width: 100%; padding: 10px 12px; border-radius: 6px; background: var(--ax-input); border: 1px solid var(--ax-input-edge); }
.ax-input--name { text-align: center; font-family: Georgia, serif; font-size: 18px; color: var(--ax-name); }
.ax-sig { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.ax-sig li { display: grid; grid-template-columns: 40px 1fr 46px; gap: 10px; align-items: center; }
.ax-sig b { text-align: right; font-variant-numeric: tabular-nums; color: var(--ax-title); }
.ax-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ax-src { padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--ax-card-edge); color: var(--ax-label); background: rgba(0, 0, 0, 0.2); }
.ax-stat { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--s); border: 1px solid color-mix(in srgb, var(--s) 45%, transparent); background: color-mix(in srgb, var(--s) 9%, transparent); }
.ax-actions { display: flex; gap: 10px; justify-content: center; width: 100%; margin-top: 14px; }

.ax-wtabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.ax-wtab { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 7px; border: 1px solid var(--ax-card-edge); background: rgba(0, 0, 0, 0.18); }
.ax-wtab span { font-family: Georgia, serif; font-size: 14px; color: var(--w); }
.ax-wtab b { font-size: 12px; color: var(--ax-label); font-variant-numeric: tabular-nums; }
.ax-wtab.is-active { border-color: var(--ax-gold); background: linear-gradient(180deg, rgba(233, 196, 106, 0.12), rgba(233, 196, 106, 0.02)); box-shadow: inset 0 0 0 1px rgba(233, 196, 106, 0.2); }
.ax-toolbar { display: flex; gap: 12px; margin: 12px 0; }
.ax-search { position: relative; flex: 1; }
.ax-search i { position: absolute; left: 14px; top: 50%; width: 13px; height: 13px; border: 2px solid var(--ax-label); border-radius: 50%; transform: translateY(-60%); }
.ax-search i::after { content: ''; position: absolute; right: -6px; bottom: -5px; width: 6px; height: 2px; background: var(--ax-label); transform: rotate(45deg); }
.ax-search .ax-input { padding-left: 40px; }
.ax-seg { display: flex; gap: 6px; }
.ax-seg button { min-width: 96px; border-radius: 6px; border: 1px solid var(--ax-card-edge); background: var(--ax-btn); color: var(--ax-label); font-family: Georgia, serif; }
.ax-seg button.is-active { border-color: var(--ax-gold); color: var(--ax-title); }
.ax-codex-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ax-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ax-entry { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 10px 14px; border-radius: 9px; border: 1px solid var(--ax-card-edge); background: var(--ax-card); }
.ax-entry:hover { border-color: rgba(233, 196, 106, 0.5); }
.ax-entry.is-selected { border-color: var(--ax-gold); box-shadow: 0 0 0 1px rgba(233, 196, 106, 0.3), 0 0 22px rgba(233, 196, 106, 0.12); }
.ax-entry > .ax-badge:first-child { position: absolute; top: 8px; right: 8px; }
.ax-entry__art { width: 60px; height: 60px; image-rendering: pixelated; }
.ax-entry__name { font-family: Georgia, serif; font-size: 16px; color: var(--ax-name); text-align: center; }
.ax-entry.is-hidden .ax-entry__name { color: #5f7a6b; letter-spacing: 2px; }
.ax-entry__sig { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ax-ghost { width: 30px; height: 30px; border-radius: 6px; background: radial-gradient(circle, #1a2a23, #08110d); border: 1px dashed #3a5546; }
.ax-ghost--lg { width: 40px; height: 40px; }
.ax-badge { font-size: 11px; padding: 2px 8px; border-radius: 5px; border: 1px solid #8b7a52; color: #e8d8ae; background: rgba(0, 0, 0, 0.3); font-family: Georgia, serif; }
.ax-badge--mine { border-color: #3f9c80; color: #a8ecd8; }
.ax-badge--legend { border-color: #c77b3a; color: #ffc285; }

.ax-detail { display: flex; flex-direction: column; gap: 12px; }
.ax-detail__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ax-detail__head h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; font-weight: 600; color: var(--ax-title); }
.ax-detail__art { width: 110px; height: 110px; margin: 4px auto; image-rendering: pixelated; filter: drop-shadow(0 0 16px rgba(233, 196, 106, 0.35)); }
.ax-sig--ghost .ax-bar { opacity: 0.4; }
.ax-ess-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ax-ess { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 7px; border: 1px solid var(--ax-card-edge); background: var(--ax-btn); }
.ax-ess span { font-size: 13px; color: var(--w); font-weight: 600; }
.ax-ess small { font-size: 11px; color: var(--ax-dim); font-variant-numeric: tabular-nums; }
.ax-ess.is-active { border-color: var(--ax-gold); box-shadow: inset 0 0 0 1px rgba(233, 196, 106, 0.2); }

@media (max-width: 1180px) {
    .ax-cauldron-layout { grid-template-columns: minmax(0, 1fr) 320px; }
    .ax-wtabs { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 760px) {
    .ax-root { padding: 0 0 80px; }
    .ax-window { padding: 14px 12px 16px; }
    .ax-cauldron-layout, .ax-codex-layout { grid-template-columns: minmax(0, 1fr); }
    .ax-ring-wrap { min-height: 0; }
    .ax-bag__head { justify-content: center; }
    .ax-bag__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .ax-facet__menu { right: auto; left: 0; }
    .ax-tile--ring { width: 44px; height: 44px; }
    .ax-slot__num { width: 18px; height: 18px; top: -16px; font-size: 10px; }
    .ax-tabs button { min-width: 0; flex: 1; }
    .ax-wtabs { display: flex; overflow-x: auto; }
    .ax-wtab { min-width: 120px; }
    .ax-toolbar { flex-direction: column; }
    .ax-seg button { flex: 1; min-width: 0; padding: 8px; }
    .ax-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 761px) {
    body:not(.mobile) .structure-ui--panel:has(#alchemy .ax-root) .modal-inner.ui-modal { height: 90dvh !important; max-height: 90dvh !important; }
    body:not(.mobile) .structure-ui--panel:has(#alchemy .ax-root) .structure-ui__controls { position: relative; flex: none; align-items: center; gap: 6px; padding: 6px 10px; grid-template-columns: 36px minmax(0, 1fr) auto; }
    body:not(.mobile) .structure-ui--panel:has(#alchemy .ax-root) .structure-ui__controls button { width: 36px; height: 36px; min-height: 36px; padding: 5px; }
    body:not(.mobile) .structure-ui--panel:has(#alchemy .ax-root) .structure-ui__controls svg { width: 24px; height: 24px; }
    body:not(.mobile) .structure-ui--panel:has(#alchemy .ax-root) .structure-ui__title { margin: 0; font-size: 22px; }
    body:not(.mobile) .structure-ui--panel:has(#alchemy .ax-root) .ui-modal__content { padding-top: 12px; }
    body:not(.mobile) .structure-ui--panel .ui-modal__content:has(.ax-root) { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow-y: auto; padding-bottom: 14px; }
    body:not(.mobile) .structure-ui--panel #alchemy:has(.ax-root) { display: flex !important; flex-direction: column; flex: 1; min-height: 0; margin: 0; padding: 0; }
    body:not(.mobile) .structure-ui--panel :is(#alchemy-container, #alchemy .elemental-nodes-tab, #pill-crafting-container):has(.ax-root) { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; padding: 0; }
    body:not(.mobile) .structure-ui--panel .ax-root { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; }
    body:not(.mobile) .structure-ui--panel .ax-tabs { flex: none; margin-bottom: 10px; }
    body:not(.mobile) .structure-ui--panel .ax-brew { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
    body:not(.mobile) .structure-ui--panel .ax-cauldron-layout { flex: 3 1 0; min-height: 260px; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr); }
    body:not(.mobile) .structure-ui--panel .ax-ring-wrap { min-height: 0; justify-content: stretch; gap: 8px; }
    body:not(.mobile) .structure-ui--panel .ax-ring-box { flex: 1; min-height: 0; align-items: center; container-type: size; }
    body:not(.mobile) .structure-ui--panel .ax-ring { width: calc(min(100cqw, 100cqh) - 26px); margin-top: 18px; }
    body:not(.mobile) .structure-ui--panel .ax-tile--ring { width: clamp(34px, 11cqmin, 64px); height: clamp(34px, 11cqmin, 64px); }
    body:not(.mobile) .structure-ui--panel .ax-ring-actions { flex: none; width: min(100%, 560px); padding: 8px 12px; }
    body:not(.mobile) .structure-ui--panel .ax-ring-actions > div:first-child { flex: 1; min-width: 0; }
    body:not(.mobile) .structure-ui--panel .ax-ring-actions > div:first-child { display: flex; align-items: center; gap: 10px; }
    body:not(.mobile) .structure-ui--panel .ax-ring-actions .ax-label-row { margin: 0; gap: 6px; flex: none; }
    body:not(.mobile) .structure-ui--panel .ax-ring-actions .ax-fire-row { flex: 1; }
    body:not(.mobile) .structure-ui--panel .ax-result { min-height: 0; gap: 8px; padding: 12px; overflow-y: auto; }
    body:not(.mobile) .structure-ui--panel .ax-result__label { display: none; }
    body:not(.mobile) .structure-ui--panel .ax-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    body:not(.mobile) .structure-ui--panel .ax-meters .ax-label-row { margin-bottom: 5px; }
    body:not(.mobile) .structure-ui--panel .ax-effects { flex: 1 1 0; min-height: 0; overflow-y: auto; }
    body:not(.mobile) .structure-ui--panel .ax-bake { position: sticky; bottom: -12px; margin: 0 -12px -12px; padding: 8px 12px 10px; background: linear-gradient(180deg, rgba(14, 31, 25, 0.85), #0e1f19 40%); }
    body:not(.mobile) .structure-ui--panel .ax-bag { flex: 2 1 0; min-height: 190px; margin-top: 0; display: flex; flex-direction: column; }
    body:not(.mobile) .structure-ui--panel .ax-bag__head { flex: none; margin-bottom: 8px; }
    body:not(.mobile) .structure-ui--panel .ax-bag__grid { flex: 1; min-height: 0; overflow-y: auto; }
    body:not(.mobile) .structure-ui--panel .ax-codex { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    body:not(.mobile) .structure-ui--panel .ax-wtabs, body:not(.mobile) .structure-ui--panel .ax-toolbar { flex: none; }
    body:not(.mobile) .structure-ui--panel .ax-codex-layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
    body:not(.mobile) .structure-ui--panel .ax-grid { min-height: 0; overflow-y: auto; align-content: start; }
    body:not(.mobile) .structure-ui--panel .ax-detail { min-height: 0; overflow-y: auto; }
}
