:root{
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

*{ box-sizing: border-box; }

html,body{ height:100%; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', -apple-system, 'Malgun Gothic', 'Hiragino Sans', 'PingFang SC', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
  min-height: 100vh;
  display:flex;
  justify-content:center;
}

/* ---------- Theme tokens ---------- */
body[data-theme="led"]{
  --bg: #0b0d0f;
  --panel: #14171b;
  --panel-2: #1b1f24;
  --border: rgba(255,176,0,.16);
  --primary: #ffb000;
  --primary-dim: #7a5200;
  --accent: #3ddc97;
  --text: #ece7da;
  --text-muted: #8a8f98;
  --danger: #ff6161;
}
body[data-theme="receipt"]{
  --bg: #efece2;
  --panel: #fbfaf5;
  --panel-2: #f2efe5;
  --border: rgba(20,20,20,.14);
  --primary: #201d18;
  --primary-dim: #bdb6a2;
  --accent: #a5271f;
  --text: #201d18;
  --text-muted: #726b5b;
  --danger: #a5271f;
}
body[data-theme="neon"]{
  --bg: #0d0221;
  --panel: #170a33;
  --panel-2: #1e0f40;
  --border: rgba(0,240,255,.2);
  --primary: #00f0ff;
  --primary-dim: #4a2f66;
  --accent: #ff2e93;
  --text: #ecebff;
  --text-muted: #8d84b8;
  --danger: #ff2e93;
}
body[data-theme="mono"]{
  --bg: #111111;
  --panel: #1c1c1c;
  --panel-2: #242424;
  --border: rgba(255,255,255,.12);
  --primary: #e8e8e8;
  --primary-dim: #555555;
  --accent: #9d9d9d;
  --text: #f0f0f0;
  --text-muted: #8a8a8a;
  --danger: #ff6b6b;
}
body[data-theme="sunset"]{
  --bg: #1a0f0a;
  --panel: #2a1610;
  --panel-2: #331c14;
  --border: rgba(255,140,66,.2);
  --primary: #ff8c42;
  --primary-dim: #7a3f1a;
  --accent: #ffd166;
  --text: #fff3e6;
  --text-muted: #c9967a;
  --danger: #ff5c5c;
}
body[data-theme="forest"]{
  --bg: #0b140f;
  --panel: #122018;
  --panel-2: #182a1f;
  --border: rgba(76,175,120,.2);
  --primary: #4caf78;
  --primary-dim: #2a5c40;
  --accent: #a3d977;
  --text: #e6f2ea;
  --text-muted: #7fa08c;
  --danger: #ff6b6b;
}

/* ---------- Digit fonts ---------- */
body[data-font="techmono"] .digit-face{ font-family:'Share Tech Mono', monospace; letter-spacing: -0.01em; }
body[data-font="orbitron"] .digit-face{ font-family:'Orbitron', sans-serif; letter-spacing: -0.01em; font-weight:700; }
body[data-font="vt323"]    .digit-face{ font-family:'VT323', monospace; letter-spacing: 0.01em; }
/* 버그 수정: 셀렉터 사이 공백이 빠져 있어서(body[data-font="spacemono"].digit-face)
   지금까지 한 번도 적용된 적이 없었음 — body 자신이 .digit-face 클래스를 가져야 하는
   잘못된 조건이 되어 있었음 */
body[data-font="spacemono"] .digit-face{ font-family:'Space Mono', monospace; letter-spacing: -0.02em; font-weight:700; }
body[data-font="jetbrains"] .digit-face{ font-family:'JetBrains Mono', monospace; letter-spacing: -0.01em; font-weight:700; }
body[data-font="pixel"]     .digit-face{ font-family:'Press Start 2P', monospace; letter-spacing: 0em; }
body[data-font="rajdhani"]  .digit-face{ font-family:'Rajdhani', sans-serif; letter-spacing: 0.01em; font-weight:700; }

/* line-height fix: custom display fonts (VT323/Orbitron) were clipping
   ascenders/descenders inside overflow:hidden boxes because no line-height
   was ever set for .digit-face specifically. */
.digit-face{ line-height: 1.18; }

.app{
  width:100%;
  max-width: 520px;
  padding: 20px 18px 48px;
  display:flex;
  flex-direction:column;
  gap:22px;
  position: relative;
  z-index: 1;
}

@media (min-width: 700px){
  .app{ max-width: 640px; }
  .stat-value{ font-size: clamp(1rem, 2.6vw, 1.5rem); }
}
@media (min-width: 1000px){
  .app{ max-width: 760px; }
  .stat-value{ font-size: clamp(1.1rem, 2vw, 1.7rem); }
}

/* ---------- Topbar ---------- */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-top: 6px;
  flex-wrap: wrap;
  row-gap: 8px;
}
.topbar-right{
  display:flex;
  align-items:center;
  gap:8px;
}
.brand{ display:flex; align-items:center; gap:9px; }
.brand-dot{
  width:10px; height:10px; border-radius:50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  flex-shrink:0;
}
.brand-text{ display:flex; flex-direction:column; gap:1px; }
.brand h1{
  margin:0; font-size: 1.15rem; font-weight:900; letter-spacing:-0.01em;
}
.brand .brand-sub{
  margin:0; font-size:.68rem; color: var(--text-muted); font-weight:500;
}
.icon-btn{
  width:40px; height:40px; border-radius: 50%;
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 1.1rem;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition: transform .15s ease, background .2s ease;
}
.icon-btn:hover{ background: var(--panel-2); }
.icon-btn:active{ transform: scale(.94); }
.icon-btn:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- Clock ---------- */
.clock{
  text-align:center;
  padding: 4px 0 2px;
}
.clock-time{
  color: var(--text);
  font-size: 3.4rem; /* fallback before JS measures the real box width */
  line-height:1.18;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
}
.clock-date{
  margin-top: 6px;
  font-size: .88rem;
  color: var(--text-muted);
  font-weight:500;
}

/* ---------- Hero ---------- */
/* fs-frame: 시계+오늘 번 돈+통계를 하나로 묶는 박스.
   전체화면 아이콘이 이 박스 모서리에 있고, 전체화면 진입 시
   이 박스 안의 내용물만 남기고 박스 자체는 사라집니다.
   overflow는 hidden -> visible로 변경: 콘텐츠가 조금이라도 예상보다
   커지면(긴 숫자, 큰 폰트 등) 무조건 아래 내용이 잘려버리던 문제를
   근본적으로 막기 위함. 모서리를 벗어나는 자식 요소는 어차피 없음
   (hero-toolbar 버튼도 이 박스 안에 relative로 배치돼 있어 넘치지 않음). */
.fs-frame{
  position: relative;
  overflow: visible;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero{
  text-align:center;
}
.hero-eyebrow{
  margin:0 0 6px;
  font-size: .92rem;
  font-weight:500;
  color: var(--accent);
  min-height: 1.3em;
}
.hero-amount{
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap: 6px;
  color: var(--primary);
  line-height:1.18;
  margin: 6px 0 4px;
  flex-wrap: nowrap;
  max-width: 100%;
  /* fallback size before JS measures the real box and sets an inline px
     value — everything below is em-relative to THIS font-size so JS only
     has to set one value and the whole row scales together */
  font-size: 3.2rem;
}
.hero-amount .digit-face{
  font-size: 1em;
  font-variant-numeric: tabular-nums;
}
.hero-amount .won{
  font-size: 0.36em;
  font-weight:700;
  color: var(--text-muted);
}
/* % suffix used by the "progress %" preset — hidden unless that preset is active */
.hero-amount .unit{
  display:none;
  font-size: 0.55em;
  font-weight:800;
  color: var(--primary);
}
.hero-caption{
  margin: 6px 0 0;
  font-size: .85rem;
  color: var(--text-muted);
}
.hero-persecond{
  margin: 10px 0 2px;
  font-size: .8rem;
  color: var(--text-muted);
  min-height: 1.2em;
}
.hero-persecond b{ color: var(--accent); font-weight:700; }

/* 예전 "진행 바" 프리셋이 쓰던 마크업 — 이제는 배경 채움(data-bg-fill) 오버레이로
   완전히 대체됐지만 HTML엔 아직 <div class="hero-bar-wrap">가 남아있어서
   기본적으로 숨겨둔다. JS도 더 이상 이 요소를 갱신하지 않는다. */
.hero-bar-wrap{ display: none !important; }


.hero-subline{
  margin: 6px 0 2px;
  font-size: clamp(0.85rem, 2.8vw, 1.15rem);
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
body[data-fullscreen="true"] .hero-subline{
  margin: 4px 0 0;
  font-size: clamp(0.95rem, 3.2vw, 1.4rem);
  opacity: 0.92;
}

/* extra breathing room whenever stats rows are hidden */
body[data-fs-layout="money"] .hero,
body[data-fs-layout="countdown"] .hero,
body[data-fs-layout="percent"] .hero,
body[data-fs-layout="hourly"] .hero,
body[data-fs-layout="compact"] .hero{
  padding-bottom: 6px;
}

/* ---------- Stats ---------- */
.stats{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stat{
  min-width: 0;
}
.stat{
  text-align:center;
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.stat-label{
  font-size: .74rem;
  color: var(--text-muted);
  font-weight:500;
}
.stat-value{
  color: var(--primary);
  font-size: clamp(0.95rem, 4.3vw, 1.3rem);
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
}

/* ---------- Footer ---------- */
.note{
  text-align:center;
  font-size: .74rem;
  color: var(--text-muted);
  line-height:1.5;
  padding: 0 6px;
  margin-bottom: 0;
}

/* ---------- SEO footer (랜딩 하단 키워드 콘텐츠 + 여백) ---------- */
.seo-footer{
  border-top: 1px solid var(--border);
  padding: 18px 4px env(safe-area-inset-bottom, 28px);
  margin-top: 6px;
  text-align: center;
}
.seo-footer p{
  margin: 0 0 4px;
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.seo-footer a{
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 4px;
}
.seo-footer a:hover{ color: var(--primary); }

/* ---------- Language switcher dropdown (헤더의 설정 톱니바퀴 옆) ---------- */
.lang-dropdown-wrap{
  position: relative;
  display: flex;
  align-items: center;
}
.lang-select{
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 30px 8px 12px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(160,160,160,0.8)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.lang-select:hover{
  border-color: var(--primary);
}
.lang-select:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,176,0,.2);
}
.lang-select option{
  background: var(--panel);
  color: var(--text);
}

/* ---------- Settings panel ---------- */
.backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.5);
  z-index: 20;
}
.settings-panel{
  position: fixed;
  left:0; right:0; bottom:0;
  z-index: 21;
  max-width: 520px;
  margin: 0 auto;
  max-height: 86vh;
  overflow-y:auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 18px 22px;
  transform: translateY(0%);
  transition: transform .28s ease;
}
@media (prefers-reduced-motion: reduce){
  .settings-panel{ transition: none; }
}
.settings-panel[hidden], .backdrop[hidden]{ display:none; }

.panel-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 14px;
}
.panel-head h2{ margin:0; font-size:1.02rem; }
.panel-head .icon-btn{ width:34px; height:34px; font-size:1rem; }

.field-group{ margin-bottom: 18px; }
.field-group > .label{
  font-size: .8rem; font-weight:700; color: var(--text-muted);
  margin-bottom: 8px; display:block;
}

.seg{
  display:flex; gap:6px; background: var(--panel-2);
  padding:4px; border-radius: 999px; border:1px solid var(--border);
}
.seg button{
  flex:1; border:none; background:transparent; color: var(--text-muted);
  padding: 8px 4px; border-radius:999px; font-size:.82rem; font-weight:700;
  cursor:pointer;
}
.seg button.active{ background: var(--primary); color: var(--bg); }

.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.chip{
  border:1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 7px 12px; border-radius: 999px; font-size:.78rem; cursor:pointer;
}
.chip:hover{ border-color: var(--primary); }

.amount-input{
  width:100%; padding: 12px 14px; font-size:1.05rem;
  border-radius: var(--radius-sm); border:1px solid var(--border);
  background: var(--panel-2); color: var(--text);
  font-variant-numeric: tabular-nums;
}

.time-row{ display:flex; gap:10px; }
.time-field{ flex:1; }
.time-field label{ display:block; font-size:.74rem; color: var(--text-muted); margin-bottom:5px; }
.time-field input{
  width:100%; padding:10px; border-radius: var(--radius-sm);
  border:1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: .95rem;
}

.days{ display:flex; gap:6px; margin-top:10px; }
.day-btn{
  flex:1; aspect-ratio:1; border-radius:50%; border:1px solid var(--border);
  background: var(--panel-2); color: var(--text-muted); font-size:.72rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.day-btn.active{ background: var(--primary); color: var(--bg); border-color: var(--primary); font-weight:700; }

.theme-grid, .font-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap:8px; margin-top:10px;
}
.font-grid{ grid-template-columns: repeat(2, 1fr); }

/* ---------- Switch / Toggle rows ---------- */
.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.toggle-field input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-field-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background .2s ease, border-color .2s ease;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform .2s cubic-bezier(0.4, 0, 0.2, 1), background .2s ease;
}
.toggle-field input:checked + .toggle-switch {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle-field input:checked + .toggle-switch::after {
  transform: translateX(20px);
  background: var(--bg);
}
.field-subnote {
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}
.net-rate-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.net-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.net-rate-row label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.net-rate-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.net-rate-input-wrap input {
  width: 68px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: .95rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.net-rate-input-wrap span {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
}
.hero-net-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--primary);
  border: 1px solid var(--primary);
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: 0;
}
.swatch{
  border:1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 6px; text-align:center; cursor:pointer; background: var(--panel-2);
  font-size:.76rem; color: var(--text);
}
.swatch.active{ border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }

.apply-btn{
  width:100%; padding: 14px; border:none; border-radius: var(--radius-md);
  background: var(--primary); color: var(--bg); font-size:1rem; font-weight:900;
  cursor:pointer; margin-top: 6px;
}
.apply-btn:active{ transform: scale(.98); }

.warn{
  font-size:.78rem; color: var(--danger); margin-top:8px; min-height: 1.1em;
}

@media (min-width: 560px){
  .app{ padding-top: 40px; }
}

/* ---------- Layout variants: 시간 강조 / 균형 / 금액 강조 (설정 패널의 "Layout") ----------
   실제 크기 배분은 이제 app.js의 fitClock()/fitHeroAmount()가 실측으로 계산한다
   (레이아웃별 상한선만 다르게 줌). 여기서는 부가적인 여백 조정만 남겨둔다. */
body[data-layout="time"] .hero{ padding-top: 22px; }

/* ---------- Fullscreen (모바일 전체화면 / 가로 모드) ---------- */
body[data-fullscreen="true"]{
  justify-content: center;
  align-items: center;
  overflow: hidden;
  height: 100vh;
  min-height: 100vh;
}
body[data-fullscreen="true"] .app{
  max-width: 860px;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  padding: 10px 16px;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}
body[data-fullscreen="true"] .settings-panel,
body[data-fullscreen="true"] .backdrop{
  max-width: 860px;
}

/* 전체화면: 불필요한 장식 제거, 한 화면에 콤팩트하게 밀착 배치 */
body[data-fullscreen="true"] .fs-frame{
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  gap: 8px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
}

/* 전체화면 시 불필요한 글자 숨김: 오늘 날짜, '오늘 번 돈' 등 안내문구, perSecond 텍스트 */
body[data-fullscreen="true"] .clock-date,
body[data-fullscreen="true"] .hero-eyebrow,
body[data-fullscreen="true"] .hero-caption,
body[data-fullscreen="true"] .hero-persecond{
  display: none !important;
}

/* 시계: 콤팩트하게 작게 조정 */
body[data-fullscreen="true"] .clock{
  padding: 0;
  margin: 0;
  line-height: 1;
}
body[data-fullscreen="true"] .clock-time{
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  line-height: 1.1;
  opacity: 0.85;
}

/* 오늘 급여 (Hero): 화면의 주인공으로 크고 선명하게 */
body[data-fullscreen="true"] .hero{
  margin: 0;
  padding: 0;
  width: 100%;
}
body[data-fullscreen="true"] .hero-amount{
  margin: 0;
  line-height: 1.1;
  font-size: clamp(3rem, 11vw, 6.2rem);
}
body[data-fullscreen="true"] .hero-amount .digit-face{
  font-size: 1em;
}
body[data-fullscreen="true"] .hero-amount .won{
  font-size: 0.38em;
}

/* 연/월/주 통계: 훨씬 작고 깔끔하게 하단 배치 */
body[data-fullscreen="true"] .stats{
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding: 4px 0 0;
}
body[data-fullscreen="true"] .stat{
  gap: 1px;
}
body[data-fullscreen="true"] .stat-label{
  font-size: clamp(0.55rem, 1.8vw, 0.72rem);
  opacity: 0.65;
}
body[data-fullscreen="true"] .stat-value{
  font-size: clamp(0.75rem, 2.5vw, 1.05rem);
  opacity: 0.85;
}

@media (orientation: landscape){
  body[data-fullscreen="true"] .app{
    padding: 8px 24px;
  }
  body[data-fullscreen="true"] .fs-frame{
    gap: 6px;
  }
  body[data-fullscreen="true"] .clock-time{
    font-size: clamp(1.4rem, 4.2vw, 2.3rem);
  }
  body[data-fullscreen="true"] .hero-amount{
    font-size: clamp(2.8rem, 9.5vw, 5.8rem);
  }
  body[data-fullscreen="true"] .stats{
    gap: 32px;
  }
  body[data-fullscreen="true"] .stat-value{
    font-size: clamp(0.75rem, 2.2vw, 1rem);
  }
}

/* ---------- Share row ---------- */
.share-row{
  display:flex; gap:8px; margin-top:10px;
}
.share-row input{
  flex:1; padding:10px 12px; border-radius: var(--radius-sm);
  border:1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size:.82rem; min-width:0;
}
.share-copy-btn{
  border:1px solid var(--border); background: var(--primary); color: var(--bg);
  border-radius: var(--radius-sm); padding: 0 16px; font-size:.82rem; font-weight:700; cursor:pointer;
  white-space:nowrap;
}
.share-hint{
  font-size:.72rem; color: var(--text-muted); margin: 6px 0 0;
}
.share-btn{
  width:100%; padding: 12px; border:1px solid var(--border); border-radius: var(--radius-md);
  background: var(--panel-2); color: var(--text); font-size:.9rem; font-weight:700; cursor:pointer;
}
.share-btn:hover{ border-color: var(--primary); }

/* ---------- Hero toolbar (공유 / 전체화면) ---------- */
.hero-toolbar{
  position:absolute; top:12px; right:12px;
  display:flex; gap:6px; z-index:2;
}
.hero-tool-btn{
  width:32px; height:32px; border-radius:50%;
  border:1px solid var(--border); background: var(--panel-2); color: var(--text-muted);
  font-size:.9rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: color .15s ease, border-color .15s ease;
}
.hero-tool-btn:hover{ color: var(--text); border-color: var(--primary); }
.hero-tool-btn:active{ transform: scale(.92); }
.hero-tool-btn.is-done{ color: var(--accent); border-color: var(--accent); }

/* ---------- Toast (iOS 전체화면 미지원 안내 등) ---------- */
.toast{
  position:fixed; left:50%; bottom:28px; transform:translateX(-50%) translateY(10px);
  max-width: 86vw; width:max-content;
  background: var(--panel); color: var(--text); border:1px solid var(--border);
  padding:11px 18px; border-radius:999px; font-size:.78rem; line-height:1.4;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  z-index:50; opacity:0; pointer-events:none;
  transition: opacity .22s ease, transform .22s ease;
  text-align:center;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ===== 메인화면 스타일 조합 (테마 + 숫자 폰트) ===== */
.theme-combos {
  margin-top: 14px;
}
.theme-combos-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}
.theme-combos-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.theme-combos-sub {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.75;
}
.theme-combos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 480px){
  .theme-combos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.combo-card {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  position: relative;
  transition: border-color .2s ease, transform .15s ease;
}
.combo-card:hover {
  border-color: var(--primary);
}
.combo-card:active {
  transform: scale(0.97);
}
.combo-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.combo-card-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.combo-dots {
  display: flex;
  gap: 4px;
}
.combo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.combo-sample {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.combo-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.combo-desc {
  font-size: 10px;
  color: var(--text-muted);
}

/* ===== 전체화면 예제 카드 그리드 (홈 화면 하단) ===== */
.fs-presets { margin-top: 20px; }
.fs-presets-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
  text-align: center;
}
.fs-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  gap: 10px;
}
.fs-tile {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  overflow: hidden;
}
.fs-tile:active { border-color: var(--accent); }
.fs-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.fs-tile-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.fs-tile-clock { display: flex; flex-direction: column; }
.fs-tile-time { font-size: clamp(14px, 4.5vw, 18px); font-weight: 700; line-height: 1.2; padding-top: 1px; color: var(--text); opacity: 0.85; }
.fs-tile-date { display: none; }
.fs-tile-money { display: flex; flex-direction: column; min-width: 0; }
.fs-tile-caption { display: none; }
.fs-tile-amount {
  font-size: clamp(14px, 4.5vw, 20px);
  font-weight: 700;
  line-height: 1.2;
  padding-top: 1px;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.fs-tile-stats { display: flex; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.fs-tile-stat { font-size: 9px; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fs-tile-stat b { font-weight: 600; color: var(--text-muted); opacity: .7; }
.fs-tile-stat i {
  font-style: normal;
  font-size: 10px;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* mini "background fill" preview bar shown on "· 배경 채움" tiles */
.fs-tile-bar{ display:flex; flex-direction:column; gap:6px; margin-top:2px; }
.fs-tile-bar-track{
  position:relative; height:10px; border-radius:999px;
  background: var(--panel); overflow:hidden;
  border: 1px solid var(--border);
}
.fs-tile-bar-fill{
  position:absolute; inset:0; width:0%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: inherit;
  transition: width .5s ease;
}
.fs-tile-bar-pct{ font-size: 12px; font-weight:700; color: var(--accent); }

.fs-tile.is-clock .fs-tile-money,
.fs-tile.is-clock .fs-tile-stats,
.fs-tile.is-money .fs-tile-clock,
.fs-tile.is-money .fs-tile-stats,
.fs-tile.is-hourly .fs-tile-clock,
.fs-tile.is-hourly .fs-tile-stats,
.fs-tile.is-countdown .fs-tile-clock,
.fs-tile.is-countdown .fs-tile-stats,
.fs-tile.is-percent .fs-tile-clock,
.fs-tile.is-percent .fs-tile-stats,
.fs-tile.is-noStats .fs-tile-stats,
.fs-tile.is-compact .fs-tile-stats { display: none; }
.fs-tile.is-clock .fs-tile-time {
  font-size: clamp(14px, 4.5vw, 19px);
  white-space: nowrap;
}
.fs-tile.is-money .fs-tile-amount,
.fs-tile.is-hourly .fs-tile-amount,
.fs-tile.is-countdown .fs-tile-amount,
.fs-tile.is-percent .fs-tile-amount,
.fs-tile.is-compact .fs-tile-amount {
  font-size: clamp(14px, 4.5vw, 18px);
}

/* 픽셀 폰트(Press Start 2P)는 글자 가로 폭이 매우 넓으므로 프리셋 타일 안에서 축소 */
body[data-font="pixel"] .fs-tile-time {
  font-size: clamp(10px, 3.2vw, 13px);
  letter-spacing: -0.05em;
}
body[data-font="pixel"] .fs-tile.is-clock .fs-tile-time {
  font-size: clamp(11px, 3.5vw, 14px);
  letter-spacing: -0.05em;
}
body[data-font="pixel"] .fs-tile-amount {
  font-size: clamp(10px, 3.2vw, 13px);
}
body[data-font="pixel"] .fs-tile.is-money .fs-tile-amount,
body[data-font="pixel"] .fs-tile.is-hourly .fs-tile-amount,
body[data-font="pixel"] .fs-tile.is-countdown .fs-tile-amount,
body[data-font="pixel"] .fs-tile.is-percent .fs-tile-amount,
body[data-font="pixel"] .fs-tile.is-compact .fs-tile-amount {
  font-size: clamp(11px, 3.5vw, 14px);
}

/* ===== data-fullscreen: UI 크롬(설정바/프리셋목록 등)은 진짜 전체화면일 때만 숨김 ===== */
body[data-fullscreen="true"] .topbar,
body[data-fullscreen="true"] .theme-combos,
body[data-fullscreen="true"] .fs-presets,
body[data-fullscreen="true"] .note,
body[data-fullscreen="true"] .seo-footer,
body[data-fullscreen="true"] .hero-toolbar {
  display: none;
}

.fs-exit-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
body[data-fullscreen="true"] .fs-exit-btn { display: flex; }

/* ===== 레이아웃 프리셋 효과: 전체화면 여부와 무관하게 data-fs-layout만으로 항상 적용 =====
   full     : 시계 + 오늘 번 돈 + 주/월/년 통계 전체
   clock    : 시계만
   money    : 오늘 번 돈만 (실시간 초단위)
   countdown: 퇴근 카운트다운 + 오늘 번 돈
   percent  : 오늘 달성률(%) + 오늘 번 돈
   hourly   : 시급 진행 모드 (초당 시급)
   noStats  : 시계 + 오늘 번 돈, 통계 없이
   compact  : 시계 + 번 돈 + 실시간 요약 (미니멀)
*/
body[data-fs-layout="clock"] .hero,
body[data-fs-layout="clock"] .stats { display: none; }
body[data-fs-layout="clock"] .clock-time { font-size: clamp(3rem, 16vw, 8rem); }

body[data-fs-layout="money"] .clock,
body[data-fs-layout="money"] .stats,
body[data-fs-layout="hourly"] .clock,
body[data-fs-layout="hourly"] .stats,
body[data-fs-layout="countdown"] .clock,
body[data-fs-layout="countdown"] .stats,
body[data-fs-layout="percent"] .clock,
body[data-fs-layout="percent"] .stats {
  display: none;
}
body[data-fs-layout="noStats"] .stats,
body[data-fs-layout="compact"] .stats { display: none; }

/* ===== 배경 채움 토글: data-bg-fill="true" — 어떤 프리셋 위에도 얹을 수 있음 =====
   화면 전체 배경을 진행률(--bg-fill-pct)만큼 좌→우로 채운다.
   .app에는 z-index를 줘서 항상 이 배경 위에 콘텐츠가 보이게 함. */
body[data-bg-fill="true"]::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  width: var(--bg-fill-pct, 0%);
  background: linear-gradient(90deg, var(--accent), var(--primary));
  opacity: .16;
  transition: width .6s ease;
  pointer-events: none;
}

/* ===== Legal & Info Pages (개인정보처리방침, 이용약관, 소개) ===== */
.legal-page {
  max-width: 740px !important;
  line-height: 1.68;
}
.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.legal-nav a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}
.legal-nav a:hover {
  text-decoration: underline;
}
.legal-content {
  color: var(--text);
  font-size: 0.92rem;
}
.legal-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
}
.legal-content .legal-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}
.legal-content p, .legal-content li {
  color: var(--text);
  opacity: 0.9;
  font-size: 0.9rem;
  line-height: 1.7;
}
.legal-content ul {
  padding-left: 20px;
  margin: 8px 0 16px;
}
.legal-content li {
  margin-bottom: 4px;
}
.legal-footer-links {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 0.76rem;
}
.legal-footer-links a {
  color: var(--text-muted);
  text-decoration: underline;
}
.legal-footer-links a:hover {
  color: var(--primary);
}