/* "Deeply Connected" (深い関係 / Fukai Kankei) brand — shared with the
   FKTI dining + learning apps. Dark ink navy, cream paper, vermilion accent. */
:root {
  --ink: #13182B;        /* app background */
  --ink2: #1E2540;       /* header / nav / chrome surface */
  --ink3: #2A3358;       /* raised surface (chat bubbles) */
  --paper: #F7F4EC;      /* cream cards */
  --ver: #E2553B;        /* vermilion brand accent / primary action */
  --caution: #C77800;
  --safe-green: #2E7D32;
  --self: #3B82F6;       /* map "your location" blue (kept for legibility) */

  /* mapped to the generic names the components already use */
  --bg: var(--ink);
  --surface: var(--ink2);
  --text: #EDEFF8;       /* text on ink */
  --text-paper: #1B2233; /* text on cream */
  --muted: #9AA0B6;
  --border: #313a5e;
  --primary: var(--ver);
  --sos: #E11D2E;        /* alarm red, distinct from the warm vermilion */
  --ok: #5fd07a;

  --display: "Hiragino Mincho ProN", "Yu Mincho", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--text);
  overscroll-behavior: none;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--sos); min-height: 1.2em; }
button { font: inherit; cursor: pointer; border: none; border-radius: 10px; }
input { font: inherit; }
a { color: var(--primary); }

/* ---- Hub / landing ---- */
#hub { min-height: 100%; display: grid; place-items: center; padding: 28px 20px calc(28px + var(--safe-bottom)); background:
  radial-gradient(120% 90% at 50% 0%, #1b2240 0%, var(--ink) 60%); }
.hub-inner { width: 100%; max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hub-logo { width: 84px; height: 84px; border-radius: 18px; box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.hub-brand { font-family: var(--display); font-size: 1.5rem; font-weight: 600; margin-top: 14px; }
.hub-jp { font-family: var(--display); color: var(--ver); letter-spacing: 6px; font-size: 1.1rem; margin-top: 2px; }
.hub-welcome { color: var(--muted); font-size: 0.95rem; margin: 14px 0 22px; }
.hub-tiles { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.hub-tile {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 18px;
  background: var(--paper); color: var(--text-paper); border: none; text-align: left;
  box-shadow: 0 10px 26px rgba(0,0,0,0.32); transition: transform 0.06s ease;
}
.hub-tile:active { transform: scale(0.98); }
.hub-tile .jp { font-family: var(--display); font-size: 2.4rem; font-weight: 600; line-height: 1; flex: 0 0 auto; width: 86px; text-align: center; }
.hub-tile .en { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.5px; }
.hub-tile.t-travel .jp { color: #E2553B; }
.hub-tile.t-dining .jp { color: #E08214; }
.hub-tile.t-learning .jp { color: #6E8B3D; }
.hub-update { display: none; width: 100%; margin: 0 0 14px; background: var(--ver); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; text-align: left; box-shadow: 0 6px 18px rgba(226,85,59,0.35); }
.hub-update.show { display: block; }
.hub-update button { margin-top: 8px; background: #fff; color: var(--ver); border-radius: 8px; padding: 7px 14px; font-weight: 700; }
.hub-signout { margin-top: 24px; background: transparent; color: var(--muted); font-size: 0.85rem; padding: 8px 14px; }
.hub-check { background: transparent; color: var(--muted); font-size: 0.78rem; padding: 6px; margin-top: 2px; opacity: 0.8; }
.link-back { position: absolute; top: calc(10px + var(--safe-top)); left: 12px; background: transparent; color: var(--muted); font-size: 0.95rem; padding: 8px 10px; z-index: 5; }

/* ---- Login ---- */
#login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 24px; width: 100%; max-width: 380px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }

/* Brand lockup (shared "Deeply Connected" family style) */
.brand-badge { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); flex: 0 0 auto; }
.brand-badge.big { width: 76px; height: 76px; border-radius: 18px; }
.brand-wrap { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 1.12; white-space: nowrap; }
.brand-title b { color: var(--ver); font-weight: 600; }
.brand-title.big { font-size: 23px; }
.brand-jp { font-size: 10px; color: var(--muted); letter-spacing: 3px; margin-top: 2px; }
.login-card label { display: block; margin: 16px 0 0; font-size: 0.9rem; color: var(--muted); }
.login-card input {
  width: 100%; margin-top: 6px; padding: 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 1rem;
}
.primary { background: var(--primary); color: #fff; padding: 12px 16px; }
.primary.big { width: 100%; margin-top: 22px; padding: 16px; font-size: 1.05rem; font-weight: 600; }

/* ---- App shell ---- */
#app { display: flex; flex-direction: column; height: 100%; }
#topbar {
  display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-top)) 12px 8px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.badge-btn { background: transparent; padding: 0; border-radius: 9px; flex: 0 0 auto; }
#topbar .brand-wrap { line-height: 1.12; }
#topbar .brand-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn { font-size: 0.85rem; vertical-align: middle; }
.conn.ok { color: var(--ok); }
.conn.off { color: var(--muted); }
.user { margin-left: auto; text-align: right; font-size: 0.8rem; min-width: 0; }
#user-name { display: block; font-weight: 600; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; }

/* App launcher sheet (sister apps) */
#apps-sheet { position: fixed; inset: 0; z-index: 2500; background: rgba(8,10,20,0.6); display: none; }
#apps-sheet.show { display: block; }
.apps-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ink2); border-top-left-radius: 18px; border-top-right-radius: 18px; padding: 18px 16px calc(18px + var(--safe-bottom)); }
.apps-panel h3 { margin: 4px 0 12px; font-family: var(--display); font-weight: 600; }
a.app-tile { display: flex; align-items: center; gap: 14px; background: var(--paper); color: var(--text-paper); border: 1px solid #e3d9c6; border-radius: 16px; padding: 16px; margin: 10px 0; text-decoration: none; box-shadow: 0 8px 22px rgba(0,0,0,.28); }
a.app-tile .ic { font-family: var(--display); font-size: 26px; color: var(--ver); width: 44px; text-align: center; flex: 0 0 auto; }
a.app-tile h4 { margin: 0; font-size: 16px; }
a.app-tile p { margin: 3px 0 0; font-size: 12.5px; color: #6B7180; }
.apps-close { width: 100%; margin-top: 8px; background: var(--ink3); color: var(--text); padding: 12px; }

/* Sister-app launcher on the login screen */
.login-apps { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.login-apps .lbl { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; text-align: center; margin-bottom: 8px; }
.login-apps .row { display: flex; gap: 10px; }
.login-apps a { flex: 1; text-align: center; background: var(--ink3); color: var(--text); text-decoration: none; border-radius: 12px; padding: 10px; font-size: 13px; }
.login-apps a .ic { font-family: var(--display); color: var(--ver); font-size: 18px; display: block; }
.role {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 6px; border-radius: 6px; background: var(--border); color: var(--text);
}
.role-guide { background: var(--ver); color: #fff; }
.role-chaperone { background: var(--caution); color: #fff; }
.role-teen { background: #3E7CA8; color: #fff; }
.actions { display: flex; align-items: center; gap: 6px; }
.ghost { background: transparent; font-size: 1.2rem; padding: 6px; min-width: 40px; min-height: 40px; }
.sos {
  background: var(--sos); color: #fff; font-weight: 800; letter-spacing: 0.05em;
  padding: 10px 14px; min-width: 56px; min-height: 44px; box-shadow: 0 2px 6px rgba(220,38,38,0.4);
}
.sos:active { transform: scale(0.96); }

main { flex: 1; position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; }
.view.scroll { overflow-y: auto; padding: 14px; padding-bottom: 90px; -webkit-overflow-scrolling: touch; }

/* ---- Map ---- */
#map { position: absolute; inset: 0; height: 100%; width: 100%; background: #aadaff; }
.self-dot .dot {
  width: 18px; height: 18px; background: var(--self); border: 3px solid #fff;
  border-radius: 50%; box-shadow: 0 0 0 rgba(37,99,235,0.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,0.5); }
  70% { box-shadow: 0 0 0 16px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
.member-pin { text-align: center; }
.member-pin .pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  margin: 0 auto;
}
.member-pin .pin span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 0.8rem; }
.member-pin .pin-label {
  font-size: 0.7rem; font-weight: 600; margin-top: 2px; color: #111; background: rgba(255,255,255,0.85);
  border-radius: 4px; padding: 0 4px; display: inline-block; white-space: nowrap;
}
.guide-pin { font-size: 1.6rem; }
#loc-status {
  position: absolute; left: 10px; bottom: 96px; z-index: 500; font-size: 0.75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px;
}
#loc-status.ok { color: var(--ok); }
#loc-status.off { color: var(--muted); }

/* ---- Chat ---- */
#view-chat { display: none; flex-direction: column; }
#view-chat.active { display: flex; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px; padding-bottom: 12px; -webkit-overflow-scrolling: touch; }
.msg { max-width: 80%; margin: 6px 0; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.msg.mine { margin-left: auto; background: var(--primary); color: #fff; }
.msg .meta { font-size: 0.68rem; display: flex; gap: 6px; align-items: center; opacity: 0.85; margin-bottom: 2px; }
.msg.mine .meta .role { background: rgba(255,255,255,0.25); color:#fff; }
.msg .who { font-weight: 700; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: 8px; padding: 10px; padding-bottom: calc(10px + var(--safe-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.chat-form input { flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }

/* ---- Cards (Today / Phrasebook) ---- */
.view.scroll h2 { font-family: var(--display); font-weight: 600; }
.day-nav { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; }
.dn-btn { width: 46px; height: 46px; flex: 0 0 auto; background: var(--ink2); color: var(--text); font-size: 1.7rem; line-height: 1; border: 1px solid var(--border); }
.dn-btn:disabled { opacity: 0.3; }
.dn-mid { flex: 1; text-align: center; min-width: 0; }
.dn-title { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.today-tag { background: var(--ver); color: #fff; font-size: 0.62rem; padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.card { background: var(--paper); color: var(--text-paper); border: 1px solid #e3d9c6; border-radius: 14px; padding: 14px; margin: 12px 0; box-shadow: 0 8px 22px rgba(0,0,0,0.28); }
.card h3 { margin: 0 0 8px; font-size: 0.95rem; font-family: var(--display); }
.card .muted { color: #6B7180; }
.card a { color: #b3402a; }
.alert-card { border-color: var(--sos); border-width: 2px; }
.offline-note { background: var(--caution); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 0.8rem; }
.schedule { list-style: none; padding: 0; margin: 0; }
.schedule li { padding: 6px 0; border-bottom: 1px solid #e3d9c6; }
.schedule .time { display: inline-block; min-width: 52px; font-weight: 700; color: var(--ver); }
.copy { font-size: 0.7rem; padding: 3px 8px; background: #e7e1d3; color: #5b5345; margin-left: 6px; }
.phrases { list-style: none; padding: 0; margin: 0; }
.phrase { padding: 10px 0; border-bottom: 1px solid #e3d9c6; cursor: pointer; min-height: 44px; }
.phrase .ja { font-size: 1.25rem; }
.phrase .romaji { color: #6B7180; font-size: 0.85rem; }
.phrase .en { font-size: 0.9rem; }

/* Trip tab — richer day layout */
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-h h3 { margin: 0; }
.card-h .emoji { font-size: 1.1rem; }
.hotel-card { background: linear-gradient(180deg, #fffdf7, var(--paper)); }
.hotel-name { font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; }
.addr { margin: 2px 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.act-link { display: inline-flex; align-items: center; gap: 4px; background: #efe7d6; color: #5b5345; border-radius: 8px; padding: 6px 10px; font-size: 0.78rem; text-decoration: none; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: #ece4d2; color: #5b5345; border-radius: 999px; padding: 3px 10px; font-size: 0.72rem; font-weight: 600; }
.meetup { font-weight: 600; }
/* schedule timeline */
.timeline { list-style: none; margin: 0; padding: 4px 0 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 58px; top: 4px; bottom: 8px; width: 2px; background: #e3d9c6; }
.t-item { position: relative; display: grid; grid-template-columns: 52px 1fr; align-items: baseline; gap: 14px; padding: 7px 0; }
.t-time { font-weight: 700; color: var(--ver); font-size: 0.74rem; text-align: right; line-height: 1.25; word-break: break-word; }
.t-act { font-size: 0.95rem; }
.t-dot { position: absolute; left: 54px; top: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--ver); border: 2px solid var(--paper); }
/* un-timed prose entry — aligns under the activities, no dot */
.t-item.t-note { display: block; padding-left: 66px; }
.t-item.t-note .t-act { font-size: 0.92rem; }
/* lodging / address rows */
.t-lodging { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 11px; margin: 8px 0; background: #efe7d6; border-radius: 10px; font-weight: 600; position: relative; }
.t-lodging.t-addr { background: #f3eee1; font-weight: 500; font-size: 0.85rem; }
.t-lodging .mini-map { margin-left: auto; text-decoration: none; font-size: 1.05rem; flex: 0 0 auto; }
/* links inside day cards */
.card a:not(.act-link):not(.copy):not(.mini-map) { color: #b3402a; text-decoration: underline; word-break: break-word; }

/* Guide itinerary editor */
#itin-editor { position: fixed; inset: 0; z-index: 2600; background: rgba(8,10,20,0.7); display: none; }
#itin-editor.show { display: block; }
.ie-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--ink); padding: calc(12px + var(--safe-top)) 14px calc(12px + var(--safe-bottom)); }
.ie-head { display: flex; align-items: center; gap: 10px; }
.ie-head h3 { margin: 0; font-family: var(--display); flex: 1; }
.ie-help { font-size: 0.78rem; color: var(--muted); margin: 8px 0; }
.ie-help code { background: var(--ink3); padding: 0 4px; border-radius: 4px; }
#itin-url { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--ink2); color: var(--text); margin-bottom: 8px; }
#itin-text { flex: 1; width: 100%; min-height: 140px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--ink2); color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; resize: none; }
.ie-actions { display: flex; gap: 8px; margin-top: 10px; }
.ie-actions button { flex: 1; padding: 13px; }
.ie-status { font-size: 0.8rem; margin-top: 8px; min-height: 1.2em; }
.ie-status.ok { color: var(--ok); }
.ie-status.err { color: var(--sos); }

/* toast */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink3); color: var(--text); padding: 10px 16px; border-radius: 999px; font-size: 0.85rem; box-shadow: 0 6px 18px rgba(0,0,0,.4); z-index: 3000; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
#toast.show { opacity: 1; }

/* Chat thread switcher (group + DMs) */
#thread-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
#thread-pills { display: flex; gap: 6px; overflow-x: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.thread-pill { flex: 0 0 auto; position: relative; background: var(--ink3); color: var(--text); border-radius: 999px; padding: 7px 13px; font-size: 0.8rem; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.thread-pill.active { background: var(--ver); color: #fff; }
.thread-pill .ub { position: absolute; top: -3px; right: -3px; background: #fff; color: var(--ver); border: 1px solid var(--ver); border-radius: 999px; min-width: 16px; height: 16px; font-size: 0.6rem; line-height: 15px; text-align: center; font-weight: 700; padding: 0 3px; }
#new-dm-btn { flex: 0 0 auto; font-size: 1.3rem; min-width: 40px; }

/* New-DM modal */
#dm-modal { position: fixed; inset: 0; z-index: 2700; background: rgba(8,10,20,0.7); display: none; }
#dm-modal.show { display: flex; align-items: flex-end; }
.dm-panel { background: var(--ink2); width: 100%; border-top-left-radius: 18px; border-top-right-radius: 18px; padding: 18px 16px calc(18px + var(--safe-bottom)); max-height: 80vh; overflow-y: auto; }
.dm-panel h3 { margin: 0 0 4px; font-family: var(--display); }
#dm-members { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.dm-member { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 10px; background: var(--ink3); }
.dm-member input { width: 20px; height: 20px; flex: 0 0 auto; }
.dm-member .nm { flex: 1; }
.dm-member .role { flex: 0 0 auto; }
.dm-actions { display: flex; gap: 8px; margin-top: 6px; }
.dm-actions button { flex: 1; padding: 13px; }

/* Members & codes admin (guide) */
#members-admin { position: fixed; inset: 0; z-index: 2700; background: var(--ink); display: none; }
#members-admin.show { display: flex; }
.ma-panel { display: flex; flex-direction: column; width: 100%; padding: calc(12px + var(--safe-top)) 14px calc(12px + var(--safe-bottom)); }
.ma-head { display: flex; align-items: center; gap: 10px; }
.ma-head h3 { margin: 0; flex: 1; font-family: var(--display); }
.ma-add { display: flex; gap: 6px; margin: 12px 0 4px; }
.ma-add input { flex: 1; min-width: 0; padding: 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--ink2); color: var(--text); }
.ma-add select { padding: 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--ink2); color: var(--text); }
#ma-list { flex: 1; overflow-y: auto; margin-top: 8px; }
.ma-row { display: flex; align-items: center; gap: 8px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.ma-info { flex: 1; min-width: 0; }
.ma-info .nm { font-weight: 600; }
.ma-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--ver); margin-top: 2px; }
.ma-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.ma-actions .ghost { min-width: 34px; min-height: 38px; font-size: 1rem; padding: 4px; }

/* Printable cards (Save as PDF). Hidden on screen; shown only when printing. */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  @page { margin: 8mm; }
}
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9mm; padding: 6mm; }
.pcard { border: 1.5px solid #333; border-radius: 10px; padding: 7mm 5mm; text-align: center; color: #111; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pcard .logo { width: 52px; height: 52px; border-radius: 10px; }
.pcard .title { font-family: Georgia, "Times New Roman", serif; font-size: 12pt; margin-top: 3mm; }
.pcard .title b { color: #E2553B; }
.pcard .jp { letter-spacing: 3px; color: #888; font-size: 8pt; margin-bottom: 4mm; }
.pcard .nm { font-size: 20pt; font-weight: 700; margin: 3mm 0 1mm; }
.pcard .prole { text-transform: uppercase; letter-spacing: 1px; font-size: 8pt; color: #E2553B; font-weight: 700; }
.pcard .lbl { margin-top: 5mm; font-size: 8pt; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.pcard .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 19pt; font-weight: 700; letter-spacing: 1px; }
.pcard .url { margin-top: 4mm; font-size: 10pt; color: #444; }

/* Conner's stick — calm fullscreen */
#stick-overlay { position: fixed; inset: 0; z-index: 4000; background: #0d1117; display: none; }
#stick-overlay.show { display: flex; align-items: center; justify-content: center; }
#stick-overlay img { max-width: 100%; max-height: 100%; object-fit: contain; }
.stick-hint { position: fixed; bottom: calc(20px + var(--safe-bottom)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.55); font-size: 0.8rem; }

/* ---- Phrase overlay ---- */
#phrase-overlay { position: fixed; inset: 0; background: #fff; color: #111; display: none; z-index: 2000; }
#phrase-overlay.show { display: grid; place-items: center; padding: 24px; text-align: center; }
.po-ja { font-size: clamp(2rem, 9vw, 4rem); font-weight: 700; }
.po-en { font-size: 1.2rem; color: #555; margin-top: 16px; }
.po-hint { position: fixed; bottom: 24px; left: 0; right: 0; color: #888; font-size: 0.8rem; }

/* ---- Banner ---- */
.banner { display: none; padding: 12px 14px; color: #fff; }
.banner.show { display: block; }
.banner.sos { background: var(--sos); }
.banner.alert { background: #b45309; }
.banner strong { display: block; font-size: 1.05rem; }
.banner button { margin-top: 6px; background: rgba(255,255,255,0.2); color: #fff; padding: 4px 10px; font-size: 0.8rem; }
.banner a { color: #fff; text-decoration: underline; }

/* ---- Bottom nav ---- */
#bottom-nav {
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.nav-btn {
  flex: 1; background: transparent; color: var(--muted); border-radius: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0; font-size: 0.7rem; min-height: 56px;
}
.nav-btn span { font-size: 1.3rem; }
.nav-ic { position: relative; display: inline-block; }
.nav-badge { display: none; position: absolute; top: -4px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ver); color: #fff; font-size: 0.62rem; line-height: 16px; text-align: center; font-weight: 700; }
.nav-badge.show { display: inline-block; }
.nav-btn.active { color: var(--primary); }
.nav-btn.small { flex: 0 0 56px; }
