/* 介護ロープレ LIFF — モバイル前提。紺 #1B2756 / 金 #FBAE40 はBiL資料と共通 */
:root {
  --navy: #1B2756; --navy-soft: #EEF1F8; --gold: #FBAE40; --gold-soft: #FFF4E0;
  --ink: #1B1F2A; --muted: #5C6270; --faint: #8A93A6; --line: #E3E5EA; --bg: #F5F6F9; --surface: #fff;
  --ok: #2E8B5E; --ok-soft: #E4F3EA; --bad: #C94F4F; --bad-soft: #F8E6E6; --warn: #D98B2C;
  --r: 14px; --shadow: 0 1px 2px rgba(27,31,42,.05), 0 8px 24px rgba(27,31,42,.06);
  --font: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.app { min-height: 100vh; padding-bottom: 32px; }
.center { display: grid; place-items: center; min-height: 70vh; gap: 12px; text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar { background: var(--navy); color: #fff; padding: 14px 18px calc(14px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; }
.topbar .back { background: transparent; border: 0; color: #fff; font-size: 20px; padding: 2px 6px; margin-left: -6px; }
.topbar .t { font-weight: 700; font-size: 16px; flex: 1; }
.topbar .who { font-size: 12px; opacity: .8; }
.wrap { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card.tap { cursor: pointer; transition: transform .1s; }
.card.tap:active { transform: scale(.985); }
.sc-head { display: flex; gap: 12px; align-items: flex-start; }
.sc-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--navy-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.sc-sub { font-size: 12px; color: var(--faint); }
.sc-title { font-size: 16px; font-weight: 700; }
.sc-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stars { color: var(--gold); letter-spacing: 1px; }
.sc-sit { font-size: 13px; color: var(--muted); margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1B1F2A; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--bad); border-color: #EBC7C7; }
.btn:disabled { opacity: .5; }
.btn.sm { padding: 9px 12px; font-size: 13.5px; width: auto; }
.row { display: flex; gap: 10px; }

.kv { display: grid; grid-template-columns: 72px 1fr; gap: 8px 10px; font-size: 14px; }
.kv dt { color: var(--faint); font-size: 12.5px; padding-top: 2px; }
.kv dd { margin: 0; }
.sec-h { font-size: 12.5px; color: var(--faint); font-weight: 600; letter-spacing: .04em; margin-bottom: 8px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 14px; align-items: start; }
.checks .b { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line); margin-top: 3px; }
.checks .b.ok { background: var(--ok); border-color: var(--ok); position: relative; }
.checks .b.ok::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checks .b.ng { background: var(--bad-soft); border-color: var(--bad); }
.checks .ev { font-size: 12px; color: var(--muted); }
.note { background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #6B4A10; }
.note.info { background: var(--navy-soft); color: var(--navy); }

/* chat (text mode inside LIFF) */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 40vh; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.7; }
.msg.ai { background: var(--surface); box-shadow: var(--shadow); border-top-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--navy); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.msg .n { font-size: 11px; color: var(--faint); margin-bottom: 2px; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.composer textarea { resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; min-height: 46px; max-height: 120px; background: var(--surface); }
.composer button { padding: 0 18px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* result */
.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: left; }
.ring { position: relative; width: 116px; height: 116px; }
.ring svg { transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .v { font-size: 34px; font-weight: 800; line-height: 1; color: var(--navy); }
.ring .v small { font-size: 12px; color: var(--faint); font-weight: 500; }
.summary { font-size: 14px; line-height: 1.8; }
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 96px 1fr 28px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--navy); border-radius: 4px; }
.bar.scene .fill { background: var(--gold); }
.bar .val { text-align: right; font-weight: 700; }
.bar .cm { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -3px; }
.pts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pts li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 14px; }
.pts .m { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 3px; }
.pts.good .m { background: var(--ok-soft); color: var(--ok); }
.pts.imp .m { background: var(--gold-soft); color: var(--warn); }
.rewrite { display: grid; gap: 8px; }
.rewrite .box { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.7; }
.rewrite .was { background: var(--bg); }
.rewrite .better { background: var(--ok-soft); }
.rewrite .lab { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.rewrite .scene-l { font-size: 12px; color: var(--faint); }
details summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 6px 0; }
.transcript { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--navy-soft); color: var(--navy); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.warn { background: var(--gold-soft); color: var(--warn); }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; }
.list-item .t { font-weight: 600; font-size: 14px; }
.list-item .s { font-size: 12px; color: var(--muted); }
.score-pill { font-weight: 800; font-size: 18px; color: var(--navy); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 100; max-width: 90vw; }
.toast.err { background: var(--bad); }
.tabs { display: flex; gap: 6px; }
.tab { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
