/* site-app.css — how the app's components sit on this page: sizes, the panels
   they live in (in the app they sit inside the terminal card), the fake
   terminal, and the phone layout. Colours come from the app's own .widget
   tokens (app.css) or the site tokens (site.css). */

.widget { line-height: 1.4; }
.widget button { font: inherit; color: inherit; }
.widget [hidden] { display: none !important; }

/* ---------- The hero app (window mode) ---------- */
/* (the left panel is the app's default 300px, --side-w in app.css) */
.hero-app { display: flex; height: 560px; position: relative; cursor: default; user-select: none; }
.hero-app .w-sessions { overflow: hidden; }
.hero-app .w-row { animation: rowIn 0.35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.fake-term {
  height: 100%; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; color: var(--term-ink); white-space: pre-wrap; overflow-wrap: anywhere;
  padding-right: 10px; padding-bottom: 6px;
}
.fake-term .ln { animation: lnIn 0.18s ease-out both; }
.fake-term .ln-gap { height: 8px; }
.fake-term .t-prompt { color: var(--ink); background: var(--card-2); border-radius: 8px; padding: 6px 10px; margin: 4px 0; }
.fake-term .t-prompt::before { content: '> '; color: var(--ink-3); }
.fake-term .t-tool b { color: var(--ink); font-weight: 700; }
.fake-term .t-tool::before { content: '● '; color: var(--green); }
.fake-term .t-res { color: var(--ink-3); padding-left: 2ch; }
.fake-term .t-res::before { content: '⎿  '; }
.fake-term .t-say::before { content: '● '; color: var(--ink); }
.fake-term .t-status { color: var(--ink-3); margin-top: 6px; }
.fake-term .t-cursor { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em; background: var(--ink-2); animation: blink 1s steps(1) infinite; }
@keyframes lnIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }

.toast-slot { position: absolute; right: 16px; bottom: 16px; width: 344px; max-width: calc(100% - 32px); z-index: 5; pointer-events: none; }
.toast-slot .w-toast { box-shadow: 0 18px 40px -12px var(--shadow); }

/* Narrower screens: the bar gives way step by step, as the app's does: the window buttons, then
   the view names (icons only), then the text size folds to one 가 */
@media (max-width: 1080px) { .hero-app .w-win-controls { display: none; } }
@media (max-width: 1000px) {
  .hero-app .w-view-name { display: none; }
  .hero-app .w-view-switch button { padding: 5px 8px; }
  .hero-app .w-view-switch { margin-right: 2px; }
}
@media (max-width: 820px) {
  .hero-app { flex-direction: column; height: auto; }
  .widget.expanded.hero-app .w-side { flex: none; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-app .w-sessions { max-height: 260px; }
  .widget.mode-window.hero-app .w-term { flex: none; height: 320px; }
  .toast-slot { right: 10px; left: 10px; bottom: 10px; width: auto; max-width: none; }
}
@media (max-width: 520px) {
  .hero-app .w-textsize-step, .hero-app .w-textsize-name { display: none; }
  .hero-app .w-textsize > .w-textsize-cur { border: 0; min-width: 26px; }
}
@media (max-width: 420px) {
  .hero-app .w-limits { grid-template-columns: minmax(36px, max-content) minmax(0, 1fr) 30px; }
  .hero-app .w-limit-reset { display: none; }
  .toast-slot .w-toast { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px 16px 14px 14px; }
  .toast-slot .w-toast-art { width: 56px; height: 56px; }
  .toast-slot .w-toast-art img { width: 42px; height: 42px; }
}

/* ---------- Panels: an app view on its own ---------- */
.widget.panel { display: block; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }

/* The Pokédex as the app lays it out inside its terminal card: dashboard on top, grid and detail side by side
   (the pane is the app's page background, --bg, since 1.4.0) */
.widget.panel.dex-panel { background: var(--bg); }
.dex-panel .dex { height: 760px; min-height: 0; }
.dex-panel .dex-main { min-height: 0; }
.dex-panel .dex-grid { min-height: 0; }
.dex-panel .dex-detail { min-height: 0; }
.dex-panel .dex-cell { cursor: pointer; }
.dex-panel .dex-cell.seen, .dex-panel .dex-cell.unknown { cursor: pointer; }
.dex-panel .dex-fsearch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 1100px) { .dex-panel .dex-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .dex-panel .dex { height: auto; }
  .dex-panel .dex-main { flex-direction: column; }
  .dex-panel .dex-grid { flex: none; height: 420px; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
  .dex-panel .dex-cell img { width: 52px; height: 52px; }
  .dex-panel .dex-detail { width: auto; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .dex-panel .dex-fsearch { margin-left: 0; }
}
@media (max-width: 560px) {
  .dex-panel .dex-top { padding: 12px 14px; }
  .dex-panel .dex-grid { padding: 12px 14px; }
  .dex-panel .dex-stat { grid-template-columns: minmax(0, 1fr); padding: 0 10px; }
  .dex-panel .dex-stat:first-child, .dex-panel .dex-stat.dex-stat-tiers { padding-left: 0; padding-right: 0; }
  .dex-panel .dex-stat-pct { grid-column: 1; grid-row: auto; align-self: start; }
  .dex-panel .dex-stat-value b { font-size: 18px; }
  .dex-panel .dex-stat-value small { display: block; font-size: 11px; }
  .dex-panel .dex-tiers { gap: 8px; }
  .dex-panel .dex-tiercol em { font-size: 14px; }
  .dex-panel .dex-tiercol em small { display: block; }
  .dex-panel .dex-chips { flex-wrap: wrap; }
  .dex-panel .dex-seg { flex-wrap: wrap; }
  .dex-panel .dex-seg button { min-width: 0; padding-left: 7px; padding-right: 7px; }
}

/* The art backdrops as in the app: one plain grey, no tier tint (the dex card uses --mon-bg from app.css) */
.w-toast-art { background: var(--toast-art-bg); }

/* Live views shown large on wide screens: the app's 12px UI, scaled up as a whole */
@media (min-width: 1040px) {
  .sess-demo, .step-panel, .tools-panel { zoom: 1.18; }
}

/* ---------- 세션마다 한 마리: three sessions opening, a resting Pokémon on each ---------- */
.sess-demo { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 20px; background: var(--side); border: 1px solid var(--line); --w-icon: 40px; --w-icon-gap: 14px; }
.sess-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sess-col { min-width: 0; height: 300px; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 16px; background: var(--term); border: 1px dashed var(--line-strong); }
.sess-col.open { border: 1px solid var(--line); animation: rowIn 0.35s cubic-bezier(.2, .8, .2, 1) both; }
/* the session's row (unfilled, as in the app's list) above its terminal, a hairline between them */
.sess-col .w-row { flex: none; margin: 0; padding: 6px 6px 10px; border-radius: 0; border-bottom: 1px solid var(--line); }
.sess-col .w-row:hover { background: none; }
.sess-wait { margin: auto; opacity: 0.35; }
.sess-term { flex: 1; min-height: 0; height: auto; padding: 2px 4px 0; font-size: 12px; }
@media (max-width: 760px) {
  .sess-cols { grid-template-columns: minmax(0, 1fr); }
  .sess-col { height: 220px; }
  .sess-col:nth-child(3) { display: none; }
  .sess-demo { --w-icon: 32px; --w-icon-gap: 8px; }
}

/* ---------- 도구를 쓰면 한 걸음: tool calls on the left, the walk and the catch card on the right ---------- */
.widget.panel.step-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); background: var(--term); border-radius: 20px; }
/* the terminal runs the full height of the panel (the side column sets it), its lines kept to the bottom */
.step-term { position: relative; min-height: 400px; border-right: 1px solid var(--line); }
.step-term .fake-term { position: absolute; inset: 18px 12px 14px 20px; height: auto; font-size: 13px; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 56px); mask-image: linear-gradient(to bottom, transparent, #000 56px); }
.step-side { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 28px; background: var(--side); min-width: 0; }
.step-count { display: flex; align-items: baseline; gap: 12px; }
.step-count .w-label { font-size: 18px; color: var(--ink-2); } /* 39 걸음: the number first, then the unit */
.step-count b { font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.step-trail { height: 64px; }
.step-toast { min-height: 112px; }
.step-toast .w-toast { box-shadow: 0 18px 40px -12px var(--shadow); }
@media (max-width: 760px) {
  .widget.panel.step-panel { grid-template-columns: minmax(0, 1fr); }
  .step-term { height: 230px; border-right: 0; border-bottom: 1px solid var(--line); }
  .step-term .fake-term { inset: 12px 10px 10px 14px; font-size: 12px; }
  .step-side { padding: 20px 16px; gap: 16px; }
  .step-count b { font-size: 48px; }
}
@media (max-width: 420px) {
  .step-toast .w-toast { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px 16px 14px 14px; }
  .step-toast .w-toast-art { width: 56px; height: 56px; }
  .step-toast .w-toast-art img { width: 42px; height: 42px; }
}

/* ---------- 사용량과 컨텍스트: the usage card beside the session rows ---------- */
.widget.panel.tools-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px; padding: 8px; background: var(--side); border-radius: 20px; }
/* Claude's two limits as tiles stacked to fill the card's height, the number large: no empty room
   above and below (until 2026-11-13 a 2×2 with Codex's two, from spawn-site-lab/usage-lab.html
   "B 타일"; that version is in spawn-site-lab/codex-hide-backup) */
/* 1.4.0: no fill in the tiles (a hairline), the number by brightness (500, not bold), the bar a
   thin grey line that turns amber from 80 % and red from 90 % */
.tools-panel .w-limits { display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 8px; padding: 8px; }
.tools-panel .w-limit { display: grid; grid-column: auto; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; align-items: end; gap: 0; padding: 18px 20px; border-radius: var(--r-l); background: none; border: 1px solid var(--line); }
.tools-panel .w-limit > .w-label { grid-column: 1 / -1; grid-row: 1; align-self: start; font-size: 13px; }
.tools-panel .w-limit-pct { grid-column: 1; grid-row: 2; text-align: left; font-size: 56px; font-weight: var(--w-strong); letter-spacing: -0.03em; line-height: 1; }
.tools-panel .w-limit-pct small { font-size: 28px; margin-left: 2px; color: var(--ink-3); }
.tools-panel .w-limit-reset { grid-column: 2; grid-row: 2; align-self: end; font-size: 13px; }
.tools-panel .w-limit .w-bar { grid-column: 1 / -1; grid-row: 3; margin-top: 14px; height: 3px; }
.tools-panel .rows { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
/* the rows sit on the panel as on the app's left panel: no fill, no ring */
.tools-panel .w-row { margin: 0; padding: 10px 12px; }
@media (max-width: 760px) {
  .widget.panel.tools-panel { grid-template-columns: minmax(0, 1fr); }
  /* above the rows the two sit side by side */
  .tools-panel .w-limits { grid-template-columns: 1fr 1fr; }
  .tools-panel .w-limit { padding: 12px 12px 11px; }
  .tools-panel .w-limit > .w-label { font-size: 12px; }
  .tools-panel .w-limit-pct { font-size: 28px; }
  .tools-panel .w-limit-pct small { font-size: 16px; }
  .tools-panel .w-limit-reset { font-size: 11px; }
}

/* ---------- 도구를 쓰면 한 걸음: today's earlier encounters under the card ---------- */
.step-log { flex: none; min-height: 0; }
.step-log .today-day { position: static; margin: 0 0 2px; padding: 2px 4px; background: transparent; }
.step-log .today-row { padding: 7px 4px; gap: 10px; }
.step-log .today-row img.today-icon { width: 24px; height: 24px; }
.step-log .today-sub { flex-wrap: wrap; white-space: normal; }
.step-side { justify-content: flex-start; }

/* ---------- 사용량과 컨텍스트: the low-HP note on its row ---------- */
.hp-hint { margin-top: 2px; padding-left: 34px; font-size: 11px; color: var(--red-text); display: flex; align-items: center; gap: 6px; }
.hp-hint::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); flex: none; }

/* ---------- 내 PC에서만: the app's settings rows ---------- */
/* full width under its left-aligned head, like the other sections' panels */
.widget.panel.set-panel { padding: 8px 22px 10px; border-radius: 20px; background: var(--card); }
.set-head { padding: 10px 0 4px; }
.set-panel .set-row:last-child { border-bottom: 0; }
.set-panel .set-text b { font-size: 14px; }
.set-panel .set-text small { font-size: 12px; }
/* (1.4.0: a hairline tag, no fill, as the app's other tags) */
.set-pill { flex: none; font-size: 10px; font-weight: var(--w-name); letter-spacing: 0.04em; color: var(--ink-2); background: none; border: 1px solid var(--line); border-radius: var(--r-xs); padding: 1px 6px; }
.set-panel .set-switch:focus-visible { outline-offset: 3px; }
/* the sample log line: a hairline box, no filled card inside the card */
.hide-sample { margin: 2px 0 10px; padding: 9px 12px; border-radius: var(--r-m); background: none; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.hide-sample .today-line { font-size: 13px; }
.hide-sample .today-sub { white-space: normal; flex-wrap: wrap; }
@media (max-width: 560px) { .widget.panel.set-panel { padding: 6px 14px 8px; } }

/* ---------- 네 단계: one small app piece per step ---------- */
.step-pic { height: 136px; border-radius: 16px; background: var(--side); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; justify-content: center; gap: 10px; overflow: hidden; }
.rel-row { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; color: var(--ink-2); text-decoration: none; min-width: 0; }
.rel-row.ext-link { text-decoration: none; color: var(--ink-ext); }
.rel-row:hover { border-color: var(--line-strong); color: var(--ink); }
.rel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.rel-name { font-size: 11.5px; color: var(--ink); overflow-wrap: anywhere; line-height: 1.35; }
.rel-tag { flex: none; font-size: 10px; font-weight: 700; color: var(--green); background: rgba(116, 214, 139, 0.12); padding: 1px 7px; border-radius: 999px; }
.mini-head { height: auto; padding: 9px 12px; }
.mini-head .w-brand { font-size: 14px; }
.mini-exe { font-size: 11.5px; color: var(--ink-3); padding-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-launch { background: transparent; border: 0; padding: 0; }
/* as the app's empty terminal pane offers it: the launcher with a hairline (1.4.0) */
.mini-launch .w-launch-main { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--line); border-radius: var(--r-s); font-size: 13px; }
.mini-term { height: auto; font-size: 11.5px; padding: 0 4px; }
.mini-catch { padding: 10px; }
.mini-catch .w-toast { padding: 12px 14px 12px 12px; gap: 12px; grid-template-columns: 56px minmax(0, 1fr); }
.mini-catch .w-toast-art { width: 56px; height: 56px; }
.mini-catch .w-toast-art img { width: 42px; height: 42px; }
.mini-catch .w-toast-meta { flex-wrap: wrap; row-gap: 2px; }

/* ---------- The closing strip: a row of Pokédex cells, one filling in now and then ---------- */
.dex-strip { max-width: 880px; margin: clamp(48px, 6vw, 72px) auto 0; padding: 14px 16px 16px; border-radius: 20px; background: var(--side); border: 1px solid var(--line); }
.dex-strip-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.dex-strip-head .w-dex-count b { font-variant-numeric: tabular-nums; }
.dex-strip-cells { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.dex-strip .dex-cell { cursor: default; content-visibility: visible; }
.dex-strip .dex-cell img { width: 78%; height: 78%; }
.dex-strip .dex-cell.fill img { animation: cellIn 0.7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cellIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .dex-strip-cells { grid-template-columns: repeat(6, minmax(0, 1fr)); } .dex-strip { padding: 12px; } }

@media (prefers-reduced-motion: reduce) {
  .hero-app .w-row, .fake-term .ln, .sess-col.open, .dex-strip .dex-cell.fill img { animation: none; }
  .fake-term .t-cursor { animation: none; }
  .w-ctx.w-hp span, .w-bar span { transition: none; }
}
@media (max-width: 520px) { .step-pic { height: auto; padding: 12px; } }
.w-launch-main .w-launch-plus { flex: none; }

/* ---------- 2026-11-30: every app view in a desktop window's shape (16:9, a 1920×1080 screen's), its parts as large as before ---------- */
@media (min-width: 821px) {
  .hero-app { height: auto; aspect-ratio: 16 / 9; }
  .sess-demo { aspect-ratio: 16 / 9; }
  .sess-cols { flex: 1; min-height: 0; }
  .sess-col { height: auto; }
  .widget.panel.step-panel { aspect-ratio: 16 / 9; }
  .step-term { min-height: 0; }
  .step-side { justify-content: center; }
  .dex-panel .dex { height: auto; aspect-ratio: 16 / 9; }
  /* in a wide window the two limits sit side by side on top, the sessions in two columns under them */
  .widget.panel.tools-panel { aspect-ratio: 16 / 9; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; row-gap: 36px; padding: 8px 24px; }
  .tools-panel .w-limit { padding: 26px 28px; }
  .tools-panel .w-limits { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .tools-panel .rows { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 8px 16px; padding: 0 8px; }
  /* the list's header as the app draws it since 1.10.14: 간략 / 상세 first, the buttons on the right */
  .hero-app .w-list-head .w-list-mode + .w-list-btn { margin-left: auto; }
  .widget.panel.set-panel { aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: center; }
}
