/* app.css — the spawn app's own stylesheets as of 1.4.0 (the calm look, "차분하게 2"), copied
   from the app repo and trimmed to the components this site rebuilds. Rules are kept as they are
   in the app; the only edits are: -webkit-app-region removed (no window to drag here), the font
   stacks point at the web fonts the site loads, the design tokens sit on .widget (not :root, so
   the marketing text around the replicas keeps the site's own tokens), the toast rules are not
   prefixed with .toast-host (the card is not in its own window), and the text size is the
   default step (보통) only.

   Sources (DueStar/spawn, 1.4.0):
     src/styles/tokens.css           every colour, line, radius, weight and type size; tiers, .tdot
     src/styles/widget.css           cards, header, usage rows, the list header, session rows, status, HP
     src/styles/widget-expanded.css  window mode, launcher, terminal card, view bar, session header,
                                     text-size control, window buttons, settings rows and switch
     src/styles/pokedex.css          dex strip, view tabs, NEW dot, the Pokédex, the log
     src/styles/toast.css            the catch notification card
     src/styles/terminal.css         the terminal view base
   The seven rules of the look: only Pokémon and tier colours are saturated; yellow only on the
   chosen session, the chosen cell and send; hairlines, not filled cards, pills or chips; weights
   400 / 500 (600 for the wordmark and headings); numbers ranked by brightness; status is a dot and
   quiet words (the HP bar stays green); the toast, medals and NEW stay lively. */

/* ======================= tokens.css (보통) ======================= */

.widget {
  /* surfaces */
  --bg: #0b0c10;  --side-bg: #0e1015;  --card: #14161c;  --card-2: #1b1e26;
  --term-bg: #101218;  --mon-bg: #16181d;  --mon-bg-hover: #1a1c22;
  --unknown-bg: #131519;  --q-ink: #2c303b;  --toast-bg: #14161c;  --toast-art-bg: #1d1e22;
  /* the three greys, and numbers */
  --ink: #d7dae3;  --ink-2: #a4a9b6;  --ink-3: #7d8291;  --num-ink: #d7dae3;
  /* lines and neutral states */
  --line: rgba(255, 255, 255, 0.07);  --line-hover: rgba(255, 255, 255, 0.22);
  --track: rgba(255, 255, 255, 0.08);  --hover: rgba(255, 255, 255, 0.045);
  --sel-bg: rgba(255, 255, 255, 0.06);  --row-sel-bg: rgba(255, 255, 255, 0.04);
  /* yellow: the chosen session, the chosen cell, send */
  --accent: #f2c94c;  --accent-hover: #f7d76c;  --accent-ink: #16171b;
  /* status */
  --green: #74d68b;  --amber: #ffb54a;  --danger: #ff6464;  --red-text: #ff8787;
  /* HP (context left): green, amber at 50 % and under, red at 20 % and under */
  --hp: #5fcf7a;  --hp-warn: var(--amber);  --hp-low: var(--danger);  --hp-h: 3px;
  /* usage bars: grey, amber from 80 %, red from 90 % (the limit is about to hit) */
  --bar: var(--ink-3);  --bar-warn: var(--amber);  --bar-danger: var(--danger);  --bar-h: 2px;
  /* rewards keep their colour */
  --new-dot: #ff4d4f;  --new-badge: #ffd84a;  --shiny: #fff3a0;
  /* weight */
  --w-body: 400;  --w-name: 500;  --w-strong: 500;  --w-head: 600;  --w-mono: 380;
  /* radius */
  --r-xs: 3px;  --r-s: 4px;  --r-m: 6px;  --r-l: 8px;  --r-toast: 14px;
  /* measures */
  --head-h: 44px;  --sess-bar-h: 40px;
  --side-w: 300px;
  --row-gap: 4px;
  --row-mon: 24px;  --strip-mon: 21px;
  /* type, 보통 (the default step) */
  --t-micro: 10px;  --t-meta: 11px;  --t-ui: 12px;  --t-name: 12px;  --t-prose: 13px;
  --t-num: 12px;  --t-head: 14px;  --t-big: 15px;  --t-code: 12px;
}
/* tier colours are information: text and dot colour, never a fill */
.tier-common { --tier: #a4a9b6; }  .tier-rare { --tier: #6cb6ff; }  .tier-sub { --tier: #c08bff; }
.tier-legendary { --tier: #ffc94a; }  .tier-mythical { --tier: #ff7ad9; }
/* a tier is shown as this dot beside its word (the word always there: tiers never rely on hue alone) */
.tdot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--tier); }

/* ======================= widget.css ======================= */

.widget {
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-ui);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.widget *, .widget *::before, .widget *::after { box-sizing: border-box; }

/* ---------- The bento ---------- */
.w-bento { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.w-bento > .w-card { flex: none; }
.w-bento > .w-sessions { flex: 1 1 auto; min-height: 0; }
.w-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 10px 12px;
  min-width: 0;
}
.w-label {
  font-size: var(--t-meta);
  font-weight: var(--w-body);
  color: var(--ink-3);
}
.w-empty { color: var(--ink-3); font-size: var(--t-ui); }

.w-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 6px 8px 6px 12px;
  border-radius: var(--r-l);
}
/* the app's wordmark (widget.css): the ball and "spawn", Uncut Sans 600 17px -2% */
.w-brand { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 17px; line-height: 1; letter-spacing: -0.02em; color: inherit; background: none; border: 0; padding: 0; }
.w-brand .pokeball { display: block; }
.w-conn { flex: none; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--green); }
/* An icon button: no fill until hovered */
.w-icon {
  width: 24px;
  height: 22px;
  border-radius: var(--r-s);
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
}
.w-head .w-icon { width: 26px; height: 26px; border-radius: var(--r-s); background: transparent; color: var(--ink-3); }
/* A usage bar: a hairline, grey until it matters (amber from 80 %, red from 90 %) */
.w-bar { height: var(--bar-h); border-radius: 1px; background: var(--track); overflow: hidden; }
.w-bar span { display: block; height: 100%; border-radius: 1px; background: var(--bar); transition: width 0.4s; }

.w-sessions {
  grid-column: 1 / -1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
/* The list's header: 세션 n, then 간략 / 상세, a new shell, a new session */
.w-list-head { display: flex; align-items: center; gap: 4px; margin: 2px 0 6px; font-size: var(--t-meta); color: var(--ink-3); min-width: 0; }
.w-list-count { margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.w-list-mode { flex: none; display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); padding: 1px; margin-right: 2px; }
.w-list-mode > span {
  position: relative; font: inherit; font-size: var(--t-micro); line-height: 1.4; color: var(--ink-3);
  padding: 1px 7px; border: 0; border-radius: calc(var(--r-s) - 1px); background: none; white-space: nowrap;
}
.w-list-mode > span.on { background: var(--sel-bg); color: var(--ink); }
.w-list-btn {
  flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: var(--r-s); background: none; color: var(--ink-3);
  font: 500 var(--t-micro)/1 'Monaspace Neon Var', 'Monaspace Neon', Consolas, monospace;
}
.w-rows { display: flex; flex-direction: column; gap: var(--row-gap); }
/* Session rows: no fill and no ring; the chosen one a little lighter with a 2px yellow bar at the
   panel's left edge. They reach 8px into the card's side padding (the sections pad 16px), so the
   bar sits at the edge itself */
.w-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 -8px;
  padding: 8px 8px 8px 10px;
  border-radius: var(--r-m);
  background: none;
  border: 0;
  user-select: none;
}
.w-row:hover { background: var(--hover); }
.w-row.chosen { background: var(--row-sel-bg); }
.w-row.chosen::before { content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--accent); pointer-events: none; }
.w-row-name { font-size: var(--t-name); font-weight: var(--w-name); color: var(--ink-2); }
.w-row.chosen .w-row-name { color: var(--ink); }
.w-row-project { color: var(--ink-3); font-size: var(--t-meta); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The status: a dot and grey words, no fill */
.w-pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-meta); font-weight: var(--w-body); padding: 0; border-radius: 0; background: none; color: var(--ink-3); white-space: nowrap; }
.w-pill-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.w-pill.mood-working .w-pill-dot { background: var(--green); }
.w-pill.mood-needs-you { color: var(--ink-2); }
.w-pill.mood-needs-you .w-pill-dot { background: var(--amber); }
.w-pill.mood-error .w-pill-dot { background: var(--danger); }
.w-row-bottom { display: flex; align-items: center; gap: 8px; padding-left: 34px; }
.w-ctx { flex: 1; height: var(--hp-h); border-radius: 2px; background: var(--track); overflow: hidden; }
.w-ctx span { display: block; height: 100%; border-radius: 2px; background: var(--hp); }
.w-row-num { font-size: var(--t-meta); color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Limits: two slim rows, hairline bars, grey until they matter ---------- */
.w-limits { display: grid; grid-template-columns: minmax(36px, max-content) minmax(0, 1fr) 30px 74px; column-gap: 10px; row-gap: 7px; padding: 9px 12px; }
.w-limit { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
.w-limit > .w-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-limit-pct { text-align: right; font-weight: var(--w-body); font-size: var(--t-meta); color: var(--num-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* (the site's markup wraps the number in <b>: it reads as the app's plain text) */
.w-limit-pct b, .w-limit-pct small { font: inherit; color: inherit; margin: 0; }
.w-limit-reset { font-size: var(--t-meta); color: var(--ink-3); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.w-limit.tone-warn .w-bar span { background: var(--bar-warn); }
.w-limit.tone-danger .w-bar span { background: var(--bar-danger); }
.w-limit.tone-warn .w-limit-pct { color: var(--amber); }
.w-limit.tone-danger .w-limit-pct { color: var(--red-text); }

/* ---------- Session rows: the Pokémon beside two lines ---------- */
.w-row-head { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: center; }
.w-row-head > .w-row-mon { grid-row: 1 / span 2; width: var(--row-mon); height: var(--row-mon); }
.w-row-line1, .w-row-line2 { display: flex; align-items: center; gap: 6px; min-width: 0; position: relative; }
.w-row-line1 .w-row-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-row-line1 > .w-pill { flex: none; }
.w-row-line2 { gap: 6px; min-height: 16px; font-size: var(--t-meta); }
.w-row-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; }
.w-row-meta .w-row-project { flex: 0 1 auto; min-width: 44px; }
.w-row-meta .w-row-tool { margin-left: 0; }
.w-row-lv { flex: none; white-space: nowrap; }
.w-row-model { flex: none; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-meta); color: var(--ink-3); }
/* The context window as HP: what is left drains like a Pokémon's HP bar */
.w-hp-label { flex: none; font-size: var(--t-micro); font-weight: var(--w-body); color: var(--ink-3); }
.w-ctx.w-hp span { transition: width 0.6s ease-out, background-color 0.3s; }
.w-ctx.hp-green span, .w-ctx.hp-full span { background: var(--hp); }
.w-ctx.hp-yellow span { background: var(--hp-warn); }
.w-ctx.hp-red span { background: var(--hp-low); }
.w-ctx.hp-full span { opacity: 0.35; }
/* The session folder's git branch, after the project: quiet, no chip, cut short when the row is narrow */
.w-row-branch { flex: 0 1 auto; min-width: 0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(var(--t-meta) - 0.5px); font-weight: var(--w-mono); color: var(--ink-3); font-family: 'Monaspace Neon Var', 'Monaspace Neon', 'Pretendard Variable', 'Pretendard JP Variable', Consolas, monospace; }
.w-row-branch::before { content: '⎇ '; opacity: 0.7; }
.w-row-tool { flex: none; font-size: var(--t-micro); color: var(--ink-3); padding: 1px 6px; border-radius: var(--r-s); border: 1px solid var(--line); margin-left: 6px; white-space: nowrap; }

/* ======================= widget-expanded.css ======================= */

.widget { flex-direction: row; gap: 6px; }
.w-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; position: relative; }
.widget.expanded .w-side { flex: 0 0 var(--side-w); width: var(--side-w); }

/* ---------- Launcher: a plain text row (new session), then folder and resume as icons ---------- */
.w-launch { grid-column: 1 / -1; display: flex; gap: 2px; padding: 6px; border-radius: var(--r-l); }
.w-launch-main {
  flex: 1; display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px;
  font: inherit; font-weight: var(--w-body); font-size: var(--t-ui); color: var(--ink-2);
  background: none; border: 0; border-radius: var(--r-s); padding: 7px 8px; min-height: 34px; min-width: 0;
}
.w-launch-alt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 40px;
  font: inherit; font-size: 14px; color: var(--ink-3); background: none; border: 0; border-radius: var(--r-s);
}
.w-launch-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Terminal card (expanded) ---------- */
.w-term { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; background: var(--term-bg); margin-top: 6px; }
.w-term-tabs {
  display: flex; align-items: center; gap: 2px; height: var(--head-h);
  padding: 0 8px 0 10px; border-bottom: 1px solid var(--line); background: var(--bg);
  overflow: hidden; min-width: 0; flex-shrink: 0;
}
.w-term-tabs > * { flex-shrink: 0; }
.w-term-tabs > .w-term-spacer { flex: 1 1 0; min-width: 0; }

/* ---------- The session header: the bar under the view bar names the open session ----------
   (the session tabs are gone: the left list and the folded rail switch sessions) */
.w-sess-bar {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0; min-width: 0;
  height: var(--sess-bar-h); padding: 0 8px 0 10px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.w-sess-head { display: flex; align-items: baseline; gap: 8px; flex: 1 1 auto; min-width: 0; padding-left: 4px; }
/* the words share a baseline, as in the app (1.6.1); the picture and the × stay centred */
.w-sess-head > .w-sess-head-pic, .w-sess-head > .w-sess-head-close { align-self: center; }
.w-sess-head-pic { flex: none; width: 22px; height: 22px; object-fit: contain; }
.w-sess-head-name {
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--t-name); font-weight: var(--w-name); color: var(--ink);
}
.w-sess-head .w-sess-head-branch { flex: 0 1 auto; max-width: 220px; }
.w-sess-head-proj { flex: none; font-size: var(--t-meta); color: var(--ink-3); white-space: nowrap; }
.w-sess-head-spacer { flex: 1 1 0; min-width: 0; }
.w-sess-head-close {
  flex: none; display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0;
  font: inherit; font-size: var(--t-big); line-height: 1; color: var(--ink-3);
  background: none; border: 0; border-radius: var(--r-s);
}
/* the session tabs (1.8.0, from the app's widget-expanded.css) */
.w-sess-head:has(.w-sess-tabs) { align-items: stretch; align-self: stretch; padding-left: 0; }
.w-sess-tabs { display: flex; align-items: stretch; align-self: stretch; gap: 2px; min-width: 0; flex: 0 1 auto; }
.w-sess-tab { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 260px; padding: 0 4px 0 8px; border-radius: var(--r-s) var(--r-s) 0 0; color: var(--ink-3); }
.w-sess-tab.on { flex: 0 1 auto; background: var(--hover); color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink-2); }
.w-sess-tab .w-sess-head-pic { width: 18px; height: 18px; }
.w-sess-tab.on .w-sess-head-pic { width: 20px; height: 20px; }
.w-sess-tab-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-ui); }
.w-sess-tab.on .w-sess-head-name { line-height: 1.4; }
.w-sess-tab.on .w-sess-head-branch { flex: 0 1 auto; max-width: 140px; }
.w-sess-tab-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.w-sess-tab.mood-working .w-sess-tab-dot { background: var(--green); }
.w-sess-tab.mood-needs-you .w-sess-tab-dot { background: var(--amber); }
.w-sess-tab-x { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; font-size: var(--t-name); line-height: 1; color: var(--ink-3); }
.w-sess-head > .w-sess-head-close { align-self: center; }
.w-term-spacer { flex: 1; }
.w-term-body { position: relative; flex: 1; min-height: 0; }
.w-term-body .term-view { position: absolute; inset: 10px 4px 6px 12px; }

/* ---------- Window mode: one opaque app, edge to edge ---------- */
.widget.mode-window { background: #0b0c10; padding: 0; gap: 0; }
.widget.mode-window .w-side { background: var(--side-bg); border-right: 1px solid var(--line); padding: 0 0 8px; height: 100%; }
.widget.mode-window .w-term { margin: 0; border: 0; border-radius: 0; height: 100%; }

/* ---------- Icons ---------- */
.ico { display: block; flex-shrink: 0; }
.pokeball { display: block; flex-shrink: 0; object-fit: contain; image-rendering: auto; }
.w-view-switch button { display: inline-flex; align-items: center; gap: 5px; }
.w-view-switch button.icon-only { padding: 5px 8px; }
.w-icon { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Window: the sidebar is open space, not cards in a box ---------- */
.widget.mode-window .w-side .w-card { background: transparent; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; }
.widget.mode-window .w-side .w-card:last-child { border-bottom: 0; }
.widget.mode-window .w-bento { gap: 0; }
.widget.mode-window .w-side .w-limits { padding: 12px 16px; }
.widget.mode-window .w-side .w-launch { padding: 6px 8px; }
/* The Pokédex strip and the session list read as one block: no line between them */
.widget.mode-window .w-side .w-dex { padding-bottom: 6px; border-bottom: 0; }

/* ---------- The top bar's right end: the widget toggle, the text size, the window's own three ---------- */
.w-win-controls { display: flex; gap: 2px; margin-left: 4px; flex: none; }
.w-widget-toggle { flex: none; width: 30px; height: 28px; border-radius: var(--r-s); background: transparent; color: var(--ink-3); margin-left: 4px; }
.w-win-controls .w-icon { width: 30px; height: 28px; border-radius: var(--r-s); background: transparent; color: var(--ink-3); }
/* The one text size: − 가 보통 + (TextSizeControl) */
.w-textsize {
  position: relative; flex: none; display: inline-flex; align-items: center;
  height: 28px; margin: 0 4px 0 6px; border: 1px solid var(--line); border-radius: var(--r-m);
}
.w-textsize > span { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0; color: var(--ink-3); }
.w-textsize > .w-textsize-step { width: 24px; font-size: 14px; line-height: 1; }
.w-textsize > .w-textsize-step.off { opacity: 0.3; }
.w-textsize > .w-textsize-cur {
  gap: 5px; padding: 0 7px; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  color: var(--ink-2); font-size: var(--t-meta); white-space: nowrap;
}
.w-textsize-g { font-family: 'Pretendard Variable', 'Pretendard JP Variable', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; font-size: 13px; line-height: 1; color: var(--ink); }

/* ---------- 설정 rows (calm: switches green when on; nothing yellow) ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-text b { font-size: var(--t-name); font-weight: var(--w-name); color: var(--ink); }
.set-text small { font-size: var(--t-meta); color: var(--ink-3); line-height: 1.45; overflow-wrap: anywhere; }
/* 32×18, a 14px knob; on: the HP green with a dark knob */
.set-switch { flex: none; position: relative; width: 32px; height: 18px; padding: 0; border-radius: 999px; border: 0; background: #2c303b; cursor: pointer; transition: background 0.15s; }
.set-switch i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #c9cdd6; transition: transform 0.15s, background 0.15s; }
.set-switch.on { background: var(--hp); }
.set-switch.on i { transform: translateX(14px); background: var(--accent-ink); }
.set-mono { font-family: 'Monaspace Neon Var', 'Monaspace Neon', 'Pretendard Variable', 'Pretendard JP Variable', monospace; }
.w-side-toggle { flex: none; }

/* ======================= pokedex.css ======================= */

.widget { --w-icon: var(--strip-mon); }

/* A tier's name in its colour (box card, log) */
.w-toast-tier { color: var(--tier); font-weight: var(--w-name); }

.dex-cell img, .dex-card-art img,
.w-dex-recent img, .w-row img { image-rendering: auto !important; }

/* ---------- Dex strip: one line — the label (and the new dot), the count beside it, the latest four ---------- */
.w-dex {
  position: relative; grid-column: 1 / -1; display: grid; grid-template-columns: auto auto 1fr;
  align-items: center; column-gap: 10px; text-align: left; font: inherit; color: inherit;
}
.w-dex .w-label { grid-column: 1; grid-row: 1; white-space: nowrap; }
.w-dex-count { grid-column: 2; grid-row: 1; font-size: var(--t-meta); color: var(--ink-3); white-space: nowrap; }
.w-dex-count b { font-size: var(--t-meta); font-weight: var(--w-body); color: var(--num-ink); }
.w-dex-recent { grid-column: 3; grid-row: 1; display: flex; gap: 3px; justify-content: flex-end; align-items: center; min-width: 0; overflow: hidden; }
.w-dex-recent img { width: var(--w-icon); height: var(--w-icon); object-fit: contain; flex: none; }
.w-dex-recent img:nth-child(n+5) { display: none; }

/* ---------- View tabs (calm: no box around them; the selected view a light grey box with
   primary-ink text; yellow is for the chosen session and 보내기 only) ---------- */
.w-view-switch { display: inline-flex; gap: 2px; padding: 0; margin-right: 6px; background: none; border: 0; flex-shrink: 0; }
.w-view-switch button {
  position: relative; font: inherit; font-size: var(--t-ui); font-weight: var(--w-body);
  padding: 5px 11px; border: 0; border-radius: var(--r-s); background: transparent; color: var(--ink-3);
}
.w-view-switch button.on { background: var(--sel-bg); color: var(--ink); }
.w-view-switch.w-view-icons { margin-right: 2px; }

/* ---------- "New": a caught Pokémon whose entry was never opened ---------- */
.dex-new, .w-new-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--new-dot); box-shadow: 0 0 0 2px var(--card); }
/* In a 도감 cell: small, no ring (the cell is quiet, the dot is the one red thing) */
.dex-new { position: absolute; right: 6px; top: 6px; width: 5px; height: 5px; box-shadow: none; }
.w-view-switch .w-new-dot { position: absolute; top: 4px; right: 3px; width: 5px; height: 5px; box-shadow: none; }
/* In the dex strip: small, right after the label */
.w-dex .w-new-dot { display: inline-block; width: 5px; height: 5px; margin-left: 4px; vertical-align: 2px; box-shadow: none; }

/* ---------- The Pokédex (calm: hairlines and spacing; the Pokémon are the colour) ---------- */
.dex { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dex-main { flex: 1; min-height: 0; display: flex; }
.dex-grid {
  flex: 1; min-width: 0; overflow-y: auto; padding: 14px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; align-content: start;
}
.dex-grid::-webkit-scrollbar, .dex-detail::-webkit-scrollbar { width: 8px; }
.dex-grid::-webkit-scrollbar-thumb, .dex-detail::-webkit-scrollbar-thumb { background: #2c303b; border-radius: var(--r-s); }
/* No border: the picture box's grey is the cell; the picked one gets the 1px yellow line */
.dex-cell {
  position: relative; aspect-ratio: 1;
  /* 1025 cells: the ones scrolled out of view skip layout and paint */
  content-visibility: auto; contain-intrinsic-size: auto 92px;
  border-radius: var(--r-m); background: var(--mon-bg); border: 0;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.dex-cell img { width: 62px; height: 62px; object-fit: contain; }
.dex-cell.seen img { filter: brightness(0) invert(0.32); }
.dex-cell.unknown { background: var(--unknown-bg); }
.dex-cell:hover { background: var(--mon-bg-hover); }
.dex-cell.picked { box-shadow: inset 0 0 0 1px var(--accent); }
.dex-cell:focus-visible { outline: 2px solid #ffd84a; outline-offset: 1px; }
.dex-q { color: var(--q-ink); font-weight: var(--w-name); font-size: 14px; }
.dex-q.big { font-size: 48px; }
.dex-no { position: absolute; left: 6px; top: 4px; font-size: var(--t-micro); color: var(--ink-3); opacity: 0.8; font-variant-numeric: tabular-nums; }
.dex-shiny { position: absolute; left: 6px; bottom: 4px; font-size: var(--t-micro); color: var(--shiny); }
.dex-count { position: absolute; right: 6px; bottom: 4px; font-size: var(--t-micro); color: var(--ink-3); font-weight: var(--w-body); font-variant-numeric: tabular-nums; }
.dex-empty { grid-column: 1 / -1; color: var(--ink-3); padding: 20px; text-align: center; font-size: var(--t-ui); }

/* Dashboard: three numbers and the tiers as columns, no boxes: a hairline between them */
.dex-top { padding: 14px 20px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.dex-stats { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)) minmax(340px, 2.6fr); gap: 0; }
.dex-stat {
  display: grid; grid-template-columns: 1fr auto; align-content: space-between; row-gap: 2px;
  padding: 0 20px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: none; min-width: 0;
}
.dex-stat:first-child { border-left: 0; padding-left: 0; }
.dex-stat-label { grid-column: 1 / -1; font-size: var(--t-meta); color: var(--ink-3); font-weight: var(--w-body); }
/* Numbers read by brightness, not weight */
.dex-stat-value { grid-column: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dex-stat-value b { font-size: calc(var(--t-num) + 8px); font-weight: var(--w-strong); color: var(--num-ink); letter-spacing: -0.02em; }
.dex-stat-value small { font-size: var(--t-meta); color: var(--ink-3); }
.dex-stat-pct { grid-column: 2; grid-row: 2; align-self: end; font-size: var(--t-meta); color: var(--ink-3); font-weight: var(--w-body); font-variant-numeric: tabular-nums; }
.dex-stat-bar { grid-column: 1 / -1; height: 2px; margin-top: 4px; border-radius: 1px; background: var(--track); overflow: hidden; }
.dex-stat-bar i { display: block; height: 100%; border-radius: 1px; background: var(--ink-3); }
.dex-stat-tiers { align-content: stretch; }
.dex-tiers { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dex-tiercol { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; }
.dex-tiercol span { font-size: var(--t-meta); font-weight: var(--w-body); color: var(--tier); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-tiercol em { font-style: normal; font-size: calc(var(--t-num) + 3px); font-weight: var(--w-strong); color: var(--num-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dex-tiercol em small { font-size: var(--t-meta); font-weight: var(--w-body); color: var(--ink-3); }
.dex-tiercol i { height: 2px; border-radius: 1px; background: var(--track); overflow: hidden; }
.dex-tiercol i b { display: block; height: 100%; border-radius: 1px; background: var(--tier); }
@media (max-width: 1100px) {
  .dex-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* the tiers on their own line under the three numbers, from the left edge */
  .dex-stat-tiers { grid-column: 1 / -1; border-left: 0; padding: 0; margin-top: 14px; }
}

/* Filters: segmented controls with no box around the group, the selected one in the neutral grey */
.dex-filterbar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.dex-fgroup { display: flex; align-items: center; gap: 8px; }
.dex-flabel { font-size: var(--t-meta); color: var(--ink-3); font-weight: var(--w-body); white-space: nowrap; }
.dex-seg { display: flex; gap: 2px; padding: 0; border-radius: 0; background: none; border: 0; }
.dex-seg button, .dex-chips button {
  font: inherit; font-size: var(--t-meta); font-weight: var(--w-body); cursor: pointer; white-space: nowrap;
  border: 0; background: transparent; color: var(--ink-3); padding: 4px 9px; border-radius: var(--r-s); min-width: 26px;
}
/* A tier chip: the coloured dot and the word, no tier-coloured fill or border */
.dex-chips { display: flex; gap: 2px; }
.dex-chips button { color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; padding-top: 5px; padding-bottom: 5px; }
.dex-seg button:not(.on):hover, .dex-chips button:not(.on):hover { color: var(--ink-2); background: var(--hover); }
.dex-seg button.on, .dex-chips button.on { background: var(--sel-bg); color: var(--ink); }
.dex-fsearch { margin-left: auto; }
.dex-fsearch input {
  font: inherit; font-size: var(--t-ui); color: var(--ink); width: 150px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 5px 9px;
}
.dex-fsearch input:focus { outline: none; border-color: var(--ink-3); }
.dex-result { font-size: var(--t-meta); color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 40px; white-space: nowrap; }

/* The right panel: a card */
.dex-detail { width: 300px; flex-shrink: 0; border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 18px; }
.dex-card { display: flex; flex-direction: column; gap: 6px; }
.dex-card-art { height: 160px; border-radius: var(--r-l); display: grid; place-items: center; background: var(--mon-bg); }
.dex-card-art img { max-height: 130px; max-width: 90%; }
.dex-card-art img.silhouette { filter: brightness(0) invert(0.32); }
.dex-card-no { font-size: var(--t-meta); color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
/* The name at a fixed 16px (a heading) */
.dex-card-name { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 16px; font-weight: var(--w-head); letter-spacing: -0.02em; }
.dex-card-icon { width: 26px; height: 26px; object-fit: contain; margin: -4px 0 -4px -2px; flex: none; }
.dex-card-en { font-size: var(--t-meta); font-weight: var(--w-body); color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.dex-card-tags { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* The tier: its dot and its word in its colour, no pill */
.dex-tier { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-meta); font-weight: var(--w-name); padding: 0; border-radius: 0; color: var(--tier); background: none; }
/* A type: a hairline tag in the type's own text colour, no fill */
.dex-type { font-size: var(--t-meta); font-weight: var(--w-name); padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r-xs); background: none; color: var(--ink); }
.dex-card-genus { font-size: var(--t-meta); color: var(--ink-3); }
.dex-card-flavor { font-family: 'Pretendard Variable', 'Pretendard JP Variable', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Hiragino Sans', system-ui, sans-serif; font-size: var(--t-ui); line-height: 1.7; color: var(--ink-2); margin: 2px 0; word-break: keep-all; }
.dex-card-flavor.muted { color: var(--ink-3); }
/* The facts: one definition list, a label column and a value column, a hairline over each pair */
.dex-facts { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 0; margin-top: 8px; }
.dex-facts div { display: contents; }
.dex-facts span, .dex-facts b { padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; }
.dex-facts span { font-size: var(--t-meta); color: var(--ink-3); padding-right: 8px; }
.dex-facts b { font-family: 'Pretendard Variable', 'Pretendard JP Variable', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Hiragino Sans', system-ui, sans-serif; font-size: var(--t-ui); font-weight: var(--w-body); color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }

/* type colours: the text only, softly */
.type-fire { color: #ffb08a; }
.type-water { color: #9ec2ff; }
.type-grass { color: #a6e39a; }
.type-electric { color: #ffe27a; }
.type-psychic { color: #ffa6c9; }
.type-ice { color: #aef0f5; }
.type-dragon { color: #b8a8ff; }
.type-dark { color: #d0c0b4; }
.type-fairy { color: #ffc2ec; }
.type-fighting { color: #ff9b90; }
.type-poison { color: #dca6f0; }
.type-ground { color: #ecd29a; }
.type-flying { color: #c2ccff; }
.type-bug { color: #d4e07a; }
.type-rock { color: #ddd0a0; }
.type-ghost { color: #c4b4f0; }
.type-steel { color: #d6dde9; }

/* Owned individuals: no fill, a hairline between them */
.dex-owned { margin-top: 12px; display: flex; flex-direction: column; gap: 0; }
.dex-owned-title { font-size: var(--t-meta); color: var(--ink-3); font-weight: var(--w-body); padding-bottom: 4px; }
.dex-owned-row { position: relative; background: none; border-top: 1px solid var(--line); border-radius: 0; padding: 7px 0; }
.dex-owned-top { display: flex; align-items: center; gap: 6px; font-size: var(--t-ui); min-width: 0; }
.dex-owned-top b { font-weight: var(--w-name); color: var(--ink); }
.dex-owned-top .dex-nature { margin-left: auto; }
.dex-nature { font-size: var(--t-meta); color: var(--ink-2); white-space: nowrap; }
.dex-owned-sub { font-size: var(--t-meta); color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.dex-lv { font-size: var(--t-micro); font-weight: var(--w-name); color: var(--ink-2); margin-right: 2px; font-variant-numeric: tabular-nums; }
.dex-owned-top img.pokeball { width: 14px; height: 14px; }

.w-row-mon { width: var(--row-mon); height: var(--row-mon); object-fit: contain; flex-shrink: 0; image-rendering: auto; }
.w-row-lv { font-size: var(--t-meta); font-weight: var(--w-body); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- The log (calm: a ruled list, numbers by brightness, line tags) ---------- */
.today { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-day { position: sticky; top: 0; z-index: 1; margin: 6px 0 0; padding: 8px 0 4px; font-size: var(--t-meta); font-weight: var(--w-name); color: var(--ink-3); background: var(--bg); }
.today-day:first-child { margin-top: 0; }
.today-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-radius: 0; }
/* a very faint line between entries */
.today-row + .today-row { border-top: 1px solid rgba(255, 255, 255, 0.045); }
.today-time { width: 5.6em; flex: none; white-space: nowrap; font-size: var(--t-meta); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.today-row img.today-icon { width: 24px; height: 24px; object-fit: contain; flex: none; }
.today-row img.faded { opacity: 0.4; filter: grayscale(0.6); }
.today-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.today-line { font-size: var(--t-name); color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.today-line b { color: var(--ink); font-weight: var(--w-name); }
.today-row.kind-flee .today-line, .today-row.kind-flee .today-line b { color: var(--ink-3); }
/* NEW and 출석: line tags, no yellow */
.today-new { font-size: var(--t-micro); font-weight: var(--w-body); color: var(--ink-2); background: none; border: 1px solid var(--line); padding: 0 5px; border-radius: var(--r-xs); }
.today-sub { display: flex; align-items: center; gap: 6px; font-size: var(--t-meta); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The tier: its dot and its word */
.today-sub .w-toast-tier { display: inline-flex; align-items: center; gap: 4px; flex: none; font-weight: var(--w-name); }
.today-ball { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); }
.today-ball img { width: 13px; height: 13px; }

/* A session waiting on the trainer: its Pokémon hops in place (only then, so the hop is the signal) */
.w-row.mood-needs-you .w-row-mon { animation: wMonHop 1.2s cubic-bezier(.3, .7, .4, 1) infinite; transform-origin: 50% 100%; }
@keyframes wMonHop { 0%, 60%, 100% { transform: none; } 20% { transform: translateY(-4px); } 40% { transform: translateY(0) scale(1.04, 0.96); } }
@media (prefers-reduced-motion: reduce) { .w-row.mood-needs-you .w-row-mon { animation: none; } }

/* ======================= toast.css (the catch card, out of its window) =======================
   The one lively thing in the calm look (a reward): the rounder card, the picture, the tier in its
   colour, NEW in yellow. A fixed-size window in the app: the 보통 sizes, the name a fixed 15px. */

.w-toast {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 14px;
  padding: 14px 18px 14px 14px; border-radius: var(--r-toast);
  border: 1px solid var(--line); background: var(--toast-bg);
  animation: toastIn 0.3s cubic-bezier(.2, .8, .2, 1) both;
}
.w-toast.leaving { animation: toastOut 0.35s ease-in both; }
/* The picture: the heaviest thing on the card, on the same quiet grey as the dex (no tier tint) */
.w-toast-art { width: 64px; height: 64px; border-radius: var(--r-l); display: grid; place-items: center; background: var(--toast-art-bg); }
.w-toast-art img { width: 48px; height: 48px; object-fit: contain; image-rendering: auto; }
.w-toast-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 10px; }
/* 1. What happened: a quiet label, the tier as its dot and its word in its colour (no pill) */
.w-toast-eyebrow { display: flex; align-items: center; gap: 8px; font-size: var(--t-meta); font-weight: var(--w-name); line-height: 1.4; }
.w-toast-kind { color: var(--ink-3); }
.w-toast .w-toast-tier { display: inline-flex; align-items: center; gap: 5px; color: var(--tier); padding: 0; background: none; }
/* NEW and 오늘의 출석 stay yellow tags: a reward */
.w-toast-new { color: var(--accent-ink); background: var(--new-badge); padding: 0 5px; border-radius: 999px; font-size: var(--t-micro); font-weight: var(--w-name); }
.w-toast-badge { color: var(--accent-ink); background: var(--new-badge); padding: 0 7px; border-radius: 999px; }
/* 2. Who: the name, loudest text (15px whatever the step: the window is fixed) */
.w-toast-title { font-size: 15px; font-weight: var(--w-head); color: var(--ink); letter-spacing: -0.02em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-toast-title small { margin-left: 7px; font-size: var(--t-meta); font-weight: var(--w-body); color: var(--ink-3); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.w-toast-arrow { color: var(--ink-3); font-weight: inherit; }
/* 3. How and where: one quieter line */
.w-toast-meta { margin-top: 3px; display: flex; align-items: center; gap: 8px; font-size: var(--t-ui); color: var(--ink-2); min-width: 0; white-space: nowrap; }
.w-toast-ball { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: var(--w-name); flex: none; }
.w-toast-ball img { width: 14px; height: 14px; }
.w-toast-place { overflow: hidden; text-overflow: ellipsis; }
/* 4. Why: the quietest line */
.w-toast-via { font-size: var(--t-meta); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* One that got away: a silhouette, as in the dex */
.w-toast.kind-flee .w-toast-art img { filter: brightness(0) invert(0.32); }
.w-toast.kind-flee .w-toast-art { background: var(--toast-art-bg); }
.w-toast.kind-flee .w-toast-title { color: var(--ink-2); }
/* The rarer the catch, the more its edge takes the tier's colour */
.w-toast.kind-catch.tier-rare { border-color: color-mix(in srgb, var(--tier) 35%, transparent); }
.w-toast.kind-catch.tier-sub { border-color: color-mix(in srgb, var(--tier) 50%, transparent); }
.w-toast.kind-catch.tier-legendary, .w-toast.kind-catch.tier-mythical { border-color: var(--tier); box-shadow: 0 0 0 1px var(--tier); }
.w-toast.shiny { border-color: var(--shiny); }
@keyframes toastIn { from { transform: translateY(24px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .w-toast, .w-toast.leaving { animation: none; } }

/* ======================= terminal.css ======================= */

.term-view { position: absolute; inset: 4px 0 0 6px; }
