:root {
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --surface-subtle: #f7faf8;
  --surface-tint: #e9f5f1;
  --ink: #17211f;
  --muted: #566660;
  --line: #dce5e1;
  --line-strong: #c5d3ce;
  --brand: #087f70;
  --brand-strong: #056458;
  --brand-deep: #073f3a;
  --brand-soft: #dff3ed;
  --warning: #a95b17;
  --warning-soft: #fff1df;
  --danger: #b93843;
  --danger-soft: #ffeaec;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(20, 52, 45, .04);
  --shadow: 0 10px 30px rgba(20, 52, 45, .07);
  --content: 560px;
  --nav-height: 72px;
  --nav-clearance: calc(var(--nav-height) + env(safe-area-inset-bottom));
  color: var(--ink);
  background: var(--canvas);
  font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { width: 100%; min-width: 320px; min-height: 100%; overflow-x: clip; scroll-padding-bottom: calc(var(--nav-clearance) + 24px); background: var(--canvas); }
body { width: 100%; min-width: 320px; min-height: 100dvh; margin: 0; overflow-x: clip; background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { min-width: 0; max-width: 100%; font: inherit; color: inherit; }
form { min-width: 0; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
[hidden] { display: none !important; }

/* App header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  min-height: 68px;
  padding: 9px max(16px, calc((100% - var(--content)) / 2 + 16px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(220, 229, 225, .88);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
}
.topbar > div { min-width: 0; padding-left: 42px; position: relative; text-align: left; }
.account-tools { min-width: 0; display: flex; align-items: center; gap: 8px; }
.account-tools > span { max-width: 145px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.account-tools button { min-height: 35px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--brand-strong); font-size: 10px; font-weight: 850; }
.legal-guidance { margin-bottom: 12px; padding: 11px 13px; display: grid; gap: 3px; border: 1px solid #c7ded6; border-radius: 13px; background: #effaf6; color: #34564e; font-size: 10px; line-height: 1.5; }
.legal-guidance strong { color: var(--brand-deep); font-size: 11px; }
.topbar > div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--brand);
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 7px var(--brand-soft);
}
.topbar > div::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 60% 60% 55% 55%;
  transform: translateY(-56%) rotate(45deg);
}
.topbar h1 { max-width: 190px; margin: 1px 0 0; overflow: hidden; font-size: 18px; font-weight: 850; line-height: 1.15; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow, .sheet-kicker { color: var(--brand-strong); font-size: 11px; font-weight: 850; line-height: 1.2; letter-spacing: .02em; }
.role { flex: 0 0 auto; display: block; }
.role > span { display: none; }
.role select { width: auto; min-height: 42px; padding: 8px 32px 8px 13px; border: 0; border-radius: 13px; outline: none; background: var(--surface-tint); color: var(--brand-deep); font-size: 13px; font-weight: 800; }

/* One-column mobile frame */
.app-shell { width: 100%; max-width: var(--content); margin: 0 auto; padding: 18px 16px calc(var(--nav-clearance) + 28px); }
.view { display: none; width: 100%; }
.view.active { display: block; animation: view-in .22s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.today-head, .page-head, .card-title, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.today-head {
  position: relative;
  min-height: 164px;
  padding: 25px 22px;
  align-items: flex-start;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--brand-deep);
  color: #fff;
  box-shadow: 0 14px 34px rgba(7, 63, 58, .17);
}
.today-head::before, .today-head::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .055); }
.today-head::before { right: -42px; bottom: -78px; width: 210px; height: 210px; }
.today-head::after { right: 72px; top: -68px; width: 120px; height: 120px; }
.today-head > div:first-child { position: relative; z-index: 2; max-width: 75%; }
.today-head .eyebrow { color: #9fe0d2; }
.today-head h2 { margin: 9px 0 0; font-size: clamp(27px, 7vw, 34px); font-weight: 900; line-height: 1.16; letter-spacing: -.05em; word-break: keep-all; }
.today-head p { margin: 11px 0 0; color: #c6dfda; font-size: 13px; font-weight: 650; line-height: 1.55; }
.hero-side { position: relative; z-index: 2; width: 84px; min-height: 120px; display: flex; justify-content: flex-end; }
.hero-side .status { position: relative; z-index: 2; align-self: flex-start; }
.hero-side svg { position: absolute; right: -27px; bottom: -35px; width: 128px; height: auto; fill: rgba(255,255,255,.04); stroke: #7fcdbd; stroke-width: 2; stroke-linecap: round; }

.page-head { min-height: 68px; margin-bottom: 14px; align-items: flex-end; }
.page-head > div { min-width: 0; flex: 1; }
.page-head h2 { margin: 4px 0 0; font-size: clamp(27px, 7vw, 34px); font-weight: 900; line-height: 1.12; letter-spacing: -.05em; }
.page-head > input[type="month"] { width: 152px; flex: 0 0 152px; min-height: 48px; padding: 8px 10px; font-size: 14px; font-weight: 750; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.back { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.back svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.save-state { max-width: 84px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; }

.status, .photo-count { padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 850; white-space: nowrap; }
.status.pending { background: var(--warning-soft); color: var(--warning); }
.status.complete, .photo-count { background: var(--brand-soft); color: var(--brand-strong); }
.status.issue { background: var(--danger-soft); color: var(--danger); }
.today-head .status { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow-sm); }
.urgent-banner { margin-bottom: 12px; padding: 14px 15px; border-radius: 15px; background: var(--danger); color: #fff; font-size: 14px; font-weight: 800; line-height: 1.45; }

/* Quick actions */
.action-grid { margin-top: 12px; padding: 13px 4px 12px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.action { min-height: 82px; padding: 5px 1px; display: flex; flex-direction: column; align-items: center; gap: 7px; border: 0; border-radius: 14px; background: transparent; text-align: center; }
.action:active { background: var(--surface-tint); transform: scale(.98); }
.action-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 15px; background: var(--brand-soft); color: var(--brand-strong); }
.action:first-child .action-icon { background: var(--brand); color: #fff; }
.action-icon svg, .bottom-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.action b { max-width: 64px; font-size: 11px; font-weight: 800; line-height: 1.3; word-break: keep-all; }
.action small { display: none; }

.notifications { margin: 12px 0; display: grid; gap: 8px; }
.notification { padding: 13px 14px; display: flex; gap: 9px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.45; box-shadow: var(--shadow-sm); }
.notification > b { color: var(--brand); }
.notification.warning > b { color: var(--warning); }
.notification.danger > b { color: var(--danger); }
.reminder-card { padding: 14px 16px; }
.reminder-card.danger { border-color: rgba(180, 48, 48, .35); background: #fff5f5; }
.reminder-copy { display: grid; gap: 4px; margin-top: 4px; }
.reminder-copy strong { font-size: 16px; line-height: 1.35; }
.reminder-copy span, .reminder-copy em { color: var(--muted); font-size: 13px; line-height: 1.45; font-style: normal; }
.recent-log { width: 100%; justify-content: space-between; text-align: left; }
.missing-day-list { margin-top: 10px; display: grid; gap: 8px; }
.missing-day { min-height: 54px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid rgba(180, 48, 48, .28); border-radius: 14px; background: #fff; color: var(--danger); font-weight: 850; text-align: left; }
.missing-day strong { font-size: 15px; line-height: 1.2; }
.missing-day span { font-size: 12px; color: var(--danger); }
.missing-day:active { transform: scale(.99); background: #fff1f1; }

.card { margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.card h3, .card h4 { margin: 0; font-size: 19px; font-weight: 850; letter-spacing: -.035em; }
.card-title { margin-bottom: 13px; }
.card-title > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.health-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.health-item { min-height: 85px; padding: 12px 10px; border-radius: 15px; background: var(--surface-subtle); }
.health-item span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.35; }
.health-item b { display: block; margin-top: 8px; font-size: 14px; font-weight: 850; line-height: 1.3; }
.health-item.good b { color: var(--brand-strong); }
.health-item.warn b { color: var(--warning); }
.text-button, .add-row, .all-normal { border: 0; background: none; color: var(--brand-strong); font-weight: 850; }
.text-button { min-height: 42px; padding: 7px; font-size: 14px; }
.settings-link { width: 100%; min-height: 54px; margin-top: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--brand-strong); font-size: 14px; font-weight: 850; box-shadow: var(--shadow-sm); scroll-margin-bottom: calc(var(--nav-clearance) + 18px); }
.record-list { display: grid; gap: 8px; }
.record { padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 14px; background: var(--surface-subtle); font-size: 14px; line-height: 1.4; }
.record strong, .record small { display: block; }
.record small { margin-top: 3px; color: var(--muted); }
.severity { padding: 6px 9px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 11px; font-weight: 850; }
.severity.긴급 { background: var(--danger-soft); color: var(--danger); }
.empty { padding: 22px; color: var(--muted); font-size: 14px; text-align: center; }

/* Controls */
label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 52px; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 13px; outline: none; background: var(--surface); font-size: 16px; }
textarea { min-height: 108px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,127,112,.12); }
button:focus-visible, summary:focus-visible { outline: 3px solid rgba(8,127,112,.24); outline-offset: 2px; }
input[type="file"] { padding: 8px; overflow: hidden; font-size: 13px; }
input[type="file"]::file-selector-button { min-height: 36px; margin-right: 9px; padding: 7px 11px; border: 0; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: 1fr; }
.work-time-control { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
.work-time-control > span { display: block; }
.work-time-segmented { min-height: 52px; }
.work-time-fields { grid-column: 1 / -1; }
.work-time-fields input[readonly] { background: var(--surface-subtle); color: var(--ink); }
.wide { margin-top: 12px; }
.switch-label, .checks label { display: flex; align-items: center; gap: 9px; }
.switch-label input, .checks input { width: 21px; min-height: 21px; accent-color: var(--brand); }
.segmented { padding: 4px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; background: #e9eeec; }
.segmented input,
.dayoff-toggle input,
.photo-source-actions input,
.plan-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}
.segmented label { min-height: 44px; display: grid; place-items: center; border-radius: 11px; color: var(--muted); font-size: 14px; font-weight: 800; cursor: pointer; }
.segmented input:checked + label { background: var(--surface); color: var(--brand-strong); box-shadow: 0 2px 8px rgba(20,52,45,.09); }

/* Daily journal */
.journal-page-head { align-items: center; }
.journal-page-head > div { flex: 1; }
.journal-sheet { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.sheet-head { padding: 19px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h3, .special-records h3 { margin: 4px 0 0; font-size: 22px; font-weight: 900; letter-spacing: -.04em; }
.dayoff-toggle { display: block; }
.dayoff-toggle > span { min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 800; }
.dayoff-toggle i { width: 9px; height: 9px; border: 2px solid #83928e; border-radius: 50%; }
.dayoff-toggle input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.dayoff-toggle input:checked + span i { border-color: var(--brand); background: var(--brand); }
.journal-context { padding: 0 18px 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.journal-context label > span, .source-choice > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.journal-context input, .journal-context select { min-height: 49px; padding-inline: 10px; font-size: 14px; font-weight: 750; }
.journal-context label { position: relative; }
.journal-context label > small { position: absolute; right: 10px; bottom: 16px; color: var(--muted); font-size: 11px; font-weight: 800; pointer-events: none; }
.journal-context label:has(> small) input { padding-right: 32px; }
.journal-sheet .source-choice { padding: 16px 18px; border-top: 1px solid var(--line); }
.journal-sheet .source-choice .segmented { margin-top: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.meter-ledger { display: block; border-top: 1px solid var(--line); }
.meter-entry { padding: 18px; display: grid; grid-template-columns: 28px 1fr; gap: 8px 8px; border-bottom: 1px solid var(--line); }
.meter-entry:last-child { border-bottom: 0; }
.meter-entry:focus-within { background: #f8fbfa; }
.meter-index { grid-column: 1; padding-top: 4px; color: var(--brand); font: 850 10px ui-monospace, SFMono-Regular, monospace; }
.meter-title { grid-column: 2; color: var(--ink); font-size: 15px; font-weight: 850; }
.meter-input { position: relative; grid-column: 1 / -1; }
.meter-input input { min-height: 64px; padding: 7px 62px 7px 2px; border: 0; border-bottom: 2px solid #91a39e; border-radius: 0; background: transparent; box-shadow: none; font: 800 clamp(29px, 9vw, 40px) ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums; }
.meter-input input:focus { border-color: var(--brand); box-shadow: none; }
.meter-input > span { position: absolute; right: 2px; bottom: 17px; color: var(--muted); font: 750 12px ui-monospace, SFMono-Regular, monospace; }
.meter-entry small { grid-column: 1; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.meter-entry small b { display: block; margin-top: 3px; color: var(--ink); font-size: 11px; }
.meter-entry em { grid-column: 2; justify-self: end; color: var(--muted); font-size: 10px; font-weight: 700; font-style: normal; text-align: right; }
.meter-entry em strong { display: block; margin-top: 3px; color: var(--brand-strong); font-size: 12px; }
.journal-sheet .field-help { margin: 0; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface-subtle); color: var(--muted); font-size: 11px; line-height: 1.55; }
.save-dock { padding-top: 12px; }
.submit-sticky, .photo-upload-button { width: 100%; min-height: 62px; padding: 10px 16px; border: 0; border-radius: 17px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 850; box-shadow: 0 10px 24px rgba(8,127,112,.2); }
.submit-sticky { display: grid; }
.submit-sticky small { margin-top: 2px; color: #effffc; font-size: 11px; font-weight: 650; }
.submit-sticky:disabled { opacity: .6; }
.special-records { margin-top: 27px; }
.special-records > header { padding: 0 3px 11px; }
.special-records > header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.special-list { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.special-list button { width: 100%; min-height: 69px; padding: 11px 15px; display: grid; grid-template-columns: 28px 1fr 18px; align-items: center; gap: 9px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.special-list button:last-child { border-bottom: 0; }
.special-list button:active { background: var(--surface-tint); }
.special-number { color: var(--brand); font: 850 10px ui-monospace, SFMono-Regular, monospace; }
.special-list button > span:nth-child(2) { display: grid; gap: 2px; }
.special-list b { color: var(--ink); font-size: 15px; font-weight: 850; }
.special-list small { color: var(--muted); font-size: 12px; }
.special-list i { color: #899590; font-size: 21px; font-style: normal; text-align: right; }

/* Monthly */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat { min-height: 91px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat b { display: block; margin-top: 7px; font-size: 20px; font-weight: 900; letter-spacing: -.03em; }
.legend { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.legend i.issue { background: var(--danger); }
.legend i.missing { background: #a8b4b0; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-head { padding: 5px 1px; color: var(--muted); font-size: 10px; font-weight: 750; text-align: center; }
.day { position: relative; aspect-ratio: 1; display: grid; place-items: center; border: 0; border-radius: 11px; background: var(--surface-subtle); font-size: 13px; font-weight: 800; }
.day.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.day.complete:after, .day.issue:after, .day.partial:after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.day.issue:after { background: var(--danger); }
.day.partial:after { background: var(--warning); }
.day.missing { color: #9aa5a1; }
.official-log-section { margin-top: 24px; }
.official-section-head { margin-bottom: 11px; padding: 0 3px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.official-section-head h3 { margin: 4px 0 0; font-size: 23px; font-weight: 900; letter-spacing: -.04em; }
.official-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.official-count { padding: 7px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 11px; font-weight: 900; white-space: nowrap; }
.official-log-list { display: grid; gap: 16px; }
.official-log-card { overflow: hidden; border: 1px solid #cbd2cf; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.official-card-bar { min-height: 62px; padding: 11px 12px 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.official-card-bar b, .official-card-bar small { display: block; }
.official-card-bar b { font-size: 13px; font-weight: 900; }
.official-card-bar small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.official-card-bar button { min-height: 38px; padding: 0 11px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface-subtle); color: var(--brand-strong); font-size: 11px; font-weight: 850; }
.official-paper { padding: 12px 10px 14px; color: #111; background: #fff; font-family: "Noto Sans KR", "Malgun Gothic", sans-serif; }
.official-form-number { margin-bottom: 7px; color: #333; font-size: 8px; }
.official-paper-head { margin-bottom: 8px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; align-items: end; }
.official-paper-head > div { text-align: center; }
.official-paper-head span { display: block; font-size: 9px; font-weight: 750; }
.official-paper-head h4 { margin: 2px 0 0; font-size: 12px; font-weight: 900; letter-spacing: -.05em; text-align: left; white-space: nowrap; }
.official-paper table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.official-paper th, .official-paper td { height: 25px; padding: 3px 2px; border: 1px solid #343434; font-size: 7px; line-height: 1.2; text-align: center; vertical-align: middle; }
.official-paper th { background: #f3f3f3; font-weight: 800; }
.official-approval th:first-child { width: 25px; }
.official-approval td { font-size: 7px; }
.official-meta { min-height: 33px; padding: 6px 8px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; border: 1px solid #343434; font-size: 8px; }
.official-meta strong { font-size: 9px; }
.official-block { margin-top: 9px; }
.official-block h5 { margin: 0 0 4px; font-size: 9px; font-weight: 900; }
.official-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.official-hours { min-width: 100%; }
.official-hours th:first-child { width: 38px; }
.official-hours th:not(:first-child), .official-hours td { width: 12px; padding: 1px 0; font-size: 6px; }
.official-hours td.active { background: #171717; color: #171717; }
.official-time-note { min-height: 25px; margin: 0; padding: 5px 7px; display: flex; justify-content: space-between; gap: 8px; border: 1px solid #343434; border-top: 0; font-size: 7px; }
.official-paired, .official-quantity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.official-paired .official-block { min-width: 0; }
.official-bottom-pair { margin-top: 2px; }
.official-quantity caption { padding: 4px; border: 1px solid #343434; border-bottom: 0; background: #f3f3f3; font-size: 8px; font-weight: 900; }
.official-quantity th:first-child { width: 23%; }
.official-quantity tr.selected td, .official-quantity tr.selected th { background: #f1faf7; font-weight: 850; }
.official-sludge th { font-size: 6.5px; }
.official-note { margin: 8px 0 0; color: #333; font-size: 7px; line-height: 1.5; }
.aggregate-list { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.aggregate { min-height: 68px; padding: 12px; background: var(--surface); }
.aggregate span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.aggregate b { display: block; margin-top: 5px; font-size: 14px; font-weight: 850; }
.export-grid { margin-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.period-print-card { display: grid; gap: 12px; }
.period-print-card .card-title { margin-bottom: 0; }
.period-print-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.export { min-height: 70px; padding: 13px; display: grid; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); text-align: left; font-size: 15px; font-weight: 850; }
.export.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.export small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; }
.export.primary small { color: #effffc; font-weight: 650; }
.notice-box { padding: 13px 14px; border-radius: 14px; background: var(--surface-tint); color: var(--muted); font-size: 11px; line-height: 1.55; }
.print-service-card { display: grid; gap: 13px; }
.print-service-card .card-title { margin-bottom: 0; }
.print-service-card .card-title h3 { margin-top: 4px; }
.plan-badge { padding: 7px 10px; border-radius: 999px; background: var(--surface-subtle); color: var(--muted); font-size: 11px; font-weight: 850; white-space: nowrap; }
.plan-badge.active { background: var(--brand-soft); color: var(--brand-strong); }
.plan-badge.pending { background: var(--warning-soft); color: var(--warning); }
.service-description { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.print-quota { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quota-item { min-height: 68px; padding: 11px; border-radius: 14px; background: var(--surface-subtle); }
.quota-item span, .quota-item b { display: block; }
.quota-item span { color: var(--muted); font-size: 10px; font-weight: 750; }
.quota-item b { margin-top: 5px; font-size: 15px; font-weight: 900; }
.print-request-list { display: grid; gap: 7px; }
.print-request { padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-subtle); }
.print-request b, .print-request small { display: block; }
.print-request b { font-size: 13px; }
.print-request small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.print-request em { color: var(--brand-strong); font-size: 11px; font-style: normal; font-weight: 850; white-space: nowrap; }

/* Photos */
.photo-page-head { align-items: flex-end; }
.photo-log-required { margin-bottom: 11px; padding: 14px; border: 1px solid #ead4b7; border-radius: 15px; background: var(--warning-soft); }
.photo-log-required strong { font-size: 15px; }
.photo-log-required p { margin: 5px 0 0; color: #765536; font-size: 12px; line-height: 1.5; }
.photo-upload-shell { padding: 13px; display: grid; gap: 11px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.camera-drop { min-height: 0; aspect-ratio: 16 / 10; padding: 18px; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed #8fa9a1; border-radius: 17px; background: var(--surface-subtle); text-align: center; }
.camera-symbol { width: 58px; height: 58px; margin-bottom: 4px; display: grid; place-items: center; border-radius: 18px; background: var(--brand-soft); color: var(--brand-strong); }
.camera-symbol svg, .photo-source-actions svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.camera-drop b { max-width: 85%; overflow: hidden; font-size: 17px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.camera-drop small { color: var(--muted); font-size: 12px; }
.camera-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-drop.has-image::after { content: "선택 완료"; position: absolute; right: 10px; bottom: 10px; padding: 7px 10px; border-radius: 999px; background: rgba(10,36,32,.88); color: #fff; font-size: 11px; font-weight: 800; }
.photo-source-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-source-actions label { min-width: 0; position: relative; display: block; overflow: hidden; }
.photo-source-actions span { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 800; }
.photo-source-actions label:first-child span { border-color: #9dcec1; background: var(--brand-soft); color: var(--brand-strong); }
.photo-fields { display: grid; grid-template-columns: 1fr; gap: 10px; }
.photo-upload-button { min-height: 58px; }
.photo-history { margin-top: 27px; }
.photo-history header { margin-bottom: 11px; }
.photo-history h3 { margin: 4px 0 0; font-size: 21px; font-weight: 900; letter-spacing: -.035em; }
.photo-tab-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-record { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.photo-record img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; background: #e5ece9; }
.photo-record div { padding: 11px; }
.photo-record b, .photo-record small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-record b { font-size: 14px; font-weight: 850; }
.photo-record small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.photo-tab-empty { grid-column: 1 / -1; padding: 28px 16px; border: 1.5px dashed #a7b8b2; border-radius: 16px; color: var(--muted); font-size: 13px; text-align: center; }

/* Audit */
.audit-list { display: grid; gap: 9px; }
.audit-entry { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.audit-entry header { display: flex; justify-content: space-between; gap: 10px; }
.audit-entry time { color: var(--muted); font-size: 11px; }
.audit-entry p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.audit-entry details { margin-top: 9px; font-size: 12px; }
.audit-entry pre { max-height: 260px; padding: 10px; overflow: auto; white-space: pre-wrap; background: var(--surface-subtle); }

/* Native-style tab bar */
.bottom-nav { position: fixed; left: 50%; bottom: 0; z-index: 40; width: 100%; max-width: var(--content); min-height: var(--nav-height); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; background: rgba(255,255,255,.97); box-shadow: 0 -10px 30px rgba(20,52,45,.09); transform: translateX(-50%); backdrop-filter: blur(18px); }
.bottom-nav button { width: 100%; min-height: 58px; padding: 5px 1px; display: grid; place-items: center; gap: 3px; border: 0; border-radius: 14px; background: transparent; color: #5f6d68; font-size: 10px; font-weight: 750; }
.bottom-nav button span { display: grid; place-items: center; }
.bottom-nav button.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 900; }
.bottom-nav button.active svg { stroke-width: 2.5; }

/* Mobile bottom sheets */
dialog { width: min(100%, var(--content)); max-width: var(--content); height: min(92dvh, 820px); max-height: 92dvh; margin: auto auto 0; padding: 0; overflow: hidden; border: 0; border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: 0 -20px 60px rgba(10,36,32,.25); }
dialog::backdrop { background: rgba(8,30,27,.58); backdrop-filter: blur(2px); }
dialog form, .modal-frame { height: 100%; display: flex; flex-direction: column; }
.dialog-head { flex: 0 0 auto; padding: 16px 17px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; border-radius: 999px; background: var(--line-strong); transform: translateX(-50%); }
.dialog-head h2 { margin: 3px 0 0; font-size: 23px; font-weight: 900; letter-spacing: -.045em; }
.close-dialog { width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--surface-subtle); font-size: 24px; }
.dialog-body { flex: 1; min-height: 0; padding: 16px 17px 25px; display: grid; align-content: start; gap: 14px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-submit { flex: 0 0 auto; min-height: 64px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border: 0; background: var(--brand); color: #fff; font-size: 16px; font-weight: 850; }
.checks { display: grid; grid-template-columns: 1fr; gap: 8px; }
.checks label { min-height: 48px; padding: 10px 12px; border-radius: 12px; background: var(--surface-subtle); color: var(--ink); font-size: 13px; }
.registration-note { margin: 0; padding: 13px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; font-weight: 700; line-height: 1.55; }
.storage-settings { padding: 14px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-subtle); }
.storage-settings h3 { margin: 4px 0 0; font-size: 18px; font-weight: 900; }
.plan-options { display: grid; gap: 9px; }
.plan-option { position: relative; display: block; cursor: pointer; }
.plan-option > span { min-height: 100px; padding: 14px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 4px 10px; border: 1.5px solid var(--line); border-radius: 15px; background: var(--surface); transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.plan-option b { color: var(--ink); font-size: 15px; font-weight: 900; }
.plan-option small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.5; }
.plan-option em { grid-column: 2; grid-row: 1; align-self: center; color: var(--brand-strong); font-size: 12px; font-style: normal; font-weight: 900; white-space: nowrap; }
.plan-option input:checked + span { border-color: var(--brand); background: #f1faf7; box-shadow: 0 0 0 3px rgba(8,127,112,.09); }
.plan-option.featured input:checked + span { background: var(--brand-deep); color: #fff; }
.plan-option.featured input:checked + span b, .plan-option.featured input:checked + span em { color: #fff; }
.plan-option.featured input:checked + span small { color: #c6dfda; }
.plan-status-text, .print-terms { margin: 0; padding: 11px 12px; border-radius: 12px; background: var(--surface-tint); color: var(--muted); font-size: 11px; line-height: 1.5; }
.optional-settings { margin-top: 3px; padding: 13px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 15px; }
.optional-settings summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
.optional-settings summary span { color: var(--muted); font-size: 11px; }
.divider { height: 1px; margin: 10px 0; background: var(--line); }
.chemical-row { margin-bottom: 8px; display: grid; grid-template-columns: 1.15fr .8fr 66px 36px; gap: 6px; }
.chemical-row [data-field="previous_stock"], .chemical-row [data-field="purchased"] { display: none; }
.chemical-row input, .chemical-row select { min-height: 48px; padding: 7px; font-size: 13px; }
.remove-row { border: 0; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 19px; }
.checklist { display: grid; grid-template-columns: 1fr; gap: 8px; }
.check-item { padding: 10px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 13px; }
.check-item > span { color: var(--ink); font-size: 13px; font-weight: 800; }
.check-item select { min-height: 47px; font-size: 14px; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.photo-input { min-height: 126px; padding: 13px 7px; display: flex; align-items: center; justify-content: center; text-align: center; border: 1.5px dashed #98ada6; border-radius: 15px; background: var(--surface-subtle); }
.photo-input input { display: none; }
.photo-input span { color: var(--brand); font-size: 25px; }
.photo-input b { font-size: 14px; }
.photo-input small { font-size: 11px; }
.photo-input.selected { border-style: solid; border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.extra-test-row { margin-bottom: 8px; display: grid; grid-template-columns: 1fr 1fr 36px; gap: 6px; }
.extra-test-row [data-extra="unit"] { grid-column: 1 / 3; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-clearance) + 14px); z-index: 100; width: max-content; max-width: calc(100% - 30px); padding: 12px 15px; border-radius: 13px; background: #17332e; color: #fff; font-size: 13px; font-weight: 750; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.legal-notice { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 22px calc(var(--nav-clearance) + 18px); color: var(--muted); font-size: 10px; line-height: 1.55; text-align: center; }

@media (max-width: 560px) {
  .legal-notice { display: none; }
}

@media (max-width: 380px) {
  .app-shell { padding-inline: 12px; }
  .topbar { padding-inline: 12px; }
  .topbar h1 { max-width: 130px; }
  .today-head { min-height: 156px; padding: 22px 18px; }
  .today-head h2 { font-size: 25px; }
  .action-grid { padding-inline: 2px; }
  .action-icon { width: 39px; height: 39px; border-radius: 13px; }
  .action b { font-size: 10px; }
  .health-list { grid-template-columns: 1fr; }
  .health-item { min-height: 64px; }
  .page-head > input[type="month"] { width: 138px; flex-basis: 138px; }
}

@media (min-width: 561px) {
  .topbar { padding-left: calc((100% - var(--content)) / 2 + 16px); padding-right: calc((100% - var(--content)) / 2 + 16px); }
  .app-shell { padding-top: 22px; }
  .field-grid.two { grid-template-columns: 1fr 1fr; }
  .photo-fields { grid-template-columns: 1fr 1fr; }
  .official-paper-head { grid-template-columns: 1.2fr 1fr; }
}

@media print {
  @page { size: A4 portrait; margin: 1mm; }
  .topbar, .bottom-nav, #monthlyView > :not(.official-log-section), .official-section-head, .official-card-bar, .legal-notice { display: none !important; }
  body, .app-shell { background: #fff !important; }
  .app-shell { width: 100%; max-width: none; padding: 0; }
  #monthlyView, .official-log-section { display: block !important; margin: 0; }
  .official-log-list { display: block; }
  .official-log-card {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: block;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .official-paper {
    padding: 3mm 2mm 3mm;
    height: auto;
    box-sizing: border-box;
    display: block;
  }
  .official-paper th, .official-paper td { height: 23px; padding: 1.5px 1px; font-size: 6.8px; }
  .official-meta { min-height: 24px; }
  .official-block { margin-top: 5px; }
  .official-print-spacer { display: none !important; }
  .official-note { margin-top: 4mm; }
}

/* Android browsers can expose a desktop-sized layout viewport even on a phone.
   The early touch-ui marker in index.html keeps those devices edge-to-edge and
   prevents the wide-screen form rules from taking over. */
html.touch-ui { --content: 100%; }
html.touch-ui .topbar { padding-left: 16px; padding-right: 16px; }
html.touch-ui .app-shell,
html.touch-ui .legal-notice { max-width: none; }
html.touch-ui .legal-notice { display: none; }
html.touch-ui .field-grid.two,
html.touch-ui .photo-fields { grid-template-columns: 1fr; }
html.touch-ui .bottom-nav { max-width: none; border-left: 0; border-right: 0; border-radius: 20px 20px 0 0; }
html.touch-ui dialog { width: 100%; max-width: none; }

/* Chrome's "desktop site" mode keeps touch input but exposes a ~980px viewport.
   Restore the device-width mobile canvas and scale it to the visual viewport. */
html.touch-scaled body {
  width: var(--mobile-layout-width);
  min-width: var(--mobile-layout-width);
  min-height: var(--mobile-layout-height);
  zoom: var(--mobile-zoom);
}
html.touch-scaled .topbar,
html.touch-scaled .app-shell,
html.touch-scaled .legal-notice,
html.touch-scaled .bottom-nav { width: 100%; }
html.touch-scaled .topbar { position: relative; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.bank-transfer-notice{display:grid;gap:14px;margin-top:16px;padding:16px;border:1px solid #b9ded3;border-radius:16px;background:#f1faf7}.bank-transfer-notice h3{margin:4px 0 6px;color:var(--deep);font-size:16px}.bank-transfer-notice p,.bank-transfer-notice small{margin:0;color:var(--muted);font-size:12px;line-height:1.55}.bank-transfer-notice dl{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0}.bank-transfer-notice dl div{padding:10px;border-radius:10px;background:#fff}.bank-transfer-notice dt{color:var(--muted);font-size:10px}.bank-transfer-notice dd{margin:3px 0 0;color:var(--deep);font-weight:900;font-size:14px}
.membership-view{padding-bottom:calc(110px + env(safe-area-inset-bottom))}.membership-hero{padding:22px;border-radius:22px;background:linear-gradient(145deg,#087f70,#07534c);color:#fff;box-shadow:var(--shadow)}.membership-hero h3{margin:14px 0 8px;font-size:23px;letter-spacing:-.05em}.membership-hero p{margin:0;color:#d8f4ed;font-size:13px;line-height:1.65}.membership-hero .plan-badge{background:#dff8ef;color:#07534c}.membership-cta{width:100%;min-height:48px;margin-top:18px;border:0;border-radius:12px;background:#fff;color:#07534c;font-weight:900}.membership-card{margin-top:14px;padding:19px}.membership-card h3{margin:0 0 14px;font-size:16px}.membership-benefits{display:grid;grid-template-columns:1fr 1fr;gap:10px}.membership-benefits div{display:grid;gap:5px;padding:13px;border-radius:13px;background:var(--surface-subtle)}.membership-benefits b{font-size:13px}.membership-benefits span,.membership-company p{color:var(--muted);font-size:11px;line-height:1.55}.membership-bank{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 12px}.membership-bank div{padding:11px;border-radius:11px;background:var(--surface-subtle)}.membership-bank dt{color:var(--muted);font-size:10px}.membership-bank dd{margin:3px 0 0;font-size:14px;font-weight:900}.membership-company p{margin:0}
.account-tools a{padding:7px 9px;border:1px solid var(--line);border-radius:9px;color:var(--deep);font-size:11px;font-weight:900;text-decoration:none}
