@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:ital,wght@0,400;0,500;1,400&display=swap');

:root {
    --bg:           #111111;
    --surface:      #1a1a1a;
    --surface-2:    #222222;
    --surface-3:    #2a2a2a;
    --border:       #2e2e2e;
    --border-hover: #444444;
    --text:         #e8e2da;
    --text-muted:   #7a7068;
    --text-faint:   #3a3530;
    --accent:       #89b445;
    --accent-dim:   rgba(137,180,69,.13);
    --accent-hover: #9cc440;
    --danger:       #e04848;
    --danger-dim:   rgba(224,72,72,.12);
    --success:      #3ab870;
    --success-dim:  rgba(58,184,112,.12);
    --radius:       8px;
    --radius-lg:    12px;
    --shadow:       0 1px 3px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
    --shadow-lg:    0 4px 24px rgba(0,0,0,.5);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.02em;
}
h2 { font-size: 1.35rem; margin-bottom: 1.2rem; }
h3 { font-size: 1.05rem; margin-bottom: .7rem; }

/* NAV */
.nav-bar {
    background: rgba(17,17,17,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-logo {
    font-weight: 700;
    font-size: .95rem;
    color: var(--accent);
    letter-spacing: -.01em;
    margin-right: 2rem;
    white-space: nowrap;
}
.nav-links { display: flex; gap: 0; }
.nav-links a {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: 0 .85rem;
    height: 52px;
    color: var(--text-muted);
    font-size: .84rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.nav-links a:hover  { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-actions { margin-left: auto; }
.nav-actions a { color: var(--text-faint); font-size: .8rem; }
.nav-actions a:hover { color: var(--text-muted); }

/* BURGER */
.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    margin-left: auto;
}
.nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: background .15s;
}
.nav-burger:hover span { background: var(--text); }
@media (max-width: 680px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 52px; left: 0; right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        z-index: 99;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        height: 48px;
        padding: 0 1.5rem;
        border-bottom: 1px solid var(--border);
        border-left: 2px solid transparent;
    }
    .nav-links a:last-child { border-bottom: none; }
    .nav-links a.active { border-bottom-color: var(--border); border-left-color: var(--accent); background: var(--accent-dim); }
    .nav-burger { display: flex; }
    .nav-logo { margin-right: 0; }
    .nav-actions a { font-size: .75rem; }
}

/* LAYOUT */
.container { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-header h2 { margin-bottom: 0; }

/* CARDS */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow);
}
.card > h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding-bottom: .8rem;
    margin-bottom: .9rem;
    border-bottom: 1px solid var(--border);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

/* DASHBOARD */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    color: inherit;
    box-shadow: var(--shadow);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(137,180,69,.15); color: inherit; }
.tool-card .tool-icon { font-size: 2rem; line-height: 1; }
.tool-card .tool-name { font-weight: 600; font-size: 1.05rem; color: var(--text); letter-spacing: -.01em; }
.tool-card .tool-desc { color: var(--text-muted); font-size: .85rem; line-height: 1.55; }
.tool-card .tool-meta { margin-top: auto; padding-top: .75rem; color: var(--text-faint); font-size: .75rem; font-family: 'DM Mono', monospace; border-top: 1px solid var(--border); }
.dashboard-hero { padding: 2.5rem 0 2rem; }
.dashboard-hero h1 { font-size: 1.9rem; font-weight: 700; margin-bottom: .4rem; letter-spacing: -.03em; }
.dashboard-hero p { color: var(--text-muted); }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-top: 1.8rem; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: .84rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
    line-height: 1;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-hover); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: 0 2px 8px rgba(137,180,69,.35); }
.btn-danger { background: var(--danger-dim); border-color: rgba(224,72,72,.35); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: .28rem .65rem; font-size: .78rem; }
.btn-group { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }

/* FORMS */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .72rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .06em; }
input[type="text"], input[type="password"], input[type="url"], input[type="search"], textarea, select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    padding: .6rem .85rem;
    transition: border-color .15s, background .15s, box-shadow .15s;
    outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: var(--surface-3); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { resize: vertical; min-height: 100px; }
textarea.tall { min-height: 240px; }
textarea.mono { font-family: 'DM Mono', monospace; font-size: .82rem; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* MESSAGES */
.message { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: .875rem; font-weight: 500; }
.message.success { background: var(--success-dim); border: 1px solid rgba(58,184,112,.3); color: var(--success); }
.message.error   { background: var(--danger-dim);  border: 1px solid rgba(224,72,72,.3);  color: var(--danger);  }

/* PROMPT BOXES */
.prompt-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.prompt-section > h3 { border-bottom: none; padding-bottom: 0; margin-bottom: .35rem; }
.prompt-section > p { color: var(--text-muted); font-size: .82rem; margin-bottom: .75rem; }
.prompt-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    font-family: 'DM Mono', monospace;
    font-size: .8rem;
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--text);
    margin-bottom: .65rem;
    max-height: 360px;
    overflow-y: auto;
}

/* TABLE */
table { width: 100%; border-collapse: collapse; font-size: .875rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
th { text-align: left; padding: .6rem .9rem; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
td { padding: .6rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* BREADCRUMB */
.breadcrumb { font-size: .82rem; color: var(--text-muted); margin-bottom: 1.2rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-faint); }

/* PM LIST */
.pm-list { list-style: none; display: flex; flex-direction: column; }
.pm-list li a { color: var(--text); font-size: .875rem; display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--border); transition: color .15s; }
.pm-list li:last-child a { border-bottom: none; }
.pm-list li a:hover { color: var(--accent); }
.pm-list li a::before { content: '→'; color: var(--text-faint); font-size: .78rem; }

/* LOGIN */
body.login-page { display: flex; align-items: center; justify-content: center; background: var(--bg); background-image: radial-gradient(ellipse at 50% 0%, rgba(137,180,69,.08) 0%, transparent 65%); }
.login-box { width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem 2rem; text-align: center; box-shadow: var(--shadow-lg); }
.login-box .login-icon { font-size: 2.2rem; margin-bottom: .8rem; }
.login-box h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 1.5rem; }
.login-box input { margin-bottom: .9rem; text-align: center; }
.login-box .btn-primary { width: 100%; justify-content: center; padding: .65rem 1rem; }
.login-error { color: var(--danger); font-size: .85rem; margin-bottom: .8rem; }

/* FOOTER */
.site-footer { margin-top: 4rem; padding: 1.5rem; border-top: 1px solid var(--border); text-align: center; color: var(--text-faint); font-size: .78rem; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* PROMPTS APP */
.prompts-layout { display: flex; height: calc(100vh - 52px); overflow: hidden; }
.prompts-sidebar { width: 270px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-header { padding: .75rem; border-bottom: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; }
.sidebar-header input[type="search"] { flex: 1; font-size: .82rem; padding: .35rem .65rem; }
.sidebar-list { list-style: none; overflow-y: auto; flex: 1; }
.sidebar-item { padding: .8rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; border-left: 2px solid transparent; }
.sidebar-item:hover { background: var(--surface-2); }
.sidebar-item.active { background: var(--accent-dim); border-left-color: var(--accent); }
.item-title { display: block; font-weight: 500; font-size: .875rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }
.sidebar-empty { padding: 1.5rem 1rem; color: var(--text-muted); font-size: .85rem; }
.prompts-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.prompts-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; color: var(--text-muted); }
.prompts-placeholder span { font-size: 2.5rem; opacity: .3; }
.prompts-placeholder p { font-size: .9rem; }
.editor-header { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.editor-title { flex: 1; background: transparent; border: none; font-family: 'DM Sans', sans-serif; font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; color: var(--text); padding: 0; outline: none; }
.editor-title::placeholder { color: var(--text-faint); }
.editor-actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.save-status { font-size: .75rem; color: var(--text-faint); min-width: 90px; text-align: right; transition: color .2s; }
.save-status.saved  { color: var(--success); }
.save-status.saving { color: var(--text-muted); }
.save-status.error  { color: var(--danger); }
.editor-textarea { flex: 1; resize: none; background: transparent; border: none; border-radius: 0; padding: 1.25rem 1.5rem; font-family: 'DM Mono', monospace; font-size: .84rem; line-height: 1.75; color: var(--text); outline: none; width: 100%; overflow-y: auto; }
.editor-footer { padding: .85rem 1.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.copy-meta { font-size: .8rem; color: var(--text-muted); }
@media (max-width: 680px) {
    .prompts-sidebar { width: 100%; position: absolute; top: 52px; bottom: 0; z-index: 10; transition: transform .2s; }
    .prompts-sidebar.hidden { transform: translateX(-100%); }
    .prompts-content { width: 100%; }
    .back-btn { display: inline-flex !important; }
}
.back-btn { display: none; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; width: 100%; max-width: 500px; box-shadow: var(--shadow-lg); animation: modalIn .15s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: .25rem .45rem; border-radius: var(--radius); transition: color .15s, background .15s; }
.modal-close:hover { color: var(--text); background: var(--surface-2); }

/* BOOKMARKS */
.bookmarks-toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.bookmarks-toolbar input[type="search"] { flex: 1; min-width: 180px; font-size: .875rem; }
.bookmark-category { margin-bottom: 1.5rem; }
.bookmark-category-header { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding-bottom: .5rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.bookmark-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .5rem; border-radius: var(--radius); transition: background .1s; }
.bookmark-item:hover { background: var(--surface-2); }
.bookmark-favicon { width: 16px; height: 16px; flex-shrink: 0; object-fit: contain; }
.bookmark-favicon-fallback { width: 16px; height: 16px; flex-shrink: 0; font-size: 13px; line-height: 16px; text-align: center; }
.bookmark-title { flex: 1; font-weight: 500; font-size: .875rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; transition: color .15s; }
.bookmark-title:hover { color: var(--accent); }
.bookmark-url { font-size: .75rem; font-family: 'DM Mono', monospace; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; flex-shrink: 0; }
@media (max-width: 540px) { .bookmark-url { display: none; } }
.bookmark-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.bookmarks-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.bookmarks-empty span { font-size: 2rem; display: block; margin-bottom: .75rem; opacity: .35; }
.bookmarklet-hint { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-top: 2rem; font-size: .82rem; color: var(--text-muted); box-shadow: var(--shadow); }
.bookmarklet-hint strong { color: var(--text); }
.bookmarklet-code { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .3rem .6rem; font-family: 'DM Mono', monospace; font-size: .76rem; color: var(--accent); word-break: break-all; margin-top: .4rem; cursor: pointer; user-select: all; transition: background .15s; }
.bookmarklet-code:hover { background: var(--surface-3); }
.title-fetching { color: var(--text-muted); font-size: .78rem; margin-top: .3rem; }

/* CLICK BADGE */
.click-badge {
    display: inline-flex;
    align-items: center;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 20px;
    padding: .1rem .5rem;
    font-size: .68rem;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    flex-shrink: 0;
    white-space: nowrap;
}
.top20-section { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--border); }

/* ── BOOKMARK CATEGORIES ─────────────────────────────── */
.bm-top20 { margin-bottom: 2rem; }
.bm-section-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: .6rem;
}

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

.bm-cat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .2s;
}
.bm-cat-card:not(.special):hover { border-color: var(--accent); transform: translateY(-2px); }
.bm-cat-card.special { opacity: .65; }

.bm-cat-body {
    flex: 1;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.bm-cat-body:hover { color: inherit; }

.bm-cat-icon { font-size: 1.75rem; line-height: 1; margin-bottom: .2rem; }
.bm-cat-name { font-weight: 600; font-size: .95rem; color: var(--text); }
.bm-cat-sub  { font-size: .73rem; color: var(--text-muted); font-family: 'DM Mono', monospace; }
.bm-cat-noexp { color: var(--text-faint); }
.bm-cat-count { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

.bm-cat-footer {
    display: flex;
    gap: .4rem;
    padding: .55rem .75rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

/* ── BOOKMARK ROWS ───────────────────────────────────── */
.bm-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1rem;
    transition: background .1s;
    color: inherit;
    text-decoration: none;
}
.bm-row:hover { background: var(--surface-2); color: inherit; }

.bm-row img, .bm-row > span:first-child { width: 15px; height: 15px; flex-shrink: 0; font-size:13px; line-height:15px; }

.bm-row-title {
    flex: 1;
    font-weight: 500;
    font-size: .875rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    transition: color .15s;
}
.bm-row-title:hover { color: var(--accent); }

.bm-row-cat    { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; }
.bm-row-domain { font-size: .72rem; font-family: 'DM Mono', monospace; color: var(--text-faint); flex-shrink: 0; }

.bm-row-actions { display: flex; gap: .3rem; flex-shrink: 0; }

@media (max-width: 500px) { .bm-row-cat, .bm-row-domain { display: none; } }

/* ── FA ICON SIZING ──────────────────────────────────── */
.nav-links a .fa-solid  { font-size: .82rem; }
.tool-card .tool-icon .fa-solid { font-size: 1.9rem; }
.login-box .login-icon .fa-solid { font-size: 2rem; color: var(--accent); }
.dashboard-hero h1 .fa-solid { font-size: 1.6rem; vertical-align: middle; }
.bm-fav-fallback { font-size: .8rem; color: var(--text-faint); width:15px; text-align:center; flex-shrink:0; }
.bm-cat-icon .fa-solid { font-size: 1.65rem; color: var(--accent); }

/* ── LOGOUT MOBILE ───────────────────────────────────── */
.nav-logout-mobile { display: none !important; }
@media (max-width: 680px) {
    .nav-actions { display: none; }
    .nav-logout-mobile { display: flex !important; border-top: 2px solid var(--border); color: var(--danger) !important; }
    .nav-logout-mobile:hover { color: var(--danger) !important; background: var(--danger-dim); }
}

/* ── CATEGORY SWITCHER ───────────────────────────────── */
.bm-cat-switcher {
    display: flex;
    align-items: center;
    gap: .3rem;
    overflow-x: auto;
    padding-bottom: .4rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.bm-cat-switcher::-webkit-scrollbar { display: none; }

.bm-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .75rem;
    border-radius: 99px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
}
.bm-switch-btn:hover { background: var(--surface-3); border-color: var(--border-hover); color: var(--text); }
.bm-switch-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.bm-switch-btn .fa-solid { font-size: .75rem; }

/* ── TO-DO TOOL ──────────────────────────────────────── */
.todo-sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.1rem;
    font-size: .82rem;
    color: var(--text-muted);
    gap: 1rem;
    flex-wrap: wrap;
}

.todo-quickadd {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    align-items: center;
}
.todo-quickadd input { flex: 1; }
.todo-quickadd select { width: 160px; flex-shrink: 0; }

.todo-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.2rem;
}
.todo-filters { display: flex; gap: .35rem; flex-wrap: wrap; }

.filter-btn {
    padding: .3rem .8rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: 'DM Sans', sans-serif;
}
.filter-btn:hover { background: var(--surface-3); color: var(--text); }
.filter-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.todo-done-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.todo-done-toggle input { cursor: pointer; accent-color: var(--accent); }

/* List sections */
.todo-list-section { margin-bottom: 1.5rem; }
.todo-list-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .25rem;
}
.todo-list-count {
    margin-left: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0 .5rem;
    font-size: .7rem;
    color: var(--text-faint);
}

/* Task rows */
.todo-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .4rem;
    border-radius: var(--radius);
    transition: background .1s, opacity .3s;
}
.todo-item:hover { background: var(--surface-2); }
.todo-item.done { opacity: .55; }
.todo-item.completing { opacity: 0; transition: opacity .8s; }

.todo-check {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-faint);
    font-size: 1.1rem;
    flex-shrink: 0;
    padding: 0;
    transition: color .15s, transform .15s;
    line-height: 1;
}
.todo-check:hover { color: var(--accent); transform: scale(1.15); }
.todo-item.done .todo-check { color: var(--accent); }

/* Priority icons */
.todo-prio-high { color: var(--danger);  font-size: .85rem; }
.todo-prio-mid  { color: #d09020;        font-size: .85rem; }
.todo-prio-low  { color: #5080d0;        font-size: .85rem; }

.todo-title {
    flex: 1;
    font-size: .9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.todo-item.done .todo-title { text-decoration: line-through; color: var(--text-muted); }

.todo-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    flex-shrink: 0;
}
.todo-rrule-icon { color: var(--text-faint); font-size: .72rem; }

.due-overdue { color: var(--danger); font-weight: 600; }
.due-today   { color: var(--danger); font-weight: 600; }
.due-soon    { color: #d09020; }
.due-normal  { color: var(--text-muted); }

.todo-edit-btn {
    opacity: 0;
    flex-shrink: 0;
    transition: opacity .15s;
}
.todo-item:hover .todo-edit-btn { opacity: 1; }

.todo-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.todo-empty .fa-circle-check { font-size: 2.5rem; opacity: .2; display: block; margin-bottom: .75rem; }
.todo-empty p { font-size: .9rem; }

/* Nav User Badge */
.nav-user {
    font-size: .78rem;
    color: var(--text-muted);
    padding: .25rem .5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* ── MAILS ───────────────────────────────────────────────── */
.mail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.mail-toolbar .section-title { margin: 0; font-size: 1rem; }

.mail-account-section { margin-bottom: 1.8rem; }

.mail-account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .25rem;
}
.mail-account-name {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
}
.mail-count-badge {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0 .45rem;
    font-size: .7rem;
    color: var(--text-faint);
}
.mail-empty {
    font-size: .82rem;
    color: var(--text-faint);
    padding: .6rem .4rem;
}

/* Mail rows */
.mail-row {
    border-bottom: 1px solid var(--border);
}
.mail-row:last-child { border-bottom: none; }

.mail-row-main {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .4rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background .1s;
}
.mail-row-main:hover { background: var(--surface-2); }

.mail-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.mail-dot-empty {
    width: 7px; height: 7px;
    flex-shrink: 0;
}
.mail-row.unseen .mail-from,
.mail-row.unseen .mail-subject { font-weight: 600; }

.mail-from {
    font-size: .82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 120px;
    max-width: 200px;
    flex-shrink: 0;
}
.mail-subject {
    flex: 1;
    font-size: .82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-date {
    font-size: .75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}
.mail-chevron {
    font-size: .65rem;
    color: var(--text-faint);
    flex-shrink: 0;
    transition: transform .2s;
}

/* Mail body */
.mail-body {
    display: none;
    padding: .75rem 1rem .75rem 1.8rem;
    font-size: .82rem;
    line-height: 1.65;
    color: var(--text-muted);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
    white-space: pre-wrap;
    word-break: break-word;
}
.mail-body.open { display: block; }
.mail-body-loading { color: var(--text-faint); }
.mail-body-error { color: var(--danger); }
.mail-body-content { font-family: 'DM Mono', monospace; font-size: .78rem; }

/* Dashboard widget rows */
.mail-row-dash {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.mail-row-dash:last-child { border-bottom: none; }
.mail-row-dash:hover { background: var(--surface-2); }
.mail-row-dash.unseen .mail-dash-from,
.mail-row-dash.unseen .mail-dash-subject { font-weight: 600; }

.mail-dash-from {
    font-size: .8rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 100px;
    max-width: 160px;
    flex-shrink: 0;
}
.mail-dash-subject {
    flex: 1;
    font-size: .8rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-dash-meta {
    font-size: .72rem;
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mail delete button */
.mail-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-faint);
    font-size: .78rem;
    padding: .2rem .35rem;
    border-radius: var(--radius);
    opacity: 0;
    flex-shrink: 0;
    transition: opacity .15s, color .15s, background .15s;
}
.mail-row-main:hover .mail-delete-btn { opacity: 1; }
.mail-delete-btn:hover { color: var(--danger); background: var(--surface-3); }

/* ── MAIL RULES ──────────────────────────────────────────── */
.rule-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .5rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.rule-row:last-child { border-bottom: none; }
.rule-row:hover { background: var(--surface-2); border-radius: var(--radius); }

.rule-icon   { color: var(--accent); font-size: .78rem; flex-shrink: 0; }
.rule-acc    { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: .1rem .5rem; }
.rule-arrow  { color: var(--text-faint); font-size: .7rem; flex-shrink: 0; }
.rule-sender { font-size: .82rem; color: var(--text); font-family: 'DM Mono', monospace; flex-shrink: 0; }
.rule-folder { font-size: .82rem; color: var(--accent); flex-shrink: 0; }
.rule-stats  { font-size: .72rem; color: var(--text-faint); flex: 1; text-align: right; white-space: nowrap; }
.rule-edit-btn, .rule-delete-btn { opacity: 0; flex-shrink: 0; }
.rule-row:hover .rule-edit-btn,
.rule-row:hover .rule-delete-btn { opacity: 1; }

/* Mail body actions bar */
.mail-body-actions {
    padding: .6rem 0 .2rem;
    border-top: 1px solid var(--border);
    margin-top: .75rem;
}

.mail-since-badge {
    font-size: .68rem;
    color: var(--text-faint);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

/* List user badges */
.list-user-badge {
    font-size: .68rem;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 99px;
    padding: .05rem .4rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    opacity: .85;
}

/* ── TASK TYPES ──────────────────────────────────────── */
.todo-type-icon { font-size: .85rem; flex-shrink: 0; }
.todo-type-rueckmeldung .todo-title { color: #c07820; }
.todo-type-idee .todo-title { color: #4a80c4; }

/* RRULE Widget */
.rrule-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--text);
    flex-wrap: wrap;
    margin-bottom: .3rem;
}
.rrule-row input[type=number],
.rrule-row input[type=text],
.rrule-row select {
    padding: .2rem .4rem;
    font-size: .82rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}
.rrule-day-lbl {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .78rem;
    cursor: pointer;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: .15rem .5rem;
    transition: background .1s, border-color .1s;
}
.rrule-day-lbl:has(input:checked) {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}
.rrule-day-lbl input { display: none; }

/* HTML mail body */
.mail-body-html {
    padding: .5rem 0;
    font-size: .85rem;
    line-height: 1.6;
    overflow-x: auto;
    word-break: break-word;
}
.mail-body-html img { max-width: 100%; height: auto; }
.mail-body-html a   { color: var(--accent); }
.mail-body-html p   { margin: .4rem 0; }

/* Action buttons above content */
.mail-body-actions {
    display: flex;
    gap: .4rem;
    padding: .5rem 0 .6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .6rem;
}

/* HTML mail iframe */
.mail-body-iframe {
    width: 100%;
    min-height: 200px;
    border: none;
    border-radius: var(--radius);
    background: #fff;
    display: block;
}

/* Song finished badge */
.song-finished-badge { font-size: .85rem; }

/* ════════════════ BACKUP-TOOL ════════════════ */

.bk-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .8rem;
    margin-bottom: 1.4rem;
}
@media (max-width: 640px) {
    .bk-stats { grid-template-columns: repeat(2, 1fr); }
}
.bk-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
}
.bk-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.02em;
}
.bk-stat-label {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .15rem;
}
.bk-stat-alert { border-color: var(--danger); }
.bk-stat-alert .bk-stat-num { color: var(--danger); }

.bk-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.bk-table th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--border);
}
.bk-table td {
    padding: .7rem .8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.bk-table tr:last-child td { border-bottom: none; }
.bk-table code { font-size: .8rem; }
.bk-col-actions { white-space: nowrap; text-align: right; }
.bk-col-actions .btn { margin-left: .15rem; }
.bk-col-actions form { display: inline; }

.bk-subdir {
    display: inline-block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: .05rem .4rem;
    border-radius: 4px;
    margin-right: .35rem;
    vertical-align: middle;
}
.bk-muted { color: var(--text-muted); font-size: .8rem; }
.bk-row-disabled { opacity: .5; }

.bk-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 500;
    padding: .12rem .5rem;
    border-radius: 20px;
    white-space: nowrap;
}
.bk-pill.ok      { color: var(--success);    background: var(--success-dim); }
.bk-pill.fail    { color: var(--danger);     background: var(--danger-dim); }
.bk-pill.running { color: var(--accent);     background: var(--accent-dim); }
.bk-pill.queued  { color: var(--text-muted); background: var(--surface-3); }

.bk-empty { text-align: center; padding: 2.2rem 1rem; }
.bk-empty p { color: var(--text-muted); margin-bottom: 1rem; }

.bk-radio {
    display: block;
    font-weight: 400;
    margin-bottom: .3rem;
    cursor: pointer;
}
.bk-radio input { margin-right: .4rem; }

.bk-detail-row td { padding-top: 0; }
.bk-error {
    color: var(--danger);
    background: var(--danger-dim);
    border-radius: var(--radius);
    padding: .5rem .7rem;
    font-size: .82rem;
}
.bk-log {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .7rem;
    font-family: 'DM Mono', monospace;
    font-size: .76rem;
    color: var(--text-muted);
    max-height: 320px;
    overflow: auto;
    margin-top: .5rem;
    white-space: pre-wrap;
}