/* 시민 앱(/citizen) 전용 스타일 — 공용 lcp.css 위에 얹는다. 모바일 우선, 고령자 모드(html.elder) 지원. */
body.cz { --lcp-font-base: 16px; --cz-tabs-h: 72px; }
html.elder body.cz { --lcp-font-base: 19px; --cz-tabs-h: 82px; }
body.cz .lcp-main.cz-main { max-width: 640px; padding-top: 12px; }
body.cz [hidden] { display: none !important; }
@media (max-width: 720px) { body.cz .lcp-nav { display: none; } body.cz .lcp-bar { flex-wrap: nowrap; } body.cz .lcp-statusbar { font-size: 11px; } }
body.cz .lcp-bar .lcp-user { display: none; }

.cz-view { display: flex; flex-direction: column; gap: 14px; animation: lcp-fade .18s ease; }
.cz-h1 { font-size: 24px; letter-spacing: -0.02em; margin: 4px 0 0; line-height: 1.3; }
.cz-sub { color: var(--text-secondary); margin: 2px 0 0; }
html.elder .cz-h1 { font-size: 28px; }
.cz-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-sm); }
.cz-card h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -0.01em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cz-card h3 { margin: 14px 0 4px; font-size: 14px; color: var(--text-secondary); }
.cz-card p { margin: 6px 0; }
.cz-card .muted, .cz-muted { color: var(--text-secondary); font-size: 14px; }
.cz-small { font-size: 13px; color: var(--text-muted); }
.cz-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.cz-actions .btn { flex: 1 1 140px; }
.btn.xl { min-height: 60px; font-size: 18px; border-radius: 16px; }
html.elder .btn { min-height: 54px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: lcp-spin .7s linear infinite; }

/* 지금 해야 할 일 */
.cz-next { border-left: 6px solid var(--accent); background: var(--lcp-accent-soft); }
.cz-next.urgent { border-left-color: var(--status-critical); background: var(--lcp-crit-soft); }
.cz-next.done { border-left-color: var(--status-good); background: var(--lcp-good-soft); }
.cz-next .kicker { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: 0; }
.cz-next.urgent .kicker { color: var(--lcp-ink-crit); }
.cz-next h2 { font-size: 20px; margin: 4px 0 6px; }
.cz-plan-list { margin: 6px 0 0; padding-left: 20px; }
.cz-plan-list li { margin: 3px 0; }
.cz-revise { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cz-revise textarea, .cz-text { width: 100%; font: inherit; background: var(--page); color: var(--text-primary); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 54px; }

/* 마이크 */
.cz-mic { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px 16px; }
.cz-mic-btn { width: 104px; height: 104px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), #12b886); color: #fff; font-size: 44px; cursor: pointer; box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--accent) 70%, transparent); display: grid; place-items: center; padding: 0; }
.cz-mic-btn:active { transform: scale(.97); }
.cz-mic-btn.rec { background: var(--status-critical); animation: cz-pulse 1.4s ease-out infinite; }
@keyframes cz-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-critical) 55%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.cz-mic-text { display: flex; gap: 8px; width: 100%; }
.cz-mic-text input { flex: 1; min-width: 0; font: inherit; background: var(--page); color: var(--text-primary); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-height: 48px; }

/* 케이스 */
.cz-case h3.title { margin: 0; font-size: 17px; color: var(--text-primary); }
.cz-case dl { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; margin: 10px 0 0; font-size: 14.5px; }
.cz-case dt { color: var(--text-muted); } .cz-case dd { margin: 0; }
.cz-why { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.cz-why summary, .cz-fold summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 40px; display: flex; align-items: center; }
.cz-fold { background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px; padding: 4px 16px; }
.cz-fold[open] { padding-bottom: 16px; }
.cz-fold > .cz-view { margin-top: 8px; }

/* 빠른 메뉴 */
.cz-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cz-quick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 10px 8px; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 16px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-align: center; }
.cz-quick button:hover:not(:disabled) { background: var(--lcp-accent-soft); }
.cz-quick button[aria-pressed="true"] { border-color: var(--accent); background: var(--lcp-accent-soft); }
.cz-quick button .ic { font-size: 30px; line-height: 1; }
.cz-quick button:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; gap: 12px; min-height: 68px; }
html.elder .cz-quick button { font-size: 18px; min-height: 104px; }

/* 진행 표시 */
.cz-progress { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 10px 0 6px; }
.cz-progress > i { display: block; height: 100%; width: 38%; border-radius: 6px; background: var(--accent); animation: cz-slide 1.3s ease-in-out infinite; }
@keyframes cz-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* 추천 카드 */
.cz-rec { border-top: 4px solid #6c3fc5; }
.cz-rec h2 { font-size: 18px; }
.cz-rec-sec { margin-top: 12px; }
.cz-rec-sec b { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 2px; }
.cz-rec-sec ul { margin: 2px 0 0; padding-left: 18px; }
.cz-rec-sec li { margin: 2px 0; }
.cz-rec .done { margin-top: 12px; }

/* 대화 */
#v-chat { min-height: calc(100dvh - 190px); }
.cz-log { display: flex; flex-direction: column; gap: 10px; flex: 1; padding-bottom: 6px; }
.cz-log .msg-row { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.cz-log .msg-row.citizen { justify-content: flex-end; }
.cz-log .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; font-size: 17px; }
.cz-log .msg { max-width: min(86%, 520px); padding: 11px 15px; border-radius: 18px; font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
html.elder .cz-log .msg { font-size: 20px; }
.cz-log .msg.ai { background: var(--surface-1); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.cz-log .msg.citizen { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.cz-log .msg.system { background: transparent; color: var(--text-muted); font-size: 13.5px; align-self: center; text-align: center; padding: 2px 8px; max-width: 96%; }
.cz-log .msg a { color: var(--accent); }
.cz-log .msg-row.citizen .msg a { color: #fff; }
.typing-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); animation: cz-dot 1s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s; } .typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes cz-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.card-mini { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: 15px; }
.card-mini .row { display: flex; gap: 10px; justify-content: space-between; padding: 3px 0; flex-wrap: wrap; }
.card-mini .row .k { color: var(--text-muted); }
.msg .hint { font-size: 13.5px; color: var(--text-secondary); margin-top: 6px; }
.msg .cz-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.msg .cz-btns .btn { flex: 1 1 120px; }
.cz-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cz-chips button { font: inherit; font-size: 14.5px; font-weight: 700; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); color: var(--accent); cursor: pointer; }
.cz-voice-row { display: flex; align-items: center; gap: 10px; }
.cz-voice-row .btn { flex: none; }
.cz-voice-row .cz-small { flex: 1; }
.cz-chat-input { position: sticky; bottom: calc(var(--kb, 0px) + var(--cz-tabs-h) + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(8px); padding: 8px 0 6px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
body.kb-open .cz-chat-input { bottom: var(--kb, 0px); }
body.kb-open .cz-tabs { display: none; }
.cz-chat-input .row { display: flex; gap: 8px; }
.cz-chat-input input { flex: 1; min-width: 0; font: inherit; font-size: 17px; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 26px; padding: 10px 18px; min-height: 52px; }
html.elder .cz-chat-input input { font-size: 20px; min-height: 60px; }
.cz-chat-input .btn { border-radius: 26px; }

/* 내 상태 */
.cz-chart h3 { margin: 0; font-size: 16px; color: var(--text-primary); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cz-chart svg { width: 100%; height: auto; display: block; margin-top: 6px; overflow: visible; }
.cz-chart .sum { font-size: 14px; color: var(--text-secondary); margin: 2px 0 0; }
.cz-chart .grid { stroke: var(--grid); stroke-width: 1; }
.cz-chart .recent { fill: var(--lcp-accent-soft); }
.cz-chart .base { stroke: var(--text-muted); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.cz-chart .ln { stroke: var(--series-blue); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cz-chart .pt { fill: var(--series-blue); }
.cz-chart .pt.r { stroke: var(--surface-1); stroke-width: 2; }
.cz-chart .zero { fill: var(--surface-1); stroke: var(--lcp-ink-crit); stroke-width: 2.6; }
.cz-chart .gap { stroke: var(--status-warning); stroke-width: 3; stroke-dasharray: 3 4; }
.cz-chart .gapm { fill: var(--status-warning); }
.cz-chart text { fill: var(--text-muted); font-size: 10.5px; font-family: inherit; }
.cz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-secondary); }
.cz-legend span { display: inline-flex; gap: 6px; align-items: center; }
.cz-legend svg { width: 22px; height: 14px; overflow: visible; }
.cz-scen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cz-scen .btn { min-height: 64px; flex-direction: column; gap: 2px; font-size: 14.5px; line-height: 1.3; text-align: center; }
.cz-scen .btn .e { font-size: 22px; }
.cz-chart-grid { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) { .cz-chart-grid { display: grid; grid-template-columns: 1fr 1fr; } }

/* 더보기 */
.cz-list { display: flex; flex-direction: column; gap: 8px; }
.cz-list .btn { justify-content: flex-start; text-align: left; font-size: 15px; min-height: 52px; }
.cz-list a.btn { text-decoration: none; }
.cz-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cz-row .t { font-weight: 700; }
.cz-mini-item { padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 14.5px; }
.cz-mini-item:last-child { border-bottom: 0; }

/* 온보딩 */
.cz-hero { text-align: center; padding: 28px 8px 8px; }
.cz-logo { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 14px; background: linear-gradient(135deg, var(--accent), #12b886); display: grid; place-items: center; color: #fff; font-size: 44px; box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.cz-form .field label { font-size: 15px; color: var(--text-primary); }
.cz-form .field input, .cz-form .field select { min-height: 52px; font-size: 17px; }
.cz-err { color: var(--lcp-ink-crit); font-weight: 700; min-height: 1.4em; margin: 6px 0 0; }

/* 전화 수신(소프트폰) */
.cz-call { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; background: linear-gradient(180deg, #0f2a4d, #1b4a86 70%, #1d5ca8); color: #fff; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); overflow-y: auto; animation: lcp-fade .2s ease; }
.cz-call * { color: inherit; }
.cz-call .who { text-align: center; margin-top: 4vh; }
.cz-call .face { width: 112px; height: 112px; margin: 0 auto 14px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 56px; animation: cz-ring 1.6s ease-out infinite; }
@keyframes cz-ring { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.4); } 100% { box-shadow: 0 0 0 34px rgba(255,255,255,0); } }
.cz-call.talk .face { animation: none; width: 64px; height: 64px; font-size: 32px; margin-bottom: 6px; }
.cz-call h1 { font-size: 24px; margin: 0; }
.cz-call .notice { background: rgba(255,255,255,.12); border-radius: 16px; padding: 14px 16px; margin: 18px 0; font-size: 15.5px; line-height: 1.6; }
.cz-call .ring-btns { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.cz-call .ring-btns .btn { min-height: 64px; font-size: 19px; border-radius: 18px; }
.cz-call .btn.accept { background: #1fb53a; color: #fff; }
.cz-call .btn.soft { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.cz-call .btn.never { background: transparent; color: rgba(255,255,255,.85); text-decoration: underline; min-height: 44px; font-size: 15px; }
.cz-call .timer { text-align: center; font-variant-numeric: tabular-nums; font-size: 15px; opacity: .9; }
.cz-call .talklog { flex: 1; display: flex; flex-direction: column; gap: 10px; margin: 12px 0; overflow-y: auto; min-height: 120px; }
.cz-call .talklog .m { max-width: 88%; padding: 11px 15px; border-radius: 18px; font-size: 18px; line-height: 1.55; }
.cz-call .talklog .m.ai { background: rgba(255,255,255,.16); align-self: flex-start; border-bottom-left-radius: 6px; }
.cz-call .talklog .m.me { background: #fff; color: #10294a; align-self: flex-end; border-bottom-right-radius: 6px; }
.cz-call .talklog .m.me * { color: #10294a; }
.cz-call .alert { background: #b3261e; border-radius: 14px; padding: 12px 14px; margin: 6px 0; font-weight: 700; }
.cz-call .alert a { text-decoration: underline; }
.cz-call .talk-controls { display: flex; flex-direction: column; gap: 10px; }
.cz-call .talk-controls .row { display: flex; gap: 8px; }
.cz-call .talk-controls input { flex: 1; min-width: 0; font: inherit; font-size: 17px; border-radius: 26px; border: 0; padding: 10px 18px; min-height: 52px; background: #fff; color: #10294a; }
.cz-call .talk-controls .btn { border-radius: 26px; }
.cz-call .big-mic { align-self: center; width: 84px; height: 84px; border-radius: 50%; background: #fff; color: #10294a; font-size: 36px; border: 0; cursor: pointer; display: grid; place-items: center; padding: 0; }
.cz-call .big-mic.rec { background: #d03b3b; color: #fff; animation: cz-pulse 1.4s ease-out infinite; }
.cz-call .big-mic.rec * { color: #fff; }
.cz-call .end-btn { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.cz-call .bye { text-align: center; margin: auto 0; }
.cz-call .bye .face { animation: none; }

/* 설치 안내·오프라인 */
.cz-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--lcp-accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 14px; padding: 10px 14px; font-size: 14.5px; }
.cz-offline { background: var(--lcp-warn-soft); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.cz-state { text-align: center; padding: 26px 10px; color: var(--text-secondary); }
.cz-state .ic { font-size: 34px; margin-bottom: 6px; }
.skel.h { height: 22px; margin: 8px 0; }

/* 고령자 모드의 공용 button 글자 크기 규칙이 아이콘 버튼을 줄이지 않도록 */
html.elder body.cz .cz-mic-btn { font-size: 48px; }
html.elder body.cz .cz-call .big-mic { font-size: 38px; }
