:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #f0f2ee;
  --text: #1c211d;
  --muted: #5d665f;
  --line: #e1e5df;
  --accent: #0f8a5f;
  --accent-strong: #0b6e4b;
  --accent-soft: #dff3e9;
  --break-bg: #eaf7f0;
  --holiday: #d93a3a;
  --sat: #2f6fd1;
  --blocked: #9aa29c;
  --warn-bg: #fff6e0;
  --warn-text: #7a5300;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111513; --surface: #1a1f1c; --surface-2: #232925; --text: #e8ece9; --muted: #9ba59e;
    --line: #2d3430; --accent: #2fb07f; --accent-strong: #5fd6a6; --accent-soft: #173a2c; --break-bg: #15291f;
    --holiday: #ff7070; --sat: #7aa7ff; --blocked: #6b736d; --warn-bg: #3a2f14; --warn-text: #f3d48a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111513; --surface: #1a1f1c; --surface-2: #232925; --text: #e8ece9; --muted: #9ba59e;
  --line: #2d3430; --accent: #2fb07f; --accent-strong: #5fd6a6; --accent-soft: #173a2c; --break-bg: #15291f;
  --holiday: #ff7070; --sat: #7aa7ff; --blocked: #6b736d; --warn-bg: #3a2f14; --warn-text: #f3d48a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent-strong); }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.site-header { padding: 18px 0 6px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; text-decoration: none; color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 16px; }
.brand small { font-weight: 600; font-size: 13px; color: var(--muted); }

.hero { padding: 18px 0 8px; }
.hero h1 { font-size: clamp(26px, 6vw, 36px); line-height: 1.25; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
.hero p.trust { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--accent-strong); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.card h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: -0.01em; }
.card h2 small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 6px; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.field-help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto; min-height: 44px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 14px;
}
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg button:focus-visible, .btn:focus-visible, .stepper button:focus-visible, .day:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 22px; font-weight: 700; cursor: pointer;
}
.stepper output { min-width: 84px; text-align: center; font-size: 28px; font-weight: 800; }
.stepper output span { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 2px; }
details.adv { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 4px; }
details.adv summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
details.adv[open] summary { margin-bottom: 12px; }
.inline-add { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.inline-add input[type="date"] { flex: 1 1 160px; min-height: 44px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; border: 1px solid var(--line); }
.chip button { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 6px 8px; margin: -4px -2px -4px 0; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
@media (min-width: 560px) { .actions { grid-template-columns: repeat(4, 1fr); } }

.summary .big { font-size: clamp(26px, 7vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin: 0; }
.summary .big b { color: var(--accent); }
.summary-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.mode-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-text); font-size: 13px; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mode-note[hidden] { display: none; }

.breaks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.break { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--break-bg); }
.break-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.break-range { font-weight: 800; font-size: 17px; }
.break-len { font-weight: 800; color: var(--accent-strong); white-space: nowrap; }
.break-meta { margin-top: 6px; font-size: 13px; color: var(--muted); }
.leave-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.leave-chip { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0 0; margin: 0; }

.deals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.deal { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.deal-main { min-width: 0; }
.deal-title { font-weight: 700; font-size: 15px; }
.deal-sub { font-size: 13px; color: var(--muted); }
.deal-eff { font-weight: 800; color: var(--accent-strong); font-size: 12px; background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.deal .btn { white-space: nowrap; flex: none; }
.deal.used { opacity: .55; }

.cal-tools { margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--line); }
.legend .lg-leave { background: var(--accent); border-color: var(--accent); }
.legend .lg-break { background: var(--break-bg); }
.legend .lg-hol { background: transparent; border-color: var(--holiday); }
.legend .lg-block { background: repeating-linear-gradient(45deg, var(--blocked) 0 2px, transparent 2px 5px); }
.months { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 620px) { .months { grid-template-columns: 1fr 1fr; } }
.month h3 { font-size: 15px; margin: 0 0 6px; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dow { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; font-weight: 700; }
.dow.sun { color: var(--holiday); }
.dow.sat { color: var(--sat); }
.day {
  position: relative; min-height: 40px; border-radius: 9px; border: 0; background: transparent;
  font-size: 13px; font-weight: 600; display: grid; place-items: center; padding: 0; cursor: default; color: var(--text);
}
.day.pad { visibility: hidden; }
.day.sat { color: var(--sat); }
.day.sun, .day.hol, .day.extra { color: var(--holiday); }
.day.hol::after { content: ""; position: absolute; bottom: 4px; left: 50%; margin-left: -2px; width: 4px; height: 4px; border-radius: 50%; background: var(--holiday); }
.day.in-break { background: var(--break-bg); }
.day.leave { background: var(--accent); color: #fff; }
.day.leave::after { background: #fff; }
.day.out { opacity: .3; }
.day.blocked { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--blocked) 45%, transparent) 0 2px, transparent 2px 6px); color: var(--muted); }
.day.tappable { cursor: pointer; }
.day.tappable:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.day.today { box-shadow: inset 0 0 0 2px var(--text); }

.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.site-footer { padding: 24px 0 48px; color: var(--muted); font-size: 13px; }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 4px 0; }

.doc h1 { font-size: 26px; margin: 12px 0; }
.doc h2 { font-size: 18px; margin: 24px 0 8px; }
.doc p, .doc li { font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 10; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.strategy-field { margin-bottom: 16px; }
details.adv summary span { font-weight: 600; color: var(--accent-strong); margin-left: 4px; }
.field-label small { font-weight: 600; color: var(--muted); }
@media (max-width: 480px) {
  .hero { padding-top: 8px; }
  .hero h1 { margin-bottom: 6px; }
  .card { padding: 16px; margin: 12px 0; }
  .field { margin-bottom: 14px; }
}

.img-dialog { border: 0; border-radius: 18px; padding: 16px; max-width: min(420px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow); text-align: center; }
.img-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.img-dialog p { margin: 0 0 10px; font-weight: 700; font-size: 14px; }
.img-dialog img { width: 100%; height: auto; border-radius: 12px; display: block; margin-bottom: 12px; -webkit-touch-callout: default; }
.doc code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
