.pref-group { margin-bottom: 12px; }
.pref-group:last-child { margin-bottom: 0; }
.pref-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-dim);
    margin: 0 0 8px 2px;
}
.pref-list {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
}
.pref-row {
    padding: 12px 14px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid var(--border);
}
.pref-row:last-child { border-bottom: none; }
.pref-row-text { flex: 1; min-width: 0; }
.pref-row-title {
    font-size: 13.5px; color: var(--fg); font-weight: 500;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pref-row-title .lock-badge {
    font-size: 10px;
    padding: 1px 6px;
    background: var(--error-soft);
    color: var(--error);
    border-radius: var(--radius-pill);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.pref-row-sub { font-size: 11.5px; color: var(--fg-mute); margin-top: 3px; line-height: 1.45; }
.pref-row-sub b { color: var(--warning); }
.pref-row-sub code { font-family: var(--font-mono); background: var(--card-shade); padding: 1px 4px; border-radius: 3px; }

.switch {
    position: relative;
    width: 46px; height: 28px;
    flex-shrink: 0;
    cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    inset: 0;
    background: #bfbfbf;
    border-radius: var(--radius-pill);
    transition: background 160ms;
}
:root.dark .switch .slider { background: #555; }
.switch .slider::before {
    content: '';
    position: absolute;
    height: 24px; width: 24px;
    top: 2px; left: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 160ms;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch.locked .slider { opacity: 0.75; cursor: not-allowed; }
.switch.locked .slider::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='white'><path d='M4 7V5a4 4 0 118 0v2h1v8H3V7zm2 0h4V5a2 2 0 10-4 0z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 6px center;
    opacity: 0.9;
}

.btn {
    padding: 8px 16px;
    border-radius: var(--radius-button);
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--fg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 120ms;
    min-height: 36px;
}
.btn:hover { background: var(--card-shade); }
.btn.suggested {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: transparent; font-weight: 600;
}
.btn.suggested:hover { background: var(--accent-hover); }
.btn.destructive {
    background: var(--error);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

.prompt-input, .asm-edit-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-button);
    background: var(--card-bg);
    color: var(--fg);
    font-size: 14px;
    outline: none;
    transition: border-color 120ms, box-shadow 120ms;
    font-family: var(--font-mono);
}
.prompt-input:focus, .asm-edit-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.prompt-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--fg);
}
.prompt-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 8px;
    min-height: 16px;
}
.prompt-error:empty {
    display: none;
    margin-top: 0;
    min-height: 0;
}

.curriculum-row {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    gap: 12px;
    font-size: 13px;
}
.curriculum-row:last-child { border: none; }
.curriculum-row code { font-family: var(--font-mono); color: var(--accent); font-size: 12px; word-break: break-word; }
.curriculum-row.banned code { color: var(--error); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.curriculum-row .year { color: var(--fg-mute); font-size: 11px; font-family: var(--font-mono); }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    background: #2e3436;
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 240ms;
    z-index: 10000 !important;
    max-width: calc(100vw - 32px);
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* Curriculum dialog: scrollable body with a sub-title under each group */
#curriculumDialogBody {
    max-height: min(560px, calc(100vh - 180px));
    overflow-y: auto;
    padding-top: 6px;
}
.curriculum-group-sub {
    padding: 2px 14px 8px;
    color: var(--fg-mute);
    font-size: 11.5px;
    font-style: italic;
}
.curriculum-list { padding: 6px 14px; }

/* ============================================================
   ABOUT DIALOG
   Follows the AdwAboutWindow pattern: centered identity block,
   link row, pill view-switcher, and rounded list-box sections.
   All colors use the IDE's existing design tokens so light/dark
   themes both compose automatically.
   ============================================================ */
.about-dialog { width: min(480px, 100%); }
.about-body-wrap { padding: 24px; gap: 0; }

.about-title-bar { font-weight: 700; font-size: 14px; }

/* The About dialog\'s header buttons (back arrow + close X) are
   slightly larger than the default .hb-btn so they read clearly
   against the centered, larger title text. The icon SVG inside
   scales up to match. */
.about-dialog .dialog-header .hb-btn {
    width: 38px;
    height: 38px;
}
.about-dialog .dialog-header .hb-btn svg {
    width: 19px;
    height: 19px;
}

/* Identity block: app icon, name, developer, version (centered) */
.about-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 8px;
}
.about-app-icon {
    width: 96px; height: 96px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--accent-fg);
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    user-select: none;
}
.about-app-name {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    color: var(--fg);
    letter-spacing: -0.01em;
}
.about-developer {
    color: var(--fg-dim);
    font-size: 14px;
    margin-bottom: 2px;
}
.about-version {
    color: var(--fg-mute);
    font-size: 13px;
}

/* Link row under the identity block */
.about-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 18px;
}
.about-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--card-shade);
    color: var(--fg);
    font-size: 12.5px;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}
.about-link-btn:hover { background: var(--accent-soft); color: var(--accent); }
.about-link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.about-link-btn svg { width: 14px; height: 14px; opacity: 0.8; }

/* Pill view-switcher (AdwViewSwitcher analogue) */
.about-switcher {
    display: flex;
    gap: 4px;
    padding: 3px;
    margin: 0 auto 18px;
    background: var(--card-shade);
    border-radius: 8px;
    width: fit-content;
}
.about-switch-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--fg-dim);
    padding: 6px 18px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.about-switch-btn:hover { color: var(--fg); }
.about-switch-btn.active {
    background: var(--card-bg);
    color: var(--fg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.about-switch-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Pages */
.about-page { display: none; }
.about-page.active { display: block; }

.about-comment {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fg);
}
.about-comment strong { color: var(--fg); font-weight: 700; }
.about-comment em { color: var(--fg-dim); }
.about-quote {
    margin: 14px 0;
    text-align: center;
    color: var(--fg-dim);
    font-style: italic;
    font-size: 13px;
}
.about-aside {
    margin: 10px 2px 0;
    font-size: 12.5px;
    color: var(--fg-dim);
    line-height: 1.5;
    font-style: italic;
}

/* List box groups (AdwPreferencesGroup analogue). Header label then
   a rounded card holding action-row-like items. */
.about-group { margin-top: 18px; }
.about-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fg-dim);
    margin: 0 2px 8px;
}
.about-list {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.about-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--fg);
}
.about-row:last-child { border-bottom: 0; }
.about-row-key {
    flex: 0 0 auto;
    color: var(--fg-dim);
    font-size: 12.5px;
}
.about-row-val {
    flex: 1 1 auto;
    text-align: right;
    color: var(--fg);
    word-break: break-word;
}
.about-row-link { color: var(--accent); text-decoration: none; }
.about-row-link:hover { text-decoration: underline; }

/* Inline notice card (used for the ministry disclaimer) */
.about-notice {
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--fg);
}

/* Downloads list: same action-row visual language. Fetch button is
   the suggested-row style; the list scrolls when long. */
.about-downloads { max-height: 260px; overflow-y: auto; }
.about-downloads .about-row { gap: 10px; }
.about-download-notice {
    padding: 11px 14px;
    font-size: 12.5px;
    color: var(--fg-dim);
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
}
.about-download-notice:last-child { border-bottom: 0; }
.about-file-name {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.about-file-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 6px;
    padding: 3px 12px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.about-file-btn:hover:not(:disabled) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.about-file-btn:disabled { opacity: 0.5; cursor: default; }


.mys-desc {
    margin: 0;
}

.mys-desc-spaced {
    margin-top: 10px;
}

.ra-section-desc {
    margin: 0 0 10px;
    font-size: 11px;
}

.ra-form-compact {
    padding-top: 0;
}
