:root {
  --paper: #efe2c6;
  --paper-light: #f8f0df;
  --paper-deep: #dcc69e;
  --ink: #172b32;
  --ink-soft: #586367;
  --vermillion: #a6402d;
  --vermillion-dark: #7e2d20;
  --moss: #536b53;
  --ochre: #b77931;
  --blue-wash: #d9e1dc;
  --white: #fffdf7;
  --danger: #a33a32;
  --shadow: 0 18px 50px rgba(55, 39, 18, .12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --nav-height: 82px;
  color-scheme: light;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 13% 21%, rgba(84, 57, 25, .045) 0 .6px, transparent .8px),
    radial-gradient(circle at 72% 63%, rgba(255, 255, 255, .34) 0 .7px, transparent .9px),
    linear-gradient(96deg, transparent 0 49.5%, rgba(80, 57, 25, .018) 50%, transparent 50.5%);
  background-size: 7px 9px, 11px 13px, 100% 100%;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(166, 64, 45, .35);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .48; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, .serif {
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(330px, .95fr) minmax(430px, 1.05fr);
  overflow: hidden;
}

.auth-story {
  position: relative;
  min-height: 100vh;
  padding: clamp(34px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--paper-light);
  background: var(--ink);
  overflow: hidden;
}

.auth-story::after {
  content: "";
  position: absolute;
  inset: 8% -18% auto auto;
  width: min(70vw, 720px);
  aspect-ratio: 1;
  border: 1px solid rgba(239, 226, 198, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 76px rgba(239, 226, 198, .025), 0 0 0 155px rgba(239, 226, 198, .018);
}

.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50% 48% 51% 45%; background: var(--vermillion); color: white;
  font-family: "Songti SC", serif; font-size: 22px; font-weight: 700;
  transform: rotate(-5deg); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.brand-name { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 22px; font-weight: 700; letter-spacing: .08em; }
.brand-note { display: block; font-size: 12px; opacity: .62; margin-top: 2px; }

.auth-copy { position: relative; z-index: 1; max-width: 610px; margin: 9vh 0 6vh; }
.auth-copy h1 { font-size: clamp(44px, 6vw, 78px); line-height: 1.08; letter-spacing: -.055em; margin-bottom: 26px; }
.auth-copy p { max-width: 500px; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.8; color: rgba(248, 240, 223, .73); }
.route-sketch { position: relative; z-index: 1; width: min(560px, 100%); height: 150px; }
.route-sketch svg { width: 100%; height: 100%; overflow: visible; }
.route-path { fill: none; stroke: var(--paper-deep); stroke-width: 2; stroke-dasharray: 5 8; }
.route-dot { fill: var(--vermillion); stroke: var(--ink); stroke-width: 4; }
.route-label { font-size: 12px; fill: rgba(248, 240, 223, .72); }

.auth-panel { padding: clamp(26px, 6vw, 84px); display: grid; place-items: center; }
.auth-card { width: min(480px, 100%); }
.auth-card h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; margin-bottom: 10px; }
.lede { color: var(--ink-soft); line-height: 1.7; margin-bottom: 28px; }
.method-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; background: rgba(23,43,50,.07); border-radius: 12px; margin-bottom: 24px; }
.method-tab { min-height: 46px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700; }
.method-tab.active { background: var(--white); color: var(--vermillion-dark); box-shadow: 0 2px 10px rgba(37,30,16,.08); }

.field { display: grid; gap: 8px; margin-bottom: 17px; }
.field label, .field-label { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select, .inline-input {
  width: 100%; border: 1px solid rgba(23,43,50,.21); border-radius: var(--radius-sm);
  background: rgba(255,253,247,.72); color: var(--ink); padding: 12px 14px; min-height: 46px;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus, .inline-input:focus { border-color: var(--vermillion); background: var(--white); outline: 3px solid rgba(166,64,45,.13); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help { font-size: 12px; color: var(--ink-soft); line-height: 1.55; }

.btn { border: 0; border-radius: 9px; min-height: 44px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 700; transition: transform .15s ease, background-color .15s ease, color .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary { background: var(--vermillion); color: white; box-shadow: 0 8px 20px rgba(166,64,45,.2); }
.btn-primary:hover:not(:disabled) { background: var(--vermillion-dark); }
.btn-secondary { background: var(--ink); color: var(--paper-light); }
.btn-ghost { border: 1px solid rgba(23,43,50,.18); background: rgba(255,253,247,.38); }
.btn-quiet { min-height: 36px; padding: 7px 10px; border: 0; background: transparent; color: var(--ink-soft); }
.btn-danger { color: var(--danger); border: 1px solid rgba(163,58,50,.25); background: rgba(255,255,255,.2); }
.btn-wide { width: 100%; }
.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; color: var(--ink-soft); font-size: 12px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: rgba(23,43,50,.15); }
.prototype-note { margin-top: 24px; padding: 15px 17px; border-left: 3px solid var(--ochre); background: rgba(183,121,49,.08); color: var(--ink-soft); font-size: 12px; line-height: 1.65; }

.app-shell { min-height: 100vh; padding-bottom: calc(var(--nav-height) + 30px); }
.topbar {
  height: 76px; padding: 0 clamp(18px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(23,43,50,.13); background: rgba(239,226,198,.86); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20;
}
.topbar .brand-mark { width: 34px; height: 34px; font-size: 18px; }
.topbar .brand-name { font-size: 19px; }
.topbar-meta { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 13px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper-light); font-family: "Songti SC", serif; font-weight: 700; }

.workspace { width: min(1440px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 54px); }
.page-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-title { margin: 0; font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -.045em; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.bottom-nav {
  position: fixed; z-index: 40; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(590px, calc(100% - 28px)); height: var(--nav-height); padding: 8px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  background: rgba(23,43,50,.94); backdrop-filter: blur(18px); border-radius: 22px;
  box-shadow: 0 18px 40px rgba(23,43,50,.28); border: 1px solid rgba(255,255,255,.1);
}
.nav-item { position: relative; border: 0; border-radius: 15px; background: transparent; color: rgba(248,240,223,.61); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; }
.nav-item.active { color: var(--white); background: rgba(248,240,223,.1); }
.nav-item.active::before { content: ""; position: absolute; top: 5px; width: 18px; height: 3px; border-radius: 3px; background: var(--vermillion); }
.nav-item .icon { width: 22px; height: 22px; }

.paper-card { background: rgba(255,253,247,.69); border: 1px solid rgba(23,43,50,.13); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(57,42,20,.055); }
.empty-state { min-height: 390px; padding: 54px 28px; display: grid; place-items: center; text-align: center; }
.empty-inner { max-width: 440px; }
.empty-illustration { width: 132px; height: 132px; margin: 0 auto 26px; border: 1px dashed rgba(23,43,50,.3); border-radius: 50%; display: grid; place-items: center; transform: rotate(-3deg); }
.empty-illustration .icon { width: 52px; height: 52px; color: var(--vermillion); }
.empty-state h2 { font-size: 28px; margin-bottom: 12px; }
.empty-state p { color: var(--ink-soft); line-height: 1.7; margin-bottom: 24px; }

.plan-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.book-shelf { position: sticky; top: 100px; padding: 12px; }
.book-shelf-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 14px; }
.book-shelf-head h2 { margin: 0; font-size: 18px; }
.book-list { display: grid; gap: 7px; }
.book-list-row { position: relative; min-width: 0; }
.book-item { width: 100%; border: 0; border-radius: 10px; background: transparent; padding: 13px 46px 13px 13px; cursor: pointer; text-align: left; display: grid; grid-template-columns: 4px 1fr; gap: 12px; }
.book-item::before { content: ""; border-radius: 4px; background: transparent; }
.book-item.active { background: rgba(23,43,50,.07); }
.book-item.active::before { background: var(--vermillion); }
.book-item strong { display: block; font-size: 14px; margin-bottom: 5px; }
.book-item span { color: var(--ink-soft); font-size: 12px; }
.book-item-delete {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  color: rgba(88,99,103,.66);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}
.book-item-delete .icon { width: 16px; height: 16px; }
.book-item-delete:hover { color: var(--danger); background: rgba(163,58,50,.09); }
.book-item-delete:focus-visible { color: var(--danger); outline: 2px dashed var(--danger); outline-offset: 2px; }
.shelf-add { width: 44px; height: 44px; min-width: 44px; min-height: 44px; aspect-ratio: 1; flex: 0 0 44px; padding: 0; border-radius: 50%; }

.book-workspace { min-width: 0; }
.book-cover { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 46px); background: var(--ink); color: var(--paper-light); border-radius: var(--radius-lg); margin-bottom: 18px; }
.book-cover::after { content: ""; position: absolute; width: 240px; height: 240px; border: 1px solid rgba(239,226,198,.12); border-radius: 50%; right: -70px; top: -86px; box-shadow: 0 0 0 40px rgba(239,226,198,.025), 0 0 0 80px rgba(239,226,198,.018); }
.book-cover-main { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; }
.book-cover h2 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.035em; margin-bottom: 10px; }
.book-cover p { color: rgba(248,240,223,.68); line-height: 1.7; margin-bottom: 0; max-width: 660px; }
.book-stamp { width: 98px; height: 98px; padding: 8px; border: 2px solid var(--vermillion); color: #e37963; border-radius: 48% 52% 45% 55%; display: grid; place-items: center; text-align: center; font-family: "Songti SC", serif; font-size: 12px; line-height: 1.4; transform: rotate(5deg); }
.book-meta { position: relative; z-index: 1; display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(248,240,223,.13); color: rgba(248,240,223,.78); font-size: 13px; }
.book-meta span { display: inline-flex; align-items: center; gap: 7px; }

.subnav { display: flex; gap: 5px; overflow-x: auto; padding: 5px; margin-bottom: 18px; background: rgba(255,253,247,.42); border: 1px solid rgba(23,43,50,.12); border-radius: 12px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav button { flex: 0 0 auto; border: 0; background: transparent; border-radius: 8px; padding: 10px 15px; cursor: pointer; color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.subnav button.active { background: var(--white); color: var(--ink); box-shadow: 0 2px 10px rgba(40,31,15,.07); }

.panel { padding: clamp(20px, 3vw, 30px); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.panel-head h3 { margin: 0; font-family: inherit; font-size: 19px; }
.panel-head p { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.summary-cell { padding: 18px; border-left: 3px solid var(--paper-deep); background: rgba(239,226,198,.35); }
.summary-cell span { display: block; color: var(--ink-soft); font-size: 12px; margin-bottom: 8px; }
.summary-cell strong { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 22px; }

.day-group { margin-top: 24px; }
.day-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.day-heading time { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 19px; font-weight: 700; }
.day-heading::after { content: ""; flex: 1; height: 1px; background: rgba(23,43,50,.15); }
.node-list { display: grid; }
.node-row { position: relative; display: grid; grid-template-columns: 82px 34px minmax(0, 1fr) auto; gap: 14px; align-items: stretch; min-height: 94px; }
.node-time { padding-top: 17px; color: var(--ink-soft); font-size: 13px; text-align: right; }
.node-track { position: relative; display: flex; justify-content: center; padding-top: 18px; }
.node-track::after { content: ""; position: absolute; top: 33px; bottom: -18px; width: 1px; border-left: 1px dashed rgba(23,43,50,.28); }
.node-row:last-child .node-track::after { display: none; }
.node-pin { position: relative; z-index: 1; width: 17px; height: 17px; background: var(--paper-light); border: 4px solid var(--moss); border-radius: 50%; }
.node-card { margin-bottom: 10px; padding: 15px 17px; background: rgba(255,253,247,.62); border: 1px solid rgba(23,43,50,.11); border-radius: 10px; }
.node-card-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.node-card strong { font-size: 15px; }
.node-card p { color: var(--ink-soft); font-size: 13px; line-height: 1.55; margin: 0; }
.node-actions { display: flex; padding-top: 11px; }
.node-actions button { width: 34px; height: 34px; padding: 0; }
.type-chip, .status-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.type-activity { color: #6d3c21; background: #edddc4; }
.type-stay { color: #264a57; background: #dce8e7; }
.type-food { color: #6b3d4a; background: #ead7dc; }
.type-transport { color: #3f4d35; background: #dce4d4; }
.type-rest { color: #4d4568; background: #e5e0ee; }
.type-custom { color: #57482e; background: #ece3cf; }
.type-ops { color: white; background: var(--vermillion); border-radius: 5px; transform: rotate(-1deg); }
.cost { margin-left: auto; color: var(--ink-soft); font-size: 12px; }

.route-map { position: relative; padding: 22px 8px 12px; min-height: 300px; overflow: hidden; }
.route-map-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 22px; }
.route-map-choice { display: grid; grid-template-columns: 9px auto; column-gap: 7px; align-items: center; min-height: 43px; padding: 6px 11px; color: #7a8183; border: 1.5px dashed rgba(111,121,124,.42); border-radius: 5px 9px 6px 8px; background: rgba(232,231,224,.48); text-align: left; cursor: pointer; }
.route-map-choice > span { grid-row: 1 / 3; width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; background: var(--paper-light); }
.route-map-choice strong, .route-map-choice small { display: block; white-space: nowrap; }
.route-map-choice strong { font-size: 12px; }
.route-map-choice small { color: inherit; font-size: 9px; opacity: .82; }
.route-map-choice.active.is-main { color: var(--sketch-blue); border-style: solid; border-color: rgba(40,85,106,.44); background: rgba(220,232,229,.64); box-shadow: 2px 3px 0 rgba(38,56,59,.08); }
.route-map-choice.active.is-fork { color: var(--vermillion-dark); border-style: solid; border-color: rgba(201,88,66,.48); background: rgba(201,88,66,.10); box-shadow: 2px 3px 0 rgba(38,56,59,.08); }
.route-map-choice:hover { color: var(--ink); background: rgba(255,253,245,.8); }
.route-map-choice:focus-visible, .route-graph-node:focus-visible, .route-graph-branch-node:focus-visible, .route-graph-end:focus-visible, .route-graph-add:focus-visible { outline: 2px dashed var(--vermillion); outline-offset: 3px; }

.route-graph { position: relative; width: min(100%, 840px); margin: 0 auto; }
.route-graph-lines { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.route-graph-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; vector-effect: non-scaling-stroke; transition: stroke .18s ease, opacity .18s ease; }
.route-graph-line.is-main.is-active { stroke: var(--sketch-blue); }
.route-graph-line.is-fork.is-active { stroke: var(--vermillion); }
.route-graph-line.is-muted { stroke: #8e9699; stroke-dasharray: 7 7; opacity: .46; }
.route-graph-open-dot { fill: var(--paper-light); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.route-graph-open-dot.is-active { stroke: var(--vermillion); }
.route-graph-open-dot.is-muted { stroke: #8e9699; opacity: .56; }

.route-graph-main, .route-graph-branch-node, .route-graph-end { position: absolute; z-index: 2; left: var(--graph-x); top: var(--graph-y); transform: translate(-50%, -25px); }
.route-graph-main { width: 144px; display: grid; justify-items: center; }
.route-graph-node, .route-graph-branch-node, .route-graph-end { padding: 0; color: inherit; border: 0; background: transparent; font: inherit; text-align: center; cursor: pointer; }
.route-graph-node { width: 134px; display: grid; justify-items: center; }
.route-graph-marker { width: 48px; height: 48px; display: grid; place-items: center; color: var(--sketch-blue); border: 3px solid var(--ink); border-radius: 47% 53% 44% 56% / 54% 45% 55% 46%; background: var(--paper-light); box-shadow: 2px 3px 0 rgba(38,56,59,.14), inset 0 0 0 3px var(--paper-light); outline: 1.5px dashed currentColor; outline-offset: -7px; font-family: "STKaiti", "KaiTi", serif; font-size: 12px; font-weight: 800; transition: color .18s ease, border-color .18s ease, opacity .18s ease; }
.route-graph-node strong, .route-graph-branch-node strong { display: block; max-width: 100%; margin-top: 7px; overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; transition: color .18s ease, opacity .18s ease; }
.route-graph-node small, .route-graph-branch-node small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 9px; transition: color .18s ease, opacity .18s ease; }
.route-graph-main:nth-of-type(even) .route-graph-marker { transform: rotate(2deg); }
.route-graph-main.is-muted .route-graph-marker, .route-graph-branch-node.is-muted .route-graph-marker { color: #8d9496; border-color: #7f888b; outline-color: #929a9c; background: #f1eee5; box-shadow: 1px 2px 0 rgba(78,84,86,.09); }
.route-graph-main.is-muted strong, .route-graph-main.is-muted small, .route-graph-branch-node.is-muted strong, .route-graph-branch-node.is-muted small { color: #8c9395; }
.route-graph-branch-node { width: 116px; color: var(--vermillion); }
.route-graph-branch-node.is-active .route-graph-marker { color: var(--vermillion); border-color: var(--vermillion-dark); }
.route-graph-branch-node.is-active strong { color: var(--vermillion-dark); }
.route-graph-add { display: inline-flex; align-items: center; gap: 3px; min-height: 26px; margin-top: 7px; padding: 4px 8px; color: var(--vermillion-dark); border: 1.5px dashed rgba(201,88,66,.42); border-radius: 4px 8px 5px 7px; background: rgba(255,253,245,.76); font-size: 10px; font-weight: 700; cursor: pointer; }
.route-graph-add .icon { width: 12px; height: 12px; }
.route-graph-main.is-muted .route-graph-add { color: #8c9395; border-color: rgba(127,136,139,.38); }
.route-graph-add:hover { color: var(--vermillion-dark); border-color: var(--vermillion); background: rgba(201,88,66,.1); }
.route-graph-end { display: grid; justify-items: center; gap: 5px; color: #858d8f; transform: translate(-50%, -7px); }
.route-graph-end > span { width: 15px; height: 15px; border: 2px solid currentColor; border-radius: 48% 52% 44% 56%; background: var(--paper-light); }
.route-graph-end small { padding: 2px 5px; background: rgba(248,240,223,.82); font-size: 9px; white-space: nowrap; }
.route-graph-end.is-active { color: var(--vermillion); }

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-card { padding: 22px; border: 1px solid rgba(23,43,50,.15); border-radius: 12px; background: rgba(255,253,247,.48); }
.compare-card.selected { border-top: 4px solid var(--vermillion); }
.compare-card h3 { font-size: 21px; margin-bottom: 6px; }
.compare-stat { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(23,43,50,.1); font-size: 13px; }
.compare-route { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.compare-stop { padding: 7px 10px; border-radius: 7px; background: var(--blue-wash); font-size: 12px; }
.compare-stop.diff { background: rgba(166,64,45,.12); color: var(--vermillion-dark); font-weight: 700; }

.trip-grid { display: grid; grid-template-columns: minmax(270px, .7fr) minmax(0, 1.3fr); gap: 22px; align-items: start; }
.trip-list { padding: 12px; display: grid; gap: 8px; }
.trip-card { width: 100%; text-align: left; padding: 16px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; }
.trip-card.active { background: var(--ink); color: var(--paper-light); }
.trip-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.trip-card strong { font-size: 15px; }
.trip-card p { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; }
.trip-card.active p { color: rgba(248,240,223,.63); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #df705a; box-shadow: 0 0 0 5px rgba(223,112,90,.13); margin-top: 5px; }
.trip-stage { overflow: hidden; }
.trip-banner { padding: 28px; display: flex; justify-content: space-between; gap: 22px; align-items: end; color: var(--paper-light); background: var(--ink); }
.trip-banner h2 { font-size: 30px; margin-bottom: 8px; }
.trip-banner p { margin: 0; color: rgba(248,240,223,.62); font-size: 13px; }
.trip-content { padding: clamp(20px, 3vw, 30px); }
.trip-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline { position: relative; margin-top: 26px; }
.timeline-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 24px; }
.timeline-item::before { content: ""; position: absolute; left: 19px; top: 30px; bottom: 0; border-left: 1px dashed rgba(23,43,50,.26); }
.timeline-item:last-child::before { display: none; }
.timeline-marker { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-wash); color: var(--ink); border: 4px solid var(--paper-light); box-shadow: 0 0 0 1px rgba(23,43,50,.15); }
.timeline-item.ops .timeline-marker { border-radius: 8px; background: var(--vermillion); color: white; transform: rotate(-3deg); }
.timeline-body { padding: 3px 0 0; }
.timeline-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--ink-soft); font-size: 11px; margin-bottom: 7px; }
.timeline-body h3 { font-family: inherit; font-size: 15px; margin-bottom: 7px; }
.timeline-body p { line-height: 1.7; color: var(--ink-soft); margin-bottom: 10px; white-space: pre-wrap; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; max-width: 520px; }
.photo-strip img { display: block; width: 100%; height: 112px; object-fit: cover; border-radius: 8px; border: 4px solid var(--white); box-shadow: 0 3px 12px rgba(54,40,21,.13); }

.start-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.start-card { padding: 24px; position: relative; overflow: hidden; }
.start-card h3 { font-size: 22px; margin-bottom: 7px; }
.start-card p { color: var(--ink-soft); min-height: 42px; line-height: 1.55; }
.start-card-meta { display: flex; gap: 12px; color: var(--ink-soft); font-size: 12px; margin: 18px 0; }

.memory-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; }
.memory-list { padding: 12px; }
.memory-list h2 { padding: 10px; font-size: 17px; }
.memory-source { width: 100%; border: 0; background: transparent; border-radius: 9px; padding: 14px 12px; text-align: left; cursor: pointer; }
.memory-source.active { background: rgba(23,43,50,.08); }
.memory-source strong { display: block; margin-bottom: 5px; }
.memory-source span { color: var(--ink-soft); font-size: 11px; }
.memory-editor { overflow: hidden; }
.memory-paper { padding: clamp(24px, 6vw, 70px); background: rgba(255,253,247,.78); min-height: 620px; }
.memory-title-input { width: 100%; border: 0; border-bottom: 1px solid rgba(23,43,50,.15); background: transparent; padding: 0 0 18px; margin-bottom: 32px; color: var(--ink); font-family: "Noto Serif SC", "Songti SC", serif; font-size: clamp(30px, 5vw, 54px); font-weight: 700; letter-spacing: -.04em; }
.memory-section { position: relative; padding: 18px 50px 18px 0; border-bottom: 1px solid rgba(23,43,50,.1); }
.memory-section input { width: 100%; border: 0; background: transparent; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.memory-section textarea { width: 100%; min-height: 96px; resize: vertical; border: 0; background: transparent; color: var(--ink-soft); line-height: 1.85; }
.section-controls { position: absolute; right: 0; top: 16px; display: grid; gap: 3px; }
.section-controls button { width: 32px; height: 29px; padding: 0; }
.memory-placeholder { padding: 70px 30px; text-align: center; }
.memory-placeholder h2 { font-size: 30px; }
.memory-placeholder p { color: var(--ink-soft); line-height: 1.7; max-width: 480px; margin: 0 auto 24px; }

.profile-grid { display: grid; grid-template-columns: minmax(270px, .7fr) minmax(0, 1.3fr); gap: 22px; align-items: start; }
.profile-card { overflow: hidden; }
.profile-identity { padding: 32px; background: var(--ink); color: var(--paper-light); }
.profile-avatar { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--vermillion); color: white; font-family: "Songti SC", serif; font-size: 32px; margin-bottom: 20px; }
.profile-identity h2 { font-size: 27px; margin-bottom: 5px; }
.profile-identity p { color: rgba(248,240,223,.6); font-size: 12px; margin-bottom: 0; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.profile-stat { padding: 18px 8px; text-align: center; border-right: 1px solid rgba(23,43,50,.1); }
.profile-stat:last-child { border-right: 0; }
.profile-stat strong { display: block; font-family: "Songti SC", serif; font-size: 22px; }
.profile-stat span { color: var(--ink-soft); font-size: 10px; }
.settings-stack { display: grid; gap: 16px; }
.settings-card { padding: clamp(20px, 3vw, 28px); }
.settings-card h2 { font-size: 21px; margin-bottom: 7px; }
.settings-card > p { color: var(--ink-soft); line-height: 1.65; font-size: 13px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 16px 0; border-top: 1px solid rgba(23,43,50,.1); }
.setting-row strong { display: block; font-size: 14px; margin-bottom: 4px; }
.setting-row span { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.local-notice { border-left: 4px solid var(--ochre); background: rgba(183,121,49,.09); }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(17,30,34,.63); backdrop-filter: blur(5px); animation: veil .18s ease-out; }
.modal { width: min(620px, 100%); max-height: min(88vh, 820px); overflow-y: auto; background: var(--paper-light); border-radius: 18px; box-shadow: 0 30px 80px rgba(10,18,20,.35); animation: rise .22s ease-out; }
.modal-wide { width: min(900px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 24px 26px 18px; background: rgba(248,240,223,.94); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(23,43,50,.1); }
.modal-head h2 { font-size: 25px; margin-bottom: 5px; }
.modal-head p { color: var(--ink-soft); font-size: 12px; margin: 0; }
.modal-body { padding: 24px 26px; }
.modal-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px 22px; background: rgba(248,240,223,.95); backdrop-filter: blur(10px); border-top: 1px solid rgba(23,43,50,.1); }
.close-button { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(23,43,50,.07); cursor: pointer; }
.choice-list { display: grid; gap: 10px; }
.choice-card { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 15px; border: 1px solid rgba(23,43,50,.15); border-radius: 10px; cursor: pointer; background: rgba(255,253,247,.45); }
.choice-card:has(input:checked) { border-color: var(--vermillion); background: rgba(166,64,45,.06); }
.choice-card input { margin-top: 4px; }
.choice-card strong { display: block; margin-bottom: 4px; }
.choice-card span { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.fork-choice { padding: 18px 0; border-bottom: 1px solid rgba(23,43,50,.11); }
.fork-choice h3 { font-family: inherit; font-size: 15px; margin-bottom: 12px; }
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.radio-option { display: block; padding: 13px; border: 1px solid rgba(23,43,50,.14); border-radius: 9px; cursor: pointer; }
.radio-option:has(input:checked) { border-color: var(--vermillion); background: rgba(166,64,45,.07); }
.radio-option input { margin-right: 7px; }
.draft-list { display: grid; gap: 10px; }
.draft-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px; background: rgba(255,253,247,.5); border: 1px solid rgba(23,43,50,.13); border-radius: 9px; }
.draft-card.uncertain { border-left: 4px solid var(--ochre); }
.draft-index { font-family: "Songti SC", serif; font-size: 21px; color: var(--ink-soft); }
.draft-card input, .draft-card select { width: 100%; margin-bottom: 6px; border: 0; border-bottom: 1px solid rgba(23,43,50,.16); background: transparent; padding: 5px; }
.share-import-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.share-import-summary > div { min-height: 70px; padding: 13px 15px; border: 1px dashed rgba(23,43,50,.3); border-radius: 7px 12px 8px 10px; background: rgba(255,253,245,.7); }
.share-import-summary span { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 12px; }
.share-import-summary strong { display: block; line-height: 1.45; }
.parse-section-title { margin: 20px 0 10px; font-family: "Songti SC", serif; font-size: 16px; font-weight: 700; }
.share-import-forks { display: flex; flex-wrap: wrap; gap: 8px; }
.share-import-forks span { padding: 7px 11px; border: 1px dashed rgba(166,64,45,.42); border-radius: 7px 10px 6px 9px; color: var(--vermillion); background: rgba(166,64,45,.05); font-size: 12px; }
.warning-box { padding: 15px; background: rgba(183,121,49,.1); border-left: 3px solid var(--ochre); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.danger-box { padding: 15px; background: rgba(163,58,50,.08); border-left: 3px solid var(--danger); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }

#toast-region { position: fixed; z-index: 120; right: 22px; bottom: 116px; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 240px; max-width: 380px; padding: 13px 16px; color: var(--paper-light); background: var(--ink); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .25s ease-out; }
.toast.error { background: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes veil { from { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 980px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: 390px; padding: 32px; }
  .auth-copy { margin: 50px 0 20px; }
  .auth-copy h1 { font-size: 46px; }
  .route-sketch { height: 95px; }
  .auth-panel { padding: 42px 24px 70px; }
  .plan-layout, .memory-layout { grid-template-columns: 1fr; }
  .book-shelf { position: static; }
  .book-list { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .book-item { min-width: 205px; }
  .trip-grid, .profile-grid { grid-template-columns: 1fr; }
  .trip-list { display: flex; overflow-x: auto; }
  .trip-card { min-width: 230px; }
}

@media (max-width: 680px) {
  :root { --nav-height: 72px; }
  .topbar { height: 64px; padding: 0 17px; }
  .topbar-meta > span { display: none; }
  .workspace { padding: 24px 15px; }
  .page-head { align-items: start; flex-direction: column; margin-bottom: 22px; }
  .page-title { font-size: 36px; }
  .head-actions { width: 100%; justify-content: stretch; }
  .head-actions .btn { flex: 1; }
  .bottom-nav { bottom: 8px; width: calc(100% - 16px); border-radius: 18px; }
  .auth-story { min-height: 330px; }
  .auth-copy { margin: 38px 0 0; }
  .auth-copy h1 { font-size: 38px; margin-bottom: 16px; }
  .auth-copy p { font-size: 15px; }
  .route-sketch { display: none; }
  .auth-panel { padding: 34px 17px 60px; }
  .method-tab { font-size: 12px; padding: 4px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .book-cover { border-radius: 16px; }
  .book-cover-main { grid-template-columns: 1fr; }
  .book-stamp { display: none; }
  .book-meta { gap: 11px 18px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-cell:last-child { grid-column: 1 / -1; }
  .node-row { grid-template-columns: 45px 24px minmax(0, 1fr); gap: 8px; }
  .node-time { font-size: 11px; }
  .node-actions { grid-column: 3; justify-content: flex-end; padding: 0 0 12px; }
  .cost { width: 100%; margin-left: 0; }
  .route-map { padding-right: 0; padding-left: 0; }
  .route-map-choices { justify-content: flex-start; flex-wrap: nowrap; margin-right: -4px; margin-left: -4px; padding: 2px 4px 7px; overflow-x: auto; }
  .route-map-choice { flex: 0 0 auto; }
  .route-graph-main { width: 94px; }
  .route-graph-node { width: 94px; }
  .route-graph-branch-node { width: 84px; }
  .route-graph-marker { width: 42px; height: 42px; }
  .route-graph-node strong, .route-graph-branch-node strong { font-size: 10px; }
  .route-graph-node small, .route-graph-branch-node small { font-size: 8px; }
  .route-graph-add { min-height: 24px; padding: 3px 6px; font-size: 9px; }
  .compare-grid { grid-template-columns: 1fr; }
  .trip-banner { flex-direction: column; align-items: start; }
  .trip-actions { width: 100%; }
  .trip-actions .btn { flex: 1; }
  .radio-row { grid-template-columns: 1fr; }
  .setting-row { align-items: start; flex-direction: column; }
  .setting-row .btn, .setting-row select { width: 100%; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-head, .modal-body { padding-left: 19px; padding-right: 19px; }
  .modal-actions { padding-left: 19px; padding-right: 19px; }
  .modal-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Hand-drawn travel journal layer */
:root {
  --paper: #f3e8ce;
  --paper-light: #fffdf5;
  --paper-deep: #d7b96d;
  --ink: #26383b;
  --ink-soft: #647071;
  --vermillion: #c95842;
  --vermillion-dark: #9f3e30;
  --moss: #657a58;
  --ochre: #b47d32;
  --blue-wash: #dce8e5;
  --white: #fffdf7;
  --danger: #a43e35;
  --sketch-blue: #28556a;
  --pencil: rgba(38, 56, 59, .64);
  --shadow: 5px 6px 0 rgba(38, 56, 59, .12);
  --radius-sm: 7px 10px 6px 9px;
  --radius: 8px 13px 7px 11px;
  --radius-lg: 11px 18px 9px 15px;
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 0 62px, rgba(193, 86, 68, .10) 63px, rgba(193, 86, 68, .10) 64px, transparent 65px),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(40, 85, 106, .075) 28px, transparent 29px),
    radial-gradient(circle at 20% 30%, rgba(52, 36, 16, .055) 0 .7px, transparent .9px),
    radial-gradient(circle at 78% 67%, rgba(255, 255, 255, .46) 0 .8px, transparent 1px);
  background-size: 100% 100%, 100% 29px, 8px 9px, 11px 13px;
}

h1, h2, .serif, .page-title, .brand-name, .book-cover h2,
.trip-banner h2, .memory-title-input, .memory-section input {
  font-family: "LXGW WenKai", "STKaiti", "KaiTi", "FangSong", serif;
  font-weight: 700;
}

.icon { stroke-width: 1.95; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px dashed var(--vermillion);
  outline-offset: 4px;
}

.brand { transform: rotate(-.35deg); }
.brand-mark {
  border: 2px solid var(--ink);
  border-radius: 47% 53% 45% 55% / 54% 46% 58% 42%;
  background: var(--vermillion);
  box-shadow: 2px 2px 0 rgba(38, 56, 59, .28), inset 0 0 0 2px rgba(255,255,255,.18);
  transform: rotate(-7deg);
  font-family: "STKaiti", "KaiTi", serif;
}
.brand-name { letter-spacing: .1em; }

.auth-story {
  background-color: #29464d;
  background-image:
    repeating-linear-gradient(104deg, transparent 0 18px, rgba(255,255,255,.018) 19px, transparent 20px),
    radial-gradient(circle at 12% 86%, rgba(243,232,206,.065) 0 1px, transparent 1.5px);
  background-size: auto, 10px 10px;
  box-shadow: inset -5px 0 0 rgba(38,56,59,.35);
}
.auth-story::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(243, 232, 206, .18);
  border-radius: 13px 18px 11px 15px;
  pointer-events: none;
}
.auth-story::after {
  border: 2px dashed rgba(243,232,206,.12);
  box-shadow: 0 0 0 75px rgba(243,232,206,.02), 0 0 0 154px rgba(243,232,206,.013);
}
.auth-copy h1 {
  letter-spacing: -.04em;
  transform: rotate(-1deg);
  text-shadow: 1px 1px 0 rgba(255,255,255,.12);
}
.auth-copy p { color: rgba(255, 253, 245, .78); }
.route-path { stroke-width: 2.5; stroke-dasharray: 3 8; stroke-linecap: round; }
.route-dot { stroke-width: 3; }

.auth-panel { position: relative; }
.auth-card {
  position: relative;
  padding: clamp(24px, 4vw, 42px);
  background: rgba(255, 253, 245, .84);
  border: 2px solid var(--pencil);
  border-radius: 8px 15px 7px 12px;
  box-shadow: 7px 8px 0 rgba(40, 85, 106, .13);
  transform: rotate(.25deg);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 104px;
  height: 27px;
  background: rgba(215, 185, 109, .68);
  border-left: 1px dashed rgba(38,56,59,.18);
  border-right: 1px dashed rgba(38,56,59,.18);
  transform: translateX(-50%) rotate(-2deg);
}
.auth-card h2 { transform: rotate(-.6deg); }
.method-tabs {
  border: 1.5px dashed var(--pencil);
  border-radius: 8px 12px 7px 11px;
  background: rgba(215,185,109,.14);
}
.method-tab { border-radius: 5px 8px 6px 9px; }
.method-tab.active {
  border: 1.5px solid var(--sketch-blue);
  background: var(--paper-light);
  color: var(--sketch-blue);
  box-shadow: 2px 2px 0 rgba(40,85,106,.14);
  transform: rotate(-.5deg);
}

.field input, .field textarea, .field select, .inline-input {
  border: 1.5px solid var(--pencil);
  border-radius: 6px 10px 5px 9px;
  background-color: rgba(255,253,245,.76);
  background-image: linear-gradient(transparent calc(100% - 1px), rgba(40,85,106,.08) 1px);
  box-shadow: 2px 2px 0 rgba(38,56,59,.07);
}
.field input:focus, .field textarea:focus, .field select:focus, .inline-input:focus {
  border-color: var(--sketch-blue);
  background: var(--paper-light);
  outline: 2px dashed rgba(40,85,106,.28);
  outline-offset: 2px;
}

.btn {
  border: 1.5px solid var(--ink);
  border-radius: 7px 11px 6px 9px;
  box-shadow: 2px 3px 0 rgba(38,56,59,.16);
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -1px) rotate(-.25deg); box-shadow: 4px 5px 0 rgba(38,56,59,.15); }
.btn:active:not(:disabled) { transform: translate(1px, 2px); box-shadow: 1px 1px 0 rgba(38,56,59,.13); }
.btn-primary { background: var(--vermillion); color: white; border-color: var(--ink); box-shadow: 3px 4px 0 rgba(38,56,59,.24); }
.btn-secondary { background: var(--sketch-blue); }
.btn-ghost { background: rgba(255,253,245,.66); border-style: dashed; }
.btn-quiet { border: 0; box-shadow: none; background: transparent; }
.btn-quiet:hover:not(:disabled) { box-shadow: none; background: rgba(215,185,109,.16); }
.btn-danger { border: 1.5px dashed var(--danger); background: rgba(255,253,245,.62); }

.topbar {
  border-bottom: 2px dashed rgba(38,56,59,.26);
  background: rgba(243,232,206,.91);
  box-shadow: 0 3px 0 rgba(40,85,106,.05);
}
.avatar {
  border: 2px solid var(--ink);
  border-radius: 46% 54% 49% 51% / 52% 47% 53% 48%;
  background: var(--sketch-blue);
  box-shadow: 2px 2px 0 rgba(38,56,59,.16);
  transform: rotate(4deg);
  font-family: "STKaiti", "KaiTi", serif;
}

.page-title {
  position: relative;
  display: inline-block;
  letter-spacing: -.02em;
  transform: rotate(-.7deg);
}
.page-title::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -5%;
  bottom: -5px;
  height: 7px;
  border-top: 3px solid rgba(201,88,66,.58);
  border-radius: 50%;
  transform: rotate(-1.2deg);
}

.bottom-nav {
  background: rgba(38,56,59,.96);
  border: 2px solid #17272a;
  border-radius: 15px 22px 13px 19px;
  box-shadow: 5px 6px 0 rgba(38,56,59,.22);
  transform: translateX(-50%) rotate(-.25deg);
}
.nav-item { border: 0; box-shadow: none; border-radius: 8px 13px 7px 11px; }
.nav-item.active { background: rgba(255,253,245,.11); transform: rotate(.6deg); }
.nav-item.active::before {
  width: 24px;
  height: 5px;
  background: transparent;
  border-top: 3px solid #ee7b64;
  border-radius: 50%;
  transform: rotate(-4deg);
}

.paper-card {
  background-color: rgba(255,253,245,.86);
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(40,85,106,.035) 28px, transparent 29px);
  border: 1.7px solid var(--pencil);
  border-radius: 7px 13px 8px 11px;
  box-shadow: var(--shadow);
}
.empty-illustration { border: 2px dashed var(--pencil); border-radius: 49% 51% 46% 54% / 53% 45% 55% 47%; }

.book-shelf { transform: rotate(-.35deg); }
.book-shelf-head { border-bottom: 1.5px dashed rgba(38,56,59,.22); }
.shelf-add { border-style: solid; border-radius: 50%; }
.book-item { border-radius: 5px 9px 6px 8px; }
.book-item::before { border-radius: 40% 60% 48% 52%; }
.book-item.active {
  background: rgba(215,185,109,.19);
  outline: 1.5px dashed rgba(38,56,59,.30);
  transform: rotate(.45deg);
}
.book-item.active::before { background: var(--vermillion); transform: rotate(3deg); }

.book-cover {
  border: 2px solid #17272a;
  border-radius: 12px 19px 9px 16px;
  background-color: #29464d;
  background-image:
    repeating-linear-gradient(105deg, transparent 0 19px, rgba(255,255,255,.018) 20px, transparent 21px),
    radial-gradient(ellipse at 92% 5%, transparent 0 62px, rgba(243,232,206,.09) 63px 64px, transparent 65px 92px, rgba(243,232,206,.055) 93px 94px, transparent 95px);
  box-shadow: 6px 7px 0 rgba(38,56,59,.17);
  transform: rotate(.12deg);
}
.book-cover::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1.5px dashed rgba(243,232,206,.22);
  border-radius: 7px 14px 6px 12px;
  pointer-events: none;
}
.book-cover::after { display: none; }
.book-cover h2 { letter-spacing: .015em; transform: rotate(-.6deg); }
.book-stamp {
  border: 2.5px dashed #e17964;
  border-radius: 46% 54% 43% 57% / 53% 46% 54% 47%;
  transform: rotate(7deg);
  font-family: "STKaiti", "KaiTi", serif;
}
.book-meta { border-top: 1.5px dashed rgba(248,240,223,.25); }

.subnav {
  border: 1.5px dashed var(--pencil);
  border-radius: 7px 12px 6px 10px;
  background: rgba(255,253,245,.52);
  box-shadow: 2px 3px 0 rgba(38,56,59,.08);
}
.subnav button { border-radius: 5px 8px 4px 7px; }
.subnav button.active {
  color: var(--sketch-blue);
  background: var(--paper-light);
  box-shadow: 2px 2px 0 rgba(40,85,106,.14);
  outline: 1.5px solid rgba(40,85,106,.42);
  transform: rotate(-.4deg);
}

.panel-head { border-bottom: 1.5px dashed rgba(38,56,59,.18); padding-bottom: 16px; }
.summary-cell {
  border: 1.5px solid rgba(38,56,59,.24);
  border-left: 3px solid var(--paper-deep);
  background: rgba(255,248,216,.58);
  box-shadow: 2px 3px 0 rgba(38,56,59,.07);
  transform: rotate(-.5deg);
}
.summary-cell:nth-child(2) { transform: rotate(.7deg); background: rgba(220,232,229,.52); }
.summary-cell:nth-child(3) { transform: rotate(-.2deg); }
.day-heading::after { height: 0; border-top: 1.5px dashed rgba(38,56,59,.27); background: transparent; transform: rotate(.2deg); }
.day-heading time { font-family: "STKaiti", "KaiTi", serif; font-size: 21px; }
.node-track::after { border-left: 2px dashed rgba(40,85,106,.38); }
.node-pin {
  border: 3px solid var(--moss);
  border-radius: 46% 54% 43% 57%;
  box-shadow: 1px 1px 0 rgba(38,56,59,.14);
}
.node-card {
  border: 1.5px solid rgba(38,56,59,.34);
  border-radius: 6px 11px 5px 9px;
  background: rgba(255,253,245,.78);
  box-shadow: 2px 3px 0 rgba(38,56,59,.07);
  transform: rotate(-.16deg);
}
.node-row:nth-child(even) .node-card { transform: rotate(.22deg); }
.type-chip, .status-chip { border: 1px solid rgba(38,56,59,.19); border-radius: 7px 10px 6px 9px; }
.type-ops { border: 1.5px solid var(--ink); border-radius: 4px 7px 5px 6px; box-shadow: 2px 2px 0 rgba(38,56,59,.16); }

.compare-card {
  border: 1.5px solid var(--pencil);
  border-radius: 6px 12px 7px 9px;
  background: rgba(255,253,245,.70);
  box-shadow: 3px 4px 0 rgba(38,56,59,.09);
  transform: rotate(-.18deg);
}
.compare-card.selected { border-top: 4px solid var(--vermillion); transform: rotate(.25deg); }
.compare-stop { border: 1px dashed rgba(40,85,106,.35); border-radius: 5px 8px 4px 7px; }

.trip-list { transform: rotate(-.25deg); }
.trip-card { border-radius: 5px 10px 6px 8px; }
.trip-card.active {
  border: 1.5px solid #17272a;
  background: var(--sketch-blue);
  box-shadow: 3px 4px 0 rgba(38,56,59,.18);
  transform: rotate(.35deg);
}
.trip-stage { border-radius: 9px 15px 7px 12px; }
.trip-banner {
  position: relative;
  background-color: #29464d;
  background-image: repeating-linear-gradient(105deg, transparent 0 19px, rgba(255,255,255,.018) 20px, transparent 21px);
  border-bottom: 2px dashed rgba(243,232,206,.28);
}
.trip-banner::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 7px;
  border-bottom: 1px dashed rgba(243,232,206,.16);
}
.timeline-item::before { border-left: 2px dashed rgba(40,85,106,.34); }
.timeline-marker { border: 2px solid var(--ink); border-radius: 48% 52% 45% 55%; box-shadow: 2px 2px 0 rgba(38,56,59,.13); transform: rotate(-3deg); }
.timeline-item.ops .timeline-marker { border-radius: 5px 9px 4px 8px; }
.photo-strip img { border: 6px solid var(--paper-light); border-radius: 2px; box-shadow: 3px 4px 0 rgba(38,56,59,.14); transform: rotate(-1.5deg); }
.photo-strip img:nth-child(even) { transform: rotate(1.4deg); }

.start-card { transform: rotate(-.25deg); }
.start-card:nth-child(even) { transform: rotate(.3deg); }

.memory-list { transform: rotate(-.2deg); }
.memory-source.active {
  background: rgba(215,185,109,.18);
  outline: 1.5px dashed rgba(38,56,59,.31);
  transform: rotate(.35deg);
}
.memory-paper {
  background-color: rgba(255,253,245,.88);
  background-image:
    linear-gradient(90deg, transparent 0 44px, rgba(201,88,66,.09) 45px, transparent 46px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(40,85,106,.075) 32px, transparent 33px);
}
.memory-title-input { border-bottom: 2px dashed rgba(38,56,59,.26); transform: rotate(-.35deg); }
.memory-section { border-bottom: 1.5px dashed rgba(38,56,59,.18); }
.memory-section input, .memory-section textarea { color: var(--ink); }

.profile-identity {
  background-color: #29464d;
  background-image: repeating-linear-gradient(105deg, transparent 0 19px, rgba(255,255,255,.018) 20px, transparent 21px);
  border-bottom: 2px dashed rgba(243,232,206,.22);
}
.profile-avatar { border: 2px solid var(--paper-light); border-radius: 46% 54% 43% 57%; box-shadow: 3px 3px 0 rgba(0,0,0,.18); transform: rotate(-5deg); }
.local-notice { border: 1.5px solid rgba(180,125,50,.48); border-left: 5px solid var(--ochre); background: rgba(255,245,198,.50); transform: rotate(-.15deg); }
.setting-row { border-top: 1.5px dashed rgba(38,56,59,.18); }

.modal-backdrop { background: rgba(27,45,49,.62); }
.modal {
  border: 2px solid var(--ink);
  border-radius: 9px 16px 8px 13px;
  background-color: var(--paper-light);
  background-image: repeating-linear-gradient(0deg, transparent 0 28px, rgba(40,85,106,.035) 29px, transparent 30px);
  box-shadow: 8px 10px 0 rgba(23,39,42,.30);
}
.modal-head, .modal-actions {
  background: rgba(255,253,245,.94);
  border-color: transparent;
  border-style: dashed;
}
.modal-head { border-bottom-width: 1.5px; }
.modal-actions { border-top-width: 1.5px; }
.close-button { border: 1.5px dashed var(--pencil); border-radius: 47% 53% 44% 56%; background: rgba(215,185,109,.17); }
.choice-card, .radio-option, .draft-card {
  border: 1.5px solid var(--pencil);
  border-radius: 6px 11px 5px 9px;
  background: rgba(255,253,245,.70);
  box-shadow: 2px 3px 0 rgba(38,56,59,.06);
}
.choice-card:has(input:checked), .radio-option:has(input:checked) { border: 2px dashed var(--vermillion); background: rgba(201,88,66,.07); transform: rotate(-.2deg); }
.warning-box { border: 1px dashed rgba(180,125,50,.48); border-left: 4px solid var(--ochre); background: rgba(255,245,198,.48); }
.danger-box { border: 1px dashed rgba(164,62,53,.40); border-left: 4px solid var(--danger); }
.toast { border: 1.5px solid #17272a; border-radius: 6px 11px 5px 9px; background: #29464d; box-shadow: 4px 5px 0 rgba(38,56,59,.22); transform: rotate(-.4deg); }

@media (max-width: 680px) {
  body {
    background-image:
      repeating-linear-gradient(0deg, transparent 0 27px, rgba(40,85,106,.065) 28px, transparent 29px),
      radial-gradient(circle at 20% 30%, rgba(52,36,16,.05) 0 .7px, transparent .9px);
  }
  .auth-card { padding: 27px 18px 22px; transform: none; }
  .topbar-meta > .avatar { display: grid; }
  .auth-story::before { inset: 10px; }
  .book-shelf, .trip-list, .memory-list, .start-card { transform: none; }
  .book-cover { transform: none; }
  .bottom-nav { transform: translateX(-50%); }
  .node-card { transform: none !important; }
  .summary-cell { transform: none !important; }
  .modal { border-radius: 14px 18px 0 0; box-shadow: 0 -5px 0 rgba(23,39,42,.18); }
}

/* Daily pages, compact nodes and sharing */
.book-cover-side {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}
.btn-cover {
  color: var(--paper-light);
  border: 1.5px dashed rgba(255,253,245,.62);
  background: rgba(255,253,245,.07);
  box-shadow: 2px 3px 0 rgba(0,0,0,.18);
  white-space: nowrap;
}
.btn-cover:hover:not(:disabled) { background: rgba(255,253,245,.14); box-shadow: 3px 4px 0 rgba(0,0,0,.18); }

.day-group {
  position: relative;
  margin-top: 28px;
  padding: 18px 18px 8px;
  border: 1.5px solid rgba(38,56,59,.26);
  border-radius: 6px 12px 7px 10px;
  background: rgba(255,253,245,.50);
  box-shadow: 3px 4px 0 rgba(38,56,59,.06);
}
.day-group:nth-of-type(even) { transform: rotate(.08deg); }
.day-heading {
  gap: 10px;
  margin-bottom: 17px;
  padding-bottom: 11px;
  border-bottom: 1.5px dashed rgba(38,56,59,.22);
}
.day-heading::after { display: none; }
.day-index {
  padding: 5px 9px;
  color: var(--vermillion-dark);
  border: 1.5px solid rgba(201,88,66,.38);
  border-radius: 5px 9px 4px 8px;
  background: rgba(201,88,66,.08);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 13px;
  font-weight: 700;
  transform: rotate(-1deg);
  white-space: nowrap;
}
.day-heading time { font-size: 19px; }
.day-add { margin-left: auto; color: var(--sketch-blue); white-space: nowrap; }
.day-add .icon { width: 17px; height: 17px; }
.day-empty {
  min-height: 102px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1.5px dashed rgba(40,85,106,.27);
  border-radius: 5px 10px 6px 9px;
  background: rgba(220,232,229,.18);
}
.day-empty > div { display: flex; align-items: center; gap: 13px; color: var(--ink-soft); }
.day-empty > div > .icon { width: 28px; height: 28px; color: var(--sketch-blue); transform: rotate(-8deg); }
.day-empty strong, .day-empty small { display: block; }
.day-empty strong { color: var(--ink); margin-bottom: 4px; }
.day-empty small { font-size: 12px; }

.compact-node-form { padding-top: 20px; }
.node-time-cost-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(150px, .65fr);
  align-items: start;
  gap: 18px;
}
.node-time-cost-row > .field { min-width: 0; margin: 0; }
.node-time-field > .field-label-row,
.node-cost-field > label {
  display: flex;
  align-items: center;
  min-height: 30px;
}
.node-time-tools { display: inline-flex; align-items: center; gap: 8px; }
.custom-time-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid rgba(40,85,106,.28);
  border-radius: 7px 9px 6px 8px;
  background: rgba(255,253,247,.55);
}
.custom-time-switch[hidden] { display: none !important; }
.custom-time-switch button {
  min-height: 24px;
  padding: 2px 7px;
  border: 0;
  border-radius: 5px 7px 4px 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}
.custom-time-switch button.active { background: var(--sketch-blue); color: #fffdf7; }
.custom-time-switch button:focus-visible { outline: 2px dashed rgba(40,85,106,.48); outline-offset: 2px; }
.node-time-field .help { display: block; margin-top: 7px; }
.manual-time-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.duration-manual-inputs { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; }
.time-unit-label { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.manual-time-inputs input {
  min-width: 0;
  height: 46px;
  padding-inline: 9px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
}
.manual-time-inputs input::-webkit-outer-spin-button,
.manual-time-inputs input::-webkit-inner-spin-button { margin: 0; appearance: none; }
.node-cost-field input { height: 46px; font-variant-numeric: tabular-nums; }
.node-day-context {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 15px;
  color: var(--sketch-blue);
  border: 1.5px dashed rgba(40,85,106,.38);
  border-radius: 5px 10px 6px 8px;
  background: rgba(220,232,229,.38);
  transform: rotate(-.25deg);
}
.node-day-context::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 22px;
  width: 52px;
  height: 13px;
  background: rgba(215,185,109,.54);
  transform: rotate(-3deg);
}
.node-day-context span, .node-day-context strong, .node-day-context small { display: block; }
.node-day-context small { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }

.share-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--sketch-blue);
  background: rgba(220,232,229,.36);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.share-preview {
  min-height: 360px !important;
  line-height: 1.8 !important;
  white-space: pre-wrap;
  font-family: "LXGW WenKai", "STKaiti", "KaiTi", sans-serif !important;
}

@media (max-width: 680px) {
  .book-cover-side { justify-content: flex-start; }
  .btn-cover { width: 100%; }
  .day-group { padding: 14px 12px 6px; transform: none !important; }
  .day-heading { flex-wrap: wrap; }
  .day-heading time { font-size: 17px; }
  .day-add { margin-left: auto; }
  .day-empty { align-items: stretch; flex-direction: column; gap: 14px; }
  .day-empty .btn { width: 100%; }
  .share-preview { min-height: 300px !important; }
}

/* Node-bound forks and deliberate time controls */
.node-time.is-duration {
  padding-top: 13px;
  font-size: 11px;
  line-height: 1.35;
}
.node-fork-entry {
  grid-column: 3 / 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 14px;
  padding: 8px 10px 2px 16px;
  border-top: 1.5px dashed rgba(201,88,66,.28);
}
.fork-entry-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 2px;
  color: var(--ink-soft);
  font-size: 11px;
}
.fork-entry-label .icon { width: 15px; height: 15px; color: var(--vermillion); }
.fork-chip, .fork-main-chip, .fork-add, .time-clear {
  min-height: 30px;
  padding: 5px 9px;
  border: 1.5px dashed rgba(201,88,66,.46);
  border-radius: 4px 8px 5px 7px;
  background: rgba(201,88,66,.07);
  color: var(--vermillion-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.fork-chip { background: rgba(201,88,66,.13); transform: rotate(-.35deg); }
.fork-main-chip {
  color: var(--sketch-blue);
  border-color: rgba(40,85,106,.38);
  background: rgba(220,232,229,.42);
  transform: rotate(.25deg);
}
.fork-chip.active {
  color: var(--paper-light);
  border-style: solid;
  background: var(--vermillion);
  box-shadow: 2px 3px 0 rgba(38,56,59,.14);
}
.fork-add { display: inline-flex; align-items: center; gap: 4px; background: transparent; }
.fork-add .icon { width: 14px; height: 14px; }
.fork-chip:hover, .fork-add:hover { background: rgba(201,88,66,.16); }
.fork-main-chip:hover { background: rgba(220,232,229,.78); }
.fork-origin-context {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 13px 15px;
  border-left: 4px solid var(--vermillion);
  border-top: 1.5px dashed rgba(201,88,66,.34);
  border-bottom: 1.5px dashed rgba(201,88,66,.34);
  background: rgba(201,88,66,.07);
}
.fork-origin-context > .icon { color: var(--vermillion); }
.fork-origin-context span, .fork-origin-context small, .fork-origin-context strong { display: block; }
.fork-origin-context small { margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; }

.fork-create-method {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}
.fork-create-method legend {
  width: 100%;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.fork-method-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 72px;
  padding: 13px 14px;
  border: 1.5px dashed rgba(40,85,106,.34);
  border-radius: 6px 11px 5px 9px;
  background: rgba(255,253,245,.62);
  box-shadow: 2px 3px 0 rgba(38,56,59,.06);
  cursor: pointer;
}
.fork-method-card:has(input:checked) {
  color: var(--vermillion-dark);
  border-style: solid;
  border-color: rgba(201,88,66,.56);
  background: rgba(201,88,66,.08);
  box-shadow: 3px 4px 0 rgba(38,56,59,.08);
  transform: rotate(-.15deg);
}
.fork-method-card input { margin: 3px 0 0; accent-color: var(--vermillion); }
.fork-method-card span,
.fork-method-card strong,
.fork-method-card small { display: block; }
.fork-method-card strong { margin-bottom: 4px; font-size: 13px; }
.fork-method-card small { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.fork-method-card.is-disabled { opacity: .48; cursor: not-allowed; }
.fork-mode-panel {
  padding: 15px 16px 2px;
  border: 1.5px dashed rgba(201,88,66,.34);
  border-radius: 5px 10px 6px 9px;
  background: rgba(255,253,245,.48);
}
.fork-mode-panel[hidden] { display: none; }
.fork-mode-panel .field { margin-bottom: 13px; }

.fork-route-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 0 22px;
  padding: 13px 16px;
  border: 1.5px dashed rgba(201,88,66,.48);
  border-left: 5px solid var(--vermillion);
  border-radius: 5px 11px 6px 9px;
  background: rgba(201,88,66,.07);
  box-shadow: 2px 3px 0 rgba(38,56,59,.06);
  transform: rotate(-.08deg);
}
.fork-route-sign,
.fork-route-actions,
.fork-end-actions { display: flex; align-items: center; }
.fork-route-sign { gap: 12px; }
.fork-route-sign > .icon { width: 25px; height: 25px; color: var(--vermillion); transform: rotate(-8deg); }
.fork-route-sign span,
.fork-route-sign small,
.fork-route-sign strong { display: block; }
.fork-route-sign strong { margin: 2px 0; color: var(--vermillion-dark); font-family: "STKaiti", "KaiTi", serif; font-size: 17px; }
.fork-route-sign small { color: var(--ink-soft); font-size: 11px; }
.fork-route-actions { gap: 5px; }
.fork-route-actions .btn { gap: 4px; }
.fork-route-actions .icon { width: 15px; height: 15px; }

.node-row.is-fork-node .node-pin {
  border-color: #4f7672;
  border-radius: 44% 56% 48% 52%;
  transform: rotate(8deg);
}
.node-row.is-fork-node .node-track::after { border-left: 2px dashed rgba(79,118,114,.44); }
.node-row.is-fork-node .node-card {
  background: rgba(220,232,229,.34);
}
.node-fork-entry.is-active-fork-entry {
  margin-top: -2px;
  padding: 8px 10px 8px 13px;
  border-top-color: rgba(79,118,114,.36);
  background: rgba(220,232,229,.28);
}
.node-fork-entry.is-active-fork-entry .fork-entry-label,
.node-fork-entry.is-active-fork-entry .fork-entry-label .icon {
  color: #385e5b;
}

.fork-route-end {
  position: relative;
  display: grid;
  grid-template-columns: 82px 34px minmax(0, 1fr);
  column-gap: 14px;
  margin: -9px 0 16px;
  padding: 7px 0 8px;
}
.fork-end-line {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-height: 48px;
  border-left: 2px dashed rgba(201,88,66,.44);
  transform: translateX(50%);
}
.fork-end-line::after {
  content: "";
  position: absolute;
  top: 17px;
  left: -6px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--vermillion);
  border-radius: 48% 52% 43% 57%;
  background: var(--paper-light);
}
.fork-end-actions {
  grid-column: 3;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  align-self: center;
}
.fork-end-actions .fork-end-action {
  min-height: 30px;
  padding: 4px 9px;
  color: var(--vermillion-dark);
  border: 1.5px dashed rgba(201,88,66,.42);
  background: rgba(255,253,245,.58);
  font-size: 11px;
  white-space: nowrap;
}
.fork-end-actions .fork-end-action .icon { width: 14px; height: 14px; }
.fork-end-actions .fork-end-action.is-connect { background: rgba(201,88,66,.10); }
.fork-route-end .fork-end-line { border-left-color: rgba(79,118,114,.44); }
.fork-route-end .fork-end-line::after { border-color: #4f7672; }
.fork-route-end .fork-end-actions .fork-end-action {
  color: #385e5b;
  border-color: rgba(79,118,114,.42);
  background: rgba(245,249,241,.70);
}
.fork-route-end .fork-end-actions .fork-end-action.is-connect { background: rgba(220,232,229,.62); }

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.time-clear {
  min-height: 28px;
  padding: 3px 8px;
  border-color: rgba(40,85,106,.34);
  background: transparent;
  color: var(--sketch-blue);
  font-weight: 500;
}
.node-time-section[hidden] { display: none !important; }
.time-colon {
  margin: 0 1px;
  color: var(--sketch-blue);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

/* Desktop account menu */
.account-menu-wrap { position: relative; }
.account-menu-wrap .avatar { padding: 0; cursor: pointer; }
.account-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 12px);
  right: -3px;
  width: 210px;
  padding: 8px;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 7px 12px 8px 10px;
  background: rgba(255,253,245,.98);
  box-shadow: 5px 6px 0 rgba(38,56,59,.18);
  transform: rotate(.15deg);
}
.account-menu::before { content: ""; position: absolute; top: -7px; right: 17px; width: 12px; height: 12px; border-top: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink); background: var(--paper-light); transform: rotate(45deg); }
.account-menu-name { padding: 9px 11px 11px; border-bottom: 1px dashed rgba(38,56,59,.24); }
.account-menu-name strong, .account-menu-name span { display: block; }
.account-menu-name span { margin-top: 3px; color: var(--ink-soft); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu > button { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 7px 10px; color: var(--ink); border: 0; background: transparent; text-align: left; cursor: pointer; }
.account-menu > button:hover { color: var(--vermillion-dark); background: rgba(215,185,109,.16); }
.account-menu > button .icon { width: 17px; height: 17px; }
.account-switch-list { display: grid; gap: 9px; }
.account-switch-row { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 13px; color: var(--ink); border: 1.5px dashed rgba(38,56,59,.32); border-radius: 6px 10px 7px 9px; background: rgba(255,253,245,.65); text-align: left; cursor: pointer; }
.account-switch-row .avatar { width: 36px; height: 36px; }
.account-switch-row strong, .account-switch-row small { display: block; }
.account-switch-row small { margin-top: 3px; color: var(--ink-soft); }
.account-switch-row em { color: var(--vermillion-dark); font-size: 12px; font-style: normal; }
.account-switch-row.is-current { border-style: solid; background: rgba(220,232,229,.44); cursor: default; }

/* Drag-to-reorder daily nodes */
.node-row[draggable="true"] { cursor: grab; }
.node-row[draggable="true"]:active { cursor: grabbing; }
.node-row.is-dragging { opacity: .35; }
.node-row.drag-before::before, .node-row.drag-after::after { content: ""; position: absolute; z-index: 6; left: 118px; right: 48px; border-top: 3px solid var(--vermillion); border-radius: 50%; pointer-events: none; }
.node-row.drag-before::before { top: -3px; }
.node-row.drag-after::after { bottom: 5px; }
.drag-handle { width: 20px; height: 24px; display: inline-grid; place-items: center; color: rgba(40,85,106,.62); cursor: grab; }
.drag-handle .icon { width: 18px; height: 18px; stroke-width: 3; }

/* Day-by-day route drawing */
.route-map-panel { padding: 18px 24px 26px; overflow: hidden; }
.route-map-date-switch { display: flex; gap: 7px; padding: 3px 3px 13px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1.5px dashed rgba(38,56,59,.20); }
.route-map-date-switch button { flex: 0 0 auto; min-width: 91px; padding: 7px 11px; color: var(--ink-soft); border: 1.5px dashed rgba(38,56,59,.25); border-radius: 5px 9px 6px 8px; background: rgba(255,253,245,.50); cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.route-map-date-switch button strong, .route-map-date-switch button span { display: block; }
.route-map-date-switch button strong { margin-bottom: 3px; font-size: 12px; }
.route-map-date-switch button span { font-size: 10px; }
.route-map-date-switch button:hover { color: var(--sketch-blue); border-color: rgba(40,85,106,.56); background: rgba(220,232,229,.30); }
.route-map-date-switch button.active { color: var(--sketch-blue); border-style: solid; border-color: var(--sketch-blue); background: rgba(220,232,229,.66); box-shadow: 2px 3px 0 rgba(38,56,59,.09); transform: rotate(-.25deg) translateY(-1px); }
.route-map-day-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 15px 4px 2px; }
.route-map-day-caption strong { font-family: "STKaiti", "KaiTi", serif; font-size: 20px; }
.route-map-day-caption span { color: var(--ink-soft); font-size: 11px; }
.route-day-graph { position: relative; width: min(100%, 820px); margin: 0 auto; transition: width .2s ease; }
.route-day-graph:not(.has-branches) { width: min(100%, 560px); }
.route-day-main-label, .route-day-branch-label { position: absolute; z-index: 3; padding: 3px 8px; border: 1.5px dashed currentColor; border-radius: 5px 8px 4px 7px; background: rgba(255,253,245,.94); font-size: 10px; font-weight: 700; letter-spacing: .04em; cursor: pointer; transition: opacity .16s ease, color .16s ease, background .16s ease; }
.route-day-main-label { top: 10px; left: 50%; color: var(--sketch-blue); transform: translateX(-50%); }
.route-day-main-label.is-muted { color: #8b9294; }
.route-day-branch-label { left: var(--graph-x); top: var(--graph-y); max-width: 132px; overflow: hidden; color: var(--vermillion-dark); text-overflow: ellipsis; transform: translate(-50%, -50%) rotate(-.35deg); white-space: nowrap; }
.route-day-branch-label.is-active { background: rgba(201,88,66,.08); }
.route-day-branch-label.is-muted { color: #858d8f; }
.route-day-item { position: absolute; z-index: 2; left: var(--graph-x); top: var(--graph-y); width: 184px; height: 96px; display: grid; place-items: center; color: var(--sketch-blue); transform: translate(-50%, -50%); }
.route-day-node { width: 84px; height: 84px; display: grid; place-items: center; padding: 11px; color: inherit; border: 2.5px solid currentColor; border-radius: 48% 52% 46% 54% / 52% 47% 53% 48%; background: var(--paper-light); box-shadow: 2px 3px 0 rgba(38,56,59,.11), inset 0 0 0 5px var(--paper-light); outline: 1.5px dashed currentColor; outline-offset: -7px; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.route-day-node:hover { transform: translateY(-2px) rotate(-.45deg); box-shadow: 3px 5px 0 rgba(38,56,59,.11), inset 0 0 0 5px var(--paper-light); }
.route-day-node strong { max-width: 64px; overflow: hidden; font-family: "STKaiti", "KaiTi", serif; font-size: 13px; line-height: 1.2; text-align: center; text-overflow: ellipsis; }
.route-day-item.is-transport .route-day-node { width: 150px; height: 54px; padding: 8px 14px; border-width: 2.5px; border-radius: 7px 12px 6px 10px; outline-offset: -6px; }
.route-day-item.is-transport .route-day-node strong { max-width: 120px; font-size: 13px; white-space: nowrap; }
.route-day-item.is-branch.is-active { color: var(--vermillion); }
.route-day-item.is-muted { color: #8a9294; opacity: .62; }
.route-day-item.is-muted .route-day-node { background: #f0eee7; box-shadow: 1px 2px 0 rgba(38,56,59,.07), inset 0 0 0 5px #f0eee7; }
.route-day-time, .route-day-cost { position: absolute; top: 50%; width: 104px; color: var(--ink-soft); font-size: 10px; line-height: 1.35; transform: translateY(-50%); pointer-events: none; }
.route-day-time { right: calc(50% + 53px); text-align: right; }
.route-day-cost { left: calc(50% + 53px); text-align: left; }
.route-day-item.is-transport .route-day-time { right: calc(50% + 86px); }
.route-day-item.is-transport .route-day-cost { left: calc(50% + 86px); }
.route-map-day-empty { min-height: 280px; display: grid; place-items: center; align-content: center; gap: 9px; color: var(--ink-soft); }
.route-map-day-empty .icon { width: 42px; height: 42px; color: var(--sketch-blue); transform: rotate(-5deg); }
.route-map-day-empty strong { color: var(--ink); font-size: 17px; }
.route-map-day-empty span { font-size: 12px; }

/* All route plans in one compact comparison sheet */
.compare-panel { padding-bottom: 26px; }
.compare-route-table { margin-top: 20px; border-top: 2px solid var(--ink); }
.compare-route-head, .compare-route-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .8fr) minmax(170px, .9fr); align-items: center; column-gap: 22px; }
.compare-route-head { padding: 10px 18px; color: var(--ink-soft); border-bottom: 1px solid rgba(38,56,59,.22); font-size: 11px; }
.compare-route-row { min-height: 86px; padding: 14px 18px; border-bottom: 1.5px dashed rgba(38,56,59,.24); }
.compare-route-row > div:not(.compare-route-name) span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; }
.compare-route-row > div:not(.compare-route-name) strong { font-size: 15px; }
.compare-route-name { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 11px; align-items: center; }
.compare-route-name > span { grid-row: 1 / 3; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; }
.compare-route-name strong, .compare-route-name small { display: block; }
.compare-route-name strong { font-family: "STKaiti", "KaiTi", serif; font-size: 19px; }
.compare-route-name small { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }
.compare-route-row.is-main .compare-route-name { color: var(--sketch-blue); }
.compare-route-row.is-fork .compare-route-name { color: var(--vermillion-dark); }
.compare-route-row:hover { background: rgba(220,232,229,.2); }

@media (max-width: 680px) {
  .node-fork-entry { grid-column: 3; padding-left: 8px; }
  .fork-entry-label { width: 100%; }
  .fork-route-banner { align-items: flex-start; flex-direction: column; }
  .fork-route-actions { width: 100%; justify-content: flex-end; }
  .fork-route-end { grid-template-columns: 45px 24px minmax(0, 1fr); column-gap: 8px; }
  .fork-end-actions { justify-content: center; }
  .node-time-cost-row { gap: 12px; grid-template-columns: minmax(0, 1.2fr) minmax(120px, .8fr); }
  .manual-time-inputs { gap: 6px; }
}

@media (max-width: 520px) {
  .node-time-cost-row { grid-template-columns: 1fr; }
}
