:root {
    --bg: #eef1fb;
    --bg-2: #f7f8fd;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-solid: #ffffff;
    --panel-soft: #f6f7fb;
    --ink: #1f2430;
    --muted: #6f7787;
    --line: #dde3f0;
    --line-strong: #cfd8ea;
    --accent: #1f6fff;
    --accent-soft: #edf4ff;
    --success-soft: #eef9f4;
    --danger: #c54848;
    --danger-soft: #fff0f0;
    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(88, 102, 140, 0.08);
    --font-display: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    --font-body: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 19px;
    font-weight: 500;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1)),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
    font-weight: 500;
}

button {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 18px;
    background: #111318;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
    border-color: rgba(31, 111, 255, 0.34);
    box-shadow: 0 10px 24px rgba(31, 111, 255, 0.14);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: wait;
    box-shadow: none;
    transform: none;
}

.secondary-button {
    background: #ffffff;
    color: var(--ink);
    border-color: var(--line);
}

.text-button {
    width: fit-content;
    padding: 0;
    background: transparent;
    color: var(--accent);
    border: none;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #bad0ff;
    box-shadow: 0 0 0 4px rgba(31, 111, 255, 0.08);
}

textarea {
    resize: vertical;
}

label {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

.app-shell {
    width: min(1580px, calc(100% - 24px));
    margin: 0 auto;
    padding: 10px 0 18px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

#auth-view {
    min-height: calc(100vh - 28px);
    display: none;
}

#auth-view.active {
    display: grid;
    place-items: center;
}

.hidden {
    display: none !important;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-layout {
    width: min(100%, 1180px);
    min-height: min(760px, calc(100vh - 28px));
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 14px;
}

.auth-hero,
.auth-panel,
.home-card,
.workspace-panel,
.topbar,
.dev-mode-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.auth-hero {
    padding: clamp(28px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at 18% 18%, rgba(31, 111, 255, 0.1), transparent 0 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 249, 255, 0.9));
}

.auth-logo-lockup {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.auth-logo-mark {
    display: grid;
    width: clamp(86px, 8vw, 128px);
    height: clamp(86px, 8vw, 128px);
    place-items: center;
    border-radius: 30px;
    color: #ffffff;
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.34), transparent 30%),
        linear-gradient(135deg, #111827 0%, #2864ed 100%);
    box-shadow: 0 26px 54px rgba(40, 100, 237, 0.22);
    flex: 0 0 auto;
}

.auth-logo-mark svg {
    width: 66%;
    height: 66%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
}

.auth-hero h1 {
    margin: 0;
    max-width: 820px;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 4.2rem);
    line-height: 1.08;
    letter-spacing: -0.065em;
    color: #111827;
    white-space: normal;
    word-break: keep-all;
}

.auth-copy {
    margin: 28px 0 0;
    max-width: 600px;
    color: var(--muted);
    line-height: 1.7;
}

.status-pill {
    margin-top: 22px;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    border: 1px solid #d7e6ff;
}

.status-pill.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #ffdcdc;
}

.auth-panel {
    padding: clamp(24px, 3vw, 38px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    align-items: center;
    margin-top: 15px;
}

.social-login {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
}

.social-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    color: #7d8796;
    font-size: 0.82rem;
    font-weight: 700;
}

.social-login-divider::before,
.social-login-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.social-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 40px;
    min-height: 0;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    border: 0;
    overflow: hidden;
}

.social-login-button:hover {
    border-color: transparent;
    box-shadow: none;
    transform: translateY(-1px);
}

.social-login-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.auth-feedback-form {
    margin-top: 17px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.74);
}

.panel-header h2,
.section-header h2,
.home-card h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.panel-header p,
.home-card p,
.workspace-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.stack {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.compact-stack {
    margin-top: 12px;
}

.inline-row,
.topbar-actions,
.section-header,
.document-actions,
.quiz-actions-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.section-header,
.topbar,
.session-card,
.document-card {
    justify-content: space-between;
}

.feedback-panel {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid #d7e6ff;
}

.feedback-panel.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #ffdcdc;
}

.topbar {
    padding: 14px 18px;
    display: flex;
    gap: 18px;
    align-items: center;
    background: rgba(255, 255, 255, 0.74);
}

.topbar h1 {
    margin: 0;
    font-size: clamp(1.7rem, 2.8vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.user-summary {
    font-weight: 600;
    color: var(--muted);
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.home-card {
    padding: 22px;
    min-height: 210px;
}

.history-card {
    grid-column: 1 / -1;
    min-height: auto;
}

.session-list,
.document-list,
.quiz-list,
.message-list,
.quiz-session-board {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.session-card,
.document-card,
.quiz-card,
.message-bubble,
.empty-box,
.quiz-solve-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--panel-solid);
}

.session-card,
.document-card {
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.session-card:hover,
.document-card:hover,
.quiz-card:hover,
.quiz-solve-card:hover,
.message-bubble:hover {
    border-color: var(--line-strong);
}

.document-card.selected {
    background: var(--accent-soft);
    border-color: #cddfff;
}

.document-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px 10px 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
}

.document-row:hover {
    border-color: var(--line);
    background: #ffffff;
}

.document-row.selected {
    border-color: #d4def3;
    background: #ffffff;
}

.document-row-open {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    color: inherit;
    border: none;
    box-shadow: none;
    border-radius: 0;
    text-align: left;
}

.document-row-open:hover,
.document-more-button:hover {
    transform: none;
}

.document-row-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #eef3ff;
    border: 1px solid #d7e0f5;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex: 0 0 34px;
}

.document-row-copy {
    flex: 1;
    min-width: 0;
}

.document-row-copy .document-name {
    display: block;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-row-copy .document-meta {
    margin: 4px 0 0;
    font-size: 0.84rem;
}

.upload-analysis-panel {
    display: block;
}

.upload-analysis-panel.hidden {
    display: none;
}

.upload-analysis-card {
    display: grid;
    gap: 8px;
    margin: 2px 0 8px;
    padding: 10px;
    border: 1px solid #dce6f7;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    min-width: 0;
    overflow: hidden;
}

.upload-analysis-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.upload-analysis-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
}

.upload-analysis-header-actions button {
    min-height: 0;
    padding: 4px 7px;
    border-radius: 999px;
    background: #263245;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    box-shadow: none;
}

.upload-analysis-header-actions button:hover {
    transform: none;
    background: #263245;
}

.upload-analysis-card-header strong {
    color: var(--ink);
    font-size: 0.88rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.upload-analysis-card-header span {
    padding: 3px 7px;
    border-radius: 999px;
    background: #eaf1ff;
    color: #2454bd;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.upload-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.upload-analysis-item {
    min-width: 0;
    padding: 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
}

.upload-analysis-item span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
}

.upload-analysis-item strong {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.upload-analysis-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 58px;
    overflow-y: auto;
    min-width: 0;
}

.upload-analysis-tags button {
    padding: 4px 7px;
    min-height: 0;
    border-radius: 999px;
    border: none;
    background: #eef4ff;
    color: #2f5fbf;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-analysis-tag-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 999px;
    background: #eef4ff;
}

.upload-analysis-tag-chip button {
    min-height: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.upload-analysis-tag-edit {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-analysis-tag-delete {
    flex: 0 0 auto;
    padding: 4px 7px 4px 5px !important;
    border-left: 1px solid #d8e5fb !important;
    color: #7b8798 !important;
    font-size: 0.82rem !important;
    line-height: 1;
}

.upload-analysis-tags button:hover {
    transform: none;
    background: #dfeaff;
}

.upload-analysis-tag-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    margin: 0;
    min-width: 0;
}

.upload-analysis-tag-editor input {
    min-height: 30px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 0.76rem;
}

.upload-analysis-tag-editor button {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 0.74rem;
}

.document-workspace-panel .upload-analysis-card {
    gap: 7px;
    padding: 9px;
}

.document-workspace-panel .upload-analysis-card-header {
    align-items: flex-start;
    gap: 6px;
}

.document-workspace-panel .upload-analysis-card-header strong {
    max-width: 72px;
    line-height: 1.2;
}

.document-workspace-panel .upload-analysis-header-actions {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.document-workspace-panel .upload-analysis-header-actions span {
    display: none;
}

.document-workspace-panel .upload-analysis-header-actions button {
    padding: 4px 6px;
    font-size: 0.64rem;
}

.document-workspace-panel .upload-analysis-grid {
    grid-template-columns: 1fr;
}

.document-workspace-panel .upload-analysis-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    padding: 6px 7px;
}

.document-workspace-panel .upload-analysis-item span,
.document-workspace-panel .upload-analysis-item strong {
    margin-top: 0;
}

.document-workspace-panel .upload-analysis-tags {
    max-height: 72px;
}

.document-row-trailing {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.analysis-toggle-button,
.document-analysis-button {
    min-height: 0;
    border-radius: 999px;
    border: 1px solid #d8e3f5;
    background: #f4f8ff;
    color: #2558c7;
    font-weight: 800;
    box-shadow: none;
}

.analysis-toggle-button {
    padding: 7px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
}

.document-analysis-button {
    padding: 5px 8px;
    font-size: 0.7rem;
}

.analysis-toggle-button:hover,
.document-analysis-button:hover {
    transform: none;
    background: #e8f0ff;
    border-color: #bed0f1;
}

.document-selected-indicator {
    width: 22px;
    height: 22px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #eef2f8;
    color: transparent;
    border: 1px solid #dde4f0;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: none;
}

.document-selected-indicator.active {
    background: #2864ed;
    border-color: #2864ed;
    color: #ffffff;
}

.document-selected-indicator:hover {
    transform: none;
}

.quiz-document-selection {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.document-more-button {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--muted);
    border: none;
    box-shadow: none;
    font-size: 1.15rem;
    line-height: 1;
}

.document-menu {
    position: absolute;
    top: 42px;
    left: 8px;
    min-width: 188px;
    padding: 8px;
    display: grid;
    gap: 2px;
    border: 1px solid #cfd7e6;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(36, 48, 77, 0.16);
    z-index: 12;
}

.document-menu-item {
    justify-content: flex-start;
    padding: 11px 12px;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    border: none;
    box-shadow: none;
    font-weight: 600;
}

.document-menu-item + .document-menu-item {
    border-top: 1px solid #eef2f8;
}

.document-menu-item:hover {
    background: var(--panel-soft);
    transform: none;
}

.document-menu-item.delete-document-button {
    color: var(--danger);
}

.document-meta,
.session-meta,
.message-source,
.quiz-explanation {
    color: var(--muted);
    line-height: 1.5;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 320px;
    gap: 12px;
    margin-top: 14px;
    align-items: stretch;
    height: calc(100vh - 110px);
    min-height: 0;
}

.workspace-panel {
    padding: 14px;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel {
    background: rgba(255, 255, 255, 0.82);
    min-height: 0;
}
.mini-badge {
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    border: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.82rem;
}

.message-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.document-list,
.quiz-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 8px 12px 4px;
    margin: -4px -8px -12px -4px;
}

.message-bubble {
    padding: 14px 15px;
}

.message-bubble.user {
    background: #f8faff;
    border-color: #dce7fb;
}

.message-bubble.assistant {
    background: #ffffff;
}

.message-role {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.message-content {
    margin-top: 8px;
    white-space: pre-wrap;
    line-height: 1.65;
}

.chat-form {
    flex-shrink: 0;
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
}

.chat-form textarea {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 4px;
}

.chat-form textarea:focus {
    box-shadow: none;
}

.quiz-card,
.quiz-solve-card {
    padding: 14px;
}

.quiz-set-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 10px 12px 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: background-color 140ms ease, border-color 140ms ease;
    overflow: visible;
}

.quiz-set-card:hover {
    background: #ffffff;
    border-color: var(--line);
}

.quiz-set-open {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    color: inherit;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    text-align: left;
}

.quiz-set-open:hover,
.quiz-set-more:hover {
    transform: none;
}

.quiz-set-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #eef5ff;
    border: 1px solid #d8e5ff;
    color: var(--accent);
    font-weight: 800;
}

.quiz-set-copy {
    min-width: 0;
}

.quiz-set-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quiz-set-meta {
    margin: 4px 0 0;
    font-size: 0.86rem;
    color: var(--muted);
}

.quiz-set-more {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--muted);
    border: none;
    box-shadow: none;
    font-size: 1.15rem;
    line-height: 1;
}

.quiz-set-menu {
    position: absolute;
    top: 44px;
    right: 8px;
    min-width: 168px;
    padding: 8px;
    display: grid;
    gap: 2px;
    border: 1px solid #cfd7e6;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(36, 48, 77, 0.16);
    z-index: 12;
}

.quiz-set-menu-item {
    justify-content: flex-start;
    padding: 11px 12px;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    border: none;
    box-shadow: none;
    font-weight: 600;
}

.quiz-set-menu-item + .quiz-set-menu-item {
    border-top: 1px solid #eef2f8;
}

.quiz-set-menu-item:hover {
    background: var(--panel-soft);
    transform: none;
}

.quiz-set-menu-item.delete-quiz-set-button {
    color: var(--danger);
}

.quiz-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.quiz-question {
    margin: 12px 0;
    line-height: 1.55;
    white-space: pre-line;
}

.quiz-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice-chip,
.choice-row {
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 0.84rem;
    border: 1px solid var(--line);
}

.choice-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quiz-solve-answer-area {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.quiz-feedback {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.feedback-badge {
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
}

.feedback-badge.correct {
    background: var(--success-soft);
    color: #1d7d56;
}

.feedback-badge.wrong {
    background: var(--danger-soft);
    color: var(--danger);
}

.feedback-detail,
.empty-box {
    line-height: 1.6;
}

.evaluation-feedback {
    white-space: pre-line;
}

.empty-box {
    padding: 20px 16px;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
}

.chat-empty-space {
    min-height: 120px;
    color: transparent;
}

.quiz-session-layout {
    margin-top: 14px;
}

.quiz-session-board {
    max-width: 760px;
}

.quiz-solve-card {
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
}

.quiz-single-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.quiz-note-button {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--muted);
    border: none;
    box-shadow: none;
    font-size: 1rem;
}

.quiz-type {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.quiz-solve-card .quiz-question {
    margin: 10px 0 0;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.7;
}

.quiz-solve-answer-area {
    margin-top: 26px;
    gap: 12px;
}

.quiz-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid #edf1f7;
    background: #fbfbfd;
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.quiz-option-card:hover {
    border-color: #d7deed;
    background: #ffffff;
}

.quiz-option-card.selected {
    border-color: #c9d8ff;
    background: #f4f8ff;
}

.quiz-option-card input {
    display: none;
}

.quiz-option-index {
    color: #5b6475;
    font-weight: 700;
}

.quiz-hint-box {
    margin-top: 18px;
    border-top: 1px solid #eef2f8;
    padding-top: 14px;
}

.quiz-hint-box summary {
    width: fit-content;
    cursor: pointer;
    color: var(--ink);
    font-weight: 600;
    list-style: none;
}

.quiz-hint-box summary::-webkit-details-marker {
    display: none;
}

.quiz-hint-content {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.7;
}

.quiz-session-actions {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quiz-check-button {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.quiz-next-button {
    min-width: 92px;
    background: #4b5fff;
}

.quiz-feedback {
    margin-top: 18px;
}

.quiz-summary-card {
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
}

.quiz-summary-header,
.quiz-summary-actions,
.summary-stage-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-summary-header h2,
.summary-panel h3 {
    margin: 0;
}

.quiz-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.95fr);
    gap: 12px;
    margin-top: 18px;
    align-items: stretch;
}

.summary-panel {
    margin-top: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.summary-panel-emphasis {
    margin-top: 0;
}

.summary-panel > h3 + * {
    margin-top: 15px;
}

.summary-top-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.summary-metric-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #ffffff;
    min-height: 118px;
}

.summary-metric-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.summary-metric-card strong {
    display: block;
    margin-top: 4px;
    color: var(--accent);
    font-size: 2rem;
    font-weight: 800;
}

.summary-metric-card.primary {
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.summary-metric-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eaf2ff;
    color: var(--accent);
    font-weight: 800;
    font-size: 1.3rem;
}

.summary-metric-icon.neutral {
    background: #f3f5f9;
    color: #5f6d82;
}

.summary-copy {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.summary-column-stack {
    display: grid;
    gap: 14px;
    grid-auto-rows: auto;
}

.summary-radar-wrap {
    position: relative;
    min-height: 238px;
    margin-top: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfcff 0%, #ffffff 100%);
}

.summary-radar-chart {
    display: grid;
    place-items: center;
    padding-top: 6px;
}

.radar-svg {
    width: 100%;
    max-width: 285px;
    height: auto;
}

.radar-grid {
    fill: none;
    stroke: #dfe6f3;
    stroke-width: 1;
}

.radar-axis {
    stroke: #e6ebf5;
    stroke-width: 1;
}

.radar-shape {
    fill: rgba(47, 109, 255, 0.22);
    stroke: #2f6dff;
    stroke-width: 2;
}

.radar-point {
    fill: #2f6dff;
}

.summary-radar-label {
    position: absolute;
    display: grid;
    gap: 2px;
    font-size: 0.88rem;
    font-weight: 700;
}

.summary-radar-label strong {
    font-size: 1rem;
}

.summary-radar-label.top {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #2f6dff;
    text-align: center;
}

.summary-radar-label.left {
    left: 8px;
    bottom: 40px;
    color: #f2a400;
}

.summary-radar-label.right {
    right: 8px;
    bottom: 40px;
    color: #ef5252;
    text-align: right;
}

.summary-stage-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
}

.legend-dot.good {
    background: #2f6dff;
}

.legend-dot.mid {
    background: #f2a400;
}

.legend-dot.low {
    background: #ef5252;
}

.summary-concept-list,
.summary-review-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.summary-concept-list li,
.summary-review-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.summary-concept-list li + li,
.summary-review-list li + li {
    border-top: 1px solid #edf1f7;
}

.summary-concept-list strong {
    color: #f06a4d;
    font-size: 0.9rem;
}

.rank-badge {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
}

.rank-1 {
    background: #ef5252;
}

.rank-2 {
    background: #f5a623;
}

.rank-3 {
    background: #f2c94c;
}

.rank-4,
.rank-5 {
    background: #6b7280;
}

.summary-progress-list,
.summary-stage-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.summary-progress-item {
    display: grid;
    gap: 8px;
}

.summary-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.summary-progress-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.summary-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #edf1f7;
    overflow: hidden;
}

.summary-progress-fill {
    height: 100%;
    border-radius: 999px;
}

.summary-progress-fill.good {
    background: #2f6dff;
}

.summary-progress-fill.mid {
    background: #f2a400;
}

.summary-progress-fill.low {
    background: #ef5252;
}

.summary-stage-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    flex-wrap: wrap;
}

.summary-stage-item small {
    width: 100%;
    color: var(--muted);
}

.quiz-summary-actions {
    margin-top: 18px;
    justify-content: flex-end;
}

.quiz-back-workspace-button {
    min-width: 128px;
    background: #4b5fff;
}

.summary-feedback-copy {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f7f3ff;
    border: 1px solid #ece2ff;
    color: #4a4f63;
}

.summary-comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-comparison-grid div {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-soft);
}

.summary-comparison-grid span,
.summary-comparison-grid small {
    color: var(--muted);
}

.summary-comparison-grid strong {
    font-size: 1.35rem;
}

.summary-comparison-grid .good strong {
    color: #1d7d56;
}

.summary-comparison-grid .mid strong {
    color: #8a6413;
}

.summary-comparison-grid .low strong {
    color: var(--danger);
}

.summary-feedback-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.summary-feedback-comparison div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.summary-feedback-comparison p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.summary-review-list li p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.summary-review-list li span {
    color: var(--muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.dev-mode-wrap {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 30;
    width: min(420px, calc(100vw - 24px));
    display: grid;
    gap: 10px;
}

.dev-mode-panel {
    padding: 16px;
    max-height: 58vh;
    overflow: auto;
}

.dev-mode-output {
    margin: 14px 0 0;
    padding: 14px;
    border-radius: var(--radius-md);
    background: #0f1726;
    color: #dce7ff;
    overflow: auto;
    min-height: 120px;
}

/* Home dashboard */
#home-view .topbar {
    padding: 18px 30px;
    border-radius: 22px 22px 0 0;
    border-bottom-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.94);
}

#home-view .topbar h1 {
    color: #111827;
    font-size: 2rem;
}

#home-view .eyebrow,
.card-kicker {
    color: var(--accent);
}

.home-dashboard {
    padding: 14px;
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 22px 22px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 112px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(88, 102, 140, 0.06);
}

.stat-card p,
.stat-card span {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.stat-card strong {
    display: block;
    margin: 4px 0;
    color: #14213d;
    font-size: 1.7rem;
    line-height: 1;
}

.stat-card small {
    font-size: 0.85rem;
    font-weight: 700;
}

.stat-icon,
.heading-icon,
.session-icon,
.recent-session-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 1.55rem;
    font-weight: 800;
}

.stat-icon svg,
.heading-icon svg,
.session-icon svg,
.recent-session-icon svg,
.icon-button svg,
.session-search-wrap svg,
.recent-session-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.stat-icon svg {
    width: 25px;
    height: 25px;
}

.session-search-wrap svg {
    width: 18px;
    height: 18px;
}

.stat-icon-blue { color: #3d73ff; background: #edf3ff; }
.stat-icon-green { color: #62bc43; background: #f1faec; }
.stat-icon-purple { color: #8750ea; background: #f4efff; }
.stat-icon-orange { color: #ff8a22; background: #fff4e8; }

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(420px, 1fr));
    gap: 14px;
    margin-top: 14px;
    align-items: stretch;
}

.home-dashboard .history-card {
    grid-column: auto;
    align-self: stretch;
    height: 100%;
}

.dashboard-side {
    display: grid;
    gap: 14px;
    align-content: start;
    align-self: start;
}

.home-dashboard .home-card {
    min-height: 0;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
}

.home-dashboard .history-card,
.home-dashboard .new-study-card {
    padding: 20px;
}

.card-kicker {
    margin: 0 0 5px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.section-heading-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-study-heading {
    justify-content: space-between;
}

.new-study-heading .heading-icon {
    flex: 0 0 auto;
}

.new-study-heading > div {
    flex: 1 1 auto;
    min-width: 0;
}

.heading-icon {
    width: 28px;
    height: 28px;
    color: #4678ff;
    border-radius: 10px;
    background: #eef4ff;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-study-form input,
.dashboard-study-form select {
    padding: 11px 13px;
    border-radius: 10px;
}

.dashboard-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 2px;
    border-radius: 12px;
    background: #111827;
}

.dashboard-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.session-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.session-search-wrap {
    position: relative;
    display: block;
    margin-top: 14px;
}

.session-search-wrap span {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: #8b99b0;
    font-size: 1.25rem;
    transform: translateY(-56%);
}

.session-search-wrap input {
    padding: 11px 14px 11px 40px;
    border-radius: 10px;
}

.session-filter-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.session-filter {
    padding: 8px 14px;
    border-radius: 999px;
    color: #263044;
    border-color: var(--line);
    background: #ffffff;
    font-size: 0.76rem;
}

.session-filter.active {
    color: #ffffff;
    border-color: #111827;
    background: #111827;
}

.icon-button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 11px;
    color: #52627c;
    border-color: var(--line);
    background: #ffffff;
    font-size: 1.2rem;
}

.history-card .session-list {
    overflow: visible;
    padding-right: 3px;
}

.session-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.pagination-button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    color: #69758a;
    border-color: var(--line);
    background: #ffffff;
    font-size: 0.78rem;
}

.pagination-button.active {
    color: #ffffff;
    border-color: #111827;
    background: #111827;
}

.pagination-button:disabled {
    color: #c3cad5;
    cursor: default;
    opacity: 1;
}

.history-card .session-card {
    position: relative;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
}

.session-icon,
.recent-session-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #3d73ff;
    background: #eef4ff;
    font-weight: 800;
}

.session-copy {
    flex: 1;
    min-width: 0;
}

.session-title-line {
    display: flex;
    align-items: center;
    gap: 9px;
}

.session-title {
    margin: 0;
    color: #172033;
    font-size: 0.98rem;
}

.session-meta {
    margin: 5px 0 0;
    font-size: 0.78rem;
}

.session-status {
    padding: 4px 8px;
    border-radius: 999px;
    color: #42a860;
    background: #eef9f0;
    border: 1px solid #d7efd9;
    font-size: 0.68rem;
    font-weight: 800;
}

.session-status.complete {
    color: #748197;
    background: #f3f5f8;
    border-color: #e2e7ef;
}

.open-session-button {
    padding: 9px 15px;
    font-size: 0.8rem;
}

.session-more-button {
    width: 32px;
    height: 32px;
    padding: 0;
    color: #7e8a9d;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    letter-spacing: -0.12em;
}

.session-more-button:hover {
    background: #f3f6fa;
    transform: none;
}

.session-menu {
    position: absolute;
    top: 52px;
    right: 10px;
    min-width: 150px;
    padding: 7px;
    display: grid;
    gap: 2px;
    border: 1px solid #cfd7e6;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(36, 48, 77, 0.16);
    z-index: 12;
}

.session-menu-item {
    justify-content: flex-start;
    padding: 10px 11px;
    border: none;
    border-radius: 9px;
    color: var(--ink);
    background: transparent;
    box-shadow: none;
    font-size: 0.84rem;
    font-weight: 600;
}

.session-menu-item + .session-menu-item {
    border-top: 1px solid #eef2f8;
}

.session-menu-item:hover {
    background: var(--panel-soft);
    transform: none;
}

.session-menu-item.delete-session-button {
    color: var(--danger);
}

.recent-session-list {
    display: grid;
    gap: 9px;
    margin-top: 14px;
}

.recent-session-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px;
    border-radius: 13px;
    color: var(--ink);
    border-color: var(--line);
    background: #ffffff;
    text-align: left;
}

.recent-session-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
    flex: 1;
}

.recent-session-copy strong,
.recent-session-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-session-copy small {
    color: var(--muted);
    font-size: 0.75rem;
}

.recent-session-arrow {
    color: #111827;
    font-size: 1.55rem;
}

.recent-session-arrow svg {
    width: 18px;
    height: 18px;
}

.recent-all-button {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border-radius: 9px;
    color: var(--accent);
    border-color: var(--accent);
    background: #ffffff;
}

@media (max-width: 1180px) {
    .auth-layout {
        max-width: 680px;
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .auth-hero,
    .auth-panel {
        min-height: 0;
    }

    .auth-hero {
        justify-content: flex-start;
    }

    .auth-logo-lockup {
        align-items: center;
    }

    .auth-logo-mark {
        width: 76px;
        height: 76px;
        border-radius: 22px;
    }

    .auth-hero h1 {
        font-size: clamp(2.8rem, 8vw, 4.8rem);
    }

    .workspace-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .workspace-panel {
        min-height: 0;
        height: auto;
    }

    .chat-panel {
        height: calc(100vh - 110px);
        min-height: 520px;
        overflow: hidden;
    }
}

@media (max-width: 700px) {
    .dashboard-stats,
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .auth-layout,
    .home-grid,
    .form-grid-2,
    .summary-top-metrics,
    .quiz-summary-grid,
    .summary-comparison-grid,
    .summary-feedback-comparison {
        grid-template-columns: 1fr;
    }

    .topbar,
    .topbar-actions,
    .inline-row,
    .section-header,
    .document-card,
    .document-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (min-width: 701px) and (max-width: 920px) {
    #home-view .topbar,
    #home-view .topbar-actions,
    .home-dashboard .section-header {
        flex-direction: row;
        align-items: center;
    }

    .home-dashboard .form-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Study workspace redesign */
#workspace-view {
    padding-top: 4px;
    letter-spacing: -0.015em;
}

.workspace-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 4px 14px;
    color: #2463e8;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: #2864ed;
}

.brand-mark svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.6;
}

.workspace-topbar {
    min-height: 96px;
    padding: 18px 22px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
}

.workspace-title-wrap,
.workspace-nav-button,
.workspace-quiz-button {
    display: flex;
    align-items: center;
}

.workspace-title-wrap {
    gap: 13px;
}

.workspace-title-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #2864ed;
}

.workspace-title-icon svg,
.workspace-nav-button svg,
.workspace-quiz-button svg,
.dropzone-icon svg,
.message-avatar svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.workspace-topbar h1 {
    color: #182133;
    font-size: 1.55rem;
}

.workspace-subtitle {
    margin: 8px 0 0;
    color: #71809a;
    font-size: 0.84rem;
}

.workspace-status {
    margin-left: 18px;
    padding: 7px 18px;
    border-radius: 999px;
    color: #2f9b53;
    background: #edf9ef;
    font-size: 0.75rem;
    font-weight: 800;
}

.workspace-nav-button {
    gap: 7px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #253047;
}

.workspace-nav-button svg {
    width: 16px;
    height: 16px;
}

#workspace-view .workspace-grid {
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    gap: 18px;
    height: calc(100vh - 168px);
    min-height: 680px;
    margin-top: 18px;
}

#workspace-view .workspace-panel {
    padding: 18px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.97);
}

#workspace-view .section-header h2 {
    margin: 0;
    color: #182133;
    font-size: 1.05rem;
}

.panel-help {
    display: inline-grid;
    width: 16px;
    height: 16px;
    place-items: center;
    margin-left: 3px;
    border: 1px solid #b8c5dc;
    border-radius: 50%;
    color: #8390a7;
    font-size: 0.65rem;
}

.workspace-dropzone {
    position: relative;
    min-height: 150px;
    place-items: center;
    align-content: center;
    gap: 7px;
    margin-top: 14px;
    padding: 18px;
    overflow: hidden;
    border: 1px dashed #c8d6ee;
    border-radius: 12px;
    color: #65738d;
    text-align: center;
    background: #fbfcff;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.workspace-dropzone.drag-over {
    border-color: #2864ed;
    background: #f4f8ff;
    box-shadow: 0 0 0 4px rgba(40, 100, 237, 0.08);
    transform: translateY(-1px);
}

.workspace-dropzone.invalid-drop {
    border-color: #ef4453;
    background: #fff7f8;
    box-shadow: 0 0 0 4px rgba(239, 68, 83, 0.08);
}

.workspace-dropzone > span:not(.dropzone-icon),
.workspace-dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #2864ed;
}

.dropzone-icon svg {
    width: 31px;
    height: 31px;
}

.workspace-dropzone strong {
    color: #62708a;
    font-size: 0.95rem;
}

.workspace-dropzone small {
    color: #8c98ac;
    font-size: 0.8rem;
}

.dropzone-file-name {
    display: block;
    max-width: 100%;
    color: #2864ed;
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-upload-options {
    display: none;
}

.workspace-upload-button,
.workspace-quiz-button {
    justify-content: center;
    width: 100%;
    border-radius: 9px;
}

.workspace-upload-button {
    margin-top: 10px;
    background: #2864ed;
}

.document-list-header,
.quiz-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 9px;
    color: #53627b;
    font-size: 0.84rem;
    font-weight: 700;
}

#workspace-view .document-list {
    margin-top: 0;
}

#workspace-view .document-list,
#workspace-view .quiz-list {
    padding: 6px 10px 14px 6px;
    margin: -6px -10px -14px -6px;
}

#workspace-view .document-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    min-height: 104px;
    padding: 12px 9px;
    border: 1px solid #d8e1f0;
    border-radius: 11px;
    overflow: visible;
    transform: none;
    min-width: 0;
}

#workspace-view .document-row:has(.document-menu:not(.hidden)) {
    z-index: 20;
}

#workspace-view .document-menu {
    top: calc(100% - 4px);
    right: 8px;
    left: auto;
    z-index: 30;
}

#workspace-view .document-row-open {
    width: 100%;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

#workspace-view .document-row-trailing {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

#workspace-view .document-row.selected {
    border-color: #3971ee;
    box-shadow: 0 0 0 1px rgba(57, 113, 238, 0.1);
}

#workspace-view .document-row-icon {
    color: #e63b49;
    border-color: #ffd4d8;
    background: #fff0f1;
}

#workspace-view .document-row-icon svg,
.document-selected-indicator svg,
.document-more-button svg,
.quiz-set-icon svg,
.quiz-set-more svg,
.quiz-document-chip svg,
.chat-attach-icon svg,
.chat-form-actions button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

#workspace-view .document-row-copy .document-name {
    font-size: 0.92rem;
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

#workspace-view .document-row-open,
#workspace-view .quiz-set-open {
    min-width: 0;
}

#workspace-view .document-row-icon,
#workspace-view .quiz-set-icon {
    flex: 0 0 auto;
}

#workspace-view .document-row-copy,
#workspace-view .quiz-set-copy {
    min-width: 0;
    max-width: 100%;
}

.document-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
    max-height: 24px;
    overflow: hidden;
}

.document-meta-tags span {
    max-width: 72px;
    padding: 3px 5px;
    border: 1px solid #dce5f5;
    border-radius: 5px;
    color: #64738e;
    background: #fbfcff;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-uploaded-at {
    margin: 8px 0 0;
    color: #7a879c;
    font-size: 0.72rem;
}

.selected-document-footer {
    margin: 14px -18px -18px;
    padding: 13px;
    color: #5f6d84;
    border-top: 1px solid #e3e8f1;
    background: #fbfcfe;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
}

#workspace-view .chat-panel {
    padding-bottom: 14px;
}

#workspace-view .message-list {
    margin-top: 14px;
    padding-right: 6px;
}

#workspace-view .message-bubble {
    display: flex;
    gap: 11px;
    padding: 13px 11px;
    border-radius: 13px;
}

#workspace-view .message-bubble.user {
    background: #f4f8ff;
    border-color: #dbe7fb;
}

.message-avatar {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 10px;
    color: #2864ed;
    background: #eaf1ff;
}

.message-avatar svg {
    width: 19px;
    height: 19px;
}

.message-body {
    min-width: 0;
}

#workspace-view .message-role {
    color: #263349;
    font-size: 0.8rem;
    letter-spacing: 0;
}

#workspace-view .message-content {
    margin-top: 5px;
    color: #263349;
    font-size: 0.88rem;
    line-height: 1.72;
}

#workspace-view .message-source {
    margin-top: 9px;
    color: #73809a;
    font-size: 0.78rem;
}

#workspace-view .chat-form {
    border-radius: 12px;
}

.chat-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-attach-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #7a879b;
    box-shadow: none;
    min-width: 0;
}

.chat-attach-icon:hover,
.chat-attach-icon:focus-visible {
    color: #2864ed;
    border-color: #d8e4ff;
    background: #f4f8ff;
    box-shadow: none;
    transform: none;
}

#workspace-view .chat-form button {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 92px;
    border-radius: 7px;
    background: #2864ed;
}

#workspace-view .chat-form .chat-attach-icon {
    min-width: 34px;
    background: transparent;
}

.chat-form-actions button svg {
    width: 16px;
    height: 16px;
}

.quiz-document-selection {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e0e6f1;
    border-radius: 10px;
    color: #344057;
    background: #fbfcff;
    font-size: 0.82rem;
}

.quiz-document-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.quiz-document-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-document-selection-header button {
    padding: 5px 8px;
    border-radius: 5px;
    color: #59677d;
    border-color: #dce4f1;
    background: #ffffff;
    font-size: 0.74rem;
}

.quiz-document-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid #dde4ef;
    border-radius: 6px;
    color: #53627b;
    background: #ffffff;
    font-size: 0.76rem;
}

.quiz-document-chip svg {
    width: 14px;
    height: 14px;
    color: #ef4453;
}

.workspace-quiz-button {
    gap: 7px;
    background: #2864ed;
}

.workspace-quiz-button svg {
    width: 17px;
    height: 17px;
}

.quiz-list-heading span {
    color: #2864ed;
}

#workspace-view .quiz-list {
    margin-top: 0;
}

#workspace-view .quiz-set-card {
    border-color: #e0e6ef;
    border-radius: 10px;
    transform: none;
    min-width: 0;
}

#workspace-view .quiz-set-title {
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

#workspace-view .quiz-set-meta,
#workspace-view .document-uploaded-at {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#workspace-view .document-row-open,
#workspace-view .quiz-set-open {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

#workspace-view .document-row-open:hover,
#workspace-view .document-row-open:focus,
#workspace-view .document-row-open:focus-visible,
#workspace-view .quiz-set-open:hover,
#workspace-view .quiz-set-open:focus,
#workspace-view .quiz-set-open:focus-visible {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none;
    transform: none !important;
}

#workspace-view .quiz-set-icon {
    color: #7655ee;
    border-color: #e5dcff;
    background: #f2edff;
}

#workspace-view .quiz-set-icon-1 {
    color: #ee7a2f;
    border-color: #ffe1ca;
    background: #fff3e8;
}

#workspace-view .quiz-set-icon-2 {
    color: #42a853;
    border-color: #d6f0da;
    background: #effaf0;
}

#workspace-view .quiz-set-icon-3 {
    color: #2864ed;
    border-color: #d6e2ff;
    background: #eef4ff;
}

@media (min-width: 921px) and (max-width: 1180px) {
    #workspace-view .workspace-grid {
        grid-template-columns: 230px minmax(0, 1fr) 260px;
        height: calc(100vh - 168px);
        min-height: 620px;
    }

    #workspace-view .workspace-panel {
        height: 100%;
    }

    #workspace-view .chat-panel {
        min-height: 0;
        overflow: hidden;
    }
}

/* Final font polish */
body {
    font-family: var(--font-body);
    font-weight: 600;
    -webkit-font-smoothing: auto;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.topbar h1,
.workspace-topbar h1 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.message-content,
#workspace-view .message-content {
    font-weight: 600;
    line-height: 1.75;
}

.document-row-copy .document-name,
.quiz-set-title,
.session-title {
    font-weight: 750;
    letter-spacing: -0.02em;
}

.document-meta,
.session-meta,
.quiz-set-meta,
.document-uploaded-at,
.message-source,
.workspace-subtitle {
    font-weight: 500;
    color: #4b5563;
}

button {
    font-weight: 800;
}

.app-shell {
    zoom: 1;
}

body {
    font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    font-weight: 600;
    -webkit-font-smoothing: auto;
}
/* Quiz result dashboard and comparison screen */
.quiz-session-board {
    width: 100%;
    max-width: none;
}

#quiz-view .quiz-session-layout,
#quiz-view .quiz-summary-card {
    width: 100%;
}

.quiz-result-dashboard .quiz-summary-header {
    align-items: flex-start;
    justify-content: space-between;
}

.quiz-result-dashboard .summary-top-metrics {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 14px;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    grid-template-rows: auto minmax(176px, 210px) minmax(176px, 210px);
    gap: 15px;
    align-items: stretch;
}

.dashboard-radar-panel {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
}

.dashboard-radar-panel .summary-radar-wrap {
    flex: 1 1 auto;
    min-height: 360px;
    display: grid;
    place-items: center;
}

.dashboard-radar-panel .summary-radar-chart {
    padding-top: 0;
}

.dashboard-radar-panel .summary-radar-label.top {
    top: calc(50% - 128px);
}

.dashboard-radar-panel .summary-radar-label.left,
.dashboard-radar-panel .summary-radar-label.right {
    top: calc(50% + 58px);
    bottom: auto;
}

.dashboard-grid > .summary-column-stack {
    grid-column: 2;
    grid-row: 1;
}

.dashboard-compact-panel {
    margin-top: 0;
}

.dashboard-review-panel {
    grid-column: 1;
    grid-row: 2 / span 2;
    align-self: stretch;
    max-height: 435px;
    min-height: 0;
    overflow: hidden;
}

.ai-final-feedback-card {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    border-color: #bfd0ff;
    background: linear-gradient(135deg, #f7faff 0%, #ffffff 48%, #eef4ff 100%);
    box-shadow: 0 20px 46px rgba(47, 109, 255, 0.13);
    min-height: 0;
}

.quiz-result-dashboard > .ai-final-feedback-card {
    margin-top: 0;
}

.ai-final-feedback-card::after {
    content: "";
    position: absolute;
    right: -44px;
    top: -52px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(47, 109, 255, 0.12);
}

.ai-final-feedback-head {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.ai-final-feedback-head > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #2f6dff;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.ai-final-feedback-head p {
    margin: 5px 0 0;
    color: #53627b;
    line-height: 1.6;
}

.ai-final-feedback-card .summary-feedback-copy {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    max-height: 112px;
    overflow-y: auto;
    padding-right: 8px;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(47, 109, 255, 0.18);
    color: #263245;
    font-weight: 650;
}

.summary-review-list li {
    justify-content: flex-start;
}

.dashboard-review-panel .summary-review-list {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

.summary-review-list li > div {
    min-width: 0;
    flex: 1;
}

.review-question-button {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid #dbe4f2;
    background: #ffffff;
    color: #2864ed;
    white-space: nowrap;
    box-shadow: none;
}

.review-book-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff6e8;
    color: #d97818;
    border: 1px solid #ffe0b8;
}

.review-book-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.comparison-entry-card {
    grid-column: 2;
    grid-row: 3;
    display: grid;
    gap: 11px;
    align-self: stretch;
    align-content: center;
    margin-top: 0;
    border-color: #d8e1f2;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.quiz-result-dashboard .ai-final-feedback-card,
.quiz-result-dashboard .comparison-entry-card {
    min-height: auto;
}

.comparison-entry-card button {
    width: fit-content;
    background: #263245;
}

.comparison-entry-card button:hover {
    border-color: transparent;
    box-shadow: none;
    background: #263245;
}

.comparison-entry-card small {
    color: var(--muted);
}

.quiz-comparison-screen {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.comparison-screen-header {
    justify-content: space-between;
    align-items: flex-start;
}

.comparison-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.36fr) minmax(0, 1fr);
    gap: 15px;
    align-items: stretch;
    min-width: 0;
}

.comparison-list-panel,
.comparison-detail-panel {
    margin-top: 0;
    min-width: 0;
    overflow: hidden;
}

.comparison-result-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    min-width: 0;
}

.quiz-comparison-screen .comparison-result-list {
    max-height: min(56vh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

.comparison-result-item {
    display: grid;
    gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--ink);
    box-shadow: none;
}

.comparison-result-item-with-action {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.comparison-result-item-with-action > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.comparison-attempt-delete-button {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    background: #fff5f5;
    border-color: #ffd0d0;
    color: #d24545;
    box-shadow: none;
    font-size: 0.78rem;
}

.comparison-attempt-delete-button:hover {
    background: #ffecec;
    box-shadow: none;
    transform: none;
}

.comparison-result-item:hover,
.comparison-result-item.selected {
    border-color: #b9c9ff;
    background: #f6f9ff;
}

.comparison-result-item.current {
    border-color: #2f6dff;
}

.comparison-result-item span,
.comparison-result-item small {
    color: var(--muted);
    font-size: 0.78rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.comparison-vs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 15px;
    align-items: stretch;
    min-width: 0;
}

.comparison-column {
    display: grid;
    grid-template-rows: auto auto minmax(2.7em, auto) auto auto auto minmax(0, 1fr);
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.comparison-column:not(.current)::after {
    content: "";
    display: block;
    height: 0;
}

.comparison-column.current {
    border-color: #bfd0ff;
    background: #f8fbff;
}

.current-result-badge,
.current-feedback-label {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #2864ed;
    font-size: 0.78rem;
    font-weight: 850;
    overflow-wrap: anywhere;
    white-space: normal;
}

.current-result-badge {
    margin-top: 8px;
    padding: 6px 9px;
}

.current-feedback-label {
    margin-top: 8px;
    padding: 5px 8px;
}

.comparison-column > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.comparison-column:not(.current) > p {
    margin-bottom: 36px;
}

.comparison-column h4 {
    margin: 8px 0 13px;
    font-size: 1rem;
    overflow-wrap: anywhere;
    min-height: 2.7em;
}

.comparison-score {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f7;
}

.comparison-score strong {
    color: #2f6dff;
    font-size: 2rem;
}

.comparison-score span {
    padding-bottom: 6px;
    color: var(--muted);
}

.comparison-stage-mini {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.comparison-stage-mini span,
.comparison-top-concepts p,
.comparison-feedback-summary p {
    color: var(--muted);
}

.comparison-stage-gauge {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 12px;
    background: var(--panel-soft);
}

.comparison-stage-gauge-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.comparison-stage-gauge-head strong {
    color: #111827;
    flex: 0 0 auto;
}

.comparison-stage-gauge-head span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.comparison-stage-gauge-track {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf6;
}

.comparison-stage-gauge-track i {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: #2f6dff;
}

.comparison-stage-gauge.previous .comparison-stage-gauge-track i {
    background: #d97818;
}

.comparison-stage-gauge.current .comparison-stage-gauge-track {
    background: #dfe8ff;
}

.comparison-stage-gauge.previous .comparison-stage-gauge-track {
    background: #f7eadc;
}

.comparison-radar-compare {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(220px, 1.1fr) auto;
    gap: 15px;
    align-items: center;
    min-width: 0;
    margin-top: 15px;
    padding: 16px;
    border: 1px solid #d8e3f7;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%);
}

.comparison-radar-compare p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.comparison-radar-compare-chart {
    min-width: 0;
    min-height: 230px;
    display: grid;
    place-items: center;
}

.comparison-radar-compare-chart .radar-svg {
    width: min(100%, 360px);
    height: auto;
}

.radar-shape-current {
    fill: rgba(47, 109, 255, 0.34);
    stroke: #2f6dff;
    stroke-width: 2.4;
}

.radar-shape-previous {
    fill: rgba(217, 120, 24, 0.18);
    stroke: #d97818;
    stroke-width: 2.2;
    stroke-dasharray: 5 4;
}

.radar-point-current {
    fill: #2f6dff;
    stroke: #ffffff;
    stroke-width: 1.5;
}

.radar-point-previous {
    fill: #d97818;
    stroke: #ffffff;
    stroke-width: 1.3;
}

.radar-compare-label {
    fill: #53627b;
    font-size: 10px;
    font-weight: 800;
}

.comparison-radar-legend {
    display: grid;
    gap: 8px;
}

.comparison-radar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.comparison-radar-legend i {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.comparison-radar-legend .current {
    background: #2f6dff;
}

.comparison-radar-legend .previous {
    background: #d97818;
}

.comparison-top-concepts,
.comparison-feedback-summary {
    margin-top: 14px;
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
}

.comparison-column:not(.current) .comparison-feedback-summary strong {
    margin-bottom: 33px;
}

.comparison-top-concepts p,
.comparison-feedback-summary p {
    margin: 7px 0 0;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: normal;
}

.comparison-delta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 11px;
    margin-top: 15px;
    min-width: 0;
}

.comparison-delta-card {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 13px;
    border-radius: 14px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
}

.comparison-delta-card span,
.comparison-delta-card small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.comparison-delta-card strong {
    font-size: 1.25rem;
}

.comparison-delta-card.good strong {
    color: #1d7d56;
}

.comparison-delta-card.mid strong {
    color: #8a6413;
}

.comparison-delta-card.low strong {
    color: var(--danger);
}

.summary-panel,
.summary-metric-card,
.comparison-result-item,
.comparison-column,
.comparison-delta-card,
.session-card,
.document-row,
.quiz-set-card {
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.summary-panel:hover,
.summary-metric-card:hover,
.comparison-column:hover,
.comparison-delta-card:hover {
    border-color: #bfccdf;
    box-shadow: 0 14px 34px rgba(42, 57, 88, 0.09);
}

.comparison-result-item:hover,
.session-card:hover,
.document-row:hover,
.quiz-set-card:hover {
    box-shadow: 0 0 0 1px rgba(47, 109, 255, 0.08), 0 8px 18px rgba(42, 57, 88, 0.06);
}

#workspace-view .document-row:hover,
#workspace-view .quiz-set-card:hover {
    transform: none;
    border-color: #2f6dff;
    background: #ffffff;
    box-shadow: none;
}

@media (min-width: 701px) {
    .auth-copy,
    .panel-header p,
    .home-card p,
    .workspace-subtitle,
    .message-content,
    .quiz-question,
    .quiz-explanation,
    .feedback-detail,
    .summary-copy,
    .summary-review-list p,
    .comparison-top-concepts p,
    .comparison-feedback-summary p {
        font-size: max(1rem, 19px);
    }
}

@media (max-width: 920px) {
    .auth-logo-lockup {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .auth-logo-mark {
        width: 82px;
        height: 82px;
        border-radius: 24px;
    }

    .auth-hero h1 {
        font-size: clamp(2.8rem, 12vw, 4.6rem);
        white-space: normal;
    }

    .quiz-result-dashboard .summary-top-metrics,
    .dashboard-grid,
    .comparison-layout,
    .comparison-radar-compare {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-rows: auto;
    }

    .dashboard-radar-panel,
    .dashboard-grid > .summary-column-stack,
    .dashboard-review-panel,
    .ai-final-feedback-card,
    .comparison-entry-card {
        grid-column: auto;
        grid-row: auto;
    }

    .comparison-screen-header {
        display: grid;
    }
}

@media (max-width: 700px) {
    body {
        font-size: 15px;
    }

    .auth-copy,
    .panel-header p,
    .home-card p,
    .workspace-subtitle,
    .message-content,
    .quiz-question,
    .quiz-explanation,
    .feedback-detail,
    .summary-copy,
    .summary-review-list p,
    .comparison-top-concepts p,
    .comparison-feedback-summary p {
        font-size: max(1rem, 15px);
    }
}

#auth-view.active {
    zoom: 1;
}

/* Workspace responsive correction */
#workspace-view .workspace-grid {
    grid-template-areas: "documents chat quiz";
    height: clamp(620px, calc(100vh - 168px), 900px);
}

#workspace-view .document-workspace-panel {
    grid-area: documents;
}

#workspace-view .chat-panel {
    grid-area: chat;
}

#workspace-view .quiz-workspace-panel {
    grid-area: quiz;
}

@media (min-width: 861px) and (max-width: 1240px) {
    #workspace-view .workspace-grid {
        grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
        grid-template-areas:
            "documents chat"
            "quiz chat";
        align-items: stretch;
        height: auto;
        min-height: 0;
    }

    #workspace-view .workspace-panel {
        height: auto;
        min-height: 0;
    }

    #workspace-view .chat-panel {
        min-height: 620px;
        height: clamp(620px, calc(100vh - 168px), 820px);
    }

    #workspace-view .document-list,
    #workspace-view .quiz-list {
        max-height: 320px;
    }
}

@media (max-width: 860px) {
    .app-shell {
        width: min(calc(100% - 16px), 720px);
        padding-top: 8px;
    }

    #workspace-view .workspace-brand {
        padding: 4px 2px 10px;
    }

    #workspace-view .workspace-topbar {
        min-height: 0;
        padding: 14px;
        gap: 12px;
    }

    #workspace-view .workspace-title-wrap {
        align-items: flex-start;
        gap: 10px;
    }

    #workspace-view .workspace-status {
        align-self: flex-start;
        margin-left: 0;
    }

    #workspace-view .workspace-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "documents"
            "chat"
            "quiz";
        gap: 12px;
        height: auto;
        min-height: 0;
        margin-top: 12px;
    }

    #workspace-view .workspace-panel {
        height: auto;
        min-height: 0;
        overflow: visible;
        padding: 14px;
    }

    #workspace-view .chat-panel {
        height: auto;
        min-height: 520px;
    }

    #workspace-view .message-list {
        min-height: 340px;
        max-height: 52vh;
    }

    #workspace-view .document-list,
    #workspace-view .quiz-list {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .app-shell {
        width: calc(100% - 10px);
    }

    #workspace-view .workspace-topbar h1 {
        font-size: 1.28rem;
    }

    #workspace-view .workspace-nav-button {
        justify-content: center;
        width: 100%;
    }

    #workspace-view .workspace-dropzone {
        min-height: 118px;
        padding: 14px;
    }

    #workspace-view .chat-panel {
        min-height: 460px;
    }

    #workspace-view .message-list {
        min-height: 280px;
    }
}

#workspace-view .document-workspace-panel {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

#workspace-view .document-workspace-panel .document-list {
    flex: none !important;
    overflow: visible !important;
    max-height: none !important;
}

#workspace-view .document-workspace-panel .upload-analysis-card {
    max-height: none !important;
    overflow: visible !important;
}

.upload-analysis-header-actions {
    flex-wrap: wrap;
    gap: 6px;
}

#exam-list-view {
    min-height: calc(100vh - 28px);
}

.exam-list-topbar {
    align-items: flex-start;
}

.exam-list-page {
    margin-top: 14px;
    padding: 26px 32px 40px;
    border: 1px solid var(--line);
    border-radius: 0 0 22px 22px;
    background: #f4f7f5;
}

.exam-year-section + .exam-year-section {
    margin-top: 30px;
}

.exam-year-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.exam-year-head h2 {
    margin: 0;
    color: #141a16;
    font-size: 1.35rem;
}

.exam-year-head span {
    color: #52605a;
    font-size: 0.88rem;
}

.exam-paper-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.exam-paper-card {
    display: grid;
    gap: 10px;
    min-height: 132px;
    padding: 20px;
    border: 1px solid #e1e8e3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(22, 30, 46, 0.04);
}

.exam-paper-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.exam-paper-meta span {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #eaf4ff;
    color: #285b88;
    font-size: 0.78rem;
    font-weight: 700;
}

.exam-paper-meta span:last-child {
    background: #e8f5ea;
    color: #20732f;
}

.exam-paper-card h3 {
    margin: 0;
    color: #111827;
    font-size: 1rem;
}

.exam-paper-card p {
    margin: 0;
    color: #5f6d68;
    font-size: 0.9rem;
}

.exam-paper-card button {
    justify-self: end;
    align-self: end;
    padding: 0;
    min-height: 30px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #1f7a32;
    font-weight: 800;
}

.exam-paper-card button:hover {
    transform: none;
    background: transparent;
    color: #145523;
    box-shadow: none;
}

.exam-question-media {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.exam-question-media img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

#quiz-view.exam-mock-active {
    min-height: calc(100vh - 28px);
}

#quiz-view.exam-mock-active .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -10px calc(50% - 50vw) 0;
    padding: 6px 18px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
}

#quiz-view.exam-mock-active .topbar h1 {
    font-size: 0.95rem;
    letter-spacing: 0;
}

#quiz-view.exam-mock-active .eyebrow {
    display: inline-flex;
    margin: 0 10px 0 0;
    padding: 6px 11px;
    border-radius: 999px;
    background: #fff1e8;
    color: #d56723;
    font-size: 0.78rem;
    letter-spacing: 0;
}

#quiz-view.exam-mock-active .workspace-subtitle {
    display: inline;
    margin: 0;
    color: #5f6673;
    font-size: 0.86rem;
}

.exam-top-timer {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    background: #edf8ef;
    color: #20732f;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.exam-top-progress {
    color: #344054;
    font-size: 0.88rem;
    font-weight: 700;
}

.exam-mock-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 322px;
    gap: 22px;
    width: min(1220px, 100%);
    margin: 24px auto 0;
    align-items: start;
}

.exam-mock-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.exam-question-card,
.exam-omr-panel {
    border: 1px solid #e3e7ed;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(22, 30, 46, 0.04);
}

.exam-question-card {
    min-height: 422px;
    padding: 28px;
}

.exam-question-head,
.exam-bottom-bar,
.exam-omr-head,
.exam-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.exam-subject-pill,
.exam-question-no {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
}

.exam-subject-pill {
    background: #edf8ef;
    color: #217533;
}

.exam-question-no {
    background: #f3f5f8;
    color: #596273;
}

.exam-report-button,
.exam-check-toggle {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    background: #ffffff;
    color: #4d5868;
    border-color: #dfe5ec;
    box-shadow: none;
    font-size: 0.82rem;
}

.exam-check-toggle.active {
    border-color: #f0c094;
    background: #fff3e8;
    color: #c45d19;
}

.exam-question-title {
    margin: 18px 0 20px;
    color: #161b22;
    font-size: 1.22rem;
    line-height: 1.55;
    letter-spacing: 0;
}

.exam-media-slot {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.exam-media-slot img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e3e7ed;
    border-radius: 8px;
}

.exam-options {
    display: grid;
    gap: 10px;
}

.exam-option-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 64px;
    padding: 12px 16px;
    border: 1px solid #dfe5ec;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
}

.exam-option-card:hover,
.exam-option-card.selected {
    border-color: #2d8438;
    background: #fbfffb;
}

.exam-option-card input {
    display: none;
}

.exam-option-no {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 34px;
    border-radius: 50%;
    background: #f1f3f5;
    color: #4d5868;
    font-weight: 850;
}

.exam-option-card.selected .exam-option-no {
    background: #2d8438;
    color: #ffffff;
}

.exam-review-option {
    cursor: default;
}

.exam-review-option.correct-answer {
    border-color: #2d8438;
    background: #edf8ef;
    color: #1f6f2c;
}

.exam-review-option.correct-answer .exam-option-no {
    background: #2d8438;
    color: #ffffff;
}

.exam-review-option.wrong-answer {
    border-color: #d86a2c;
    background: #fff3e8;
    color: #9f3f12;
}

.exam-review-option.wrong-answer .exam-option-no {
    background: #c7541f;
    color: #ffffff;
}

.exam-review-option.selected:not(.correct-answer) {
    box-shadow: 0 0 0 1px #c7541f inset;
}

.exam-option-text {
    display: flex;
    min-height: 28px;
    min-width: 0;
    align-items: center;
    color: #202631;
    line-height: 1.45;
}

.exam-option-image {
    display: block;
    width: auto;
    min-width: 72px;
    max-width: min(100%, 220px);
    min-height: 96px;
    max-height: 180px;
    object-fit: contain;
    image-rendering: auto;
}

.exam-review-feedback {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 10px;
    border-left: 4px solid #c7541f;
    background: #fff3e8;
    color: #4d2b1d;
    line-height: 1.65;
}

.exam-review-feedback.correct {
    border-left-color: #2d8438;
    background: #edf8ef;
    color: #1f4f28;
}

.exam-review-feedback strong,
.exam-review-feedback p {
    margin: 0;
}

.exam-review-feedback b {
    color: #1f7a32;
}

.exam-bottom-bar {
    color: #4d5868;
    font-size: 0.88rem;
}

.exam-nav-actions {
    display: flex;
    gap: 8px;
}

.exam-nav-actions button,
.exam-submit-bottom,
#exam-mock-submit-button,
#exam-mock-exit-button {
    border-radius: 9px;
    box-shadow: none;
}

.exam-next-button,
.exam-submit-bottom,
#exam-mock-submit-button {
    background: #2b8436;
}

.exam-omr-panel {
    position: sticky;
    top: 72px;
    overflow: hidden;
}

.exam-omr-head {
    padding: 16px 18px 10px;
}

.exam-legend {
    justify-content: flex-start;
    padding: 0 18px 14px;
    color: #5f6673;
    font-size: 0.78rem;
}

.exam-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.exam-legend i {
    width: 10px;
    height: 10px;
    border: 1px solid #d9e0e8;
    border-radius: 3px;
    background: #ffffff;
}

.exam-legend i.answered {
    border-color: #2b8436;
    background: #2b8436;
}

.exam-legend i.correct {
    border-color: #2b8436;
    background: #2b8436;
}

.exam-legend i.wrong {
    border-color: #d86a2c;
    background: #fff3e8;
}

.exam-legend i.flagged {
    border-color: #f1c49f;
    background: #fff3e8;
}

.exam-omr-list {
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    padding: 14px 18px;
    background: #f7f9f8;
}

.exam-omr-subject + .exam-omr-subject {
    margin-top: 16px;
}

.exam-omr-subject h3 {
    margin: 0 0 9px;
    color: #1f7a32;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.exam-omr-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
}

.exam-omr-button {
    display: grid;
    gap: 1px;
    min-height: 42px;
    padding: 5px 0;
    border: 1px solid #dfe5ec;
    border-radius: 6px;
    background: #ffffff;
    color: #344054;
    box-shadow: none;
    font-size: 0.72rem;
}

.exam-omr-button:hover,
.exam-omr-button.current {
    border-color: #2b8436;
    box-shadow: 0 0 0 1px #2b8436 inset;
    transform: none;
}

.exam-omr-button.answered strong {
    color: #2b8436;
}

.exam-omr-button.reviewed.correct {
    border-color: #2b8436;
    background: #edf8ef;
}

.exam-omr-button.reviewed.correct strong {
    color: #2b8436;
}

.exam-omr-button.reviewed.wrong {
    border-color: #d86a2c;
    background: #fff3e8;
}

.exam-omr-button.reviewed.wrong strong {
    color: #b64b18;
}

.exam-omr-button.reviewed.current {
    box-shadow: 0 0 0 2px #2b8436 inset;
}

.exam-omr-button.flagged {
    background: #fff8f1;
}

.exam-omr-button.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.exam-submit-bottom {
    width: calc(100% - 36px);
    margin: 12px 18px 14px;
}

@media (max-width: 980px) {
    .exam-paper-grid {
        grid-template-columns: 1fr;
    }

    .exam-paper-card:first-child {
        grid-column: auto;
    }

    .exam-list-page {
        padding: 20px 16px 30px;
    }

    .exam-mock-shell {
        grid-template-columns: 1fr;
        margin-top: 14px;
    }

    .exam-omr-panel {
        position: static;
    }

    .exam-omr-list {
        max-height: none;
    }

    #quiz-view.exam-mock-active .topbar {
        display: grid;
    }

    #quiz-view.exam-mock-active .topbar-actions {
        flex-wrap: wrap;
    }
}

/* Masstige-inspired visual refresh */
:root {
    --bg: #ffffff;
    --bg-2: #f4f4f2;
    --panel: #ffffff;
    --panel-solid: #ffffff;
    --panel-soft: #f4f4f2;
    --ink: #0b0b0b;
    --muted: #686864;
    --line: #e4e4e0;
    --line-strong: #bdbdb5;
    --accent: #ddff4f;
    --accent-soft: #f4ffc2;
    --success-soft: #edf8ef;
    --danger: #b3261e;
    --danger-soft: #fff0ed;
    --radius-xl: 14px;
    --radius-lg: 10px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --shadow: none;
}

body {
    color: var(--ink);
    background:
        linear-gradient(rgba(11, 11, 11, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 11, 11, 0.035) 1px, transparent 1px),
        var(--bg);
    background-size: 72px 72px;
    letter-spacing: 0;
}

button {
    min-height: 40px;
    border-radius: 8px;
    background: #0b0b0b;
    color: #ffffff;
    box-shadow: none;
}

button:hover {
    border-color: #0b0b0b;
    box-shadow: none;
    transform: translateY(-1px);
}

.secondary-button,
.icon-button,
.pagination-button,
.session-filter,
.exam-report-button,
.exam-check-toggle {
    background: #ffffff;
    color: #0b0b0b;
    border-color: var(--line);
}

.secondary-button:hover,
.icon-button:hover,
.pagination-button:hover,
.session-filter:hover {
    border-color: #0b0b0b;
    background: #f7f7f5;
}

.text-button {
    color: #0b0b0b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

input,
textarea,
select {
    border-radius: 8px;
    border-color: #d9d9d2;
    background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #0b0b0b;
    box-shadow: 0 0 0 3px rgba(221, 255, 79, 0.65);
}

.app-shell {
    width: min(1500px, calc(100% - 28px));
    padding-top: 14px;
}

.auth-hero,
.auth-panel,
.home-card,
.workspace-panel,
.topbar,
.dev-mode-panel,
.exam-question-card,
.exam-omr-panel {
    border-color: var(--line);
    border-radius: 14px;
    background: #ffffff;
    backdrop-filter: none;
    box-shadow: none;
}

.auth-layout {
    gap: 1px;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--line);
}

.auth-hero,
.auth-panel {
    border: 0;
    border-radius: 0;
}

.auth-hero {
    justify-content: flex-end;
    min-height: 620px;
    color: #ffffff;
    background:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 24px),
        linear-gradient(180deg, #171714 0%, #0b0b0b 100%);
}

.auth-logo-mark {
    width: clamp(74px, 7vw, 108px);
    height: clamp(74px, 7vw, 108px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    color: #0b0b0b;
    background: var(--accent);
    box-shadow: none;
}

.auth-hero .eyebrow,
.auth-copy {
    color: rgba(255, 255, 255, 0.68);
}

.auth-hero h1 {
    color: #ffffff;
    letter-spacing: 0;
}

.status-pill,
.mini-badge,
.workspace-status,
.exam-subject-pill,
.exam-paper-meta span,
.session-status {
    border-radius: 999px;
    border-color: rgba(11, 11, 11, 0.12);
    background: var(--accent);
    color: #0b0b0b;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    margin-bottom: 1px;
    border-radius: 14px 14px 0 0;
    background: rgba(11, 11, 11, 0.94);
    color: #ffffff;
}

.topbar .eyebrow,
.topbar .workspace-subtitle,
.topbar .user-summary {
    color: rgba(255, 255, 255, 0.62);
}

.topbar h1,
.workspace-topbar h1 {
    letter-spacing: 0;
}

.topbar .secondary-button {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
}

.topbar .secondary-button:hover {
    background: var(--accent);
    color: #0b0b0b;
    border-color: var(--accent);
}

.home-dashboard,
.exam-list-page {
    border-color: var(--line);
    background: #f7f7f5;
    box-shadow: none;
}

.stat-card,
.session-card,
.document-card,
.document-row,
.quiz-card,
.message-bubble,
.empty-box,
.quiz-solve-card,
.quiz-set-card,
.exam-paper-card,
.summary-panel,
.summary-metric-card,
.comparison-column,
.comparison-delta-card,
.comparison-result-item {
    border-radius: 10px;
    border-color: var(--line);
    background: #ffffff;
    box-shadow: none;
}

.stat-card {
    align-items: flex-start;
    min-height: 126px;
    border-top: 4px solid #0b0b0b;
}

.stat-card strong {
    color: #0b0b0b;
    font-size: 2rem;
    letter-spacing: 0;
}

.stat-icon,
.heading-icon,
.session-icon,
.recent-session-icon,
.document-row-icon,
.quiz-set-icon,
.workspace-title-icon,
.dropzone-icon {
    border-radius: 10px;
    background: var(--accent);
    color: #0b0b0b;
}

.stat-icon-blue,
.stat-icon-green,
.stat-icon-purple,
.stat-icon-orange {
    background: var(--accent);
    color: #0b0b0b;
}

.session-filter.active,
.pagination-button.active {
    color: #0b0b0b;
    border-color: var(--accent);
    background: var(--accent);
}

.card-kicker,
.eyebrow {
    color: #72726d;
    letter-spacing: 0.08em;
}

.new-study-card {
    border-top: 6px solid var(--accent);
}

.dashboard-submit,
.workspace-upload-button,
.workspace-quiz-button,
.quiz-next-button,
.exam-next-button,
.exam-submit-bottom,
#exam-mock-submit-button {
    background: var(--accent);
    color: #0b0b0b;
}

.dashboard-submit:hover,
.workspace-upload-button:hover,
.workspace-quiz-button:hover,
.quiz-next-button:hover,
.exam-next-button:hover,
.exam-submit-bottom:hover,
#exam-mock-submit-button:hover {
    background: #c9ef25;
    border-color: #0b0b0b;
}

.session-search-wrap,
.chat-form,
.workspace-dropzone,
.quiz-document-selection,
.upload-analysis-card {
    border-color: var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.workspace-dropzone {
    border-color: #bdbdb5;
    color: #55554f;
}

.workspace-dropzone.drag-over {
    border-color: #0b0b0b;
    background: var(--accent-soft);
    box-shadow: none;
}

.dropzone-file-name,
.analysis-toggle-button,
.document-analysis-button {
    color: #0b0b0b;
}

.analysis-toggle-button,
.document-analysis-button {
    border-color: #0b0b0b;
    background: #ffffff;
}

.analysis-toggle-button:hover,
.document-analysis-button:hover {
    background: var(--accent);
    border-color: #0b0b0b;
}

.workspace-brand {
    color: #0b0b0b;
    font-family: var(--font-display);
    font-size: 1.18rem;
}

.workspace-brand::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    border: 1px solid #0b0b0b;
}

.workspace-grid {
    gap: 1px;
    padding: 1px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--line);
}

#workspace-view .workspace-panel {
    border: 0;
    border-radius: 0;
}

#workspace-view .document-workspace-panel {
    border-radius: 13px 0 0 13px;
}

#workspace-view .quiz-workspace-panel {
    border-radius: 0 13px 13px 0;
}

.chat-panel {
    background: #ffffff;
}

.message-bubble.user {
    border-color: #0b0b0b;
    background: #0b0b0b;
    color: #ffffff;
}

.message-bubble.user .message-role,
.message-bubble.user .message-source {
    color: rgba(255, 255, 255, 0.62);
}

.message-bubble.assistant {
    border-color: #d7d7cf;
    background: #f7f7f5;
}

.document-row:hover,
.quiz-set-card:hover,
.session-card:hover,
.recent-session-item:hover,
.exam-paper-card:hover {
    border-color: #0b0b0b;
    box-shadow: none;
}

.document-row.selected,
.document-card.selected,
.exam-option-card.selected,
.exam-option-card:hover {
    border-color: #0b0b0b;
    background: #fbffe8;
}

.document-selected-indicator.active,
.exam-option-card.selected .exam-option-no,
.exam-review-option.correct-answer .exam-option-no {
    background: var(--accent);
    border-color: #0b0b0b;
    color: #0b0b0b;
}

.exam-list-page,
.exam-omr-list {
    background: #f7f7f5;
}

.exam-paper-card button,
.recent-all-button {
    color: #0b0b0b;
}

.exam-top-timer,
.exam-review-feedback.correct,
.exam-subject-pill {
    background: var(--accent-soft);
    color: #0b0b0b;
}

.exam-review-feedback {
    background: #fff0ed;
    color: #3d1f18;
}

.exam-omr-button:hover,
.exam-omr-button.current {
    border-color: #0b0b0b;
    box-shadow: 0 0 0 1px #0b0b0b inset;
}

.exam-omr-button.answered strong,
.exam-omr-subject h3 {
    color: #0b0b0b;
}

@media (max-width: 860px) {
    .topbar {
        position: static;
        border-radius: 14px;
    }

    #workspace-view .workspace-grid {
        padding: 0;
        border: 0;
        background: transparent;
    }

    #workspace-view .workspace-panel,
    #workspace-view .document-workspace-panel,
    #workspace-view .quiz-workspace-panel {
        border: 1px solid var(--line);
        border-radius: 14px;
    }
}

/* Console readability and less-internal labels */
.topbar {
    gap: 24px;
}

.topbar-actions {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar .user-summary {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.topbar .secondary-button {
    min-height: 36px;
    background: #ffffff;
    color: #111827;
    border-color: #ffffff;
}

.topbar .secondary-button:hover {
    background: #eef2f5;
    color: #111827;
    border-color: #eef2f5;
}

#home-view #exam-mock-button {
    background: #00c73c;
    color: #ffffff;
    border-color: #00c73c;
}

#home-view #exam-mock-button:hover {
    background: #00b336;
    border-color: #00b336;
}

.workspace-title-wrap {
    min-width: 0;
}

.workspace-title-wrap > div {
    min-width: 0;
}

.workspace-subtitle {
    color: #4c5967;
    font-weight: 600;
}

.topbar .workspace-subtitle {
    color: rgba(255, 255, 255, 0.78);
}

.workspace-status,
.session-status {
    font-weight: 700;
}

.session-meta {
    color: #6f7782;
}

@media (max-width: 700px) {
    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar .user-summary {
        max-width: 100%;
    }
}

/* Absolute final main icon alignment */
#home-view .stat-icon-green:has(img),
#home-view .new-study-heading .heading-icon:has(img) {
    overflow: hidden;
    border: 1px solid #bfead0;
    background: #e8f8ee;
    color: transparent;
}

#home-view .stat-icon-green:has(img) {
    padding: 10px;
}

#home-view .new-study-heading .heading-icon:has(img) {
    width: 28px;
    height: 28px;
    padding: 5px;
    flex: 0 0 28px;
}

#home-view .stat-icon-green img,
#home-view .new-study-heading .heading-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Restore main page icon treatment */
#home-view .dashboard-stats .stat-icon:has(img) {
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #050807 !important;
    color: transparent !important;
    padding: 8px !important;
}

#home-view .dashboard-stats .stat-icon img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

#home-view .new-study-heading .heading-icon:has(img) {
    width: 28px !important;
    height: 28px !important;
    padding: 5px !important;
    overflow: hidden !important;
    border: 1px solid #bfead0 !important;
    border-radius: 6px !important;
    background: #e8f8ee !important;
    color: transparent !important;
    flex: 0 0 28px !important;
}

/* Absolute final session list and workspace icon refinement */
#home-view .history-card .session-icon:has(img) {
    width: 38px !important;
    height: 38px !important;
    padding: 7px !important;
    overflow: hidden;
    border: 1px solid #d7e1e7 !important;
    border-radius: 6px !important;
    background: #eef3f6 !important;
    color: transparent !important;
}

#home-view .history-card .session-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#home-view .history-card .session-title {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
}

#home-view .history-card .session-meta {
    margin-top: 4px !important;
    color: #6f7782 !important;
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
}

#workspace-view .workspace-title-icon:has(img) {
    width: 34px !important;
    height: 34px !important;
    padding: 7px !important;
    overflow: hidden;
    border: 1px solid #bfead0 !important;
    border-radius: 6px !important;
    background: #e8f8ee !important;
    color: transparent !important;
    flex: 0 0 34px !important;
}

#workspace-view .workspace-title-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#workspace-view .document-selected-indicator {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
}

#workspace-view .document-selected-indicator svg {
    width: 15px;
    height: 15px;
}

/* Absolute final session list and workspace icon refinement */
#home-view .history-card .session-icon:has(img) {
    width: 38px;
    height: 38px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid #d7e1e7;
    border-radius: 6px;
    background: #eef3f6;
    color: transparent;
}

#home-view .history-card .session-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#home-view .history-card .session-title {
    font-size: 0.95rem;
    line-height: 1.3;
}

#home-view .history-card .session-meta {
    margin-top: 4px;
    color: #6f7782;
    font-size: 0.76rem;
    line-height: 1.35;
}

#workspace-view .workspace-title-icon:has(img) {
    width: 34px;
    height: 34px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid #bfead0;
    border-radius: 6px;
    background: #e8f8ee;
    color: transparent;
    flex: 0 0 34px;
}

#workspace-view .workspace-title-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#workspace-view .document-selected-indicator {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 6px;
}

#workspace-view .document-selected-indicator svg {
    width: 15px;
    height: 15px;
}

/* Session list and workspace icon refinement */
#home-view .history-card .session-icon:has(img) {
    width: 38px;
    height: 38px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid #d7e1e7;
    border-radius: 6px;
    background: #eef3f6;
    color: transparent;
}

#home-view .history-card .session-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#home-view .history-card .session-title {
    font-size: 0.95rem;
    line-height: 1.3;
}

#home-view .history-card .session-meta {
    margin-top: 4px;
    color: #6f7782;
    font-size: 0.76rem;
    line-height: 1.35;
}

#workspace-view .workspace-title-icon:has(img) {
    width: 34px;
    height: 34px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid #bfead0;
    border-radius: 6px;
    background: #e8f8ee;
    color: transparent;
    flex: 0 0 34px;
}

#workspace-view .workspace-title-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#workspace-view .document-selected-indicator {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 6px;
}

#workspace-view .document-selected-indicator svg {
    width: 15px;
    height: 15px;
}

/* Upload icon visual fit */
.workspace-dropzone .dropzone-icon:has(img) {
    width: 54px;
    height: 54px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.workspace-dropzone .dropzone-icon img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.stat-icon-green:has(img) {
    background: #e8f8ee;
}

.dashboard-submit img,
.workspace-upload-button img {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
}

/* Main page icon background fit */
#home-view .stat-icon-green:has(img),
#home-view .new-study-heading .heading-icon:has(img) {
    overflow: hidden;
    border: 1px solid #bfead0;
    background: #e8f8ee;
    color: transparent;
}

#home-view .stat-icon-green:has(img) {
    padding: 10px;
}

#home-view .new-study-heading .heading-icon:has(img) {
    width: 28px;
    height: 28px;
    padding: 5px;
    flex: 0 0 28px;
}

#home-view .stat-icon-green img,
#home-view .new-study-heading .heading-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Login logo icon */
.auth-logo-mark {
    padding: 7px;
    background: #ffffff;
    color: transparent;
}

.auth-logo-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Final custom icon sizing */
.stat-icon img,
.heading-icon img,
.session-icon img,
.recent-session-icon img,
.quiz-set-icon img,
.dropzone-icon img,
.message-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stat-icon:has(img),
.heading-icon:has(img),
.recent-session-icon:has(img),
.quiz-set-icon:has(img),
.dropzone-icon:has(img),
.message-avatar:has(img) {
    overflow: hidden;
    background: #050807;
    color: transparent;
}

.stat-icon:has(img) {
    padding: 8px;
}

.heading-icon:has(img),
.recent-session-icon:has(img),
.quiz-set-icon:has(img),
.message-avatar:has(img) {
    padding: 6px;
}

.dropzone-icon:has(img) {
    padding: 9px;
}

.dashboard-submit,
.workspace-upload-button,
.workspace-quiz-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dashboard-submit img,
.workspace-upload-button img,
.workspace-quiz-button img {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    object-fit: contain;
}

/* Custom PNG icons */
.stat-icon img,
.heading-icon img,
.session-icon img,
.recent-session-icon img,
.quiz-set-icon img,
.message-avatar img,
.workspace-quiz-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stat-icon:has(img),
.recent-session-icon:has(img),
.quiz-set-icon:has(img),
.message-avatar:has(img) {
    overflow: hidden;
    background: #050807;
    color: transparent;
}

.stat-icon:has(img) {
    padding: 8px;
}

.recent-session-icon:has(img),
.quiz-set-icon:has(img),
.message-avatar:has(img) {
    padding: 6px;
}

.workspace-quiz-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.workspace-quiz-button img {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.message-avatar:has(img) {
    border-color: #050807;
}

/* Dark header contrast fix */
.topbar,
.workspace-topbar {
    background: #0f1720;
    color: #ffffff;
}

.topbar h1,
.workspace-topbar h1,
.topbar .workspace-title-wrap h1,
#workspace-title,
#quiz-session-title {
    color: #ffffff;
    text-shadow: none;
}

.topbar .eyebrow {
    color: #7ee6a2;
}

.topbar .workspace-subtitle,
#workspace-subtitle,
#quiz-session-subtitle {
    color: #d5dde6;
}

.topbar .user-summary {
    background: #ffffff;
    color: #111827;
    border: 1px solid #ffffff;
}

.topbar .secondary-button {
    background: #ffffff;
    color: #111827;
    border-color: #ffffff;
    font-weight: 800;
}

.topbar .secondary-button:hover {
    background: #e6ebf0;
    color: #111827;
    border-color: #e6ebf0;
}

#home-view #exam-mock-button,
.topbar #exam-mock-button {
    background: #00c73c;
    color: #ffffff;
    border-color: #00c73c;
}

#home-view #logout-button,
#workspace-logout-button,
#quiz-logout-button,
#exam-list-logout-button {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.55);
}

#home-view #logout-button:hover,
#workspace-logout-button:hover,
#quiz-logout-button:hover,
#exam-list-logout-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffffff;
}

.workspace-title-icon {
    background: #00c73c;
    color: #ffffff;
}

.workspace-status {
    background: rgba(0, 199, 60, 0.16);
    border-color: rgba(0, 199, 60, 0.45);
    color: #8af0aa;
}

/* Enterprise portal correction: remove generated-looking hero treatment */
body {
    background: #f3f5f7;
    color: #1f2933;
}

#auth-view.active {
    place-items: start center;
    padding-top: 72px;
}

.auth-layout {
    width: min(100%, 980px);
    min-height: auto;
    grid-template-columns: 0.85fr 1fr;
    border-radius: 2px;
    box-shadow: 0 8px 24px rgba(31, 41, 51, 0.06);
}

.auth-hero {
    min-height: 520px;
    padding: 48px 42px;
    justify-content: flex-start;
    background: #17212c;
}

.auth-hero::after {
    display: none;
}

.auth-logo-lockup {
    display: block;
}

.auth-logo-mark {
    width: 42px;
    height: 42px;
    margin-bottom: 28px;
    border-radius: 2px;
}

.auth-logo-mark svg {
    width: 58%;
    height: 58%;
}

.auth-hero h1 {
    max-width: 420px;
    font-size: 2rem;
    line-height: 1.34;
    font-weight: 700;
}

.auth-copy {
    max-width: 420px;
    margin-top: 18px;
    font-size: 0.98rem;
    line-height: 1.75;
}

.status-pill {
    margin-top: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.86rem;
    font-weight: 600;
}

.status-pill::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #00c73c;
    vertical-align: 1px;
}

.status-pill.error {
    background: transparent;
    border: 0;
    color: #ffaaa3;
}

.status-pill.error::before {
    background: #ff6b5f;
}

.auth-panel {
    min-height: 520px;
    padding: 70px 64px;
    justify-content: flex-start;
}

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

.panel-header p {
    margin-top: 10px;
    max-width: 34ch;
    font-size: 0.94rem;
}

.stack {
    gap: 16px;
    margin-top: 28px;
}

label {
    gap: 7px;
    font-size: 0.88rem;
}

input,
textarea,
select {
    min-height: 44px;
    padding: 10px 12px;
}

#login-form button[type="submit"],
#signup-form button[type="submit"] {
    margin-top: 2px;
    width: 100%;
}

.auth-link-row {
    gap: 16px;
    margin-top: 20px;
}

.auth-link-row .text-button {
    min-height: auto;
    padding: 0;
    font-size: 0.9rem;
}

.topbar {
    min-height: 64px;
    padding: 0 28px;
}

.home-dashboard,
.exam-list-page {
    padding: 28px;
}

.home-card,
.workspace-panel,
.stat-card,
.exam-paper-card {
    border-radius: 2px;
}

.stat-card {
    min-height: 96px;
}

.stat-icon,
.heading-icon,
.session-icon,
.recent-session-icon,
.document-row-icon,
.quiz-set-icon,
.workspace-title-icon,
.dropzone-icon {
    border-radius: 2px;
}

@media (max-width: 860px) {
    #auth-view.active {
        padding-top: 16px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        width: calc(100% - 28px);
    }

    .auth-hero {
        min-height: auto;
        padding: 34px 28px;
    }

    .auth-logo-mark {
        margin-bottom: 22px;
    }

    .auth-hero h1 {
        font-size: 1.75rem;
    }

    .status-pill {
        margin-top: 28px;
    }

    .auth-panel {
        min-height: auto;
        padding: 34px 28px 40px;
    }
}

/* Ncloud-inspired enterprise refresh */
:root {
    --bg: #f5f7f8;
    --bg-2: #eef2f4;
    --panel: #ffffff;
    --panel-solid: #ffffff;
    --panel-soft: #f7f9fa;
    --ink: #1e2227;
    --muted: #6f7782;
    --line: #dfe4e8;
    --line-strong: #b9c2cc;
    --accent: #00c73c;
    --accent-soft: #e8f8ee;
    --success-soft: #e8f8ee;
    --danger: #d84235;
    --danger-soft: #fff0ee;
    --radius-xl: 6px;
    --radius-lg: 6px;
    --radius-md: 4px;
    --radius-sm: 4px;
    --shadow: 0 1px 2px rgba(20, 28, 36, 0.04);
}

body {
    color: var(--ink);
    background: var(--bg);
    background-image: none;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0;
}

.app-shell {
    width: min(1440px, 100%);
    padding: 0 24px 24px;
}

button {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 4px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: none;
}

button:hover {
    border-color: #00b336;
    background: #00b336;
    box-shadow: none;
    transform: none;
}

.secondary-button,
.icon-button,
.pagination-button,
.session-filter,
.exam-report-button,
.exam-check-toggle,
.analysis-toggle-button,
.document-analysis-button {
    background: #ffffff;
    color: #303741;
    border-color: #cfd7df;
}

.secondary-button:hover,
.icon-button:hover,
.pagination-button:hover,
.session-filter:hover,
.analysis-toggle-button:hover,
.document-analysis-button:hover {
    border-color: #9ca8b4;
    background: #f4f7f9;
    color: #1e2227;
}

.text-button {
    color: #2774c4;
    text-decoration: none;
}

.text-button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

input,
textarea,
select {
    min-height: 42px;
    border-radius: 4px;
    border-color: #cfd7df;
    background: #ffffff;
    font-size: 0.94rem;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 199, 60, 0.16);
}

.auth-layout {
    width: min(100%, 1120px);
    min-height: min(680px, calc(100vh - 48px));
    gap: 0;
    border: 1px solid #d8dee5;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 12px 36px rgba(30, 38, 48, 0.08);
}

.auth-hero,
.auth-panel,
.home-card,
.workspace-panel,
.topbar,
.dev-mode-panel,
.exam-question-card,
.exam-omr-panel,
.stat-card,
.session-card,
.document-card,
.document-row,
.quiz-card,
.message-bubble,
.empty-box,
.quiz-solve-card,
.quiz-set-card,
.exam-paper-card {
    border-radius: 6px;
    border-color: var(--line);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.auth-hero {
    position: relative;
    justify-content: center;
    min-height: 600px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(0, 199, 60, 0.12), transparent 42%),
        linear-gradient(180deg, #111827 0%, #17202b 100%);
}

.auth-hero::after {
    content: "";
    position: absolute;
    right: clamp(28px, 5vw, 76px);
    bottom: clamp(28px, 5vw, 74px);
    width: min(38%, 260px);
    aspect-ratio: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(90deg, rgba(0, 199, 60, 0.95) 0 18%, transparent 18%),
        linear-gradient(#263241 1px, transparent 1px),
        linear-gradient(90deg, #263241 1px, transparent 1px),
        rgba(255, 255, 255, 0.04);
    background-size: auto, 28px 28px, 28px 28px, auto;
    opacity: 0.9;
}

.auth-logo-mark {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    border: 0;
    color: #ffffff;
    background: var(--accent);
}

.auth-hero h1 {
    max-width: 720px;
    color: #ffffff;
    font-size: clamp(2rem, 3.8vw, 3.8rem);
    font-weight: 800;
    letter-spacing: 0;
}

.auth-hero .eyebrow,
.auth-copy {
    color: rgba(255, 255, 255, 0.72);
}

.auth-panel {
    border-left: 1px solid var(--line);
    padding: clamp(28px, 4vw, 52px);
}

.status-pill {
    border-radius: 4px;
    background: rgba(0, 199, 60, 0.14);
    border-color: rgba(0, 199, 60, 0.3);
    color: #2dd36f;
}

.status-pill.error {
    background: rgba(216, 66, 53, 0.12);
    border-color: rgba(216, 66, 53, 0.25);
    color: #ff8a80;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0 -24px;
    padding: 12px 24px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: #111827;
    color: #ffffff;
}

.topbar h1 {
    font-size: clamp(1.35rem, 2vw, 2rem);
    letter-spacing: 0;
}

.topbar .eyebrow,
.topbar .workspace-subtitle,
.topbar .user-summary {
    color: rgba(255, 255, 255, 0.62);
}

.topbar .secondary-button {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
    background: transparent;
}

.topbar .secondary-button:hover {
    color: #ffffff;
    border-color: var(--accent);
    background: rgba(0, 199, 60, 0.16);
}

.home-dashboard,
.exam-list-page {
    margin: 0 -24px;
    padding: 24px;
    border: 0;
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
}

.dashboard-stats,
.dashboard-columns,
.dashboard-side,
.workspace-grid,
.exam-paper-grid {
    gap: 12px;
}

.stat-card {
    min-height: 108px;
    padding: 18px;
    align-items: center;
    border-top: 0;
}

.stat-card strong {
    color: #111827;
    font-size: 1.75rem;
    font-weight: 800;
}

.stat-card p,
.stat-card span,
.panel-header p,
.home-card p,
.workspace-subtitle {
    color: var(--muted);
}

.stat-icon,
.heading-icon,
.session-icon,
.recent-session-icon,
.document-row-icon,
.quiz-set-icon,
.workspace-title-icon,
.dropzone-icon {
    border-radius: 6px;
    background: #eef3f6;
    color: #52606d;
}

.stat-icon-green,
.heading-icon,
.workspace-title-icon {
    background: var(--accent-soft);
    color: #009a2f;
}

.home-dashboard .home-card {
    border-radius: 6px;
}

.new-study-card {
    border-top: 3px solid var(--accent);
}

.card-kicker,
.eyebrow {
    color: #78838f;
    letter-spacing: 0.04em;
}

.mini-badge,
.workspace-status,
.session-status,
.exam-paper-meta span,
.exam-subject-pill {
    border-radius: 4px;
    border-color: #d6e9dc;
    background: var(--accent-soft);
    color: #008a2a;
}

.session-filter.active,
.pagination-button.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.dashboard-submit,
.workspace-upload-button,
.workspace-quiz-button,
.quiz-next-button,
.exam-next-button,
.exam-submit-bottom,
#exam-mock-submit-button {
    background: var(--accent);
    color: #ffffff;
}

.dashboard-submit:hover,
.workspace-upload-button:hover,
.workspace-quiz-button:hover,
.quiz-next-button:hover,
.exam-next-button:hover,
.exam-submit-bottom:hover,
#exam-mock-submit-button:hover {
    background: #00b336;
    border-color: #00b336;
}

.session-search-wrap,
.chat-form,
.workspace-dropzone,
.quiz-document-selection,
.upload-analysis-card {
    border-radius: 6px;
    border-color: var(--line);
    background: #ffffff;
}

.workspace-brand {
    padding: 14px 0;
    color: #111827;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.workspace-brand::before {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 2px;
    background: var(--accent);
}

.workspace-grid {
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

#workspace-view .workspace-panel,
#workspace-view .document-workspace-panel,
#workspace-view .quiz-workspace-panel {
    border: 1px solid var(--line);
    border-radius: 6px;
}

.workspace-dropzone {
    min-height: 132px;
    border-style: dashed;
    color: #697480;
    background: #f9fbfc;
}

.workspace-dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone-file-name {
    color: #008a2a;
}

.message-bubble.user {
    border-color: #d9e2ea;
    background: #f0f6ff;
    color: #1f354d;
}

.message-bubble.user .message-role,
.message-bubble.user .message-source {
    color: #65778b;
}

.message-bubble.assistant {
    border-color: #dce3e8;
    background: #ffffff;
}

.document-row:hover,
.quiz-set-card:hover,
.session-card:hover,
.recent-session-item:hover,
.exam-paper-card:hover {
    border-color: #9aa7b3;
}

.document-row.selected,
.document-card.selected,
.exam-option-card.selected,
.exam-option-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.document-selected-indicator.active,
.exam-option-card.selected .exam-option-no,
.exam-review-option.correct-answer .exam-option-no {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.exam-list-page,
.exam-omr-list {
    background: var(--bg);
}

.exam-paper-card button,
.recent-all-button {
    color: #008a2a;
}

.exam-top-timer,
.exam-review-feedback.correct,
.exam-subject-pill {
    background: var(--accent-soft);
    color: #008a2a;
}

.exam-review-feedback {
    border-radius: 6px;
    background: var(--danger-soft);
    color: #55302c;
}

.exam-omr-button:hover,
.exam-omr-button.current {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent) inset;
}

.exam-omr-button.answered strong,
.exam-omr-subject h3 {
    color: #008a2a;
}

#quiz-view.exam-mock-active .topbar {
    background: #111827;
    color: #ffffff;
}

#quiz-view.exam-mock-active .eyebrow {
    background: rgba(0, 199, 60, 0.16);
    color: #71e49a;
}

#quiz-view.exam-mock-active .workspace-subtitle {
    color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 860px) {
    .app-shell {
        width: 100%;
        padding: 0 14px 18px;
    }

    .auth-layout {
        margin: 14px 0;
        border-radius: 6px;
    }

    .auth-hero {
        min-height: 420px;
    }

    .auth-panel {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .topbar,
    .home-dashboard,
    .exam-list-page {
        margin-left: -14px;
        margin-right: -14px;
    }

    .topbar {
        position: static;
    }
}

/* Final main icon alignment */
#home-view .stat-icon-green:has(img),
#home-view .new-study-heading .heading-icon:has(img) {
    overflow: hidden;
    border: 1px solid #bfead0;
    background: #e8f8ee;
    color: transparent;
}

#home-view .stat-icon-green:has(img) {
    padding: 10px;
}

#home-view .new-study-heading .heading-icon:has(img) {
    width: 28px;
    height: 28px;
    padding: 5px;
    flex: 0 0 28px;
}

#home-view .stat-icon-green img,
#home-view .new-study-heading .heading-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Final topbar action readability override */
.topbar .topbar-actions {
    gap: 12px;
}

.topbar .user-summary {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #d5dde8;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
}

.topbar .secondary-button {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    border-color: #d5dde8;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
    text-decoration: none;
}

.topbar .secondary-button:hover {
    background: #f3f6fa;
    color: #111827;
    border-color: #aeb8c6;
    transform: none;
    box-shadow: none;
}

#home-view #exam-mock-button,
.topbar #exam-mock-button {
    min-width: 190px;
    background: #ffd84d;
    color: #111827;
    border-color: #e5b900;
}

#home-view #exam-mock-button:hover,
.topbar #exam-mock-button:hover {
    background: #f4c900;
    color: #111827;
    border-color: #c8a100;
}

#home-view #logout-button,
#workspace-logout-button,
#quiz-logout-button,
#exam-list-logout-button {
    background: #ffffff;
    color: #111827;
    border-color: #d5dde8;
}

#home-view #logout-button:hover,
#workspace-logout-button:hover,
#quiz-logout-button:hover,
#exam-list-logout-button:hover {
    background: #f3f6fa;
    color: #111827;
    border-color: #aeb8c6;
}

.topbar .user-summary::selection,
.topbar .secondary-button::selection {
    background: #111827;
    color: #ffffff;
}

@media (max-width: 700px) {
    .topbar .topbar-actions {
        align-items: stretch;
    }

    .topbar .user-summary,
    .topbar .secondary-button,
    #home-view #exam-mock-button,
    .topbar #exam-mock-button {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
}

/* Absolute final main icon alignment */
#home-view .stat-icon-green:has(img),
#home-view .new-study-heading .heading-icon:has(img) {
    overflow: hidden;
    border: 1px solid #bfead0;
    background: #e8f8ee;
    color: transparent;
}

#home-view .stat-icon-green:has(img) {
    padding: 10px;
}

#home-view .new-study-heading .heading-icon:has(img) {
    width: 28px;
    height: 28px;
    padding: 5px;
    flex: 0 0 28px;
}

#home-view .stat-icon-green img,
#home-view .new-study-heading .heading-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Final correction: keep only home session meta small and align title icons with stat icons. */
#home-view .dashboard-stats .stat-icon:has(img),
#home-view .new-study-heading .heading-icon:has(img),
#workspace-view .workspace-title-icon:has(img) {
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #050807 !important;
    color: transparent !important;
}

#home-view .dashboard-stats .stat-icon:has(img) {
    width: 52px !important;
    height: 52px !important;
    padding: 8px !important;
}

#home-view .new-study-heading .heading-icon:has(img),
#workspace-view .workspace-title-icon:has(img) {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 7px !important;
    flex: 0 0 38px !important;
}

#home-view .dashboard-stats .stat-icon img,
#home-view .new-study-heading .heading-icon img,
#workspace-view .workspace-title-icon img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

#home-view .history-card .session-title {
    font-size: 0.98rem !important;
    line-height: 1.35 !important;
}

#home-view .history-card .session-meta {
    margin-top: 4px !important;
    color: #6f7782 !important;
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
}

#workspace-view .session-meta,
#workspace-view .workspace-subtitle,
#quiz-view .workspace-subtitle {
    font-size: inherit;
}

/* Login logo fit only */
#auth-view .auth-logo-mark {
    width: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: transparent !important;
}

#auth-view .auth-logo-mark img {
    display: block !important;
    width: 56px !important;
    height: 56px !important;
    object-fit: contain !important;
}

/* Final typography scope and login logo frame correction */
#home-view .dashboard-stats .stat-card p,
#home-view .dashboard-stats .stat-card span {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
}

#home-view .dashboard-stats .stat-card strong {
    font-size: 1.7rem !important;
    line-height: 1 !important;
}

#home-view .dashboard-side .home-card p:not(.card-kicker),
#home-view .new-study-card > p,
#home-view .recent-card p:not(.card-kicker) {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

#home-view .card-kicker {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
}

#home-view .home-card h2 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
}

#home-view .history-card .session-title {
    font-size: 0.98rem !important;
    line-height: 1.35 !important;
}

#home-view .history-card .session-meta {
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
}

#workspace-view .workspace-subtitle,
#quiz-view .workspace-subtitle {
    font-size: 0.84rem !important;
    line-height: 1.6 !important;
}

#auth-view .auth-logo-mark {
    width: 64px !important;
    height: 64px !important;
    padding: 8px !important;
    border: 1px solid rgba(95, 211, 255, 0.45) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
}

#auth-view .auth-logo-mark img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
}

/* Final topbar vertical alignment correction */
#exam-list-view .exam-list-topbar {
    align-items: center !important;
}

#exam-list-view .exam-list-topbar .topbar-actions {
    align-items: center !important;
    align-self: center !important;
}

/* Final stat card label balance */
#home-view .dashboard-stats .stat-card {
    align-items: center !important;
}

#home-view .dashboard-stats .stat-card > div:last-child {
    display: flex !important;
    min-height: 52px !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 5px !important;
}

#home-view .dashboard-stats .stat-card p {
    color: #3f4752 !important;
    font-size: 0.86rem !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
}

#home-view .dashboard-stats .stat-card strong {
    margin: 0 !important;
    color: #111827 !important;
    font-size: 1.45rem !important;
    font-weight: 850 !important;
    line-height: 1.05 !important;
}

#home-view .dashboard-stats .stat-card strong small {
    font-size: 0.76rem !important;
    font-weight: 750 !important;
}

#home-view .dashboard-stats .stat-card > div:last-child > span {
    color: #697380 !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
}

/* Final home stat typography and status badge balance */
#home-view .dashboard-stats .stat-card {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    min-height: 112px !important;
    padding: 18px 20px !important;
}

#home-view .dashboard-stats .stat-card > div:last-child {
    display: grid !important;
    gap: 4px !important;
    align-content: center !important;
}

#home-view .dashboard-stats .stat-card p,
#home-view .dashboard-stats .stat-card strong,
#home-view .dashboard-stats .stat-card span {
    margin: 0 !important;
}

#home-view .dashboard-stats .stat-card p,
#home-view .dashboard-stats .stat-card span {
    color: #5f6875 !important;
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    font-weight: 500 !important;
}

#home-view .dashboard-stats .stat-card strong {
    color: #111827 !important;
    font-size: 1.7rem !important;
    line-height: 1 !important;
    font-weight: 800 !important;
}

#workspace-view .workspace-status {
    display: inline-flex !important;
    min-height: 28px !important;
    align-items: center !important;
    margin-left: 14px !important;
    padding: 0 12px !important;
    border: 1px solid rgba(126, 230, 162, 0.42) !important;
    border-radius: 6px !important;
    background: rgba(126, 230, 162, 0.1) !important;
    color: #7ee6a2 !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

#home-view .history-card .session-status {
    padding: 3px 7px !important;
    border: 1px solid #cce8d5 !important;
    border-radius: 5px !important;
    background: #eef8f1 !important;
    color: #16803a !important;
    font-size: 0.66rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
}

/* Final login logo frame fill */
#auth-view .auth-logo-mark {
    width: 64px !important;
    height: 64px !important;
    padding: 8px !important;
    border: 1px solid rgba(70, 204, 235, 0.55) !important;
    border-radius: 12px !important;
    background: #000000 !important;
    box-shadow: none !important;
}

#auth-view .auth-logo-mark img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
}

/* Absolute final home stat label spacing correction */
#home-view .dashboard-stats .stat-card > div:last-child {
    display: flex !important;
    min-height: 52px !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 3px !important;
}

#home-view .dashboard-stats .stat-card p,
#home-view .dashboard-stats .stat-card > div:last-child > span {
    margin: 0 !important;
    font-size: 0.82rem !important;
    line-height: 1.15 !important;
}

#home-view .dashboard-stats .stat-card strong {
    display: flex !important;
    align-items: baseline !important;
    gap: 2px !important;
    margin: 0 !important;
    font-size: 1.18rem !important;
    line-height: 1.12 !important;
}

#home-view .dashboard-stats .stat-card strong span,
#home-view .dashboard-stats .stat-card strong small {
    margin: 0 !important;
    line-height: 1 !important;
}
