/* ============================================================
   NoraKo — Design System v2（β）
   ・誌面のような編集感 × 個人の写真 × SNS。カードで囲わず、写真・余白・細線・文字・色面で構成。
   ・スマホ／タブレット／PC は「同じ部品・同じブランド」で、レイアウトだけをデバイスごとに最適化する
     （mobile <768: 下タブ ／ tablet 768–1099: 左レール ／ desktop ≥1100: 左サイドナビ＋右レール）。
   ・ブランド素材（ロゴ・Type色/記号・プロフィール写真）は js/brand.js から差し替える。色の直書きをしない。
   ============================================================ */
:root {
  /* Color */
  --bg: #f3efe8; --paper: #f8f5f0; --card: #fbf9f5; --sand: #e8e2d7;
  --line: #d8d1c5; --line2: #e5dfd4;
  --ink: #1d1b1b; --ink2: #5a5551; --ink3: #8f887f;
  --charcoal: #2a2726;
  --rose: #7a2f3d; --rose-d: #632532; --rose2: #a8666f; --rose3: #dcc8c4; --rose4: #eee4df; /* Muted Bordeaux（旧名維持） */
  --heart: #c8464a; --ok: #4f6f57; --danger: #a8443f; --warn: #a77a2f;
  --tape: rgba(214, 200, 180, 0.7);
  /* Spacing (4px scale) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  /* Radius / Border / Shadow */
  --r-xs: 2px; --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
  --bd: 1px solid var(--line);
  --sh-1: 0 6px 12px -8px rgba(40, 30, 26, 0.45);
  --sh-2: 0 12px 24px -14px rgba(40, 30, 26, 0.5);
  --sh-pop: 0 24px 60px -24px rgba(30, 22, 20, 0.6);
  /* Type scale */
  --fs-2xs: 10px; --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 32px;
  /* Fonts */
  --f-ui: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-serif: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --f-hand: "Klee One", "Hiragino Maru Gothic ProN", "Yu Gothic", cursive, sans-serif;
  --f-en: "Nothing You Could Do", "Bradley Hand", "Segoe Script", cursive;
  /* Layout */
  --hdr-h: 54px; --tab-h: 60px; --side-w: 248px; --rail-w: 84px; --pg: none;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .25 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --photo-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .22 0 0 0 0 .18 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--f-ui); color: var(--ink); background: var(--bg); font-size: var(--fs-md); line-height: 1.65; -webkit-font-smoothing: antialiased; line-break: strict; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
p, li { text-wrap: pretty; }
[hidden] { display: none !important; }
button:disabled { opacity: 0.4; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.hand { font-family: var(--f-hand); font-weight: 400; }
.hand-en { font-family: var(--f-en); font-weight: 400; letter-spacing: 0.02em; }
.serif { font-family: var(--f-serif); font-weight: 600; letter-spacing: 0.005em; }
.script { font-family: var(--f-serif); font-style: italic; font-weight: 500; }
.center { text-align: center; }
.muted-s { font-size: var(--fs-xs); color: var(--ink3); line-height: 1.6; }
.grow { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================
   Shell：#app = [#sidebar] + #main（#stage ＋ #tabbar）
   ============================================================ */
#boot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); transition: opacity 0.3s; }
#boot.gone { opacity: 0; pointer-events: none; }
#boot .wordmark { font-size: 40px; animation: boot 1.2s ease-in-out infinite alternate; }
@keyframes boot { from { opacity: 0.35; } }
#app { position: fixed; inset: 0; display: flex; background: var(--bg); padding-top: var(--safe-t); }
#main { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg) var(--paper-grain); }
.screen.leave { pointer-events: none; animation: leave 0.2s ease forwards; z-index: 0; }
.screen:not(.leave):not(.underlay) { z-index: 1; }
.enter-push { animation: enter-push 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.enter-back { animation: enter-back 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.enter-up { animation: enter-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.enter-tab { animation: enter-tab 0.2s ease; }
@keyframes enter-push { from { transform: translateX(24px); opacity: 0; } }
@keyframes enter-back { from { transform: translateX(-24px); opacity: 0; } }
@keyframes enter-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes enter-tab { from { opacity: 0; } }
@keyframes leave { to { opacity: 0; } }
@keyframes modal-in { from { transform: translateY(14px) scale(0.985); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .enter-push, .enter-back, .enter-up, .enter-tab { animation: none; } }

/* ヘッダー */
.hdr { flex: 0 0 var(--hdr-h); height: var(--hdr-h); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--sp-2); width: 100%; max-width: var(--pg); margin-inline: auto; }
.hdr-l { display: flex; align-items: center; min-width: 0; }
.hdr-t { display: flex; align-items: center; justify-content: center; font-weight: 500; min-width: 0; }
.hdr-r { display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 0; }
.hdr-date, .hdr-date-btn { font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.hdr-serif { font-family: var(--f-serif); font-size: 22px; font-weight: 600; }
.hdr-link { font-size: var(--fs-sm); color: var(--ink2); padding: 8px 10px; }
.ib { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); flex: 0 0 auto; }
.ib:hover { background: rgba(40, 30, 26, 0.05); }
.ib.sm { width: 30px; height: 30px; }
.ib.light { color: #fff; }
.ib .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--heart); box-shadow: 0 0 0 1.5px var(--bg); }
.body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 28px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.body > .pg { width: 100%; max-width: var(--pg); margin-inline: auto; }
.foot { flex: 0 0 auto; padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--safe-b)); background: linear-gradient(180deg, rgba(243, 239, 232, 0), var(--bg) 30%); display: flex; flex-direction: column; gap: var(--sp-2); width: 100%; max-width: var(--pg); margin-inline: auto; }

/* ページ幅（route の width で決まる）。mobile は制限なし */
.screen[data-w="narrow"] { --pg: 560px; }
.screen[data-w="feed"] { --pg: 720px; }
.screen[data-w="wide"] { --pg: 1180px; }
.screen[data-w="split"] { --pg: none; }
#app.lay-mobile .screen { --pg: none !important; }

/* 下タブ（mobile） */
#tabbar { flex: 0 0 auto; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; align-items: center; justify-content: space-around; background: rgba(243, 239, 232, 0.96); border-top: 1px solid var(--line2); position: relative; z-index: 5; }
#tabbar.hidden { display: none; }
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 10.5px; color: var(--ink3); letter-spacing: 0.02em; }
.tab.on { color: var(--ink); font-weight: 500; }
.tab .ic { stroke-width: 1.4; }
.tab.on .ic { stroke-width: 1.6; }
.tab[data-k="today"].on .ic { fill: currentColor; }
.tab.has-dot::after { content: ""; position: absolute; top: 7px; left: calc(50% + 8px); width: 7px; height: 7px; border-radius: 50%; background: var(--heart); box-shadow: 0 0 0 1.5px var(--bg); }

/* サイドナビ（tablet: アイコンレール / desktop: 左サイドナビ） */
#sidebar { display: none; flex: 0 0 auto; flex-direction: column; border-right: 1px solid var(--line2); background: var(--paper); padding: var(--sp-5) var(--sp-3) var(--sp-4); overflow-y: auto; scrollbar-width: none; }
#app:not(.lay-mobile) #sidebar { display: flex; }
#app:not(.lay-mobile) #tabbar { display: none; }
.sb-brand { display: flex; align-items: center; padding: 2px 10px var(--sp-6); }
.sb-brand .wordmark { font-size: 32px; }
.sb-brand .sb-mark { display: none; font-family: var(--f-serif); font-size: 32px; font-weight: 600; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item { position: relative; display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 14px; border-radius: var(--r-md); font-size: 15px; color: var(--ink2); width: 100%; text-align: left; }
.sb-item:hover { background: rgba(40, 30, 26, 0.05); color: var(--ink); }
.sb-item.on { color: var(--ink); font-weight: 700; background: rgba(40, 30, 26, 0.06); }
.sb-item .ic { flex: 0 0 auto; stroke-width: 1.4; }
.sb-item.on .ic { stroke-width: 1.7; }
.sb-item[data-k="today"].on .ic { fill: currentColor; }
.sb-item.has-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--heart); margin-left: auto; }
.sb-cta { margin: var(--sp-5) 4px 0; }
.sb-cta .btn { width: 100%; height: 46px; }
.sb-foot { margin-top: auto; padding-top: var(--sp-5); display: flex; flex-direction: column; gap: 2px; }
.sb-me { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); text-align: left; margin-top: var(--sp-2); border-top: 1px solid var(--line2); border-radius: 0; padding-top: 16px; }
.sb-me:hover { background: rgba(40, 30, 26, 0.03); }
.sb-me-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.sb-me-t b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me-t em { font-style: normal; font-size: 11px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#app.lay-tablet #sidebar { width: var(--rail-w); padding: var(--sp-4) 8px; align-items: center; }
#app.lay-tablet .sb-brand { padding: 4px 0 var(--sp-5); justify-content: center; }
#app.lay-tablet .sb-brand .wordmark { display: none; }
#app.lay-tablet .sb-brand .sb-mark { display: block; }
#app.lay-tablet .sb-item { flex-direction: column; gap: 3px; height: 58px; justify-content: center; padding: 0; font-size: 10px; width: 68px; }
#app.lay-tablet .sb-item.has-dot::after { position: absolute; top: 8px; right: 16px; margin: 0; }
#app.lay-tablet .sb-cta .btn { width: 48px; height: 48px; padding: 0; border-radius: 50%; }
#app.lay-tablet .sb-cta .btn span { display: none; }
#app.lay-tablet .sb-me-t { display: none; }
#app.lay-tablet .sb-me { padding: 12px 0; justify-content: center; }
#app.lay-desktop #sidebar { width: var(--side-w); }

/* モーダル画面（tablet/desktop で、カメラ・作成・共有などの全画面ルートを重ねて表示） */
#stage.has-modal::before { content: ""; position: absolute; inset: 0; background: rgba(30, 24, 22, 0.48); z-index: 20; animation: enter-tab 0.2s ease; }
.screen.is-modal { inset: 0; margin: auto; z-index: 21; width: min(680px, calc(100% - 48px)); height: min(880px, calc(100% - 48px)); border-radius: var(--r-lg); box-shadow: var(--sh-pop); overflow: hidden; background: var(--bg); animation: modal-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.screen.is-modal[data-w="narrow"] { width: min(520px, calc(100% - 48px)); }
.screen.is-modal[data-w="mid"] { width: min(780px, calc(100% - 48px)); }
.screen.is-modal[data-w="wide"] { width: min(980px, calc(100% - 48px)); }
.screen.underlay { z-index: 1; pointer-events: none; }
.screen.is-modal .hdr, .screen.is-modal .foot, .screen.is-modal .body > .pg { max-width: none; }

/* ============================================================
   共通部品
   ============================================================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 var(--sp-5); border-radius: var(--r-pill); font-size: var(--fs-md); font-weight: 500; letter-spacing: 0.03em; transition: transform 0.12s, background 0.15s, opacity 0.15s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-d); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-line { border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn-soft { background: var(--sand); color: var(--ink); }
.btn-ghost { color: var(--ink2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn.danger, .menu-i.danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 15px; font-size: var(--fs-sm); }
.btn-lg { height: 52px; font-size: 15px; letter-spacing: 0.08em; }
.btn.is-off, .btn[aria-disabled="true"] { opacity: 0.4; }
.btn.busy { pointer-events: none; opacity: 0.7; }
.follow-btn.btn-primary { background: var(--ink); }
.follow-btn.btn-line { border-color: var(--line); color: var(--ink2); }
.v-link { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--ink2); white-space: nowrap; }
.v-link.ul { text-decoration: underline; text-underline-offset: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; padding: 4px var(--sp-4) 8px; scrollbar-width: none; }
.chips.scroll-x::-webkit-scrollbar, .scroll-x::-webkit-scrollbar { display: none; }
.scroll-x { scrollbar-width: none; }
.chip { height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; font-size: 12.5px; color: var(--ink2); white-space: nowrap; flex-shrink: 0; transition: all 0.15s; }
.chip:hover { border-color: var(--ink3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-s { display: inline-block; font-size: 10.5px; color: var(--ink2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 8px; line-height: 1.6; }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-2xs); line-height: 1.6; padding: 0 8px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ink2); white-space: nowrap; }
.badge.rose { color: var(--rose); border-color: var(--rose3); background: var(--rose4); }

/* フォーム */
.field { padding: var(--sp-2) var(--sp-4) var(--sp-3); }
.lbl { display: block; font-size: var(--fs-sm); color: var(--ink2); margin-bottom: 7px; font-weight: 500; letter-spacing: 0.04em; }
.lbl em { font-style: normal; color: var(--ink3); font-weight: 400; margin-left: 4px; }
.textwrap { position: relative; }
.textwrap textarea, .input { width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(251, 249, 245, 0.85); padding: 11px 13px 26px; resize: none; outline: none; line-height: 1.7; font-size: 16px; transition: border-color 0.15s, background 0.15s; }
.input { padding: 10px 13px; height: 44px; }
.textwrap textarea:focus, .input:focus, .search:focus { border-color: var(--ink); background: #fff; }
.field.err .input, .field.err textarea { border-color: var(--danger); }
.field-err { display: none; font-size: var(--fs-xs); color: var(--danger); margin-top: 6px; }
.field.err .field-err { display: block; }
.field-hint { font-size: var(--fs-xs); color: var(--ink3); margin-top: 6px; line-height: 1.6; }
.count { position: absolute; right: 12px; bottom: 6px; font-size: 10.5px; color: var(--ink3); }
.search, .search-wrap input { width: 100%; height: 42px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; padding: 0 4px 0 30px; outline: none; font-size: 16px; }
.search-wrap { position: relative; padding: 6px var(--sp-4) 8px; }
.search-wrap .ic { position: absolute; left: var(--sp-4); top: 18px; color: var(--ink3); }
.search-wrap input::placeholder { color: var(--ink3); }
.switch { position: relative; flex: 0 0 auto; width: 46px; height: 28px; border-radius: 14px; background: var(--line); transition: background 0.18s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s; }
.switch.on { background: var(--rose); }
.switch.on::after { transform: translateX(18px); }
.seg { display: flex; gap: var(--sp-2); }
.seg-b { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 46px; white-space: nowrap; padding: 0 8px; border-radius: var(--r-md); border: 1px solid var(--line); font-size: var(--fs-md); color: var(--ink2); }
.seg-b.on { border-color: var(--ink); color: var(--ink); background: rgba(251, 249, 245, 0.9); font-weight: 500; box-shadow: inset 0 0 0 1px var(--ink); }
.slot-pick { display: flex; gap: var(--sp-2); padding: 2px var(--sp-4); justify-content: center; }
.slot-pill { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink2); }
.slot-pill.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.slot-pill.dark { background: transparent; border-color: rgba(255, 255, 255, 0.3); color: #d9cfc4; }
.slot-pill.dark.on { background: #f2ebe1; border-color: #f2ebe1; color: #2a2321; }

/* リスト行（設定・一覧など） */
.rows { border-top: 1px solid var(--line2); }
.row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line2); text-align: left; }
.row:hover { background: rgba(40, 30, 26, 0.025); }
.row > .ic:first-child { color: var(--ink2); flex: 0 0 auto; }
.row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.row-t b { font-size: 14.5px; font-weight: 500; }
.row-t i { font-style: normal; font-size: var(--fs-xs); color: var(--ink3); }
.row-v { font-size: var(--fs-sm); color: var(--ink3); white-space: nowrap; }
.row > .ic:last-child { color: var(--ink3); }
.row.danger .row-t b, .row.danger > .ic:first-child { color: var(--danger); }
.sec-label { padding: var(--sp-6) var(--sp-4) var(--sp-2); font-size: var(--fs-xs); color: var(--ink3); letter-spacing: 0.08em; }

/* シート／ダイアログ（mobile=下から / tablet・desktop=中央ダイアログ） */
#overlay { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.sheet-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30, 24, 22, 0.46); opacity: 0; transition: opacity 0.2s; pointer-events: auto; }
.sheet { position: relative; width: 100%; max-height: 88%; overflow-y: auto; background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 8px var(--sp-5) calc(22px + var(--safe-b)); transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); pointer-events: auto; scrollbar-width: none; }
.sheet-wrap.tall .sheet { height: 86%; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.sheet-title { text-align: center; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.sheet-lead { font-size: var(--fs-sm); color: var(--ink2); margin-bottom: 12px; line-height: 1.75; }
.menu { display: flex; flex-direction: column; }
.menu-i { display: flex; align-items: center; gap: 12px; min-height: 52px; font-size: 14.5px; border-bottom: 1px solid var(--line2); text-align: left; }
.menu-i:last-child { border-bottom: 0; }
.menu-i:hover { background: rgba(40, 30, 26, 0.025); }
.menu-i.sel { color: var(--rose); font-weight: 500; }
.menu-em { margin-left: auto; font-style: normal; font-size: var(--fs-sm); color: var(--ink3); }
.confirm { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: 6px; }
.confirm-t { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 2px; }
.confirm-b { font-size: var(--fs-sm); color: var(--ink2); text-align: center; margin-bottom: 6px; line-height: 1.75; }
#app:not(.lay-mobile) .sheet-wrap { align-items: center; }
#app:not(.lay-mobile) .sheet { width: min(480px, calc(100% - 48px)); border-radius: var(--r-lg); padding-bottom: 22px; transform: translateY(14px) scale(0.985); opacity: 0; transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s; box-shadow: var(--sh-pop); }
#app:not(.lay-mobile) .sheet-wrap.tall .sheet { height: min(720px, calc(100% - 64px)); width: min(560px, calc(100% - 48px)); }
#app:not(.lay-mobile) .sheet-wrap.open .sheet { transform: none; opacity: 1; }
#app:not(.lay-mobile) .sheet-grab { display: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 24px); transform: translate(-50%, 10px); opacity: 0; background: var(--charcoal); color: #f6f1e9; padding: 10px 18px; border-radius: var(--r-pill); font-size: var(--fs-sm); z-index: 300; max-width: 86%; text-align: center; transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
#app:not(.lay-mobile) ~ .toast, .lay-desktop-toast { bottom: 32px; }

/* 写真 */
.ph { position: relative; overflow: hidden; background: var(--sand); border-radius: var(--r-xs); }
.ph:not(.ld):not(.er)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.3s infinite; z-index: 1; }
@keyframes shimmer { to { transform: translateX(100%); } }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; transform: scale(var(--pz, 1)); transform-origin: var(--px, 50%) var(--py, 50%); }
.ph.er { display: grid; place-items: center; color: var(--ink3); }
.ph.er img { display: none; }
.ph.er::after { content: "写真を読み込めません"; font-size: var(--fs-xs); background: none; opacity: 1; mix-blend-mode: normal; position: static; }
.ph.sq { aspect-ratio: 1 / 1; }
.ph.ld::after { content: ""; position: absolute; inset: 0; background-image: var(--photo-grain); mix-blend-mode: multiply; opacity: 0.2; pointer-events: none; }
.ph.f-soft img { filter: brightness(1.05) contrast(0.92) saturate(0.92); }
.ph.f-glow img { filter: brightness(1.07) saturate(1.08) contrast(0.96); }
.ph.f-film img { filter: sepia(0.22) contrast(1.05) saturate(0.86) hue-rotate(-6deg); }
.ph.f-mono img { filter: grayscale(1) contrast(1.05); }
.tn-a { filter: saturate(0.96) sepia(0.05); } .tn-b { filter: saturate(0.86) hue-rotate(6deg) brightness(1.02); } .tn-c { filter: saturate(1.05) brightness(1.04) contrast(0.96); }
.tn-d { filter: saturate(0.72) contrast(1.06); } .tn-e { filter: sepia(0.15) saturate(1.04) brightness(0.98); } .tn-f { filter: saturate(0.9) hue-rotate(-6deg) contrast(1.03); }
.ph-empty { display: grid; place-items: center; aspect-ratio: 4 / 5; color: var(--ink3); background: var(--sand); }
.pol { position: relative; display: block; background: #fdfbf7; padding: 6px 6px 20px; border-radius: 1px; box-shadow: 0 8px 18px -8px rgba(40, 30, 26, 0.4), 0 1px 3px rgba(40, 30, 26, 0.15); }
.pol .ph { border-radius: 0; }
.pol-cap { position: absolute; left: 8px; bottom: 3px; font-size: 11px; color: var(--ink3); }
.tape { position: absolute; z-index: 3; top: -9px; left: 50%; width: 54px; height: 17px; margin-left: -27px; background: var(--tape); transform: rotate(-4deg); box-shadow: 0 1px 2px rgba(40, 30, 26, 0.1); pointer-events: none; }
.tape.r { left: auto; right: -8px; margin-left: 0; transform: rotate(38deg); top: -4px; }
.dc-multi { position: absolute; right: 7px; top: 7px; z-index: 3; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.av { display: inline-block; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--sand); }
.av img { width: 100%; height: 100%; }

/* Nora Type の小部品 */
.tsym { display: inline-grid; place-items: center; color: var(--tc, var(--rose)); }
.tl { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 10.5px; line-height: 1.5; color: var(--tc, var(--ink3)); white-space: nowrap; }
.tl > span { overflow: hidden; text-overflow: ellipsis; }
.tl.boxed { border: 1px solid var(--line); padding: 0 8px 0 6px; color: var(--ink); }
.tl.boxed svg { color: var(--tc); }
.tav { position: relative; display: inline-block; flex-shrink: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--tc, var(--line)); }
.tav-in { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--tt, var(--sand)); }
.tav-in img { width: 100%; height: 100%; }
.tav-b { position: absolute; right: -5px; bottom: -3px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); color: var(--tc); box-shadow: 0 0 0 1.5px var(--tc); }
.tav.off { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line); }
.tav.off .tav-b { color: var(--ink3); box-shadow: 0 0 0 1.5px var(--line); }
/* Nora Type キャラクター（U.charImg）：正式画像はほぼ正方形だが完全な1:1ではないため、
   指定サイズの正方形ボックスに収める（引き伸ばし・切り取りをしない） */
.char { object-fit: contain; }

.heart { color: var(--ink); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; transition: color 0.15s; }
.heart.on { color: var(--heart); }
.heart.pop svg { animation: pop 0.34s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.icon-act { color: var(--ink); width: 34px; height: 34px; display: inline-grid; place-items: center; }

/* 状態：空・読み込み・エラー */
.empty-state { padding: var(--sp-12) var(--sp-6); text-align: center; color: var(--ink2); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); line-height: 1.9; }
.empty-state .ic-big { color: var(--ink3); }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.empty-state p { max-width: 24em; }
.empty-state.compact { padding: var(--sp-8) var(--sp-5); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner { width: 16px; height: 16px; border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff; }
.loading-state { display: grid; place-items: center; gap: var(--sp-3); padding: var(--sp-12) var(--sp-6); color: var(--ink3); font-size: var(--fs-sm); }
.skel { background: linear-gradient(100deg, var(--sand) 30%, #f1ece3 50%, var(--sand) 70%); background-size: 200% 100%; animation: skel 1.3s infinite; border-radius: var(--r-xs); }
@keyframes skel { to { background-position: -200% 0; } }
.banner { display: flex; align-items: flex-start; gap: var(--sp-3); margin: var(--sp-3) var(--sp-4); padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--warn); background: rgba(167, 122, 47, 0.1); font-size: var(--fs-sm); line-height: 1.7; }
.banner.err { border-color: var(--danger); background: rgba(168, 68, 63, 0.08); }
.banner.info { border-color: var(--ink3); background: rgba(40, 30, 26, 0.04); }

/* 誌面の部品（各画面共通） */
.v-title { font-family: var(--f-serif); font-weight: 600; font-size: var(--fs-2xl); letter-spacing: 0.005em; line-height: 1.1; }
.v-eyebrow { font-family: var(--f-en); font-size: 13px; color: var(--ink3); letter-spacing: 0.02em; }
.v-tabs { display: flex; gap: 24px; padding: 0 var(--sp-4); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.v-tab { position: relative; height: 42px; font-size: var(--fs-md); color: var(--ink3); white-space: nowrap; flex: 0 0 auto; }
.v-tab:hover { color: var(--ink2); }
.v-tab.on { color: var(--ink); font-weight: 500; }
.v-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.v-tab .seg-dot { display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--heart); vertical-align: 2px; }
.v-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 22px var(--sp-4) 8px; }
.v-sec-h .serif { font-size: 22px; font-weight: 500; white-space: nowrap; }
.wordmark { font-family: var(--f-serif); font-weight: 600; font-size: 30px; letter-spacing: 0; line-height: 1; color: var(--ink); }
.wordmark-img { height: 26px; width: auto; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-8) var(--sp-4); border: 1.5px dashed var(--line); border-radius: var(--r-md); color: var(--ink2); text-align: center; transition: all 0.15s; }
.dropzone.over { border-color: var(--rose); background: var(--rose4); }

.no-chrome #sidebar, .no-chrome #tabbar { display: none !important; }
.banner > .ic { flex: 0 0 auto; margin-top: 3px; }
