/* ============================================================
   東京散步手帖 · App 版
   沿用 ../styles.css 的繪本 tokens 與元件，
   這裡只做「電話 App」外殼、分頁、底部導覽與少量覆寫。
   ============================================================ */

html, body {
  height: 100%;
  scroll-behavior: auto;
}

body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #F3EDE2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='2' cy='2' r='1.1' fill='%233E3A39' fill-opacity='0.07'/%3E%3C/svg%3E");
}

/* 手機外殼：真手機全屏，桌面變一台繪本風手機 */
.phone {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
}

@media (min-width: 640px) {
  body { padding: 24px; }
  body::before,
  body::after {
    content: "";
    position: fixed;
    z-index: 0;
    border: var(--line);
    border-radius: 50%;
    pointer-events: none;
  }
  body::before {
    width: 168px;
    height: 168px;
    left: 7vw;
    top: 12vh;
    background: var(--aqua-soft);
  }
  body::after {
    width: 116px;
    height: 116px;
    right: 9vw;
    bottom: 11vh;
    background: var(--coral-soft);
  }
  .phone {
    z-index: 1;
    width: 414px;
    height: min(860px, calc(100dvh - 48px));
    border: var(--line);
    border-radius: 40px;
    box-shadow: 10px 10px 0 var(--ink);
  }
}

/* ---------- 頂部 App Bar ---------- */
.appbar {
  position: relative;
  z-index: 12;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(9px + env(safe-area-inset-top)) 13px 9px;
  border-bottom: var(--line);
  background: var(--paper);
}
.appbar__mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 10px;
  background: var(--coral);
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}
.appbar__mark .icon { width: 17px; height: 17px; }
.appbar__title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-size: 12.5px;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar__title small {
  font-size: 8.5px;
  letter-spacing: .1em;
  opacity: .78;
  margin-top: 2px;
}
.appbar__install {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  font-size: 10.5px;
  line-height: 1.5;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow-soft);
  box-shadow: 1.5px 1.5px 0 var(--ink);
  cursor: pointer;
}
.appbar__install .icon { width: 12px; height: 12px; }
.appbar__install:active { transform: translate(1px, 1px); box-shadow: none; }
.standalone .appbar__install,
.standalone .install-banner { display: none !important; }

/* ---------- 螢幕容器 ---------- */
.screens {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  position: relative;
  scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }

.screen {
  display: none;
  padding: 14px 14px 30px;
}
.screen.is-active {
  display: block;
  animation: screen-in .38s var(--ease-bounce) both;
}
.sheet-open .screens { overflow: hidden; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 首頁 ---------- */
.app-hero {
  margin-bottom: 14px;
  overflow: hidden;
}
.app-hero__art {
  background: var(--paper);
  border-bottom: var(--line);
}
.app-hero__art svg {
  display: block;
  width: 100%;
  height: auto;
}
.app-hero__body { padding: 15px 15px 14px; }
.app-hero .eyebrow { margin-bottom: 6px; }
.app-hero h1 {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: .02em;
  margin: 0 0 8px;
}
.app-hero__lead {
  font-size: 12px;
  line-height: 1.85;
  opacity: .8;
  margin-bottom: 11px;
}

.countdown { margin-bottom: 14px; }

.shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}
.shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 3px 8px;
  background: #fff;
  border: var(--line);
  border-radius: 16px;
  box-shadow: 3px 3px 0 var(--ink);
  text-align: center;
  cursor: pointer;
  transition: transform .12s var(--ease-bounce), box-shadow .12s;
}
.shortcut:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}
.shortcut__icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 9px;
  margin-bottom: 2px;
}
.shortcut__icon .icon { width: 15px; height: 15px; }
.shortcut__icon--coral { background: var(--coral); }
.shortcut__icon--yellow { background: var(--yellow); }
.shortcut__icon--green { background: var(--green); }
.shortcut__icon--aqua { background: var(--aqua); }
.shortcut__label {
  font-size: 10.5px;
  line-height: 1.45;
  white-space: nowrap;
}
.shortcut small { display: none; }

.panel {
  padding: 12px 14px 11px;
  margin-bottom: 14px;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.panel__head h2 {
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: .05em;
}
.panel__tag {
  font-size: 7.5px;
  letter-spacing: .14em;
  line-height: 1.7;
  padding: 0 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow-soft);
}
.summary li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 0;
  font-size: 11.5px;
  line-height: 1.65;
  border-bottom: 2px dashed color-mix(in srgb, var(--ink) 16%, var(--paper));
}
.summary li:last-child { border-bottom: 0; padding-bottom: 1px; }
.summary .icon { width: 13px; height: 13px; margin-top: 3px; }
.summary b { font-weight: 400; }
.summary em {
  margin-left: auto;
  max-width: 62%;
  text-align: right;
  font-style: normal;
  opacity: .85;
}

.install-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  margin-bottom: 14px;
  border: var(--line);
  border-radius: 16px;
  background: var(--aqua-soft);
  box-shadow: 3px 3px 0 var(--ink);
  text-align: left;
  cursor: pointer;
}
.install-banner:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.install-banner__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--aqua);
}
.install-banner__icon .icon { width: 15px; height: 15px; }
.install-banner__text { display: flex; flex-direction: column; line-height: 1.4; }
.install-banner__text strong { font-size: 12px; font-weight: 400; }
.install-banner__text small { font-size: 9.5px; opacity: .78; }
.install-banner__arrow { width: 16px; height: 16px; margin-left: auto; }

.app-foot {
  text-align: center;
  font-size: 9.5px;
  line-height: 1.8;
  opacity: .72;
  padding: 2px 0 4px;
}
.app-foot a {
  color: inherit;
  text-underline-offset: 2px;
}

/* ---------- 共用螢幕標題 ---------- */
.screen-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 13px;
}
.screen-head .sec-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-3deg);
}
.screen-head .sec-mark .icon { width: 19px; height: 19px; }
.screen-head .sec-kicker {
  font-size: 8px;
  letter-spacing: .2em;
  margin-bottom: 0;
}
.screen-head h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: .02em;
}
.screen-head__count {
  margin-left: auto;
  font-size: 9.5px;
  line-height: 1.7;
  padding: 1px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  white-space: nowrap;
}

/* ---------- 行程 ---------- */
.daytabs {
  gap: 5px;
  margin-inline: 0;
  padding: 2px 2px 12px;
  max-width: none;
}
.daytab {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 4px 7px;
  border-radius: 13px;
  box-shadow: 2.5px 2.5px 0 var(--ink);
}
.daytab__label { font-size: 7.5px; letter-spacing: .08em; }
.daytab__date { font-size: 14.5px; }
.daytab__week { font-size: 9px; }
.daytab[aria-selected="true"] { box-shadow: 3px 4px 0 var(--ink); }
.day-panel { min-height: 0; }

.dayhead h3 { font-size: 17px; }
.dayhead__area { font-size: 9.5px; }
.tl-card { padding: 11px 12px 12px; }
.tl-head h4 { font-size: 14px; }
.tl-desc { font-size: 12px; }
.tl-time { font-size: 11px; }
.swipe-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 9.5px;
  line-height: 1.7;
  letter-spacing: .06em;
  opacity: .75;
}

/* ---------- 航班 ---------- */
.flights {
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 13px;
}
.flight { border-radius: 20px; }
.mini-tip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 11px;
  font-size: 10.5px;
  line-height: 1.7;
  background: var(--yellow-soft);
  border-style: dashed;
  box-shadow: none;
}
.mini-tip .icon { width: 13px; height: 13px; margin-top: 3px; }

/* ---------- 住宿 ---------- */
.hotel {
  grid-template-columns: 1fr;
  margin-bottom: 0;
}
.hotel__art {
  display: block;
  border-right: 0;
  border-bottom: var(--line);
  padding: 12px;
}
.hotel__body { padding: 16px 15px 15px; }
.hotel__body h3 { font-size: 21px; }
.hotel__facts { margin: 12px 0 10px; }
.stay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}
.stay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  font-size: 11px;
  line-height: 1.5;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}
.stay-btn .icon { width: 13px; height: 13px; }
.stay-btn:active { transform: translate(2px, 2px); box-shadow: none; }

/* ---------- 清單 ---------- */
.segmented {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 0 9px;
  margin-bottom: 2px;
  background: var(--paper);
}
.seg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  font-size: 11px;
  line-height: 1.5;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}
.seg[data-list-tab="todo"] { --seg: var(--coral); }
.seg[data-list-tab="pre"] { --seg: var(--aqua); }
.seg[data-list-tab="pack"] { --seg: var(--green); }
.seg[aria-selected="true"] {
  background: var(--seg);
  transform: translateY(-1px);
}
.seg__badge {
  font-size: 8px;
  line-height: 1.6;
  padding: 0 4px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
.list-pane .panel { margin-bottom: 0; padding: 13px 13px 12px; }
.list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.list-top h3 {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}
.list-top__count {
  font-size: 9.5px;
  opacity: .8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.list-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}
.list-done { font-size: 9.5px; }
.pack-groups {
  grid-template-columns: 1fr;
  gap: 10px;
}
.pack-group { padding: 8px 10px 5px; }
.pack-group__head h4 { font-size: 11.5px; }
.pack-group .check { font-size: 11.5px; }
.footnote { font-size: 10px; }

/* ---------- 底部導覽 ---------- */
.tabbar {
  flex: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  border-top: var(--line);
  background: var(--paper);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 0 1px;
  border: 0;
  border-radius: 12px;
  background: none;
  font-size: 10px;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
}
.tab__icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 10px;
  transition: background-color .15s, border-color .15s, transform .15s var(--ease-bounce);
}
.tab__icon .icon { width: 19px; height: 19px; }
.tab[data-tab="home"] { --accent: var(--coral); }
.tab[data-tab="itinerary"] { --accent: var(--aqua); }
.tab[data-tab="flights"] { --accent: var(--yellow); }
.tab[data-tab="stay"] { --accent: var(--green); }
.tab[data-tab="lists"] { --accent: var(--coral); }
.tab[aria-current="page"] .tab__icon {
  background: var(--accent);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translateY(-1px);
}
.tab:active .tab__icon { transform: scale(.9); }

/* ---------- 安裝說明 / Toast ---------- */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
}
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  animation: fade-in .22s ease both;
}
.sheet__panel {
  position: relative;
  width: 100%;
  max-height: 82%;
  overflow-y: auto;
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: var(--line);
  border-radius: 24px 24px 0 0;
  animation: sheet-up .32s var(--ease-bounce) both;
}
.sheet__handle {
  display: block;
  width: 38px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: var(--ink);
  opacity: .22;
}
.sheet__panel h2 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .02em;
  margin-bottom: 3px;
}
.sheet__panel p {
  font-size: 11.5px;
  line-height: 1.75;
  opacity: .8;
  margin-bottom: 9px;
}
.sheet__panel ol {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.sheet__panel li {
  font-size: 11px;
  line-height: 1.7;
  padding: 7px 9px;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  background: #fff;
}
.sheet__panel strong { font-weight: 400; }
.sheet__close {
  width: 100%;
  padding: 9px;
  border: var(--line);
  border-radius: 12px;
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  cursor: pointer;
}
.sheet__close:active { transform: translate(2px, 2px); box-shadow: none; }

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translate(-50%, 8px);
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease-bounce);
}
.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 很窄的手機 ---------- */
@media (max-width: 359px) {
  .appbar__install span { display: none; }
  .appbar__install { padding: 4px 6px; }
  .app-hero h1 { font-size: 27px; }
  .daytab__date { font-size: 13.5px; }
  .shortcut__label { font-size: 12px; }
}

/* 減少動態效果：沿用 styles.css 的全域規則，這裡再關掉分頁切換 */
@media (prefers-reduced-motion: reduce) {
  .screen.is-active,
  .sheet__panel,
  .sheet__backdrop {
    animation: none !important;
  }
  .toast,
  .tab__icon,
  .shortcut,
  .stay-btn,
  .seg {
    transition: none !important;
  }
}

/* ============================================================
   旅行手帖 · 空白 App 專用
   ============================================================ */

/* App Bar 編輯 */
.appbar__edit {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11px;
  line-height: 1.5;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow-soft);
  box-shadow: 1.5px 1.5px 0 var(--ink);
  cursor: pointer;
}
.appbar__edit .icon { width: 13px; height: 13px; }
.appbar__edit:active { transform: translate(1px, 1px); box-shadow: none; }

/* 首頁 CTA */
.welcome-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}
.welcome-actions .btn--primary { grid-column: 1 / -1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .12s var(--ease-bounce), box-shadow .12s;
}
.btn .icon { width: 14px; height: 14px; }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--primary { background: var(--coral); }
.btn--ghost { background: var(--paper); }
.btn--sm { padding: 6px 9px; font-size: 11px; box-shadow: 1.5px 1.5px 0 var(--ink); }
.btn--danger {
  width: 100%;
  margin-top: 12px;
  background: var(--paper);
  border-style: dashed;
  box-shadow: none;
  color: color-mix(in srgb, var(--ink) 85%, var(--coral));
}
.btn--danger .icon { width: 13px; height: 13px; }

/* 空白狀態 */
.empty {
  padding: 26px 20px 22px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-top: 4px;
}
.empty__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 3px;
}
.empty__icon .icon { width: 23px; height: 23px; }
.empty__icon--coral { background: var(--coral); }
.empty__icon--aqua { background: var(--aqua); }
.empty__icon--green { background: var(--green); }
.empty__icon--yellow { background: var(--yellow); }
.empty h3 { font-size: 15px; font-weight: 400; }
.empty p {
  max-width: 260px;
  font-size: 11px;
  line-height: 1.75;
  opacity: .8;
}
.empty .btn { margin-top: 8px; }
.pane-empty {
  padding: 12px 0 4px;
  text-align: center;
  font-size: 10.5px;
  opacity: .7;
}

/* 插圖小動畫（plane 需要外層 positioning，內層才動） */
.art-plane,
.art-suitcase,
.art-passport {
  transform-box: fill-box;
  transform-origin: center;
  animation: plane-bob 5.5s ease-in-out infinite;
}
.art-suitcase { transform-origin: bottom center; animation-duration: 4.2s; }
.art-passport { animation-duration: 6s; animation-delay: -1.5s; }
@keyframes plane-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(1deg); }
}

/* ============================================================
   編輯旅程
   ============================================================ */
.editor {
  position: absolute;
  inset: 0;
  z-index: 75;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.editor[hidden] { display: none !important; }
.editor-open .screens { overflow: hidden; }

.editor__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(9px + env(safe-area-inset-top)) 13px 9px;
  background: var(--paper);
  border-bottom: var(--line);
}
.editor__bar h2 {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .04em;
}
.ed-btn {
  padding: 5px 11px;
  font-size: 11px;
  line-height: 1.5;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
}
.ed-btn--save {
  background: var(--coral);
  box-shadow: 2px 2px 0 var(--ink);
}
.ed-btn:active { transform: translate(1px, 1px); box-shadow: none; }

.editor__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(40px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.editor__scroll::-webkit-scrollbar { display: none; }

.ed-sec {
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 2px dashed color-mix(in srgb, var(--ink) 20%, var(--paper));
}
.ed-sec:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.ed-sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ed-sec__head h3 { font-size: 15px; font-weight: 400; letter-spacing: .03em; }
.ed-sec__head span { font-size: 9px; letter-spacing: .16em; opacity: .55; }
.ed-hint {
  font-size: 10px;
  line-height: 1.7;
  opacity: .78;
  margin: 0 0 10px;
}
.ed-sub {
  margin: 9px 0 5px;
  padding-top: 7px;
  border-top: 2px dashed color-mix(in srgb, var(--ink) 16%, var(--paper));
  font-size: 10px;
  letter-spacing: .1em;
  opacity: .7;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin-bottom: 9px;
  font-size: 10.5px;
}
.field > span { opacity: .8; letter-spacing: .03em; line-height: 1.5; }
.field input,
.field select,
.field textarea {
  min-width: 0;
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 7px 9px;
}
.field textarea { min-height: 64px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 0;
  border-color: var(--ink);
}
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.field-row:has(.field:only-child) { grid-template-columns: 1fr; }

.ed-card {
  padding: 10px;
  margin-bottom: 10px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--ink) 12%, transparent);
}
.ed-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.ed-card__head h4 { font-size: 12px; font-weight: 400; letter-spacing: .04em; }
.icon-btn {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}
.icon-btn .icon { width: 12px; height: 12px; }
.icon-btn:active { transform: scale(.92); }

.ed-item {
  padding: 9px;
  margin: 8px 0;
  border: 2px dashed color-mix(in srgb, var(--ink) 35%, var(--paper));
  border-radius: 12px;
  background: var(--paper);
}
.ed-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ed-item__head h5 {
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .06em;
  opacity: .7;
}
.check-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 8px;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}
.check-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--coral);
}

.add-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  border: 2px dashed var(--ink);
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}
.add-btn .icon { width: 13px; height: 13px; }
.add-btn:active { background: var(--yellow-soft); }

.ed-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}
.ed-actions-row .btn { flex: 1; min-width: 66px; }

.ed-json {
  margin-top: 4px;
  padding: 9px;
  border: 2px dashed color-mix(in srgb, var(--ink) 35%, var(--paper));
  border-radius: 12px;
  background: #fff;
}
.ed-json summary { font-size: 11px; cursor: pointer; letter-spacing: .03em; }
.ed-json textarea {
  width: 100%;
  min-height: 180px;
  margin: 8px 0;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  resize: vertical;
}

.editor-open .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }

/* 很窄的手機 */
@media (max-width: 359px) {
  .appbar__edit { padding: 4px 8px; font-size: 10px; }
  .field-row { grid-template-columns: 1fr; }
  .welcome-actions { grid-template-columns: 1fr; }
  .welcome-actions .btn--primary { grid-column: auto; }
}

/* 編輯器分段跳轉 */
.ed-jump {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 7px 13px;
  background: var(--paper);
  border-bottom: 2px dashed color-mix(in srgb, var(--ink) 18%, var(--paper));
  scrollbar-width: none;
}
.ed-jump::-webkit-scrollbar { display: none; }
.ed-jump button {
  flex: 0 0 auto;
  padding: 3px 10px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.ed-jump button:active { background: var(--yellow-soft); }

.icon-btn { width: 28px; height: 28px; }
.icon-btn .icon { width: 13px; height: 13px; }
