@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
    --primary:      #F97316;
    --primary-d:    #EA580C;
    --primary-l:    #FFF7ED;
    --primary-ll:   #FFEDD5;
    --gold:         #F59E0B;
    --bg:           #FFF8F3;
    --bg2:          #FFF1E6;
    --card:         #FFFFFF;
    --text:         #1C0A00;
    --muted:        #9A6A50;
    --border:       rgba(249,115,22,.16);
    --border-solid: #FFE0C8;
    --success:      #16A34A;
    --success-bg:   #F0FDF4;
    --danger:       #DC2626;
    --danger-bg:    #FEF2F2;
    --sidebar-w:    240px;
    --topbar-h:     62px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-d); }

/* ── TOPBAR ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    background: var(--card);
    border-bottom: 1.5px solid var(--border-solid);
    box-shadow: 0 1px 8px rgba(249,115,22,.07);
}
.brand {
    font-family: 'Nunito', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary-d);
    letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; color: var(--primary); }

.topbar-user {
    display: flex;
    align-items: center;
    gap: .9rem;
}
.topbar-user .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}
.topbar-user .user-name { font-weight: 700; font-size: .9rem; }
.topbar-user .user-role {
    font-size: .72rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-l);
    padding: .08rem .45rem;
    border-radius: 999px;
    border: 1px solid var(--border-solid);
    text-transform: capitalize;
}
.topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

/* ── LAYOUT ── */
.layout {
    display: flex;
    min-height: calc(100vh - var(--topbar-h));
}

/* ── SIDEBAR TOGGLE BUTTON ── */
.sb-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: .42rem .52rem;
    border-radius: 7px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    margin-right: .4rem;
}
.sb-toggle:hover { background: var(--primary-l); color: var(--primary-d); }
.sb-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .22s, opacity .22s, width .22s;
}
/* Animate to X when open (if you want — optional) */

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--card);
    border-right: 1.5px solid var(--border-solid);
    padding: 1.25rem 0 2rem;
    display: flex;
    flex-direction: column;
    transition: width .24s cubic-bezier(.4,0,.2,1),
                padding .24s, opacity .18s, border-color .24s;
    overflow: hidden;
}
/* Collapsed state */
body.sb-collapsed .sidebar {
    width: 0;
    padding: 0;
    border-color: transparent;
    opacity: 0;
}
.sidebar-section-label {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: .5rem 1.25rem .3rem;
}
.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0 .6rem;
}
.sidebar li a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .62rem .8rem;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: .88rem;
    transition: background .15s, color .15s;
}
.sidebar li a:hover {
    background: var(--primary-l);
    color: var(--primary-d);
    text-decoration: none;
}
.sidebar li.active a {
    background: var(--primary-ll);
    color: var(--primary-d);
    font-weight: 700;
}
.sidebar li.active a .icon {
    background: var(--primary);
    color: #fff;
    border-radius: 7px;
    padding: .18rem .25rem;
}
.sidebar .icon {
    width: 1.5rem;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── CONTENT ── */
.content {
    flex: 1;
    padding: 1.75rem 2rem;
    max-width: 1080px;
    min-width: 0;
}
body:not(.has-sidebar) .content {
    max-width: 880px;
    margin: 0 auto;
}

/* Page heading */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-family: 'Nunito', sans-serif; font-size: 1.65rem; font-weight: 900; margin: 0 0 .2rem; }
.page-header p   { color: var(--muted); margin: 0; font-size: .9rem; }

/* ── CARDS ── */
.card {
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 10px rgba(249,115,22,.05);
}
.card > h2:first-child,
.card > h3:first-child { margin-top: 0; font-family: 'Nunito', sans-serif; font-weight: 800; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}

/* Stat cards */
.stat-card {
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 10px rgba(249,115,22,.05);
    transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(249,115,22,.1); }
.stat-card .stat-num {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: .25rem;
}
.stat-card .stat-label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    border-radius: 9px;
    border: 1.5px solid var(--primary);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 700;
    font-family: inherit;
    transition: background .15s, transform .12s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--primary-d); border-color: var(--primary-d); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(249,115,22,.3); text-decoration: none; color: #fff; }
.btn:active { transform: none; }
.btn-ghost {
    background: transparent;
    color: var(--primary);
    border-color: var(--border-solid);
}
.btn-ghost:hover { background: var(--primary-l); border-color: var(--primary); box-shadow: none; color: var(--primary-d); }
.btn-secondary {
    background: var(--card);
    color: var(--text);
    border-color: var(--border-solid);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.btn-secondary:hover { background: var(--bg2); border-color: rgba(249,115,22,.3); box-shadow: none; color: var(--text); }
.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #FECACA;
}
.btn-danger:hover { background: #FEE2E2; box-shadow: none; color: var(--danger); }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; border-radius: 7px; }

/* ── FORMS ── */
label {
    display: block;
    font-weight: 700;
    font-size: .85rem;
    color: var(--text);
    margin: .9rem 0 .3rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: .65rem .85rem;
    border: 1.5px solid var(--border-solid);
    border-radius: 9px;
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}

/* Login/register centered form */
.auth-wrap {
    min-height: calc(100vh - var(--topbar-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 20px;
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(249,115,22,.08);
}
.auth-card .auth-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #FFF7ED, #FED7AA);
    border: 1.5px solid #FBD38D;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1.1rem;
}
.auth-card h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    text-align: center;
    margin: 0 0 .3rem;
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 1.25rem;
}
.auth-card .btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 1.25rem;
    padding: .75rem;
    font-size: 1rem;
    border-radius: 11px;
}
.auth-footer {
    text-align: center;
    margin-top: 1.1rem;
    font-size: .85rem;
    color: var(--muted);
}

/* ── ALERTS ── */
.alert {
    padding: .75rem 1rem;
    border-radius: 9px;
    margin-bottom: 1rem;
    font-size: .88rem;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1.5px solid #FECACA; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1.5px solid #BBF7D0; }

/* ── MISC UTILS ── */
.muted { color: var(--muted); }
.tag {
    display: inline-block;
    font-size: .74rem;
    font-weight: 600;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: var(--primary-l);
    border: 1px solid var(--border-solid);
    color: var(--primary-d);
}
.tag-success { background: var(--success-bg); border-color: #BBF7D0; color: var(--success); }
.tag-danger  { background: var(--danger-bg);  border-color: #FECACA; color: var(--danger); }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead tr { background: var(--bg2); }
th { text-align: left; padding: .7rem .75rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1.5px solid var(--border-solid); }
td { padding: .7rem .75rem; border-bottom: 1px solid var(--border-solid); vertical-align: middle; }
tbody tr:hover { background: #FFFBF8; }
tbody tr:last-child td { border-bottom: none; }

/* ── SPELLING TEST ── */
.word-stage {
    text-align: center;
    padding: 2.5rem 1rem;
}
.speak-btn {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #FFF7ED, #FED7AA);
    border: 2px solid #FBD38D;
    color: var(--primary);
    border-radius: 50%;
    width: 90px;
    height: 90px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(249,115,22,.15);
}
.speak-btn:hover { transform: scale(1.08); box-shadow: 0 8px 24px rgba(249,115,22,.25); }
.answer-row { display: flex; gap: .65rem; max-width: 380px; margin: 1.5rem auto 0; }
.answer-row input { flex: 1; }
.feedback { margin-top: 1rem; font-weight: 700; font-size: .98rem; }
.feedback.correct   { color: var(--success); }
.feedback.incorrect { color: var(--danger); }

/* ── FIND & FIX ── */
.broken-sentence span.word {
    cursor: pointer;
    padding: .1rem .22rem;
    border-radius: 5px;
    transition: background .12s;
}
.broken-sentence span.word:hover { background: #FED7AA; }
.broken-sentence span.word.selected { background: #FB923C; color: #fff; border-radius: 5px; }

/* ── LEARN WORD CARDS ── */
.word-card {
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 14px;
    padding: 1.25rem;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.word-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(249,115,22,.1); border-color: rgba(249,115,22,.3); }
.word-card h3 { font-family: 'Nunito', sans-serif; font-size: 1.15rem; font-weight: 900; margin: 0 0 .25rem; color: var(--text); }
.word-card .phonetic { font-size: .82rem; color: var(--primary); margin-bottom: .4rem; }
.word-card .definition { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; line-height: 1.55; }
.word-card .example { font-size: .82rem; color: var(--muted); font-style: italic; }
.speak-mini {
    background: none;
    border: 1.5px solid var(--border-solid);
    border-radius: 7px;
    color: var(--primary);
    cursor: pointer;
    padding: .25rem .45rem;
    font-size: 1rem;
    transition: background .15s;
    vertical-align: middle;
}
.speak-mini:hover { background: var(--primary-l); }

/* ── PHONICS CHART (Learn Words) ── */
.phonics-chart {
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 10px rgba(249,115,22,.05);
}

/* Main row: icon column + word columns side by side */
.ph-main-row {
    display: flex;
    align-items: stretch;
    border-bottom: 2px solid #1C0A00;
}

/* Left icons column */
.ph-icon-col {
    width: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: .85rem;
    border-right: 1.5px solid var(--border-solid);
}
.ph-icon-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform .15s;
}
.ph-icon-btn:hover { transform: scale(1.15); }

/* Word columns container */
.ph-cols {
    display: flex;
    flex: 1;
    overflow-x: auto;
}

/* Single phonics column */
.ph-col {
    flex: 1;
    min-width: 80px;
    border-right: 1.5px solid var(--border-solid);
    display: flex;
    flex-direction: column;
}
.ph-col:last-child { border-right: none; }

/* Column header — the sound pattern */
.ph-col-head {
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    padding: .7rem .5rem .55rem;
    border-bottom: 2px solid #1C0A00;
    letter-spacing: .02em;
}

/* Individual word in a column */
.ph-word {
    font-family: 'Nunito', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    padding: .25rem .4rem;
    color: var(--text);
    cursor: pointer;
    transition: background .12s;
    line-height: 1.3;
}
.ph-word:hover { background: var(--primary-l); }
.ph-word.exception { color: #B91C1C; }
.ph-col-body { flex: 1; padding: .35rem 0 .65rem; }

/* Phonics group highlight — red letters inside a word */
.ph-hl {
    color: #DC2626;
    font-style: normal;
    font-weight: 800;
}

/* Sight words row */
.ph-sight-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: .6rem 0 .6rem;
    border-top: 2px solid #1C0A00;
    background: var(--card);
}
.ph-sight-icon-cell {
    width: 52px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    font-size: 1.5rem;
    border-right: 1.5px solid var(--border-solid);
    align-self: stretch;
    align-items: center;
}
.ph-sight-words {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}
.ph-sight-word {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    padding: .15rem .4rem;
    border-radius: 5px;
    color: var(--text);
    transition: background .12s;
}
.ph-sight-word:hover { background: var(--primary-l); }

/* Example sentences */
.ph-sentences {
    padding: .75rem 1.25rem 1rem;
    border-top: 1.5px solid var(--border-solid);
}
.ph-sentence {
    font-family: 'Nunito', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #B91C1C;
    margin: .4rem 0;
    cursor: pointer;
    display: inline-block;
    border-radius: 5px;
    padding: .1rem .3rem;
    transition: background .12s;
}
.ph-sentence:hover { background: #FEF2F2; }

/* ── TOPIC SUB-NAV (Words / Vocabulary / Story) ── */
.ph-subnav {
    display: flex;
    gap: .3rem;
    border-bottom: 1.5px solid var(--border-solid);
    padding-bottom: .55rem;
    margin-bottom: .85rem;
}
.ph-subnav-btn {
    padding: .42rem .95rem;
    border: 1.5px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: background .14s, color .14s, border-color .14s;
}
.ph-subnav-btn:hover {
    background: var(--primary-l);
    color: var(--primary-d);
}
.ph-subnav-btn.active {
    background: var(--primary-ll);
    color: var(--primary-d);
    border-color: var(--border-solid);
}
.ph-sub         { display: none; }
.ph-sub.active  { display: block; }

/* ── VOCABULARY SECTION ── */
.vocab-list {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}
.vocab-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: .9rem 1.1rem;
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 12px;
    transition: box-shadow .15s;
}
.vocab-item:hover { box-shadow: 0 4px 14px rgba(249,115,22,.08); }
.vocab-item-word {
    min-width: 120px;
    flex-shrink: 0;
}
.vocab-item-word .vw-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text);
    cursor: pointer;
    transition: color .12s;
}
.vocab-item-word .vw-text:hover { color: var(--primary); }
.vocab-item-word .vw-text.exception { color: #B91C1C; }
.vocab-item-word .vw-phonetic {
    font-size: .8rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: .1rem;
}
.vocab-item-detail { flex: 1; }
.vocab-item-detail .vd-def {
    font-size: .9rem;
    color: var(--text);
    line-height: 1.55;
    margin-bottom: .3rem;
}
.vocab-item-detail .vd-ex {
    font-size: .85rem;
    color: var(--muted);
    font-style: italic;
}

/* ── STORY SECTION ── */
.ph-story-card {
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 14px;
    overflow: hidden;
}
.ph-story-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1.25rem;
    background: var(--primary-l);
    border-bottom: 1.5px solid var(--border-solid);
}
.ph-story-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--primary-d);
}
.ph-story-body {
    padding: 1.25rem 1.5rem 1.5rem;
    font-family: 'Nunito', sans-serif;
    font-size: 1.65rem;
    line-height: 1.9;
    color: var(--text);
}
.ph-story-para { margin: .85rem 0; }
.story-word {
    color: var(--primary-d);
    font-weight: 900;
    cursor: pointer;
    border-radius: 4px;
    padding: 0 .1rem;
    transition: background .12s;
}
.story-word:hover    { background: var(--primary-l); }
.story-word.exc-word { color: #B91C1C; }
.ph-story-empty {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

/* ── PHONICS TABS + MODE TOGGLE ── */
.ph-tabs-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.ph-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.ph-tab {
    display: inline-block;
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 9px;
    text-decoration: none !important;
    padding: .42rem 1.05rem;
    font-family: 'Nunito', sans-serif;
    font-size: .95rem;
    font-weight: 800;
    color: var(--muted);
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s, transform .12s;
    white-space: nowrap;
}
.ph-tab:hover {
    background: var(--primary-l);
    color: var(--primary-d);
    border-color: rgba(249,115,22,.4);
    transform: translateY(-1px);
}
.ph-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(249,115,22,.3);
}

/* Look / Write mode toggle */
.ph-mode-toggle {
    display: flex;
    gap: .25rem;
    background: var(--bg2);
    border: 1.5px solid var(--border-solid);
    border-radius: 10px;
    padding: .2rem;
    flex-shrink: 0;
}
.ph-mode-btn {
    padding: .38rem .95rem;
    border: none;
    border-radius: 7px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: background .14s, color .14s, box-shadow .14s;
}
.ph-mode-btn.active {
    background: var(--card);
    color: var(--primary-d);
    box-shadow: 0 1px 5px rgba(0,0,0,.09);
}

/* Panel visibility */
.ph-panel          { display: none; }
.ph-panel.active   { display: block; }

/* ── WRITE MODE ── */
.ph-write-section {
    background: var(--card);
    border: 1.5px solid var(--border-solid);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(249,115,22,.05);
}
.ph-write-intro {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .75rem 1.25rem;
    background: var(--primary-l);
    border-bottom: 1.5px solid var(--border-solid);
    font-size: .88rem;
    color: var(--primary-d);
    font-weight: 600;
}
.ph-write-intro p { margin: 0; }
.ph-write-grid {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1.1rem 1.25rem;
}
.ph-write-row {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.ph-hear-btn {
    flex-shrink: 0;
    min-width: 80px;
}
.ph-write-input {
    width: 180px !important;
    flex-shrink: 0;
    padding: .5rem .75rem !important;
}
.ph-write-input.ok  { border-color: var(--success) !important; background: var(--success-bg) !important; }
.ph-write-input.err { border-color: var(--danger)  !important; background: var(--danger-bg)  !important; }
.ph-check-btn { flex-shrink: 0; }
.ph-write-result {
    font-family: 'Nunito', sans-serif;
    font-size: .9rem;
    font-weight: 800;
    white-space: nowrap;
}
.ph-write-result.ok  { color: var(--success); }
.ph-write-result.err { color: var(--danger); }

/* ── SITE FOOTER ── */
.site-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: .8rem;
    color: var(--muted);
    border-top: 1px solid var(--border-solid);
    background: var(--card);
    position: relative;
    z-index: 10;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1.5px solid var(--border-solid);
        padding: .5rem 0;
    }
    .sidebar ul { display: flex; overflow-x: auto; padding: 0 .5rem; gap: .25rem; }
    .sidebar li a { white-space: nowrap; border-radius: 8px; padding: .5rem .75rem; }
    .sidebar li.active a { border-bottom: none; }
    .sidebar-section-label { display: none; }
    .content { padding: 1.25rem; }
}
