:root {
  --page: #fff;
  --field: #c8ced5;
  --error: #a52b2b;
  --ink: #20252b;
  --muted: #626a73;
  --line: #e4e7eb;
  --surface: #f6f7f9;
  --accent: #214f78;
  --accent-bg: #eaf1f8;
  color: var(--ink);
  background: var(--page);
  font-family: system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #226fb6; outline-offset: 2px; }
.frame { width: min(960px, calc(100% - 40px)); margin-inline: auto; }
.top { margin-top: 28px; }
.top h1 { margin: 0; font-size: clamp(27px, 4vw, 36px); font-weight: 750; letter-spacing: -.055em; line-height: 1.17; }
.trip-date { margin: 7px 0 14px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.trip-date span { padding: 0 3px; }
.nav { display: flex; flex-wrap: wrap; column-gap: 17px; border-bottom: 1px solid var(--line); }
.nav a { padding: 9px 2px 10px; font-size: 14px; font-weight: 620; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
main { padding-top: 20px; }
.panel { margin: 0 0 14px; }
.heading { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; }
.section-title { margin: 0; font-size: 20px; font-weight: 740; letter-spacing: -.04em; }
.heading p, .small { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 4px 0 0; }
.schedule-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.schedule-top .heading { margin: 0; }
.schedule-actions { display: flex; align-items: center; gap: 6px; }
.schedule-button { padding: 6px 9px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-size: 13px; font-weight: 650; white-space: nowrap; }
.view-toggle { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); background: var(--surface); }
.view-toggle button, .time-jump button { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; font-size: 13px; font-weight: 630; }
.view-toggle button[aria-pressed="true"] { color: var(--accent); background: var(--page); box-shadow: 0 0 0 1px var(--line); }
.day-picker { display: grid; grid-template-columns: repeat(var(--visible-days), minmax(0, 1fr)); gap: 5px; margin-bottom: 14px; }
.day-btn { border: 1px solid var(--line); background: var(--page); color: var(--ink); min-width: 0; text-align: center; padding: 9px 4px; }
.day-btn strong, .day-btn small { display: block; white-space: nowrap; }
.day-btn strong { font-size: 14px; }
.day-btn small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.day-btn[aria-pressed="true"] { background: var(--accent-bg); border-color: #b8cce0; color: var(--accent); }
.day-btn:hover:not([aria-pressed="true"]) { background: var(--surface); }
.timeline { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.event { border-bottom: 1px solid var(--line); }
.event-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-note { margin: 14px 0; color: var(--muted); font-size: 14px; }
.event-card, .place-card { width: 100%; text-align: left; color: var(--ink); min-width: 0; }
.event-card { display: grid; grid-template-columns: 94px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 52px; border: 0; background: var(--page); padding: 9px 6px; }
.event-card:hover, .place-card:hover { background: var(--surface); }
.event-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.event-head b { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.event-card .event-head b { font-size: 15px; }
.event-card .event-head b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--bar); border: 1px solid var(--bar-line); vertical-align: 1px; }
.cue { color: var(--muted); font-size: 18px; flex: none; }
.flight-row b { color: var(--accent); }
.flight-card { padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.flight-date { margin: 0 0 4px; color: var(--accent); font-size: 13px; font-weight: 680; }
.flight-clock { margin: 0 0 7px; font-size: 22px; font-weight: 760; font-variant-numeric: tabular-nums; }
.flight-clock small { margin-left: 5px; color: var(--muted); font-size: 13px; font-weight: 620; }
.flight-checks { list-style: none; margin: 0; padding: 0; }
.flight-checks li { display: grid; grid-template-columns: 55px 1fr; gap: 7px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.flight-checks b { font-variant-numeric: tabular-nums; }
.controls { display: flex; gap: 7px; margin: 0 0 10px; }
.controls input, .controls select { min-width: 0; border: 1px solid var(--field); border-radius: 6px; padding: 7px 9px; background: var(--page); color: var(--ink); font-size: 13px; }
.controls input { flex: 1; }
.places-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.place-card { border: 1px solid var(--line); background: var(--page); border-radius: 6px; padding: 7px 9px; }
.place-card small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.budget { width: min(100%, 520px); border-top: 1px solid var(--line); margin-bottom: 24px; }
.budget-row { display: grid; grid-template-columns: minmax(82px, 1fr) minmax(92px, 135px) 60px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.budget-row label, .budget-row strong { font-size: 14px; font-weight: 650; }
.budget-fixed-amount { text-align: right; padding: 9px 8px; font-size: 16px; font-variant-numeric: tabular-nums; }
.budget-fixed-label { text-align: center; color: var(--muted); font-size: 12px; }
.budget-row input, .budget-row select { width: 100%; min-width: 0; min-height: 38px; padding: 5px 8px; border: 1px solid var(--field); border-radius: 0; background: var(--page); color: var(--ink); font-size: 16px; }
.budget-row input { text-align: right; font-variant-numeric: tabular-nums; }
.budget-row input:invalid { border-color: var(--error); }
.budget-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; padding: 11px 10px; background: var(--accent-bg); font-size: 14px; }
.budget-total output { font-size: 16px; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.budget-error { color: var(--error); }
.price-list { margin: 0; }
.price-list div { border-bottom: 1px solid var(--line); padding: 7px 0; }
.price-list dt { font-weight: 690; font-size: 14px; }
.price-list dd { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.precautions, .schedule-form input:not([type="radio"]), .schedule-form select, .schedule-form textarea { display: block; width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--field); border-radius: 0; background: var(--page); color: var(--ink); font-size: 16px; }
.precautions { max-width: 640px; resize: vertical; line-height: 1.6; }
dialog { width: min(490px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); max-height: 85vh; }
dialog::backdrop { background: #242c3470; }
.dialog-inner { position: relative; padding: 17px; overflow-wrap: anywhere; }
.dialog-inner h2 { margin: 0 32px 8px 0; font-size: 20px; letter-spacing: -.035em; }
.close { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border: 0; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 21px; line-height: 1; }
.dialog-inner dl { margin: 11px 0 0; font-size: 13px; }
.dialog-inner dl div { display: grid; grid-template-columns: 60px 1fr; gap: 7px; padding: 6px 0; border-top: 1px solid var(--line); }
.dialog-inner dt { font-weight: 690; }
.dialog-inner dd { margin: 0; line-height: 1.5; }
.detail-note { white-space: pre-wrap; }
.schedule-form { display: grid; gap: 10px; font-size: 13px; }
.schedule-form label { min-width: 0; }
.schedule-form input:not([type="radio"]), .schedule-form select, .schedule-form textarea { margin-top: 4px; }
.schedule-times, .schedule-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.schedule-colors { min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 4px 0 0; border: 0; }
.schedule-colors legend { padding: 0; }
.schedule-colors label { display: flex; align-items: center; padding: 4px 2px; background: var(--bar); color: var(--bar-ink); border: 1px solid var(--bar-line); cursor: pointer; }
.schedule-colors input { accent-color: var(--bar-ink); }
.schedule-form .actions { margin-top: 0; }
.form-error { color: var(--error); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.actions a { text-decoration: none; font-size: 13px; font-weight: 680; padding: 7px 9px; border-radius: 6px; background: var(--surface); color: var(--ink); }
.actions .primary { color: var(--accent); background: var(--accent-bg); }
.calendar-guide { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 6px; }
.calendar-guide .small { margin: 0; }
.scroll-hint { display: none; }
.time-jump { display: flex; gap: 3px; flex: none; margin-inline-start: auto; }
.time-jump button { background: var(--surface); padding: 4px 6px; font-variant-numeric: tabular-nums; font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 9px; margin: 0 0 7px; }
.legend span { color: var(--muted); font-size: 11px; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border: 1px solid var(--bar-line); border-radius: 2px; background: var(--bar); }
.air { --bar: #e4eee7; --bar-line: #739780; --bar-ink: #284c37; }
.transit { --bar: #e4edf6; --bar-line: #7997b4; --bar-ink: #244761; }
.food { --bar: #f6edda; --bar-line: #a88a53; --bar-ink: #5d4320; }
.visit { --bar: #eee8f6; --bar-line: #9a83b2; --bar-ink: #4a3561; }
.free { --bar: #eff0f1; --bar-line: #929aa1; --bar-ink: #414a53; }
.matrix-scroll { max-height: 68vh; overflow: auto; overscroll-behavior-x: contain; border: 1px solid var(--field); }
.matrix { display: grid; grid-template-columns: 54px repeat(var(--visible-days), minmax(150px, 1fr)); min-width: calc(54px + 150px * var(--visible-days)); }
.matrix-time, .matrix-date { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--field); border-right: 1px solid var(--line); padding: 6px 9px; font-size: 14px; }
.matrix-time { left: 0; z-index: 6; display: grid; place-items: center; font-weight: 730; }
.matrix-date small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.time-axis, .day-lane { height: var(--lane-height); position: relative; box-shadow: inset -1px 0 var(--line); }
.time-axis { position: sticky; left: 0; z-index: 3; background-color: var(--surface); }
.time-tick { position: absolute; width: 100%; text-align: center; padding-top: 4px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hour-tick { color: var(--ink); font-weight: 730; }
.calendar-bar { position: absolute; inset-inline: 0; border: 1px solid var(--bar-line); border-radius: 0; background: var(--bar); color: var(--bar-ink); text-align: left; padding: 3px 6px; overflow: hidden; display: flex; flex-direction: column; align-items: start; justify-content: center; }
.calendar-bar span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 690; line-height: 1.15; overflow-wrap: anywhere; }
.calendar-bar small { font-size: 11px; margin-top: 2px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calendar-bar.short { padding-block: 0; }
.calendar-bar.short span { display: block; width: 100%; white-space: nowrap; text-overflow: ellipsis; }
.calendar-bar.short span { font-size: 11px; }
.calendar-bar.short small { font-size: 9px; margin-top: 0; }
.calendar-bar:hover, .calendar-bar:focus-visible { z-index: 2; box-shadow: inset 0 0 0 1px var(--bar-line); }
.calendar-bar:focus-visible { outline-offset: -3px; }
@media (max-width: 844px) { .scroll-hint { display: inline; } }
@media (max-width: 560px) {
  .frame { width: calc(100% - 28px); }
  .top { margin-top: 18px; }
  main { padding-top: 14px; }
  .nav { gap: 15px; }
  .nav a { font-size: 13px; }
  .day-btn small { font-size: 11px; }
  .event-card { grid-template-columns: 84px minmax(0, 1fr); gap: 5px; }
  .event-time { font-size: 12px; }
  .calendar-guide .small { font-size: 11px; }
  .places-grid { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: 43px repeat(var(--visible-days), minmax(150px, 1fr)); min-width: calc(43px + 150px * var(--visible-days)); }
}

html, .matrix-scroll { scrollbar-width: none; }
html::-webkit-scrollbar, .matrix-scroll::-webkit-scrollbar { display: none; }
.rest { --bar: #e7ebf4; --bar-line: #8c9bb4; --bar-ink: #30415c; }

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.schedule-search { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.schedule-search span { flex: none; }
.schedule-search input { width: min(100%, 280px); min-width: 0; min-height: 38px; padding: 7px 9px; border: 1px solid var(--field); border-radius: 0; background: var(--page); color: var(--ink); font-size: 16px; }
dialog { background: var(--page); }
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #15191f;
  --surface: #20262e;
  --ink: #e8edf3;
  --muted: #adb8c6;
  --line: #34404c;
  --field: #556474;
  --accent: #aae0fc;
  --accent-bg: #253d50;
  --error: #ffabab;
}
[data-theme="dark"] :focus-visible { outline-color: #aae0fc; }
[data-theme="dark"] dialog::backdrop { background: #07090dc9; }
[data-theme="dark"] .air { --bar: #233b32; --bar-line: #52816b; --bar-ink: #d1f1df; }
[data-theme="dark"] .transit { --bar: #243a51; --bar-line: #597b9c; --bar-ink: #d8eaff; }
[data-theme="dark"] .food { --bar: #483721; --bar-line: #907344; --bar-ink: #ffe7bd; }
[data-theme="dark"] .visit { --bar: #3b2e49; --bar-line: #83699c; --bar-ink: #f2dfff; }
[data-theme="dark"] .free { --bar: #303943; --bar-line: #64717e; --bar-ink: #e1e7ef; }
[data-theme="dark"] .rest { --bar: #2b354b; --bar-line: #64779a; --bar-ink: #dfe8ff; }

.budget-panel { max-width: 640px; margin-bottom: 32px; }
.budget-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 14px; }
.budget-picker .day-btn { border-right-width: 0; font-size: .875rem; min-height: 42px; }
.budget-picker .day-btn:last-child { border-right-width: 1px; }
.budget-picker .day-btn[aria-pressed="true"] { border-color: var(--line); box-shadow: inset 0 -2px var(--accent); }
.budget { width: 100%; }
.budget-total { padding: 16px; }
.budget-total output { font-size: clamp(1rem, 4vw, 1.5rem); }
.budget-days { margin: 0; }
.budget-days > div { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.budget-days small { color: var(--muted); margin-left: 6px; }
.budget-days dd { margin: 0; font-variant-numeric: tabular-nums; }
.budget-label { font-size: .875rem; color: var(--muted); margin: 22px 0 6px; }
.nav a { min-height: 42px; }

.place-expense { margin: 16px 0 12px; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.place-expense h3 { margin: 0 0 8px; font-size: .95rem; }
.place-expense h3 small, [data-category-total] { color: var(--accent); font-size: .875rem; }
.place-expense-fields { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; }
.place-expense-fields input, .place-expense-fields select { min-width: 0; min-height: 40px; padding: 5px; border: 1px solid var(--field); border-radius: 0; background: var(--page); color: var(--ink); }
.place-expense p:empty { display: none; }
[data-category-total] { display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }
.budget-days dd { white-space: nowrap; }
.budget-days > div { gap: 8px; }

.budget-places { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.budget-places button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; min-height: 44px; border: 0; border-bottom: 1px solid var(--line); background: var(--page); color: var(--ink); text-align: left; }
.budget-places button:hover { background: var(--surface); }
.budget-places b { white-space: nowrap; color: var(--accent); }
.schedule-expense { min-width: 0; border: 1px solid var(--line); padding: 8px; }
.schedule-expense .place-expense-fields { grid-template-columns: minmax(0, 1fr) auto; }
.schedule-expense .place-expense-fields > * { margin-top: 0; }

.event-head .transport-fare { margin-inline-start: auto; white-space: nowrap; font-weight: 700; }
.calendar-bar small .transport-fare { display: inline; font: inherit; font-weight: 700; }
.calendar-bar small .transport-fare::before { content: " · "; }
.transport-fare[hidden], .calendar-bar small .transport-fare[hidden] { display: none; }
