/* 모바일 우선 스타일 (갤럭시 S25 기준 너비 약 360px 우선 고려) */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f9fafb;
  --fg: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-fg: #ffffff;
  --danger: #dc2626;
  --border: #e5e7eb;
  --focus: #2563eb;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  --tap: 48px; /* 최소 터치 크기 */
  --tabbar-h: 64px; /* 하단 메뉴 높이 (5단계) */
  --sat: #2563eb; /* 토요일 */
  --sun: #dc2626; /* 일요일 */
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --surface: #1f2937;
    --fg: #f3f4f6;
    --muted: #9ca3af;
    --primary: #60a5fa;
    --primary-fg: #0b1220;
    --danger: #f87171;
    --border: #374151;
    --focus: #93c5fd;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    --sat: #93c5fd;
    --sun: #fca5a5;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  word-break: keep-all; /* 한국어 단어 중간 줄바꿈 방지 */
  overflow-wrap: anywhere; /* 아주 긴 단어(URL 등)는 잘라서 가로 넘침 방지 */
}

body {
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden; /* 입력 화면이 열려 있을 때 뒤 화면 스크롤 방지 */
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── 공통 버튼 ───────────────────────────────────── */
.btn {
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation; /* 더블탭 확대 지연 제거 */
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
}

.btn-text {
  background: transparent;
  color: var(--primary);
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

/* ── 상단 ────────────────────────────────────────── */
.app-header {
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  border-bottom: 1px solid var(--border);
}

.app-title {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
}

.app-main {
  padding: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 96px); /* 하단 메뉴·+ 버튼에 가리지 않도록 */
}

/* ── 날짜 영역 ───────────────────────────────────── */
.day-header {
  margin-bottom: 16px;
}

.today {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.35;
}

.day-relative {
  margin: 2px 0 10px;
  min-height: 1.5em;
  color: var(--primary);
  font-weight: 600;
}

.day-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* ── 일정 목록 ───────────────────────────────────── */
.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.event-item,
.mo-event {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--cat, #6b7280);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.event-time,
.mo-time {
  font-size: 0.9375rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.event-title,
.mo-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.event-cat,
.mo-cat {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--cat, #6b7280);
  color: var(--fg);
  font-size: 0.875rem;
}

[data-category='company'] { --cat: #2563eb; }
[data-category='parttime'] { --cat: #ea580c; }
[data-category='personal'] { --cat: #16a34a; }
[data-category='family'] { --cat: #db2777; }
[data-category='etc'] { --cat: #6b7280; }

.empty-state {
  margin: 24px 0;
  padding: 24px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}

.note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.status {
  margin: 24px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.status[data-state='ok'] { border-color: #16a34a; }
.status[data-state='warning'] { border-color: #ca8a04; color: var(--fg); }
.status[data-state='error'] { border-color: var(--danger); color: var(--danger); }

.notice {
  margin: 0;
  color: var(--muted);
}

/* ── + 버튼 ──────────────────────────────────────── */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 16px);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 2rem;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  transition: bottom 0.15s;
}

.fab:disabled {
  opacity: 0.4;
}

body.toast-open .fab {
  bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 88px);
}

/* ── 입력 화면 (전체 화면) ───────────────────────── */
dialog {
  color: var(--fg);
  background: var(--bg);
}

.sheet {
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh; /* 키보드가 열리면 줄어드는 실제 보이는 높이 */
  max-height: 100%;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.sheet-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sheet-header {
  flex: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.sheet-title {
  margin: 0;
  font-size: 1.125rem;
  text-align: center;
}

.sheet-header .btn-primary {
  min-width: 80px;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
}

.field {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-weight: 600;
}

.req,
.opt {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 1rem; /* 16px 미만이면 입력 시 화면이 확대됨 */
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] {
  border-color: var(--danger);
  border-width: 2px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 0.9375rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}

.chip span::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cat, #6b7280);
}

.chip input:checked + span {
  border: 2px solid var(--cat, #6b7280);
  font-weight: 700;
}

.chip input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.form-error {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
}

.form-error-text {
  margin: 0;
}

.form-error .btn {
  margin-top: 10px;
}

#editor-delete {
  margin-top: 8px;
}

/* ── 확인 창 ─────────────────────────────────────── */
.confirm {
  width: min(92vw, 360px);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.confirm::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.confirm-message {
  margin: 0 0 20px;
  font-size: 1.0625rem;
  white-space: pre-line;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm .btn-primary.is-danger {
  background: var(--danger);
  color: #ffffff;
}

/* ── 알림 ────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 8px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 8px 16px;
  border-radius: 12px;
  background: #1f2937;
  color: #f9fafb;
  box-shadow: var(--shadow);
}

@media (prefers-color-scheme: dark) {
  .toast {
    background: #e5e7eb;
    color: #111827;
  }
}

.toast-text {
  flex: 1;
}

.toast-action {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #93c5fd;
  font-weight: 700;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .toast-action {
    color: #1d4ed8;
  }
}

.form-error.is-info {
  border-color: var(--primary);
  color: var(--fg);
}

/* ── 일정 중복 경고 (4단계) ──────────────────────── */
.overlap {
  width: min(94vw, 400px);
  max-height: 90dvh;
  overflow-y: auto;
}

.overlap-heading {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.overlap-recheck {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 4px solid #ca8a04;
  background: var(--surface);
  font-size: 0.9375rem;
}

.overlap-summary {
  margin: 0 0 12px;
  white-space: pre-line;
  font-size: 0.9375rem;
  color: var(--muted);
}

.overlap-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.overlap-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--cat, #6b7280); /* 분류 색상은 [data-category] 규칙에서 지정 */
  border-radius: 10px;
  background: var(--surface);
}

.overlap-item-title {
  display: block;
  font-weight: 700;
  font-size: 1.0625rem;
}

.overlap-item-time {
  display: block;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
}

.overlap-item-meta {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
}

.overlap-item-portion {
  display: block;
  margin-top: 2px;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ── 5단계: 공통 화면 머리말 ─────────────────────── */
.view-header {
  margin-bottom: 16px;
}

.view-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.35;
}

.view-sub {
  margin: 2px 0 10px;
  min-height: 1.5em;
  color: var(--primary);
  font-weight: 600;
}

.load-error {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
}

.load-error-text {
  margin: 0 0 10px;
}

/* ── 5단계: 하단 메뉴 ────────────────────────────── */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: var(--tap);
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  cursor: pointer;
  touch-action: manipulation;
}

.tab-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  border-radius: 999px;
  box-sizing: content-box;
  padding: 2px 14px;
}

.tab[aria-current='page'] {
  color: var(--primary);
  font-weight: 700;
}

.tab[aria-current='page'] .tab-icon {
  background: var(--surface);
  outline: 1px solid var(--border);
}

/* ── 5단계: 주간 화면 ────────────────────────────── */
.week-days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.wk-day {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.wk-day.is-selected {
  border: 2px dashed var(--primary);
}

.wk-day.is-today {
  border: 2px solid var(--primary);
}

.wk-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.wk-date {
  font-size: 1.0625rem;
  font-weight: 700;
}

.wk-day.is-sat .wk-date { color: var(--sat); }
.wk-day.is-sun .wk-date { color: var(--sun); }

.wk-today {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 0.8125rem;
  font-weight: 700;
}

.wk-count {
  margin-left: auto;
  flex: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
}

.wk-count.is-empty {
  font-weight: 400;
  color: var(--muted);
}

.wk-events {
  list-style: none;
  margin: 0;
  padding: 0 10px 10px;
  display: grid;
  gap: 6px;
}

.wk-event {
  display: grid;
  gap: 1px;
  width: 100%;
  min-height: 52px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--cat, #6b7280);
  border-radius: 10px;
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.wk-time {
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.wk-title {
  font-size: 1rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 아주 긴 제목은 두 줄까지만 (전체는 수정 화면에서) */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 5단계: 월간 화면 ────────────────────────────── */
.month-cal {
  margin: 0 -8px; /* 좁은 화면에서 칸 너비를 조금 더 확보 */
}

.month-weekdays,
.month-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.month-weekdays {
  margin-bottom: 4px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

.month-weekdays .is-sat { color: var(--sat); }
.month-weekdays .is-sun { color: var(--sun); }

.month-weeks {
  display: grid;
  gap: 2px;
}

.mc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  min-height: 56px;
  padding: 4px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}

.mc-day {
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  text-align: center;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.mc.is-sat .mc-day { color: var(--sat); }
.mc.is-sun .mc-day { color: var(--sun); }

.mc.is-out {
  opacity: 0.45;
}

.mc.is-selected {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.mc.is-today .mc-day {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 700;
}

.mc-count {
  min-height: 1.2em;
  max-width: 100%;
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.mc.has-events .mc-count {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  outline: 1px solid var(--border);
}

.month-day {
  margin-top: 16px;
}

.month-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.month-day-titles {
  min-width: 0;
}

.month-day-heading {
  margin: 0;
  font-size: 1.125rem;
}

.month-day-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.month-day-header .btn {
  flex: none;
  padding: 0 12px;
}

.month-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.month-day .empty-state {
  margin: 8px 0;
}

/* ── 5·6단계: 설정 화면 ──────────────────────────── */
#view-settings .view-title {
  margin-bottom: 16px;
}

.settings-card {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.settings-label {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 700;
}

.settings-desc,
.settings-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.settings-hint {
  margin: 10px 0 0;
  font-size: 0.875rem;
}

.settings-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.backup-privacy {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 4px solid #ca8a04;
  background: var(--bg);
  font-size: 0.9375rem;
}

.backup-last,
.backup-message,
.import-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.9375rem;
  white-space: pre-line;
}

[data-state='ok'].backup-message,
[data-state='ok'].import-note { border-color: #16a34a; }
[data-state='warning'].backup-last,
[data-state='warning'].backup-message { border-color: #ca8a04; border-width: 2px; }
[data-state='error'].backup-last,
[data-state='error'].backup-message,
[data-state='error'].import-note { border-color: var(--danger); color: var(--danger); }
[data-state='info'].backup-message { border-color: var(--primary); }

.snapshot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.snapshot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.snapshot-text {
  flex: 1;
  min-width: 0;
  display: grid;
}

.snapshot-time {
  font-weight: 600;
}

.snapshot-meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.snapshot-restore {
  flex: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── 6단계: 백업 가져오기 미리보기 ───────────────── */
.import {
  width: min(94vw, 420px);
  max-height: 90dvh;
  overflow-y: auto;
}

.import-file {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  white-space: pre-line;
}

.import-stats,
.import-warnings {
  margin: 0 0 10px;
  padding-left: 1.2em;
  font-size: 0.9375rem;
}

.import-warnings {
  padding: 8px 10px 8px 1.6em;
  border-left: 4px solid #ca8a04;
  background: var(--surface);
}

.import-modes {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  display: grid;
  gap: 8px;
}

.import-modes legend {
  margin-bottom: 6px;
  padding: 0;
  font-weight: 700;
}

.import-mode {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.import-mode:has(input:checked) {
  border: 2px solid var(--primary);
}

.import-mode.is-disabled {
  cursor: not-allowed;
  border-style: dashed;
}

.import-mode.is-disabled strong {
  color: var(--muted);
}

.import-mode input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.import-mode > span {
  display: grid;
  gap: 2px;
}

.import-mode-desc {
  color: var(--muted);
  font-size: 0.875rem;
}

.import-replace-warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 2px solid var(--danger);
  border-radius: 10px;
}

.import-replace-warn p {
  margin: 0 0 8px;
  font-size: 0.9375rem;
}

.import .note-gap {
  margin-bottom: 12px;
}

.import .btn-primary.is-danger {
  background: var(--danger);
  color: #ffffff;
}

.import-note {
  margin: 0 0 12px;
}

/* ── 7단계: 인터넷 연결·새 버전 안내 ─────────────── */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0;
  padding: 6px 16px;
  background: #374151;
  color: #f9fafb;
  font-size: 0.875rem;
  text-align: center;
}

.update-banner {
  margin: 12px 16px 0;
  padding: 12px;
  border: 2px solid var(--primary);
  border-radius: 12px;
  background: var(--surface);
}

.update-text {
  margin: 0 0 10px;
  font-size: 0.9375rem;
}

.update-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#update-check {
  margin-top: 10px;
}

/* 설치된 앱(독립 실행)에서 머리글이 상태 표시줄 아래로 들어가지 않도록 */
@media (display-mode: standalone) {
  .app-header {
    padding-top: calc(env(safe-area-inset-top) + 12px);
  }
}

/* 8-1단계: 파일 보관 직접 확인 버튼 */
#backup-confirm {
  margin-top: 8px;
}
[data-state='info'].backup-last { border-color: var(--primary); }
[data-state='ok'].backup-last { border-color: #16a34a; }
