/* かぞくトーク — 小学3年生と祖父母が、迷わず長く使える「家族の秘密基地」 */
:root {
  --bg: #f7f5ff; --bg-chat: #f3f0ff; --panel: #fffefd; --panel-soft: #f8f7ff;
  --ink: #302d43; --muted: #77728a; --line: #e8e4f1;
  --brand: #7567e8; --brand-dark: #5a4fd0; --brand-soft: #eeebff;
  --sky: #65c9e8; --mine: #dff5c9; --mine-line: #c7e8a9;
  --accent: #ff6f91; --accent-soft: #fff0f4; --sun: #ffd76a;
  --safe: #2e9f72; --danger: #d85361; --danger-soft: #fff0f1;
  --radius: 22px; --tap: 52px; --fs: 17px;
  --shadow-sm: 0 2px 10px rgba(63, 51, 118, .08); --shadow: 0 12px 32px rgba(63, 51, 118, .12);
}
html[data-big="1"] { --fs: 21px; --tap: 60px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: var(--fs); font-family: 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif; line-height: 1.55; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button, input, textarea, select { font-family: inherit; }
button { touch-action: manipulation; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: .82em; }
.center { text-align: center; }
.error { color: var(--danger); font-weight: 800; background: var(--danger-soft); border-radius: 14px; padding: 10px 12px; }
.screen { height: 100vh; height: 100dvh; }
.screen.center { display: grid; place-content: center; gap: 8px; justify-items: center; }

/* ブランド */
.logo-mark { width: 78px; height: 78px; border-radius: 27px; position: relative; background: linear-gradient(145deg, #9185ff 0%, #6f64e8 55%, #5fc8e4 100%); box-shadow: 0 13px 28px rgba(94, 81, 207, .24), inset 0 1px rgba(255,255,255,.42); }
.logo-mark::before { content: ''; position: absolute; inset: 19px 17px 25px; background: #fff; border-radius: 15px 15px 15px 5px; transform: rotate(-2deg); }
.logo-mark::after { content: '♥'; position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 7px; color: #ff7797; font: 900 21px/1 system-ui; }
.boot-title { margin: 8px 0 0; font-size: 1.2em; font-weight: 900; letter-spacing: .04em; }
.mini-mark { width: 32px; height: 32px; border-radius: 11px; flex: none; position: relative; background: linear-gradient(145deg, #9185ff, #5fc8e4); box-shadow: var(--shadow-sm); }
.mini-mark::after { content: '♥'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 900 13px/1 system-ui; }

/* 参加画面 */
#screen-join { display: grid; place-items: center; overflow: auto; padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 12% 13%, rgba(255, 215, 106, .30) 0 58px, transparent 59px), radial-gradient(circle at 88% 85%, rgba(101, 201, 232, .22) 0 88px, transparent 89px), linear-gradient(145deg, #f8f5ff 0%, #f1f8ff 100%); }
.join-card { background: rgba(255, 254, 253, .95); border: 1px solid rgba(255,255,255,.9); border-radius: 32px; box-shadow: var(--shadow); padding: 25px 24px 28px; width: min(480px, 100%); display: grid; gap: 19px; justify-items: stretch; }
.join-brand { display: flex; align-items: center; justify-content: center; gap: 15px; text-align: left; }
.join-brand .logo-mark { width: 60px; height: 60px; border-radius: 21px; flex: none; }
.join-brand .logo-mark::before { inset: 15px 13px 20px; border-radius: 11px 11px 11px 4px; }
.join-brand .logo-mark::after { font-size: 16px; padding-bottom: 5px; }
.join-card h1 { margin: 0; font-size: 1.55em; line-height: 1.15; letter-spacing: .02em; }
.eyebrow { margin: 0 0 4px; color: var(--brand); font-size: .72em; font-weight: 900; letter-spacing: .04em; }
.join-step { display: grid; gap: 16px; justify-items: stretch; text-align: center; }
.step-pill { justify-self: center; display: inline-flex; gap: 7px; align-items: center; padding: 6px 13px 6px 7px; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; font-size: .78em; font-weight: 900; }
.step-pill span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--brand); }
.step-pill.safe { background: #e8f8f2; color: #247b5b; }
.step-pill.safe span { background: var(--safe); }
.lead { margin: 0; font-size: 1.05em; }
.big-emoji { font-size: 64px; line-height: 1; filter: drop-shadow(0 7px 12px rgba(76,60,130,.14)); }
.privacy-note { margin: -3px 0 0; color: var(--safe); font-size: .75em; font-weight: 800; }
.warn { margin: 0; background: #fff8de; border: 2px solid #f5d66e; border-radius: 17px; padding: 13px 15px; font-size: .88em; text-align: left; }
.field { display: grid; gap: 6px; text-align: left; width: 100%; }
.field > span { color: var(--muted); font-size: .82em; font-weight: 900; padding-left: 3px; }
input[type=text], textarea, select { width: 100%; min-height: var(--tap); padding: 12px 15px; border: 2px solid var(--line); border-radius: 16px; background: #fbfaff; color: var(--ink); font: inherit; font-size: max(16px, 1em); transition: border-color .16s, box-shadow .16s; }
input[type=text]:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
#in-code { text-align: center; font-weight: 900; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
#in-key { font-family: ui-monospace, Menlo, monospace; font-size: max(15px, .85em); letter-spacing: .04em; }
.btn { width: 100%; min-height: var(--tap); padding: 0 21px; border: 0; border-radius: 17px; background: #f0eef6; color: var(--ink); font: inherit; font-weight: 900; cursor: pointer; transition: transform .12s, box-shadow .12s, opacity .12s; }
.btn.primary { color: #fff; background: linear-gradient(135deg, #8174ef, #685bdc); box-shadow: 0 5px 0 #5045bf, 0 9px 18px rgba(94,81,207,.18); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #5045bf; }
.btn.big { min-height: calc(var(--tap) + 7px); font-size: 1.06em; }
.btn.ghost { color: var(--muted); background: transparent; box-shadow: none; }
.btn.danger { color: #fff; background: var(--danger); }
.btn.danger-soft { color: var(--danger); background: var(--danger-soft); border: 2px solid #f6cbd1; }
.btn:disabled { opacity: .45; box-shadow: none; }
.emoji-pick, .color-pick { display: flex; flex-wrap: wrap; gap: 9px; }
.emoji-pick button, .color-pick button { width: var(--tap); height: var(--tap); padding: 0; border: 3px solid transparent; border-radius: 18px; background: var(--panel-soft); font-size: 26px; cursor: pointer; transition: transform .12s, background .12s; }
.emoji-pick button:active { transform: scale(.92); }
.emoji-pick button[aria-pressed=true], .color-pick button[aria-pressed=true] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 3px 10px rgba(91,75,202,.14); }
.color-pick button { border-radius: 50%; font-size: 0; }
.spinner { justify-self: center; width: 50px; height: 50px; border: 6px solid #e5e0f7; border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sas-icon { margin: -4px 0 -8px; font-size: 37px; }
.sas { width: 100%; padding: 15px 8px 17px; border: 3px solid #b9ead7; border-radius: 22px; background: #f0fcf8; color: #1e5f49; font-size: clamp(2.2em, 11vw, 3em); font-weight: 900; letter-spacing: .16em; line-height: 1.1; font-variant-numeric: tabular-nums; box-shadow: inset 0 -4px rgba(46,159,114,.07); }
.sas-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sas-checks p { margin: 0; padding: 9px 6px; border-radius: 12px; background: #f3f1fb; color: var(--muted); font-size: .78em; font-weight: 800; }
.sas-checks span { color: var(--safe); }
.safe-note { margin: -3px 0 0; color: var(--danger); font-size: .8em; font-weight: 900; }
.safe-action { background: linear-gradient(135deg, #3ab483, #258f68) !important; box-shadow: 0 5px 0 #1b7252, 0 9px 18px rgba(37,143,104,.17) !important; }
.keywords { margin: 0; padding: 13px; border: 2px dashed #c9c2df; border-radius: 15px; background: #f8f6fc; text-align: left; white-space: pre-wrap; word-break: break-all; font: .82em/1.9 ui-monospace, Menlo, monospace; }

/* アプリ本体 */
.app { display: grid; grid-template-columns: 1fr; }
.pane-list, .pane-chat { min-width: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--panel); }
@media (min-width: 820px) { .app { grid-template-columns: 340px 1fr; background: var(--panel); } .pane-list { border-right: 1px solid var(--line); box-shadow: 7px 0 24px rgba(63,51,118,.05); z-index: 2; } .icon-btn.back { display: none; } }
@media (max-width: 819px) { .app.chat-open .pane-list { display: none; } .app:not(.chat-open) .pane-chat { display: none; } }
.bar { min-height: calc(var(--tap) + 12px); padding: calc(8px + env(safe-area-inset-top)) 12px 8px; display: flex; align-items: center; gap: 8px; flex: none; background: rgba(255,254,253,.96); border-bottom: 1px solid var(--line); }
.brand-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 900; }
.brand-title div { display: grid; line-height: 1.18; }
.brand-title small { margin-top: 3px; color: var(--muted); font-size: .63em; font-weight: 700; }
.chat-heading { flex: 1; min-width: 0; text-align: center; line-height: 1.2; }
.bar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.icon-btn { min-width: var(--tap); min-height: var(--tap); padding: 0; border: 0; border-radius: 16px; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.icon-btn:active { background: var(--brand-soft); transform: scale(.96); }
.icon-btn.soft { background: var(--panel-soft); }
.icon-btn.back { font-size: 38px; line-height: 1; }
.icon-btn.round { flex: none; border-radius: 50%; background: #f2f0f8; }
.presence { min-height: 1em; margin-top: 3px; color: var(--safe); font-size: .67em; font-weight: 800; }
.presence:not(:empty)::before { content: ''; width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; background: #49bd81; }

/* トーク一覧 */
.room-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px; }
.room { width: 100%; min-height: 77px; padding: 11px 10px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 20px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; transition: background .13s, transform .13s; }
.room:active { transform: scale(.985); }
.room:active, .room.active { background: var(--brand-soft); }
.avatar { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.9); border-radius: 19px; color: #fff; font-size: 25px; box-shadow: 0 5px 13px rgba(61,47,112,.13), inset 0 -3px 6px rgba(0,0,0,.06); }
.avatar.sm { width: 36px; height: 36px; border-width: 2px; border-radius: 13px; font-size: 18px; }
.avatar.group { background: linear-gradient(145deg, #ffd86e, #ff9d82); }
.room-main { flex: 1; min-width: 0; }
.room-name-row { display: flex; align-items: center; gap: 8px; }
.room-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.room-time { flex: none; color: var(--muted); font-size: .66em; font-weight: 700; }
.room-sub { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .78em; }
.room-side { min-width: 27px; display: grid; justify-items: center; gap: 7px; }
.badge { min-width: 27px; height: 27px; padding: 0 7px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #ff7b9b, #f25f84); color: #fff; font-size: .72em; font-weight: 900; box-shadow: 0 4px 10px rgba(236,84,123,.24); }
.dot-online { width: 10px; height: 10px; border: 2px solid var(--panel); border-radius: 50%; background: #4ac283; box-shadow: 0 0 0 2px #d8f5e7; }
.admin-badge { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.admin-badge button { width: 100%; padding: 11px 14px; border: 0; border-radius: 14px; background: #fff5d8; color: #8b6216; font: inherit; font-size: .83em; font-weight: 900; cursor: pointer; }

/* メッセージ */
.messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 3px; padding: 14px 13px 9px; background-color: var(--bg-chat); background-image: radial-gradient(circle at 1px 1px, rgba(117,103,232,.065) 1px, transparent 0); background-size: 22px 22px; }
.daysep { align-self: center; margin: 12px 0 7px; padding: 4px 12px; border: 1px solid rgba(117,103,232,.08); border-radius: 13px; background: rgba(255,255,255,.74); color: var(--muted); font-size: .7em; font-weight: 800; backdrop-filter: blur(5px); }
.msg { max-width: 100%; margin-top: 8px; display: flex; align-items: flex-end; gap: 8px; }
.msg.mine { flex-direction: row-reverse; }
.msg.cont { margin-top: 2px; }
.msg.cont .avatar, .msg.cont .who { visibility: hidden; height: 0; margin: 0; }
.msg-col { min-width: 0; max-width: min(74%, 490px); display: flex; flex-direction: column; }
.msg.mine .msg-col { align-items: flex-end; }
.who { margin: 0 0 3px 5px; color: var(--muted); font-size: .72em; font-weight: 800; }
.bubble { padding: 10px 14px; border: 1px solid rgba(90,72,150,.07); border-radius: 20px 20px 20px 7px; background: var(--panel); box-shadow: 0 4px 12px rgba(63,51,118,.08); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; cursor: pointer; }
.msg.mine .bubble { border-color: var(--mine-line); border-radius: 20px 20px 7px 20px; background: var(--mine); }
.bubble:active { filter: brightness(.98); }
.bubble.plain, .msg.mine .bubble.plain { padding: 0; border: 0; background: transparent; box-shadow: none; }
.bubble.plain svg, .bubble.plain img { display: block; }
.bubble svg { width: 145px; height: 145px; filter: drop-shadow(0 5px 7px rgba(60,48,102,.10)); }
html[data-big="1"] .bubble svg { width: 172px; height: 172px; }
.bubble img.photo { width: 250px; max-width: 100%; display: block; border: 4px solid var(--panel); border-radius: 20px; background: #e4e0ed; box-shadow: var(--shadow-sm); }
.meta { margin: 3px 6px 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .64em; }
.msg.mine .meta { flex-direction: row-reverse; }
.read-mark { color: var(--safe); font-weight: 900; }
.reacts { margin: 3px 4px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.react-chip { padding: 2px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-sm); font-size: .79em; cursor: pointer; }
.react-chip.on { border-color: #ff93ad; background: var(--accent-soft); }
.sys { align-self: center; padding: 6px; color: var(--muted); font-size: .78em; }
.typing { padding: 5px 18px 8px; background: var(--bg-chat); color: var(--muted); font-size: .78em; }
.typing::before { content: '•••'; margin-right: 6px; color: var(--brand); letter-spacing: 2px; }
.load-more { align-self: center; margin: 6px 0; padding: 8px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); font: inherit; font-size: .8em; font-weight: 800; cursor: pointer; }
.chat-empty { margin: auto; width: min(330px, 90%); padding: 24px 20px; text-align: center; border: 1px solid rgba(117,103,232,.1); border-radius: 28px; background: rgba(255,255,255,.76); box-shadow: var(--shadow-sm); backdrop-filter: blur(5px); }
.empty-friends { font-size: 42px; letter-spacing: 8px; }
.chat-empty h2 { margin: 9px 0 4px; font-size: 1.08em; }
.chat-empty p { margin: 0 0 14px; color: var(--muted); font-size: .84em; white-space: pre-line; }
.empty-action { min-height: 46px; padding: 0 17px; border: 0; border-radius: 15px; background: var(--brand-soft); color: var(--brand-dark); font: inherit; font-size: .86em; font-weight: 900; cursor: pointer; }

/* 入力欄・スタンプ */
.composer { flex: none; display: flex; align-items: flex-end; gap: 7px; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,254,253,.98); }
.composer .icon-btn { width: var(--tap); height: var(--tap); font-size: 24px; }
.sticker-button { color: var(--brand); font-weight: 900; }
.photo-button { background: #eef8fb !important; }
.input-wrap { flex: 1; min-width: 0; }
#in-msg { min-height: var(--tap); max-height: 130px; padding: 12px 16px; resize: none; overflow-y: auto; border-radius: 23px; background: #f7f6fb; }
.send-btn { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(145deg, #8174ef, #6759d9); color: #fff; font-size: 21px; cursor: pointer; box-shadow: 0 4px 11px rgba(91,75,202,.23); }
.send-btn span { transform: translateX(1px) rotate(-5deg); }
.send-btn:active:not(:disabled) { transform: scale(.93); }
.send-btn:disabled { background: #d9d5e2; box-shadow: none; }
.drawer { height: min(52dvh, 390px); flex: none; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--panel); box-shadow: 0 -10px 28px rgba(63,51,118,.08); }
.drawer-head { padding: 7px 12px 4px 16px; display: flex; align-items: center; justify-content: space-between; }
.drawer-head > div { display: grid; }
.drawer-head strong { font-size: .92em; }
.drawer-head small { color: var(--muted); font-size: .65em; }
.sticker-grid { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; padding: 7px 10px 14px; }
.sticker-grid button { position: relative; min-width: 0; padding: 7px 5px 5px; border: 1px solid transparent; border-radius: 19px; background: var(--panel-soft); cursor: pointer; }
.sticker-grid button:active { transform: scale(.94); background: var(--brand-soft); }
.sticker-grid svg { width: 100%; height: auto; display: block; }
.sticker-name { display: block; margin-top: -3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .66em; font-weight: 800; }

/* シート・設定 */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(34,28,60,.48); backdrop-filter: blur(4px); }
.sheet-inner { width: min(640px, 100%); max-height: 93vh; max-height: 93dvh; overflow: hidden; display: flex; flex-direction: column; border-radius: 29px 29px 0 0; background: var(--bg); box-shadow: 0 -12px 40px rgba(24,19,50,.2); }
.sheet-inner.narrow { width: min(455px, 100%); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; gap: 12px; padding: 10px 14px calc(26px + env(safe-area-inset-bottom)); }
.settings-group { margin: 6px 3px -3px; color: var(--brand); font-size: .72em; font-weight: 900; letter-spacing: .06em; }
.settings-group.admin-only { color: #9b6a1e; }
.card { position: relative; display: grid; gap: 12px; padding: 17px; border: 1px solid rgba(117,103,232,.06); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow-sm); }
.card.admin-card { border-color: #f0dfb9; }
.card h2 { margin: 0; font-size: 1em; }
.guardian-label { position: absolute; top: 15px; right: 15px; padding: 4px 8px; border-radius: 9px; background: #fff4d7; color: #93671e; font-size: .65em; font-weight: 900; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row > select { min-width: 165px; flex: 1; }
.row > .btn { width: auto; flex: none; }
.toggle { min-height: var(--tap); display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; }
.toggle input { width: 29px; height: 29px; flex: none; accent-color: var(--brand); }
.invite-out { display: grid; gap: 8px; padding: 15px; border: 2px dashed #beb4ee; border-radius: 17px; background: var(--brand-soft); text-align: center; }
.invite-code { font: 900 1.65em/1.2 ui-monospace, Menlo, monospace; letter-spacing: .1em; }
.pending-list, #member-list { display: grid; gap: 8px; }
.pending-item, .member-item { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 17px; background: var(--panel-soft); }
.pending-item .grow, .member-item .grow { flex: 1; min-width: 0; }
.pending-item .btn, .member-item .btn { width: auto; min-height: 43px; padding: 0 13px; font-size: .84em; }
.device-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .74em; }

/* オーバーレイ */
.viewer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(13,11,20,.92); }
.viewer img { max-width: 96%; max-height: 92%; border-radius: 16px; }
.react-bar { position: fixed; z-index: 50; display: flex; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 27px; background: var(--panel); box-shadow: 0 10px 35px rgba(31,25,58,.24); }
.react-bar button { width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 25px; cursor: pointer; }
.react-bar button:active { transform: scale(.9); background: var(--brand-soft); }
.toast { position: fixed; left: 50%; bottom: calc(27px + env(safe-area-inset-bottom)); z-index: 70; max-width: 90%; padding: 12px 20px; transform: translateX(-50%); border-radius: 16px; background: rgba(43,38,61,.95); color: #fff; text-align: center; font-weight: 800; box-shadow: 0 8px 25px rgba(26,21,47,.25); }

@media (min-width: 700px) { .sheet { align-items: center; padding: 24px; } .sheet-inner { border-radius: 29px; } }
@media (max-width: 430px) { .join-card { padding: 22px 18px 24px; border-radius: 27px; } .join-brand { gap: 11px; } .join-brand .logo-mark { width: 53px; height: 53px; } .join-card h1 { font-size: 1.38em; } .composer { gap: 5px; padding-left: 7px; padding-right: 7px; } .composer .icon-btn, .send-btn { width: 48px; min-width: 48px; } .bubble svg { width: 132px; height: 132px; } .sticker-grid { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1a28; --bg-chat: #201d2d; --panel: #282536; --panel-soft: #312e40; --ink: #f4f1fb; --muted: #aaa4bd; --line: #3b374c; --brand: #9c91ff; --brand-dark: #b0a8ff; --brand-soft: #383354; --mine: #35533a; --mine-line: #46684b; --accent-soft: #482d39; --danger-soft: #472b31; --shadow-sm: 0 2px 10px rgba(0,0,0,.25); --shadow: 0 12px 32px rgba(0,0,0,.32); }
  #screen-join { background: radial-gradient(circle at 12% 13%, rgba(255,215,106,.10) 0 58px, transparent 59px), radial-gradient(circle at 88% 85%, rgba(101,201,232,.09) 0 88px, transparent 89px), #1c1a28; }
  .join-card, .bar, .composer { background: rgba(40,37,54,.97); }
  input[type=text], textarea, select, #in-msg { background: #24212f; }
  input[type=text]:focus, textarea:focus, select:focus { background: #292536; }
  .sas { background: #20372f; border-color: #376f59; color: #a8efd2; }
  .warn { background: #3a3424; border-color: #6e6035; }
  .keywords { background: #24212f; border-color: #514a65; }
  .daysep, .chat-empty { background: rgba(40,37,54,.82); }
  .bubble img.photo { border-color: #353141; }
  .guardian-label { background: #493f26; color: #f0d58f; }
  .card.admin-card { border-color: #51472e; }
  .invite-out { border-color: #635a92; }
}


/* iPhone / iPad で Safari のまま参加しようとしたときの案内 */
.ios-first {
  background: #fff6d8; border: 2px solid #ffd85e; border-radius: 16px;
  padding: 14px 16px; text-align: left; font-size: .9em; width: 100%;
}
.ios-first-title { font-weight: 800; margin: 0 0 6px; font-size: 1.05em; }
.ios-first p { margin: 0 0 6px; }
.ios-first ol { margin: 6px 0 6px; padding-left: 1.3em; }
.ios-first li { margin: 3px 0; }
@media (prefers-color-scheme: dark) {
  .ios-first { background: #3b3320; border-color: #7a6a2e; }
}


/* グループ作成・メンバー選択 */
.member-check-list { display: grid; gap: 6px; }
.member-check {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap);
  padding: 6px 10px; border-radius: 14px; background: rgba(127,127,127,.08); cursor: pointer;
}
.member-check input { width: 24px; height: 24px; accent-color: var(--brand, #7567e8); flex: none; }
.member-check .grow { flex: 1; min-width: 0; font-weight: 700; }


/* 顔写真アバター */
.avatar.has-photo { font-size: 0; background-size: cover; background-position: center; }
.avatar-row { align-items: center; }
.avatar-row .avatar { width: 64px; height: 64px; font-size: 30px; }
.avatar-row .btn { width: auto; }
