:root {
    --bg-dark: hsl(230, 25%, 10%);
    --bg-glass: hsla(230, 30%, 18%, 0.6);
    --border-glass: hsla(230, 40%, 40%, 0.3);
    
    --text-primary: hsl(210, 20%, 98%);
    --text-secondary: hsl(210, 15%, 70%);
    
    --primary-color: hsl(250, 85%, 65%);
    --primary-hover: hsl(250, 85%, 72%);
    --primary-glow: hsla(250, 85%, 65%, 0.35);
    
    --danger-color: hsl(350, 85%, 65%);
    --danger-hover: hsl(350, 80%, 70%);
    
    --success-color: hsl(150, 80%, 60%);
    
    --font-main: 'Pretendard', system-ui, -apple-system, sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.2, 0, 0, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    /* Subtle glow shapes in the background */
    background-image: 
        radial-gradient(ellipse at 15% 30%, hsla(250, 85%, 65%, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 85% 70%, hsla(190, 85%, 55%, 0.12) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: scroll; /* prevent shift */
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* transform 없는 페이드 — fixed 자식 요소에 viewport 기준 보호 */
@keyframes fadeInOpacity {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.92) translateY(10px); }
    70% { transform: scale(1.02) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}


#app-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

body.report-view-active #app-container {
    display: none;
}

/* View switching */
.view-container {
    display: none;
    /* transform을 사용하면 fixed 자식의 viewport 기준점이 오염됨 — opacity만 사용 */
    animation: fadeInOpacity var(--transition-smooth) forwards;
}
.view-container.active {
    display: block;
}

/* session-view 전용: 전체 화면 스크롤 컨테이너 */
#session-view.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography elements */
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: 0; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: 0; margin-bottom: 1.2rem; }

.report-title-accent {
    color: var(--primary-color);
}

.report-subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-actions-inline,
.section-header-row {
    display: flex;
    align-items: center;
}

.header-actions-inline {
    gap: 10px;
}

.section-header-row {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.refresh-sessions-btn {
    padding: 4px 10px;
    font-size: 13px;
}

.past-sessions-list {
    max-height: 250px;
    overflow-y: auto;
}

.muted-italic {
    color: var(--text-secondary);
    font-style: italic;
}

.muted-text {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

/* Glass Elements */
.glass-header {
    position: relative;
    z-index: 20;
    overflow: visible;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.report-header {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr) auto;
    grid-template-areas: "title summary actions";
    gap: clamp(0.8rem, 1.6vw, 1.25rem);
    align-items: center;
}

.report-header > :first-child {
    grid-area: title;
    min-width: 0;
}

.report-header .scenario-summary-panel {
    grid-area: summary;
}

.report-header .header-actions {
    grid-area: actions;
    justify-self: end;
}

.scenario-summary-panel {
    min-width: 0;
}

.scenario-summary-panel[hidden] {
    display: none;
}

.scenario-summary-trigger {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.95rem;
    border-radius: 15px;
    background: var(--item-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    text-align: left;
    box-shadow: none;
}

.scenario-summary-trigger:hover,
.scenario-summary-trigger:focus-visible {
    background: var(--hover-bg);
    border-color: hsla(250, 85%, 65%, 0.3);
    transform: none;
    box-shadow: none;
}

.scenario-summary-trigger-text {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.scenario-summary-kicker {
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 850;
}

.scenario-summary-primary {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scenario-summary-secondary {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scenario-summary-action {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 850;
    white-space: nowrap;
}

.scenario-summary-row {
    display: grid;
    grid-template-columns: 5.2rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.scenario-summary-label {
    color: var(--primary-color);
    font-size: 0.84rem;
    font-weight: 850;
    line-height: 1.5;
    white-space: nowrap;
}

.scenario-summary-value {
    color: var(--text-primary);
    display: block;
    font-size: 0.96rem;
    font-weight: 650;
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

#replay-view.active,
#debrief-view.active {
    width: min(1680px, calc(100vw - clamp(2rem, 5vw, 5.5rem)));
    height: 100vh;
    margin: 0 auto;
    padding: clamp(0.75rem, 1.5vw, 1.25rem) 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#replay-view .replay-header {
    grid-template-columns: minmax(270px, 0.9fr) minmax(320px, 1.1fr) auto;
    grid-template-areas: "title summary actions";
    gap: clamp(0.8rem, 1.6vw, 1.25rem);
    align-items: center;
    padding: clamp(0.95rem, 1.6vw, 1.25rem) clamp(1.15rem, 2vw, 1.5rem);
    margin-bottom: clamp(0.85rem, 1.7vw, 1.15rem);
}

#debrief-view .report-header {
    grid-template-columns: minmax(270px, 0.9fr) minmax(320px, 1.1fr) auto;
    grid-template-areas: "title summary actions";
    gap: clamp(0.8rem, 1.6vw, 1.25rem);
    align-items: center;
    padding: clamp(0.95rem, 1.6vw, 1.25rem) clamp(1.15rem, 2vw, 1.5rem);
    margin-bottom: clamp(0.85rem, 1.7vw, 1.15rem);
}

.report-main,
.replay-main {
    width: 100%;
    flex: 1;
    min-height: 0;
}

.report-layout,
.replay-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
    gap: clamp(1.35rem, 2.4vw, 2.25rem);
    align-items: stretch;
    height: 100%;
    min-height: 0;
}

.report-card,
.replay-card {
    min-width: 0;
    height: 100%;
    max-height: none;
    min-height: 0;
    padding: clamp(1.5rem, 2vw, 2rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.replay-transcript-card {
    overflow: hidden;
    padding-top: clamp(0.95rem, 1.3vw, 1.15rem);
}

.replay-card-title {
    margin-bottom: 0;
    flex-shrink: 0;
}

.replay-divider {
    border: 0;
    border-top: 1px solid var(--border-glass);
    margin: 1rem 0 1.25rem;
    flex-shrink: 0;
}

.replay-transcript-card .replay-card-title {
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.2;
}

.replay-transcript-card .replay-divider {
    margin: 0.55rem 0 0.65rem;
}

.replay-card-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.report-block {
    margin-bottom: 1.5rem;
}

.report-summary-text {
    margin-top: 0.5rem;
    line-height: 1.6;
}

.replay-score-section {
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

.replay-transcript {
    flex: 1;
    min-height: 0;
    padding: 0.35rem 0.4rem 1rem 0.15rem;
    outline: none;
    border: none;
    overflow-y: auto;
}

@media (max-width: 1100px) {
    #replay-view.active,
    #debrief-view.active {
        width: calc(100vw - 2rem);
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding-bottom: 2rem;
    }

    #replay-view .replay-header,
    #debrief-view .report-header {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "summary"
            "actions";
        align-items: stretch;
    }

    #replay-view .header-actions,
    #debrief-view .header-actions {
        justify-content: flex-start;
    }

    .report-layout,
    .replay-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .report-card,
    .replay-card {
        height: auto;
        max-height: none;
        min-height: 0;
    }

    .replay-transcript-card {
        overflow: visible;
    }
}

/* 통합 세션 헤더 — 고객 정보 + 타이머 */
.session-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1040px, 100%);
    z-index: 101;
    border-radius: 0 0 20px 20px;
    border-top: none;
    margin-bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.9rem 1.75rem;
}

.session-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.session-top-row h2 {
    margin-bottom: 0;
}

.session-pause-banner {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1040px, calc(100% - 32px));
    z-index: 100;
    padding: 0.65rem 1rem;
    border-radius: 0 0 14px 14px;
    border: 1px solid var(--border-glass);
    border-top: 0;
    background: var(--bg-glass-solid);
    color: var(--primary-color);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.session-pause-banner[hidden] {
    display: none;
}

.scoring-overlay {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    place-items: center;
    padding: clamp(1.2rem, 4vw, 2rem);
    background: rgba(255, 255, 255, 0.46);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

html[data-theme="dark"] .scoring-overlay {
    background: rgba(0, 0, 0, 0.58);
}

.scoring-overlay[hidden] {
    display: none;
}

.scoring-card {
    width: min(520px, 94vw);
    display: grid;
    justify-items: center;
    gap: 1.1rem;
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    background: var(--bg-glass-solid);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

.scoring-spinner {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: 5px solid hsla(250, 85%, 65%, 0.18);
    border-top-color: var(--primary-color);
    animation: spin 0.9s linear infinite;
}

.scoring-card h3 {
    margin: 0 0 0.45rem;
    color: var(--text-primary);
    font-size: 1.35rem;
}

.scoring-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.65;
}

.scoring-steps {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.scoring-steps span {
    padding: 0.5rem 0.35rem;
    border-radius: 999px;
    background: hsla(250, 85%, 65%, 0.1);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 850;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-2px);
    border-color: hsla(250, 80%, 70%, 0.5);
    box-shadow: 0 8px 32px var(--primary-glow);
}

/* Grid Layouts */
.debrief-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.col-span-2 {
    grid-column: span 2;
}

/* Buttons */
button {
    font-family: var(--font-main);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), hsl(270, 85%, 65%));
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px hsla(250, 85%, 65%, 0.5);
}

.btn-danger {
    background: hsla(350, 85%, 65%, 0.15);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}
.btn-danger:hover {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 20px hsla(350, 85%, 65%, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
    background: hsla(210, 20%, 98%, 0.1);
}

.header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.home-shell {
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.home-main {
    display: grid;
    gap: 1.5rem;
}

.home-utility-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.home-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.home-intro {
    max-width: 470px;
}

.home-description {
    margin-top: 0.85rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.65;
    text-wrap: balance;
}

.practice-launch-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-radius: 24px;
}

.practice-launch-copy {
    min-width: 0;
}

.section-kicker {
    display: inline-block;
    margin-bottom: 0.4rem;
    color: var(--primary-color);
    font-size: 0.76rem;
    font-weight: 850;
}

.practice-launch-copy h2 {
    margin-bottom: 0.4rem;
    font-size: 1.35rem;
}

.practice-launch-copy p {
    max-width: 580px;
    color: var(--text-secondary);
    font-size: 0.96rem;
    font-weight: 550;
    line-height: 1.62;
}

.practice-launch-controls {
    display: grid;
    grid-template-columns: max-content minmax(248px, 280px);
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-width: 0;
}

.practice-launch-controls.has-active-session {
    align-items: start;
}

.home-actions > .header-icon-btn,
.home-actions > .logout-btn,
.home-actions > .main-action-btn,
.home-actions > .difficulty-control {
    height: 56px;
    min-height: 56px;
}

.practice-launch-controls > .difficulty-control,
.launch-action-stack > .main-action-btn,
.launch-action-stack > .resume-session-btn {
    height: 56px;
    min-height: 56px;
}

.home-actions > .header-icon-btn {
    width: 56px;
    min-width: 56px;
}

.home-actions > .logout-btn,
.home-actions > .main-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
}

.main-action-btn {
    flex: 0 0 260px;
    width: 260px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-action-btn.is-loading {
    opacity: 0.7;
}

.launch-action-stack {
    display: grid;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

.launch-action-stack .main-action-btn,
.launch-action-stack .resume-session-btn {
    width: 100%;
    max-width: none;
    flex: none;
}

.resume-session-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 1rem;
    color: var(--primary-color);
    white-space: nowrap;
}

.resume-session-btn[hidden] {
    display: none;
}

.difficulty-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    height: 56px;
    padding: 0.25rem;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    background: var(--item-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.difficulty-selector legend {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.difficulty-selector label {
    position: relative;
}

.difficulty-selector input {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.difficulty-selector span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3.35rem;
    height: 46px;
    padding: 0 0.76rem;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.difficulty-selector input:checked + span {
    background: hsla(250, 85%, 65%, 0.12);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px hsla(250, 85%, 65%, 0.55);
}

.difficulty-selector input:focus-visible + span {
    box-shadow: 0 0 0 3px hsla(250, 85%, 65%, 0.28);
}

.difficulty-selector input:disabled + span {
    opacity: 0.55;
    cursor: not-allowed;
}

.difficulty-info-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 56px;
    border-radius: 14px;
    background: var(--item-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    box-shadow: none;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
    padding: 0;
}

.difficulty-info-btn:hover,
.difficulty-info-btn:focus-visible {
    color: var(--primary-color);
    background: var(--hover-bg);
    transform: none;
    box-shadow: none;
}

.floating-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30000;
    width: min(340px, calc(100vw - 32px));
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.55;
    text-align: left;
    white-space: pre-line;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.floating-tooltip[hidden] {
    display: none;
}

.floating-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Chat Layout */
.chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;              /* 명시적 너비 고정 */
    overflow: hidden;         /* 가로 넘침 차단 */
    padding-top: 92px;
    padding-bottom: 132px;
    box-sizing: border-box;
}
.chat-history {
    flex: 1;
    width: 100%;              /* 명시적 너비 고정 */
    overflow-x: hidden;       /* 가로 넘침 차단 */
    overflow-y: auto;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-glass) transparent;
    box-sizing: border-box;
}
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 4px; }

/* 시스템 안내 박스 (세션 시작 시) */
.system-guide {
    background: linear-gradient(135deg, hsla(240,30%,18%,0.7), hsla(270,30%,18%,0.7));
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin: 0.5rem 0;
    backdrop-filter: blur(10px);
}
.guide-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}
.guide-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}
.guide-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.guide-body li {
    display: flex;
    align-items: flex-start;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    padding-left: 0.25rem;
}
.guide-label {
    white-space: nowrap;
    margin-right: 0.4rem;
    flex-shrink: 0;
}
.guide-body li strong { color: var(--text-primary); }

.chat-bubble {
    /* flex 컨테이너 — align-self(flex-end/start)가 콘텐츠 폭 자동 조정
       display:inline-block 제거: flex 자식에서 줄바꿈 방해 */
    max-width: 60%;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    padding: 0.9rem 1.2rem;
    border-radius: 20px;
    line-height: 1.65;
    animation: popIn var(--transition-smooth) forwards;
    position: relative;

    font-size: 1.0rem;
    box-sizing: border-box;
}


.bubble-user {
    align-self: flex-end;
    background: linear-gradient(145deg, var(--primary-color), hsl(260, 85%, 68%));
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.bubble-ai {
    align-self: flex-start;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* 타이핑 인디케이터 — 세 점 깜빡임 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    align-self: flex-start;
    padding: 0.9rem 1.2rem;
    min-width: 56px;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    box-sizing: border-box;
}
.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

.btn-danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.4rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
}

.btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-danger:disabled:hover {
    background: hsla(350, 85%, 65%, 0.15);
    color: var(--danger-color);
    box-shadow: none;
}

.session-end-btn {
    min-height: 44px;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    white-space: nowrap;
}

.pulse-highlight {
    animation: pulse-glow 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.7);
}

@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.7); transform: scale(1); }
    50%  { box-shadow: 0 0 0 15px rgba(255, 77, 109, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); transform: scale(1); }
}

/* 텍스트 입력 영역 */
.text-input-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 0.75rem;
    align-items: end;
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 0.75rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(1040px, calc(100% - 64px));
    z-index: 99;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.16);
    animation: fadeInOpacity 0.3s var(--transition-smooth) forwards;
}

.text-input-area[hidden] {
    display: none;
}

.text-input-area textarea {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1.05rem;
    resize: none;
    overflow-x: hidden;
    overflow-y: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-height: 140px;
    min-height: 56px;
    line-height: 1.6;
    padding: 0.85rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.text-input-area textarea:focus { outline: none; }
.text-input-area textarea::placeholder { color: var(--text-secondary); }
.text-input-area textarea:disabled { opacity: 0.5; }
.text-input-area textarea.is-scrollable { overflow-y: auto; }

.btn-send-text {
    background: linear-gradient(135deg, var(--primary-color), hsl(270, 85%, 65%));
    color: white;
    border: none;
    border-radius: 14px;
    width: 56px;
    height: 56px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-send-text:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-send-text:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }


/* Bullet Lists */
.bullet-list { list-style: none; }
.report-list { font-size: 0.9rem; }
.bullet-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}
.bullet-list li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}
.bullet-list li.list-empty {
    padding-left: 0;
    color: var(--text-secondary);
    list-style: none;
}
.bullet-list li.list-empty::before {
    content: none;
}
.list-empty-padded {
    padding: 10px;
}
.past-session-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10.2rem;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 4px;
    padding: 10px 12px 10px 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.past-session-item:hover {
    background: rgba(255,255,255,0.05);
}
.past-session-title {
    min-width: 0;
    overflow: hidden;
    color: var(--primary-color);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.past-session-date {
    justify-self: stretch;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.list-error {
    color: var(--danger-color);
}
.warning-list li::before { color: var(--danger-color); content: '⚠️'; left: 0; font-size: 0.9em; }
.focus-list li::before { color: var(--success-color); content: '🎯'; left: 0; font-size: 0.9em; }

.focus-card {
    border-color: rgba(123, 44, 191, 0.22);
    background:
        linear-gradient(135deg, rgba(123, 44, 191, 0.08), rgba(255, 255, 255, 0)),
        var(--bg-glass);
}

/* Score Table */
.score-table { width: 100%; border-collapse: collapse; }
.score-table-flush { margin-top: 0; }
.score-section-title { margin-bottom: 1rem; }
.score-table th, .score-table td {
    padding: 1rem 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-glass);
}
.score-table th { color: var(--text-secondary); font-weight: 500; }
.score-table tr:last-child td { border-bottom: none; }
.score-table td:first-child {
    color: var(--text-primary);
    font-weight: 750;
}
.score-value {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.score-value-low { color: var(--danger-color); }
.score-value-mid { color: var(--warning-color); }
.score-value-high { color: var(--success-color); }
.score-insight-cell {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}
.score-insight-block {
    display: grid;
    gap: 0.45rem;
}
.score-insight-line {
    display: grid;
    grid-template-columns: 3.1rem minmax(0, 1fr);
    gap: 0.6rem;
    align-items: start;
}
.score-insight-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.55rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--item-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    font-size: 0.72rem;
    font-weight: 800;
}

.table-empty-cell {
    color: var(--text-secondary);
}

.transcript-speaker {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8em;
    font-weight: 700;
    opacity: 0.7;
}

.transcript-empty {
    color: var(--text-secondary);
    padding: 1rem;
}

.system-message {
    margin: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85em;
    text-align: center;
}

/* Session Meta Utils */
.session-meta { display: flex; align-items: center; gap: 1.5rem; }
/* ── Timer Color Alerts ─────────────────────────────────── */
.timer {
    min-width: 5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0;
    transition: color 0.5s, opacity 0.5s;
}
.timer-idle { color: var(--text-secondary); opacity: 0.78; }
.timer-danger  { color: var(--danger-color) !important; animation: pulse-timer 0.8s ease-in-out infinite; }

.timer-toggle-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 12px;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    box-shadow: none;
}

.timer-toggle-btn svg {
    width: 18px;
    height: 18px;
}

.timer-toggle-btn:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--hover-bg);
    transform: none;
    box-shadow: none;
}

.timer-toggle-btn[aria-pressed="true"] {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: hsla(250, 85%, 65%, 0.12);
}

.timer-toggle-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
@keyframes pulse-timer {
    0%,100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
}


/* ── 감점 경고 토스트 ─────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.deduction-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: hsla(350, 40%, 15%, 0.95);
    border: 1px solid hsla(350, 85%, 55%, 0.5);
    border-left: 4px solid var(--danger-color);
    border-radius: 14px;
    padding: 0.9rem 1.2rem;
    min-width: 260px;
    max-width: 340px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.deduction-toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.deduction-toast.toast-hidden {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.app-toast {
    max-width: 360px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.app-toast-error {
    border-color: rgba(255, 91, 95, 0.34);
    color: var(--danger-color);
}

.app-toast-info {
    border-color: rgba(123, 44, 191, 0.22);
    color: var(--primary-color);
}

.app-toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.app-toast.toast-hidden {
    opacity: 0;
    transform: translateX(16px);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--danger-color);
}

.toast-reason {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Auth Styles ─────────────────────────── */
#login-view.active {
    min-height: calc(100vh - 5rem);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(420px, 100%);
    margin: 0 auto;
    padding: 2.25rem;
    background: hsla(230, 30%, 16%, 0.78);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-eyebrow {
    color: var(--primary-hover);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 0.35rem;
}

.auth-card h1 {
    font-size: 1.9rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    letter-spacing: 0;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-card label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.auth-card input {
    width: 100%;
    padding: 0.85rem 0.95rem;
    background: hsla(230, 24%, 10%, 0.65);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.auth-card input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px hsla(250, 85%, 65%, 0.18);
}

.auth-card input::placeholder { color: hsla(210, 15%, 70%, 0.65); }

.auth-card button {
    width: 100%;
    justify-content: center;
}

.auth-secondary-button {
    margin-top: 0.15rem;
}

.otp-qr-card {
    display: grid;
    justify-items: center;
    gap: 0.7rem;
    padding: 1rem;
    background: hsla(230, 24%, 10%, 0.45);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
}

.otp-qr-card[hidden] {
    display: none;
}

.otp-qr-card img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    background: white;
}

.otp-qr-card p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.45;
}

.auth-message {
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.auth-message[hidden] {
    display: none;
}

.auth-message-error {
    color: hsl(350, 85%, 78%);
    background: hsla(350, 85%, 65%, 0.12);
    border: 1px solid hsla(350, 85%, 65%, 0.3);
}

.auth-message-info {
    color: hsl(150, 80%, 78%);
    background: hsla(150, 80%, 60%, 0.1);
    border: 1px solid hsla(150, 80%, 60%, 0.25);
}

@media (max-width: 760px) {
    #app-container {
        padding: 1rem;
    }

    .glass-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.2rem;
    }

    .report-header {
        display: flex;
        flex-direction: column;
    }

    .scenario-summary-panel {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .header-actions > button,
    .header-actions > .difficulty-control {
        flex: 1 1 100%;
    }

    .difficulty-control {
        width: 100%;
    }

    .difficulty-selector {
        flex: 1;
        justify-content: space-between;
    }

    .difficulty-selector label {
        flex: 1;
    }

    .difficulty-selector span {
        width: 100%;
    }

    .home-actions > .main-action-btn {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }

    .home-shell {
        align-items: stretch;
    }

    .home-utility-actions {
        justify-content: flex-start;
    }

    .practice-launch-panel {
        grid-template-columns: 1fr;
        padding: 1.2rem;
    }

    .practice-launch-controls {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .launch-action-stack,
    .practice-launch-controls .main-action-btn {
        width: 100%;
        max-width: none;
        flex-basis: auto;
    }
}

/* Hycoach-aligned visual system */
:root,
html[data-theme="light"] {
    --primary-color: #7b2cbf;
    --primary-hover: #9d4edd;
    --primary-glow: rgba(123, 44, 191, 0.28);
    --bg-dark: #f4f4f5;
    --bg-glass: rgba(255, 255, 255, 0.68);
    --bg-glass-solid: rgba(255, 255, 255, 0.96);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #09090b;
    --text-secondary: #52525b;
    --input-bg: rgba(255, 255, 255, 0.86);
    --hover-bg: rgba(0, 0, 0, 0.05);
    --item-bg: rgba(255, 255, 255, 0.88);
    --danger-color: #ff5b5f;
    --danger-hover: #ff777a;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    color-scheme: light;
}

html[data-theme="dark"] {
    --primary-color: #7b2cbf;
    --primary-hover: #9d4edd;
    --primary-glow: rgba(123, 44, 191, 0.4);
    --bg-dark: #09090b;
    --bg-glass: rgba(24, 24, 27, 0.66);
    --bg-glass-solid: rgba(24, 24, 27, 0.96);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --input-bg: rgba(0, 0, 0, 0.24);
    --hover-bg: rgba(255, 255, 255, 0.06);
    --item-bg: rgba(0, 0, 0, 0.2);
    --danger-color: #ff6b6b;
    --danger-hover: #ff8585;
    --success-color: #10b981;
    --warning-color: #fbbf24;
    color-scheme: dark;
}

body {
    background:
        radial-gradient(circle at 15% 50%, rgba(123, 44, 191, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(157, 78, 221, 0.12) 0%, transparent 50%),
        var(--bg-dark);
    color: var(--text-primary);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 15% 50%, rgba(30, 20, 50, 0.42) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(50, 20, 60, 0.42) 0%, transparent 50%),
        var(--bg-dark);
}

#app-container {
    max-width: 980px;
}

.glass-panel,
.glass-header,
.card,
.auth-card,
.text-input-area {
    background: var(--bg-glass);
    border-color: var(--border-glass);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.16);
}

.glass-header,
.card {
    border-radius: 24px;
}

.card:hover {
    transform: none;
    border-color: rgba(123, 44, 191, 0.22);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.14);
}

.btn-primary,
.btn-send-text {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 10px 32px var(--primary-glow);
}

.btn-primary:hover,
.btn-send-text:hover {
    background: var(--primary-hover);
    box-shadow: 0 14px 38px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-glass);
    box-shadow: none;
}

.btn-secondary:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
    transform: none;
    box-shadow: none;
}

.logout-btn {
    width: auto;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: rgba(255, 91, 95, 0.1);
    border: 1px solid rgba(255, 91, 95, 0.38);
    color: var(--danger-color);
    box-shadow: none;
    font-size: 0.94rem;
    font-weight: 700;
}

.logout-btn:hover {
    background: rgba(255, 91, 95, 0.18);
    transform: translateY(-1px);
    box-shadow: none;
}

.header-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-icon-btn[aria-label]::after,
.header-icon-btn[aria-label]::before,
.timer-toggle-btn[aria-label]::after,
.timer-toggle-btn[aria-label]::before {
    position: absolute;
    left: 50%;
    z-index: 40000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.header-icon-btn[aria-label]::after,
.timer-toggle-btn[aria-label]::after {
    content: attr(aria-label);
    top: calc(100% + 10px);
    width: max-content;
    max-width: min(240px, calc(100vw - 32px));
    padding: 0.45rem 0.62rem;
    border-radius: 8px;
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.25;
    white-space: nowrap;
    transform: translate(-50%, -4px);
}

.header-icon-btn[aria-label]::before,
.timer-toggle-btn[aria-label]::before {
    content: '';
    top: calc(100% + 5px);
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--border-glass);
    border-left: 5px solid transparent;
    transform: translate(-50%, -4px);
}

.header-icon-btn[aria-label]:hover::after,
.header-icon-btn[aria-label]:hover::before,
.header-icon-btn[aria-label]:focus-visible::after,
.header-icon-btn[aria-label]:focus-visible::before,
.timer-toggle-btn[aria-label]:not(:disabled):hover::after,
.timer-toggle-btn[aria-label]:not(:disabled):hover::before,
.timer-toggle-btn[aria-label]:focus-visible::after,
.timer-toggle-btn[aria-label]:focus-visible::before {
    opacity: 1;
    transform: translate(-50%, 0);
}

.header-icon-btn:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
    box-shadow: none;
}

.header-icon-btn.logout-icon-btn {
    background: rgba(255, 91, 95, 0.1);
    border-color: rgba(255, 91, 95, 0.38);
    color: var(--danger-color);
}

.header-icon-btn.logout-icon-btn:hover {
    background: rgba(255, 91, 95, 0.18);
}

#login-view.active {
    min-height: calc(100vh - 5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.auth-card {
    width: min(520px, 100%);
    padding: clamp(2.2rem, 6vw, 4rem);
    text-align: center;
    border-radius: 28px;
    background: var(--bg-glass-solid);
}

.auth-card h1 {
    font-size: clamp(2.1rem, 6vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.auth-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2.2rem;
}

.auth-form {
    gap: 1rem;
}

.auth-card label {
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 700;
    text-align: left;
}

.auth-card input,
.settings-form textarea,
.settings-form select {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
}

#login-phone {
    font-size: 1.25rem;
    letter-spacing: 0.18em;
    text-align: center;
    font-weight: 800;
}

.remembered-login {
    display: grid;
    gap: 0.8rem;
}

.auth-checking {
    display: grid;
    gap: 0.8rem;
}

.auth-checking[hidden],
.remembered-login[hidden],
.auth-form[hidden],
.remembered-verify-label[hidden],
.field-group[hidden],
.enrollment-shortcut[hidden],
.remember-device-row[hidden],
.remembered-reset-button[hidden] {
    display: none;
}

.auth-checking-button:disabled {
    opacity: 0.72;
    cursor: progress;
    transform: none;
}

.remembered-secondary-button {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    box-shadow: none;
}

.remembered-secondary-button:hover {
    color: var(--text-primary);
    background: transparent;
    transform: none;
    box-shadow: none;
}

.remembered-verify-label {
    display: grid;
    place-items: center;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

.otp-input-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.auth-card input.otp-digit {
    height: 3.35rem;
    padding: 0;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0;
}

.auth-card input.otp-digit:focus {
    border-color: var(--primary-color);
}

.remember-device-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: center;
}

.auth-card .remember-device-row input {
    width: 1rem;
    height: 1rem;
    padding: 0;
    flex: 0 0 auto;
}

#btn-login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-card input:focus,
.settings-form textarea:focus,
.settings-form select:focus,
#text-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.enrollment-shortcut {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-glass);
    text-align: left;
}

.enrollment-shortcut strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.98rem;
    margin-bottom: 0.3rem;
}

.enrollment-shortcut span {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

.privacy-note {
    max-width: 520px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.55;
    opacity: 0.86;
}

.otp-qr-card {
    background: var(--item-bg);
    border-color: var(--border-glass);
}

.session-top-row {
    gap: 1rem;
}

.session-header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.chat-history {
    padding: 1.2rem 0.65rem;
}

.system-guide,
.bubble-ai,
.typing-indicator {
    background: var(--item-bg);
    border: 1px solid var(--border-glass);
    box-shadow: none;
}

.bubble-row {
    display: flex;
    align-self: stretch;
    justify-content: flex-start;
}

.bubble-row .typing-indicator {
    flex: 0 0 auto;
}

.bubble-user {
    background: var(--primary-color);
    box-shadow: 0 6px 18px var(--primary-glow);
}

.bubble-ai,
.bubble-user {
    max-width: 75%;
}

.text-input-area textarea {
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 0.85rem 1rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-content.settings-modal {
    width: min(760px, 94vw);
    height: min(560px, 86vh);
    padding: 0;
    overflow: hidden;
    border-radius: 28px;
    background: var(--bg-glass-solid);
}

.modal-content.feedback-modal {
    width: min(720px, 94vw);
    max-height: min(720px, 90vh);
    padding: 0;
    overflow: hidden;
    border-radius: 28px;
    background: var(--bg-glass-solid);
}

.modal-content.scenario-modal {
    width: min(760px, 94vw);
    max-height: min(620px, 88vh);
    padding: 0;
    overflow: hidden;
    border-radius: 26px;
    background: var(--bg-glass-solid);
}

.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.6rem 2rem;
    border-bottom: 1px solid var(--border-glass);
}

.scenario-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.45rem 1.8rem;
    border-bottom: 1px solid var(--border-glass);
}

.feedback-modal-header h2 {
    margin: 0 0 0.35rem;
    color: var(--text-primary);
    font-size: 1.8rem;
}

.scenario-modal-header h2 {
    margin: 0 0 0.25rem;
    color: var(--text-primary);
    font-size: 1.55rem;
}

.feedback-modal-header p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.scenario-modal-header p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.feedback-modal-body {
    max-height: calc(min(720px, 90vh) - 108px);
    overflow-y: auto;
    padding: 1.6rem 2rem 2rem;
}

.scenario-modal-body {
    display: grid;
    gap: 1rem;
    max-height: calc(min(620px, 88vh) - 104px);
    overflow-y: auto;
    padding: 1.4rem 1.8rem 1.7rem;
}

.scenario-modal-body .scenario-summary-row {
    grid-template-columns: 5.8rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--border-glass);
}

.scenario-modal-body .scenario-summary-row:last-child {
    border-bottom: 0;
}

.scenario-modal-body .scenario-summary-value {
    font-size: 1rem;
    line-height: 1.65;
}

.confirm-modal {
    width: min(420px, 92vw);
    padding: 1.6rem;
    border-radius: 22px;
    background: var(--bg-glass-solid);
}

.confirm-modal h2 {
    margin-bottom: 0.6rem;
    color: var(--text-primary);
    font-size: 1.35rem;
}

.confirm-modal p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.35rem;
}

.confirm-actions .btn-danger,
.confirm-actions .btn-primary,
.confirm-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1rem;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem 2rem;
    border-bottom: 1px solid var(--border-glass);
}

.settings-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.modal-close-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    box-shadow: none;
    font-size: 2rem;
    line-height: 1;
}

.modal-close-btn:hover {
    background: var(--hover-bg);
    transform: none;
    box-shadow: none;
}

.settings-container {
    display: flex;
    height: calc(100% - 84px);
    min-height: 0;
}

.settings-sidebar {
    width: 220px;
    padding: 1.35rem 0;
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-tab-btn {
    width: 100%;
    padding: 0.95rem 1.6rem;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    border-left: 4px solid transparent;
    text-align: left;
    box-shadow: none;
    font-weight: 700;
}

.settings-tab-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.settings-tab-btn.active {
    background: var(--hover-bg);
    border-left-color: var(--primary-color);
    color: var(--text-primary);
}

.settings-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 2rem;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-panel h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin: 0 0 1rem;
}

.settings-help {
    color: var(--text-secondary);
    margin: 0 0 1.2rem;
    line-height: 1.6;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.radio-row input {
    width: auto;
}

.range-row {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}

.range-row input {
    width: 100%;
    accent-color: var(--primary-color);
}

.settings-value {
    text-align: center;
    color: var(--text-primary);
    font-weight: 800;
}

.settings-form {
    display: grid;
    gap: 0.7rem;
}

.settings-form label {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.92rem;
}

.settings-form textarea {
    resize: vertical;
    min-height: 120px;
}

.feedback-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 1.25rem;
    border-bottom: 1px solid var(--border-glass);
}

.feedback-tab-btn {
    min-height: 48px;
    padding: 0.85rem 0.75rem;
    border-radius: 0;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 800;
    text-align: center;
}

.feedback-tab-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.feedback-tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--text-primary);
}

.feedback-tab-panel {
    display: none;
}

.feedback-tab-panel.active {
    display: block;
}

.feedback-history {
    margin-top: 0;
}

.feedback-history h4 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
}

.feedback-list {
    display: grid;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.feedback-item,
.feedback-empty,
.info-item {
    background: var(--item-bg);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.feedback-type,
.feedback-status {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary-color);
}

.feedback-status {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
}

.feedback-status-received {
    background: rgba(255, 91, 95, 0.1);
    color: var(--danger-color);
}

.feedback-status-progress {
    background: rgba(245, 158, 11, 0.12);
    color: #b7791f;
}

.feedback-status-done {
    background: rgba(21, 183, 130, 0.12);
    color: var(--success-color);
}

.feedback-content {
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.55;
}

.feedback-admin-comment,
.feedback-sync-warning {
    margin-top: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: rgba(123, 44, 191, 0.08);
    border: 1px solid rgba(123, 44, 191, 0.18);
    color: var(--text-primary);
    font-size: 0.86rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.feedback-admin-comment::before {
    content: "운영자 답변";
    display: block;
    margin-bottom: 0.35rem;
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 850;
}

.feedback-sync-warning {
    background: rgba(255, 91, 95, 0.08);
    border-color: rgba(255, 91, 95, 0.24);
    color: var(--danger-color);
}

.feedback-date {
    margin-top: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.info-list {
    display: grid;
    gap: 0.9rem;
}

.info-item {
    display: grid;
    gap: 0.25rem;
}

.info-item span {
    color: var(--primary-color);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.info-item strong {
    color: var(--text-primary);
    font-size: 0.98rem;
}

@media (max-width: 760px) {
    .header-icon-btn {
        width: 42px;
        min-width: 42px;
    }

    .session-header {
        padding: 0.75rem 1rem;
    }

    .session-pause-banner {
        top: 136px;
        width: calc(100% - 24px);
        font-size: 0.84rem;
    }

    .session-top-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .session-top-row h2 {
        width: 100%;
        font-size: 1.08rem;
    }

    .session-header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.45rem;
    }

    .timer {
        min-width: 4.6rem;
        font-size: 1.25rem;
        text-align: left;
    }

    .timer-toggle-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
    }

    .session-end-btn {
        flex: 1;
        justify-content: center;
        min-width: 9.5rem;
        padding: 0.65rem 0.8rem;
        font-size: 0.9rem;
    }

    .logout-btn {
        min-height: 42px;
        padding: 0.62rem 0.8rem;
        font-size: 0.88rem;
    }

    .chat-container {
        padding-top: 142px;
        padding-bottom: 118px;
    }

    .text-input-area {
        grid-template-columns: minmax(0, 1fr) 52px;
        gap: 0.55rem;
        width: calc(100% - 24px);
        bottom: 0.75rem;
        border-radius: 16px;
        padding: 0.55rem;
    }

    .text-input-area textarea {
        min-height: 52px;
        font-size: 0.98rem;
        padding: 0.75rem 0.85rem;
    }

    .btn-send-text {
        width: 52px;
        height: 52px;
        border-radius: 13px;
    }

    .settings-container {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        padding: 0.5rem;
    }

    .settings-tab-btn {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
        padding: 0.8rem 1rem;
    }

    .settings-tab-btn.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-color);
    }

    .settings-main {
        padding: 1.2rem;
    }

    .modal-content.feedback-modal {
        width: min(94vw, 640px);
        max-height: 90vh;
    }

    .modal-content.scenario-modal {
        width: min(94vw, 640px);
        max-height: 90vh;
    }

    .feedback-modal-header {
        padding: 1.2rem;
    }

    .scenario-modal-header {
        padding: 1.2rem;
    }

    .feedback-modal-header h2 {
        font-size: 1.45rem;
    }

    .scenario-modal-header h2 {
        font-size: 1.35rem;
    }

    .feedback-modal-body {
        max-height: calc(90vh - 96px);
        padding: 1.2rem;
    }

    .scenario-modal-body {
        max-height: calc(90vh - 96px);
        padding: 1.1rem 1.2rem 1.3rem;
    }

    .scenario-modal-body .scenario-summary-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .range-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .bubble-ai,
    .bubble-user {
        max-width: 90%;
    }

    .score-table,
    .score-table tbody,
    .score-table tr,
    .score-table td {
        display: block;
        width: 100%;
    }

    .score-table thead {
        display: none;
    }

    .score-table tr {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-glass);
    }

    .score-table tr:last-child {
        border-bottom: none;
    }

    .score-table td {
        padding: 0.3rem 0;
        border-bottom: 0;
    }

    .score-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        color: var(--text-secondary);
        font-size: 0.72rem;
        font-weight: 800;
    }

    .score-value {
        font-size: 1.15rem;
    }

    .score-insight-line {
        grid-template-columns: 2.9rem minmax(0, 1fr);
    }
}
