:root {
    --bg: #08110f;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-strong: rgba(255, 255, 255, 0.13);
    --text: #f7fbf8;
    --muted: #9fb2aa;
    --line: rgba(255, 255, 255, 0.13);
    --green: #35d78c;
    --green-dark: #0c8f66;
    --rose: #ff6b7a;
    --amber: #f1b84b;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    background:
        linear-gradient(118deg, rgba(53, 215, 140, 0.16), transparent 34%),
        linear-gradient(246deg, rgba(241, 184, 75, 0.12), transparent 42%),
        linear-gradient(150deg, #07100e 0%, #10231c 48%, #08110f 100%);
    letter-spacing: 0;
}

button {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 18px;
}

.assistant-stage {
    width: min(100%, 560px);
    min-height: calc(100svh - 36px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 18px 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.topbar {
    width: min(1180px, calc(100% - 24px));
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px auto 0;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.topbar-brand,
.topbar-nav a,
.text-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.flash {
    width: min(1180px, calc(100% - 24px));
    margin: 12px auto 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.flash-success {
    color: #07331f;
    background: rgba(53, 215, 140, 0.88);
}

.flash-error,
.form-error {
    color: #fff;
    background: rgba(186, 37, 70, 0.86);
}

.auth-shell,
.panel-shell,
.student-layout {
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 18px 0;
}

.auth-card,
.panel-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px);
}

.auth-card {
    width: min(100%, 440px);
    padding: 24px;
}

.auth-card h1,
.page-heading h1,
.panel-card h2 {
    margin: 0;
    letter-spacing: 0;
}

.auth-card h1 {
    margin-top: 26px;
    font-size: 32px;
    text-align: left;
}

.helper-text,
.empty-text {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.stack-form {
    display: grid;
    gap: 13px;
    margin-top: 18px;
}

.compact-form {
    margin-top: 12px;
}

.stack-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.22);
    outline: none;
}

textarea {
    min-height: 120px;
    padding-top: 12px;
    resize: vertical;
    line-height: 1.45;
}

select option {
    color: #101816;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(53, 215, 140, 0.78);
    box-shadow: 0 0 0 3px rgba(53, 215, 140, 0.16);
}

.primary-button,
.icon-text-button {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.primary-button {
    color: #062119;
    background: linear-gradient(135deg, var(--green), var(--amber));
}

.icon-text-button {
    padding: 0 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
}

.panel-shell {
    padding: 26px 0 40px;
}

.page-heading {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.page-heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-heading p {
    margin: 0;
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.page-heading h1 {
    font-size: clamp(30px, 5vw, 48px);
    text-align: left;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.panel-card {
    padding: 18px;
}

.panel-card h2 {
    font-size: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.table-list,
.class-list,
.word-list,
.chip-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.table-row,
.word-row,
.class-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
}

.class-item {
    align-items: flex-start;
    flex-direction: column;
    color: var(--text);
    text-decoration: none;
}

.class-item-row {
    align-items: center;
    flex-direction: row;
}

.class-item-link {
    flex: 1;
    color: var(--text);
    text-decoration: none;
}

.table-row strong,
.word-row strong,
.class-item strong {
    display: block;
}

.table-row span,
.word-row span,
.class-item span,
.class-item em {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.table-row-actions,
.class-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-row-actions em,
.class-item-actions em {
    margin: 0;
}

.word-toolbar {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.word-toolbar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.word-toolbar-copy {
    display: grid;
    gap: 6px;
}

.word-toolbar-copy h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
}

.word-toolbar-copy p {
    margin: 0;
}

.word-count {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.18);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.word-toolbar-actions,
.word-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.word-row-selectable {
    align-items: center;
}

.word-toolbar .icon-text-button,
.word-row-actions .icon-text-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
}

.word-select {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    cursor: pointer;
}

.word-checkbox {
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: #43e49b;
}

.danger-button {
    color: #ffe0e4;
    background: rgba(255, 107, 122, 0.18);
}

.word-list.word-list-separated {
    margin-top: 12px;
}

.word-list.word-list-separated .word-row {
    min-height: 0;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
        rgba(0, 0, 0, 0.16);
}

.word-list.word-list-separated .word-row-actions {
    align-items: center;
    flex-direction: row;
}

.points-card {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.points-balance,
.points-metric,
.summary-card,
.before-after-card,
.score-ring-card,
.timeline-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.points-balance {
    padding: 16px;
    background:
        radial-gradient(circle at top left, rgba(67, 228, 155, 0.22), transparent 48%),
        rgba(0, 0, 0, 0.18);
}

.points-balance span,
.points-metric span,
.summary-card span,
.before-after-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.points-balance strong {
    display: block;
    margin-top: 8px;
    font-size: 42px;
    line-height: 1;
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.points-metric {
    padding: 12px;
}

.points-metric strong,
.summary-card strong,
.before-after-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    line-height: 1.1;
}

.points-metric strong {
    font-size: 18px;
}

.report-shell {
    padding-bottom: 52px;
}

.report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
    gap: 16px;
    margin-bottom: 16px;
}

.report-hero-copy,
.report-hero-stats {
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        radial-gradient(circle at top left, rgba(67, 228, 155, 0.14), transparent 34%),
        radial-gradient(circle at bottom right, rgba(241, 184, 75, 0.14), transparent 38%),
        rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px);
}

.report-hero-copy {
    padding: 24px;
}

.report-hero-copy p,
.report-subtitle {
    display: block;
    color: var(--muted);
}

.report-hero-copy p {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.report-subtitle {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.report-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.summary-grid,
.report-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-grid-wide {
    grid-template-columns: 1fr;
}

.summary-card {
    padding: 16px;
}

.summary-card em,
.before-after-card em,
.comparison-copy span,
.comparison-values em,
.timeline-head span,
.timeline-note,
.score-ring-card p {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.summary-card.is-hero {
    background: rgba(0, 0, 0, 0.16);
}

.summary-card.is-hero strong {
    font-size: 34px;
}

.chart-card {
    overflow: hidden;
}

.chart-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.chart-card-head h2 {
    margin-bottom: 6px;
}

.report-line-chart {
    width: 100%;
    height: auto;
    display: block;
}

.report-line-chart line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.chart-fill {
    fill: rgba(67, 228, 155, 0.12);
}

.chart-line {
    fill: none;
    stroke: #67ebb0;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-dot {
    fill: #f3c45c;
    stroke: #0a1713;
    stroke-width: 2;
}

.chart-score {
    fill: var(--text);
    font-size: 11px;
    text-anchor: middle;
}

.chart-label-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.before-after-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.before-after-card {
    padding: 16px;
}

.before-after-card.is-highlight {
    background:
        radial-gradient(circle at top left, rgba(67, 228, 155, 0.18), transparent 36%),
        rgba(0, 0, 0, 0.18);
}

.comparison-list {
    display: grid;
    gap: 14px;
}

.comparison-row {
    display: grid;
    gap: 8px;
}

.comparison-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.comparison-bars {
    display: grid;
    gap: 8px;
}

.bar-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.bar-fill.is-before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.16));
}

.bar-fill.is-after {
    background: linear-gradient(90deg, #43e49b, #f3c45c);
}

.comparison-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.score-ring-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.score-ring-card {
    padding: 16px;
    text-align: center;
}

.score-ring {
    --value: 0;
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(8, 17, 15, 0.95) 58%, transparent 59%),
        conic-gradient(#43e49b calc(var(--value) * 1%), rgba(255, 255, 255, 0.10) 0);
}

.score-ring-inner strong {
    font-size: 30px;
}

.score-ring-card h3 {
    margin: 0;
    font-size: 16px;
}

.points-economy {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.points-stack {
    text-align: center;
}

.points-stack strong {
    display: block;
    margin-top: 10px;
    font-size: 22px;
}

.points-stack span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.points-stack-bar {
    height: 180px;
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}

.points-stack-fill {
    width: 100%;
    display: block;
    border-radius: 10px 10px 4px 4px;
}

.points-stack-fill.is-earned {
    background: linear-gradient(180deg, #43e49b, #0d8e67);
}

.points-stack-fill.is-spent {
    background: linear-gradient(180deg, #f3c45c, #a86f11);
}

.points-stack-fill.is-balance {
    background: linear-gradient(180deg, #b4f7d6, #43e49b);
}

.metric-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.metric-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.timeline-list {
    display: grid;
    gap: 12px;
}

.timeline-item {
    padding: 14px;
}

.timeline-item p {
    margin: 10px 0 0;
    line-height: 1.55;
}

.timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.timeline-note {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.delta-positive {
    color: #8ff0bf;
}

.delta-negative {
    color: #ffb6be;
}

.delta-flat {
    color: var(--muted);
}

.student-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    padding: 18px 0 34px;
}

.student-stage {
    width: 100%;
    min-height: calc(100svh - 112px);
}

.student-stage .voice-orb-wrap {
    flex: 0 0 auto;
    min-height: 0;
    padding: 34px 0 18px;
}

.student-side {
    display: grid;
    align-content: start;
    gap: 16px;
}

.context-strip {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.context-strip span,
.chip-list span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.09);
    font-size: 12px;
    font-weight: 800;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
}

.brand-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-mark {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--amber));
    box-shadow: 0 0 24px rgba(53, 215, 140, 0.65);
}

.brand-name {
    overflow-wrap: anywhere;
}

.voice-orb-wrap {
    width: 100%;
    display: grid;
    place-items: center;
    flex: 1;
    min-height: 250px;
    padding: 28px 0 14px;
}

.mic-button {
    position: relative;
    width: min(58vw, 226px);
    height: min(58vw, 226px);
    min-width: 172px;
    min-height: 172px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #062119;
    cursor: pointer;
    background:
        radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 22%, transparent 38%),
        linear-gradient(145deg, #43e49b, #f3c45c);
    box-shadow:
        0 32px 90px rgba(53, 215, 140, 0.30),
        inset 0 -18px 30px rgba(4, 31, 22, 0.22),
        inset 0 15px 32px rgba(255, 255, 255, 0.24);
    transform: translateY(0);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
    -webkit-tap-highlight-color: transparent;
}

.mic-button:active {
    transform: translateY(3px) scale(0.99);
}

.mic-button:disabled {
    cursor: wait;
    filter: grayscale(0.25) brightness(0.86);
}

.mic-icon {
    width: 76px;
    height: 76px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    inset: -16px;
    border: 1px solid rgba(53, 215, 140, 0.0);
    border-radius: 50%;
    pointer-events: none;
}

.is-recording .mic-button {
    color: #fff;
    background:
        radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.42), transparent 34%),
        linear-gradient(145deg, #ff6b7a, #b5164a);
    box-shadow:
        0 28px 86px rgba(255, 107, 122, 0.36),
        inset 0 -18px 30px rgba(66, 0, 22, 0.28);
}

.is-recording .pulse-ring {
    animation: pulse 1.35s ease-out infinite;
    border-color: rgba(255, 107, 122, 0.50);
}

.is-thinking .mic-button {
    animation: breathe 1.25s ease-in-out infinite;
}

h1 {
    width: 100%;
    margin: 0;
    color: var(--text);
    font-size: 34px;
    line-height: 1.05;
    text-align: center;
    font-weight: 800;
}

.status-text {
    min-height: 24px;
    margin: 12px 0 20px;
    color: var(--muted);
    font-size: 16px;
    text-align: center;
}

.has-error .status-text {
    color: #ffb0ba;
}

.quick-translate-card {
    width: 100%;
    display: grid;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
        rgba(6, 24, 18, 0.58);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.16);
}

.quick-translate-head {
    display: grid;
    gap: 4px;
}

.quick-translate-head strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.quick-translate-head span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.quick-translate-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-translate-mode {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.quick-translate-mode.is-active {
    border-color: rgba(83, 226, 157, 0.62);
    background: rgba(53, 215, 140, 0.18);
}

.quick-translate-mode:active {
    transform: translateY(1px);
}

.quick-translate-form {
    display: grid;
    gap: 8px;
}

.quick-translate-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.quick-translate-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.quick-translate-input-row input {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    font-size: 14px;
    outline: none;
}

.quick-translate-input-row input:focus {
    border-color: rgba(83, 226, 157, 0.62);
    box-shadow: 0 0 0 3px rgba(53, 215, 140, 0.12);
}

.quick-translate-result {
    padding: 12px 13px;
    border-radius: 10px;
    color: #dbf7ea;
    background: rgba(53, 215, 140, 0.12);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.quick-translate-result.is-error {
    color: #ffe9ed;
    background: rgba(255, 107, 122, 0.14);
}

.action-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.action-form {
    margin: 0;
}

.repeat-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--panel-strong);
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.repeat-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.repeat-button:active {
    transform: translateY(2px);
}

.repeat-button:disabled {
    opacity: 0.44;
    cursor: not-allowed;
}

.icon-text-button:disabled {
    opacity: 0.44;
    cursor: not-allowed;
}

.dialogue {
    width: 100%;
    display: grid;
    gap: 12px;
}

.conversation-log {
    width: 100%;
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.conversation-head {
    width: 100%;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.conversation-head h2 {
    margin: 0;
    font-size: 18px;
}

.conversation-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.conversation-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
}

.conversation-line.is-assistant {
    background: rgba(255, 255, 255, 0.08);
}

.conversation-main span {
    display: block;
    margin-bottom: 5px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.conversation-line.is-assistant .conversation-main span {
    color: var(--amber);
}

.conversation-main p,
.translation-box,
.correction-box,
.warning-box {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.translate-button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.11);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.translation-box,
.correction-box {
    grid-column: 1 / -1;
    padding: 10px;
    border-radius: 8px;
}

.warning-box {
    grid-column: 1 / -1;
    padding: 10px;
    border-radius: 8px;
    color: #fff3d7;
    background: rgba(241, 184, 75, 0.16);
}

.translation-box {
    color: #dbf7ea;
    background: rgba(53, 215, 140, 0.12);
}

.correction-box {
    display: grid;
    gap: 4px;
    color: #ffe9ed;
    background: rgba(255, 107, 122, 0.14);
}

.correction-box strong {
    color: #ffb0ba;
    font-size: 12px;
    text-transform: uppercase;
}

.pagination-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.pagination-row a,
.pagination-row span {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.09);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.message-card {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.message-card span {
    display: block;
    margin-bottom: 7px;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.answer-card span {
    color: var(--amber);
}

.message-card p {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.message-card .translate-button,
.message-card .translation-box,
.message-card .correction-box,
.message-card .warning-box {
    margin-top: 10px;
}

.notice-text {
    width: 100%;
    margin: auto 0 0;
    padding-top: 16px;
    color: rgba(247, 251, 248, 0.56);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.is-hidden {
    display: none;
}

@keyframes pulse {
    0% {
        opacity: 0.85;
        transform: scale(0.94);
    }
    100% {
        opacity: 0;
        transform: scale(1.22);
    }
}

@keyframes breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.025);
    }
}

@media (min-width: 760px) {
    .app-shell {
        padding: 32px;
    }

    .assistant-stage {
        min-height: calc(100vh - 64px);
        padding: 28px 28px 30px;
    }

    h1 {
        font-size: 46px;
    }

    .message-card {
        padding: 18px;
    }
}

@media (max-width: 360px) {
    .app-shell {
        padding: 10px;
    }

    .assistant-stage {
        min-height: calc(100svh - 20px);
        border-radius: 8px;
        padding: 18px 13px 18px;
    }

    h1 {
        font-size: 28px;
    }

    .mic-button {
        min-width: 150px;
        min-height: 150px;
    }

    .mic-icon {
        width: 62px;
        height: 62px;
    }
}

@media (max-width: 860px) {
    .panel-grid,
    .student-layout {
        grid-template-columns: 1fr;
    }

    .summary-grid,
    .report-grid,
    .report-hero,
    .report-hero-stats {
        grid-template-columns: 1fr;
    }

    .student-stage {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px;
    }

    .topbar-nav {
        width: 100%;
        justify-content: space-between;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-card,
    .panel-card {
        padding: 15px;
    }

    .table-row,
    .conversation-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .word-row {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .class-item-row,
    .table-row-actions,
    .class-item-actions,
    .page-heading-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .conversation-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-translate-input-row {
        grid-template-columns: 1fr;
    }

    .conversation-line {
        grid-template-columns: 1fr;
    }

    .word-toolbar-header,
    .word-toolbar-actions,
    .word-row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .word-count {
        width: fit-content;
    }

    .points-grid,
    .before-after-grid,
    .score-ring-grid,
    .points-economy {
        grid-template-columns: 1fr;
    }

    .comparison-copy,
    .comparison-values,
    .timeline-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
