/* かどきれん：1カラムのスマホ画面。方眼ノートの紙の上に、カードとテープでしおりらしさを出す */
:root {
  --paper: #F6F3EC; --dot: #E2DCCF; --card: #FFFDF8; --ink: #2A2D35; --muted: #6E6A61; --line: #E3DDD0;
  --ai: #2F4B7E; --ai-soft: #E5EBF5; --yama: #E9B43C; --yama-soft: #FAEFD2; --sakura: #C9706E; --sakura-soft: #F7E3E1;
  --ok: #3C8659; --ok-soft: #E1F0E6; --sheet: #FFFEFA; --shadow: rgba(70, 55, 30, .09); --overlay: rgba(20, 22, 28, .55);
  --f-head: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --f-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1E23; --dot: #2A2D34; --card: #25282F; --ink: #ECE7DC; --muted: #A49E93; --line: #3A3D46;
    --ai: #94AEDD; --ai-soft: #2B3446; --yama: #DDA93A; --yama-soft: #3A3222; --sakura: #E39A97; --sakura-soft: #3D2B2C;
    --ok: #7CC497; --ok-soft: #22362A; --sheet: #ECE7DA; --shadow: rgba(0, 0, 0, .35); --overlay: rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background-color: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.7;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 20px 20px;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--ai); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 700; text-wrap: balance; margin: 0; line-height: 1.4; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

.app {
  max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: env(safe-area-inset-top, 0px) calc(110px + env(safe-area-inset-bottom, 0px));
}

/* ヘッダー */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-block: 10px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--f-head); font-weight: 700; font-size: 18px; letter-spacing: .03em; text-decoration: none; color: var(--ink); white-space: nowrap; flex: none; }
.top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.guide-btn { white-space: nowrap; flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; color: var(--ai); text-decoration: none; }
.me-chip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 4px 3px 3px; font-size: 13px; min-width: 0; }
.me-chip span.name { min-width: 2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip form { display: contents; }
.me-chip button { white-space: nowrap; border: 0; background: var(--paper); border-radius: 999px; font-size: 11px; padding: 2px 8px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; flex: none; }

/* 共通部品 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: 0 2px 8px var(--shadow); }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.section-title h2 { font-size: 18px; }
.section-title .aside { font-size: 12px; color: var(--muted); }
.label { font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; white-space: nowrap; vertical-align: 1px; }
.pill.new { background: var(--sakura-soft); color: var(--sakura); }
.pill.ai { background: var(--ai-soft); color: var(--ai); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--yama-soft); color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; padding: 10px 16px;
  border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--ai); border-color: var(--ai); color: var(--card); }
.btn.danger { color: var(--sakura); border-color: var(--sakura); }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.marker { background: linear-gradient(transparent 58%, var(--yama-soft) 58%); padding: 0 2px; }
.you-row { background: var(--yama-soft); }
.notice { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 8px 14px; font-size: 14px; font-weight: 700; }
.empty { color: var(--muted); font-size: 14px; }

/* フォーム */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field .flabel { font-size: 13px; font-weight: 700; }
.input, .field input[type="text"], .field input[type="date"], .field input[type="time"], .field input[type="number"], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; font-size: 16px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .me-chip span.name { display: none; } }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 8px; font-size: 14px; background: var(--card); cursor: pointer; }
.check-chip input { width: 18px; height: 18px; accent-color: var(--ai); }
.fam-block { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fam-block:last-child { border-bottom: 0; }

/* ログイン */
.login { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding-top: 24px; }
.login-head { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.login-head h1 { font-size: 32px; letter-spacing: .1em; }
.pin-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pin-box { aspect-ratio: 1 / 1; max-width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; display: grid; place-items: center; }
.pin-box.filled { border-color: var(--ai); }
.pin-box.filled::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.pin-input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; font-size: 22px; letter-spacing: .6em; text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { padding: 12px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 22px; font-variant-numeric: tabular-nums; }
.key.sub { font-size: 13px; color: var(--muted); }
.login-error { color: var(--sakura); font-size: 14px; text-align: center; }
.js .pin-fallback { display: none; }
.pin-js { display: none; }
.js .pin-js { display: flex; flex-direction: column; gap: 10px; }

/* ホーム */
.hero { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 18px 18px; box-shadow: 0 3px 12px var(--shadow); margin-top: 10px; }
.hero::before { content: ""; position: absolute; top: -10px; left: 50%; width: 110px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: var(--yama); opacity: .75; border-radius: 2px; }
.hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hero h1 { font-size: 24px; }
.countdown { text-align: center; flex: none; }
.countdown b { display: block; font-family: var(--f-head); font-size: 38px; line-height: 1; color: var(--ai); }
.countdown span { font-size: 11px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.fact { border-top: 1px dashed var(--line); padding-top: 8px; min-width: 0; overflow-wrap: anywhere; }
.fact b { display: block; font-size: 14px; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.list-rows { display: flex; flex-direction: column; }
.row-link { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); color: var(--ink); text-decoration: none; }
.row-link:last-child { border-bottom: 0; }
.row-link time { font-size: 12px; color: var(--muted); flex: none; width: 46px; }
.row-link > div { min-width: 0; flex: 1; }
.row-link > .side { flex: none; font-size: 12px; color: var(--muted); }
.past-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.past { border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 12px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.past b { font-family: var(--f-head); }

/* 行事の画面 */
.page-head { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.page-head h1 { font-size: 24px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; color: var(--ink); }
.chip[aria-current="page"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.days { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.day-btn { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.35; text-decoration: none; color: var(--ink); }
.day-btn b { font-size: 15px; }
.day-btn span { font-size: 11px; color: var(--muted); }
.day-btn[aria-current="page"] { border-color: var(--ai); background: var(--ai-soft); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 52px 18px 1fr; gap: 0 8px; }
.tl-time { font-weight: 700; font-size: 14px; text-align: right; padding-top: 12px; font-variant-numeric: tabular-nums; }
.tl-rail { position: relative; }
.tl-rail::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-rail::after { content: ""; position: absolute; left: 3px; top: 17px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--ai); }
.tl-item.meal .tl-rail::after { border-color: var(--yama); }
.tl-item.move .tl-rail::after { border-color: var(--muted); }
.tl-body { padding: 10px 0 12px; min-width: 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; }
.tl-body a { font-size: 12px; font-weight: 700; text-decoration: none; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; padding-top: 2px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rooms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.room { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); min-width: 0; }
.room.mine { border-color: var(--yama); background: var(--yama-soft); }
.room h3 { font-size: 17px; }
.room ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px dashed var(--line); vertical-align: top; }
th { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: flex; align-items: center; gap: 6px; font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 2px; background: var(--card); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; align-items: center; gap: 10px; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; flex: 1; min-width: 0; }
.checklist input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ai); flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.checklist .who { margin-left: auto; font-size: 11px; color: var(--muted); }
.checklist form.toggle { display: contents; }

/* しおりの表示 */
.sheet-view { display: flex; flex-direction: column; gap: 10px; }
.sheet-img { display: block; width: 100%; background: var(--sheet); border-radius: 4px; box-shadow: 0 4px 16px var(--shadow); }
.sheet-pdf { width: 100%; aspect-ratio: 1 / 1.414; border: 1px solid var(--line); border-radius: 4px; background: var(--sheet); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumb { flex: none; width: 34px; height: 34px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); display: grid; place-items: center; font-size: 12px; text-decoration: none; color: var(--ink); }
.thumb[aria-current="page"] { border-color: var(--ai); background: var(--ai-soft); }

/* 家族ページ */
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .t { flex: 1; min-width: 160px; }
.toggle-row .t b { display: block; font-size: 14px; }
.switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.switch form { display: contents; }
.switch button { border: 0; background: transparent; font-size: 12px; font-weight: 700; padding: 6px 12px; color: var(--muted); }
.switch button[aria-pressed="true"] { background: var(--ai); color: var(--card); }
.switch button.priv[aria-pressed="true"] { background: var(--sakura); }
.hidden-note { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }

/* 幹事・管理 */
.progress { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 14px; }
.progress a { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dashed var(--line); padding: 7px 0; color: var(--ink); text-decoration: none; }
.data-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.data-row:last-child { border-bottom: 0; }
.data-row .main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.data-row form { margin: 0; }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; background: var(--card); cursor: pointer; }
.page-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--card); }
.page-row img, .page-row .ph { width: 44px; height: 60px; object-fit: cover; border-radius: 3px; flex: none; background: var(--sheet); display: grid; place-items: center; font-size: 10px; color: #555; }
.page-row .name { flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.page-row .mv { display: flex; gap: 4px; }
.page-row .mv button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
details.box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--card); }
details.box summary { cursor: pointer; font-weight: 700; }
details.box[open] summary { margin-bottom: 10px; }

/* 使い方 */
.phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.phase-head .when { font-size: 12px; font-weight: 700; color: var(--ai); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.step-no { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--ai-soft); color: var(--ai); }
.steps .pill { align-self: flex-start; }

/* 下のナビ */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
}
.nav-inner { max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; }
.nav svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--ai); }

@media (prefers-reduced-motion: no-preference) {
  main { animation: fadein .2s ease; }
  @keyframes fadein { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}

/* ---------- 迷わない画面のための部品 ---------- */
.back-btn {
  display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 70%; padding: 6px 12px 6px 6px;
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px;
}
.back-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-link { display: inline-flex; border-radius: 50%; }
.me-link .avatar { width: 34px; height: 34px; font-size: 14px; }

/* 大きく押しやすい行（準備リスト・メニュー・一覧） */
.big-list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: 0 2px 8px var(--shadow); }
.big-row { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; }
.big-row:last-child { border-bottom: 0; }
.big-row:active { background: var(--paper); }
.big-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.big-row .main b { font-size: 16px; }
.big-row .main span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.big-row .chev { flex: none; color: var(--muted); }
.step-mark { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; border: 2px solid var(--line); color: var(--muted); }
.step-mark.done { background: var(--ok); border-color: var(--ok); color: var(--card); }
.step-mark.next { border-color: var(--ai); color: var(--ai); }
.status { flex: none; font-size: 12px; font-weight: 700; color: var(--ok); }
.status.todo { color: var(--muted); font-weight: 400; }

.next-hint { background: var(--ai-soft); color: var(--ink); border-radius: var(--r); padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.next-hint b { color: var(--ai); }
.add-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 14px; border-radius: var(--r); border: 2px dashed var(--ai); background: var(--card); color: var(--ai); font-weight: 700; font-size: 16px; text-decoration: none; }
.form-actions { display: flex; gap: 8px; }
.form-actions .btn { flex: 1; padding: 13px 16px; font-size: 16px; }
.error-box { background: var(--sakura-soft); color: var(--sakura); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.edit-link { align-self: flex-start; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.title-row > div { min-width: 0; }

/* 種類を大きなカードで選ぶ */
.kind-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-card { position: relative; }
.kind-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.kind-card span { display: flex; flex-direction: column; gap: 2px; border: 2px solid var(--line); background: var(--card); border-radius: var(--r); padding: 14px; height: 100%; }
.kind-card span b { font-size: 17px; }
.kind-card span small { color: var(--muted); font-size: 12px; }
.kind-card input:checked + span { border-color: var(--ai); background: var(--ai-soft); }
.kind-card input:focus-visible + span { outline: 2px solid var(--ai); outline-offset: 2px; }
.step-label { font-size: 12px; font-weight: 700; color: var(--ai); letter-spacing: .05em; }

/* ---------- 子どもでも使えるシンプルな画面 ---------- */
body { font-size: 16px; }
.topbar { min-height: 56px; }
.nav a { font-size: 12px; padding: 7px 0 9px; }
.nav svg { width: 27px; height: 27px; }
.nav a[aria-current="page"] svg { stroke-width: 2.3; }

/* ホームの大きなボタン */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-btn {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 104px; padding: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 8px var(--shadow);
  color: var(--ink); text-decoration: none;
}
.tile-btn svg { width: 30px; height: 30px; color: var(--ai); }
.tile-btn b { font-size: 18px; font-family: var(--f-head); }
.tile-btn span { font-size: 12px; color: var(--muted); }
.tile-btn.wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }

/* できた度合いのバー */
.meter { height: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.done-msg { font-family: var(--f-head); font-size: 18px; color: var(--ok); text-align: center; }

/* もちもの：大きなチェック */
.checklist.big label { padding: 13px 4px; font-size: 17px; }
.checklist.big input[type="checkbox"] { width: 26px; height: 26px; }

/* わたし */
.me-card { display: flex; align-items: center; gap: 14px; }
.me-card .avatar { width: 56px; height: 56px; font-size: 24px; }
.me-card h1 { font-size: 22px; }
.info-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row .k { flex: none; width: 4.5em; color: var(--muted); font-size: 13px; padding-top: 3px; }
.info-row .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.info-row .v b { font-size: 18px; }

/* 予定をえらぶチップ */
.ev-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ev-chips::-webkit-scrollbar { display: none; }

/* おもいで */
.memory { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); box-shadow: 0 2px 8px var(--shadow); }
.memory b { font-family: var(--f-head); font-size: 19px; }

/* 予定の画面のタブを大きく */
.tabs4 { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.tabs4 a { text-align: center; padding: 9px 0; border-radius: 10px; font-weight: 700; font-size: 13px; letter-spacing: -.02em; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs4 a[aria-current="page"] { background: var(--ai); color: var(--card); }
.countdown-pill { display: inline-block; background: var(--yama-soft); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 700; }

/* ---------- 予定のカード・写真・自分のところ ---------- */
.ev-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 8px var(--shadow); text-decoration: none; color: var(--ink); }
.ev-card.first { position: relative; border-color: var(--yama); margin-top: 8px; }
.ev-card.first::before { content: ""; position: absolute; top: -10px; left: 50%; width: 100px; height: 20px; transform: translateX(-50%) rotate(-3deg); background: var(--yama); opacity: .75; border-radius: 2px; }
.ev-card h2 { font-size: 21px; margin-top: 2px; }
.ev-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ev-card-foot { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.ev-card-actions { display: flex; gap: 8px; }
.ev-card-actions .btn { flex: 1; }
.mine-box { display: flex; flex-direction: column; gap: 2px; background: var(--yama-soft); border: 1px solid var(--yama); border-radius: 12px; padding: 10px 14px; }
.mine-box b { font-size: 20px; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 2px 8px var(--shadow); min-width: 0; }
.photo-cover { aspect-ratio: 4 / 3; background: var(--ai-soft); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; }
.photo-meta { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.photo-meta b { font-family: var(--f-head); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop { display: block; padding-left: 14px; position: relative; }
.stop::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }

/* ---------- 写真 ---------- */
.upload-box { display: flex; flex-direction: column; gap: 8px; }
.upload-progress { display: flex; flex-direction: column; gap: 4px; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.group-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.group-head .when { font-size: 12px; font-weight: 700; color: var(--ai); flex: none; }
.group-head b { font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile { position: relative; aspect-ratio: 1 / 1; max-width: 100%; border-radius: 6px; overflow: hidden; background: var(--ai-soft); display: block; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.tile .play { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); }
.tile .play::after { content: ""; position: absolute; left: 8px; top: 6px; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.viewer-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; }
.photo-stage { background: #111; border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 200px; }
.photo-stage img, .photo-stage video { max-width: 100%; max-height: 72vh; display: block; }
.photo-cover img { width: 100%; height: 100%; object-fit: cover; }

.pre b, b.pre { display: inline-block; }
.mine-box b.pre { font-size: 18px; line-height: 1.5; }
