:root {
    --mint: #a8efd0;
    --mint-dark: #22b873;
    --purple: #7b48d9;
    --purple-soft: #eee7ff;
    --yellow: #fff0a8;
    --yellow-dark: #f4b400;
    --pink: #ff5b93;
    --blue: #2f80ed;
    --ink: #25213b;
    --muted: #6d6a80;
    --line: #dcefe5;
    --bg: #f5fff9;
    --card: #ffffff;
    --danger: #e74c3c;
    --shadow: 0 16px 38px rgba(88, 73, 140, .14);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Pretendard", "Noto Sans KR", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(168, 239, 208, .38), transparent 32rem),
        radial-gradient(circle at top right, rgba(238, 231, 255, .58), transparent 28rem),
        linear-gradient(180deg, #f9fff9 0%, #fbf8ff 100%);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.auth-body { display: grid; place-items: center; padding: 28px; }
.auth-wrap { width: min(1100px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: stretch; }
.hero-card, .auth-card, .panel, .menu-card, .study-card, .profile-card, .pack-card, .chapter-card {
    background: rgba(255, 255, 255, .92);
    border: 2px solid rgba(168, 239, 208, .95);
    border-radius: 28px;
    box-shadow: var(--shadow);
}
.hero-card { padding: 42px; min-height: 560px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; position: relative; }
.hero-card::after { content: "✦ ✧ ✦"; position: absolute; right: 38px; top: 30px; color: var(--yellow-dark); font-size: 40px; opacity: .8; }
.hero-card h1 { margin: 10px 0 14px; font-size: clamp(44px, 6vw, 72px); line-height: 1.05; color: var(--purple); text-shadow: 3px 3px 0 var(--yellow); }
.hero-card p { font-size: 20px; line-height: 1.65; color: var(--muted); max-width: 540px; }
.mascot-bubble { width: 110px; height: 110px; border-radius: 36px; display: grid; place-items: center; font-size: 58px; background: linear-gradient(145deg, var(--mint), var(--purple-soft)); border: 3px solid #fff; box-shadow: var(--shadow); }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pill-row span, .badge { background: #fff8cc; border: 1px solid #ffe484; color: #6e4b00; border-radius: 999px; padding: 8px 14px; font-weight: 700; }

.auth-card { padding: 28px; }
.auth-card.wide { max-width: 760px; margin: auto; }
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
pre { white-space: pre-wrap; background: #f7f3ff; border-radius: 16px; padding: 14px; overflow: auto; }
.tab-buttons { display: flex; padding: 6px; background: #f3f0ff; border-radius: 18px; margin-bottom: 22px; }
.tab-button { flex: 1; border: 0; border-radius: 14px; padding: 13px; background: transparent; color: var(--muted); font-weight: 800; }
.tab-button.active { background: #fff; color: var(--purple); box-shadow: 0 8px 20px rgba(123, 72, 217, .16); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
label { display: block; font-weight: 800; margin: 14px 0 7px; }
input, select { width: 100%; border: 2px solid #dce8e1; border-radius: 16px; padding: 13px 14px; background: #fff; outline: none; transition: .15s; }
input:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 4px rgba(34, 184, 115, .12); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.primary-button, .soft-button, .danger-button, .link-button { border: 0; border-radius: 16px; padding: 12px 16px; font-weight: 900; }
.primary-button { background: linear-gradient(135deg, var(--mint-dark), #15c5a5); color: #fff; width: 100%; margin-top: 18px; box-shadow: 0 12px 22px rgba(34, 184, 115, .25); }
.soft-button { background: #f2eeff; color: var(--purple); border: 1px solid #d9ccff; }
.danger-button { background: #ffe9e7; color: var(--danger); border: 1px solid #ffc2bd; margin-top: 14px; }
.link-button { background: transparent; color: var(--purple); padding: 7px 8px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.message-box, .notice { margin-top: 14px; border-radius: 16px; padding: 12px 14px; display: none; }
.message-box.show, .notice { display: block; }
.notice.success, .message-box.success { background: #e9fff4; border: 1px solid #9be7c2; color: #14683d; }
.notice.danger, .message-box.danger { background: #fff0ef; border: 1px solid #ffc3bd; color: #a83125; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: rgba(255,255,255,.86); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(168,239,208,.5); }
.brand { display: inline-flex; align-items: center; gap: 0; font-weight: 1000; font-size: 22px; color: var(--purple); line-height: 1; }
.brand-mark { width: 42px; height: 42px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(145deg, var(--mint), var(--yellow)); color: var(--purple); box-shadow: var(--shadow); }
.brand-logo {
    display: block;
    width: auto;
    height: 48px;
    max-width: 165px;
    object-fit: contain;
}

.topnav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topnav a { padding: 9px 12px; border-radius: 14px; font-weight: 800; color: var(--ink); }
.topnav a:hover { background: var(--purple-soft); color: var(--purple); }
.page-shell { width: min(1280px, calc(100% - 34px)); margin: 0 auto; padding: 28px 0 60px; }
.dashboard-hero { display: grid; grid-template-columns: 1.5fr .7fr; gap: 20px; align-items: stretch; margin-bottom: 22px; }
.dashboard-hero > div:first-child { padding: 34px; border-radius: 30px; background: linear-gradient(135deg, rgba(168,239,208,.8), rgba(238,231,255,.8)); border: 2px solid #fff; box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: var(--mint-dark); font-weight: 1000; letter-spacing: .05em; text-transform: uppercase; }
h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; }
h2 { margin: 0 0 12px; font-size: 24px; }
.profile-card { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.profile-card strong { font-size: 22px; color: var(--purple); }
.menu-grid, .chapter-grid, .pack-grid, .admin-grid, .stats-grid { display: grid; gap: 18px; }
.menu-grid { grid-template-columns: repeat(3, 1fr); margin: 22px 0; }
.menu-card { padding: 26px; transition: .18s; position: relative; overflow: hidden; }
.menu-card:hover, .chapter-card:hover, .pack-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(88, 73, 140, .18); }
.menu-card.mint { border-color: var(--mint); }
.menu-card.purple { border-color: #d7c9ff; }
.menu-card.yellow { border-color: #ffe58d; }
.card-icon { font-size: 44px; }
.panel { padding: 24px; margin-bottom: 20px; }
.section-title, .page-title-row, .study-header, .search-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-title-row { margin-bottom: 20px; }
.history-list { display: grid; gap: 10px; }
.history-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 16px; background: #fbfffd; border: 1px solid var(--line); }

.chapter-grid { grid-template-columns: repeat(4, 1fr); }
.chapter-card, .pack-card { overflow: hidden; cursor: pointer; }
.chapter-card img { width: 100%; height: 190px; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.chapter-card .body, .pack-card { padding: 18px; }
.chapter-card p, .pack-card p { color: var(--muted); line-height: 1.55; }
.pack-grid { grid-template-columns: repeat(4, 1fr); }
.pack-card h2 { color: var(--purple); }
.study-modal { position: fixed; inset: 0; z-index: 20; background: rgba(37, 33, 59, .42); display: grid; place-items: center; padding: 24px; }
.study-modal.hidden, .hidden { display: none !important; }
.study-card { width: min(980px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 24px; position: relative; }
.study-card.large { width: min(1180px, 100%); }
.close-button { position: absolute; right: 18px; top: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff0ef; color: var(--danger); font-size: 24px; font-weight: 900; }
.grammar-image { width: 100%; border-radius: 22px; border: 1px solid var(--line); margin: 14px 0 20px; }
.quiz-box { display: grid; gap: 14px; }
.question-card { background: #fbfffd; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.question-row { display: grid; grid-template-columns: 1fr 220px; gap: 12px; align-items: center; }
.result-good { color: var(--mint-dark); font-weight: 900; }
.result-bad { color: var(--danger); font-weight: 900; }
.mode-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-buttons .active { background: var(--purple); color: #fff; }
.flip-card { min-height: 260px; display: grid; place-items: center; background: linear-gradient(145deg, #ffffff, #f7fff9); border: 2px solid var(--mint); border-radius: 28px; text-align: center; cursor: pointer; user-select: none; }
.flip-card .main-word { font-size: 56px; color: var(--purple); font-weight: 1000; }
.flip-card .meaning { font-size: 44px; color: var(--mint-dark); font-weight: 1000; }
.study-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; flex-wrap: wrap; }
.option-grid, .letter-grid, .memory-grid { display: grid; gap: 10px; margin-top: 16px; }
.option-grid { grid-template-columns: repeat(2, 1fr); }
.option-button, .letter-button, .memory-card { border: 2px solid #e3ddff; border-radius: 16px; padding: 14px; background: #fff; font-weight: 900; }
.option-button:hover, .letter-button:hover { border-color: var(--purple); color: var(--purple); }
.letter-grid { grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); }
.answer-line { min-height: 48px; padding: 12px; border-radius: 14px; background: #f8f4ff; border: 1px dashed #cabaff; font-size: 24px; letter-spacing: 4px; }
.memory-grid { grid-template-columns: repeat(4, 1fr); }
.memory-card { min-height: 80px; display: grid; place-items: center; }
.memory-card.matched { background: #e9fff4; border-color: var(--mint-dark); color: var(--mint-dark); }
.leaderboard { padding: 16px; border-radius: 18px; border: 1px solid #d7c9ff; background: #fbf8ff; margin: 12px 0; }
.leaderboard-row { display: grid; grid-template-columns: 60px 1fr 120px; gap: 10px; padding: 10px; border-bottom: 1px solid #ece6ff; }

.search-row input { flex: 1; }
.search-row .primary-button { width: auto; margin: 0; }
.dict-list { display: grid; gap: 12px; margin-top: 18px; }
.dict-item { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfffd; }
.dict-main { display: grid; gap: 10px; }
.dict-word-row { display: flex; align-items: center; gap: 10px; }
.dict-item h3 { margin: 0; color: var(--purple); font-size: 28px; }
.dict-example-box { margin-top: 8px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid #d9f4e7; }
.dict-example-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--mint-dark); font-weight: 1000; }
.dict-example { margin: 10px 0 6px; font-size: 18px; }
.dict-translation { margin: 0; color: #4a4b65; font-weight: 800; }
.speaker-button { border: 0; border-radius: 50%; width: 44px; height: 44px; background: #f0fff7; color: var(--mint-dark); font-size: 20px; cursor: pointer; }
.mini-speak-button { width: auto; height: auto; border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 1000; }
.buzzer-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 18px; }
.buzzer-panel { display: grid; place-items: center; padding: 28px; border-radius: 28px; background: #fff; border: 2px solid var(--mint); box-shadow: var(--shadow); }
.buzzer-button { width: 260px; height: 260px; border-radius: 50%; border: 10px solid #fff; background: radial-gradient(circle at 35% 30%, #fffbce, var(--yellow-dark)); color: #fff; font-size: 50px; font-weight: 1000; text-shadow: 0 4px 0 rgba(0,0,0,.16); box-shadow: 0 22px 0 #c68200, 0 24px 42px rgba(244,180,0,.35); }
.buzzer-button:active { transform: translateY(10px); box-shadow: 0 12px 0 #c68200, 0 14px 32px rgba(244,180,0,.3); }
.buzzer-list { display: grid; gap: 10px; padding-left: 24px; }
.buzzer-list li { background: #fbfffd; border: 1px solid var(--line); border-radius: 16px; padding: 14px; font-weight: 900; }
.admin-grid { grid-template-columns: repeat(2, 1fr); }
.admin-grid form { display: grid; gap: 10px; }
hr { border: 0; border-top: 1px dashed #d7c9ff; margin: 18px 0; }
.stats-grid { grid-template-columns: repeat(3, 1fr); }
.stat-card { padding: 16px; border-radius: 18px; background: #fbfffd; border: 1px solid var(--line); }
.stat-card strong { display: block; font-size: 28px; color: var(--purple); }

@media (max-width: 1000px) {
    .auth-wrap, .dashboard-hero, .buzzer-layout { grid-template-columns: 1fr; }
    .menu-grid, .chapter-grid, .pack-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .menu-grid, .chapter-grid, .pack-grid, .admin-grid, .stats-grid, .option-grid { grid-template-columns: 1fr; }
    .topbar, .page-title-row, .section-title, .study-header { align-items: flex-start; flex-direction: column; }
    .form-grid-2, .form-grid-3, .question-row { grid-template-columns: 1fr; }
    .buzzer-button { width: 210px; height: 210px; font-size: 40px; }
}

/* Grammo menu/page character images */
.menu-card .image-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 128px;
    margin-bottom: 14px;
    font-size: 0;
    line-height: 0;
}

.menu-card .image-icon img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 128px;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(88, 73, 140, .18));
    transition: transform .18s ease;
}

.menu-card:hover .image-icon img {
    transform: translateY(-4px) scale(1.035);
}

.page-title-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.page-title-main > div {
    min-width: 0;
}

.page-title-mascot {
    width: 82px;
    height: 82px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 10px 16px rgba(88, 73, 140, .16));
}

@media (max-width: 1000px) {
    .menu-card .image-icon { min-height: 110px; }
    .menu-card .image-icon img { height: 110px; }
    .page-title-mascot { width: 72px; height: 72px; }
}

@media (max-width: 640px) {
    .page-title-main {
        align-items: flex-start;
    }
    .menu-card .image-icon { min-height: 96px; }
    .menu-card .image-icon img { height: 96px; }
    .page-title-mascot { width: 64px; height: 64px; }
}

/* Grammo top-left logo */
@media (max-width: 640px) {
    .topbar { padding: 8px 12px; }
    .brand-logo {
        width: auto;
        height: 42px;
        max-width: 145px;
    }
}

/* Buzzer 6-team mode */
.team-legend-wrap {
    margin-bottom: 18px;
}

.team-legend {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 12px;
}

.team-card {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 18px;
    border: 2px solid var(--line);
    background: #fff;
    text-align: center;
}

.team-card img {
    width: 78px;
    height: 78px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(88, 73, 140, .18));
}

.team-card strong {
    font-size: 14px;
    color: var(--ink);
}

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

.team-card.team-blue,
.team-badge.team-blue,
.my-team-info.team-blue { border-color: #63a8ff; background: #eef6ff; color: #1264c8; }
.team-card.team-yellow,
.team-badge.team-yellow,
.my-team-info.team-yellow { border-color: #ffd74f; background: #fff9d9; color: #9b6d00; }
.team-card.team-mint,
.team-badge.team-mint,
.my-team-info.team-mint { border-color: #8cebd2; background: #ecfff9; color: #087c65; }
.team-card.team-pink,
.team-badge.team-pink,
.my-team-info.team-pink { border-color: #ff91c6; background: #fff0f8; color: #c62072; }
.team-card.team-green,
.team-badge.team-green,
.my-team-info.team-green { border-color: #99df52; background: #f1ffe8; color: #427b00; }
.team-card.team-red,
.team-badge.team-red,
.my-team-info.team-red { border-color: #ff7d70; background: #fff0ee; color: #c72c20; }

.buzzer-button.image-buzzer {
    width: 280px;
    height: 240px;
    border: 0;
    border-radius: 34px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: grid;
    place-items: center;
    overflow: visible;
}

.buzzer-button.image-buzzer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 24px rgba(88, 73, 140, .24));
    transition: transform .12s ease, filter .12s ease;
}

.buzzer-button.image-buzzer:hover img {
    transform: translateY(-4px) scale(1.03);
    filter: drop-shadow(0 24px 30px rgba(88, 73, 140, .28));
}

.buzzer-button.image-buzzer:active {
    transform: none;
    box-shadow: none;
}

.buzzer-button.image-buzzer:active img {
    transform: translateY(9px) scale(.97);
    filter: drop-shadow(0 9px 14px rgba(88, 73, 140, .22));
}

.my-team-info {
    margin: 8px 0 0;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fbfffd;
    font-weight: 900;
    text-align: center;
}

.buzzer-list {
    padding-left: 0;
    list-style: none;
}

.buzzer-hit-row {
    display: grid;
    grid-template-columns: 46px auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.hit-order {
    font-size: 18px;
    color: var(--purple);
    font-weight: 1000;
}

.team-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 2px solid var(--line);
    font-size: 13px;
    font-weight: 1000;
}

.hit-user {
    min-width: 0;
}

@media (max-width: 1000px) {
    .team-legend { grid-template-columns: repeat(3, 1fr); }
    .buzzer-hit-row { grid-template-columns: 42px 1fr; }
    .buzzer-hit-row .muted { grid-column: 2; }
}

@media (max-width: 640px) {
    .team-legend { grid-template-columns: repeat(2, 1fr); }
    .buzzer-button.image-buzzer { width: 240px; height: 210px; }
}

/* 선생님 페이지: Word Pack 선택 UI */
.compact-title {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.compact-title h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.field-label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 800;
    color: var(--ink);
}

.small-help {
    font-size: 13px;
    margin: -4px 0 12px;
}

.small-button {
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
}


.word-example {
    margin: 14px 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
}

.word-translation {
    margin: 0;
    font-size: 16px;
    color: var(--muted);
}

/* Class Pack / 학생 정보 수정 */
.profile-edit-form {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.profile-edit-form label {
    margin: 8px 0 5px;
    font-size: 13px;
}
.profile-edit-form input,
.profile-edit-form select {
    padding: 10px 12px;
    border-radius: 13px;
}
.profile-save-button {
    width: 100%;
    margin-top: 10px;
}
.compact-form-grid {
    gap: 8px;
}
.small-help {
    margin: 6px 0 10px;
}
.field-label {
    margin-top: 10px;
}
select:focus {
    border-color: var(--mint-dark);
    box-shadow: 0 0 0 4px rgba(34, 184, 115, .12);
}

/* Word Pack memory game */
.memory-setup { display: grid; gap: 18px; }
.memory-size-box { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.memory-size-box label { display: grid; gap: 8px; font-weight: 900; color: var(--ink); }
.memory-size-box select { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 16px; background: #fff; }
.memory-size-info { grid-column: 1 / -1; padding: 12px 14px; border-radius: 16px; background: #fbfffd; border: 1px solid var(--line); }
.memory-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.memory-score-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.memory-game-scroll { overflow: auto; max-height: min(62vh, 680px); padding: 4px; }
.memory-grid-dynamic { min-width: 620px; }
.memory-grid-dynamic .memory-card { min-height: 58px; padding: 8px; font-size: 15px; line-height: 1.25; word-break: keep-all; }
.memory-card.blind { background: linear-gradient(145deg, #ffffff, #f5f1ff); color: var(--purple); }
.memory-card.active { background: #fffaf0; border-color: var(--yellow-dark); color: var(--ink); }
.memory-card.matched { background: #e9fff4; border-color: var(--mint-dark); color: var(--mint-dark); }
.memory-number { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #eee8ff; color: var(--purple); font-weight: 1000; }

@media (max-width: 720px) {
    .memory-size-box { grid-template-columns: 1fr; }
    .memory-grid-dynamic { min-width: 520px; }
}


/* Teacher pack edit UI */
.pack-edit-list {
    display: grid;
    gap: 12px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}
.pack-edit-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfffd;
}
.pack-edit-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #5a5b76;
    font-size: 13px;
}
.pack-edit-card label {
    display: grid;
    gap: 6px;
    font-weight: 900;
    color: #25243d;
}
.pack-edit-card input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 11px;
    font: inherit;
    background: #fff;
}

/* Teacher pack edit UI v2: left list + selected editor */
.pack-edit-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
}
.pack-manager {
    display: grid;
    grid-template-columns: minmax(190px, .85fr) minmax(260px, 1.45fr);
    gap: 14px;
    align-items: start;
}
.pack-manager-list {
    display: grid;
    gap: 8px;
    max-height: 310px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfffd;
}
.pack-select-item {
    width: 100%;
    min-height: 62px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.pack-select-item:hover {
    transform: translateY(-1px);
    border-color: var(--purple-light);
    box-shadow: 0 8px 18px rgba(88, 73, 140, .10);
}
.pack-select-item.active {
    border-color: var(--purple);
    background: #f3edff;
    box-shadow: inset 0 0 0 1px rgba(126, 75, 229, .24);
}
.pack-select-item strong,
.pack-select-item span {
    display: block;
}
.pack-select-item strong {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 1000;
}
.pack-select-item span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}
.pack-manager-editor .pack-edit-card {
    margin: 0;
}
.selected-pack-editor {
    min-height: 100%;
}
.pack-empty-message {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfffd;
}
@media (max-width: 900px) {
    .pack-manager {
        grid-template-columns: 1fr;
    }
    .pack-manager-list {
        max-height: 240px;
    }
}

.pack-editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.pack-editor-actions .soft-button,
.pack-editor-actions .danger-button {
    width: 100%;
    margin-top: 0;
}
@media (max-width: 640px) {
    .pack-editor-actions {
        grid-template-columns: 1fr;
    }
}


/* Grammar dialogue learning UI */
.grammar-view-buttons {
    justify-content: flex-end;
}
.chapter-dialogue-button {
    margin-top: 12px;
}
.grammar-dialogue {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}
.dialogue-progress {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 18px;
    background: #fbfffd;
    border: 1px solid var(--line);
}
.dialogue-progress-track {
    height: 10px;
    border-radius: 999px;
    background: #eee8ff;
    overflow: hidden;
}
.dialogue-progress-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--mint-dark), var(--purple));
}
.grammo-chat-stage {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(168, 239, 208, .35), rgba(238, 231, 255, .42));
    border: 1px solid var(--line);
}
.grammo-character-wrap {
    position: relative;
    display: grid;
    place-items: center;
}
.grammo-character {
    width: min(180px, 100%);
    max-height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(88, 73, 140, .18));
    animation: grammoFloatSmall 3s ease-in-out infinite;
}
.grammo-speak {
    position: absolute;
    right: 10px;
    bottom: 0;
}
.speech-bubble {
    position: relative;
    min-height: 150px;
    padding: 24px 26px;
    border-radius: 26px;
    background: #fff;
    border: 2px solid rgba(168, 239, 208, .95);
    box-shadow: 0 14px 30px rgba(88, 73, 140, .12);
}
.speech-bubble::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 54px;
    width: 30px;
    height: 30px;
    background: #fff;
    border-left: 2px solid rgba(168, 239, 208, .95);
    border-bottom: 2px solid rgba(168, 239, 208, .95);
    transform: rotate(45deg);
}
.speech-text {
    font-size: 24px;
    line-height: 1.55;
    font-weight: 900;
    color: var(--ink);
    word-break: keep-all;
}
.dialogue-quiz-card {
    padding: 18px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--line);
}
.dialogue-question {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 1000;
}
.dialogue-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.dialogue-option {
    min-height: 68px;
    border: 2px solid #e3ddff;
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    font-weight: 1000;
    padding: 12px;
    text-align: left;
    transition: .15s;
}
.dialogue-option span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    border-radius: 999px;
    background: #f3edff;
    color: var(--purple);
}
.dialogue-option:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--purple);
    color: var(--purple);
}
.dialogue-option.correct {
    border-color: var(--mint-dark);
    background: #e9fff4;
    color: #14683d;
}
.dialogue-option.wrong {
    border-color: var(--danger);
    background: #fff0ef;
    color: var(--danger);
}
.dialogue-feedback {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fbfffd;
    color: var(--muted);
    font-weight: 800;
}
.dialogue-feedback.good {
    background: #e9fff4;
    color: #14683d;
}
.dialogue-feedback.bad {
    background: #fff0ef;
    color: #a83125;
}
.dialogue-answer-line {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff9d7;
    color: #6e4b00;
    font-weight: 1000;
}
.dialogue-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.dialogue-nav-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.dialogue-next-button {
    width: auto;
    min-width: 120px;
    margin-top: 0;
}
.dialogue-finish-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: center;
    padding: 26px;
    border-radius: 28px;
    background: linear-gradient(135deg, #f5fff9, #fbf8ff);
    border: 2px solid var(--mint);
}
.dialogue-finish-grammo {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(88, 73, 140, .16));
}
.dialogue-finish-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.dialogue-finish-actions .primary-button,
.dialogue-finish-actions .soft-button {
    width: auto;
    margin-top: 0;
}
@keyframes grammoFloatSmall {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-8px) rotate(1deg); }
}
@media (max-width: 860px) {
    .grammo-chat-stage,
    .dialogue-finish-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .speech-bubble::before { display: none; }
    .dialogue-options { grid-template-columns: 1fr; }
    .dialogue-nav { align-items: stretch; }
    .dialogue-nav-right, .dialogue-nav .soft-button, .dialogue-next-button { width: 100%; }
    .dialogue-nav-right { display: grid; }
}

/* Grammar dialogue UI polish v2 */
.grammar-dialogue {
    gap: 14px;
}

.grammar-dialogue .dialogue-progress {
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(168, 239, 208, .95);
    box-shadow: 0 8px 22px rgba(88, 73, 140, .08);
}

.grammar-dialogue .grammo-chat-stage {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 80% 0%, rgba(255, 240, 168, .45), transparent 16rem),
        linear-gradient(135deg, rgba(232, 255, 244, .9), rgba(246, 241, 255, .92));
    border: 2px solid rgba(168, 239, 208, .92);
    box-shadow: 0 14px 30px rgba(88, 73, 140, .10);
}

.grammar-dialogue .grammo-character-wrap {
    min-height: 150px;
    border-radius: 26px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(220, 239, 229, .95);
}

.grammar-dialogue .grammo-character-wrap .grammo-character,
.grammar-dialogue img.grammo-character {
    display: block;
    width: 128px !important;
    height: 128px !important;
    max-width: 128px !important;
    max-height: 128px !important;
    object-fit: contain !important;
    object-position: center !important;
    filter: drop-shadow(0 10px 15px rgba(88, 73, 140, .18));
}

.grammar-dialogue .grammo-speak {
    right: 8px;
    bottom: 8px;
    width: 38px;
    height: 38px;
    background: linear-gradient(145deg, #f0fff7, #eee7ff);
    border: 1px solid #d7c9ff;
    box-shadow: 0 8px 16px rgba(88, 73, 140, .12);
}

.grammar-dialogue .speech-bubble {
    min-height: 130px;
    padding: 22px 24px;
    border: 2px solid rgba(168, 239, 208, .95);
    box-shadow: 0 16px 30px rgba(88, 73, 140, .10);
}

.grammar-dialogue .speech-text {
    font-size: clamp(19px, 2.1vw, 24px);
    line-height: 1.55;
}

.grammar-dialogue .dialogue-quiz-card {
    padding: 20px;
    background: rgba(255, 255, 255, .96);
    border: 2px solid rgba(220, 239, 229, .95);
    box-shadow: 0 10px 26px rgba(88, 73, 140, .08);
}

.grammar-dialogue .dialogue-question {
    font-size: clamp(20px, 2.2vw, 26px);
    color: var(--ink);
}

.grammar-dialogue .dialogue-options {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.grammar-dialogue .dialogue-option {
    display: flex;
    align-items: center;
    min-height: 70px;
    padding: 14px 16px;
    border: 2px solid #d7c9ff;
    border-radius: 22px;
    background: linear-gradient(145deg, #ffffff, #f7f3ff);
    color: var(--ink);
    box-shadow: 0 8px 18px rgba(88, 73, 140, .08);
    font-size: 17px;
    text-align: left;
}

.grammar-dialogue .dialogue-option span {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin-right: 10px;
    background: linear-gradient(145deg, var(--purple), #9c70f0);
    color: #fff;
    box-shadow: 0 6px 12px rgba(123, 72, 217, .18);
}

.grammar-dialogue .dialogue-option:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: var(--mint-dark);
    box-shadow: 0 14px 24px rgba(34, 184, 115, .14);
}

.grammar-dialogue .dialogue-option:disabled {
    opacity: 1;
    cursor: default;
}

.grammar-dialogue .dialogue-option.correct {
    border-color: var(--mint-dark);
    background: linear-gradient(145deg, #e9fff4, #ffffff);
    color: #14683d;
}

.grammar-dialogue .dialogue-option.wrong {
    border-color: #ff8f86;
    background: linear-gradient(145deg, #fff0ef, #ffffff);
    color: #a83125;
}

.dialogue-feedback-panel {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
    border-radius: 24px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 0 12px 26px rgba(88, 73, 140, .09);
}

.dialogue-feedback-panel.good {
    border-color: rgba(34, 184, 115, .65);
    background: linear-gradient(135deg, #e9fff4, #ffffff);
}

.dialogue-feedback-panel.bad {
    border-color: rgba(255, 143, 134, .72);
    background: linear-gradient(135deg, #fff0ef, #ffffff);
}

.dialogue-feedback-grammo {
    width: 116px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 10px 14px rgba(88, 73, 140, .14));
}

.dialogue-feedback-panel strong {
    display: block;
    margin-bottom: 5px;
    font-size: 26px;
    font-weight: 1000;
    color: var(--purple);
}

.dialogue-feedback-panel.good strong {
    color: var(--mint-dark);
}

.dialogue-feedback-panel.bad strong {
    color: var(--danger);
}

.dialogue-feedback-panel p {
    margin: 0;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 850;
}

.dialogue-retry-button {
    margin-top: 12px;
}

.grammar-dialogue .dialogue-feedback.ready {
    background: #fbfffd;
    border: 1px dashed rgba(168, 239, 208, .95);
    color: var(--muted);
}

.grammar-dialogue .dialogue-answer-line {
    margin-top: 12px;
    background: linear-gradient(135deg, #fff8cc, #fffdf0);
    border: 1px solid #ffe484;
}

.grammar-dialogue .dialogue-nav {
    padding-top: 2px;
}

.grammar-dialogue .dialogue-nav .soft-button,
.grammar-dialogue .dialogue-nav .primary-button {
    min-height: 48px;
    border-radius: 18px;
    padding: 12px 18px;
    box-shadow: 0 8px 18px rgba(88, 73, 140, .10);
}

.grammar-dialogue .dialogue-nav .soft-button {
    background: linear-gradient(145deg, #f6f1ff, #ffffff);
    border: 2px solid #d7c9ff;
}

.grammar-dialogue .dialogue-nav .primary-button,
.grammar-dialogue .dialogue-next-button {
    width: auto !important;
    min-width: 150px;
    margin-top: 0 !important;
    background: linear-gradient(135deg, var(--mint-dark), #15c5a5);
}

.dialogue-finish-card {
    grid-template-columns: 210px minmax(0, 1fr);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 240, 168, .55), transparent 18rem),
        linear-gradient(135deg, #f5fff9, #fbf8ff);
}

.dialogue-finish-card .dialogue-finish-grammo,
.dialogue-finish-grammo {
    width: 190px !important;
    max-width: 190px !important;
    max-height: 150px !important;
    object-fit: contain !important;
}

@media (max-width: 860px) {
    .grammar-dialogue .grammo-chat-stage {
        grid-template-columns: 1fr;
    }
    .dialogue-feedback-panel {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .dialogue-feedback-grammo {
        margin: 0 auto;
    }
    .grammar-dialogue .dialogue-nav .primary-button,
    .grammar-dialogue .dialogue-next-button {
        width: 100% !important;
    }
}

/* Grammar chapter traffic-light status cards */
.grammar-traffic-card {
    min-height: 300px;
    padding: 22px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 16px;
    position: relative;
    transition: .18s;
}

.grammar-traffic-card.red { border-color: #ffb4aa; }
.grammar-traffic-card.yellow { border-color: #ffe484; }
.grammar-traffic-card.green { border-color: #9be7c2; }

.grammar-signal-wrap {
    width: 66px;
    min-height: 29px;
    margin: 0 auto;
    padding: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #25213b, #3b3656);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), 0 6px 12px rgba(88, 73, 140, .14);
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.grammar-signal-light {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.28);
    opacity: .22;
    filter: grayscale(.8);
    box-shadow: inset 0 3px 5px rgba(255,255,255,.32), inset 0 -4px 5px rgba(0,0,0,.25);
}

.grammar-signal-light.red { background: #ff4d43; }
.grammar-signal-light.yellow { background: #ffd447; }
.grammar-signal-light.green { background: #22d37d; }

.grammar-signal-light.on {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 9px currentColor, inset 0 3px 5px rgba(255,255,255,.55), inset 0 -4px 5px rgba(0,0,0,.18);
}

.grammar-signal-light.red.on { color: rgba(255, 77, 67, .75); }
.grammar-signal-light.yellow.on { color: rgba(255, 212, 71, .78); }
.grammar-signal-light.green.on { color: rgba(34, 211, 125, .78); }

.grammar-traffic-card .body {
    padding: 0;
}

.grammar-traffic-card .body h2 {
    margin-top: 2px;
}

.traffic-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 14px 0 16px;
    padding: 10px 12px;
    border-radius: 16px;
    font-weight: 900;
}

.traffic-status-line span {
    white-space: nowrap;
}

.traffic-status-line small {
    color: var(--muted);
    font-weight: 800;
}

.traffic-status-line.red {
    background: #fff0ef;
    color: #c0392b;
    border: 1px solid #ffc3bd;
}

.traffic-status-line.yellow {
    background: #fff8cc;
    color: #8a6100;
    border: 1px solid #ffe484;
}

.traffic-status-line.green {
    background: #e9fff4;
    color: #14683d;
    border: 1px solid #9be7c2;
}

.grammar-traffic-card .chapter-dialogue-button {
    width: 100%;
    min-height: 48px;
    border-radius: 18px;
    background: linear-gradient(145deg, #f6f1ff, #ffffff);
    border: 2px solid #d7c9ff;
}

.grammar-traffic-card.green .chapter-dialogue-button {
    background: linear-gradient(135deg, #e9fff4, #ffffff);
    border-color: #9be7c2;
    color: var(--mint-dark);
}

.grammar-view-buttons .soft-button.hidden {
    display: none !important;
}

.dialogue-finish-actions .soft-button:disabled {
    opacity: .52;
    cursor: not-allowed;
}

@media (max-width: 980px) {
    .chapter-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .chapter-grid { grid-template-columns: 1fr; }
    .grammar-traffic-card { min-height: auto; }
}


/* Dashboard grammar progress graph */
.grammar-progress-panel {
    margin: 22px 0;
}

.grammar-progress-title {
    align-items: flex-start;
}

.grammar-progress-title h2 {
    margin-bottom: 6px;
}

.grammar-progress-tools {
    min-width: min(360px, 100%);
}

.grammar-progress-tools label {
    margin-top: 0;
}

.grammar-progress-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 18px 0;
}

.grammar-progress-stat {
    border-radius: 18px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    background: #fbfffd;
}

.grammar-progress-stat strong {
    display: block;
    font-size: 30px;
    line-height: 1;
    margin-bottom: 8px;
}

.grammar-progress-stat span {
    color: var(--muted);
    font-weight: 800;
    font-size: 14px;
}

.grammar-progress-stat.green { border-color: #96ecc8; background: #effff7; }
.grammar-progress-stat.green strong { color: var(--mint-dark); }
.grammar-progress-stat.yellow { border-color: #ffe38a; background: #fffbed; }
.grammar-progress-stat.yellow strong { color: #c98b00; }
.grammar-progress-stat.red { border-color: #ffb8b1; background: #fff4f2; }
.grammar-progress-stat.red strong { color: var(--danger); }
.grammar-progress-stat.purple { border-color: #d9ccff; background: #faf7ff; }
.grammar-progress-stat.purple strong { color: var(--purple); }

.grammar-progress-chart {
    display: grid;
    gap: 10px;
}

.grammar-progress-row {
    display: grid;
    grid-template-columns: minmax(180px, 280px) 1fr minmax(130px, 160px);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .82);
}

.grammar-progress-row.green { border-color: #9be7c2; }
.grammar-progress-row.yellow { border-color: #ffe38a; }
.grammar-progress-row.red { border-color: #ffc3bd; }

.grammar-progress-chapter strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
}

.grammar-progress-chapter span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.grammar-progress-track {
    position: relative;
    height: 30px;
    border-radius: 999px;
    background: #f2f0fb;
    overflow: hidden;
    border: 1px solid #e2ddf5;
}

.grammar-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 0;
    border-radius: 999px;
    transition: width .35s ease;
}

.grammar-progress-fill.green { background: linear-gradient(135deg, var(--mint-dark), #19cfa7); }
.grammar-progress-fill.yellow { background: linear-gradient(135deg, #ffd34d, #f4b400); }
.grammar-progress-fill.red { background: linear-gradient(135deg, #ff7668, var(--danger)); }

.grammar-progress-percent {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ink);
    font-weight: 1000;
    font-size: 13px;
    text-shadow: 0 1px 0 rgba(255,255,255,.65);
}

.grammar-progress-badge {
    border-radius: 16px;
    padding: 10px 12px;
    text-align: center;
    font-size: 13px;
    border: 1px solid var(--line);
    background: #fff;
}

.grammar-progress-badge strong,
.grammar-progress-badge small {
    display: block;
}

.grammar-progress-badge small {
    margin-top: 3px;
    color: var(--muted);
}

.grammar-progress-badge.green { border-color: #9be7c2; color: var(--mint-dark); background: #effff7; }
.grammar-progress-badge.yellow { border-color: #ffe38a; color: #a87500; background: #fffbed; }
.grammar-progress-badge.red { border-color: #ffc3bd; color: var(--danger); background: #fff4f2; }

.grammar-progress-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: -1px;
}

.legend-dot.red { background: var(--danger); }
.legend-dot.yellow { background: var(--yellow-dark); }
.legend-dot.green { background: var(--mint-dark); }

@media (max-width: 900px) {
    .grammar-progress-summary { grid-template-columns: repeat(2, 1fr); }
    .grammar-progress-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .grammar-progress-badge {
        text-align: left;
    }
}

/* Dashboard subwindow buttons */
.dashboard-subwindow-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.dashboard-open-card {
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

.dashboard-open-card .card-icon {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 22px;
    margin-bottom: 14px;
    background: linear-gradient(145deg, #f7fff9, #f7f2ff);
    box-shadow: 0 12px 26px rgba(88, 73, 140, .12);
}

.dashboard-subwindow-card {
    border: 2px solid var(--mint);
    box-shadow: 0 28px 80px rgba(35, 29, 68, .22);
}

.dashboard-history-list {
    margin-top: 16px;
    max-height: 58vh;
    overflow: auto;
    padding-right: 4px;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 760px) {
    .dashboard-subwindow-buttons {
        grid-template-columns: 1fr;
    }
}

/* Landing login page assets */
.landing-auth-wrap {
    width: min(1220px, calc(100% - 48px));
    grid-template-columns: 1.15fr .85fr;
    align-items: stretch;
}

.landing-hero-card {
    min-height: 620px;
    padding: 0;
    justify-content: flex-start;
    background:
        linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.24)),
        url('../img/landing/Background.png') center/cover no-repeat;
    border-color: rgba(168, 239, 208, .95);
}

.landing-hero-card::after {
    content: none;
}

.landing-main-title {
    position: absolute;
    z-index: 3;
    top: 22px;
    left: 50%;
    width: min(88%, 720px);
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 14px 18px rgba(88, 73, 140, .16));
    animation: grammoFloatTitle 5.2s ease-in-out infinite;
    pointer-events: none;
}

.landing-main-grammo {
    position: absolute;
    z-index: 4;
    left: clamp(18px, 5vw, 52px);
    bottom: 68px;
    width: min(22.5%, 170px);
    height: auto;
    filter: drop-shadow(0 18px 24px rgba(37, 33, 59, .18));
    animation: grammoFloatMascot 4.4s ease-in-out infinite;
    pointer-events: none;
}

.landing-hero-copy {
    position: absolute;
    z-index: 5;
    right: clamp(20px, 4vw, 48px);
    bottom: 34px;
    width: min(56%, 430px);
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .76);
    border: 2px solid rgba(255, 255, 255, .9);
    box-shadow: 0 16px 28px rgba(88, 73, 140, .16);
    backdrop-filter: blur(8px);
}

.landing-hero-copy p {
    margin: 0;
    font-size: 17px;
    line-height: 1.65;
    color: #4a4b65;
    font-weight: 700;
}

.landing-hero-copy .pill-row {
    margin-top: 14px;
}

.sample-login-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.sample-login-button {
    border: 1px solid #d9ccff;
    border-radius: 999px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #fff, #f2eeff);
    color: var(--purple);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 16px rgba(123, 72, 217, .10);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.sample-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(123, 72, 217, .16);
    background: linear-gradient(135deg, #fff7cf, #f3edff);
}

@keyframes grammoFloatTitle {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes grammoFloatMascot {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
}

@media (max-width: 1000px) {
    .landing-auth-wrap {
        grid-template-columns: 1fr;
        width: min(760px, calc(100% - 32px));
    }

    .landing-hero-card {
        min-height: 560px;
    }
}

@media (max-width: 640px) {
    .auth-body { padding: 18px; }
    .landing-auth-wrap { width: 100%; }
    .landing-hero-card { min-height: 520px; }
    .landing-main-title { top: 18px; width: 96%; max-width: 720px; }
    .landing-main-grammo { width: 29%; left: 50%; bottom: 126px; transform: translateX(-50%); animation: none; }
    .landing-hero-copy {
        left: 16px;
        right: 16px;
        bottom: 18px;
        width: auto;
    }
    .landing-hero-copy p { font-size: 15px; }
    .sample-login-row { grid-template-columns: 1fr; }
}
