:root {
  color-scheme: light;
  --bg: #f3efe6;
  --paper: #fffdf7;
  --paper-2: #f9f5ec;
  --ink: #1e2924;
  --muted: #6d746f;
  --line: #d9d3c7;
  --accent: #3f6755;
  --accent-2: #8f5e44;
  --accent-soft: #dce8df;
  --warn: #a26525;
  --danger: #9d3f3f;
  --shadow: 0 18px 50px rgba(45, 52, 47, .08);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 11px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141a17;
  --paper: #1d2521;
  --paper-2: #242e29;
  --ink: #edf2ed;
  --muted: #aab4ae;
  --line: #36413b;
  --accent: #9fc8b3;
  --accent-2: #ddb097;
  --accent-soft: #2b3e35;
  --warn: #e6ad67;
  --danger: #ef8e8e;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.app-shell { max-width: 1180px; margin: 0 auto; padding: 28px 28px 122px; }
.topbar { display:flex; gap:24px; justify-content:space-between; align-items:flex-start; margin-bottom:24px; }
.brand-block h1 { margin:3px 0 8px; font-family: "Songti SC", "STSong", serif; font-weight:700; font-size:clamp(30px, 4vw, 48px); letter-spacing:-.03em; }
.eyebrow { font-size:11px; letter-spacing:.2em; font-weight:750; color:var(--accent-2); text-transform:uppercase; }
.header-meta { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.header-actions { display:flex; gap:10px; align-items:center; padding-top:4px; }

.pill { display:inline-flex; align-items:center; min-height:28px; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.pill-soft { background:var(--paper); border:1px solid var(--line); color:var(--muted); }
.pill-good { background:var(--accent-soft); color:var(--accent); }
.pill-warn { background:color-mix(in srgb, var(--warn) 14%, transparent); color:var(--warn); }
.save-state { font-size:12px; color:var(--muted); }

button { border:0; cursor:pointer; }
.icon-btn, .secondary-btn, .primary-btn, .danger-btn, .ghost-btn, .small-btn {
  border-radius:999px;
  min-height:42px;
  padding:0 16px;
  border:1px solid var(--line);
  background:var(--paper);
  transition:transform .15s ease, background .15s ease, border-color .15s ease;
}
button:active { transform:scale(.98); }
.icon-btn { width:42px; padding:0; font-size:20px; }
.primary-btn { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:750; }
html[data-theme="dark"] .primary-btn { color:#122019; }
.secondary-btn { font-weight:700; }
.danger-btn { color:#fff; background:var(--danger); border-color:var(--danger); font-weight:700; }
.ghost-btn { background:transparent; }
.small-btn { min-height:34px; padding:0 11px; font-size:12px; font-weight:700; }
.full-width { width:100%; }

.day-tabs { display:flex; gap:8px; overflow-x:auto; padding:4px 0 12px; scrollbar-width:none; position:sticky; top:0; z-index:20; background:linear-gradient(var(--bg) 75%, transparent); }
.day-tabs::-webkit-scrollbar { display:none; }
.day-tab { white-space:nowrap; min-width:max-content; border:1px solid var(--line); background:var(--paper); border-radius:999px; padding:9px 14px; font-weight:760; font-size:13px; color:var(--muted); }
.day-tab.active { background:var(--ink); color:var(--paper); border-color:var(--ink); }

.day-view { margin-top:14px; }
.day-summary { background:var(--paper); border:1px solid var(--line); border-radius:var(--radius-lg); padding:28px; box-shadow:var(--shadow); margin-bottom:18px; overflow:hidden; position:relative; }
.day-summary::after { content:""; position:absolute; width:180px; height:180px; border:1px solid var(--line); border-radius:50%; right:-70px; top:-100px; opacity:.55; }
.day-kicker { font-size:12px; font-weight:800; letter-spacing:.12em; color:var(--accent-2); }
.day-summary h2 { margin:4px 0 4px; font-family:"Songti SC", "STSong", serif; font-size:clamp(26px, 3vw, 38px); }
.day-route { font-size:17px; color:var(--muted); margin-bottom:16px; }
.summary-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.weather-chip { display:inline-flex; align-items:center; gap:7px; background:var(--paper-2); border:1px solid var(--line); padding:8px 12px; border-radius:999px; font-size:13px; }
.weather-chip [contenteditable="true"] { min-width:60px; outline:none; border-bottom:1px dashed var(--accent); }

.group-card { margin:16px 0; }
.group-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:0 6px 8px; }
.group-heading h3 { margin:0; font-family:"Songti SC", "STSong", serif; font-size:20px; }
.group-add { display:none; }
.editing .group-add { display:inline-flex; }

.items-list { display:grid; gap:10px; min-height:2px; }
.trip-item { background:var(--paper); border:1px solid var(--line); border-radius:var(--radius-md); box-shadow:0 8px 28px rgba(45,52,47,.04); overflow:hidden; position:relative; }
.trip-item.dragging { opacity:.7; transform:scale(.99); box-shadow:0 22px 50px rgba(45,52,47,.16); }
.item-summary { width:100%; text-align:left; display:grid; grid-template-columns:minmax(72px, .8fr) minmax(0, 3fr) auto auto; gap:14px; align-items:center; padding:17px 18px; background:transparent; }
.item-time { font-weight:800; font-size:13px; color:var(--accent-2); font-variant-numeric:tabular-nums; }
.item-main { min-width:0; }
.item-title { font-weight:790; font-size:16px; line-height:1.3; }
.item-subtitle { margin-top:3px; color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-status { font-size:12px; font-weight:760; padding:5px 9px; border-radius:999px; background:var(--paper-2); color:var(--muted); white-space:nowrap; }
.item-status.pending { background:color-mix(in srgb, var(--warn) 14%, transparent); color:var(--warn); }
.item-status.done { background:var(--accent-soft); color:var(--accent); }
.chevron { width:22px; text-align:center; color:var(--muted); transition:transform .2s ease; }
.trip-item.open .chevron { transform:rotate(180deg); }

.item-detail { display:none; padding:0 18px 18px; border-top:1px solid transparent; }
.trip-item.open .item-detail { display:block; border-top-color:var(--line); padding-top:17px; }
.detail-list { display:grid; gap:10px; }
.detail-line { background:var(--paper-2); border-radius:12px; padding:11px 13px; font-size:14px; }
.detail-line[contenteditable="true"], .item-title[contenteditable="true"], .item-subtitle[contenteditable="true"], .item-time[contenteditable="true"] { outline:2px solid transparent; border-radius:6px; }
.editing [contenteditable="true"]:focus { outline-color:color-mix(in srgb, var(--accent) 45%, transparent); background:var(--paper-2); }
.detail-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.detail-meta { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; margin-top:16px; }
.editor-box { margin-top:16px; padding:14px; background:var(--paper-2); border:1px dashed var(--line); border-radius:14px; display:none; }
.editing .editor-box { display:block; }
.editor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.field-label { display:grid; gap:6px; font-size:12px; font-weight:750; color:var(--muted); }
input, textarea, select { width:100%; border:1px solid var(--line); border-radius:11px; background:var(--paper); color:var(--ink); padding:10px 11px; outline:none; }
textarea { min-height:86px; resize:vertical; }
input:focus, textarea:focus, select:focus { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.drag-handle { display:none; align-items:center; justify-content:center; cursor:grab; border:1px dashed var(--line); border-radius:10px; padding:5px 8px; color:var(--muted); font-size:12px; user-select:none; touch-action:none; }
.editing .drag-handle { display:inline-flex; }

.empty-day { border:1px dashed var(--line); border-radius:var(--radius-lg); background:color-mix(in srgb, var(--paper) 70%, transparent); padding:48px 24px; text-align:center; color:var(--muted); }
.empty-day .empty-icon { font-size:30px; }
.empty-day p { font-size:17px; }
.empty-actions { display:none; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:16px; }
.editing .empty-actions { display:flex; }

.utility-bar { position:fixed; z-index:40; left:50%; bottom:18px; transform:translateX(-50%); width:min(calc(100% - 28px), 640px); display:grid; grid-template-columns:repeat(5,1fr); gap:5px; padding:8px; background:color-mix(in srgb, var(--paper) 88%, transparent); border:1px solid var(--line); border-radius:20px; box-shadow:0 18px 55px rgba(20,30,24,.18); backdrop-filter:blur(18px); }
.utility-btn { background:transparent; border-radius:14px; padding:8px 5px; font-size:11px; font-weight:750; display:grid; gap:2px; place-items:center; position:relative; }
.utility-btn > span:first-child { font-size:18px; }
.utility-btn:hover { background:var(--paper-2); }
.badge { position:absolute; right:10px; top:5px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; display:grid; place-items:center; font-size:10px; color:#fff; background:#b7483f; border:2px solid var(--paper); }

.mobile-save-bar { position:fixed; z-index:50; left:0; right:0; bottom:0; padding:10px 14px calc(10px + var(--safe-bottom)); background:color-mix(in srgb, var(--paper) 94%, transparent); border-top:1px solid var(--line); backdrop-filter:blur(14px); }
body.mobile-saving .utility-bar { bottom:78px; }

.panel-dialog, .small-dialog { border:0; padding:0; background:transparent; color:var(--ink); }
.panel-dialog { width:min(880px, calc(100% - 24px)); max-height:min(82vh, 850px); }
.small-dialog { width:min(450px, calc(100% - 24px)); }
dialog::backdrop { background:rgba(10,15,12,.45); backdrop-filter:blur(4px); }
.dialog-shell, .small-dialog-card { background:var(--paper); border:1px solid var(--line); border-radius:24px; box-shadow:0 30px 90px rgba(0,0,0,.2); }
.dialog-shell { overflow:hidden; max-height:82vh; display:flex; flex-direction:column; }
.dialog-header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:20px 22px 14px; border-bottom:1px solid var(--line); }
.dialog-header h2, .small-dialog-card h2 { margin:3px 0 0; font-family:"Songti SC", "STSong", serif; }
.dialog-content { padding:20px 22px 28px; overflow:auto; }
.small-dialog-card { padding:24px; }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.muted { color:var(--muted); }
.inline-error { color:var(--danger); min-height:22px; margin-top:8px; font-size:13px; }

.tool-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; margin-bottom:14px; }
.tool-list { display:grid; gap:9px; }
.tool-row { border:1px solid var(--line); border-radius:14px; padding:14px; background:var(--paper-2); }
.tool-row-head { display:flex; gap:12px; justify-content:space-between; align-items:flex-start; }
.tool-row-title { font-weight:800; }
.tool-row-meta { color:var(--muted); font-size:12px; margin-top:4px; }
.tool-row-actions { display:flex; gap:7px; flex-wrap:wrap; margin-top:12px; }
.ticket-countdown { font-size:12px; font-weight:750; color:var(--warn); }
.check-row { display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center; border-bottom:1px solid var(--line); padding:11px 2px; }
.check-row:last-child { border-bottom:0; }
.check-row input[type="checkbox"] { width:20px; height:20px; accent-color:var(--accent); }
.check-row.done .check-text { text-decoration:line-through; color:var(--muted); }

.budget-table { width:100%; border-collapse:collapse; font-size:13px; }
.budget-table th, .budget-table td { border-bottom:1px solid var(--line); padding:10px 8px; text-align:left; vertical-align:top; }
.budget-table th { color:var(--muted); font-size:11px; letter-spacing:.06em; }
.budget-table td.num, .budget-table th.num { text-align:right; font-variant-numeric:tabular-nums; }
.budget-summary { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:16px; }
.metric { background:var(--paper-2); border-radius:14px; padding:14px; }
.metric b { display:block; margin-top:4px; font-size:22px; }
.optional-note { font-size:12px; color:var(--muted); margin-top:10px; }

.calendar-nav { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.calendar-dow { font-size:11px; color:var(--muted); text-align:center; padding:5px 0; }
.calendar-day { min-height:86px; border:1px solid var(--line); border-radius:12px; padding:7px; background:var(--paper-2); font-size:12px; }
.calendar-day.out { opacity:.35; }
.calendar-day .date-no { font-weight:800; }
.calendar-event { display:block; margin-top:5px; padding:4px 5px; border-radius:7px; background:var(--accent-soft); color:var(--accent); font-size:10px; font-weight:700; line-height:1.25; }
.calendar-event.done { opacity:.5; text-decoration:line-through; }

.history-row { display:flex; gap:12px; justify-content:space-between; align-items:center; }
.version-badge { font-variant-numeric:tabular-nums; font-weight:800; }

.toast { position:fixed; z-index:100; left:50%; bottom:112px; transform:translate(-50%, 18px); background:var(--ink); color:var(--paper); border-radius:999px; padding:10px 16px; font-size:13px; font-weight:700; opacity:0; pointer-events:none; transition:.2s ease; max-width:calc(100% - 32px); text-align:center; }
.toast.show { opacity:1; transform:translate(-50%,0); }

@media (max-width: 700px) {
  .app-shell { padding:20px 14px 124px; }
  .topbar { align-items:flex-start; margin-bottom:16px; }
  .brand-block h1 { font-size:31px; }
  .header-actions { gap:7px; }
  .secondary-btn { padding:0 13px; }
  .day-tabs { margin-left:-14px; margin-right:-14px; padding-left:14px; padding-right:14px; }
  .day-summary { padding:22px 18px; border-radius:20px; }
  .item-summary { grid-template-columns:1fr auto; gap:8px 10px; padding:15px 14px; }
  .item-time { grid-column:1; }
  .item-main { grid-column:1; }
  .item-status { grid-row:1 / span 2; grid-column:2; align-self:center; }
  .chevron { grid-column:2; justify-self:end; display:none; }
  .item-detail { padding-left:14px; padding-right:14px; }
  .detail-meta, .editor-grid { grid-template-columns:1fr; }
  .utility-bar { bottom:12px; width:calc(100% - 20px); border-radius:18px; }
  .utility-btn { font-size:10px; padding:7px 3px; }
  .badge { right:6px; }
  .budget-table { font-size:12px; }
  .budget-table th:nth-child(2), .budget-table td:nth-child(2) { display:none; }
  .calendar-day { min-height:70px; padding:5px; }
  .calendar-event { font-size:9px; }
}

@media (min-width: 701px) {
  .mobile-save-bar { display:none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior:auto !important; transition:none !important; }
}

/* ===== v1.3 mobile-first refinements ===== */
.access-logout { border:1px dashed var(--line); cursor:pointer; }
.item-category { display:inline-flex; align-items:center; gap:4px; margin-bottom:4px; font-size:11px; font-weight:800; color:var(--accent); letter-spacing:.02em; }
.timeline-section { margin:18px 0; }
.timeline-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:0 6px 9px; }
.timeline-heading h3 { margin:0; font-family:"Songti SC","STSong",serif; font-size:21px; }
.timeline-caption { color:var(--muted); font-size:12px; }
.timeline-list { display:grid; gap:10px; }
.timeline-addbar { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin:18px 0; }
.field-note { display:flex; align-items:center; min-height:42px; padding:10px 12px; border:1px dashed var(--line); border-radius:11px; color:var(--muted); font-size:12px; }
.quick-editable { cursor:text; }
.quick-pencil { color:var(--accent); font-weight:800; }
.compact-empty { padding:24px 18px; }
.compact-empty p { margin:6px 0; }
.tool-hint { margin:0 0 12px; padding:10px 12px; border-radius:12px; background:var(--paper-2); color:var(--muted); font-size:12px; }
.inline-hint { margin:0; padding:0; background:none; }

.budget-category-row { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 16px; }
.budget-chip { display:flex; gap:7px; align-items:center; padding:8px 11px; border:1px solid var(--line); border-radius:999px; background:var(--paper-2); font-size:12px; }
.budget-chip span { color:var(--muted); }
.budget-mobile { display:none; }
.budget-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--paper-2); }
.budget-card-main { min-width:0; display:grid; gap:4px; }
.budget-card-main b { font-size:14px; line-height:1.35; }
.budget-card-main span { color:var(--muted); font-size:11px; }
.budget-card-money { display:grid; justify-items:end; gap:1px; white-space:nowrap; }
.budget-card-money span { color:var(--muted); font-size:10px; }
.budget-card-money b { font-size:16px; font-variant-numeric:tabular-nums; }

.person-switch { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; padding:4px; margin-bottom:14px; background:var(--paper-2); border:1px solid var(--line); border-radius:999px; }
.person-tab { min-height:40px; border-radius:999px; background:transparent; font-weight:800; color:var(--muted); }
.person-tab.active { background:var(--ink); color:var(--paper); }
.packing-list { border-top:1px solid var(--line); }
.pack-actions { display:flex; gap:5px; }
.check-text[contenteditable="true"] { outline:none; border-radius:6px; padding:2px 4px; }
.check-text[contenteditable="true"]:focus { background:var(--paper-2); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 25%,transparent); }

.calendar-mobile { display:none; }
.calendar-mini-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
.calendar-mini-day { position:relative; aspect-ratio:1; min-width:0; padding:5px; border:1px solid var(--line); border-radius:11px; background:var(--paper-2); text-align:left; }
.calendar-mini-day.out { opacity:.32; }
.calendar-mini-day.selected { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); background:var(--accent-soft); }
.calendar-mini-day .date-no { font-size:12px; font-weight:850; }
.event-dot { position:absolute; left:7px; bottom:7px; width:6px; height:6px; border-radius:50%; background:var(--accent); }
.event-count { position:absolute; right:5px; top:4px; min-width:16px; height:16px; padding:0 4px; display:grid; place-items:center; border-radius:999px; background:var(--accent); color:var(--paper); font-size:9px; font-weight:800; }
.calendar-agenda { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.agenda-title { display:flex; justify-content:space-between; gap:12px; align-items:baseline; margin-bottom:9px; }
.agenda-title span { color:var(--muted); font-size:11px; }
.agenda-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; padding:11px 0; border-bottom:1px solid var(--line); }
.agenda-row > div { min-width:0; display:grid; gap:3px; }
.agenda-row b { font-size:13px; }
.agenda-row div span { color:var(--muted); font-size:11px; }
.agenda-empty { padding:18px 0; color:var(--muted); font-size:12px; text-align:center; }

@media (max-width: 700px) {
  .app-shell { padding:16px 12px 132px; }
  .topbar { flex-direction:column; gap:11px; align-items:stretch; margin-bottom:14px; }
  .brand-block { min-width:0; width:100%; }
  .brand-block h1 { margin:2px 0 8px; font-size:30px; line-height:1.18; white-space:nowrap; letter-spacing:-.045em; }
  .eyebrow { font-size:10px; }
  .header-meta { gap:6px; }
  .pill { min-height:30px; padding:4px 9px; font-size:11px; }
  .save-state { flex-basis:100%; font-size:11px; }
  .header-actions { width:100%; display:flex; align-items:center; gap:8px; padding-top:0; }
  .header-actions .icon-btn, .header-actions .secondary-btn, .header-actions .primary-btn { min-height:48px; height:48px; }
  .header-actions .icon-btn { width:48px; min-width:48px; }
  #editBtn { min-width:92px; flex:0 0 auto; }
  #undoBtn { flex:0 0 auto; }
  #desktopSaveBtn { display:none !important; }
  .access-logout { max-width:100%; }

  .day-tabs { margin-left:-12px; margin-right:-12px; padding:4px 12px 10px; gap:7px; }
  .day-tab { min-height:48px; padding:10px 17px; font-size:14px; }
  .day-view { margin-top:9px; }
  .day-summary { padding:21px 17px; border-radius:21px; margin-bottom:15px; }
  .day-summary::after { width:135px; height:135px; right:-50px; top:-78px; }
  .day-kicker { font-size:11px; }
  .day-summary h2 { font-size:28px; line-height:1.25; margin:7px 0 4px; }
  .day-route { font-size:14px; margin-bottom:13px; }
  .weather-chip { min-height:43px; padding:9px 12px; font-size:13px; }

  .timeline-heading { margin:0 4px 8px; }
  .timeline-heading h3 { font-size:20px; }
  .timeline-caption { font-size:11px; }
  .timeline-list { gap:9px; }
  .trip-item { border-radius:17px; }
  .item-summary { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; gap:6px 10px; padding:14px 14px 15px; align-items:start; }
  .item-time { grid-column:1; grid-row:1; font-size:12px; line-height:1.2; }
  .item-status { grid-column:2; grid-row:1; align-self:start; max-width:112px; overflow:hidden; text-overflow:ellipsis; font-size:11px; padding:5px 8px; }
  .item-main { grid-column:1 / -1; grid-row:2; min-width:0; }
  .item-category { margin-bottom:3px; font-size:10px; }
  .item-title { font-size:16px; line-height:1.35; overflow-wrap:anywhere; }
  .item-subtitle { margin-top:4px; font-size:12px; line-height:1.45; white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .chevron { display:none; }
  .item-detail { padding-left:13px; padding-right:13px; }
  .trip-item.open .item-detail { padding-top:13px; padding-bottom:14px; }
  .detail-line { padding:10px 11px; font-size:13px; line-height:1.65; }
  .detail-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .detail-actions > .small-btn, .detail-actions > a.small-btn, .detail-actions > .drag-handle { width:100%; min-height:40px; display:flex; justify-content:center; align-items:center; text-align:center; padding:7px 8px; }
  .detail-meta { grid-template-columns:1fr; gap:7px; }
  .editor-box { padding:12px; border-radius:13px; }
  .editor-grid { grid-template-columns:1fr; gap:9px; }
  .field-label { gap:5px; font-size:12px; }
  input, textarea, select { min-height:46px; border-radius:12px; padding:10px 11px; font-size:14px; }
  textarea { min-height:92px; }
  .cost-editor .editor-grid { padding:10px 0 2px; border-top:1px solid var(--line); }
  .timeline-addbar { justify-content:flex-start; }

  .utility-bar { width:calc(100% - 16px); bottom:8px; padding:7px; gap:3px; border-radius:19px; }
  .utility-btn { min-height:55px; font-size:10px; padding:6px 2px; border-radius:13px; }
  .utility-btn > span:first-child { font-size:18px; }
  .badge { right:4px; top:3px; }
  body.mobile-saving .utility-bar { bottom:78px; }
  .mobile-save-bar { padding:10px 12px calc(10px + var(--safe-bottom)); }
  .mobile-save-bar .primary-btn { min-height:52px; font-size:16px; }

  .panel-dialog { width:calc(100% - 12px); max-height:90dvh; }
  .dialog-shell { max-height:90dvh; border-radius:22px; }
  .dialog-header { padding:15px 16px 12px; min-height:82px; }
  .dialog-header h2 { font-size:27px; line-height:1.1; }
  .dialog-header .icon-btn { width:46px; min-width:46px; height:46px; }
  .dialog-content { padding:14px 14px calc(22px + var(--safe-bottom)); }
  .small-dialog-card { padding:20px; border-radius:22px; }
  .tool-toolbar { align-items:stretch; gap:8px; }
  .ticket-toolbar { display:grid; grid-template-columns:1fr; }
  .ticket-toolbar .primary-btn { width:100%; min-height:44px; }
  .tool-row { padding:13px; border-radius:14px; }
  .tool-row-head { gap:8px; }
  .tool-row-title { font-size:14px; line-height:1.35; }
  .tool-row-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .tool-row-actions .small-btn { min-height:40px; padding:6px 8px; white-space:normal; }

  .budget-summary { gap:8px; margin-top:2px; }
  .metric { padding:13px 12px; border-radius:14px; }
  .metric span { font-size:11px; }
  .metric b { font-size:22px; line-height:1.2; }
  .budget-category-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin:12px 0 14px; }
  .budget-chip { min-width:0; display:grid; gap:1px; border-radius:13px; padding:9px 10px; }
  .budget-chip b { font-size:12px; }
  .budget-chip span { font-size:11px; white-space:nowrap; }
  .budget-desktop { display:none; }
  .budget-mobile { display:grid; gap:8px; }
  .budget-card { grid-template-columns:minmax(0,1fr) auto; gap:9px; padding:12px; }
  .budget-card-main b { font-size:13px; overflow-wrap:anywhere; }
  .budget-card-main span { font-size:10px; }
  .budget-card-money b { font-size:15px; }
  .optional-note { font-size:11px; line-height:1.55; }

  .calendar-desktop { display:none; }
  .calendar-mobile { display:block; }
  .calendar-nav { margin-bottom:10px; }
  .calendar-nav .small-btn { min-height:38px; padding:0 10px; }
  .calendar-nav b { font-size:15px; }
  .calendar-mini-grid { gap:4px; }
  .calendar-dow { padding:3px 0; font-size:10px; }
  .calendar-mini-day { border-radius:10px; padding:5px; }
  .calendar-mini-day .date-no { font-size:11px; }
  .event-dot { left:6px; bottom:6px; width:5px; height:5px; }
  .event-count { right:4px; top:4px; min-width:14px; height:14px; font-size:8px; }
  .calendar-agenda { margin-top:12px; padding-top:12px; }
  .agenda-row { padding:10px 0; }
  .calendar-export { display:block; margin-top:14px; }
  .calendar-export .primary-btn { width:100%; min-height:48px; }

  .person-switch { margin-bottom:12px; }
  .person-tab { min-height:42px; font-size:13px; }
  .packing-toolbar { display:flex; align-items:center; }
  .check-row { grid-template-columns:auto minmax(0,1fr) auto; gap:8px; padding:11px 0; }
  .check-row input[type="checkbox"] { width:22px; height:22px; }
  .check-text { min-width:0; font-size:14px; overflow-wrap:anywhere; }
  .pack-actions .small-btn { min-height:36px; padding:0 9px; }

  .toast { bottom:104px; font-size:12px; }
}

@media (min-width: 701px) {
  .calendar-desktop { display:block; }
  .calendar-mobile { display:none; }
  .budget-desktop { display:block; }
  .budget-mobile { display:none; }
}
