/* Asciimood Lab: an app inside the site. Three panes on a desktop, stacked on a phone. */
body.lab { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.lab-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); flex: none; }
.lab-pill { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); border: 1px solid rgba(240, 162, 74, 0.4); background: var(--accent-soft); padding: 3px 9px; border-radius: 99px; }
.lab-links { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.lab-links a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 14px; }
.lab-links a:not(.btn):hover { color: var(--ink); }
.lang { all: unset; cursor: pointer; font: 600 12px var(--mono); color: var(--muted); padding: 8px 9px; border-radius: 8px; }
.lang:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }

.lab-app { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(300px, 340px); }
.lab-lib, .lab-setup { min-height: 0; display: flex; flex-direction: column; background: var(--bg-2); }
.lab-lib { border-right: 1px solid var(--line); }
.lab-setup { border-left: 1px solid var(--line); overflow-y: auto; }
.pane-head { padding: 16px 14px 10px; display: grid; gap: 10px; flex: none; }
.lab h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px; }
.count { font: 500 11px var(--mono); color: var(--faint); }
.pane-head input { font: 14px var(--sans); color: var(--ink); background: #0a0a0d; border: 1px solid var(--line-strong); padding: 9px 11px; border-radius: 9px; width: 100%; outline: none; transition: border-color .2s; }
.pane-head input:focus { border-color: rgba(240, 162, 74, 0.6); }

.lib-cats { display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 12px; scrollbar-width: none; flex: none; }
.lib-cats::-webkit-scrollbar { display: none; }
.lib-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; grid-auto-rows: max-content; }
.tile { all: unset; box-sizing: border-box; cursor: pointer; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #0a0a0d; display: flex; flex-direction: column; transition: border-color .2s, transform .25s var(--ease); position: relative; }
.tile[hidden] { display: none; }
.tile:hover { border-color: var(--line-strong); }
.tile:active { transform: scale(0.97); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile.used { border-color: rgba(240, 162, 74, 0.6); }
.tile.used::after { content: "✓"; position: absolute; top: 5px; right: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #1a1206; font: 700 10px/16px var(--sans); text-align: center; }
.tile canvas { flex: none; display: block; width: 100%; aspect-ratio: 1.5; }
.tile .name { font-size: 12px; font-weight: 500; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--line); background: var(--panel); }

/* the stage */
.lab-stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px; background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(240, 162, 74, 0.06), transparent 70%), var(--bg); }
#lab-tty { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#lab-tty .tty-body { flex: 1; min-height: 0; }
#lab-tty .mood { flex: 1; min-height: 180px; margin-top: 6px; }
.peek { position: absolute; right: 10px; bottom: 10px; padding: 5px 10px; border-radius: 8px; background: rgba(10, 10, 13, 0.85); border: 1px solid var(--line-strong); font: 500 12px var(--mono); color: var(--ink); backdrop-filter: blur(6px); }
.peek b { color: var(--accent); font-weight: 600; }
.sim { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sim button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); min-width: 0; transition: border-color .2s, background-color .2s; }
.sim button:hover { border-color: var(--line-strong); }
.sim button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sim button.on { border-color: var(--c); background: color-mix(in oklab, var(--c) 10%, var(--bg-2)); }
.sim .ic { font: 600 13px var(--mono); color: var(--c); flex: none; }
.sim .lb { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim button.on .lb { color: var(--ink); }

/* the setup */
.block { padding: 16px 14px 4px; display: grid; gap: 10px; }
.mood-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; padding: 3px; gap: 3px; background: #0a0a0d; }
.seg button { all: unset; text-align: center; font: 500 12.5px var(--sans); color: var(--muted); padding: 7px 4px; border-radius: 7px; cursor: pointer; transition: color .2s, background-color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); background: var(--panel-2); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.seg button:focus-visible { outline: 2px solid var(--accent); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.hint b { color: var(--ink); font-weight: 600; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.slots[hidden] { display: none; }
.slots button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); transition: border-color .2s, box-shadow .2s; }
.slots button:hover { border-color: var(--line-strong); }
.slots button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slots li.on button { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 30px -10px rgba(240, 162, 74, 0.5); }
.slots canvas { width: 76px; height: 44px; border-radius: 6px; display: block; background: #0a0a0d; }
.slots .txt { display: grid; min-width: 0; }
.slots .st { font: 500 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slots b { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slots .pick { font: 500 11px var(--sans); color: var(--faint); opacity: 0; transition: opacity .2s; }
.slots li.on .pick { opacity: 1; color: var(--accent); }

.out { margin: 16px 14px 16px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: #0c0c0f; display: grid; gap: 12px; position: sticky; bottom: 14px; box-shadow: 0 -20px 40px -10px var(--bg-2); }
.out label { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.out > code { font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; color: var(--muted); max-height: 120px; overflow-y: auto; }
.out > code .k { color: var(--ink); }
.out > code.flash { animation: flash .6s var(--ease); }
@keyframes flash { from { color: var(--accent); } }
#copy { width: 100%; }
#copy.done { background: var(--ok); }
.first summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
.first summary::-webkit-details-marker { display: none; }
.first summary::before { content: "+ "; color: var(--accent); font-family: var(--mono); }
.first[open] summary::before { content: "− "; }
.first p { margin: 8px 0; font-size: 13px; color: var(--muted); }
.first .cmdbar { padding-left: 12px; }
.first .cmd-text { font-size: 11.5px; }
kbd { font-size: 12px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--panel-2); }

@media (max-width: 1080px) {
  body.lab { height: auto; overflow: auto; }
  .lab-app { grid-template-columns: minmax(0, 1fr); }
  .lab-stage, .lab-setup, .lab-lib { min-width: 0; }
  .lab-stage { order: 1; height: min(72vh, 620px); padding: 12px; }
  .lab-setup { order: 2; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .lab-lib { order: 3; border-right: 0; border-top: 1px solid var(--line); }
  .lib-list { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .out { position: static; box-shadow: none; }
  .sim { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .lab-links a:not(.btn) { display: none; }
  .tty-title { display: none; }
  #auto { margin-left: auto; }
  .sim .lb { display: none; }
  .sim button { justify-items: center; padding: 9px 4px; }
  .lab-stage { height: 60vh; }
}

/* the link with Claude Code */
.link-state { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.link-state::before { content: "●"; color: var(--muted); }
.link-state.ok::before { color: var(--ok); }
.link-state.busy::before { color: var(--accent); }
.link-state.bad::before { color: #f87171; }
.link-state b { color: var(--ink); font-weight: 600; }
#unlinked p { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
#unlinked .cmd-text { font-size: 11.5px; }
.opt { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.opt input { accent-color: var(--accent); width: 16px; height: 16px; }
.out > * { min-width: 0; }
#unlinked .cmdbar { flex-wrap: wrap; gap: 8px; }
#unlinked .cmd-text { white-space: normal; overflow-wrap: anywhere; }

/* Pro: locked tiles, the card in the setup pane, the unlock dialog */
.pro-badge { display: inline-block; font: 700 10px/1 var(--mono); letter-spacing: .1em; color: #1a1206; background: var(--accent); padding: 3px 6px; border-radius: 5px; vertical-align: 2px; }
.tile .lock { position: absolute; top: 5px; left: 6px; font: 700 9px/1 var(--mono); letter-spacing: .08em; color: #1a1206; background: var(--accent); padding: 3px 5px; border-radius: 4px; }
.tile.locked .name::before { content: "🔒 "; font-size: 10px; }
.pro-card { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.pro-card.on .btn { display: none; }
.pro-dialog { max-width: 440px; width: calc(100% - 32px); box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg-2); color: var(--ink); padding: 22px 22px 18px; }
.pro-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.pro-dialog h2 { margin: 6px 0 10px; font-size: 22px; }
.pro-x { all: unset; cursor: pointer; position: absolute; top: 10px; right: 14px; font-size: 22px; color: var(--muted); }
.pro-tag { margin: 0; }
.pro-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); font-size: 14px; }
.pro-list { margin: 0 0 16px; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.pro-list li::marker { color: var(--accent); }
#pro-buy { display: flex; justify-content: center; }
.pro-key { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.pro-key-row { display: flex; gap: 8px; }
.pro-key-row input { flex: 1; min-width: 0; font: 13px var(--mono); color: var(--ink); background: #0a0a0d; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 10px; }
.pro-key .hint.bad { color: #f87171; }
.pro-key .hint.ok { color: #86efac; }
.tile.off { display: none; }
