:root {
  --accent: #14b8a6;
  --accent-text: #0b7a72;
  --accent-tint: #dcf7f3;
  --bg: #f2f8f9;
  --card: #ffffff;
  --ink: #1b2430;
  --heading: #0b1f3a;
  --muted: #5a6573;
  --line: #d9e1e8;
  --pay: #b45309;      --pay-tint: #fef3c7;
  --act: #1d4ed8;      --act-tint: #dbeafe;
  --none: #15803d;     --none-tint: #dcfce7;
  --warn: #b91c1c;     --warn-tint: #fee2e2;
  --radius: 12px;
  --tabbar: 4.25rem;
  --stage: #dfe9ec;
  --bezel: #12161c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #2dd4bf;
    --accent-text: #5eead4;
    --accent-tint: #123a40;
    --bg: #0a1626;
    --card: #10233b;
    --ink: #dbe6ef;
    --heading: #f1f6fa;
    --muted: #9fb0c0;
    --line: #22395a;
    --pay: #fbbf24;    --pay-tint: #3a2c0b;
    --act: #93c5fd;    --act-tint: #172a4d;
    --none: #86efac;   --none-tint: #10331f;
    --warn: #fca5a5;   --warn-tint: #3b1414;
    --stage: #050c16;
    --bezel: #2a3240;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}
[hidden] { display: none !important; }

/* Phone frame: on a computer the app sits in a phone, like the real thing.
   On a phone (narrow screen) the frame disappears and the app fills the screen. */
html, body { height: 100%; }
body { background: var(--stage); }
.stage { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 24px 16px; }
.phone {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  width: 390px; max-width: 100%;
  height: min(844px, calc(100vh - 80px)); min-height: 560px;
  background: var(--bg);
  border: 12px solid var(--bezel); border-radius: 52px;
  box-shadow: 0 30px 70px -25px rgba(11, 31, 58, 0.45);
  container-type: inline-size;
}
.statusbar {
  flex: none; display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 1.6rem 0.3rem; background: var(--card);
  font-size: 0.82rem; font-weight: 700; color: var(--heading);
}
.statusbar .sb-r { display: flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; }
.statusbar .batt { display: inline-block; width: 1.4rem; height: 0.7rem; border: 1.5px solid currentColor; border-radius: 3px; position: relative; }
.statusbar .batt::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: currentColor; border-radius: 1px; }
.phone::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; z-index: 70;
  width: 120px; height: 5px; border-radius: 3px; transform: translateX(-50%);
  background: var(--heading); opacity: 0.35; pointer-events: none;
}
.caption { margin: 0; font-size: 0.85rem; color: var(--muted); text-align: center; }

@media (max-width: 500px), (max-height: 600px) and (max-width: 900px) {
  .stage { padding: 0; display: block; }
  .phone {
    width: 100%; height: 100vh; height: 100dvh; min-height: 0;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .statusbar, .phone::after, .caption { display: none; }
  .apphead { padding-top: calc(0.5rem + env(safe-area-inset-top)); }
  .phone.bare main { padding-top: calc(1.5rem + env(safe-area-inset-top)); }
}
[lang="ja"] { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif; }

/* App header */
.apphead {
  flex: none; z-index: 5; position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  min-height: 3.1rem; padding: 0.5rem 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.apphead .brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--heading); text-decoration: none; letter-spacing: -0.01em; }
.apphead .mark { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 50%; border: 2.5px solid #c62828; background: #fffaf3; color: #c62828; font-size: 1rem; font-weight: 900; line-height: 1; transform: rotate(-8deg); box-shadow: inset 0 0 0 1.5px #fffaf3, inset 0 0 0 2.5px rgba(198,40,40,0.35); }
.apphead .mark .i { width: 1.1rem; height: 1.1rem; }
.hback { display: flex; align-items: center; gap: 0.15rem; margin-left: -0.4rem; padding: 0.3rem 0.4rem; border-radius: 8px; color: var(--accent-text); text-decoration: none; font-weight: 600; max-width: 70%; }
.hback .i { width: 1.35rem; height: 1.35rem; stroke-width: 2.4; flex: none; }
.hback span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apphead .mode { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--accent-tint); color: var(--accent-text); }

main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 1rem 16px 2rem; }
main:focus { outline: none; }
main { scrollbar-width: none; }
main::-webkit-scrollbar { display: none; }
.phone.bare .tabbar, .phone.bare .apphead { display: none; }
.phone.bare main { padding-top: calc(1.5rem + env(safe-area-inset-top)); }

/* Screen transitions */
.in-fade { animation: inFade 0.22s ease both; }
.in-push { animation: inPush 0.26s cubic-bezier(.2,.8,.2,1) both; }
@keyframes inFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes inPush { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .in-fade, .in-push { animation: none; } }

/* Icons */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i.chev { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.i.big { width: 2.6rem; height: 2.6rem; stroke-width: 1.5; color: var(--accent); }

/* Press feedback, like native buttons */
a, button, label { -webkit-tap-highlight-color: transparent; }
.btn, .qbtn, .list a, .sample, .hero, .scanbar, .choice, .tabbar a, .send, .iconbtn, .shutter, .roundbtn {
  transition: transform 0.12s ease, background-color 0.15s, border-color 0.15s;
  -webkit-user-select: none; user-select: none;
}
.btn:active, .qbtn:active, .list a:active, .sample:active, .hero:active, .scanbar:active, .choice:active, .send:active, .iconbtn:active { transform: scale(0.97); }

h1, h2, h3 { color: var(--heading); line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; margin: 0.25rem 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 1.25rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
p { margin: 0 0 0.9rem; }
a { color: var(--accent-text); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }

button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Bottom tab bar */
.tabbar {
  flex: none; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  color: var(--muted); text-decoration: none; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.tabbar a .i { width: 1.5rem; height: 1.5rem; stroke-width: 1.8; }
.tabbar a[aria-current="page"] { color: var(--accent-text); }
.tabbar a[aria-current="page"] .i { stroke-width: 2.3; }

/* Buttons */
.btn .i { width: 1.2rem; height: 1.2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.9rem; padding: 0.6rem 1.2rem;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  font-weight: 600; text-decoration: none; text-align: center;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent-text); border-color: var(--accent-text); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: var(--bg); } }
.btn.primary:hover { background: var(--heading); border-color: var(--heading); color: var(--bg); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 2.3rem; padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.row > .btn { flex: 1 1 auto; }

/* Choice buttons */
.choices { display: grid; gap: 0.5rem; margin: 0 0 1rem; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice {
  display: block; width: 100%;
  text-align: left; padding: 0.75rem 1rem; min-height: 3rem;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius);
}
.choice:hover { border-color: var(--accent); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.choice .sub { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.choice .jp { display: block; font-size: 0.85rem; color: var(--muted); }

/* Cards */
.card {
  margin: 0 0 1rem; padding: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.card > :last-child { margin-bottom: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); }

.list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.list a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8rem 1rem; background: var(--card); color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.list a:hover { border-color: var(--accent); }
.list .t { font-weight: 600; }
.list .s { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.grow { flex: 1; min-width: 0; }

/* Icon circles for a kind of letter / application */
.av { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--accent-tint); color: var(--accent-text); }
.av .i { width: 1.35rem; height: 1.35rem; }
.av.pay { background: var(--pay-tint); color: var(--pay); }
.av.act { background: var(--act-tint); color: var(--act); }
.av.none, .av.done { background: var(--none-tint); color: var(--none); }

/* Home */
.onboard { text-align: left; }
.onboard .art, .art { display: block; width: 100%; max-width: 17rem; margin: 0 auto 0.5rem; }
.onboard h1 { font-size: 1.8rem; text-align: center; }
.lead { font-size: 1.05rem; text-align: center; }
.feat { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.75rem; }
.feat li { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.95rem; }
.fi { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 12px; }
.fi .i { width: 1.35rem; height: 1.35rem; }
.fi.pay, .ti.pay { background: var(--pay-tint); color: var(--pay); }
.fi.act, .ti.act { background: var(--act-tint); color: var(--act); }
.fi.none, .ti.none { background: var(--none-tint); color: var(--none); }
.ti.acc { background: var(--accent-tint); color: var(--accent-text); }

.hello { margin: 0.25rem 0 0; color: var(--muted); font-weight: 600; }
.big-title { font-size: 1.55rem; margin: 0.1rem 0 1rem; }
.hero {
  position: relative; overflow: hidden; display: flex; gap: 0.5rem; align-items: center;
  margin: 0 0 0.9rem; padding: 1.1rem 1rem 1.1rem 1.1rem; border-radius: 20px;
  background: linear-gradient(135deg, #0b7a72, #0e5f8a); color: #fff; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(11, 95, 120, 0.7);
}
.hero-t { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.hero-t b { font-size: 1.25rem; color: #fff; }
.hero-t > span { font-size: 0.9rem; opacity: 0.92; max-width: 13rem; }
.hero-btn { align-self: flex-start; display: inline-flex !important; align-items: center; gap: 0.4rem; margin-top: 0.35rem; padding: 0.5rem 0.9rem; border-radius: 999px; background: #fff; color: var(--accent-text) !important; font-weight: 700; font-size: 0.92rem !important; opacity: 1 !important; }
@media (prefers-color-scheme: dark) { .hero-btn { color: #0b7a72 !important; } }
.hero-art { position: absolute; right: -0.8rem; bottom: -1.2rem; color: rgba(255,255,255,0.18); }
.hero-art .i { width: 8.5rem; height: 8.5rem; stroke-width: 1.4; }
.upnext { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.9rem; padding: 0.75rem 0.9rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.upnext > .i { width: 1.4rem; height: 1.4rem; color: var(--pay); }
.upnext > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.35; }

.ti { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; }
.ti .i { width: 1.4rem; height: 1.4rem; }
.badge { position: absolute; top: 0.6rem; right: 0.6rem; min-width: 1.35rem; height: 1.35rem; padding: 0 0.35rem; border-radius: 999px; background: var(--warn); color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1.35rem; text-align: center; }
.quick { display: grid; gap: 0.5rem; }
.qbtn { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.7rem 0.85rem; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; }
.qbtn > .i { width: 1.5rem; height: 1.5rem; color: var(--accent-text); }
.qbtn b { display: block; font-size: 1rem; }
.qbtn span span { display: block; font-size: 0.8rem; color: var(--muted); }
.qbtn:hover { border-color: var(--accent); }

/* Settings profile row */
.profilecard { display: flex !important; align-items: center; gap: 0.75rem; }
.profilecard > span:nth-child(2) { flex: 1; }
.avatar { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--accent-tint); color: var(--accent-text); flex: none; }
.avatar .i { width: 1.5rem; height: 1.5rem; }

/* Letters */
.scanbar { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 16px; background: var(--accent-text); color: #fff; text-decoration: none; }
.scanbar b { color: #fff; font-size: 1.05rem; }
.scanbar .small { opacity: 0.9; }
.scanbar > span:nth-child(2) { flex: 1; line-height: 1.35; }
.scanbar .chev { color: #fff; }
.sb-ic { display: grid; place-items: center; flex: none; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: rgba(255,255,255,0.18); }
.sb-ic .i { width: 1.5rem; height: 1.5rem; }
@media (prefers-color-scheme: dark) { .scanbar, .send { background: #0f766e; } .apphead .mark { background: #1f1414; border-color: #ef5350; color: #ef5350; box-shadow: none; } }
.samples { display: grid; gap: 0.6rem; margin: 0 0 1rem; }
.sample { display: flex; gap: 0.85rem; align-items: center; padding: 0.6rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sample:hover { border-color: var(--accent); }
.sample .t { display: block; font-weight: 600; line-height: 1.3; }
.sample .s { display: block; font-size: 0.82rem; color: var(--muted); margin: 0.1rem 0 0.35rem; }
.thumb { position: relative; flex: none; width: 4.2rem; height: 5.4rem; overflow: hidden; border-radius: 6px; border: 1px solid #d6d2c4; background: #fffefa; box-shadow: 0 3px 8px rgba(0,0,0,0.12); pointer-events: none; }
.thumb .paper { position: absolute; top: 0; left: 0; width: 22rem; margin: 0; border: 0; box-shadow: none; transform: scale(0.19); transform-origin: 0 0; }
.lhead { display: flex; gap: 0.75rem; align-items: flex-start; }
.lhead .av { margin-top: 0.35rem; }
.lhead h1 { margin-bottom: 0.2rem; }
.words { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0 0 1rem; }
.word { display: flex; flex-direction: column; padding: 0.6rem 0.75rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 0.88rem; line-height: 1.35; }
.word b { font-size: 1.1rem; }

/* Camera */
.viewfinder { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; height: 15rem; margin: 0 0 1rem; border-radius: 20px; background: #1d232b; color: #cfd8e3; cursor: pointer; font-weight: 400; overflow: hidden; }
.vf-c { position: absolute; inset: 1.1rem; background:
  linear-gradient(#fff,#fff) top left / 1.6rem 3px, linear-gradient(#fff,#fff) top left / 3px 1.6rem,
  linear-gradient(#fff,#fff) top right / 1.6rem 3px, linear-gradient(#fff,#fff) top right / 3px 1.6rem,
  linear-gradient(#fff,#fff) bottom left / 1.6rem 3px, linear-gradient(#fff,#fff) bottom left / 3px 1.6rem,
  linear-gradient(#fff,#fff) bottom right / 1.6rem 3px, linear-gradient(#fff,#fff) bottom right / 3px 1.6rem;
  background-repeat: no-repeat; opacity: 0.85; }
.vf-doc .i { width: 3.5rem; height: 3.5rem; stroke-width: 1.3; opacity: 0.6; }
.vf-t { font-size: 0.85rem; }
.camrow { display: flex; align-items: center; justify-content: space-between; margin: 0 1rem 1.25rem; }
.roundbtn { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; width: 3.6rem; margin: 0; font-size: 0.72rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.roundbtn .i { width: 2.6rem; height: 2.6rem; padding: 0.55rem; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.roundbtn.ghost { visibility: hidden; }
.shutter { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; margin: 0; border-radius: 50%; border: 4px solid var(--accent-text); cursor: pointer; }
.shutter span { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--accent-text); }
.shutter:active span { transform: scale(0.9); }

/* City office */
.greet { display: flex; gap: 0.6rem; align-items: flex-end; margin: 0 0 1rem; }
.clerk { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--act-tint); color: var(--act); }
.clerk .i { width: 1.4rem; height: 1.4rem; }
.bubble { margin: 0; padding: 0.7rem 0.9rem; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line); }
.bubble [lang="ja"] { font-size: 1.05rem; }
.checklist .box { flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; border: 2px solid var(--muted); border-radius: 5px; }
main.chatview { padding-bottom: 0; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; padding-bottom: 0.75rem; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.typing { color: var(--muted); font-size: 0.9rem; }
.empty { margin: auto 0; padding: 1rem 0; text-align: center; }
.empty p { margin: 0.4rem 0 0.8rem; }
.cbar { display: flex; align-items: flex-end; gap: 0.5rem; }
.cbar textarea { flex: 1; min-height: 2.75rem; height: 2.75rem; max-height: 7.5rem; margin: 0; padding: 0.6rem 1rem; border-radius: 22px; resize: none; line-height: 1.4; }
.send { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: var(--accent-text); color: #fff; }
.send .i { width: 1.3rem; height: 1.3rem; stroke-width: 2.4; }
.iconbtn { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--accent-text); }
.iconbtn .i { width: 1.2rem; height: 1.2rem; }
.phrase .act .iconbtn { margin-left: 0.1rem; }

/* Chips */
.chip {
  display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap;
  background: var(--accent-tint); color: var(--accent-text);
}
.chip.pay  { background: var(--pay-tint);  color: var(--pay); }
.chip.act  { background: var(--act-tint);  color: var(--act); }
.chip.none { background: var(--none-tint); color: var(--none); }
.chip.warn { background: var(--warn-tint); color: var(--warn); }

/* Summary card for a letter */
.summary {
  margin: 0 0 1rem; padding: 1rem 1rem 0.6rem;
  background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--verdict, var(--accent));
  border-radius: var(--radius);
}
.summary.pay  { --verdict: var(--pay); }
.summary.act  { --verdict: var(--act); }
.summary.none { --verdict: var(--none); }
.summary .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0 0 0.9rem; }
.facts dt { color: var(--muted); font-size: 0.92rem; }
.facts dd { margin: 0; font-weight: 600; }
.steps { margin: 0 0 1rem; padding-left: 1.3rem; }
.steps li { margin-bottom: 0.45rem; }
.note { padding: 0.65rem 0.85rem; border-radius: 10px; background: var(--accent-tint); font-size: 0.95rem; margin: 0 0 1rem; }
.note.warn { background: var(--warn-tint); }
.note.pay { background: var(--pay-tint); }

/* Segmented control */
.seg { display: flex; gap: 0; margin: 0 0 0.75rem; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { flex: 1; padding: 0.55rem 0.4rem; border: 0; background: var(--card); color: var(--ink); font-size: 0.9rem; font-weight: 600; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-text); }

/* Paper: always looks like paper, even in dark mode */
.paper {
  position: relative; overflow: hidden;
  margin: 0 0 1rem; padding: 1.1rem 1rem 1rem;
  background: #fffefa; color: #222;
  border: 1px solid #d6d2c4; border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  font-size: 0.82rem; line-height: 1.7;
}
.paper .meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.75rem; }
.paper .to { margin: 0.6rem 0 0.4rem; font-size: 0.95rem; }
.paper .title { margin: 0.6rem 0 0.8rem; text-align: center; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em; }
.paper p { margin: 0 0 0.6rem; }
.paper .tw { overflow-x: auto; margin: 0.5rem 0 0.8rem; }
.paper table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.paper th, .paper td { border: 1px solid #999; padding: 0.25rem 0.4rem; text-align: left; vertical-align: top; }
.paper th { background: #efece2; font-weight: 600; }
.paper td.num { text-align: right; white-space: nowrap; }
.paper .from { margin-top: 0.8rem; text-align: right; font-size: 0.75rem; }
.paper .barcode { height: 2.2rem; margin: 0.6rem 0 0.2rem; background: repeating-linear-gradient(90deg, #222 0 2px, transparent 2px 4px, #222 4px 5px, transparent 5px 8px); }
.stamp {
  position: absolute; bottom: 0.8rem; left: 0.8rem;
  padding: 0.1rem 0.45rem; border: 2px solid #c0392b; border-radius: 4px;
  color: #c0392b; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em;
  transform: rotate(-6deg); opacity: 0.85;
}

/* Line-by-line translation */
.lines { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.lines li { padding: 0.65rem 0.8rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.lines .ja { display: block; font-size: 0.92rem; margin-bottom: 0.25rem; }
.lines .en { display: block; color: var(--muted); }
.fulltext { white-space: pre-wrap; }

/* Payment methods */
details.method { margin: 0 0 0.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
details.method > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.8rem 1rem; cursor: pointer; list-style: none; font-weight: 600;
}
details.method > summary::-webkit-details-marker { display: none; }
details.method > summary::after { content: "▾"; color: var(--muted); }
details.method[open] > summary::after { content: "▴"; }
details.method .body { padding: 0 1rem 0.9rem; }
details.method.off { opacity: 0.65; }
.why-off { display: block; font-size: 0.82rem; color: var(--muted); font-weight: 400; }
.proto-link::after { content: " ↗"; }

/* Scanner */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.6rem; margin: 0 0 1rem; }
.page { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.page img { display: block; width: 100%; height: 8rem; object-fit: cover; }
.page .n { position: absolute; top: 0.3rem; left: 0.3rem; padding: 0 0.4rem; border-radius: 6px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.75rem; }
.page .tools { display: flex; justify-content: space-between; }
.page .tools button { flex: 1; padding: 0.3rem 0; border: 0; border-top: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 0.85rem; }
.page .tools button + button { border-left: 1px solid var(--line); }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  min-height: 8rem; padding: 1rem; margin: 0 0 1rem;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--card);
  color: var(--muted); text-align: center; cursor: pointer;
}
.drop:hover { border-color: var(--accent); }
.drop .big { font-size: 2rem; color: var(--accent-text); }
.drop .big .i { width: 2.4rem; height: 2.4rem; stroke-width: 1.5; }
.spinner { display: inline-block; width: 1.1rem; height: 1.1rem; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -0.2rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms (inputs) */
label { display: block; margin: 0 0 0.3rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="tel"], input[type="date"], input[type="number"], textarea, select {
  width: 100%; margin: 0 0 1rem; padding: 0.65rem 0.75rem;
  font: inherit; color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius);
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; }
.check { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.5rem; font-weight: 400; }
.check input { width: 1.3rem; height: 1.3rem; }

/* Tablet-style form */
.tablet {
  margin: 0 0 1rem; padding: 0.6rem;
  background: #2b2f36; border-radius: 18px;
}
.tablet .paper { margin: 0; box-shadow: none; }
.formgrid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.formgrid th { width: 38%; white-space: normal !important; font-size: 0.76rem; }
.formgrid .en { display: block; color: #6b6b6b; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 0.66rem; font-weight: 400; }
.formgrid td { height: 2.4rem; padding: 0 !important; }
.formgrid tr { cursor: pointer; }
.formgrid tr:hover th, .formgrid tr:hover td { background: #fff7cc; }
.formgrid tr.cur th, .formgrid tr.cur td { background: #fff1a8; }
.formgrid tr.done .val::before { content: "✓ "; color: #15803d; }
.formgrid .val { display: block; padding: 0.3rem 0.4rem; color: #1d3fbf; font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Hiragino Sans", sans-serif; font-size: 0.82rem; min-height: 2.4rem; word-break: break-all; }
.formgrid .val:empty::after { content: "tap to fill"; color: #aaa; font-family: -apple-system, sans-serif; font-size: 0.7rem; }
.boxhelp {
  position: sticky; bottom: 0.5rem; z-index: 4;
  margin: 0 0 1rem; padding: 0.9rem 1rem;
  background: var(--card); border: 2px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.boxhelp .lbl { font-size: 0.8rem; color: var(--muted); }
.boxhelp .jp { font-size: 1.1rem; font-weight: 700; }
.boxhelp .ex { display: block; margin: 0.25rem 0 0.6rem; font-size: 0.9rem; }
.boxhelp .ex b { color: var(--act); }
.boxhelp input { margin-bottom: 0.6rem; }
.boxhelp .kana { margin: -0.3rem 0 0.6rem; font-size: 0.85rem; }
.boxhelp .nav { display: flex; gap: 0.5rem; }
.boxhelp .nav .btn { flex: 1; }
.progressbar { height: 0.45rem; background: var(--line); border-radius: 999px; overflow: hidden; margin: 0 0 0.75rem; }
.progressbar span { display: block; height: 100%; background: var(--accent); }

/* Checklist */
.checklist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.checklist li { display: flex; gap: 0.6rem; padding: 0.7rem 0.85rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.checklist .when { display: block; font-size: 0.82rem; color: var(--muted); }

/* Phrases */
.phrase { padding: 0.75rem 0.9rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 0.5rem; }
.phrase .en { font-weight: 600; }
.phrase .ja { font-size: 1.15rem; margin: 0.15rem 0 0; }
.phrase .act { align-items: center; }
.phrase .rd { font-size: 0.85rem; color: var(--muted); }
.phrase .act { display: flex; gap: 0.4rem; margin-top: 0.45rem; }

/* Show to staff (full screen) */
.staff {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column; justify-content: center; gap: 1rem;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  background: #fffef6; color: #111; text-align: center;
}
.staff .big { font-size: clamp(1.8rem, 8vw, 3.2rem); font-size: clamp(1.6rem, 9cqw, 3.2rem); font-weight: 700; line-height: 1.4; }
.staff .rd { font-size: 1.05rem; color: #555; }
.staff .en { font-size: 1rem; color: #555; }
.staff .hint { font-size: 0.85rem; color: #777; }
.staff .btn { align-self: center; background: #fff; color: #111; border-color: #bbb; }

.toast {
  position: absolute; left: 50%; bottom: calc(var(--tabbar) + 1rem); z-index: 60;
  transform: translateX(-50%);
  padding: 0.55rem 1rem; border-radius: 999px;
  background: var(--heading); color: var(--bg); font-size: 0.9rem; font-weight: 600;
}

.back { display: inline-block; margin: 0 0 0.5rem; color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.back:hover { color: var(--accent-text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tips { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.tips li { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.75rem 0.85rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 0.95rem; }
.tips li > .i { width: 1.4rem; height: 1.4rem; margin-top: 0.1rem; color: var(--accent-text); }
.findlbl { display: flex; align-items: center; gap: 0.4rem; margin: 0.9rem 0 0.35rem; font-weight: 600; color: var(--heading); }
.findlbl .i { color: var(--accent-text); }
.label-big { margin: 0 0 0.6rem; padding: 0.5rem; border-radius: 12px; background: #fff1a8; color: #222; text-align: center; font-size: 2rem; font-weight: 700; letter-spacing: 0.06em; }
.minimap { height: 11rem; overflow: hidden; margin: 0.5rem 0 0; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,0.15); pointer-events: none; }
.minimap .paper { margin: 0; box-shadow: none; padding: 0.6rem; }
.minimap .formgrid td { height: 2rem; }
.minimap .formgrid th { font-size: 0.7rem; }
.minimap tr.cur th, .minimap tr.cur td { background: #fff1a8; outline: 3px solid #e0a800; outline-offset: -3px; }
.minimap .here { display: block; padding: 0.35rem 0.4rem; color: #b45309; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 0.78rem; font-weight: 700; }
.minimap .staffrow th, .minimap .staffrow td { background: #e5e5e5; color: #777; }
.writebox { margin: 0 0 0.6rem; padding: 0.9rem 1rem; border: 2px dashed var(--accent); border-radius: 12px; background: var(--card); color: var(--heading); font-size: 1.6rem; font-weight: 700; line-height: 1.4; text-align: center; word-break: break-word; }
.writebox.opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1rem; font-size: 1.25rem; font-weight: 400; color: var(--muted); }
.writebox.opts span { padding: 0.2rem 0.6rem; border: 3px solid transparent; border-radius: 999px; }
.writebox.opts .circled { border-color: #c0392b; color: var(--heading); font-weight: 700; }
.writebox.empty { font-size: 0.95rem; font-weight: 400; color: var(--muted); border-color: var(--line); }
.formphoto { display: block; width: 100%; margin-top: 0.6rem; border-radius: 8px; border: 1px solid var(--line); }
.copynav { display: grid; grid-template-columns: 1fr 2fr; gap: 0.5rem; margin: 1rem 0 0.5rem; }
.note .i { color: var(--none); }
.minimap .val:empty::after { content: none; }

/* Voice input, small text buttons, numbered steps on the visit screen */
.mic { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--accent-text); }
.mic .i { width: 1.3rem; height: 1.3rem; }
.mic.on { background: var(--warn); border-color: var(--warn); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 0.5rem var(--warn-tint); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.linkbtn { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.5rem; padding: 0.25rem 0; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 0.88rem; font-weight: 600; text-align: left; cursor: pointer; }
.linkbtn .i { width: 1.05rem; height: 1.05rem; }
.check input[type="checkbox"] { flex: none; }

/* Counter mode: split screen. Top half faces the officer (upside down), bottom half faces you. */
.counter { position: absolute; inset: 0; z-index: 45; display: grid; grid-template-rows: minmax(0, 46%) minmax(0, 54%); background: var(--bg); }
.c-staff { transform: rotate(180deg); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.45rem; padding: 0.7rem 0.9rem; background: #fffef6; color: #111; text-align: center; border-bottom: 3px dashed #c9c3b2; overflow-y: auto; }
.c-lbl { margin: 0; font-size: 0.78rem; color: #666; }
.c-big { font-size: clamp(0.95rem, 4.3vw, 1.15rem); font-weight: 700; line-height: 1.45; }
.c-mic { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.1rem; border: 0; border-radius: 999px; background: #0b7a72; color: #fff; font: inherit; font-size: 0.95rem; font-weight: 700; }
.c-mic .i { width: 1.3rem; height: 1.3rem; }
.c-mic.on { background: #b91c1c; animation: pulse 1.2s ease-in-out infinite; }
.c-me { display: flex; flex-direction: column; min-height: 0; padding: 0.6rem 12px calc(0.6rem + env(safe-area-inset-bottom)); gap: 0.45rem; }
.c-head { display: flex; align-items: center; gap: 0.4rem; }
.c-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-head .btn.small { padding: 0.3rem 0.6rem; }
.c-thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.45rem; }
.cb { max-width: 92%; padding: 0.5rem 0.7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 0.92rem; }
.cb.me { align-self: flex-end; background: var(--accent-tint); }
.cb .who { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.cb .en { font-weight: 600; }
.cb .ja { font-size: 0.85rem; color: var(--muted); }
.cb .src { margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted); }
.cb .linkbtn { margin-top: 0.2rem; font-size: 0.8rem; }
.warnt { color: var(--warn); }
.c-sugg { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.2rem; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.c-sugg::-webkit-scrollbar { display: none; }
.c-tools { display: flex; align-items: center; gap: 0.75rem; }
.c-tools .muted { flex: 1; }
.c-tools .linkbtn { margin: 0; }
.c-sugg::-webkit-scrollbar { display: none; }
.c-sugg button { flex: none; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 2.9rem; max-width: 15rem; padding: 0.3rem 0.7rem; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; text-align: left; }
.c-sugg button span:first-child { font-weight: 700; font-size: 0.88rem; }
.c-sugg button span + span { font-size: 0.72rem; color: var(--muted); }
.c-notes { position: absolute; left: 0; right: 0; bottom: 0; top: 40%; z-index: 2; overflow-y: auto; padding: 1rem 16px; background: var(--bg); border-top: 1px solid var(--line); }

/* Scanned form with numbered pins */
.pinned { position: relative; margin: 0 0 0.75rem; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.pinned img { display: block; width: 100%; height: auto; }
.pin { display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 0.25rem; border-radius: 999px; background: #e11d48; color: #fff; font: 700 0.78rem/1 -apple-system, BlinkMacSystemFont, sans-serif; box-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.pinned .pin { position: absolute; transform: translate(-50%, -50%); }
.pinned .pin.off { background: #6b7280; }
.pinned .pin.cur { min-width: 2rem; height: 2rem; font-size: 1rem; outline: 3px solid #fde047; }
.pinned-sample th .pin { margin-right: 0.35rem; vertical-align: 0.05rem; }
.pinlist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.45rem; }
.pinlist li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.pinlist .grow { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.pinlist .lab { font-weight: 700; }
.pinlist .wr { font-size: 1.15rem; font-weight: 700; color: var(--accent-text); word-break: break-all; }
.pinlist li.staffonly { opacity: 0.7; }
.c-type { display: flex; gap: 0.35rem; width: 100%; max-width: 20rem; }
.c-type input { flex: 1; min-width: 0; margin: 0; padding: 0.4rem 0.6rem; border: 1px solid #c9c3b2; border-radius: 8px; background: #fff; color: #111; font-size: 0.9rem; }
.c-type button { padding: 0.4rem 0.7rem; border: 1px solid #c9c3b2; border-radius: 8px; background: #fff; color: #111; font: inherit; font-size: 0.85rem; font-weight: 700; }
.counter { grid-template-columns: minmax(0, 1fr); }
.c-staff, .c-me, .c-thread, .c-sugg { min-width: 0; }
.askbox { margin: 0 0 0.75rem; padding: 0.8rem 0.9rem; border: 2px dashed var(--accent); border-radius: 12px; background: var(--card); }
.askbox input { margin-bottom: 0.4rem; }
.asktitle { margin: 0 0 0.3rem; font-size: 1.05rem; }
.asktitle span { color: var(--muted); font-size: 0.9rem; }

/* Bottom sheet for short explanations */
.sheetwrap { position: absolute; inset: 0; z-index: 70; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0.45); }
.sheet { width: 100%; padding: 1.1rem 16px calc(1rem + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--bg); color: var(--ink); }
.sheet h2 { margin-top: 0; }
button.mode { border: 0; font-family: inherit; cursor: pointer; }
.nudge { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.9rem; text-decoration: none; color: var(--ink); }
.nudge > .i:first-child { width: 1.5rem; height: 1.5rem; color: var(--accent-text); flex: none; }
.nudge > span { flex: 1; }

/* Visit screen: two tabs, a numbered flow at the counter, and a bar that stays in reach */
.bring { display: grid; gap: 0.1rem; margin: 0 0 0.75rem; padding: 0.4rem 0.8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.bring .check { margin: 0; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.bring .check:last-child { border-bottom: 0; }
.flow { counter-reset: f; list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.flow > li { counter-increment: f; position: relative; padding: 0.8rem 0.9rem 0.9rem 2.6rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.flow > li::before { content: counter(f); position: absolute; left: 0.8rem; top: 0.8rem; display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--accent-text); color: var(--bg); font-size: 0.8rem; font-weight: 700; }
.flow .btn, .flow .row, .flow .qbtn { margin-top: 0.6rem; }
.flow .btn + .btn { margin-top: 0.45rem; }
.flow .row { display: flex; gap: 0.5rem; }
.flow .row .btn { flex: 1; margin-top: 0; }
main.haspin { padding-bottom: 0; }
.pinbar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 0.5rem; margin: 1rem -16px 0; padding: 0.6rem 16px; background: var(--bg); border-top: 1px solid var(--line); }
.pinbar .btn { flex: 1; margin: 0; padding-left: 0.5rem; padding-right: 0.5rem; }
.pinbar .btn:last-child:not(:first-child):not(:nth-child(2)) { flex: none; }
.checked { display: flex; gap: 0.4rem; align-items: flex-start; margin: 1rem 0 0; font-size: 0.82rem; color: var(--muted); }
.checked .i { flex: none; width: 1rem; height: 1rem; margin-top: 0.15rem; color: #15803d; }
.tablet .stamp, .paper .stamp { bottom: auto; top: 0.6rem; right: 0.6rem; left: auto; }
.pinlist.example { opacity: 0.85; }
.hero2 { text-decoration: none; display: flex; align-items: center; gap: 0.75rem; width: 100%; margin: 0 0 0.9rem; padding: 0.85rem 1rem; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--accent-tint); color: var(--heading); font: inherit; text-align: left; cursor: pointer; }
.hero2 > .i:first-child { width: 1.6rem; height: 1.6rem; color: var(--accent-text); flex: none; }
.hero2 > span { flex: 1; }
.hero2 > span span { font-size: 0.85rem; color: var(--muted); }
.actionline { margin: 0.2rem 0 0.4rem; font-size: 1.25rem; font-weight: 800; color: var(--heading); line-height: 1.3; }
.copynav { position: sticky; bottom: 0; z-index: 4; margin: 0.75rem -16px 0; padding: 0.6rem 16px; background: var(--bg); border-top: 1px solid var(--line); }
/* Checkboxes that are easy to see in both themes */
input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center; width: 1.35rem; height: 1.35rem; margin: 0; border: 2px solid var(--muted); border-radius: 6px; background: var(--card); cursor: pointer; }
input[type="checkbox"]::before { content: ""; width: 0.7rem; height: 0.7rem; transform: scale(0); transition: transform 0.1s; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: #fff; }
input[type="checkbox"]:checked { border-color: var(--accent-text); background: var(--accent-text); }
input[type="checkbox"]:checked::before { transform: scale(1); }
@media (prefers-color-scheme: dark) { input[type="checkbox"]::before { background: #0a1626; } }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.info { background: var(--line); color: var(--ink); }
.c-heard { margin: 0; padding: 0.35rem 0.6rem; border-radius: 8px; background: #efece2; font-size: 0.85rem; color: #333; }
.c-heard span { font-size: 0.75rem; color: #666; }
.phone.notab .tabbar { display: none; }

/* Counter mode: the card staff see first, staff answers, official words, the visit summary. */
.c-card { margin: 0; display: grid; gap: 0.1rem; font-size: 0.85rem; width: 100%; max-width: 22rem; padding: 0.5rem 0.75rem; border: 1px solid #d8d2c0; border-radius: 10px; background: #fff; text-align: left; }
.c-card div { display: flex; gap: 0.6rem; }
.c-card dt { flex: none; width: 4.5em; font-size: 0.8rem; color: #666; }
.c-card dd { margin: 0; font-weight: 700; }
.c-staff:has(.c-staffsays) { justify-content: flex-start; }
.c-staffsays { display: flex; flex: none; gap: 0.35rem; width: 100%; overflow-x: auto; padding-bottom: 0.2rem; scrollbar-width: none; }
.c-staffsays::-webkit-scrollbar { display: none; }
.c-staffsays button { flex: none; max-width: 12rem; padding: 0.35rem 0.55rem; border: 1px solid #c9c3b2; border-radius: 8px; background: #fff; color: #111; font: inherit; font-size: 0.82rem; text-align: left; }
.c-staffsays button:active { background: #efece2; }
.c-do { display: flex; gap: 0.35rem; margin-top: 0.35rem; padding: 0.4rem 0.5rem; border-radius: 8px; background: var(--accent-tint); font-size: 0.85rem; }
.c-do .i { flex: none; width: 1rem; height: 1rem; margin-top: 0.15rem; color: var(--accent-text); }
.c-terms { display: grid; gap: 0.15rem; margin-top: 0.3rem; font-size: 0.75rem; color: var(--muted); }
.c-terms b { color: var(--ink); }
.c-cardme { display: grid; gap: 0.35rem; margin: 0.45rem 0 0; padding-top: 0.4rem; border-top: 1px solid var(--line); }
.c-cardme dt { font-size: 0.72rem; color: var(--muted); }
.c-cardme dd { margin: 0; font-weight: 600; }
.c-cardme dd .ja { display: block; font-weight: 400; }
.c-summary { top: 0; }
.c-summary h3 { margin: 1rem 0 0.4rem; font-size: 1rem; }
.c-sum { margin: 0.5rem 0; max-height: 9rem; overflow: auto; white-space: pre-wrap; font: inherit; font-size: 0.82rem; color: var(--muted); }
p.kana { margin: -0.2rem 0 0.8rem; font-size: 0.88rem; color: var(--muted); }
.c-staff > * { flex: none; }
.c-empty { margin: auto 0; text-align: center; }
/* Writing pad on staff's half, hands-free listening bar, handwriting images. */
.c-type #staffPen { display: inline-flex; align-items: center; gap: 0.2rem; }
.c-type #staffPen .i { width: 1rem; height: 1rem; }
.c-pad { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem 0.8rem; background: #fffef6; }
.c-pad canvas { flex: 1; min-height: 0; width: 100%; border: 2px dashed #b9b29c; border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.c-padbar { display: flex; gap: 0.5rem; }
.c-padbar button { flex: 1; min-height: 2.6rem; border: 1px solid #c9c3b2; border-radius: 10px; background: #fff; color: #111; font: inherit; font-weight: 700; }
.c-padbar .go { background: #0b7a72; border-color: #0b7a72; color: #fff; }
.c-hand { display: block; width: 100%; max-width: 18rem; margin: 0.3rem 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.c-listen { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem; border-radius: 10px; background: var(--accent-tint); font-size: 0.85rem; font-weight: 600; }
.c-listen .btn { margin-left: auto; }
.c-tools { gap: 0.6rem; overflow-x: auto; scrollbar-width: none; }
.c-tools .linkbtn { flex: none; white-space: nowrap; font-size: 0.8rem; }
.c-tools .linkbtn[aria-pressed="false"] { color: var(--muted); }

/* ---------- Journey (week 06) ---------- */
:root { --hanko: #c0392b; }
@media (prefers-color-scheme: dark) { :root { --hanko: #f87171; } }
.progress { height: 0.6rem; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0 0 0.3rem; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.progress-t { margin: 0 0 0.9rem; }
.nextq { display: flex; flex-direction: column; gap: 0.15rem; margin: 0 0 1rem; padding: 1rem 1.1rem; border-radius: 20px; background: linear-gradient(135deg, #0b7a72, #0e5f8a); color: #fff; text-decoration: none; }
.nextq .muted { color: rgba(255,255,255,0.85); }
.nextq .warnt { color: #fde68a; }
.nq-t { font-size: 1.25rem; line-height: 1.25; }
.qgroup { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.2rem 0 0.45rem; }
.qnote { margin: -0.25rem 0 0.45rem; }
.qlist { display: grid; gap: 0.45rem; }
.qrow, details.later > summary { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 3.4rem; }
.qrow:hover { border-color: var(--accent); }
.qrow.locked { opacity: 0.6; }
.qrow.boss:not(.locked) { border-color: var(--pay); }
.qt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.qb { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--line); color: var(--muted); }
.qb .i { width: 1rem; height: 1rem; }
.qb.open { border-color: var(--accent); color: var(--accent-text); }
.qb.done { background: var(--none); border-color: var(--none); color: #fff; }
.qb.wait { border-style: dashed; border-color: var(--act); color: var(--act); }
.minihanko { flex: none; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border: 2px solid var(--hanko); border-radius: 50%; color: var(--hanko); font-size: 0.72rem; font-weight: 700; transform: rotate(-12deg); }
details.later { border-radius: var(--radius); }
details.later > summary { cursor: pointer; list-style: none; }
details.later > summary::-webkit-details-marker { display: none; }
details.later > summary > .i { flex: none; width: 1.3rem; height: 1.3rem; color: var(--accent-text); }
details.later[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }
details.later > p, details.later > a { margin: 0; padding: 0.6rem 0.9rem; background: var(--card); border: 1px solid var(--line); border-top: 0; }
details.later > a { display: flex; border-radius: 0 0 var(--radius) var(--radius); }
details.later > p:last-child { border-radius: 0 0 var(--radius) var(--radius); }

.q-jp { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; }
.q-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.4rem; }
.q-chips .chip { display: inline-flex; align-items: center; gap: 0.3rem; }
.q-chips .i { width: 0.95rem; height: 0.95rem; }
.q-lbl { display: flex; align-items: center; gap: 0.35rem; margin: 1rem 0 0.3rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card .q-lbl:first-child { margin-top: 0; }
.q-lbl .i { width: 1rem; height: 1rem; }
.q-steps { padding-left: 1.2rem; margin: 0 0 0.5rem; }
.q-steps li { margin-bottom: 0.35rem; }
.bring .check { margin-bottom: 0.4rem; }
.q-actions { display: grid; gap: 0.5rem; margin: 1rem 0; }
.q-done { margin-top: 1rem; }
.q-photo { display: block; max-width: 100%; border-radius: 10px; margin: 0.6rem 0; }
.note .i { width: 1rem; height: 1rem; vertical-align: -0.15rem; }
.office { margin-top: 0.75rem; }
.office-n { margin: 0 0 0.3rem; font-size: 1.15rem; }
.office .btn { margin-top: 0.4rem; }
.infodesk { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed var(--line); }
.infodesk p { margin: 0 0 0.5rem; }
.same { margin-top: 0.75rem; }

.ziprow { display: flex; gap: 0.5rem; align-items: flex-end; }
.ziprow > div { flex: 1; }
.ziprow .btn { min-height: 2.9rem; margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
#view input + label, #view select + label, .two-col + label { margin-top: 0.75rem; }
.addrprev { margin-top: 1rem; }
.addr-ja { font-size: 1.1rem; line-height: 1.5; margin: 0 0 0.5rem; word-break: break-all; }

.stampview { text-align: center; padding: 1rem 0 0.5rem; }
.stampview h1 { margin-top: 0.9rem; }
.hanko { display: inline-grid; place-items: center; align-content: center; width: 8.5rem; height: 8.5rem; border: 5px solid var(--hanko); border-radius: 50%; color: var(--hanko); transform: rotate(-12deg); }
.hanko span { font-size: 2.3rem; font-weight: 800; line-height: 1; }
.hanko small { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.2em; margin-top: 0.3rem; }
.hanko.fresh { animation: stampin 0.45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stampin { from { transform: rotate(-12deg) scale(2.2); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hanko.fresh { animation: none; } }
.unlock { margin-top: 1rem; }
.unlock .qrow { margin-top: 0.4rem; }
.filebtn { cursor: pointer; }
.choice.soon { opacity: 0.5; cursor: not-allowed; }
.nowrap { white-space: nowrap; }
.addr-ja { word-break: normal; }
.welcome { padding-top: 1.5rem; }
.welcome .w-hi { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--accent-text); }
.welcome h1 { font-size: 2rem; margin: 0.1rem 0 0.6rem; }
.welcome .lead { margin: 0 0 1.25rem; text-align: left; }
.steps-top { display: flex; justify-content: space-between; align-items: center; min-height: 2.2rem; margin-top: 0.25rem; }
.steps-top .linkbtn { margin-top: 0; font-size: 0.95rem; }
.center { text-align: center; }
.nq-s { font-size: 0.88rem; color: rgba(255,255,255,0.85); margin-bottom: 0.2rem; }
.center-b { display: block; margin: 0.75rem auto 0; text-align: center; }
.q-done .i { width: 1.1rem; height: 1.1rem; }

/* Journey: game-style level map. Each stage is a coloured world; levels sit on a winding road. */
.lvmap { position: relative; margin: 0.5rem -16px 0; overflow: hidden; border-radius: 22px 22px 0 0; }
.zone { position: relative; padding: 1.1rem 16px 2.4rem; background:
  radial-gradient(rgba(255,255,255,0.35) 1.4px, transparent 1.6px) 0 0 / 22px 22px,
  linear-gradient(var(--zt), var(--zb)); }
.zone + .zone::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 20px; background: var(--zt);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20 V10 Q15 0 30 10 T60 10 T90 10 T120 10 V20Z'/%3E%3C/svg%3E") 0 0 / 120px 20px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20 V10 Q15 0 30 10 T60 10 T90 10 T120 10 V20Z'/%3E%3C/svg%3E") 0 0 / 120px 20px repeat-x; }
.z-arrival  { --zt: #8fd3ff; --zb: #c9ecff; --zr: #1e88e5; --zr2: #1565c0; }
.z-before   { --zt: #b5e48c; --zb: #d9f2b4; --zr: #43a047; --zr2: #2e7d32; }
.z-cityhall { --zt: #d7cdf6; --zb: #ebe5ff; --zr: #7e57c2; --zr2: #5e35b1; }
.z-money    { --zt: #ffe08a; --zb: #fff1bf; --zr: #f59e0b; --zr2: #c27803; }
.z-post     { --zt: #ffc4d6; --zb: #ffe1ea; --zr: #e8457f; --zr2: #b02a5e; }
.z-work     { --zt: #ffc59a; --zb: #ffdcbf; --zr: #f4511e; --zr2: #bf360c; }
.z-goal     { --zt: #ffd7a8; --zb: #ffe9d1; padding-bottom: 8.5rem; }
@media (prefers-color-scheme: dark) {
  .zone { background: radial-gradient(rgba(255,255,255,0.14) 1.2px, transparent 1.4px) 0 0 / 26px 26px, linear-gradient(var(--zt), var(--zb)); }
  .z-arrival  { --zt: #0e2c52; --zb: #133a66; }
  .z-before   { --zt: #12361f; --zb: #17452a; }
  .z-cityhall { --zt: #251d48; --zb: #2f2659; }
  .z-money    { --zt: #3a2c08; --zb: #4a380c; }
  .z-post     { --zt: #3d1428; --zb: #4d1a33; }
  .z-work     { --zt: #3d1d0c; --zb: #4d2610; }
  .z-goal     { --zt: #2a1838; --zb: #3a2048; }
  .lv-deco svg, .lv-fuji svg { filter: brightness(0.82) saturate(0.9); }
}

/* Stage ribbon */
.ribbon { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; margin: 0 auto 0.4rem; width: max-content; max-width: 85%; }
.ribbon > span { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0.35rem 1.4rem 0.45rem; background: var(--zr); color: #fff; font-weight: 800; font-size: 1.02rem; line-height: 1.2; text-align: center; border-radius: 6px; box-shadow: 0 4px 0 var(--zr2); text-shadow: 0 1px 0 rgba(0,0,0,0.2); }
.ribbon > span::before, .ribbon > span::after { content: ""; position: absolute; top: 0.55rem; width: 1rem; height: 100%; background: var(--zr2); z-index: -1; }
.ribbon > span::before { left: -0.75rem; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.ribbon > span::after { right: -0.75rem; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.ribbon small { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.ribbon em { margin-top: 0.55rem; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--card); color: var(--ink); font-style: normal; font-size: 0.75rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.ribbon em .i { width: 0.8rem; height: 0.8rem; color: var(--none); }
.ribbon.clear em { color: var(--none); }

/* Road */
.lv-path { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lv-path path { fill: none; stroke-linecap: round; }
.lv-path .r-edge { stroke: #d9b97a; stroke-width: 30; }
.lv-path .r-fill { stroke: #fff4d6; stroke-width: 24; }
.lv-path .r-dash { stroke: #e8cf98; stroke-width: 4; stroke-dasharray: 9 11; }
.lv-path .r-trail { stroke: #ffc928; stroke-width: 8; }
@media (prefers-color-scheme: dark) {
  .lv-path .r-edge { stroke: #0a1220; } .lv-path .r-fill { stroke: #3a4a62; } .lv-path .r-dash { stroke: #5b6d88; } .lv-path .r-trail { stroke: #e0a800; }
}

/* Scenery */
.lv-deco { position: absolute; z-index: 1; width: 6.6rem; pointer-events: none; }
.lv-deco.l { left: 0.4rem; }
.lv-deco.r { right: 0.4rem; }
.lv-deco svg { display: block; width: 100%; height: auto; overflow: visible; }
.lv-fuji { position: absolute; z-index: 0; left: 0; right: 0; bottom: 0; height: 10rem; pointer-events: none; }
.lv-fuji svg { display: block; width: 100%; height: 100%; }
.dk-fly { animation: dkfly 4s ease-in-out infinite; }
.dk-fly2 { animation: dkfly2 3s ease-in-out infinite; }
.dk-fall { animation: dkfall 5s ease-in-out infinite; }
@keyframes dkfly { 50% { transform: translate(3px, -5px); } }
@keyframes dkfly2 { 50% { transform: translate(-3px, -4px); } }
@keyframes dkfall { 50% { transform: translate(-3px, 5px); } }

/* Levels: shiny candy buttons */
.lv { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 9rem; margin: 1.1rem 0 0 calc(var(--x) - 4.5rem); color: var(--ink); text-decoration: none; text-align: center; -webkit-tap-highlight-color: transparent; }
.lv.cur { margin-top: 3.6rem; }
.lv-dot { position: relative; display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border-radius: 50%; border: 4px solid #fff; color: #fff;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.75) 0 9%, rgba(255,255,255,0) 22%), linear-gradient(#cfd6de, #9aa6b3);
  box-shadow: 0 6px 0 #77838f, 0 10px 16px rgba(0,0,0,0.18); transition: transform 0.12s; }
.lv-dot b { font-size: 1.75rem; font-weight: 900; line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,0.22); }
.lv:active .lv-dot { transform: translateY(4px); box-shadow: 0 2px 0 #77838f, 0 4px 8px rgba(0,0,0,0.18); }
.lv.open .lv-dot { background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.8) 0 9%, rgba(255,255,255,0) 22%), linear-gradient(#5eead4, #0fa492); box-shadow: 0 6px 0 #0b7a6c, 0 10px 16px rgba(0,0,0,0.2); }
.lv.boss.open .lv-dot { background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.8) 0 9%, rgba(255,255,255,0) 22%), linear-gradient(#ff8fbb, #e8457f); box-shadow: 0 6px 0 #a3245a, 0 10px 16px rgba(0,0,0,0.2); }
.lv.wait .lv-dot { background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.8) 0 9%, rgba(255,255,255,0) 22%), linear-gradient(#b99bff, #7c4dff); box-shadow: 0 6px 0 #5530c4, 0 10px 16px rgba(0,0,0,0.2); }
.lv.done .lv-dot { background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.85) 0 9%, rgba(255,255,255,0) 22%), linear-gradient(#ffe680, #f5b400); box-shadow: 0 6px 0 #c48a00, 0 10px 16px rgba(0,0,0,0.18); }
.lv.boss .lv-dot { width: 5.2rem; height: 5.2rem; }
.lv-stamp { display: grid; place-items: center; width: 74%; height: 74%; border: 2.5px solid #c62828; border-radius: 50%; color: #c62828; font-weight: 900; font-size: 1rem; transform: rotate(-14deg); background: rgba(255,255,255,0.35); }
.lv-lock { position: absolute; right: -0.35rem; bottom: -0.25rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #fff; color: #5a6573; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.lv-lock .i { width: 0.9rem; height: 0.9rem; }
.lv.cur .lv-dot { animation: lvpulse 1.6s ease-in-out infinite; }
@keyframes lvpulse { 0%, 100% { outline: 0 solid rgba(255,255,255,0); } 50% { outline: 0.5rem solid rgba(255,255,255,0.6); } }
/* You are here */
.lv-me { position: absolute; z-index: 3; top: -2.9rem; display: flex; align-items: center; gap: 0.3rem; height: 2.2rem; padding: 0 0.75rem 0 0.55rem; border-radius: 999px; border: 3px solid #fff; background: linear-gradient(#ffb74d, #f4511e); color: #fff; font-weight: 800; font-size: 0.8rem; white-space: nowrap; letter-spacing: 0.01em; box-shadow: 0 3px 8px rgba(0,0,0,0.25); animation: lvbob 1.4s ease-in-out infinite; }
.lv-me::after { content: ""; position: absolute; bottom: -0.6rem; left: 50%; margin-left: -0.4rem; border: 0.4rem solid transparent; border-bottom: 0; border-top: 0.55rem solid #fff; }
.lv-me .i { width: 1rem; height: 1rem; flex: none; }
/* Just stamped: the stamp lands again on the map */
.lv.just .lv-stamp { animation: lvstamp 0.6s cubic-bezier(.2,1.4,.4,1) 0.25s both; }
.lv.just .lv-dot { animation: lvpulse 1.2s ease-in-out 0.6s 2; }
@keyframes lvstamp { from { transform: rotate(-14deg) scale(2.2); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }
@keyframes lvbob { 50% { transform: translateY(-5px); } }
.lv-l { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; margin-top: 0.6rem; padding: 0.25rem 0.6rem 0.3rem; border-radius: 12px; background: var(--card); box-shadow: 0 2px 6px rgba(0,0,0,0.12); line-height: 1.25; }
.lv-l b { font-size: 0.92rem; }
.lv-l .small { font-size: 0.82rem; }
.lv-l .chip { margin-top: 0.15rem; }
.lv.locked .lv-l b { color: var(--muted); }
.lv.goal { width: 16rem; margin-left: calc(50% - 8rem); margin-top: 1.5rem; }
.lv.goal .lv-dot { width: 5.6rem; height: 5.6rem; background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.85) 0 9%, rgba(255,255,255,0) 22%), linear-gradient(#fff, #e9edf2); box-shadow: 0 6px 0 #b8c2cc, 0 10px 16px rgba(0,0,0,0.18); }
.lv.goal .lv-stamp { border-style: dashed; border-color: #9aa6b3; color: #9aa6b3; font-size: 1.6rem; }
.lv.goal.done .lv-dot { background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.85) 0 9%, rgba(255,255,255,0) 22%), linear-gradient(#ffe680, #f5b400); box-shadow: 0 6px 0 #c48a00, 0 10px 16px rgba(0,0,0,0.18); }
.lv.goal.done .lv-stamp { border-style: solid; border-color: #c62828; color: #c62828; }
@media (prefers-color-scheme: dark) { .lv-dot, .lv-me { border-color: #e6edf3; } }
@media (prefers-reduced-motion: reduce) { .lv.cur .lv-dot, .lv.just .lv-dot, .lv.just .lv-stamp, .lv-me, .dk-fly, .dk-fly2, .dk-fall { animation: none; } }

/* ---------- Week 07: facts not checked yet ---------- */
.unsure { display: inline-block; margin-left: 0.2rem; padding: 0 0.45rem; border-radius: 999px; background: var(--pay-tint); color: var(--pay); font-size: 0.78em; font-weight: 600; white-space: nowrap; }

/* ---------- Week 07: practise the visit ---------- */
a.card.rh-cta { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0; padding: 0.85rem 0.9rem; text-decoration: none; color: var(--ink); border: 2px solid var(--accent); background: var(--accent-tint); }
.rh-cta .chev { margin-left: auto; flex: none; color: var(--accent-text); }
.rh-cta-i { display: grid; place-items: center; flex: none; width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--accent-text); color: var(--accent-text); font-weight: 900; font-size: 0.85rem; line-height: 1.05; text-align: center; transform: rotate(-8deg); }
.rh-cta.is-ready { border-color: var(--none); background: var(--none-tint); }
.rh-cta.is-ready .rh-cta-i { border-color: #c62828; color: #c62828; font-size: 0.72rem; }
.rh-how { list-style: none; padding: 0; margin: 0.75rem 0; display: grid; gap: 0.5rem; }
.rh-how li { display: flex; gap: 0.5rem; align-items: flex-start; }
.rh-how .i { flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; color: var(--accent-text); }

.rh-top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.rh-top .back { margin: 0; }
.rh-dots { display: flex; gap: 3px; flex: 1; }
.rh-dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.rh-dots i.d { background: var(--accent); }
.rh-dots i.c { background: var(--accent-text); }
.rh-slips { font-size: 0.8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.rh-slips.bad { color: var(--warn); }
.rh-where { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.25rem 0 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.rh-where .i { width: 1rem; height: 1rem; }
.rh-staff { position: relative; padding: 0.9rem 1rem 0.6rem; border-radius: 16px 16px 16px 4px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; }
.rh-trap { margin-bottom: 0.4rem; }
.rh-ja { margin: 0 0 0.35rem; font-size: 1.3rem; font-weight: 700; line-height: 1.45; color: var(--heading); }
.rh-tools { display: flex; gap: 1rem; flex-wrap: wrap; }
.rh-tools .linkbtn { margin-top: 0; }
.rh-tools .i { width: 1rem; height: 1rem; }
.rh-en { margin: 0.4rem 0 0.2rem; padding-top: 0.4rem; border-top: 1px dashed var(--line); font-size: 0.95rem; }
.rh-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.rh-timer i { display: block; height: 100%; background: var(--pay); transform-origin: left; animation: rhtime 22s linear forwards; }
.rh-done .rh-timer i { animation-play-state: paused; opacity: 0.3; }
@keyframes rhtime { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.rh-opts { display: grid; gap: 0.55rem; }
.rh-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; min-height: 3rem; padding: 0.7rem 0.9rem; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.rh-opt:hover:not(:disabled) { border-color: var(--accent); }
.rh-opt:disabled { cursor: default; }
.rh-opt.ok { border-color: var(--none); background: var(--none-tint); }
.rh-opt.no { border-color: var(--warn); background: var(--warn-tint); opacity: 0.75; }
.rh-opt:disabled:not(.ok):not(.no) { opacity: 0.45; }
.rh-act { display: flex; gap: 0.35rem; align-items: flex-start; font-weight: 600; }
.rh-act .i { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; color: var(--accent-text); }
.rh-say { font-weight: 600; }
.rh-saja { font-size: 0.85rem; color: var(--muted); }
#rhFb { margin-top: 0.75rem; }
#rhFb .note { margin-bottom: 0.6rem; }
.rh-good { background: var(--none-tint); }
.rh-end { text-align: center; margin: 0.5rem 0 1rem; }
.rh-end h1 { margin-top: 0.6rem; }
.rh-hanko { display: inline-grid; place-items: center; width: 6rem; height: 6rem; border-radius: 50%; border: 4px solid #c62828; color: #c62828; font-size: 1.4rem; font-weight: 900; line-height: 1.1; transform: rotate(-10deg); animation: rhstamp 0.45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes rhstamp { from { transform: rotate(-10deg) scale(2.2); opacity: 0; } to { transform: rotate(-10deg) scale(1); opacity: 1; } }
@media (prefers-color-scheme: dark) { .rh-hanko, .rh-cta.is-ready .rh-cta-i { border-color: #ef5350; color: #ef5350; } }
.rh-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.6rem; }
.rh-list li { display: grid; gap: 0.15rem; padding: 0.7rem 0.85rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.rh-list li > span[lang="ja"] { font-weight: 700; }
.rh-phrase { margin: 0 0 0.6rem; }
.rh-phrase .linkbtn { margin: 0; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .rh-hanko { animation: none; } .rh-timer i { animation-duration: 22s; } }

/* ---------- Week 07: Junbi name ---------- */
.apphead .brand-ja { margin-left: 0.15rem; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.welcome .w-brand { margin: 0 0 0.1rem; font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em; color: var(--accent-text); }
.welcome .w-brand span { margin-left: 0.25rem; font-weight: 600; color: var(--muted); }
.welcome .w-tag { margin: 0 0 1rem; font-size: 0.92rem; color: var(--muted); }

/* ---------- Week 07: UI review fixes ---------- */
#view:focus { outline: none; }
.donow { margin: 0.25rem 0 0.75rem; padding: 0.75rem 0.8rem 0.4rem; border-radius: 16px; background: var(--card); border: 2px solid var(--accent); }
.donow .q-lbl { margin-top: 0; color: var(--accent-text); }
.dn-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 3rem; }
.dn-row:first-of-type { border-top: 0; }
.dn-row .qt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.dn-row .chev { flex: none; color: var(--muted); }
.dn-row.urgent .qb { border-color: var(--warn); color: var(--warn); }
a.card.letter-cta { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.85rem; color: var(--ink); text-decoration: none; }
.letter-cta > .i:first-child { flex: none; width: 1.5rem; height: 1.5rem; color: var(--accent-text); }
.letter-cta .chev { margin-left: auto; flex: none; color: var(--muted); }
.qgroup.map-h { margin: 1.1rem 0 0.4rem; }
.field-err { margin: 0.9rem 0 0; padding: 0.55rem 0.8rem; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-weight: 600; font-size: 0.95rem; }
[aria-invalid="true"] { border-color: var(--warn) !important; }
.btn.cm-start { margin: 0.25rem 0 1rem; min-height: 3.4rem; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.choice:disabled { opacity: 0.55; cursor: not-allowed; }
.lv-me .i { width: 1.3rem; height: 1.3rem; }
/* Counter mode: reply chips stay one short row, so the conversation gets the room */
.c-sugg button { max-width: 12.5rem; min-height: 2.6rem; padding: 0.25rem 0.65rem; }
.c-sugg button span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.card.rh-cta { text-align: left; }

/* ---------- Week 08 ---------- */
/* Phrases to say: big Japanese line, English under it, tap to play */
.say { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.6rem; width: 100%; text-align: left; margin: 0 0 0.5rem; padding: 0.7rem 0.85rem;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; cursor: pointer; }
.say > * { grid-column: 1; }
.say b { font-size: 1.05rem; line-height: 1.45; color: var(--heading); }
.say .say-i { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 1.4rem; height: 1.4rem; color: var(--accent-text); }
.say.big b { font-size: 1.3rem; }
.say:active { background: var(--accent-tint); }

/* "Stuck?" link */
a.card.stuck-cta { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0; text-decoration: none; color: var(--ink); border: 2px solid var(--pay); background: var(--pay-tint); }
.stuck-cta .chev { margin-left: auto; flex: none; color: var(--pay); }
.stuck-i { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--pay); color: var(--card); font-weight: 900; font-size: 1.3rem; }

/* The bank <-> phone loop */
.loopd { display: flex; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0.75rem; }
.lp { display: inline-flex; align-items: center; gap: 0.3rem; flex: none; padding: 0.45rem 0.65rem; border-radius: 999px; border: 2px solid var(--line); font-weight: 700; font-size: 0.9rem; }
.lp svg { width: 1rem; height: 1rem; }
.lp.here { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-text); }
.la { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 0.72rem; line-height: 1.3; color: var(--muted); text-align: center; }
.la span:first-child { border-bottom: 1px dashed var(--line); padding-bottom: 0.15rem; margin-bottom: 0.15rem; }

/* My papers */
.papers { padding: 0.25rem 0.9rem; }
.pp-row { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.pp-row:last-child { border-bottom: 0; }
.pp-k { margin: 0; font-size: 0.8rem; color: var(--muted); }
.pp-k b { color: var(--ink); font-size: 0.9rem; }
.pp-v { margin: 0.15rem 0 0; font-size: 1.2rem; font-weight: 700; color: var(--heading); line-height: 1.4; overflow-wrap: anywhere; }
.pp-v .addr-ja { font-size: 1.15rem; margin: 0; }
.pp-s { margin: 0; color: var(--muted); }
.pp-none { margin: 0.15rem 0 0; }
.pp-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.pp-shot { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pp-shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }

/* What leaves your phone */
.privacy p { margin: 0 0 0.4rem; }
.privacy ul { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.privacy li { margin-bottom: 0.3rem; }

/* ---------- Week 09 ---------- */
/* Text size buttons */
.seg-b { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; line-height: 1.1; }
.seg-b small { font-size: 0.7rem; font-weight: 500; }
/* A stamp without its proof photo stays faded until you add one */
.lv.done.noproof .lv-dot { filter: grayscale(0.7); opacity: 0.6; }
a.card.proof-cta { display: flex; align-items: center; gap: 0.7rem; margin: 0.75rem 0; padding: 0.75rem 0.85rem; color: var(--ink); text-decoration: none; border: 2px dashed var(--accent); }
.proof-cta > .i:first-child { flex: none; width: 1.5rem; height: 1.5rem; color: var(--accent-text); }
.proof-cta .chev { margin-left: auto; flex: none; color: var(--muted); }

/* ---------- Week 08b: UI/UX review fixes ---------- */
/* Counter mode: the student's half comes first in the page (screen readers), staff's half still sits on top */
.c-staff { grid-row: 1; justify-content: flex-start; }
.c-me { grid-row: 2; }
.c-staff > :first-child { margin-top: auto; }
.c-staff > :last-child { margin-bottom: auto; }
/* Staff read across a counter, upside down: big text */
.c-big { font-size: clamp(1.35rem, 6.4vw, 1.75rem); line-height: 1.4; }
.c-big.c-idle { font-size: 1.05rem; font-weight: 600; color: #6b6b6b; }
.c-ack { display: flex; align-items: flex-start; gap: 0.4rem; margin: 0; padding: 0.45rem 0.7rem; border-radius: 10px; background: #e3f4ef; color: #0b5e57; font-size: 0.95rem; font-weight: 700; text-align: left; }
.c-ack .i { flex: none; width: 1.2rem; height: 1.2rem; margin-top: 0.1rem; }
.c-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.c-mic { min-height: 48px; }
.c-more { min-height: 48px; padding: 0.5rem 1rem; border: 2px solid #0b7a72; border-radius: 999px; background: #fff; color: #0b5e57; font: inherit; font-size: 0.95rem; font-weight: 700; }
.c-staffsays { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; overflow: visible; }
.c-staffsays button { max-width: none; min-height: 44px; font-size: 0.9rem; line-height: 1.35; }
.c-type input, .c-type button { min-height: 44px; }
/* Student half: 44px controls */
.c-head .iconbtn { width: 44px; height: 44px; }
.c-head .btn.small { min-height: 44px; padding: 0.4rem 0.9rem; }
.c-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0.35rem; overflow: visible; }
.c-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-height: 44px; padding: 0.25rem 0.2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--accent-text); font: inherit; font-size: 0.72rem; font-weight: 700; line-height: 1.15; text-align: center; }
.c-tool .i { width: 1.1rem; height: 1.1rem; }
.c-tool[aria-pressed="false"] { color: var(--muted); }
.cbar .mic, .cbar .send { min-width: 44px; min-height: 44px; }

/* Toasts never block a tap; in counter mode they sit under the header of your half */
.toast { pointer-events: none; max-width: calc(100% - 2rem); text-align: center; }
.toast.top { bottom: auto; top: calc(46% + 3.6rem); }
/* Map: a stamp waiting for its photo stays in full colour, with a small camera badge */
.lv.done.noproof .lv-dot { filter: none; opacity: 1; }
.lv-proof { position: absolute; right: -0.35rem; bottom: -0.25rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #fff; color: #0b7a72; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.lv-proof .i { width: 0.95rem; height: 0.95rem; }
/* "You are here": solid dark orange, readable white text (about 5:1) */
.lv-me { background: #c2410c; }
.dn-more { margin: 0.35rem 0 0; text-align: center; }
/* "May differ" and other amber chips: bigger and darker in light mode */
.unsure { font-size: 0.85rem; color: #92400e; }
.chip.pay { color: #92400e; }
@media (prefers-color-scheme: dark) { .unsure, .chip.pay { color: var(--pay); } }
/* Touch targets */
.apphead .mode { position: relative; }
.apphead .mode::after { content: ""; position: absolute; inset: -11px -6px; }
.hback { min-height: 44px; }
.rh-top .back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem 0 0; }
.rh-tools .linkbtn { min-height: 44px; margin-top: 0; }
.btn-quiet { margin-top: 0.5rem; border-color: transparent; background: none; color: var(--accent-text); box-shadow: none; }
.btn-danger { color: var(--warn); border-color: var(--warn); }
.btn-danger .i { width: 1.1rem; height: 1.1rem; }
/* The "Stuck?" card: helpful, but quieter than the main button */
a.card.stuck-cta { border: 1px solid var(--line); background: var(--card); }
.stuck-i { width: 2.2rem; height: 2.2rem; font-size: 1.1rem; background: var(--pay-tint); color: var(--pay); }
.stuck-cta .chev { color: var(--muted); }
/* Practise: the Japanese you'd say comes first */
.rh-saja { font-size: 1rem; font-weight: 700; color: var(--heading); }
.rh-say { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.c-actions { flex-wrap: nowrap; }
.c-actions > button { flex: 1; justify-content: center; max-width: 11rem; }
/* Shorter phones: tighter staff half, 4 common answers (the rest are under 入力・その他) */
@media (max-height: 760px) {
  .c-staff { gap: 0.3rem; padding: 0.45rem 0.8rem; }
  .c-big { font-size: clamp(1.2rem, 5.6vw, 1.5rem); line-height: 1.35; }
  .c-ack { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
  .c-staffsays:not(.all) button:nth-child(n+5) { display: none; }
}
@media (max-height: 700px) {
  .c-staff > .c-lbl:first-child { display: none; }
  .c-card { font-size: 0.8rem; padding: 0.35rem 0.6rem; }
  .c-big { line-height: 1.3; }
}
.c-actions > button { white-space: nowrap; }

/* Counter mode translation checks (1124t): "Did you mean…?" choices, numbers read directly, "Maybe" */
.c-pick { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.45rem; }
.cb .btn.small { min-height: 44px; }
.c-pick .btn.small { flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; text-align: left; }
.c-pick .btn.small span[lang="ja"] { font-size: 0.8rem; font-weight: 400; opacity: 0.85; }
.c-facts { margin-top: 0.35rem; padding: 0.35rem 0.5rem; border-radius: 8px; background: var(--accent-tint); font-size: 0.85rem; font-weight: 600; }
.c-maybe { margin-top: 0.35rem; font-size: 0.85rem; }
.c-askja { margin-bottom: 0.3rem; }
.c-askja button { border-color: #0b5e57; }
