/* Theme: the garden of the Tree of Knowledge at golden dusk. */
:root {
  --bg: #15110d;
  --panel: #211a13;
  --panel-2: #2e251a;
  --line: #3e3224;
  --text: #f5ecdb;
  --muted: #b5a68a;
  --green: #86c97a; /* leaf: profit, in range, ok */
  --red: #e9705a; /* withered fruit: loss, danger */
  --gold: #eab84e;
  --accent: #d9a441; /* primary actions */
  --on-accent: #1d140a;
  --teal: #6fb5a3;
  --pink: #e58aa0;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --glass: rgba(33, 26, 19, .8); /* panels over the background art */
  --glass-strong: rgba(29, 23, 16, .9);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; color: var(--text); font: 14px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
/* The owner's artwork behind the whole app (web/bg.jpg), dimmed toward the bottom so text stays readable. */
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; background: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(21, 17, 13, .38) 0%, rgba(21, 17, 13, .55) 40%, rgba(21, 17, 13, .82) 100%), url("bg.jpg") 62% 32% / cover no-repeat, var(--bg); }
button { font: inherit; color: inherit; }
#app { max-width: 560px; margin: 0 auto; padding: 10px 12px calc(76px + env(safe-area-inset-bottom)); }

/* KPI board */
.board { background: linear-gradient(180deg, rgba(42, 32, 22, .82), rgba(29, 23, 16, .82)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(234, 184, 78, .22); border-radius: var(--radius); padding: 10px 12px 12px; box-shadow: inset 0 1px 0 rgba(255, 220, 150, .06); }
.board-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.board-title { font-family: var(--serif); font-size: 13px; letter-spacing: .6px; color: var(--gold); font-weight: 600; }
.chip { font-size: 10.5px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font-weight: 600; letter-spacing: .4px; }
.chip.live-mode { background: rgba(134, 201, 122, .15); color: var(--green); }
.chip.sim-mode { background: rgba(234, 184, 78, .15); color: var(--gold); }
.chip.paused { background: rgba(233, 112, 90, .15); color: var(--red); }
.live { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--green); font-variant-numeric: tabular-nums; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.6s infinite; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
.kpi .k { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.kpi .s { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* scene */
.tab { display: none; padding-top: 10px; }
.tab.active { display: block; }
.scene-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, #1a1330, #a9503c 60%, #36251a); border: 1px solid rgba(234, 184, 78, .22); box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
.hint { text-align: center; color: #d9cbb0; font-size: 12px; margin: 8px 0 0; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }

.char { cursor: pointer; outline: none; }
.char .body { transform-box: fill-box; transform-origin: 50% 100%; animation: bob 3.2s ease-in-out infinite; }
.char:focus-visible .head circle:first-child { stroke: var(--gold); stroke-width: 3; }
.char.working .arm { transform-box: fill-box; transform-origin: 50% 0; animation: type .5s ease-in-out infinite alternate; }
.char.working .arm-r { animation-delay: .25s; }
.char.alert .body { animation: hop .55s ease-in-out infinite; }
.char .sprout { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 3.6s ease-in-out infinite; }
.char.thinking .sprout { animation: sway .6s ease-in-out infinite; }
.char .badge { fill: #8d7f66; }
.char.working .badge { fill: var(--green); }
.char.alert .badge { fill: var(--red); animation: pulse 1s infinite; }
.char .eye { transform-box: fill-box; transform-origin: center; animation: eyes 5s infinite; }
.sign-text { fill: #f6dfa8; font-family: var(--serif); font-weight: 700; letter-spacing: 1.4px; }
.star { animation: twinkle 3.4s ease-in-out infinite; }
.bird { animation: glide 9s ease-in-out infinite; }
.canopy { transform-box: fill-box; transform-origin: 50% 100%; animation: canopy 7s ease-in-out infinite; }
.serpent .tongue { animation: tongue 4s steps(1) infinite; }
.lantern-glow { animation: flicker 2.6s ease-in-out infinite; }
.firefly { animation: firefly 6s ease-in-out infinite; }
.blossoms { transition: opacity .8s ease; }
.blossoms.hidden { opacity: 0; }

/* fruits = open positions */
.fruit { cursor: pointer; outline: none; }
.fruit .fruit-body { transform-box: fill-box; transform-origin: 50% 0; animation: dangle 4s ease-in-out infinite; }
.fruit .skin { transition: fill .6s ease; }
.fruit.ripe .skin { fill: #f2c14e; }
.fruit.young .skin { fill: #b9d05a; }
.fruit.unripe .skin { fill: #cfd9a0; }
.fruit.withered .skin { fill: #9b4f2e; }
.fruit.ripe .fruit-body { filter: url(#glow); }
.fruit.busy .fruit-body { animation: shake .3s ease-in-out infinite; }
.fruit .fruit-anim { transform-box: fill-box; transform-origin: 50% 0; }
.fruit.grow .fruit-anim { animation: grow .9s cubic-bezier(.3, 1.5, .5, 1); }
.fruit.fall .fruit-anim { animation: fall 1.1s ease-in forwards; }
.fruit:focus-visible .skin { stroke: var(--text); stroke-width: 1.5; }
.fruit-label { fill: #fff3d6; font-weight: 700; paint-order: stroke; stroke: rgba(20, 14, 6, .85); stroke-width: 2.4px; stroke-linejoin: round; }

.bubble { position: absolute; transform: translate(-50%, -100%); max-width: 46%; background: rgba(33, 26, 19, .95); border: 1px solid rgba(234, 184, 78, .3); border-radius: 10px; padding: 5px 8px; font-size: 11px; line-height: 1.35; color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .35s ease, transform .35s ease; }
.bubble.show { opacity: 1; transform: translate(-50%, calc(-100% - 4px)); }
.bubble b { display: block; font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--gold); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; background: inherit; border-right: 1px solid rgba(234, 184, 78, .3); border-bottom: 1px solid rgba(234, 184, 78, .3); transform: translateX(-50%) rotate(45deg); }
.name { position: absolute; transform: translate(-50%, 2px); font-size: 9.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(21, 17, 13, .78); color: var(--text); white-space: nowrap; }

/* team list */
.team { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.member { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
.member .av { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #1d140a; }
.member .txt { flex: 1; min-width: 0; }
.member .top { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.member .msg-line { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.pill.idle { background: var(--panel-2); color: var(--muted); }
.pill.working { background: rgba(134, 201, 122, .15); color: var(--green); }
.pill.alert { background: rgba(233, 112, 90, .15); color: var(--red); }
.member .chev { color: var(--muted); font-size: 18px; }

/* cards */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.card h3 { margin: 0; font-family: var(--serif); font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card h3 a { color: var(--text); text-decoration: none; }
.card.flash { animation: flash 1.6s ease; }
.tag { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.tag.in { background: rgba(134, 201, 122, .14); color: var(--green); }
.tag.below { background: rgba(233, 112, 90, .14); color: var(--red); }
.tag.above { background: rgba(234, 184, 78, .14); color: var(--gold); }
.fruit-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .18); }
.fruit-dot.ripe { background: #f2c14e; } .fruit-dot.young { background: #b9d05a; } .fruit-dot.unripe { background: #cfd9a0; } .fruit-dot.withered { background: #9b4f2e; }
.row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.row .big { font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.range { position: relative; height: 34px; margin: 12px 2px 4px; }
.range .track { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: var(--panel-2); }
.range .zone { position: absolute; top: 14px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #5f8f45, var(--gold)); }
.range .mark { position: absolute; top: 9px; width: 2px; height: 16px; background: var(--red); }
.range .mark.fast { background: #a33a26; }
.range .mark span { position: absolute; top: 17px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--muted); white-space: nowrap; }
.range .dot { position: absolute; top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--text); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--text); transition: left .6s ease; }
.spark { width: 100%; height: 44px; margin-top: 6px; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn { flex: 1; min-height: 40px; border: 0; border-radius: 10px; padding: 9px 12px; background: var(--panel-2); font-weight: 600; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, #e7b553, var(--accent)); color: var(--on-accent); }
.btn.danger { background: rgba(233, 112, 90, .16); color: var(--red); }
.btn.ok { background: rgba(134, 201, 122, .16); color: var(--green); }
.btn:disabled { opacity: .5; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; background: var(--glass); border-radius: var(--radius); }
.card .empty { background: none; }
.empty svg { width: 44px; height: 44px; fill: var(--panel-2); margin-bottom: 6px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed { background: var(--glass); border-radius: var(--radius); padding: 0 10px; }
.feed li { display: flex; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .av { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #1d140a; }
.feed .t { font-size: 11px; color: var(--muted); }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-variant-numeric: tabular-nums; }
.kv .k { color: var(--muted); }
.addr { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }

details.costs { margin-top: 10px; background: var(--panel-2); border-radius: 10px; padding: 8px 10px; }
details.costs summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; }
details.costs .kv { margin-top: 8px; }

/* history */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
.stats .kpi .v { font-size: 16px; }
.cmp { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.cmp th { text-align: right; color: var(--muted); font-weight: 600; font-size: 11px; padding: 4px 0 6px; }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp td { padding: 6px 0; border-top: 1px solid var(--line); text-align: right; }
.hist-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.hist-row .l { min-width: 0; }
.hist-row .l div:first-child { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.tag.trail { background: rgba(234, 184, 78, .14); color: var(--gold); }

/* tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: rgba(21, 17, 13, .9); border-top: 1px solid rgba(234, 184, 78, .18); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); z-index: 5; }
.tabs button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; color: var(--muted); font-size: 10.5px; cursor: pointer; min-width: 0; }
.tabs button svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; }
.tabs button span { white-space: nowrap; letter-spacing: -.2px; font-size: 10px; }
.tabs button.active { color: var(--gold); background: var(--panel); }

/* bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 7, 4, .6); animation: fade .2s ease; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 86vh; overflow: auto; background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 18px 18px 0 0; border: 1px solid rgba(234, 184, 78, .22); padding: 8px 14px calc(16px + env(safe-area-inset-bottom)); animation: up .25s ease; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; cursor: pointer; }
.agent-head { display: flex; align-items: center; gap: 10px; }
.agent-head .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #1d140a; }
.agent-head h2 { margin: 0; font-family: var(--serif); font-size: 19px; }
.quote { background: var(--panel-2); border-left: 3px solid var(--gold); border-radius: 12px; padding: 10px 12px; margin: 12px 0; font-size: 13px; font-style: italic; }
.section-title { font-family: var(--serif); font-size: 13px; letter-spacing: .4px; color: var(--gold); margin: 14px 0 6px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow: auto; padding: 4px 0; }
.msg { max-width: 85%; padding: 8px 11px; border-radius: 14px; font-size: 13px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.typing { color: var(--muted); }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input { flex: 1; min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; }
.chat-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chips button { border: 1px solid var(--line); background: none; border-radius: 99px; padding: 5px 10px; font-size: 12px; color: var(--muted); cursor: pointer; }
pre.report { white-space: pre-wrap; font: 12.5px/1.5 inherit; background: var(--panel-2); padding: 10px; border-radius: 10px; margin: 0; }

#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #3a2d1d; border: 1px solid rgba(234, 184, 78, .3); color: var(--text); padding: 9px 14px; border-radius: 12px; font-size: 13px; opacity: 0; transition: .25s ease; pointer-events: none; z-index: 20; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.gate { position: fixed; inset: 0; background: var(--bg); display: grid; place-content: center; text-align: center; padding: 24px; z-index: 30; }
.gate[hidden] { display: none; }
.gate h2 { font-family: var(--serif); color: var(--gold); }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes type { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes eyes { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes canopy { 0%, 100% { transform: rotate(-.6deg); } 50% { transform: rotate(.6deg); } }
@keyframes dangle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes shake { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes grow { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes fall { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(70px); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .25; } }
@keyframes glide { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, -3px); } }
@keyframes tongue { 0%, 88%, 100% { opacity: 0; } 90%, 96% { opacity: 1; } }
@keyframes flicker { 0%, 100% { opacity: .9; } 40% { opacity: .65; } 70% { opacity: 1; } }
@keyframes firefly { 0%, 100% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 50% { transform: translate(8px, -12px); opacity: .7; } 80% { opacity: 1; } }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(234, 184, 78, 0); } 25% { box-shadow: 0 0 0 3px rgba(234, 184, 78, .7); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .firefly { opacity: .6; } }

/* Sinta: cek token */
.check-box h3 { margin-bottom: 4px; }
.check-box p { margin: 0 0 10px; }
.check-box input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; min-width: 0; }
.checking { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--panel-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.check-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.check-head > div:first-child { min-width: 0; }
.check-head h3 { margin-bottom: 2px; }
.score { flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 3px solid var(--line); }
.score b { font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
.score span { font-size: 8.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.score.ok { border-color: var(--green); }
.score.warn { border-color: var(--gold); }
.score.red { border-color: var(--red); }
.verdict { margin-top: 10px; padding: 8px 10px; border-radius: 10px; font-weight: 700; }
.verdict.ok { background: rgba(134, 201, 122, .14); color: var(--green); }
.verdict.warn { background: rgba(234, 184, 78, .14); color: var(--gold); }
.verdict.red { background: rgba(233, 112, 90, .14); color: var(--red); }
.flags { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.flags li { position: relative; padding-left: 20px; }
.flags li::before { position: absolute; left: 0; top: 1px; font-size: 11px; }
.flags li.red::before { content: "🚫"; }
.flags li.warn::before { content: "⚠️"; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.metrics div { background: var(--panel-2); border-radius: 10px; padding: 7px 9px; min-width: 0; }
.metrics em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); }
.metrics b { font-size: 15px; font-variant-numeric: tabular-nums; }
.metrics span { display: block; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.sbar { display: grid; grid-template-columns: 104px 1fr 28px; align-items: center; gap: 8px; font-size: 12px; margin-top: 7px; }
.sbar i { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.sbar i b { display: block; height: 100%; background: var(--muted); }
.sbar i b.ok { background: var(--green); }
.sbar i b.warn { background: var(--gold); }
.sbar i b.red { background: var(--red); }
.sbar em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--panel-2); }
.stack .exit, .legend .exit { background: #7d6f58; }
.stack .trim, .legend .trim { background: var(--gold); }
.stack .hold, .legend .hold { background: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.pool { display: block; text-decoration: none; color: var(--text); background: var(--panel-2); border: 1px solid transparent; border-radius: 12px; padding: 9px 10px; margin-bottom: 6px; }
.pool.best { border-color: var(--accent); background: rgba(217, 164, 65, .12); }
.pool.thin { opacity: .6; }
.pool-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pool-top .go { margin-left: auto; color: var(--muted); font-size: 12px; }
.pool-kv { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; margin-top: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.pool-kv em { display: block; font-style: normal; font-size: 10px; color: var(--muted); }
.recent { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; margin-bottom: 6px; cursor: pointer; }
.recent b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.ok { background: rgba(134, 201, 122, .15); color: var(--green); }
.pill.warn { background: rgba(234, 184, 78, .15); color: var(--gold); }
.pill.red { background: rgba(233, 112, 90, .15); color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.recs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recs-head h3 { margin: 0; }
#recs-meta { margin: 6px 0 8px; }
.rec { border-top: 1px solid var(--line); padding: 10px 0; }
.rec:first-child { border-top: 0; }
.rec-top { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.rec-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rec-name b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.warn-text { color: var(--gold); margin-top: 6px; }
.entry-status { margin-top: 8px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.entry-status.ready { background: rgba(134, 201, 122, .14); color: var(--green); }
.entry-status.wait { background: var(--panel-2); color: var(--muted); }
.pill.zone-in { background: rgba(134, 201, 122, .15); color: var(--green); }
.pill.zone-above { background: rgba(234, 184, 78, .15); color: var(--gold); }
.pill.zone-below { background: rgba(233, 112, 90, .15); color: var(--red); }
.zone-in-text { color: var(--green); } .zone-above-text { color: var(--gold); } .zone-below-text { color: var(--red); }
.ring { --p: 0; --c: var(--muted); flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--panel-2) 0); }
.ring b { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.ring.ok { --c: var(--green); } .ring.warn { --c: var(--gold); } .ring.red { --c: var(--red); }
.home-recs:empty { display: none; }
.home-recs-head { display: flex; align-items: baseline; justify-content: space-between; }
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.mini { flex: 0 0 74%; max-width: 260px; scroll-snap-align: start; text-align: left; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 10px; cursor: pointer; display: grid; gap: 4px; }
.mini-top { display: flex; align-items: center; gap: 8px; }
.mini-top b { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .ring { width: 38px; height: 38px; } .mini .ring b { width: 29px; height: 29px; font-size: 12px; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
#rec-filters { margin: 0 0 4px; }
.rec-top .rank, .mini-top .rank { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-weight: 800; font-size: 12px; }
.rec-top .sym { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; font-weight: 800; font-size: 15px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-top .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.parts { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--panel-2); margin: 8px 0 4px; }
.parts .s, .parts-legend .s { background: var(--green); } .parts .f, .parts-legend .f { background: var(--accent); }
.parts .m, .parts-legend .m { background: var(--teal); } .parts .u, .parts-legend .u { background: var(--pink); }
.parts-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--muted); }
.parts-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 3px; }
.rec-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.rec-actions .btn { flex: 0 0 auto; min-height: 34px; padding: 6px 12px; }
.rec-actions .btn.on { outline: 2px solid var(--accent); }
.evals { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.stack-form { display: grid; gap: 8px; margin-top: 10px; }
.tag.paper { background: rgba(234, 184, 78, 0.14); color: var(--gold); }
.seed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0; margin: 12px 0; list-style: none; counter-reset: seed; }
.seed li { counter-increment: seed; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; text-align: center; user-select: none; -webkit-user-select: none; }
.seed li::before { content: counter(seed) ". "; color: var(--muted); font-size: 11px; }
.stack-form input { min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; }
.stack-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.qr { width: 210px; margin: 10px auto; background: #fff; border-radius: 12px; padding: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.steps { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 4px; }
.chips button.on { border-color: var(--accent); color: var(--text); background: rgba(217, 164, 65, .16); }
.linkish { border: 0; background: none; padding: 0; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }

a.btn { color: var(--text); text-decoration: none; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
