/* 안드로이드 ui/theme/Theme.kt (워크리포트 디자인) 와 같은 색·글자·면 */
@font-face { font-family: Pretendard; font-weight: 400; font-display: swap; src: url(fonts/pretendard_regular.otf) format('opentype'); }
@font-face { font-family: Pretendard; font-weight: 500; font-display: swap; src: url(fonts/pretendard_medium.otf) format('opentype'); }
@font-face { font-family: Pretendard; font-weight: 600; font-display: swap; src: url(fonts/pretendard_semibold.otf) format('opentype'); }
@font-face { font-family: Pretendard; font-weight: 700; font-display: swap; src: url(fonts/pretendard_bold.otf) format('opentype'); }

:root {
  --paper: #ffffff; --ink: #111214; --ink-soft: #6b6f76; --ink-muted: #3f4248; --rule: #e6e7ea;
  --navy: #2563eb; --red: #d12f2f; --green: #0f8a5f; --ochre: #c2620a; --shelf: #e6e7ea; --tint: #f2f3f5;
  --radius: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 17px; line-height: 28px; letter-spacing: -0.01em; word-break: keep-all;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; overscroll-behavior-y: none;
}
input, button { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

/* 글자 토큰 */
.t-cover { font-size: 34px; font-weight: 700; line-height: 42px; letter-spacing: -0.035em; }
.t-chapter { font-size: 27px; font-weight: 700; line-height: 36px; letter-spacing: -0.03em; }
.t-title { font-size: 19px; font-weight: 600; line-height: 28px; letter-spacing: -0.02em; }
.t-body { font-size: 17px; font-weight: 400; line-height: 28px; letter-spacing: -0.01em; }
.t-body-bold { font-size: 17px; font-weight: 600; line-height: 28px; letter-spacing: -0.01em; }
.t-label { font-size: 15px; font-weight: 500; line-height: 22px; letter-spacing: -0.005em; color: var(--ink-soft); }
.t-caption { font-size: 13px; font-weight: 500; line-height: 18px; color: var(--ink-soft); }
.t-button { font-size: 15px; font-weight: 600; line-height: 20px; letter-spacing: -0.01em; font-feature-settings: 'tnum'; }
.t-button-lg { font-size: 17px; font-weight: 600; line-height: 22px; letter-spacing: -0.015em; font-feature-settings: 'tnum'; }
.t-figure { font-size: 28px; font-weight: 700; line-height: 32px; letter-spacing: -0.03em; font-feature-settings: 'tnum'; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* 화면 틀 */
.screen { min-height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.header { display: flex; align-items: center; padding: 12px 8px 8px 20px; position: sticky; top: 0; background: var(--paper); z-index: 5; padding-top: calc(12px + env(safe-area-inset-top)); margin-top: calc(-1 * env(safe-area-inset-top)); }
.header.with-back { padding-left: 8px; }
.header .grow { flex: 1; min-width: 0; }
.icon-btn { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 24px; color: var(--ink); }
.icon-btn:active { background: var(--tint); }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.content { width: 100%; max-width: 600px; margin: 0 auto; padding: 4px 20px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; }
.grow { flex: 1; min-width: 0; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.center-note { text-align: center; padding: 48px 0; white-space: pre-line; }

/* 면: dark = 먹색(켜짐·주 버튼), 기본 = 옅은 회색, on-tint = 회색 카드 위의 흰 면 */
.surface {
  display: flex; align-items: center; justify-content: center; position: relative;
  border-radius: var(--radius); background: var(--tint); color: var(--ink);
  transition: transform 100ms, background-color 100ms; touch-action: manipulation; min-width: 0;
}
.surface.on-tint { background: var(--paper); }
.surface.dark { background: var(--ink); color: var(--paper); }
.surface:not(.disabled):active { transform: scale(0.98); background: var(--shelf); }
.surface.dark:not(.disabled):active { background: rgba(17, 18, 20, 0.85); }
.surface.disabled { cursor: default; color: rgba(17, 18, 20, 0.35); }
.surface.dark.disabled { background: rgba(17, 18, 20, 0.35); color: rgba(255, 255, 255, 0.35); }
.surface.start { justify-content: flex-start; }
.btn-pad { padding: 0 14px; white-space: nowrap; }

.card { border-radius: var(--radius); background: var(--tint); padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.light-card { min-height: 68px; padding: 14px 18px; gap: 8px; }
.section-head { display: flex; align-items: center; padding: 16px 0 2px; }
.link { color: var(--navy); padding: 8px 6px; border-radius: 6px; }
.link:active { background: var(--tint); }
.rule { height: 1px; background: var(--rule); }
.control-row { display: flex; align-items: center; min-height: 48px; gap: 8px; }

/* 진행 표시 */
.busy { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 슬라이더 */
input[type=range] { width: 100%; height: 32px; -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ink) var(--p, 0%), var(--shelf) var(--p, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); margin-top: -8px; }
input[type=range]:disabled { opacity: .35; }

/* 메뉴 */
.menu-scrim { position: fixed; inset: 0; z-index: 20; }
.menu { position: absolute; right: 8px; top: 56px; background: var(--paper); border-radius: 8px; padding: 8px 0; min-width: 180px; box-shadow: 0 6px 24px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.08); z-index: 21; }
.menu button { display: block; width: 100%; text-align: left; padding: 12px 16px; }
.menu button:active { background: var(--tint); }

/* 바닥 시트·대화상자 */
.scrim { position: fixed; inset: 0; background: rgba(17, 18, 20, 0.4); z-index: 30; display: flex; animation: fade .15s; }
.sheet-wrap { align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; border-radius: 16px 16px 0 0; padding: 22px 24px calc(24px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet .grab { width: 32px; height: 4px; border-radius: 2px; background: var(--rule); margin: -8px auto 18px; }
.dialog-wrap { align-items: center; justify-content: center; padding: 24px; }
.dialog { background: var(--paper); width: 100%; max-width: 400px; border-radius: 12px; padding: 24px; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: .5 } }

.field { width: 100%; height: 56px; border: 1px solid var(--rule); border-radius: 4px; padding: 0 16px; font-size: 16px; line-height: 24px; outline: none; background: var(--paper); -webkit-user-select: text; user-select: text; }
.field:focus { border: 2px solid var(--ink); padding: 0 15px; }
.field-label { font-size: 13px; color: var(--ink-soft); margin: 0 0 4px 2px; }
input[type=time].field { font-size: 28px; font-weight: 700; text-align: center; font-feature-settings: 'tnum'; height: 72px; max-width: 220px; margin: 0 auto; display: block; }

/* 알림 줄 */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); border-radius: 6px; padding: 14px 18px; font-size: 15px; line-height: 22px; max-width: min(560px, calc(100vw - 32px)); width: max-content; z-index: 40; animation: fade .2s; }
