/* Hallmark · shape: app screen · genre: editorial · theme: Hedgerow (deal 3/3, seed personal-tracker-how-far-2404·fe86258a·2026-10-30·r0) · redesign: full
 * nav: top bar with the wordmark and two icon buttons; from 60rem a left rail of filters (statuses, kinds) beside the command bar and the list · signature: the bookmark ribbon, a teal tag hung on each row's progress line at the episode where you stopped · states: loading skeleton, empty, no match, error, undo toast · hedgerow: custom (the user asked for a light palette, so the dark leaf-green is replaced by pale mist paper and one muted teal)
 * axes: light/high-contrast-serif/chromatic-teal · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V5 · weakest: S, a list app has little to argue; argued that a watch log is a field guide: ruled index rows, the title and the episode set in the serif, one teal rule heading the list and one ribbon per row */
/* Hallmark · answered F7 · the controls and the tags inside them share two radii (12px controls, 6px tags and key caps); rows and the list stay unrounded rules */
/* Hallmark · face note · Prata has no Hangul, so Noto Serif KR carries the display and IBM Plex Sans KR the body; two families, no mono */
@import url("./tokens.css?v=grad5");
@import url("./base.css?v=grad5");

/* 갈피 (Galpi)
   디자인: hallmark 'Hedgerow' 테마. 짙은 초록 종이에 크림 잉크, 신호색은 연두 하나.
   카드 대신 괘선 색인, 제목과 회차는 명조, 진행 줄 위에는 책갈피 리본.
   app.js 의 인라인 스타일이 쓰던 별칭(--accent 등)은 새 토큰을 가리키게 남겨둔다. */

:root {
  --rule-bar: 1.5px;
  --topbar: 64px;
  --color-edge: color-mix(in oklab, var(--color-muted) 60%, var(--color-paper));
  --color-field: var(--color-paper-2);
  --color-tint: color-mix(in oklab, var(--color-accent) 8%, transparent);
  --color-scrim: color-mix(in oklab, var(--color-ink) 38%, transparent);

  --accent: var(--color-accent);
  --muted: var(--color-muted);
  --ok: var(--color-success);
  --text: var(--color-ink);

  --safe-b: env(safe-area-inset-bottom, 0px);
}

body {
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button { cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
button:disabled, button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* 누를 곳에서 글자가 끌려 선택되면 드래그가 되어 오작동으로 이어진다.
   입력칸은 당연히 선택할 수 있어야 하므로 제외한다. */
button, .card, .chip, .thumb, .linkbtn, .plus, .log, .hint, .brand, .card-main {
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
input, textarea, .inp { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; }

.ic { width: 20px; height: 20px; flex: none; pointer-events: none; }

/* ---------------------------------------------------------- 틀 */
.app {
  max-width: 70rem; margin: 0 auto;
  padding: 0 var(--space-md) calc(var(--space-3xl) + var(--safe-b));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "cmd" "rail" "list";
}
.topbar { grid-area: top; }
.cmdbar { grid-area: cmd; }
.rail   { grid-area: rail; }
.list   { grid-area: list; }

@media (min-width: 60rem) {
  .app {
    padding-inline: var(--space-lg);
    grid-template-columns: 15rem minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "top top" "rail cmd" "rail list";
    column-gap: var(--space-xl);
  }
}

/* ---------------------------------------------------------- 상단 */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky-nav);
  min-height: var(--topbar);
  background: color-mix(in oklab, var(--color-paper) 72%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: var(--space-2xs);
}

.brand {
  max-width: none; margin: 0;
  font-size: var(--text-2xl); line-height: 1; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: var(--space-xs);
}
.brand { font-family: var(--font-display); background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; width: fit-content; }
.brand .mark { width: 16px; height: 20px; color: var(--color-accent); flex: none; }
.spacer { flex: 1; }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius-ctl);
  display: grid; place-items: center; flex: none;
  color: var(--color-ink-2);
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--color-tint); color: var(--color-ink); }
.icon-btn:active { background: var(--color-paper-3); }
.icon-btn.on { color: var(--color-accent); }

/* ---------------------------------------------------------- 명령바 */
.cmdbar {
  position: sticky; top: var(--topbar); z-index: var(--z-sticky);
  background: color-mix(in oklab, var(--color-paper) 72%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  padding-bottom: var(--space-sm);
}

.cmdbox { position: relative; }
.cmdbox > svg {
  position: absolute; left: var(--space-md); top: 50%; translate: 0 -50%;
  width: 18px; height: 18px; color: var(--color-muted); pointer-events: none;
}

#cmd {
  width: 100%; min-height: 48px; min-width: 0;
  padding: 0 calc(var(--space-2xl) - var(--space-sm)) 0 var(--space-xl);
  background: var(--color-field); color: var(--color-ink);
  border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-ctl);
  font-size: var(--text-md);   /* iOS 자동확대 방지 */
  outline: 2px solid transparent; outline-offset: 2px;
}
#cmd::placeholder { color: var(--color-muted); opacity: 1; }
#cmd:focus-visible { outline-color: var(--color-focus); border-color: var(--color-accent); }
#cmd:disabled { opacity: 0.55; cursor: not-allowed; }

.slash {
  position: absolute; right: var(--space-md); top: 50%; translate: 0 -50%;
  min-width: 24px; height: 24px; display: grid; place-items: center;
  border: var(--rule-hair) solid var(--color-edge); border-radius: var(--radius-sm);
  font: 500 var(--text-xs)/1 var(--font-body); color: var(--color-muted); pointer-events: none;
}
.cmdbox:has(#cmd:not(:placeholder-shown)) .slash { display: none; }
@media (hover: none) { .slash { display: none; } }

.cmd-x {
  position: absolute; right: var(--space-xs); top: 50%; translate: 0 -50%;
  width: 36px; height: 36px; border-radius: var(--radius-ctl);
  color: var(--color-muted);
  display: none; place-items: center;
}
.cmd-x svg { width: 16px; height: 16px; }
.cmd-x:hover { color: var(--color-ink); background: var(--color-tint); }
.cmd-x:active { background: var(--color-paper-3); }
.cmd-x.on { display: grid; }

.hint {
  display: none; margin-top: var(--space-xs); padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-3);
  border: var(--rule-hair) solid var(--color-edge); border-radius: var(--radius-ctl);
  font-size: var(--text-sm); color: var(--color-ink); font-weight: 500;
  align-items: center; gap: var(--space-xs); cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out);
}
.hint.on { display: flex; }
.hint:hover { border-color: var(--color-accent); }
.hint b { color: var(--color-accent); font-weight: 700; }
.hint .warn { color: var(--color-ink-2); font-weight: 400; }
.hint kbd {
  border: var(--rule-hair) solid var(--color-edge); border-radius: var(--radius-sm);
  padding: 0 var(--space-xs); font: 500 var(--text-xs)/1.6 var(--font-body);
  color: var(--color-muted); margin-left: auto; flex: none;
}

/* ---------------------------------------------------------- 필터 (좁은 화면: 가로 칩 두 줄) */
.rail { min-width: 0; }

.filters {
  display: flex; align-items: center; gap: var(--space-xs); overflow-x: auto;
  padding: var(--space-2xs) var(--space-2xs) var(--space-xs);
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: none; min-height: 40px; padding: 0 var(--space-md);
  display: inline-flex; align-items: center; gap: var(--space-xs);
  border-radius: var(--radius-ctl);
  border: var(--rule-hair) solid var(--color-edge);
  font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.chip:hover { background: var(--color-tint); color: var(--color-ink); }
.chip:active { background: var(--color-paper-3); }
.chip.on { background: var(--grad-accent-soft); border-color: var(--color-accent); color: var(--color-ink); }
.chip .n { font-size: var(--text-xs); color: var(--color-muted); font-variant-numeric: tabular-nums; }

/* 체크 칸: 켜진 개별 탭에서만 보이고, 넓은 화면의 세로 목록에서는 꺼진 칸도 보인다 */
.ck {
  width: 16px; height: 16px; flex: none; display: grid; place-items: center;
  border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-sm); color: var(--color-accent-ink);
}
.ck .ic { width: 12px; height: 12px; stroke-width: 2.5; }
.chip.on .ck { background: var(--grad-accent); border-color: transparent; }
.chip:not(.on) .ck { display: none; }

/* 프리셋 탭(전체·진행·다 봄·멈춤): 테두리 없는 글자. 개별 탭과 역할이 다르므로 모양부터 다르다. */
.chip.preset { border-color: transparent; color: var(--color-muted); padding: 0 var(--space-sm); }
.chip.preset:hover { color: var(--color-ink); }
.chip.preset.on { background: none; color: var(--color-ink); font-weight: 700; border-bottom-color: var(--color-accent); border-radius: 0; }
.chip.preset.partial { color: var(--color-ink-2); border-bottom-color: var(--color-edge); border-radius: 0; }

.divider { width: 1px; align-self: stretch; background: var(--color-rule); margin: var(--space-xs) var(--space-2xs); flex: none; }

/* 넓은 화면: 필터가 왼쪽 세로 목록이 된다. 고른 줄의 괘선이 연두로 바뀐다. */
@media (min-width: 60rem) {
  .rail {
    position: sticky; top: calc(var(--topbar) + var(--space-xs)); align-self: start;
    max-height: calc(100dvh - var(--topbar) - var(--space-lg)); overflow-y: auto;
    scrollbar-width: thin;
  }
  .filters { flex-direction: column; align-items: stretch; gap: 0; overflow: visible; padding: 0 0 var(--space-lg); }
  .chip {
    width: 100%; min-height: 44px; padding: 0 var(--space-xs);
    border: 0; border-bottom: var(--rule-hair) solid var(--color-rule); border-radius: 0;
    background: none;
  }
  .chip .n { margin-left: auto; }
  .chip:not(.on) .ck { display: grid; }
  .chip.on { background: var(--grad-accent-soft); border-bottom-color: var(--color-accent); font-weight: 700; }
  .chip.preset { padding: 0 var(--space-xs); }
  .chip.preset.on, .chip.preset.partial { border-radius: 0; }
  .chip.preset.partial { background: none; }
  .rail .chip:focus-visible { outline-offset: -2px; }
  .divider { width: 100%; height: var(--rule-bar); margin: var(--space-sm) 0; background: var(--color-muted); }
  #kindFilters .chip { min-height: 40px; }
}

/* ---------------------------------------------------------- 목록: 괘선 색인 */
.list {
  min-width: 0;
  border-top: 3px solid transparent;
  border-image: var(--grad-accent) 1;
}

.card {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-md) var(--space-xs) var(--space-md) var(--space-2xs);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.card:hover { background: var(--grad-accent-soft); }
.card.pinned { background: color-mix(in oklab, var(--color-paper-3) 45%, transparent); }
.card.pinned:hover { background: var(--grad-accent-soft); }

.card-main {
  flex: 1; min-width: 0; cursor: pointer;
  display: flex; align-items: center; gap: var(--space-md);
  text-decoration: none; color: inherit;
}
.card-body { flex: 1; min-width: 0; }
.card-main:active .card-title { color: var(--color-accent-2); }

/* 썸네일: 틀은 3:4로 통일한다.
   세로 표지(웹툰·소설·포스터)는 꽉 채우고 위쪽을 기준으로 잘라 제목·얼굴을 살린다.
   가로 이미지(OTT 대표 이미지)는 자르지 않고 전체를 보이고, 남는 위아래는
   같은 이미지를 흐리게 깔아 채운다. 가로/세로 판정은 app.js 의 onload 가 한다. */
.thumb {
  flex: none; width: 48px; height: 64px; position: relative; isolation: isolate;
  background: var(--grad-accent-soft); overflow: hidden; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font: 600 var(--text-xl)/1 var(--font-display); color: var(--color-muted);
}
.thumb::after {   /* 테두리는 이미지 위에 얹어야 가장자리가 깔끔하다 */
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-ink) 12%, transparent);
}
.thumb img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block;
  filter: saturate(0.9) contrast(1.05) brightness(0.94);
}
.thumb.wide::before {
  content: ''; position: absolute; inset: -8px; z-index: 0;
  background: var(--cover) center / cover no-repeat;
  filter: blur(8px) saturate(.8); opacity: .75;
}
.thumb.wide img { object-fit: contain; object-position: 50% 50%; }
.thumb.big { width: 72px; height: 96px; font-size: var(--text-2xl); }
/* 상세 시트 맨 위의 큰 이미지: 자르지 않고 전체를 보이며, 남는 칸은 같은 이미지를 흐리게 깐다 */
.thumb.hero {
  width: 100%; height: clamp(15rem, 48dvh, 26rem); margin: var(--space-2xs) 0 var(--space-md);
  font-size: 5rem; color: var(--color-accent);
}
.thumb.hero.wide::before { inset: -24px; filter: blur(22px) saturate(1.1); opacity: .85; }
.thumb.hero img { filter: none; }
.thumb.hero::after { box-shadow: none; }

.title-row { display: flex; align-items: center; gap: var(--space-xs); }
.title-row .card-title { flex: 0 1 auto; min-width: 0; }
.pin { flex: none; color: var(--color-muted); display: grid; }
.pin .ic { width: 14px; height: 14px; }

.card-title {
  font: 600 var(--text-lg)/1.3 var(--font-display); letter-spacing: var(--tracking-display);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-title mark {
  background: color-mix(in oklab, var(--color-accent) 28%, transparent);
  color: var(--color-ink);
}

/* 상태 배지: 색을 늘리지 않고 테두리 모양으로 구분한다. 지금 보는 것만 연두로 짚는다. */
.badge {
  flex: none; font-size: var(--text-xs); font-weight: 500; line-height: 1.5;
  padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-sm);
  white-space: nowrap; border: var(--rule-hair) solid var(--color-edge); color: var(--color-ink-2);
}
.badge.watching { background: var(--grad-accent); border-color: transparent; color: var(--color-accent-ink); }
.badge.planned  { border-style: dashed; }
.badge.waiting  { background: var(--color-paper-3); border-color: var(--color-paper-3); }
.badge.done     { background: var(--grad-ink); border-color: transparent; color: var(--color-paper); }
.badge.paused   { color: var(--color-muted); }
.badge.dropped  { color: var(--color-muted); border-color: transparent; text-decoration: line-through; }

/* 메타 줄: 종류, 회차, 사이트, 마지막 기록. 구분은 점 대신 간격으로 한다. */
.card-meta {
  display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--space-md); row-gap: 0;
  margin-top: var(--space-3xs); font-size: var(--text-sm); color: var(--color-muted);
}
.k { font-weight: 500; color: var(--color-ink-2); }
.ep { color: var(--color-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.stale { color: var(--color-accent-2); }

/* 회차 숫자: 넓은 화면에서는 행 오른쪽에 명조로 크게 */
.fig { display: none; align-items: baseline; justify-content: flex-end; gap: var(--space-2xs); min-width: 7rem; white-space: nowrap; }
.fig-n { font: 600 var(--text-3xl)/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
.fig-u, .fig-s, .fig-t { font-size: var(--text-sm); color: var(--color-muted); }
.fig-s { margin-right: var(--space-xs); color: var(--color-ink-2); }
.fig-t { font: 600 var(--text-lg)/1 var(--font-display); color: var(--color-ink-2); }
@media (min-width: 40rem) {
  .fig { display: flex; }
  .meta-ep { display: none; }
}

/* 좁은 화면: 제목이 먼저 읽히도록 썸네일·버튼을 줄이고, 배지는 자리가 모자라면 제목 아래로 내려간다 */
@media (max-width: 39.99rem) {
  .card { gap: var(--space-2xs); padding-right: var(--space-2xs); }
  .card-main { gap: var(--space-sm); }
  .thumb { width: 40px; height: 54px; font-size: var(--text-lg); }
  .thumb.hero { width: 100%; height: clamp(13rem, 42dvh, 20rem); font-size: 4rem; }
  .title-row { flex-wrap: wrap; row-gap: var(--space-3xs); }
  .card-title { font-size: var(--text-md); }
  .plus { width: 52px; }
  .linkbtn { width: 32px; }
}

/* 책갈피 리본: 진행 줄 위에, 어디까지 봤는지를 연두 끈으로 짚는다 */
.bar {
  height: 2px; background: var(--color-rule);
  margin: var(--space-sm) var(--space-2xs) var(--space-xs);
}
.bar i { display: block; position: relative; height: 100%; background: var(--grad-accent); }
.bar i::after {
  content: ''; position: absolute; right: 0; top: 0; width: 8px; height: 13px;
  background: oklch(55% 0.25 325); translate: 50% 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}

/* +1: 연두 테두리의 알약. 누르면 채워진다. */
.plus {
  flex: none; width: 56px; height: 44px; border-radius: var(--radius-ctl);
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  font: 700 var(--text-md)/1 var(--font-body); font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.plus:hover { background: var(--grad-accent-soft); }
.plus:active { transform: scale(.95); background: var(--grad-accent); border-color: transparent; color: var(--color-accent-ink); }
.plus.done { border-color: var(--color-edge); color: var(--color-muted); }
.plus.done:hover { background: var(--color-paper-3); color: var(--color-ink-2); }

.linkbtn {
  flex: none; width: 40px; height: 44px; border-radius: var(--radius-ctl);
  display: grid; place-items: center; color: var(--color-muted);
  text-decoration: none;
  transition: transform var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.linkbtn .ic { width: 18px; height: 18px; }
.linkbtn:hover { color: var(--color-ink); background: var(--color-tint); }
.linkbtn:active { transform: scale(.92); }

/* ---------------------------------------------------------- 로딩·빈 화면 */
.skel { display: flex; flex-direction: column; animation: breathe 1.6s var(--ease-in-out) infinite alternate; }
.skel i {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-2xs); border-bottom: var(--rule-hair) solid var(--color-rule);
}
.skel i::before { content: ''; width: 48px; height: 64px; background: var(--color-paper-3); }
.skel i::after { content: ''; flex: 1; max-width: 55%; height: 32px; background: var(--color-paper-3); }
@keyframes breathe { from { opacity: 0.35; } to { opacity: 0.75; } }

.empty { padding: var(--space-2xl) var(--space-lg); color: var(--color-muted); }
.empty h3 { max-width: none; margin: 0 0 var(--space-xs); font-size: var(--text-2xl); color: var(--color-ink); }
.empty p { margin: 0 0 var(--space-lg); font-size: var(--text-md); line-height: 1.6; }

/* ---------------------------------------------------------- 버튼 */
.btn {
  min-height: 44px; padding: 0 var(--space-lg); border-radius: var(--radius-ctl);
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 var(--text-sm)/1 var(--font-body); white-space: nowrap;
  background: var(--grad-accent); color: var(--color-accent-ink);
  border: 1.5px solid transparent;
  transition: filter var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--grad-accent-hover); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--color-accent); border-color: var(--color-accent); }
.btn.ghost:hover { background: var(--grad-accent-soft); border-color: var(--color-accent); }
.btn.danger { background: transparent; color: var(--color-error); border-color: transparent; }
.btn.danger:hover { background: transparent; border-color: var(--color-error); }
.btn.as-link { text-decoration: none; }

/* ---------------------------------------------------------- 새 작품 버튼 */
.fab {
  position: fixed; right: max(var(--space-md), calc(50% - 35rem + var(--space-lg)));
  bottom: calc(var(--space-lg) + var(--safe-b)); z-index: var(--z-sticky-nav);
  min-width: 52px; height: 52px; border-radius: var(--radius-ctl);
  background: var(--grad-accent); color: var(--color-accent-ink);
  border: 0;
  display: flex; align-items: center; justify-content: center; gap: var(--space-xs);
  padding: 0; font: 700 var(--text-sm)/1 var(--font-body);
  box-shadow: 0 8px 24px color-mix(in oklab, oklch(55% 0.25 325) 35%, transparent);
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.fab svg { width: 20px; height: 20px; }
.fab span { display: none; }
@media (min-width: 40rem) { .fab { padding: 0 var(--space-lg) 0 var(--space-md); } .fab span { display: inline; } }
.fab:hover { background: var(--grad-accent-hover); }
.fab:active { transform: scale(.95); }

/* ---------------------------------------------------------- 시트 */
.backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: var(--color-scrim);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade var(--dur-micro) var(--ease-out);
}
.backdrop.hidden { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: .4; } }

.sheet {
  width: 100%; max-width: 40rem; max-height: 92dvh; overflow-y: auto;
  background: var(--grad-paper) var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule); border-bottom: 0; border-top: 4px solid transparent; border-image: var(--grad-accent) 1;
  border-radius: 0;
  padding: var(--space-xs) var(--space-md) calc(var(--space-lg) + var(--safe-b));
  animation: rise var(--dur-short) var(--ease-out);
}
@media (min-width: 40rem) {
  .backdrop { align-items: center; }
  .sheet { max-height: 88dvh; padding-inline: var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-top: 4px solid transparent; border-image: var(--grad-accent) 1; border-radius: 0; }
  .grab { display: none; }
}

.grab { width: 40px; height: 4px; background: var(--color-rule); margin: var(--space-2xs) auto var(--space-sm); }

.sheet h2 {
  max-width: none; margin: var(--space-sm) 0 var(--space-lg);
  font-size: var(--text-2xl); line-height: 1.25;
  display: flex; align-items: center; gap: var(--space-xs);
}
.sheet h2 .spacer { flex: 1; }
.sheet h2.ok { color: var(--color-success); }
.sheet h2.ok .ic { width: 24px; height: 24px; stroke-width: 2.25; }
.done-msg { font: 600 var(--text-xl)/1.3 var(--font-display); margin: 0 0 var(--space-lg); max-width: none; }

.field { margin-bottom: var(--space-md); }
.field > label {
  display: block; font-size: var(--text-sm); font-weight: 500;
  color: var(--color-muted); margin-bottom: var(--space-xs);
}

.inp {
  width: 100%; min-height: 44px; padding: 0 var(--space-md); font-size: var(--text-md); color: var(--color-ink);
  background: var(--color-field);
  border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-ctl);
  outline: 2px solid transparent; outline-offset: 2px;
}
.inp::placeholder { color: var(--color-muted); opacity: 1; }
.inp:focus-visible { outline-color: var(--color-focus); border-color: var(--color-accent); }
.inp:disabled { opacity: 0.55; cursor: not-allowed; }
.inp[readonly] { background: transparent; border-style: dashed; }
textarea.inp { resize: vertical; min-height: 96px; padding: var(--space-sm) var(--space-md); line-height: 1.6; }

.row { display: flex; gap: var(--space-md); }
.row > * { flex: 1; min-width: 0; }

.peek { min-height: 1lh; margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); }
.note { max-width: 65ch; margin: 0 0 var(--space-md); font-size: var(--text-sm); line-height: 1.6; color: var(--color-ink-2); }
.note b { color: var(--color-ink); font-weight: 700; }
.note.lead-note { font-size: var(--text-md); color: var(--color-ink); margin-bottom: var(--space-xs); }
.note.url { word-break: break-all; color: var(--color-muted); }
.note .warn, .warn { color: var(--color-accent-2); }
.linkinfo { margin-top: calc(-1 * var(--space-xs)); }
.titles { margin: 0 0 var(--space-md); padding: 0; list-style: none; max-height: 9rem; overflow: auto; font-size: var(--text-sm); color: var(--color-muted); }
.titles li { padding: var(--space-3xs) 0; }

/* 회차 스테퍼: 숫자는 명조로 크게 */
.stepper {
  display: flex; align-items: stretch; gap: var(--space-2xs);
  background: var(--color-field);
  border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-ctl);
  padding: var(--space-2xs);
}
.stepper button {
  width: 52px; min-height: 48px; background: var(--color-paper-3); border-radius: var(--radius-sm);
  font: 400 var(--text-xl)/1 var(--font-body); color: var(--color-ink);
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.stepper button:hover { background: var(--grad-accent-soft); }
.stepper button:active { background: var(--grad-accent); color: var(--color-accent-ink); }
.stepper input {
  flex: 1; min-width: 0; text-align: center; border: 0; background: none; color: var(--color-ink);
  outline: 2px solid transparent; outline-offset: -4px;
  font: 600 var(--text-3xl)/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums;
}
.stepper input:focus-visible { outline-color: var(--color-focus); }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .unit { align-self: center; color: var(--color-muted); font-size: var(--text-sm); padding-right: var(--space-sm); }

.quick { display: flex; gap: var(--space-xs); margin-top: var(--space-xs); flex-wrap: wrap; }
.quick.tight { margin-top: var(--space-xs); }
.quick button, .pick button {
  min-height: 40px; padding: 0 var(--space-md); border-radius: var(--radius-ctl);
  border: var(--rule-hair) solid var(--color-edge);
  font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2);
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.quick button:hover, .pick button:hover { background: var(--grad-accent-soft); color: var(--color-ink); }
.quick button:active, .pick button:active { background: var(--grad-accent); border-color: transparent; color: var(--color-accent-ink); }

.pick { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.pick button.on { background: var(--grad-accent-soft); border-color: var(--color-accent); color: var(--color-ink); font-weight: 700; }
.pick button.stars { display: inline-flex; align-items: center; gap: var(--space-3xs); }
.pick button.stars .ic { width: 14px; height: 14px; }
.pick button.stars.on { color: var(--color-accent); }

.actions { display: flex; gap: var(--space-md); margin-top: var(--space-lg); }
.actions.flush { margin-top: 0; }
.actions .btn { flex: 1; }

.coverrow { display: flex; gap: var(--space-md); align-items: flex-start; }
.coverrow-body { flex: 1; min-width: 0; }

/* 기록 내역: 표처럼. 회차는 명조 숫자, 시각은 작게 */
.logs { margin-top: var(--space-2xs); border-top: var(--rule-hair) solid var(--color-muted); }
.log {
  display: flex; align-items: center; gap: var(--space-md);
  min-height: 48px; padding: var(--space-2xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule);
  font-size: var(--text-sm);
}
.log b { font: 600 var(--text-lg)/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; min-width: 4.5rem; color: var(--color-ink); }
.log .when { color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log .memo {
  color: var(--color-muted); flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.log .memo.who { color: var(--color-ink); font-weight: 500; }
.log .del {
  width: 40px; height: 40px; display: grid; place-items: center; margin-left: auto;
  color: var(--color-muted); border-radius: var(--radius-ctl);
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.log .del .ic { width: 16px; height: 16px; }
.log .del:hover { color: var(--color-error); background: var(--color-tint); }
.log .del:active { background: var(--color-paper-3); }
.logs-empty { padding: var(--space-sm) 0; color: var(--color-muted); font-size: var(--text-sm); }

.section-title {
  font: 600 var(--text-lg)/1.3 var(--font-display); color: var(--color-ink);
  margin: var(--space-xl) 0 var(--space-xs); padding-bottom: var(--space-xs);
  border-bottom: var(--rule-hair) solid var(--color-muted);
}
.saved { color: var(--color-success); font: 500 var(--text-sm)/1 var(--font-body); margin-left: var(--space-xs); }

/* ---------------------------------------------------------- 토스트 */
.toast {
  position: fixed; left: 50%; translate: -50% 0;
  bottom: calc(var(--space-3xl) + var(--safe-b)); z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--space-md);
  background: var(--grad-ink); color: var(--color-paper);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg); border-radius: var(--radius-ctl);
  font-size: var(--text-sm); font-weight: 500; max-width: calc(100% - 2 * var(--space-md));
  animation: rise var(--dur-short) var(--ease-out);
}
.toast.hidden { display: none; }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast button {
  color: var(--color-accent-deep); font-weight: 700; flex: none;   /* 잉크색 토스트 위에서 읽히는 옅은 청록 */
  min-height: 40px; padding: 0 var(--space-md); border-radius: var(--radius-ctl);
  border: var(--rule-hair) solid currentColor;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.toast button:hover { background: color-mix(in oklab, currentColor 14%, transparent); }
.toast button:active { background: color-mix(in oklab, currentColor 24%, transparent); }
.toast button:focus-visible { outline: 2px solid var(--color-accent-deep); }

/* ---------------------------------------------------------- 메뉴 */
.menu-item {
  display: flex; align-items: center; gap: var(--space-md); width: 100%;
  min-height: 56px; padding: 0 var(--space-xs);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  font-size: var(--text-md); font-weight: 500; text-align: left; text-decoration: none; color: var(--color-ink);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.sheet h2 + .menu-item { border-top: var(--rule-hair) solid var(--color-muted); }
.menu-item .ic { color: var(--color-muted); transition: color var(--dur-micro) var(--ease-out); }
.menu-item:hover { background: var(--grad-accent-soft); }
.menu-item:hover .ic { color: var(--color-accent); }
.menu-item:active { background: var(--color-paper-3); }
.menu-item small { font-size: var(--text-sm); color: var(--color-muted); font-weight: 400; margin-left: auto; }

/* ---------------------------------------------------------- 로그인 */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-md); }
.login form {
  width: 100%; max-width: 22rem; background: var(--color-paper) ;
  border: var(--rule-hair) solid var(--color-rule); border-top: 4px solid transparent; border-image: var(--grad-accent) 1; border-radius: 0;
  padding: var(--space-lg); text-align: left;
}
.login .brand { margin-bottom: var(--space-lg); font-size: var(--text-3xl); }
.login .brand .mark { width: 19px; height: 24px; }
.login .btn { width: 100%; margin-top: var(--space-sm); }
.login .err { color: var(--color-error); font-size: var(--text-sm); min-height: 1lh; margin-top: var(--space-xs); }

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; opacity: 0.6; }
  .plus:active, .btn:active, .fab:active, .linkbtn:active { transform: none; }
}





