/* =====================================================================
   KOMAINU ALL IN ONE CONNECT — Design System
   ビルド工程なし・単一CSS。トークン → ベース → ユーティリティ → 部品 → 画面 の順。
   z-index層: nav(50) < fullscreen(1000) < camera(1100) < busy(1200)
             < sheet(1300) < toast(1400) < splash(100000 / login-overlay=99999より上)
   ===================================================================== */

/* ===== 0. リセット ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: inline-block; }
a { -webkit-tap-highlight-color: transparent; }
h1,h2,h3,h4,h5,h6,p { margin: 0 0 .5rem; }
ol, ul { margin: 0; }

/* ===== 1. トークン ===== */
:root {
    /* 色 */
    --bg-0: #050508;                       /* スプラッシュ/ステータスバー連続用 (TWA固定値) */
    --bg-1: #0a0d14;                       /* アプリ地色 */
    --bg-2: #10151f;                       /* シート等の浮き面 */
    --surface-1: rgba(255,255,255,.04);
    --surface-2: rgba(255,255,255,.08);
    --stroke-1: rgba(255,255,255,.08);
    --stroke-2: rgba(255,255,255,.16);
    --stroke-accent: rgba(0,212,170,.35);
    --accent: #00d4aa;
    --accent-hi: #2ee8c2;
    --accent-ink: #032019;                 /* アクセント面上の文字色 */
    --accent-dim: rgba(0,212,170,.12);
    --violet: #a78bfa;  --violet-dim: rgba(139,92,246,.14);
    --blue:   #5ba3ff;  --blue-dim:   rgba(77,159,255,.13);
    --danger: #ff5c66;  --danger-dim: rgba(255,92,102,.12);
    --warn:   #ffc44d;  --warn-dim:   rgba(255,196,77,.12);
    --ok:     #34d399;  --ok-dim:     rgba(52,211,153,.12);
    --info:   #7db4ff;  --info-dim:   rgba(125,180,255,.12);
    --text-1: #f2f5f9;
    --text-2: #9aa7b8;
    --text-3: #5f6b7e;
    /* タイポ */
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-en: 'Inter', 'Noto Sans JP', sans-serif;
    /* 角丸 */
    --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-full: 999px;
    /* 影 */
    --shadow-1: 0 8px 24px rgba(0,0,0,.35);
    --shadow-2: 0 18px 50px rgba(0,0,0,.55);
    --glow-accent: 0 6px 18px rgba(0,212,170,.28);
    /* z-index層 */
    --z-nav: 50; --z-fab: 60;
    --z-fullscreen: 1000; --z-camera: 1100; --z-busy: 1200;
    --z-sheet: 1300; --z-toast: 1400;
    /* レイアウト */
    --nav-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

/* ===== 2. ベース ===== */
body {
    background:
        radial-gradient(ellipse 90% 40% at 50% -5%, rgba(0,212,170,.08) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 140px, var(--bg-1) 100%);
    background-attachment: fixed;
    color: var(--text-1);
    font-family: var(--font-jp);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overscroll-behavior-y: none;
}
::selection { background: var(--accent-dim); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 2px; }

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: calc(10px + var(--safe-t)) 18px calc(var(--nav-h) + var(--safe-b) + 32px);
}

h5, h6 { color: var(--text-1); font-weight: 600; font-size: 1rem; letter-spacing: .02em; margin-bottom: 1.1rem; }

/* ===== 3. ユーティリティ (Bootstrap互換の自前サブセット) ===== */
.d-flex { display: flex; }
.d-block { display: block; }
.flex-wrap { flex-wrap: wrap; }
.flex-fill { flex: 1 1 auto; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 14px; }
.me-auto { margin-right: auto; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 22px; }
.mb-5 { margin-bottom: 40px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 22px; }
.p-0 { padding: 0 !important; }
.py-3 { padding-top: 14px; padding-bottom: 14px; }
.py-4 { padding-top: 22px; padding-bottom: 22px; }
.py-5 { padding-top: 44px; padding-bottom: 44px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--text-2) !important; }
.text-white { color: var(--text-1) !important; }
.small { font-size: .82rem; }
.fs-2 { font-size: 2rem; }

/* フォームの2〜3列グリッド (旧 row/col-md-* の置換) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid--tight { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

/* ===== 4. ボタン ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: var(--r-full);
    padding: 11px 22px; font-size: .88rem; font-weight: 600; letter-spacing: .02em;
    text-decoration: none; white-space: nowrap;
    transition: transform .12s ease, filter .2s ease, background .2s ease, color .2s ease, opacity .2s;
    position: relative;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-sm { padding: 7px 15px; font-size: .78rem; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent-hi) 0%, var(--accent) 55%, #00b48f 100%);
    color: var(--accent-ink); box-shadow: var(--glow-accent);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-success {
    background: linear-gradient(135deg, #3ee0a0 0%, #18b26f 100%);
    color: #041f14; box-shadow: 0 6px 18px rgba(52,211,153,.22);
}
.btn-danger { background: linear-gradient(135deg, #ff6b74 0%, #e6474f 100%); color: #fff; box-shadow: 0 6px 18px rgba(255,92,102,.22); }
.btn-outline-secondary { background: var(--surface-2); border: 1px solid var(--stroke-1); color: var(--text-2); }
.btn-outline-secondary:hover { color: var(--text-1); border-color: var(--stroke-2); }
.btn-outline-danger { background: var(--danger-dim); border: 1px solid rgba(255,92,102,.35); color: #ff8a8f; }
.btn-outline-danger:hover { background: rgba(255,92,102,.2); }
.btn-outline-light { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; }

/* ボタン内スピナー（多重タップ防止） */
.btn.is-busy { pointer-events: none; color: transparent !important; }
.btn.is-busy::after {
    content: ''; position: absolute; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-primary.is-busy::after, .btn-success.is-busy::after { border-color: rgba(3,32,25,.3); border-top-color: var(--accent-ink); }

/* 丸アイコンボタン（アカウント等） */
.btn-account {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-1); border: 1px solid var(--stroke-1);
    color: var(--text-2); font-size: 1.1rem; text-decoration: none;
    transition: all .25s;
}
.btn-account:active { transform: scale(.94); }

/* ===== 5. フォーム ===== */
.form-label { display: inline-block; font-size: .76rem; color: var(--text-2); letter-spacing: .04em; margin-bottom: 6px; }
.form-control, .form-select {
    display: block; width: 100%;
    background: rgba(0,0,0,.28); border: 1px solid var(--stroke-1); border-radius: 12px;
    color: var(--text-1); padding: 12px 14px; font-size: 16px; /* 16px未満はモバイルでズームされる */
    transition: border-color .2s, background .2s, box-shadow .2s;
    appearance: none; -webkit-appearance: none;
}
.form-control:focus, .form-select:focus {
    outline: none; background: rgba(0,0,0,.4);
    border-color: var(--stroke-accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-control::placeholder { color: var(--text-3); }
.form-control:read-only { opacity: .8; }
textarea.form-control { line-height: 1.7; resize: vertical; }
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239aa7b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 40px;
}
.form-select option { background: var(--bg-2); color: var(--text-1); }
.form-control-sm, .form-select-sm { padding: 9px 12px; font-size: 14px; }
select.form-select-sm { padding-right: 36px; }

/* 結合入力 (APIキー等: input + button) */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 12px 0 0 12px; border-right: none; flex: 1; min-width: 0; }
.input-group .btn { border-radius: 0 12px 12px 0; }

/* スイッチ (旧 form-check form-switch) */
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check-input {
    appearance: none; -webkit-appearance: none; flex-shrink: 0;
    width: 46px; height: 27px; border-radius: var(--r-full);
    background: var(--surface-2); border: 1px solid var(--stroke-2);
    position: relative; transition: background .25s, border-color .25s; cursor: pointer;
}
.form-check-input::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 19px; height: 19px; border-radius: 50%; background: var(--text-2);
    transition: transform .25s cubic-bezier(.22,1,.36,1), background .25s;
}
.form-check-input:checked { background: var(--accent); border-color: var(--accent); }
.form-check-input:checked::after { transform: translateX(19px); background: var(--accent-ink); }
.form-check-label { font-size: .85rem; color: var(--text-2); cursor: pointer; }

/* ===== 6. カード / サーフェス ===== */
.card {
    background: var(--surface-1);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid var(--stroke-1); border-radius: var(--r-md);
    margin-bottom: 16px; box-shadow: var(--shadow-1);
}
.card-body { padding: 20px; }

/* ===== 7. バッジ / チップ ===== */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .7rem; font-weight: 600; letter-spacing: .03em;
    padding: 5px 11px; border-radius: var(--r-full); white-space: nowrap;
}
.bg-danger  { background: var(--danger-dim) !important; color: #ff8a8f;  border: 1px solid rgba(255,92,102,.3); }
.bg-warning { background: var(--warn-dim) !important;   color: #ffdf9e;  border: 1px solid rgba(255,196,77,.3); }
.bg-success { background: var(--ok-dim) !important;     color: #6ee7b7;  border: 1px solid rgba(52,211,153,.3); }
.bg-info    { background: var(--info-dim) !important;   color: #a9ccff;  border: 1px solid rgba(125,180,255,.3); }
.badge-type { background: var(--accent-dim) !important; color: var(--accent); border: 1px solid rgba(0,212,170,.25); flex-shrink: 0; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chip-row::-webkit-scrollbar { height: 0; }
.chip {
    flex: 0 0 auto; background: var(--surface-1); border: 1px solid var(--stroke-1);
    color: var(--text-2); border-radius: var(--r-full); padding: 7px 15px;
    font-size: .78rem; font-weight: 500; white-space: nowrap; transition: all .2s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.chip-sub.on { background: var(--violet); color: #1c1236; }
.chip-pref.on { background: var(--blue); color: #0a1c33; }

/* ===== 8. アプリシェル ===== */
/* 画面ヘッダー */
.view-header { display: flex; justify-content: space-between; align-items: center; margin: 10px 2px 18px; min-height: 42px; }
.view-title { font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; margin: 0; color: var(--text-1); }
.view-title i { color: var(--accent); font-size: 1.05rem; margin-right: 10px; }

/* ボトムナビ */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
    display: flex; justify-content: center; gap: 2px;
    background: rgba(7,10,16,.85);
    -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
    border-top: 1px solid var(--stroke-1);
    padding: 8px 6px calc(8px + var(--safe-b));
}
.bottom-nav__item {
    flex: 1; max-width: 96px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 4px 0; border: none; background: transparent;
    color: var(--text-3); font-size: .6rem; font-weight: 500; letter-spacing: .04em;
    text-decoration: none; transition: color .2s;
}
.bottom-nav__item i { font-size: 1.2rem; transition: transform .2s cubic-bezier(.22,1,.36,1); }
.bottom-nav__item.active { color: var(--accent); }
.bottom-nav__item.active i { transform: translateY(-1px); filter: drop-shadow(0 2px 8px rgba(0,212,170,.5)); }
.bottom-nav__item:active i { transform: scale(.88); }

/* セグメントコントロール（見守り内切替） */
.seg {
    display: flex; gap: 4px;
    background: var(--surface-1); border: 1px solid var(--stroke-1);
    border-radius: var(--r-full); padding: 4px; margin-bottom: 20px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.seg::-webkit-scrollbar { height: 0; }
.seg__btn {
    flex: 1 0 auto; border: none; background: transparent;
    color: var(--text-2); font-size: .8rem; font-weight: 500;
    padding: 9px 14px; border-radius: var(--r-full); white-space: nowrap;
    transition: all .25s cubic-bezier(.22,1,.36,1);
}
.seg__btn.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 3px 12px rgba(0,212,170,.3); }

/* タブ切替トランジション */
.fade-enter-active, .fade-leave-active { transition: opacity .25s ease, transform .25s ease; }
.fade-enter-from { opacity: 0; transform: translateY(8px); }
.fade-leave-to { opacity: 0; transform: translateY(-4px); }

/* ===== 9. ホーム ===== */
.home-hero { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 2px 4px; }
.home-date { font-family: var(--font-en); font-size: .74rem; font-weight: 600; color: var(--text-3); letter-spacing: .12em; margin-bottom: 6px; }
.home-greet { font-size: 1.5rem; font-weight: 700; line-height: 1.35; color: var(--text-1); margin: 0; }
.home-greet .accent { color: var(--accent); }

.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 4px; }
.stat-pill {
    background: var(--surface-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md);
    padding: 14px 6px 12px; text-align: center; transition: transform .15s;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.stat-pill:active { transform: scale(.96); }
.stat-pill__num { font-family: var(--font-en); font-size: 1.55rem; font-weight: 700; line-height: 1.1; color: var(--text-1); }
.stat-pill__lbl { font-size: .64rem; color: var(--text-3); margin-top: 5px; letter-spacing: .04em; }
.stat-pill--alert { border-color: rgba(255,92,102,.4); background: var(--danger-dim); }
.stat-pill--alert .stat-pill__num { color: var(--danger); }
.stat-pill--warn { border-color: rgba(255,196,77,.35); background: var(--warn-dim); }
.stat-pill--warn .stat-pill__num { color: var(--warn); }

.home-section-title { font-size: .72rem; font-weight: 600; color: var(--text-3); letter-spacing: .14em; margin: 26px 2px 12px; }

.launcher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.launcher-card {
    background: var(--surface-1); border: 1px solid var(--stroke-1); border-radius: var(--r-lg);
    padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 12px;
    cursor: pointer; transition: transform .15s ease, border-color .2s;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    -webkit-tap-highlight-color: transparent;
}
.launcher-card:active { transform: scale(.96); }
.launcher-card__icon {
    width: 46px; height: 46px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.launcher-card--teal   .launcher-card__icon { background: var(--accent-dim); color: var(--accent); }
.launcher-card--blue   .launcher-card__icon { background: var(--blue-dim);   color: var(--blue); }
.launcher-card--violet .launcher-card__icon { background: var(--violet-dim); color: var(--violet); }
.launcher-card--neutral .launcher-card__icon { background: var(--surface-2); color: var(--text-2); }
.launcher-card__name { font-size: .95rem; font-weight: 600; color: var(--text-1); }
.launcher-card__desc { font-size: .68rem; color: var(--text-3); line-height: 1.55; margin-top: 2px; }
.launcher-card__badge { margin-left: 6px; vertical-align: 2px; }

/* 汎用リスト行 */
.list-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--stroke-1);
}
.list-row:last-child { border-bottom: none; }

/* ===== 10. 見守り: 状況リスト ===== */
.dash-item { padding: 16px 18px; border-bottom: 1px solid var(--stroke-1); }
.dash-item:last-child { border-bottom: none; }
.dash-item__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dash-item__name { font-size: 1rem; font-weight: 600; color: var(--text-1); }
.dash-item__status { font-size: .74rem; color: var(--text-3); }
.dash-stats { display: flex; align-items: center; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.dash-stat { text-align: center; }
.dash-stat .num { font-family: var(--font-en); font-size: 1.3rem; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.dash-stat .num.alert { color: var(--danger); }
.dash-stat .lbl { font-size: .62rem; color: var(--text-3); margin-top: 3px; }
.dash-stat--right { margin-left: auto; text-align: right; }
.dash-stat--right .num { font-size: .88rem; font-weight: 500; color: var(--text-2); }

/* ===== 11. 利用ログ ===== */
.log-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.log-card { margin-bottom: 10px; }
.log-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.log-head:active { background: var(--surface-1); }
.log-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.log-head .chevron { color: var(--text-3); font-size: .72rem; flex-shrink: 0; transition: transform .2s; }
.log-snippet { color: var(--text-2); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.log-body { padding: 14px 16px 16px; border-top: 1px solid var(--stroke-1); }
.chat-bubble { border-radius: 14px; padding: 11px 14px; margin-bottom: 8px; font-size: .88rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.chat-user { background: var(--surface-2); border: 1px solid var(--stroke-1); border-bottom-left-radius: 4px; }
.chat-ai { background: var(--accent-dim); border: 1px solid rgba(0,212,170,.18); border-bottom-right-radius: 4px; }
.chat-label { font-size: .68rem; letter-spacing: .05em; opacity: .7; display: block; margin-bottom: 4px; }
.chat-label i { margin-right: 4px; }

/* ===== 12. AIパーソナリティ（重要設定） ===== */
.prompt-dangerzone-banner {
    display: flex; align-items: flex-start; gap: 14px;
    background: var(--danger-dim); border: 1px solid rgba(255,92,102,.35);
    border-left: 3px solid var(--danger); border-radius: var(--r-sm);
    padding: 14px 18px; margin-bottom: 20px;
    color: #ffb3b6; font-size: .82rem; line-height: 1.7;
}
.prompt-dangerzone-banner i { color: #ff8a8f; font-size: 1.2rem; margin-top: 2px; }
.prompt-card { background: linear-gradient(180deg, rgba(42,16,20,.5), var(--surface-1)); border-color: rgba(255,92,102,.22); }
.prompt-card--editing { border-color: var(--danger); box-shadow: 0 0 0 1px rgba(255,92,102,.4), 0 10px 30px rgba(255,92,102,.12); }
.prompt-card__title { color: #ff8a8f !important; display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.prompt-card__badge { background: var(--danger-dim) !important; color: #ff8a8f !important; border: 1px solid rgba(255,92,102,.35); }
.prompt-card__textarea { font-size: .84rem; line-height: 1.7; }
.prompt-card__textarea[readonly] { background: rgba(0,0,0,.35); color: #b9c2cf; cursor: not-allowed; }
.prompt-card__textarea:not([readonly]) { background: rgba(34,8,10,.5); border-color: rgba(255,92,102,.5); }

/* ===== 13. ブログ ===== */
.blog-howto { background: var(--accent-dim); border: 1px solid rgba(0,212,170,.22); border-radius: var(--r-sm); margin-bottom: 20px; overflow: hidden; }
.blog-howto__title { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; cursor: pointer; color: var(--accent); font-size: .86rem; font-weight: 500; }
.blog-howto__list { padding: 0 22px 16px 40px; color: var(--text-1); font-size: .83rem; line-height: 1.9; }
.blog-howto__list li { margin-bottom: 8px; }
.blog-step { color: var(--accent) !important; font-size: .95rem; margin-bottom: 1rem !important; }
.blog-preview { width: 100%; height: 480px; border: 1px solid var(--stroke-2); border-radius: var(--r-sm); background: #fff; }

/* ===== 14. 名刺 ===== */
.card-search {
    position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 10px;
    background: rgba(13,17,26,.92);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid var(--stroke-1); border-radius: var(--r-full);
    padding: 12px 18px; margin-bottom: 14px;
}
.card-search:focus-within { border-color: var(--stroke-accent); }
.card-search i { color: var(--text-3); }
.card-search input { flex: 1; background: transparent; border: none; color: var(--text-1); outline: none; font-size: 16px; min-width: 0; }
.card-search input::placeholder { color: var(--text-3); }

.namecard {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--surface-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md);
    padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: transform .15s, border-color .2s;
    -webkit-tap-highlight-color: transparent;
}
.namecard:active { transform: scale(.98); border-color: var(--stroke-accent); }
.namecard-main { min-width: 0; }
.namecard-name { font-size: 1rem; color: var(--text-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.namecard-company { font-size: .78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.namecard-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.namecard-date { font-family: var(--font-en); font-size: .7rem; color: var(--text-3); }

.fab {
    position: fixed; right: 20px; bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
    width: 58px; height: 58px; border-radius: 18px; border: none; z-index: var(--z-fab);
    background: linear-gradient(135deg, var(--accent-hi), var(--accent) 70%);
    color: var(--accent-ink); font-size: 1.35rem;
    box-shadow: 0 10px 28px rgba(0,212,170,.4);
    transition: transform .15s;
}
.fab:active { transform: scale(.9); }

/* 全画面ビュー（名刺詳細・確認 / ブログ編集） */
.card-fs {
    position: fixed; inset: 0; z-index: var(--z-fullscreen);
    background: linear-gradient(180deg, var(--bg-0), var(--bg-1) 140px);
    display: flex; flex-direction: column;
    animation: fsIn .25s cubic-bezier(.22,1,.36,1);
}
@keyframes fsIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card-fs-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: calc(12px + var(--safe-t)) 16px 12px; border-bottom: 1px solid var(--stroke-1);
    background: rgba(7,10,16,.7);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.card-fs-body { flex: 1; overflow-y: auto; padding: 18px 18px calc(40px + var(--safe-b)); max-width: 640px; width: 100%; margin: 0 auto; }
.card-image-wrap { text-align: center; margin-bottom: 18px; }
.card-image { max-width: 100%; max-height: 260px; border-radius: var(--r-sm); border: 1px solid var(--stroke-2); }
.card-detail-name { color: var(--text-1); font-weight: 700; font-size: 1.3rem; margin-bottom: 2px; }
.detail-row { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--stroke-1); font-size: .9rem; }
.detail-row a { color: var(--accent); text-decoration: none; word-break: break-all; }
.detail-label { flex: 0 0 72px; color: var(--text-3); font-size: .76rem; padding-top: 2px; }
.dup-warn { background: var(--warn-dim); border: 1px solid rgba(255,196,77,.3); color: #ffdf9e; border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 16px; font-size: .83rem; }
.tray { margin-top: 24px; background: var(--danger-dim); border: 1px solid rgba(255,92,102,.3); border-radius: var(--r-sm); padding: 14px 16px; }
.tray-title { color: #ff8a8f; font-size: .83rem; margin-bottom: 10px; }
.tray-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .83rem; padding: 6px 0; }

/* カメラ */
.camera-fs { position: fixed; inset: 0; z-index: var(--z-camera); background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.camera-video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.camera-guide {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 86%; max-width: 460px; aspect-ratio: 1.6/1;
    border: 2px solid rgba(255,255,255,.75); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4);
}
.camera-controls { position: absolute; bottom: calc(30px + var(--safe-b)); left: 0; right: 0; display: flex; align-items: center; justify-content: space-around; z-index: 2; }
.shutter { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 5px solid rgba(255,255,255,.5); box-shadow: 0 0 0 4px rgba(0,0,0,.3); transition: transform .1s; }
.shutter:active { transform: scale(.9); }
.shutter:disabled { opacity: .4; }
.camera-fallback { position: absolute; top: 22%; color: #fff; text-align: center; z-index: 2; font-size: .9rem; line-height: 1.7; }
.fail-box { background: rgba(16,21,32,.97); border: 1px solid var(--stroke-2); border-radius: var(--r-md); padding: 26px; max-width: 360px; width: 88%; text-align: center; color: var(--text-1); z-index: 2; }

/* ===== 15. 処理中オーバーレイ（名刺解析など明示的な待ちのみ） ===== */
.busy-overlay {
    position: fixed; inset: 0; z-index: var(--z-busy);
    background: rgba(5,5,8,.88);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 26px;
}
.busy-overlay__label { color: var(--text-2); font-size: .88rem; letter-spacing: .1em; }
.loading-spinner { position: relative; width: 64px; height: 64px; }
.loading-spinner::before, .loading-spinner::after { content: ''; position: absolute; border-radius: 50%; }
.loading-spinner::before { width: 100%; height: 100%; border: 2px solid transparent; border-top-color: var(--accent); border-right-color: var(--blue); animation: spin 1.1s linear infinite; }
.loading-spinner::after { width: 58%; height: 58%; top: 21%; left: 21%; border: 2px solid transparent; border-bottom-color: var(--violet); border-left-color: var(--accent); animation: spin .8s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 16. スケルトン ===== */
.skel { position: relative; overflow: hidden; background: var(--surface-1); border-radius: var(--r-sm); }
.skel::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent);
    animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel--text { height: 14px; margin-bottom: 8px; }
.skel--row { height: 68px; border-radius: var(--r-md); margin-bottom: 10px; }
.skel--stat { height: 82px; border-radius: var(--r-md); }

/* ===== 17. ボトムシート（確認ダイアログ） ===== */
.sheet-backdrop {
    position: fixed; inset: 0; z-index: var(--z-sheet);
    background: rgba(3,5,9,.65);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
    width: 100%; max-width: 560px;
    background: var(--bg-2); border: 1px solid var(--stroke-1); border-bottom: none;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 8px 22px calc(22px + var(--safe-b));
    box-shadow: var(--shadow-2);
}
.sheet__handle { width: 36px; height: 4px; border-radius: 2px; background: var(--stroke-2); margin: 8px auto 18px; }
.sheet__title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.sheet__title.danger { color: #ff8a8f; }
.sheet__body { font-size: .88rem; color: var(--text-2); line-height: 1.8; white-space: pre-wrap; margin-bottom: 22px; }
.sheet__actions { display: flex; gap: 10px; }
.sheet__actions .btn { flex: 1; }
/* シート出入り */
.sheet-enter-active, .sheet-leave-active { transition: opacity .25s ease; }
.sheet-enter-active .sheet, .sheet-leave-active .sheet { transition: transform .3s cubic-bezier(.22,1,.36,1); }
.sheet-enter-from, .sheet-leave-to { opacity: 0; }
.sheet-enter-from .sheet, .sheet-leave-to .sheet { transform: translateY(100%); }

/* ===== 18. トースト ===== */
.toast-stack {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: var(--z-toast);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    width: max-content; max-width: calc(100vw - 40px); pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 9px;
    background: rgba(16,21,32,.96); border: 1px solid var(--stroke-accent);
    color: var(--text-1); padding: 11px 19px; border-radius: var(--r-full);
    font-size: .84rem; box-shadow: var(--shadow-1); max-width: 100%;
}
.toast i { color: var(--accent); flex-shrink: 0; }
.toast--error { border-color: rgba(255,92,102,.45); }
.toast--error i { color: var(--danger); }
.toast-enter-active, .toast-leave-active { transition: opacity .25s, transform .25s; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(10px); }

/* ===== 19. スプラッシュ（消灯側。初期描画はindex.htmlのインラインCSS） ===== */
#splash.splash--out { opacity: 0; pointer-events: none; }

/* ===== 20. 顧客情報テキストエリア ===== */
.info-textarea { min-height: 300px; font-size: .9rem; line-height: 1.8; }

/* ===== 21. レスポンシブ微調整 ===== */
@media (min-width: 720px) {
    .launcher-grid { grid-template-columns: repeat(4, 1fr); }
    .bottom-nav__item { font-size: .66rem; }
}
