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

/* ============================================================
   Base body - index.html, login.html, signup.html
   ============================================================ */
body {
    font-family: system-ui, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Nav bar
   ============================================================ */
.site-nav {
    width: 100%;
    /* Warm cream default; kid-mode / marketing-page rules below refine
       borders and accents. The old navy (#1e40af) default has been
       retired - every page that renders a nav also opts into either
       marketing-page or kid-mode, both of which override this. */
    background: #fefdfa;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgb(43 43 43 / 0.05);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    /* .nav-links (mobile dropdown) does `background: inherit` to pick up
       whatever background the current page's <nav> uses; that only works
       if this element (its actual parent) forwards it too. */
    background: inherit;
}

.site-nav .nav-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-right: auto;
    padding: 0.25rem 0.5rem 0.25rem 0;
    min-width: 0;
    flex-shrink: 1; /* nav a sets flex-shrink:0; brand must stay the one item that yields */
}

.site-nav .nav-brand-logo {
    display: block;
    width: 2.1rem;
    height: 2.1rem;
    object-fit: contain;
}

.site-nav .nav-brand-text {
    color: #2b2b2b;
    font-weight: 700;
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-nav a {
    color: rgb(43 43 43 / 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    border-radius: 0.4rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition:
        background 0.15s,
        color 0.15s;
}

.site-nav a:hover {
    background: #eafaf3;
    color: #0f9d74;
}

.site-nav a.active {
    color: #0f9d74;
    border-bottom: 2px solid rgb(43 185 156 / 0.5);
    padding-bottom: calc(
        0.35rem - 2px
    ); /* compensate for border so height stays the same */
}

.site-nav .nav-logout {
    background: #ffffff;
    border: 1px solid rgb(43 43 43 / 0.15);
    color: #2b2b2b;
    padding: 0.35rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
    transition:
        background 0.15s,
        color 0.15s;
}

.site-nav .nav-logout:hover {
    background: #eafaf3;
    border-color: rgb(43 185 156 / 0.3);
    color: #0f9d74;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 2.1rem;
    height: 2.1rem;
    background: transparent;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: rgb(43 43 43 / 0.06);
}

.nav-toggle-bar {
    width: 1.15rem;
    height: 2px;
    background: rgb(43 43 43 / 0.7);
    border-radius: 999px;
    transition: transform 0.15s, opacity 0.15s;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 600px) {
    .nav-toggle {
        display: inline-flex;
        margin-left: 0.5rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        background: inherit;
        border-top: 1px solid rgb(43 43 43 / 0.08);
        padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom));
        border-radius: 0 0 1rem 1rem;
        box-shadow: 0 12px 24px rgb(43 43 43 / 0.12);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a,
    .nav-links .nav-logout {
        width: 100%;
        text-align: center;
        padding: 0.7rem 0.6rem;
    }

    .nav-notifications {
        width: 100%;
    }

    .notif-dropdown {
        width: calc(100vw - 2rem);
        max-width: 330px;
    }
}

.nav-usage {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: conic-gradient(var(--nav-usage-color, #2bb99c) calc(var(--nav-usage-pct, 0) * 1%), #e5e7eb 0);
}
.nav-usage::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #fefdfa;
}
.nav-usage-text {
    position: relative;
    z-index: 1;
    line-height: 1;
    white-space: nowrap;
}
.nav-usage-pct {
    font-size: 0.56rem;
    font-weight: 700;
    color: var(--nav-usage-color, #2bb99c);
}
.nav-usage[data-state="normal"]    { --nav-usage-color: #2bb99c; }
.nav-usage[data-state="warning"]   { --nav-usage-color: #f59e0b; }
.nav-usage[data-state="exhausted"] { --nav-usage-color: #dc2626; }

.nav-notifications {
    position: relative;
    flex-shrink: 0;
}

.notif-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #c9714a;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 330px;
    max-height: 400px;
    overflow-y: auto;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.12);
    z-index: 100;
    color: #2b2b2b;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgb(43 43 43 / 0.08);
    font-size: 0.85rem;
    font-weight: 700;
}

.notif-dropdown-header span {
    white-space: nowrap;
}

.notif-dropdown-header button {
    background: #f7f4ec;
    border: 1px solid rgb(43 43 43 / 0.08);
    color: rgb(43 43 43 / 0.75);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    transition: background 0.15s, border-color 0.15s;
    width: auto;
}

.notif-dropdown-header button:hover {
    background: #efe9dd;
    border-color: rgb(43 43 43 / 0.14);
}

.notif-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(43 43 43 / 0.06);
    font-size: 0.85rem;
    line-height: 1.4;
}

.notif-item.unread {
    cursor: pointer;
    background: #fdece4;
    font-weight: 700;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item a {
    color: #c9714a;
    font-weight: 700;
    text-decoration: none;
    padding: 0;
    border-radius: 0;
}

.notif-item a:hover {
    color: #c9714a;
    text-decoration: underline;
}

.notif-link {
    margin-top: 0.5rem;
}

.notif-link a {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background: #f7f4ec;
    color: rgb(43 43 43 / 0.75);
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.notif-link a:hover {
    background: #efe9dd;
    border-color: rgb(43 43 43 / 0.14);
    transform: translateY(-1px);
}

.notif-item-time {
    display: block;
    color: rgb(43 43 43 / 0.45);
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 2px;
}

.notif-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: rgb(43 43 43 / 0.45);
    font-size: 0.85rem;
}

/* pages with nav need top padding so content isn't hidden under the fixed bar */
body.has-nav {
    padding-top: 4rem;
}

/* index.html - marketing homepage */
body.marketing-page {
    background: linear-gradient(135deg, #fdfbf0, #fbf7e8);
}

/* Nav adapts to marketing pages (dashboard with hero) */
body.marketing-page.has-nav .site-nav {
    background: #fefdfa;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgb(43 185 156 / 0.15);
    box-shadow: 0 1px 3px rgb(43 43 43 / 0.05);
}

body.marketing-page.has-nav .site-nav .nav-brand-text {
    color: #2b2b2b;
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
}

body.marketing-page.has-nav .site-nav a:not(.nav-brand) {
    color: rgb(43 43 43 / 0.7);
    background: #ffffff;
    border: 1px solid rgb(43 43 43 / 0.08);
}

body.marketing-page.has-nav .site-nav a:not(.nav-brand):hover {
    background: #eafaf3;
    border-color: rgb(43 185 156 / 0.3);
    color: #0f9d74;
}

body.marketing-page.has-nav .site-nav a.active {
    background: #d7f4e6;
    border: 1px solid rgb(43 185 156 / 0.3);
    color: #0f9d74;
    padding-bottom: 0.35rem;
}

body.marketing-page.has-nav .site-nav .nav-logout {
    background: #ffffff;
    border: 1px solid rgb(43 43 43 / 0.15);
    color: #2b2b2b;
}

body.marketing-page.has-nav .site-nav .nav-logout:hover {
    background: #eafaf3;
    border-color: rgb(43 185 156 / 0.3);
    color: #0f9d74;
}

/* ============================================================
   Session bar - tutor.html
   ============================================================ */
#session-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Match the tutor page's own content column (#chat, body.tutor form),
       which now matches the dashboard's 1100px column, instead of
       spanning edge-to-edge. */
    padding: 0.7rem max(1rem, calc((100% - 1100px) / 2));
    background: #f7f4ec;
    border-bottom: 1px solid rgb(43 43 43 / 0.06);
    font-size: 0.85rem;
    color: #2b2b2b;
    flex-shrink: 0;
    min-height: 3rem;
}

#session-info {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

#session-info:hover {
    color: #ff8b6a;
}

#session-toggle {
    font-size: 0.6rem;
    opacity: 0.7;
}

#session-topic {
    font-weight: 600;
}

#session-list {
    position: fixed;
    top: calc(4rem + 3rem);
    left: 0;
    right: 0;
    z-index: 49;
    /* Match #session-bar's content column (1100px, same as the
       dashboard) instead of spanning edge-to-edge. */
    max-width: 1100px;
    margin: 0 auto;
    background: #fefdfa;
    border-bottom: 1px solid rgb(43 43 43 / 0.08);
    box-shadow: 0 8px 20px rgb(43 43 43 / 0.1);
    max-height: 50vh;
    overflow-y: auto;
}

.session-list-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgb(43 43 43 / 0.05);
    transition: background 0.1s;
    border-left: 3px solid transparent;
}

.session-list-item:hover {
    background: #faf7f0;
}

.session-list-item.current {
    background: #fdece4;
    border-left-color: #ff8b6a;
}

.session-list-topic {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2b2b2b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-list-item.current .session-list-topic {
    color: #c9714a;
}

.session-list-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.session-list-date {
    font-size: 0.7rem;
    color: rgb(43 43 43 / 0.4);
    margin-top: 0.1rem;
}

.session-list-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.session-rename-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.1rem;
    font-size: 0.75rem;
    opacity: 0;
    flex-shrink: 0;
    line-height: 1;
    width: auto;
    color: rgb(43 43 43 / 0.5);
    transition: opacity 0.15s;
}

.session-list-item:hover .session-rename-btn {
    opacity: 1;
}

.session-rename-input {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border: 1px solid #f4b79f;
    border-radius: 0.3rem;
    outline: none;
    color: #2b2b2b;
    min-width: 0;
    width: auto;
}

.session-rename-input:focus {
    border-color: #ff8b6a;
    box-shadow: 0 0 0 2px rgb(255 139 106 / 0.2);
}

.session-rename-save,
.session-rename-cancel {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0.2rem;
    flex-shrink: 0;
    width: auto;
    line-height: 1;
}

.session-rename-save {
    color: #16a34a;
}
.session-rename-cancel {
    color: #dc2626;
}

.session-list-meta {
    font-size: 0.78rem;
    color: rgb(43 43 43 / 0.45);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.session-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.session-status-dot.active {
    background: #22c55e;
}
.session-status-dot.paused {
    background: #f59e0b;
}
.session-status-dot.completed {
    background: #94a3b8;
}
.session-status-dot.abandoned {
    background: #f87171;
}

.session-list-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: rgb(43 43 43 / 0.45);
    font-size: 0.85rem;
}

#session-stats {
    color: rgb(43 43 43 / 0.45);
    font-size: 0.8rem;
    white-space: nowrap;
}

.session-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

.session-stat.correct {
    color: #5c8e77;
}

.session-stat.incorrect {
    color: #c9714a;
}

#new-session-btn {
    margin-left: auto;
    padding: 0.3rem 0.7rem;
    background: #ff8b6a;
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    width: auto;
    flex-shrink: 0;
}

#new-session-btn:hover {
    background: #ff7a55;
}

/* ============================================================
   children.html - page layout
   ============================================================ */
.children-container {
    max-width: 640px;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.children-page {
    max-width: 720px;
}

.children-content {
    padding: 0.5rem 0 2rem;
}

.children-page .btn-add {
    align-self: flex-start;
}

.children-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.children-header h1 {
    margin-bottom: 0;
    text-align: left;
}

.btn-add {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    background: #ff8b6a;
    color: white;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 0 #e06e4c;
    transition: background 0.15s, transform 0.15s;
}

.btn-add:hover {
    background: #ff7a55;
    transform: translateY(-1px);
}

.child-card {
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.child-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
    border-color: rgb(43 43 43 / 0.14);
}

.child-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.child-name {
    font-weight: 700;
    color: #2b2b2b;
}

.child-username {
    font-size: 0.85rem;
    color: rgb(43 43 43 / 0.45);
}

.child-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-edit {
    padding: 0.4rem 0.85rem;
    background: #f7f4ec;
    color: rgb(43 43 43 / 0.75);
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    width: auto;
}

.btn-edit:hover {
    background: #efe9dd;
    border-color: rgb(43 43 43 / 0.14);
}

.btn-delete {
    padding: 0.4rem 0.85rem;
    background: #fdece4;
    color: #c9714a;
    border: 1px solid #ef9a8a;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    width: auto;
}

.btn-delete:hover {
    background: #ffd9c9;
}

.btn-secondary {
    padding: 0.55rem 1.1rem;
    background: #f7f4ec;
    color: rgb(43 43 43 / 0.75);
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    width: auto;
}

.btn-secondary:hover {
    background: #efe9dd;
    border-color: rgb(43 43 43 / 0.14);
}

.btn-danger {
    padding: 0.55rem 1.1rem;
    background: #c9714a;
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    width: auto;
    box-shadow: 0 3px 0 #a85a38;
}

.btn-danger:hover {
    background: #b85f3d;
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #a85a38;
}

.account-settings {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgb(43 43 43 / 0.08);
}

.account-settings h2 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.25rem;
    color: #2b2b2b;
    font-weight: 700;
    margin-bottom: 1rem;
}

.settings-card {
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    margin-bottom: 1.5rem;
}

.settings-card p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.danger-zone {
    background: #fdece4;
    border: 1px solid #ef9a8a;
    border-radius: 1.15rem;
    padding: 1.35rem;
}

.danger-zone p {
    color: #8a3a1f;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* --- Billing panel (parent/standalone dashboard) ---
   Mirrors the .child-dashboard-card / .kid-course-card aesthetic so
   the subscription block reads as part of the same dashboard surface
   rather than a bare paragraph list. */
.billing-card {
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.billing-card:hover {
    box-shadow: 0 10px 28px rgb(43 43 43 / 0.09);
    transform: translateY(-3px);
    border-color: rgb(43 43 43 / 0.14);
}

.billing-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.billing-plan-name {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2b2b2b;
}

.billing-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1.2;
}

.billing-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.billing-status-active,
.billing-status-trialing {
    background: #eaf4ee;
    color: #5c8e77;
    border-color: #b9ddca;
}

.billing-status-paused {
    background: #fbf3de;
    color: #b48a1e;
    border-color: #e8b84b;
}

.billing-status-past_due,
.billing-status-canceled,
.billing-status-unpaid,
.billing-status-incomplete {
    background: #fdece4;
    color: #c9714a;
    border-color: #ef9a8a;
}

.billing-usage {
    margin-bottom: 0.85rem;
}

.billing-usage-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.billing-usage-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgb(43 43 43 / 0.65);
}

.billing-usage-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2b2b2b;
}

.billing-usage-text .billing-usage-period {
    color: rgb(43 43 43 / 0.45);
    font-weight: 600;
}

.billing-usage-bar {
    height: 8px;
    background: #eee9db;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.05);
}

.billing-usage-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.billing-usage-bar-fill.usage-ok {
    background: linear-gradient(90deg, #8fc3a8, #5c8e77);
}

.billing-usage-bar-fill.usage-warn {
    background: linear-gradient(90deg, #e8b84b, #b48a1e);
}

.billing-usage-bar-fill.usage-over {
    background: linear-gradient(90deg, #ef9a8a, #c9714a);
}

.billing-meta {
    font-size: 0.85rem;
    color: rgb(43 43 43 / 0.55);
    margin-bottom: 1rem;
}

.billing-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.billing-actions .empty-action,
.billing-card-empty .empty-action {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    background: #f7f4ec;
    color: rgb(43 43 43 / 0.75);
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.billing-actions .empty-action:hover,
.billing-card-empty .empty-action:hover {
    background: #efe9dd;
    border-color: rgb(43 43 43 / 0.14);
}

.billing-card-empty {
    text-align: center;
    padding: 2rem 1.35rem;
}

.billing-card-empty p {
    color: rgb(43 43 43 / 0.55);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.empty-msg {
    color: rgb(43 43 43 / 0.45);
    text-align: center;
    padding: 2rem 0;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgb(43 43 43 / 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal {
    position: relative;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgb(0 0 0 / 0.15);
}

.modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: rgb(43 43 43 / 0.5);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
}

.modal-close:hover {
    background: rgb(43 43 43 / 0.06);
    color: #2b2b2b;
}

.modal h2 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.25rem;
    color: #2b2b2b;
    margin-bottom: 1.25rem;
}

.modal-msg {
    color: rgb(43 43 43 / 0.65);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ============================================================
   Success message
   ============================================================ */
.success {
    background: #f0fdf4;
    color: #16a34a;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* ============================================================
   Child setup flow (frontend/childsetup.js) - shown inline on the
   dashboard for a parent's first child, and on /add-child after that.
   ============================================================ */
.child-setup {
    background: #fefdfa;
    border: 1.5px solid rgb(255 139 106 / 0.25);
    border-radius: 1.15rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    max-width: 560px;
}

.child-setup h3 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.25rem;
    color: #2b2b2b;
    margin: 0 0 0.35rem;
}

.child-setup-lede {
    margin: 0 0 1.4rem;
    font-size: 0.9rem;
    color: rgb(43 43 43 / 0.6);
}

.child-setup label {
    color: rgb(43 43 43 / 0.75);
    font-weight: 600;
    font-size: 0.9rem;
}

.child-setup input[type="text"] {
    border: 1px solid rgb(43 43 43 / 0.12);
    border-radius: 0.85rem;
    background: #fff;
}

.child-setup input[type="text"]:focus {
    border-color: #ff8b6a;
    box-shadow: 0 0 0 3px rgb(255 139 106 / 0.15);
    outline: none;
}

.child-setup button[type="submit"] {
    width: 100%;
    padding: 0.8rem 1.75rem;
    background: #ff8b6a;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 3px 0 #e06e4c;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.child-setup button[type="submit"]:hover:not(:disabled) {
    background: #ff7a55;
    transform: translateY(-1px);
}

.child-setup button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: 0 3px 0 rgb(224 110 76 / 0.4);
}

/* Grade picker - the answer that bulk-enrolls that grade's subjects.
   Two per row rather than free-flowing pills: primary school is a fixed
   six grades, so a 2x3 grid reads as one scannable block instead of a
   ragged last line, and gives each option a full-width tap target. */
.cs-grades {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.cs-grade {
    padding: 0.7rem 0.9rem;
    background: #fff;
    border: 1.5px solid rgb(43 43 43 / 0.12);
    /* Matches the text inputs above; a 999px pill looks stretched once the
       button spans half the card. */
    border-radius: 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgb(43 43 43 / 0.75);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cs-grade:hover {
    border-color: rgb(255 139 106 / 0.6);
}

.cs-grade.selected {
    background: #ff8b6a;
    border-color: #ff8b6a;
    color: #fff;
}

.cs-grade-hint {
    margin: 0.55rem 0 0;
    font-size: 0.8rem;
    color: rgb(43 43 43 / 0.5);
}

/* Generated credentials, collapsed by default: correct for almost everyone,
   but still editable for the parent who wants a specific username or PIN. */
.cs-creds {
    margin-bottom: 1rem;
    border-top: 1px solid rgb(43 43 43 / 0.07);
    padding-top: 0.9rem;
}

.cs-creds summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgb(43 43 43 / 0.55);
    margin-bottom: 0.9rem;
}

.cs-creds summary:hover {
    color: #e06e4c;
}

.cs-pin-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.cs-pin-row input {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    letter-spacing: 0.15em;
}

.cs-pin-row .btn-secondary {
    flex-shrink: 0;
}

.cs-username-status {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 1em;
}

.cs-username-status.ok {
    color: #16a34a;
}

.cs-username-status.bad {
    color: #c9714a;
}

.cs-consent label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgb(43 43 43 / 0.65);
}

.cs-consent input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.cs-consent a {
    color: #c9714a;
    font-weight: 600;
}

/* Credential handoff card - the one moment the username/PIN are worth
   showing, since the PIN is hashed and can never be redisplayed later. */
.child-handoff {
    background: #fefdfa;
    border: 1.5px solid rgb(127 191 160 / 0.5);
    border-radius: 1.15rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    max-width: 560px;
}

.child-handoff-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.child-handoff h3 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.2rem;
    color: #2b2b2b;
    margin: 0 0 0.35rem;
}

.child-handoff > p {
    margin: 0 0 1.2rem;
    font-size: 0.9rem;
    color: rgb(43 43 43 / 0.65);
}

.child-handoff-creds {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.25rem;
    align-items: baseline;
    margin: 0 0 1.2rem;
    padding: 1rem 1.25rem;
    background: #f7f4ec;
    border-radius: 0.85rem;
}

.child-handoff-creds dt {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(43 43 43 / 0.55);
}

.child-handoff-creds dd {
    margin: 0;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2b2b2b;
    letter-spacing: 0.05em;
    overflow-wrap: anywhere;
}

.child-handoff-note {
    margin: 0 0 1.2rem;
    font-size: 0.85rem;
    color: rgb(43 43 43 / 0.6);
}

.child-handoff-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.child-handoff-actions button:not(.btn-secondary) {
    padding: 0.55rem 1.4rem;
    background: #ff8b6a;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: auto;
}

.child-handoff-actions button:not(.btn-secondary):hover {
    background: #ff7a55;
}

.child-handoff-warning {
    margin: 0;
    font-size: 0.78rem;
    color: rgb(43 43 43 / 0.45);
}

/* The default .link blue reads as a foreign element against the warm
   kid-mode palette these pages use. */
body.kid-mode .link a {
    color: #c9714a;
    font-weight: 600;
}

@media (max-width: 480px) {
    .child-handoff-actions button:not(.btn-secondary) {
        margin-left: 0;
        width: 100%;
    }
}

/* ============================================================
   Body variant - tutor.html
   ============================================================ */
body.tutor {
    font-size: 1rem;
    min-height: unset;
    height: 100vh;
    height: 100dvh;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    padding-top: 4rem; /* fixed nav; session bar now flows in normally below it */
    overflow: hidden;
}

/* nav-inner's own max-width (1100px) already matches this page's content
   column (#chat, #session-bar, #form) below it. Left padding is reduced
   by .nav-brand's own 0.5rem padding (below) so the logo's visible edge
   lands at the same 1rem inset as the other elements instead of 1.5rem. */
body.tutor .nav-inner {
    padding-left: 0.3rem;
}

/* ============================================================
   Headings
   ============================================================ */

/* index.html standalone h1 */
h1 {
    color: #1e40af;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* login.html / signup.html - h1 inside .container */
.container h1 {
    font-size: 3rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .container h1 {
        font-size: 2rem;
        text-align: center;
    }
}

/* ============================================================
   Container
   ============================================================ */

/* index.html */
.container {
    max-width: 600px;
    width: 100%;
    /*padding: 1rem;*/
    /*text-align: center;*/
}

/* subject.html / test.html / tests.html - top-level wrappers with no
   .container ancestor, so they need their own edge padding now that
   body no longer supplies it globally */
.subject-wrap,
.test-wrap,
.tests-wrap {
    padding: 1rem;
}

/* ============================================================
   index.html - specific rules
   ============================================================ */
.subtitle {
    color: #64748b;
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #1e40af;
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.cta:hover {
    background: #1e3a8a;
}

/* ============================================================
   Subject landing page
   ============================================================ */
.subject-landing {
    text-align: center;
    padding: 2rem 0;
}

.subject-landing h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subject-grade {
    color: #64748b;
    margin-bottom: 2rem;
}

.start-btn {
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
    margin-top: 1rem;
}

/* ============================================================
   Curriculum display (subject.html)
   ============================================================ */
.subject-page {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.subject-page .homepage-hero {
    padding: 1.25rem 0 0 0;
    gap: 0.5rem;
}

/* #subject-title reuses .hero-heading (shared with the marketing hero on
   index/login/signup), whose clamp(2rem, 4vw, 3rem) is sized for a
   headline, not a page/book title. Scope an ID override so this page
   doesn't depend on winning the .container h1 / h1.hero-heading cascade
   tie-break, and gets its own appropriately smaller size. */
#subject-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

@media (max-width: 900px) {
    .subject-page .homepage-hero {
        padding: 1rem 0 1rem;
    }
}

.readonly-banner {
    background: #fff4e5;
    border: 1px solid #ffcc80;
    color: #8a5a00;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.curriculum {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.book {
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1rem;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 1px 3px rgb(43 43 43 / 0.05);
    transition:
        box-shadow 0.2s,
        transform 0.2s,
        border-color 0.2s;
}

.book:hover {
    box-shadow: 0 4px 12px rgb(43 43 43 / 0.07);
    border-color: rgb(43 43 43 / 0.14);
}

.book-title {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #2b2b2b;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid rgb(43 43 43 / 0.08);
    margin-bottom: 1rem;
}

.section {
    margin-bottom: 1rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
    background: #eaf4ee;
    border-radius: 0.85rem;
    padding: 0.7rem 0.9rem;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #2b2b2b;
    flex: 1;
    min-width: 0;
}

.section-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.12s;
}

.section-link:hover {
    color: #5c8e77;
}

.chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.chapter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 0.75rem;
    transition:
        border-color 0.12s,
        box-shadow 0.12s,
        transform 0.12s;
}

.chapter:hover {
    border-color: #ffb59d;
    box-shadow: 0 4px 12px rgb(43 43 43 / 0.07);
    transform: translateY(-1px);
}

.chapter-link:hover {
    background: none;
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
    width: auto;
    padding: 0;
}

.chapter-num {
    padding: 0.3rem 0.7rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdece4;
    color: #c9714a;
    border-radius: 0.65rem;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: none;
}

.chapter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2b2b2b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.chapter-go {
    flex-shrink: 0;
    color: #ff8b6a;
    font-size: 1.1rem;
    font-weight: 800;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.12s, transform 0.12s;
}

.chapter:hover .chapter-go {
    opacity: 1;
    transform: translateX(0);
}

.btn-test {
    flex-shrink: 0;
    width: auto;
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    background: #fdece4;
    border: 1px solid #f6cdb9;
    color: #c9714a;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.1s;
}

.btn-test:hover {
    background: #fbddce;
}

.btn-test:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-test-section {
    flex-shrink: 0;
    width: auto;
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #b9ddca;
    color: #5c8e77;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.btn-test-section:hover {
    background: #eaf4ee;
    border-color: #8fc3a8;
    color: #47755f;
}

.btn-test-section:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .section-title {
        flex: 1 1 100%;
    }

    .btn-test-section {
        align-self: flex-start;
        flex-grow: 0;
        padding: 0.25rem 0.6rem;
        font-size: 0.72rem;
    }

    .chapter {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .chapter-link {
        flex: 1 1 100%;
    }

    .chapter-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .btn-test {
        align-self: flex-start;
        flex-grow: 0;
        padding: 0.25rem 0.6rem;
        font-size: 0.72rem;
    }
}

/* Skeleton loading state (subject.html, while curriculum is fetched) */
.skeleton-book {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.5rem;
}

.skeleton-line {
    background: linear-gradient(
        90deg,
        #eef2f6 25%,
        #f8fafc 37%,
        #eef2f6 63%
    );
    background-size: 400% 100%;
    border-radius: 0.5rem;
    animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

.skeleton-book-title {
    height: 1.1rem;
    width: 50%;
    margin-bottom: 1rem;
}

.skeleton-chapter {
    height: 2.75rem;
    margin-bottom: 0.625rem;
}

/* Active chapter context indicator in tutor */
.context-bar {
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    color: #1e40af;
    font-weight: 500;
}

/* ============================================================
   Test modal (subject.html)
   ============================================================ */
.modal-box {
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    padding: 28px 28px 24px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 40px rgb(0 0 0 / 0.15);
}

.modal-box h3 {
    margin: 0 0 8px;
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.1em;
    color: #111827;
}

.modal-box p {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 0.93em;
}

.modal-box .modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-box .modal-actions button {
    flex: 1;
    width: auto;
    padding: 0.85rem 10px;
    cursor: pointer;
    border: none;
    border-radius: 0.9rem;
    font-size: 0.93em;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-mc {
    background: #f2966a;
    color: #fff;
    box-shadow: 0 8px 20px rgb(242 150 106 / 0.35);
}

.btn-mc:hover {
    transform: translateY(-2px);
}

.btn-written {
    background: #fff;
    color: #3f3f46;
    border: 1px solid #e5e7eb;
}

.btn-written:hover {
    background: #f9fafb;
}

.btn-cancel {
    width: 100%;
    padding: 9px;
    cursor: pointer;
    background: none;
    border: none;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.9em;
    font-weight: 500;
    transition: color 0.12s;
}

.btn-cancel:hover {
    color: #3f3f46;
}

.features {
    text-align: left;
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.features h3 {
    margin-bottom: 1rem;
}

.features ul {
    list-style: none;
}

.features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.features li:last-child {
    border-bottom: none;
}

/* ============================================================
   login.html / signup.html - form elements
   ============================================================ */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgb(30 64 175 / 0.1);
}

button {
    width: 100%;
    padding: 0.75rem;
    background: #1e40af;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
}

button:disabled {
    opacity: 0.5;
}

/* login.html - error shown via .hidden toggle */
.error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* signup.html - error hidden by default */
.error.hidden-by-default {
    display: none;
}

.hidden {
    display: none;
}

.link {
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
}

.link a {
    color: #1e40af;
    text-decoration: none;
}

.link a:hover {
    text-decoration: underline;
}

.legal-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.legal-footer a {
    color: #94a3b8;
    text-decoration: none;
}

.legal-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   Site footer (legal pages)
   ============================================================ */
.site-footer {
    width: 100%;
    margin-top: 3rem;
    padding: 1.5rem 0 2.5rem;
    border-top: 1px solid rgb(17 24 39 / 0.08);
    background: transparent;
}

.footer-inner {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-links a {
    color: #57606f;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #111827;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   Legal pages (terms / privacy / refund) - long-form prose styling
   ============================================================ */
.terms {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 0 3rem;
    color: #57606f;
    line-height: 1.7;
    text-align: left;
}

.terms h1 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.terms .updated {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.terms h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin: 28px 0 8px;
}

.terms p {
    margin: 0 0 12px;
}

.terms a {
    color: #2bb99c;
    text-decoration: none;
}

.terms a:hover {
    color: #0f9d74;
    text-decoration: underline;
}

.terms .ai-callout {
    background: #eafaf3;
    border: 1px solid #d7f4e6;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 8px 0 24px;
}

.terms .ai-callout .ai-title {
    font-weight: 700;
    color: #0f9d74;
    margin: 0 0 6px;
}

.terms .ai-callout p {
    color: #0f9d74;
    margin: 0;
    font-size: 0.95rem;
}

/* ============================================================
   Dashboard - index.html logged-in views
   ============================================================ */

/* --- Dashboard page container (own width/font, independent of .marketing) --- */
.dashboard-page {
    max-width: 1100px;
    /*padding-top: 1rem;*/
    padding-right: 1.5rem;
    /*padding-bottom: 3rem;*/
    padding-left: 1.5rem;
    font-family: "Nunito", "Noto Sans Greek", system-ui, sans-serif;
}

.dashboard-page .homepage-hero {
    padding: 2rem 0 0 0;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .dashboard-page .homepage-hero {
        padding: 1rem 0 1.5rem;
    }
}

/* Legacy dashboard-container for non-hero pages */
.dashboard-container {
    padding-top: 2rem;
    padding-bottom: 3rem;
    max-width: 720px;
    text-align: left;
}

.dashboard-welcome {
    text-align: left;
    margin-bottom: 2rem;
}

.dashboard-welcome h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.dashboard-welcome .welcome-sub {
    color: #64748b;
    font-size: 0.95rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.dashboard-stat-card {
    background: #fefdfa;
    border: 1.5px solid transparent;
    border-radius: 1.15rem;
    padding: 1.35rem 1.25rem;
    text-align: left;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    transition:
        box-shadow 0.2s,
        transform 0.2s;
}

.dashboard-stat-card:hover {
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
    transform: translateY(-3px);
}

.dashboard-stat-card .stat-number {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #2b2b2b;
    line-height: 1.1;
}

.dashboard-stat-card .stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgb(43 43 43 / 0.55);
    margin-top: 0.25rem;
}

.dashboard-stat-card .stat-icon {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    display: block;
}

/* --- Dashboard children section --- */
.dashboard-children {
    text-align: left;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dashboard-header h2 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.25rem;
    color: #2b2b2b;
    font-weight: 700;
}

/* Link-style action on the right of a dashboard section header
   (e.g. "Διαχείριση →"). Pill shape to match the kid-mode buttons. */
.section-action {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    color: rgb(43 43 43 / 0.75);
    background: #f7f4ec;
    border: 1px solid rgb(43 43 43 / 0.08);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.section-action:hover {
    background: #efe9dd;
    border-color: rgb(43 43 43 / 0.14);
    transform: translateY(-1px);
}

/* --- Child card (parent dashboard) --- */
.child-dashboard-card {
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    transition:
        box-shadow 0.2s,
        transform 0.2s,
        border-color 0.2s;
}

.child-dashboard-card:hover {
    box-shadow: 0 10px 28px rgb(43 43 43 / 0.09);
    transform: translateY(-3px);
    border-color: rgb(43 43 43 / 0.14);
}

.child-dashboard-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.child-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    flex-shrink: 0;
    background: #6366f1;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
}

.child-dashboard-card-top .child-info {
    flex: 1;
    min-width: 0;
}

.child-dashboard-card-top .child-name {
    font-size: 1rem;
    font-weight: 700;
    color: #2b2b2b;
}

.child-dashboard-card-top .child-username {
    font-size: 0.8rem;
    color: rgb(43 43 43 / 0.45);
}

.child-dashboard-card-top .child-enroll-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgb(43 43 43 / 0.65);
    background: #f7f4ec;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.child-dashboard-card-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subject-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    color: rgb(43 43 43 / 0.55);
    background: #f7f4ec;
    border: 1px solid rgb(43 43 43 / 0.08);
}

.subject-tag:hover {
    border-color: rgb(43 43 43 / 0.14);
    background: #efe9dd;
}

.readonly-badge {
    font-size: 0.75em;
    color: #b48a1e;
    background: #fbf3de;
    border: 1px solid #e8b84b;
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
}

.subject-tag.active {
    color: #2b2b2b;
    background: #fdece4;
    border-color: #ff8b6a;
}

.subject-tag.active:hover {
    background: #ffd9c9;
    border-color: #ff7a55;
}

/* Color-tinted subject tags (uses HSL variables from .color-N classes) */
.subject-tag.color-0.active,
.subject-tag.color-1.active,
.subject-tag.color-2.active,
.subject-tag.color-3.active,
.subject-tag.color-4.active,
.subject-tag.color-5.active {
    background: hsl(var(--tag-h, 230), calc(var(--tag-s, 55%) * 0.5), 95%);
    border-color: hsl(var(--tag-h, 230), calc(var(--tag-s, 55%) * 0.4), 80%);
    color: hsl(var(--tag-h, 230), calc(var(--tag-s, 55%) * 0.6), 30%);
}

.subject-tag.color-0.active:hover,
.subject-tag.color-1.active:hover,
.subject-tag.color-2.active:hover,
.subject-tag.color-3.active:hover,
.subject-tag.color-4.active:hover,
.subject-tag.color-5.active:hover {
    background: hsl(var(--tag-h, 230), calc(var(--tag-s, 55%) * 0.6), 92%);
    border-color: hsl(var(--tag-h, 230), calc(var(--tag-s, 55%) * 0.5), 72%);
}

.subject-tag .tag-check {
    font-size: 0.7rem;
    opacity: 0.45;
    transition: opacity 0.15s;
}

.subject-tag.active .tag-check {
    opacity: 1;
}

.child-dashboard-card-subjects-hint {
    font-size: 0.75rem;
    color: rgb(43 43 43 / 0.45);
    margin: 0.35rem 0 0.75rem;
}

.subject-tag input[type="checkbox"] {
    display: none;
}

/* subject colors for visual variety */
.subject-tag.color-0 {
    --tag-h: 230;
    --tag-s: 55%;
    --tag-l: 55%;
}
.subject-tag.color-1 {
    --tag-h: 160;
    --tag-s: 45%;
    --tag-l: 45%;
}
.subject-tag.color-2 {
    --tag-h: 340;
    --tag-s: 55%;
    --tag-l: 50%;
}
.subject-tag.color-3 {
    --tag-h: 45;
    --tag-s: 70%;
    --tag-l: 50%;
}
.subject-tag.color-4 {
    --tag-h: 190;
    --tag-s: 55%;
    --tag-l: 45%;
}
.subject-tag.color-5 {
    --tag-h: 280;
    --tag-s: 40%;
    --tag-l: 50%;
}

/* --- Per-child grade tabs (parent dashboard reviews/tests) ---
   Mirrors .grade-tab(s) on the kid-facing tests page (tests.html) so the
   two "grouped by grade" UIs look and feel the same. */
.dashboard-grade-tabs {
    display: flex;
    gap: 1.4rem;
    margin-top: 10px;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgb(43 43 43 / 0.08);
    overflow-x: auto;
}

.dashboard-grade-tab {
    appearance: none;
    width: auto;
    background: none;
    border: none;
    border-radius: 0;
    outline: none;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgb(43 43 43 / 0.45);
    padding: 0 0 0.6rem;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.dashboard-grade-tab:hover {
    color: rgb(43 43 43 / 0.75);
}

.dashboard-grade-tab:focus-visible {
    outline: 2px solid #ff8b6a;
    outline-offset: 2px;
}

.dashboard-grade-tab.active {
    color: #2b2b2b;
    border-bottom-color: #ff8b6a;
}

.dashboard-grade-panel-section {
    margin-top: 12px;
}

.dashboard-grade-panel-section-title {
    font-size: 0.9em;
}

.dashboard-review-list {
    margin-top: 4px;
}

.dashboard-review-item {
    font-size: 0.9em;
    color: #2b2b2b;
    margin: 2px 0 8px 0;
}

/* Subject label used both above a review sentence and above a grouped list
   of recent tests - one class keeps both spots visually consistent. */
.dashboard-subject-heading {
    /* rem, not em - this class is used both inside and outside
       .dashboard-review-item's own font-size scaling, and em would
       compound with that ancestor context, rendering inconsistently. */
    font-size: 0.9rem;
    font-weight: 700;
    color: #ff8b6a;
    margin-top: 0.25rem;
}

.dashboard-empty-note {
    color: rgb(43 43 43 / 0.45);
    font-size: 0.9em;
}

/* --- Empty & loading states --- */
.dashboard-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.dashboard-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.6;
}

.dashboard-empty p {
    color: rgb(43 43 43 / 0.55);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.dashboard-empty .empty-action {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.55rem 1.25rem;
    background: #ff8b6a;
    color: white;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 3px 0 #e06e4c;
    transition: background 0.15s, transform 0.15s;
}

.dashboard-empty .empty-action:hover {
    background: #ff7a55;
    transform: translateY(-1px);
}

.loading-msg {
    text-align: center;
    color: rgb(43 43 43 / 0.45);
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* --- Subject cards (child dashboard) --- */
.child-dashboard-subjects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.child-subject-card {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.child-subject-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 16px rgb(30 64 175 / 0.12);
    transform: translateY(-2px);
}

.child-subject-card .subject-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.child-subject-card .subject-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

.child-subject-card .subject-card-start {
    font-size: 0.75rem;
    color: #1e40af;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* dashboard fade-in animation */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-animate > * {
    animation: fade-in-up 0.3s ease both;
}

/* ── In-session rewards ─────────────────────────────────────────── */
/* Fixed to the viewport (not a flex child of #chat, and not merely
   absolute within #chat-scroll - the scroll container's content grows
   and is kept pinned to the bottom, which would carry an absolutely
   positioned overlay out of view) so toasts/badges float above
   messages, stay visible regardless of scroll position, and never
   shift message layout when they appear or are removed. */
.reward-overlay {
    position: fixed;
    top: calc(4rem + 3rem + 12px); /* below nav + session bar */
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 50;
}

.reward-toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    animation:
        reward-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both,
        reward-float 2.6s ease-in forwards;
}

.reward-streak {
    font-size: 0.95rem;
}

.reward-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 16px;
    background: #fff;
    border: 2px solid #fcd34d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    animation: reward-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.reward-badge-out {
    animation: fade-in 0.4s ease reverse both;
}

.reward-badge-icon {
    font-size: 2rem;
    line-height: 1;
}

.reward-badge-text {
    display: flex;
    flex-direction: column;
}

.reward-badge-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #f59e0b;
}

.reward-badge-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

@keyframes reward-pop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes reward-float {
    0%,
    70% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-14px);
    }
}

.dashboard-animate > *:nth-child(1) {
    animation-delay: 0s;
}
.dashboard-animate > *:nth-child(2) {
    animation-delay: 0.05s;
}
.dashboard-animate > *:nth-child(3) {
    animation-delay: 0.1s;
}
.dashboard-animate > *:nth-child(4) {
    animation-delay: 0.15s;
}
.dashboard-animate > *:nth-child(5) {
    animation-delay: 0.2s;
}
.dashboard-animate > *:nth-child(6) {
    animation-delay: 0.25s;
}
.dashboard-animate > *:nth-child(7) {
    animation-delay: 0.3s;
}
.dashboard-animate > *:nth-child(8) {
    animation-delay: 0.35s;
}

/* ============================================================
   Subject picker / child dashboard (legacy)
   ============================================================ */
.subject-picker {
    text-align: center;
}

.subject-picker h2 {
    margin-bottom: 0.5rem;
    color: #1e40af;
}

.subject-picker p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.subject-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subject-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    color: #1e40af;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
}

.subject-btn:hover {
    border-color: #1e40af;
    background: #eff6ff;
}

/* ============================================================
   tutor.html - layout
   ============================================================ */
#chat-scroll {
    flex: 1;
    overflow-y: auto;
    background: #fbf7ec;
}

#chat {
    padding: 1.5rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================
   tutor.html - messages
   ============================================================ */
.message {
    position: relative;
    padding: 0.85rem 1.25rem;
    border-radius: 1.15rem;
    line-height: 1.6;
    animation: msg-in 0.2s ease both;
}

@keyframes msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message p {
    margin-bottom: 0.5rem;
}

.message p:last-child {
    margin-bottom: 0;
}

.message.user {
    align-self: flex-end;
    background: #5c8e77;
    color: white;
    border-radius: 1.15rem 1.15rem 0.35rem 1.15rem;
    box-shadow: 0 2px 8px rgb(43 43 43 / 0.14);
}

.message.assistant {
    align-self: flex-start;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.07);
    color: #2b2b2b;
    border-radius: 1.15rem 1.15rem 1.15rem 0.35rem;
    box-shadow: 0 2px 10px rgb(43 43 43 / 0.05);
}

.message.assistant > ul,
.message.assistant > ol {
    margin-left: 18px;
}

.message.error {
    align-self: flex-start;
    max-width: 85%;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ============================================================
   tutor.html - avatar + timestamp wrapper around each bubble
   ============================================================ */
.message-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 85%;
}

.message-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-row.assistant {
    align-self: flex-start;
}

.message-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.message-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    overflow: hidden;
}

.message-row.assistant .message-avatar {
    background: #eaf4ee;
}

.message-row.assistant .message-avatar img {
    width: 1.8rem;
    height: 1.8rem;
    object-fit: contain;
}

.message-row.user .message-avatar {
    background: #5c8e77;
    color: white;
}

.message-time {
    font-size: 0.72rem;
    color: #9aa5b1;
    margin-top: 0.3rem;
    padding: 0 0.35rem;
}

.message-row.user .message-time {
    align-self: flex-end;
    text-align: right;
    width: 80px;
}

.message-row.assistant .message-time {
    text-align: left;
}

.copy-btn {
    position: absolute;
    top: -0.45rem;
    right: -0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgb(43 43 43 / 0.15);
    cursor: pointer;
    padding: 0.28rem;
    color: #6b7280;
    opacity: 0.85;
    transition:
        opacity 0.15s,
        background 0.15s,
        color 0.15s;
}

.copy-btn svg {
    width: 100%;
    height: 100%;
}

.copy-btn:hover,
.copy-btn:focus-visible {
    opacity: 1;
}

.copy-btn:hover {
    background: rgb(43 43 43 / 0.06);
}

.copy-btn.copied {
    opacity: 1;
    color: #5c8e77;
    border-color: #5c8e77;
}

.typing {
    align-self: flex-start;
    padding: 0.75rem 1rem;
    border-radius: 1.15rem 1.15rem 1.15rem 0.35rem;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.07);
    box-shadow: 0 2px 10px rgb(43 43 43 / 0.05);
    font-style: italic;
    color: rgb(43 43 43 / 0.5);
}

/* ============================================================
   tutor.html - footer / chat form
   ============================================================ */
footer {
    background: #fefdfa;
    border-top: 1px solid rgb(43 43 43 / 0.06);
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    flex-shrink: 0;
}

body.tutor form {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

body.tutor input {
    width: auto;
    flex: 1;
    padding: 0.75rem 1.1rem;
    border: none;
    background: #f7f4ec;
    border-radius: 999px;
    font-size: 1rem;
    color: #2b2b2b;
    outline: none;
}

body.tutor input::placeholder {
    color: rgb(43 43 43 / 0.4);
}

body.tutor button[type="submit"] {
    width: auto;
    padding: 0.75rem 1.5rem;
    font-weight: 800;
    background: #ff8b6a;
    color: #fff;
    border: none;
    border-radius: 999px;
    box-shadow: 0 3px 0 #e06e4c;
    cursor: pointer;
}

body.tutor button[type="submit"]:hover {
    background: #ff7a55;
}

body.tutor button[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #e06e4c;
}

/* ============================================================
    Kid-friendly Dashboard
    ============================================================ */
.kid-dashboard {
    padding: 0.5rem 0 2rem;
}

/* Hero subtitle under the welcome heading */
.kid-hero-sub {
    color: rgb(43 43 43 / 0.55);
    font-size: 1rem;
    font-weight: 600;
    margin-top: -0.5rem;
}

/* Points pill (sits in the hero row, right of the heading) */
.kid-points {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.05);
    flex-shrink: 0;
    align-self: flex-start;
}

.kid-points-label {
    font-size: 0.95rem;
    color: rgb(43 43 43 / 0.6);
    font-weight: 700;
}

.kid-points-value {
    font-size: 1.05rem;
    color: #ff8b6a;
    font-weight: 800;
}

@media (max-width: 900px) {
    .kid-points {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Stats row */
.kid-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .kid-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kid-stat-card {
    border-radius: 1.15rem;
    padding: 1.35rem 1rem;
    border: 1.5px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.kid-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
}

.kid-stat-pink {
    background: #fdece4;
    border-color: transparent;
}
.kid-stat-pink .kid-stat-number { color: #c9714a; }
.kid-stat-pink .kid-stat-label { color: rgb(43 43 43 / 0.55); }

.kid-stat-teal {
    background: #eaf4ee;
    border-color: transparent;
}
.kid-stat-teal .kid-stat-number { color: #5c8e77; }
.kid-stat-teal .kid-stat-label { color: rgb(43 43 43 / 0.55); }

.kid-stat-cream {
    background: #fbf3de;
    border-color: transparent;
}
.kid-stat-cream .kid-stat-number { color: #b48a1e; }
.kid-stat-cream .kid-stat-label { color: rgb(43 43 43 / 0.55); }

.kid-stat-purple {
    background: #f1edfa;
    border-color: transparent;
}
.kid-stat-purple .kid-stat-number { color: #7c6bb0; }
.kid-stat-purple .kid-stat-label { color: rgb(43 43 43 / 0.55); }

.kid-stat-number {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.kid-stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Section titles */
.kid-section {
    margin-bottom: 2rem;
}

.kid-section-title {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 1rem;
}

/* Course cards */
.kid-courses {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .kid-courses {
        grid-template-columns: repeat(2, 1fr);
    }
}

.kid-course-card {
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.08);
    border-radius: 1.15rem;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    min-width: 0;
}

.kid-course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgb(43 43 43 / 0.09);
    border-color: rgb(43 43 43 / 0.14);
}

.kid-course-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.kid-course-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
}

.kid-course-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.kid-course-name {
    font-weight: 700;
    font-size: 1rem;
    color: #2b2b2b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kid-course-meta {
    font-size: 0.82rem;
    color: rgb(43 43 43 / 0.45);
}

/* Primary "Συνέχισε" button pinned to the right of the top row */
.kid-course-top .kid-course-btn-primary {
    margin-left: auto;
    flex-shrink: 0;
}

.kid-course-bar-wrap {
    margin-bottom: 0.75rem;
}

.kid-course-bar {
    height: 8px;
    background: #eee9db;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.05);
}

.kid-course-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.kid-course-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.kid-course-pct {
    font-size: 0.9rem;
    font-weight: 800;
    color: rgb(43 43 43 / 0.65);
    background: #f7f4ec;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

/* Course action buttons */
.kid-course-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kid-course-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.kid-course-btn-primary {
    background: #ff8b6a;
    color: white;
    font-weight: 800;
    box-shadow: 0 3px 0 #e06e4c;
}

.kid-course-btn-primary:hover {
    background: #ff7a55;
    box-shadow: 0 3px 0 #e06e4c;
    transform: translateY(-1px);
}

.kid-course-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #e06e4c;
}

.kid-course-btn-secondary {
    background: #f7f4ec;
    color: rgb(43 43 43 / 0.75);
    border: 1px solid rgb(43 43 43 / 0.08);
}

.kid-course-btn-secondary:hover {
    background: #efe9dd;
    border-color: rgb(43 43 43 / 0.14);
}

/* Achievements */
.kid-achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.kid-achievement {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.1);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #2b2b2b;
    transition: transform 0.15s, box-shadow 0.15s;
}

.kid-achievement:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
}

.kid-achievement-icon {
    font-size: 1.15rem;
}

/* ============================================================
    Kid mode - warm mockup theme (scoped to child pages only so the
    parent dashboard / marketing pages keep the blue theme). The class
    is added by JS on the child dashboard + subject page and baked into
    the tutor body_class.
    ============================================================ */
body.kid-mode {
    background: #fbf7ec;
    font-family: "Nunito", "Noto Sans Greek", system-ui, sans-serif;
    color: #2b2b2b;
}

body.kid-mode.marketing-page {
    background: #fbf7ec;
}

/* Light, warm nav to sit over the cream page instead of the blue bar */
body.kid-mode .site-nav,
body.kid-mode.marketing-page.has-nav .site-nav {
    background: #fefdfa;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgb(43 43 43 / 0.06);
    box-shadow: 0 1px 3px rgb(43 43 43 / 0.05);
}

body.kid-mode .site-nav .nav-brand-text {
    color: #2b2b2b;
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
}

body.kid-mode .site-nav a:not(.nav-brand) {
    color: rgb(43 43 43 / 0.65);
    background: #ffffff;
    border: 1px solid rgb(43 43 43 / 0.08);
}

body.kid-mode .site-nav a:not(.nav-brand):hover {
    background: #f7f4ec;
    border-color: rgb(43 43 43 / 0.14);
    color: #2b2b2b;
}

body.kid-mode .site-nav a.active {
    background: #fdece4;
    border: 1px solid rgb(255 139 106 / 0.3);
    color: #ff8b6a;
    padding-bottom: 0.35rem;
}

body.kid-mode .site-nav .nav-logout {
    background: #ffffff;
    border: 1px solid rgb(43 43 43 / 0.15);
    color: #2b2b2b;
}

body.kid-mode .site-nav .nav-logout:hover {
    background: #f7f4ec;
    border-color: rgb(43 43 43 / 0.2);
    color: #2b2b2b;
}

body.kid-mode .nav-usage[data-state="normal"] {
    --nav-usage-color: #5c8e77;
}

body.kid-mode .nav-toggle:hover {
    background: #f7f4ec;
}

body.kid-mode .nav-toggle-bar {
    background: rgb(43 43 43 / 0.75);
}

/* Kid dashboard hero: drop the marketing gradient card, adopt the warm
   welcome header with the coral accent badge from the mockup. */
body.kid-mode .dashboard-page .homepage-hero {
    background: transparent;
    padding: 1.5rem 0 0.5rem;
    align-items: flex-start;
    justify-content: space-between;
}

body.kid-mode .subject-page .homepage-hero {
    background: transparent;
}

body.kid-mode .hero-badge {
    background: #fdece4;
    color: #c9714a;
}

body.kid-mode .hero-badge-dot {
    background: #ff8b6a;
}

body.kid-mode h1.hero-heading {
    color: #2b2b2b;
}

/* ============================================================
    Lightbox
    ============================================================ */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    cursor: zoom-out;
    padding: 1rem;
    animation: fade-in 0.15s ease;
}

#lightbox.hidden {
    display: none;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 8px 40px rgb(0 0 0 / 0.5);
}

/* ============================================================
   Photo preview modal
   ============================================================ */
#photo-overlay {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
    backdrop-filter: blur(4px);
    animation: fade-in 0.15s ease;
}

#photo-overlay.hidden {
    display: none;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#photo-modal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgb(0 0 0 / 0.25);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: slide-up 0.2s ease;
}

@keyframes slide-up {
    from {
        transform: translateY(12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#photo-modal-img-wrap {
    width: 100%;
    max-height: 52vh;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

#photo-preview-img {
    width: 100%;
    max-height: 52vh;
    object-fit: contain;
    display: block;
}

.crop-box {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2000px rgb(0 0 0 / 0.5);
    touch-action: none;
    cursor: move;
}

.crop-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
    touch-action: none;
}

.crop-handle[data-corner="nw"] {
    top: -9px;
    left: -9px;
    cursor: nwse-resize;
}
.crop-handle[data-corner="ne"] {
    top: -9px;
    right: -9px;
    cursor: nesw-resize;
}
.crop-handle[data-corner="sw"] {
    bottom: -9px;
    left: -9px;
    cursor: nesw-resize;
}
.crop-handle[data-corner="se"] {
    bottom: -9px;
    right: -9px;
    cursor: nwse-resize;
}

#photo-modal-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 0;
}

#photo-filename {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

#photo-filesize {
    font-size: 0.8rem;
    color: #94a3b8;
    flex-shrink: 0;
}

#photo-warning {
    margin: 0.5rem 1.25rem 0;
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

#photo-warning.hidden {
    display: none;
}

#photo-modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    justify-content: flex-end;
}

#photo-retake-btn {
    width: auto;
    padding: 0.6rem 1.1rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

#photo-retake-btn:hover {
    background: #e2e8f0;
}

#photo-confirm-btn {
    width: auto;
    padding: 0.6rem 1.25rem;
    background: #1e40af;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

#photo-confirm-btn:hover {
    background: #1e3a8a;
}

/* ============================================================
   Image thumbnail in chat bubble
   ============================================================ */
/* Image bubbles get their own compact treatment */
.message.image-bubble {
    padding: 0;
    max-width: min(400px, 80vw);
    background: transparent;
    border: none;
    line-height: 0;
}

.chat-image-thumb {
    display: block;
    width: min(400px, 80vw);
    height: min(300px, 60vw);
    object-fit: cover;
    border-radius: 0.75rem;
    cursor: pointer;
}

#staging-tray {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    overflow-x: auto;
}
#staging-tray.hidden {
    display: none;
}
.staged-thumb {
    position: relative;
    flex: 0 0 auto;
}
.staged-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}
.staged-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    cursor: pointer;
    padding: 0;
}
.chat-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
/* Inside a multi-image bubble, shrink thumbnails so a whole test (several
   pages) reads as a compact grid instead of a stack of full-size photos.
   A single image (grid with one child) keeps a larger, more legible size. */
.chat-image-grid .chat-image-thumb {
    width: min(150px, 28vw);
    height: min(150px, 28vw);
}
.chat-image-grid:has(.chat-image-thumb:only-child) .chat-image-thumb {
    width: min(400px, 80vw);
    height: min(300px, 60vw);
}
.image-caption {
    margin-top: 6px;
}

#camera-btn {
    width: auto;
    padding: 0.3rem 1rem 0.75rem 1rem;
    background: #f7f4ec;
    color: #475569;
    border: none;
    border-radius: 999px;
    font-size: 1.1rem;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
    flex-shrink: 0;
    font-weight: normal;
}

#camera-btn:hover {
    background: #efe9dd;
}

#camera-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ============================================================
   Scan bubble (inline assistant thinking message)
   ============================================================ */
.message.scanning {
    align-self: flex-start;
    background: #fefdfa;
    border: 1px solid rgb(43 43 43 / 0.07);
    box-shadow: 0 2px 10px rgb(43 43 43 / 0.05);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-style: italic;
    color: rgb(43 43 43 / 0.55);
}

.scan-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgb(43 43 43 / 0.15);
    border-top-color: #ff8b6a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ============================================================
   Mobile - footer chat form wraps onto two rows
   ============================================================ */
@media (max-width: 600px) {
    footer {
        padding: 0.65rem 0.75rem;
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
    }

    /* Anchor the dropdown to the viewport so its fixed width can't push it
       off the left edge when the bell sits near the right of the screen. */
    .notif-dropdown {
        position: fixed;
        top: 3.75rem;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        max-height: calc(100vh - 4.5rem);
    }

    body.tutor form {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    body.tutor input {
        /* Take the full width on the first row */
        flex: 1 1 100%;
        padding: 0.65rem 0.75rem;
        font-size: 0.95rem;
    }

    #camera-btn {
        /* Grow equally to fill the second row alongside the submit button */
        flex: 1 1 0;
        padding: 0.65rem 0;
        font-size: 1rem;
    }

    body.tutor button[type="submit"] {
        flex: 2 1 0; /* submit gets twice the share so it feels primary */
        padding: 0.65rem 0;
    }
}

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

/* Responsive iframes (e.g., YouTube embeds in chat) */
#chat iframe,
div#chat iframe,
div.message iframe,
.message.assistant iframe,
.message iframe,
section#chat-container iframe {
    width: 100% !important;
    max-width: 560px !important;
    min-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 0.5rem;
    display: block !important;
    margin: 0 auto !important;
}

/* Message rating */
.message-rating {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
    justify-content: flex-end;
}

.rating-btn {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgb(43 43 43 / 0.05);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.5;
    transition:
        opacity 0.15s,
        background 0.15s,
        transform 0.1s;
}

.rating-btn:hover {
    opacity: 1;
    background: rgb(43 43 43 / 0.1);
    transform: translateY(-1px);
}

.rating-btn.active {
    opacity: 1;
    background: #fdece4;
}

/* Feedback modal */
#rating-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#rating-modal.open {
    display: flex;
}

#rating-modal-inner {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: min(90vw, 400px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#rating-modal-inner textarea {
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    padding: 10px;
    resize: vertical;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
}

.rating-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.rating-modal-actions button {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
}

#rating-modal-submit {
    background: #ff8b6a;
    color: #fff;
    font-weight: 700;
}

#rating-modal-cancel {
    background: #f7f4ec;
    color: #2b2b2b;
    font-weight: 600;
}

/* ============================================================
   Usage blocked overlay - tutor.html
   ============================================================ */
#usage-blocked-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#usage-blocked-overlay.hidden {
    display: none;
}
#usage-blocked-modal {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
#usage-blocked-modal #usage-blocked-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    width: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
}
#usage-blocked-modal #usage-blocked-close:hover {
    color: #475569;
}
#usage-blocked-icon {
    font-size: 2.5rem;
}
#usage-blocked-modal h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}
#usage-blocked-modal p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}
.usage-blocked-cta {
    display: inline-block;
    background: #4f46e5;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    margin-top: 0.25rem;
    transition: background 0.15s;
}
.usage-blocked-cta:hover {
    background: #4338ca;
}

/* ============================================================
   Logged-out homepage hero - index.html unauthenticated view
   ============================================================ */
.dashboard-container.homepage-hero-container {
    max-width: 1100px;
}

.homepage-hero {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: linear-gradient(135deg, #fdfbf0, #fbf7e8);
    border-radius: 1.5rem;
    padding: 3rem;
    font-family: "Nunito", "Noto Sans Greek", system-ui, sans-serif;
}

.hero-copy {
    flex: 1;
    min-width: 280px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #d7f4e6;
    color: #0f9d74;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #12b76a;
    display: inline-block;
}

h1.hero-heading {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    color: #111827;
    margin-bottom: 1.25rem;
}

.hero-highlight {
    color: #2bb99c;
}

.hero-sub {
    color: #57606f;
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 480px;
}

.hero-tooltip {
    position: relative;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    cursor: help;
}

.hero-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 0.6rem);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 260px;
    background: #111827;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    z-index: 10;
    pointer-events: none;
}

.hero-tooltip:hover::after,
.hero-tooltip:focus::after {
    opacity: 1;
    visibility: visible;
}

.hero-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.hero-login-hint {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.hero-login-hint a {
    color: #1e40af;
    text-decoration: none;
}

.hero-login-hint a:hover {
    text-decoration: underline;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 0.9rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.hero-btn-primary {
    background: #f2966a;
    color: #fff;
    box-shadow: 0 8px 20px rgb(242 150 106 / 0.35);
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
}

.hero-btn-secondary {
    background: #fff;
    color: #3f3f46;
    border: 1px solid #e5e7eb;
}

.hero-btn-secondary:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
}

.hero-visual {
    position: relative;
    flex: 0 0 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual-blob {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 30%, #eafaf3, transparent 70%);
    z-index: 0;
}

.hero-owl {
    position: relative;
    z-index: 1;
    width: 300px;
    height: auto;
}

@media (max-width: 900px) {
    .homepage-hero {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem 1.5rem 2rem;
        gap: 0.5rem;
    }

    .hero-copy {
        order: 2;
    }

    .hero-visual {
        order: 1;
        flex-basis: 180px;
    }

    .hero-visual-blob {
        width: 180px;
        height: 180px;
    }

    .hero-owl {
        width: 160px;
    }

    .hero-sub {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }
}

/* --- Marketing homepage --- */
.marketing {
    max-width: 1100px;
    padding: 0 1.5rem;
    font-family: "Nunito", "Noto Sans Greek", system-ui, sans-serif;
}

.mkt-section {
    margin-top: 4rem;
}

.mkt-section-title {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    color: #111827;
    text-align: center;
    margin-bottom: 2rem;
}

.mkt-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.mkt-step {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    text-align: center;
}

.mkt-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #d7f4e6;
    color: #0f9d74;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.mkt-step-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.mkt-step-text {
    color: #57606f;
    font-size: 0.95rem;
    line-height: 1.55;
}

.mkt-values {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.mkt-value-card {
    background: linear-gradient(135deg, #fdfbf0, #fbf7e8);
    border-radius: 1.25rem;
    padding: 1.75rem 1.25rem;
    text-align: center;
}

.mkt-value-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.mkt-value-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.4rem;
}

.mkt-value-text {
    color: #57606f;
    font-size: 0.9rem;
    line-height: 1.5;
}

.mkt-cta {
    margin-top: 4rem;
    background: linear-gradient(135deg, #fbf6df, #f5ecc4);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
}

.mkt-cta-title {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #111827;
    margin-bottom: 1.5rem;
}

.mkt-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-weight: 700;
    color: #111827;
}

.mkt-footer-logo {
    height: 1.5rem;
    width: auto;
}

@media (max-width: 900px) {
    .mkt-steps {
        grid-template-columns: 1fr;
    }

    .mkt-values {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .mkt-values {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Login page (shares marketing look & feel)
   ============================================================ */
.login-page .login-hero {
    align-items: flex-start;
}

.login-form {
    width: 100%;
    max-width: 420px;
    margin-top: 0.5rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #57606f;
    margin-bottom: 0.4rem;
}

.login-form input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
    outline: none;
    border-color: #2bb99c;
    box-shadow: 0 0 0 3px rgb(43 185 156 / 0.15);
}

.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.login-form .error,
.login-form .success {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
    .login-page .login-hero {
        text-align: center;
    }

    .login-form {
        margin-left: auto;
        margin-right: auto;
    }

    .login-form label {
        text-align: left;
    }
}

/* ============================================================
   Signup page - hero layout (only elements unique to signup.html's
   markup, or scoped under .signup-page, are safe to leave unscoped -
   login.html shares .login-hero/.hero-visual/.hero-owl but has none
   of the overrides below, so scope anything that touches those shared
   classes under .signup-page to avoid changing login.html's look)
   ============================================================ */
.login-hero .hero-title-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.login-hero .hero-title-text {
    flex: 1;
    min-width: 0;
}

.login-hero .hero-title-text .hero-badge {
    margin-bottom: 0.75rem;
}

.login-hero .hero-title-text .hero-heading {
    margin-bottom: 0;
}

.signup-page .login-hero .hero-visual {
    flex: 0 0 auto;
    width: 140px;
    height: 140px;
}

.signup-page .login-hero .hero-visual-blob {
    width: 140px;
    height: 140px;
}

.signup-page .login-hero .hero-owl {
    width: 120px;
}

.signup-page .login-form {
    max-width: none;
}

@media (max-width: 600px) {
    .login-hero .hero-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .signup-page .login-hero .hero-visual {
        width: 110px;
        height: 110px;
    }

    .signup-page .login-hero .hero-visual-blob {
        width: 110px;
        height: 110px;
    }

    .signup-page .login-hero .hero-owl {
        width: 95px;
    }
}

/* ============================================================
   Signup page - plan selection cards (#plans-container)
   Named distinctly from pricing.html's .plan-card/.plan-badge/
   .plan-coming-soon, which are a different component with different
   styling - reusing those names here would silently bleed into
   pricing.html since both live in this shared stylesheet.
   ============================================================ */
.signup-plan-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px 0;
}

@media (max-width: 480px) {
    .signup-plan-cards {
        grid-template-columns: 1fr;
    }
}

.signup-plan-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.signup-plan-card:hover {
    border-color: #cbd5e1;
}

.signup-plan-card.selected {
    border-color: #2bb99c;
    background: #eafaf3;
}

.signup-plan-card .plan-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.signup-plan-card .plan-badge.free {
    background: #dcfce7;
    color: #166534;
}

.signup-plan-card .plan-badge.paid {
    background: #d7f4e6;
    color: #0f9d74;
}

.signup-plan-card .plan-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.signup-plan-card .plan-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
}

.signup-plan-card .plan-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: #6b7280;
}

.signup-plan-card .plan-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 8px;
}

.signup-plan-card .plan-free-label {
    display: inline-block;
    font-size: 0.75rem;
    color: #16a34a;
    margin-top: 6px;
}

.signup-plan-card .plan-per-child {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 6px;
}

.signup-plan-loading {
    color: #6b7280;
    font-size: 0.9rem;
    padding: 12px 0;
}

.signup-plan-card.inactive {
    opacity: 0.5;
    cursor: default;
}

.signup-plan-card .plan-coming-soon {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    margin-top: 6px;
}

.signup-plan-hint {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.signup-parent-note {
    margin-top: 5px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #0f9d74;
    background: #eafaf3;
    border: 1px solid #d7f4e6;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 5px 0 20px 0;
}

.signup-parent-note strong {
    display: block;
    margin-bottom: 4px;
    color: #0f9d74;
}

/* ── Pricing page ── */
.pricing-hero {
    text-align: center;
    margin-bottom: 32px;
}
.pricing-hero h1 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}
.pricing-hero p {
    color: #57606f;
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto;
}

/* Desktop grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 6 rows: badge | name | price | credits | free-note | cta */
    grid-template-rows: auto auto auto auto auto auto;
    width: 100%;
    max-width: 860px;
    margin: 0 auto 32px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.08);
    overflow: hidden;
}
.pg-cell {
    padding: 0 16px;
    border-right: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.pg-cell:nth-child(4n) { border-right: none; }

/* Row-specific padding/borders */
.pg-row-badge      { padding-top: 20px; padding-bottom: 6px; }
.pg-row-name       { padding-top: 0;    padding-bottom: 4px; }
.pg-row-price      { padding-top: 4px;  padding-bottom: 4px; }
.pg-row-credits    { padding-top: 0;    padding-bottom: 4px; }
.pg-row-freenote   { padding-top: 0;    padding-bottom: 6px; min-height: 36px; }
.pg-row-cta        { padding-top: 10px; padding-bottom: 18px; }

.pg-cell.inactive  { background: #fafafa; }

/* Mobile cards */
.pricing-cards {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 32px;
}
.plan-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.plan-card.inactive { opacity: 0.6; }

@media (max-width: 640px) {
    .pricing-grid  { display: none; }
    .pricing-cards { display: flex; }
}

/* Shared plan elements */
.plan-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.plan-badge.free { background: #dcfce7; color: #166534; }
.plan-badge.paid { background: #d7f4e6; color: #0f9d74; }
.plan-col-name {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}
.inactive .plan-col-name,
.plan-card.inactive .plan-col-name { color: #9ca3af; }
.plan-col-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
}
.inactive .plan-col-price,
.plan-card.inactive .plan-col-price { color: #9ca3af; }
.plan-col-price .per-month {
    font-size: 0.8rem;
    font-weight: 400;
    color: #6b7280;
}
.plan-credits {
    font-size: 0.82rem;
    color: #6b7280;
}
.inactive .plan-credits,
.plan-card.inactive .plan-credits { color: #9ca3af; }
.free-note {
    font-size: 0.72rem;
    color: #16a34a;
    font-weight: 500;
    line-height: 1.5;
}
.plan-cta {
    display: inline-block;
    background: #2bb99c;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 20px;
    border-radius: 8px;
    transition: background 0.15s;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.plan-cta:hover { background: #1f8f78; }
.plan-coming-soon {
    font-size: 0.78rem;
    font-weight: 600;
    color: #9ca3af;
}
.pricing-hint {
    font-size: 0.85rem;
    color: #0f9d74;
    max-width: 860px;
    margin: 0 auto;
    padding: 12px 16px;
    background: #eafaf3;
    border: 1px solid #d7f4e6;
    border-radius: 8px;
}

/* Billing period toggle */
.billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.billing-toggle-switch {
    position: relative;
    display: inline-flex;
    background: #fbfbfb;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
}
.billing-toggle-switch button {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #57606f;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.billing-toggle-switch button.active {
    color: #fff;
    background: #2bb99c;
    box-shadow: 0 1px 3px rgb(43 185 156 / 0.35);
}
.billing-toggle-switch button .save-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #0f9d74;
    background: #d7f4e6;
    padding: 1px 7px;
    border-radius: 999px;
}
.billing-toggle-switch button.active .save-badge {
    color: #0f9d74;
    background: #fff;
}
@media (max-width: 480px) {
    .billing-toggle { flex-direction: column; }
}

/* ============================================================
   Onboarding (welcome modal + carousel, checklist card)
   ============================================================ */
.onboarding-box {
    max-width: 400px;
    text-align: center;
}

.onboarding-slide {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.onboarding-icon {
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.onboarding-slide h3 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.15rem;
    color: #2b2b2b;
    margin: 0 0 0.6rem;
}

.onboarding-slide p {
    color: rgb(43 43 43 / 0.65);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 1rem 0;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgb(43 43 43 / 0.15);
    transition: background 0.15s, transform 0.15s;
}

.onboarding-dot.active {
    background: #ff8b6a;
    transform: scale(1.2);
}

.onboarding-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.onboarding-nav .onboarding-back {
    background: none;
    border: none;
    color: rgb(43 43 43 / 0.55);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.6rem 0.5rem;
}

.onboarding-nav .onboarding-back.hidden {
    visibility: hidden;
}

.onboarding-nav .onboarding-next {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 999px;
    background: #ff8b6a;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 3px 0 #e06e4c;
    transition: background 0.15s, transform 0.15s;
}

.onboarding-nav .onboarding-next:hover {
    background: #ff7a55;
    transform: translateY(-1px);
}

.onboarding-skip {
    display: block;
    margin: 0.75rem auto 0;
}

/* Parent "Ξεκίνα εδώ" checklist card, shown above the stats row until all
   steps are done, then removed entirely. */
.onboarding-checklist {
    background: #fefdfa;
    border: 1.5px solid rgb(255 139 106 / 0.25);
    border-radius: 1.15rem;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.03);
}

.onboarding-checklist-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 0.6rem;
}

.onboarding-checklist h3 {
    font-family: "Comfortaa", "Noto Sans Greek", system-ui, sans-serif;
    font-size: 1.05rem;
    color: #2b2b2b;
    margin: 0;
}

.onboarding-checklist-progress {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e06e4c;
}

.onboarding-checklist-bar {
    height: 5px;
    border-radius: 999px;
    background: rgb(43 43 43 / 0.08);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.onboarding-checklist-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #e06e4c;
    transition: width 0.3s ease;
}

.onboarding-checklist-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    font-size: 0.92rem;
    color: rgb(43 43 43 / 0.75);
}

.onboarding-checklist-item + .onboarding-checklist-item {
    border-top: 1px solid rgb(43 43 43 / 0.06);
}

.onboarding-checklist-item.done {
    color: rgb(43 43 43 / 0.4);
    text-decoration: line-through;
}

.onboarding-checklist-item.locked {
    color: rgb(43 43 43 / 0.35);
}

.onboarding-checklist-check {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.onboarding-checklist-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.onboarding-checklist-hint {
    font-size: 0.78rem;
    font-weight: 400;
    text-decoration: none;
    color: rgb(43 43 43 / 0.5);
}

.onboarding-checklist-item a {
    color: #e06e4c;
    font-weight: 700;
    text-decoration: none;
    margin-left: auto;
    flex-shrink: 0;
}

.onboarding-checklist-item a:hover {
    text-decoration: underline;
}


.kid-welcome-owl {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin: 0 auto 1rem;
    display: block;
}
