@import url('https://ticons.ticnob.com/dist/ticons-subset.css');

:root {
    --bg: #f3f6fc;
    --bg-elevated: #ffffff;
    --text: #102033;
    --ink: #102033;
    --text-muted: #36445a;
    --line: #d7dfeb;
    --panel: #ffffff;
    --soft: #eef3fb;
    --soft-strong: #e5edfb;
    --blue: #164db8;
    --blue-hover: #0c3e99;
    --blue-text: #123f98;
    --blue-soft: #e8efff;
    --green: #087a59;
    --green-soft: #e5f8f1;
    --green-text: #056245;
    --yellow: #8f5f00;
    --yellow-soft: #fff4db;
    --yellow-text: #6f4700;
    --red: #b91c1c;
    --red-soft: #fde9ea;
    --red-text: #8f161d;
    --pink: #d94e94;
    --text-inverse: #ffffff;
    --text-inverse-muted: #d8e2f2;
    --text-inverse-subtle: #bac7dd;
    --accent-text-on-soft: #123f98;
    --status-success-text: #055c3e;
    --status-warning-text: #6f4700;
    --status-danger-text: #8f161d;
    --rail-bg: #edf2fa;
    --shadow: rgba(16, 24, 40, 0.10);
    --shadow-lg: rgba(16, 24, 40, 0.16);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --border-radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

[data-theme="dark"] {
    --bg: #0b1220;
    --bg-elevated: #121b2d;
    --text: #e9effa;
    --ink: #e9effa;
    --text-muted: #c7d2e6;
    --line: #27344a;
    --panel: #111a2a;
    --soft: #172438;
    --soft-strong: #1e2e47;
    --blue: #8fb2ff;
    --blue-hover: #b5caff;
    --blue-text: #b5caff;
    --blue-soft: #172b52;
    --green: #7de4bd;
    --green-soft: #153528;
    --green-text: #a4f0d1;
    --yellow: #ffd779;
    --yellow-soft: #3c3014;
    --yellow-text: #ffe2a1;
    --red: #ff9aa2;
    --red-soft: #3d1d24;
    --red-text: #ffc2c7;
    --pink: #f28dc0;
    --text-inverse: #ffffff;
    --text-inverse-muted: #d8e2f2;
    --text-inverse-subtle: #bac7dd;
    --accent-text-on-soft: #b5caff;
    --status-success-text: #a4f0d1;
    --status-warning-text: #ffe2a1;
    --status-danger-text: #ffc2c7;
    --rail-bg: #0f1727;
    --shadow: rgba(0, 0, 0, 0.28);
    --shadow-lg: rgba(0, 0, 0, 0.40);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.amani-theme {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(circle at 12% 8%, rgba(47, 109, 246, 0.16), transparent 22%),
        radial-gradient(circle at 88% 12%, rgba(20, 184, 166, 0.11), transparent 18%),
        radial-gradient(circle at 14% 88%, rgba(217, 77, 148, 0.08), transparent 20%),
        linear-gradient(180deg, #f7f9fe 0%, #f2f6fd 42%, #fbfcff 100%);
    background-attachment: fixed;
}

body.amani-theme a {
    color: var(--blue);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

body.amani-theme a:hover {
    color: var(--blue-hover);
}

body.amani-theme button,
body.amani-theme input,
body.amani-theme select,
body.amani-theme textarea {
    font: inherit;
}

body.amani-theme button {
    cursor: pointer;
}

body.amani-theme :focus-visible {
    outline: 3px solid color-mix(in srgb, var(--blue) 24%, transparent);
    outline-offset: 2px;
}

img.amani-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: scale(1.12);
    transform-origin: center;
}

.amani-surface,
.amani-panel,
.amani-card,
.amani-launcher-item,
.amani-launcher-spotlight-card,
.amani-button,
.amani-button-secondary,
.amani-icon-btn,
.amani-page-chip {
    border-radius: var(--border-radius);
}

.amani-surface,
.amani-panel,
.amani-card {
    background: color-mix(in srgb, var(--panel) 94%, var(--bg));
    border: 1px solid var(--line);
    box-shadow: 0 18px 44px var(--shadow);
}

.amani-page-shell {
    min-height: 100vh;
}

.amani-page-topbar,
.amani-page-main {
    width: min(1240px, calc(100vw - 32px));
    margin: 0 auto;
}

.amani-page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0 14px;
    flex-wrap: wrap;
}

.amani-page-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.amani-page-brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(47, 109, 246, 0.16), rgba(47, 109, 246, 0.05));
    color: var(--blue);
    font-size: 20px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
}

.amani-page-brand-copy strong,
.amani-page-hero h1,
.amani-page-title {
    display: block;
    font-family: var(--font-heading);
    letter-spacing: -0.04em;
    color: var(--ink);
}

.amani-page-brand-copy strong {
    font-size: 15px;
    line-height: 1.2;
}

.amani-page-brand-copy span,
.amani-page-hero p,
.amani-page-note,
.amani-page-subtle {
    color: var(--text-muted);
}

.amani-page-main {
    display: grid;
    gap: 16px;
    padding-bottom: 40px;
}

.amani-page-hero {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: var(--radius-xl);
    border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 255, 0.98)),
        radial-gradient(circle at 100% 0%, rgba(47, 109, 246, 0.08), transparent 32%);
    box-shadow: 0 18px 44px var(--shadow);
}

.amani-page-hero::after {
    content: "";
    position: absolute;
    inset: auto -5% -48% auto;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(47, 109, 246, 0.09), transparent 68%);
    pointer-events: none;
}

.amani-page-hero h1 {
    margin: 0;
    font-size: clamp(30px, 4.2vw, 54px);
    line-height: 1.02;
}

.amani-page-hero p {
    margin: 12px 0 0;
    max-width: 860px;
    line-height: 1.7;
    font-size: 16px;
}

.amani-page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    background: var(--soft);
    border: 1px solid var(--line);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 800;
}

.amani-page-hero-actions,
.amani-toolbar,
.amani-action-row,
.amani-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.amani-page-hero-actions {
    margin-top: 18px;
}

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

.amani-section-head h2,
.amani-section-head h3 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-heading);
    letter-spacing: -0.03em;
}

.amani-card,
.amani-panel {
    background: color-mix(in srgb, var(--panel) 96%, var(--bg));
    border: 1px solid color-mix(in srgb, var(--line) 92%, transparent);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px var(--shadow);
}

.amani-card {
    padding: 18px;
}

.amani-card-link,
.amani-stat-card,
.amani-launcher-item {
    text-decoration: none;
    color: var(--text);
}

.amani-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.amani-stat-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.95));
    border: 1px solid color-mix(in srgb, var(--line) 94%, transparent);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.amani-stat-card:hover,
.amani-stat-card:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
    box-shadow: 0 18px 42px var(--shadow-lg);
}

.amani-stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 800;
}

.amani-stat-value {
    font-size: 28px;
    line-height: 1.05;
    font-weight: 900;
    color: var(--ink);
}

.amani-stat-help {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.amani-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--panel) 96%, var(--bg));
    box-shadow: 0 16px 40px var(--shadow);
}

.amani-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
    background: transparent;
}

.amani-table thead th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--soft) 82%, white);
}

.amani-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 94%, transparent);
    vertical-align: top;
}

.amani-table tbody tr:last-child td {
    border-bottom: 0;
}

.amani-table tbody tr:hover {
    background: color-mix(in srgb, var(--soft) 50%, transparent);
}

.amani-table tbody tr.is-active {
    background: color-mix(in srgb, var(--blue) 5%, transparent);
}

.amani-badge,
.amani-page-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.amani-badge {
    background: var(--soft);
    color: var(--text-muted);
    border: 1px solid var(--line);
}

.amani-badge.is-running,
.amani-page-chip.is-running {
    background: color-mix(in srgb, var(--blue) 14%, white);
    color: var(--blue);
    border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
}

.amani-badge.is-paused,
.amani-page-chip.is-paused {
    background: color-mix(in srgb, var(--yellow) 18%, white);
    color: #9f6a00;
    border-color: color-mix(in srgb, var(--yellow) 26%, var(--line));
}

.amani-badge.is-complete,
.amani-page-chip.is-complete {
    background: color-mix(in srgb, var(--green) 16%, white);
    color: var(--green);
    border-color: color-mix(in srgb, var(--green) 24%, var(--line));
}

.amani-badge.is-idle,
.amani-page-chip.is-idle {
    background: var(--soft);
    color: var(--text-muted);
}

.amani-button,
.amani-button-secondary,
.amani-button-danger,
.amani-button-quiet,
.amani-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.amani-button:hover,
.amani-button-secondary:hover,
.amani-button-danger:hover,
.amani-button-quiet:hover,
.amani-icon-btn:hover {
    transform: translateY(-1px);
}

.amani-button,
.amani-button-primary {
    background: linear-gradient(180deg, var(--blue), var(--blue-hover));
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--blue) 32%, transparent);
}

.amani-button:hover,
.amani-button-primary:hover {
    color: #fff;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--blue) 38%, transparent);
}

.amani-button-secondary {
    background: color-mix(in srgb, var(--soft) 86%, white);
    color: var(--text);
    border-color: var(--line);
}

.amani-button-secondary:hover {
    background: var(--panel);
    border-color: color-mix(in srgb, var(--blue) 22%, var(--line));
    color: var(--ink);
}

.amani-button-danger {
    background: linear-gradient(180deg, var(--red), color-mix(in srgb, var(--red) 88%, black));
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--red) 28%, transparent);
}

.amani-button-quiet {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--line);
}

.amani-button-quiet:hover {
    background: var(--soft);
    color: var(--ink);
}

.amani-icon-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--panel);
    color: var(--text);
    border-color: var(--line);
    box-shadow: 0 10px 24px var(--shadow);
}

.amani-icon-btn:hover {
    background: var(--soft);
}

.amani-input,
body.amani-theme input[type="text"],
body.amani-theme input[type="number"],
body.amani-theme input[type="search"],
body.amani-theme input[type="email"],
body.amani-theme input[type="url"],
body.amani-theme input[type="password"],
body.amani-theme select,
body.amani-theme textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 92%, var(--bg));
    color: var(--text);
    padding: 11px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.amani-theme textarea {
    min-height: 120px;
    resize: vertical;
}

.amani-note,
.amani-help {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.amani-mono,
body.amani-theme .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* ── Launcher toggle button ─────────────────────────────────────────────── */

.amani-launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.amani-launcher-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 92%, var(--bg));
    color: var(--text);
    display: inline-grid;
    place-items: center;
    box-shadow: 0 10px 24px var(--shadow);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.amani-launcher-toggle:hover {
    transform: translateY(-1px);
    background: var(--soft);
}

.amani-launcher-toggle.is-open {
    background: color-mix(in srgb, var(--blue) 10%, var(--panel));
    border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
    color: var(--blue);
}

.amani-launcher-icons {
    position: relative;
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
}

.amani-launcher-icons i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 24px;
    line-height: 1;
    transition: opacity 0.15s;
}

.amani-launcher-icons .amani-launcher-icon-fill {
    opacity: 0;
}

.amani-launcher-toggle.is-open .amani-launcher-icon-line {
    opacity: 0;
}

.amani-launcher-toggle.is-open .amani-launcher-icon-fill {
    opacity: 1;
}

/* ── Dialog / Modal ─────────────────────────────────────────────────────── */

dialog.amani-launcher-panel {
    border: none;
    padding: 0;
    width: min(920px, calc(100vw - 24px));
    max-height: min(84vh, 860px);
    margin: auto;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(47, 109, 246, 0.10), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.98));
    box-shadow: 0 32px 96px rgba(15, 23, 42, 0.28), 0 0 0 1px var(--line);
    overflow: hidden;
    animation: launcher-modal-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

dialog.amani-launcher-panel:not([open]) {
    display: none !important;
}

dialog.amani-launcher-panel[open] {
    display: flex;
    flex-direction: column;
}

dialog.amani-launcher-panel::backdrop {
    background: rgba(8, 15, 28, 0.56);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: launcher-backdrop-in 200ms ease;
}

.amani-launcher-inner {
    overflow-y: auto;
    padding: 20px;
    flex: 1;
    overscroll-behavior: contain;
}

@keyframes launcher-modal-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.amani-launcher-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.amani-launcher-panel-copy {
    display: grid;
    gap: 2px;
}

.amani-launcher-kicker {
    color: var(--blue);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.amani-launcher-panel-copy strong {
    font-size: 20px;
    line-height: 1.1;
    color: var(--text);
    font-family: var(--font-heading);
}

.amani-launcher-panel-copy span {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.amani-launcher-search {
    position: relative;
    margin-bottom: 12px;
}

.amani-launcher-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.amani-launcher-search input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.amani-launcher-search input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}

.amani-launcher-spotlight {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.amani-launcher-spotlight-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--soft)), color-mix(in srgb, var(--soft) 70%, white));
    padding: 12px 14px;
    display: grid;
    gap: 4px;
}

.amani-launcher-spotlight-card span {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.amani-launcher-spotlight-card strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
}

.amani-launcher-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.amani-launcher-item {
    min-height: 104px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.98));
    display: grid;
    gap: 8px;
    align-content: start;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.amani-launcher-item:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--blue) 38%, var(--line));
    box-shadow: 0 12px 26px rgba(47, 109, 246, 0.13);
}

.amani-launcher-item.is-active {
    border-color: var(--blue);
    background: linear-gradient(180deg, rgba(240, 246, 255, 0.98), rgba(229, 239, 255, 0.98));
    box-shadow: 0 0 0 1px rgba(47, 109, 246, 0.12);
}

.amani-launcher-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #eaf1ff;
    color: var(--blue);
    font-size: 18px;
    overflow: hidden;
}

.amani-launcher-item-icon i {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    font-style: normal;
}

.amani-launcher-item strong {
    display: block;
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
}

.amani-launcher-item span {
    display: block;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.amani-launcher-empty {
    grid-column: 1 / -1;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: var(--soft);
    color: var(--text-muted);
    padding: 18px;
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}

.amani-launcher-empty i {
    font-size: 28px;
    color: var(--blue);
}

.amani-launcher-empty strong {
    color: var(--text);
    font-size: 15px;
}

.amani-launcher-empty span {
    font-size: 12px;
}

.amani-launcher-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
    color: var(--text);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    cursor: pointer;
}

.amani-launcher-close:hover {
    background: var(--panel);
}

/* ── Helpers ───────────────────────────────────────────────────────────── */

.amani-glass {
    background: color-mix(in srgb, var(--panel) 84%, transparent);
    backdrop-filter: blur(10px);
}

.amani-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.amani-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.amani-empty-state {
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--panel) 96%, var(--bg));
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
}

/* ── Contrast-safe final layer ─────────────────────────────────────────── */

body.amani-theme .ti {
    width: 1.08em;
    height: 1.08em;
    flex: 0 0 auto;
    vertical-align: -0.16em;
}

body.amani-theme,
body.amani-theme .amani-card,
body.amani-theme .amani-panel,
body.amani-theme .amani-surface,
body.amani-theme .amani-table,
body.amani-theme .amani-launcher-item,
body.amani-theme .amani-launcher-spotlight-card {
    color: var(--text);
}

body.amani-theme .amani-page-brand-copy span,
body.amani-theme .amani-page-hero p,
body.amani-theme .amani-page-note,
body.amani-theme .amani-page-subtle,
body.amani-theme .amani-stat-label,
body.amani-theme .amani-stat-help,
body.amani-theme .amani-launcher-item span,
body.amani-theme .amani-launcher-spotlight-card span,
body.amani-theme .amani-empty-state {
    color: var(--text-muted);
}

body.amani-theme .amani-page-kicker,
body.amani-theme .amani-page-chip,
body.amani-theme .amani-badge,
body.amani-theme .verified,
body.amani-theme .verified-badge {
    color: var(--accent-text-on-soft);
    background: var(--blue-soft);
    border-color: color-mix(in srgb, var(--blue) 32%, var(--line));
}

body.amani-theme .verified,
body.amani-theme .verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 800;
}

body.amani-theme .amani-button,
body.amani-theme button[type="submit"],
body.amani-theme .button-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #ffffff;
}

body.amani-theme .amani-button:hover,
body.amani-theme button[type="submit"]:hover,
body.amani-theme .button-primary:hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
    color: #ffffff;
}

body.amani-theme .amani-button-secondary,
body.amani-theme .button-secondary,
body.amani-theme .amani-icon-btn {
    background: var(--panel);
    border-color: var(--line);
    color: var(--text);
}

body.amani-theme input,
body.amani-theme select,
body.amani-theme textarea {
    background: var(--panel);
    border-color: var(--line);
    color: var(--text);
}

body.amani-theme input::placeholder,
body.amani-theme textarea::placeholder {
    color: color-mix(in srgb, var(--text-muted) 88%, var(--panel));
    opacity: 1;
}

body.amani-theme .success,
body.amani-theme .status-success,
body.amani-theme .badge-success {
    color: var(--status-success-text);
    background: var(--green-soft);
}

body.amani-theme .warning,
body.amani-theme .status-warning,
body.amani-theme .badge-warning {
    color: var(--status-warning-text);
    background: var(--yellow-soft);
}

body.amani-theme .danger,
body.amani-theme .error,
body.amani-theme .status-danger,
body.amani-theme .badge-danger {
    color: var(--status-danger-text);
    background: var(--red-soft);
}

[data-theme="dark"] body.amani-theme,
body.amani-theme[data-theme="dark"] {
    background:
        radial-gradient(circle at 12% 8%, rgba(143, 178, 255, 0.14), transparent 22%),
        radial-gradient(circle at 88% 12%, rgba(125, 228, 189, 0.10), transparent 18%),
        linear-gradient(180deg, #0b1220 0%, #0f1727 48%, #0b1220 100%);
}

[data-theme="dark"] body.amani-theme .amani-page-hero,
body.amani-theme[data-theme="dark"] .amani-page-hero {
    background:
        linear-gradient(135deg, rgba(18, 27, 45, 0.98), rgba(15, 23, 39, 0.98)),
        radial-gradient(circle at 100% 0%, rgba(143, 178, 255, 0.16), transparent 32%);
}

[data-theme="dark"] body.amani-theme .amani-stat-card,
[data-theme="dark"] body.amani-theme .amani-launcher-item,
[data-theme="dark"] body.amani-theme .amani-launcher-spotlight-card,
body.amani-theme[data-theme="dark"] .amani-stat-card,
body.amani-theme[data-theme="dark"] .amani-launcher-item,
body.amani-theme[data-theme="dark"] .amani-launcher-spotlight-card {
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, var(--soft)), color-mix(in srgb, var(--soft) 82%, black));
}

[data-theme="dark"] body.amani-theme .amani-launcher-item-icon,
body.amani-theme[data-theme="dark"] .amani-launcher-item-icon {
    background: var(--blue-soft);
    color: var(--blue-text);
}

@media (max-width: 980px) {
    dialog.amani-launcher-panel {
        width: min(720px, calc(100vw - 16px));
    }

    .amani-launcher-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .amani-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.amani-theme {
        background-attachment: scroll;
    }

    .amani-page-topbar,
    .amani-page-main {
        width: min(100vw - 20px, 100%);
    }

    .amani-page-hero {
        padding: 20px;
        border-radius: 22px;
    }

    dialog.amani-launcher-panel {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 24px);
        margin: auto 8px 8px;
        border-radius: 18px 18px 14px 14px;
    }

    .amani-launcher-grid,
    .amani-launcher-spotlight,
    .amani-grid-2,
    .amani-grid-3 {
        grid-template-columns: 1fr;
    }
}
