/* Hallmark · genre: modern-minimal · macrostructure: Workbench · design-system: design.md · designed-as-app
 * theme: custom brand orange/navy · tone: technical · nav: N3 app side rail · footer: Ft4 utility colophon · enrichment: existing logo only
 * audience: owner-operated reader · use: scan, organize, and act on feeds and tasks · states: default · hover · focus · active · disabled · loading · error · success
 * pre-emit critique: P5 H5 E5 S5 R5 V4 · contrast: pass (40–41) · slop: pass (1–58)
 * honest: pass (46) · chrome: pass (47) · tokens: pass (48, Hallmark layer) · responsive/mobile: pass (34, 49–57) · icons: pass (30)
 */

:root {
    --bg: var(--color-paper);
    --panel: var(--color-paper-raised);
    --panel-soft: var(--color-paper-soft);
    --ink: var(--color-ink);
    --muted: var(--color-muted);
    --line: var(--color-rule);
    --accent: var(--color-accent);
    --accent-strong: var(--color-brand-navy);
    --accent-soft: var(--color-accent-soft);
    --warn: var(--color-error);
    --warn-soft: var(--color-error-soft);
    --shadow: var(--shadow-raised);
    color-scheme: light;
    font-family: var(--font-body);
}

:root[data-theme="dark"] {
    --bg: var(--color-paper);
    --panel: var(--color-paper-raised);
    --panel-soft: var(--color-paper-soft);
    --ink: var(--color-ink);
    --muted: var(--color-muted);
    --line: var(--color-rule);
    --accent: var(--color-accent);
    --accent-strong: var(--color-brand-navy);
    --accent-soft: var(--color-accent-soft);
    --warn: var(--color-error);
    --warn-soft: var(--color-error-soft);
    --shadow: var(--shadow-raised);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(245, 130, 32, 0.12), rgba(246, 248, 245, 0) 280px),
        var(--bg);
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--accent-strong);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, #fff7ed 0%, #f7faf6 48%, #edf4fb 100%);
}

.auth-panel {
    width: min(470px, 100%);
    position: relative;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 36px;
    text-align: center;
}

.auth-panel::before {
    content: "";
    display: block;
    height: 6px;
    margin: -36px -36px 26px;
    background: linear-gradient(90deg, #f58220, #79a852, #0a3158);
}

.auth-graphic {
    width: min(292px, 100%);
    height: auto;
    display: block;
    margin: 0 auto 18px;
    filter: drop-shadow(0 18px 24px rgba(10, 49, 88, 0.14));
}

.auth-panel h1 {
    margin: 0 0 8px;
    color: var(--accent-strong);
    font-size: 30px;
    line-height: 1.12;
}

.auth-panel .muted {
    margin: 0;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
    text-align: left;
}

.idea-drop-public {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.idea-drop-card {
    width: min(760px, 100%);
    display: grid;
    gap: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 36px;
}

.idea-drop-public .brand-row {
    gap: 14px;
}

.idea-drop-public .brand-row strong {
    color: var(--accent-strong);
    font-size: 34px;
    line-height: 1.05;
}

.idea-drop-public .brand-mark.small {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.idea-drop-form {
    display: grid;
    gap: 18px;
}

.idea-drop-public .idea-drop-form label {
    gap: 10px;
    color: var(--ink);
    font-size: 17px;
}

.idea-drop-form textarea {
    min-height: 230px;
    resize: vertical;
    line-height: 1.5;
}

.idea-drop-public .idea-drop-form textarea {
    min-height: 320px;
    padding: 16px;
    font-size: 20px;
    line-height: 1.55;
}

.idea-drop-public .idea-drop-form input,
.idea-drop-public .idea-drop-form select {
    min-height: 54px;
    padding: 12px 14px;
    font-size: 18px;
}

.idea-drop-send {
    min-height: 56px;
    font-size: 18px;
}

.idea-drop-notice {
    max-width: none;
    margin: 0;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.mobile-menu-btn,
.reader-menu-btn,
.sidebar-backdrop {
    display: none;
}

.mobile-menu-btn span,
.reader-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.sidebar {
    background: rgba(255, 255, 255, 0.82);
    border-right: 1px solid var(--line);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    backdrop-filter: blur(16px);
}

.sidebar-top,
.reader-top,
.modal-head,
.entry-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.sidebar-top {
    display: grid;
    align-items: center;
    justify-content: stretch;
    justify-items: center;
    gap: 12px;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.88));
}

.sidebar-brand-graphic {
    width: min(218px, 100%);
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(10, 49, 88, 0.12));
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-weight: 900;
    letter-spacing: 0;
}

.brand-mark.small {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.muted {
    color: var(--muted);
}

.user-mail {
    margin: 7px 0 0;
    max-width: 205px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-top .user-mail {
    width: 100%;
    max-width: 100%;
    margin: 0;
    text-align: center;
    font-size: 12px;
}

.account-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sidebar-top .account-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.sidebar-top .account-actions form {
    display: flex;
}

.ai-settings-btn {
    font-size: 12px;
    font-weight: 950;
}

.sidebar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sidebar-actions .folder-create-btn {
    grid-column: 1 / -1;
}

.remote-control-btn {
    grid-column: 1 / -1;
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
        var(--warn);
    box-shadow: 0 12px 28px rgba(185, 70, 47, 0.22);
}

.remote-control-btn::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.remote-control-btn.active {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)),
        #8f2f1f;
    border-color: #8f2f1f;
    box-shadow: 0 14px 34px rgba(143, 47, 31, 0.32);
}

.remote-control-btn.active::before {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2), 0 0 18px rgba(255, 255, 255, 0.78);
}

.remote-control-btn:disabled {
    opacity: 0.82;
}

.playlist-panel {
    display: grid;
    gap: 10px;
    background: #f9fbfb;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.playlist-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.playlist-play-btn span {
    min-width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 12px;
}

.playlist-url-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.playlist-url-row input {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
}

.primary-btn,
.danger-btn,
.ghost-btn,
.icon-btn,
.folder-row,
.source-chip,
.feed-pill,
.segmented button {
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.primary-btn {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 800;
    padding: 0 14px;
}

.primary-btn:hover {
    background: var(--accent-strong);
}

.danger-btn {
    background: var(--warn);
    color: #fff;
    border-color: var(--warn);
    font-weight: 800;
    padding: 0 14px;
}

.danger-btn:hover {
    background: #953522;
}

.ghost-btn,
.icon-btn {
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
    font-weight: 700;
    padding: 0 12px;
}

.ghost-btn:hover,
.icon-btn:hover {
    border-color: #b7c8c2;
    background: var(--panel-soft);
}

.ghost-btn.compact {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.primary-btn.compact {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.danger-btn.compact {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.icon-btn {
    min-width: 40px;
}

.icon-btn.compact {
    min-width: 32px;
    min-height: 32px;
    padding: 0;
}

.settings-btn {
    font-size: 16px;
    line-height: 1;
}

.icon-btn.active {
    background: #fff4d8;
    border-color: #e7bd58;
}

.folder-list {
    display: grid;
    gap: 8px;
}

.folder-group {
    display: grid;
    gap: 6px;
}

.folder-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.folder-toggle {
    width: 28px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-weight: 900;
}

.folder-toggle:hover {
    background: var(--panel-soft);
    color: var(--ink);
}

.folder-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: transparent;
    color: var(--ink);
    padding: 0 10px;
    font-weight: 850;
    text-align: left;
}

.folder-action {
    width: 32px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    padding: 0;
    font-size: 15px;
    font-weight: 800;
}

.folder-action:hover {
    background: var(--panel-soft);
    color: var(--ink);
}

.gear-action {
    line-height: 1;
}

.folder-row b {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
}

.folder-row.active,
.folder-row:hover,
.source-chip.active,
.source-chip:hover {
    background: var(--accent-soft);
    border-color: rgba(245, 130, 32, 0.22);
}

.live-folder {
    border-color: rgba(121, 168, 82, 0.18);
    background: rgba(121, 168, 82, 0.08);
}

.article-folder {
    border-color: rgba(111, 74, 142, 0.14);
    background: rgba(111, 74, 142, 0.07);
}

.idea-folder {
    border-color: rgba(196, 117, 45, 0.18);
    background: rgba(196, 117, 45, 0.08);
}

.source-list {
    display: grid;
    gap: 6px;
    min-height: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
    margin-left: 12px;
}

.source-list[hidden],
.folder-group[data-collapsed="true"] .source-list {
    display: none !important;
}

.source-list.drop-ready,
.folder-row.drop-ready {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.source-chip {
    width: 100%;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    background: transparent;
    border-color: transparent;
    padding: 6px 7px;
    text-align: left;
}

.source-chip.dragging {
    opacity: 0.45;
}

.source-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #dde9f4;
    color: #26465c;
    font-size: 12px;
    font-weight: 900;
    position: relative;
    overflow: hidden;
}

.x-avatar {
    background: #111817;
    color: #fff;
    font-size: 14px;
}

.rss-avatar {
    background: #f28c28;
}

.reddit-avatar {
    background: #ff4500;
}

.youtube-avatar {
    background: #ff0033;
}

.web-avatar {
    background: #305c7a;
    color: #fff;
}

.iptv-avatar {
    background: #0a3158;
    color: #fff;
    font-size: 11px;
}

.radio-avatar {
    background: #7a4f18;
    color: #fff;
    font-size: 10px;
}

.article-avatar {
    background: #6f4a8e;
    color: #fff;
}

.idea-avatar {
    background: #c4752d;
    color: #fff;
}

.rss-dot,
.rss-arc,
.reddit-antenna,
.reddit-face,
.reddit-eye,
.youtube-play {
    position: absolute;
    display: block;
}

.youtube-play {
    width: 0;
    height: 0;
    left: 12px;
    top: 9px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid #fff;
}

.rss-dot {
    width: 6px;
    height: 6px;
    left: 8px;
    bottom: 8px;
    border-radius: 50%;
    background: #fff;
}

.rss-arc {
    left: 8px;
    bottom: 8px;
    border-color: #fff;
    border-style: solid;
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 0 999px 0 0;
}

.rss-arc.small {
    width: 12px;
    height: 12px;
    border-width: 3px 3px 0 0;
}

.rss-arc.large {
    width: 18px;
    height: 18px;
    border-width: 3px 3px 0 0;
}

.reddit-face {
    width: 19px;
    height: 14px;
    left: 5px;
    bottom: 6px;
    border-radius: 999px;
    background: #fff;
}

.reddit-face::before,
.reddit-face::after {
    content: "";
    position: absolute;
    top: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
}

.reddit-face::before {
    left: -2px;
}

.reddit-face::after {
    right: -2px;
}

.reddit-antenna {
    width: 10px;
    height: 9px;
    left: 16px;
    top: 4px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    border-radius: 0 999px 0 0;
    transform: rotate(-18deg);
}

.reddit-antenna::after {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
}

.reddit-eye {
    width: 3px;
    height: 3px;
    bottom: 11px;
    border-radius: 50%;
    background: #ff4500;
    z-index: 1;
}

.reddit-eye.left {
    left: 11px;
}

.reddit-eye.right {
    right: 11px;
}

.source-body {
    display: grid;
    min-width: 0;
}

.source-name,
.source-body small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-name {
    font-size: 13px;
    font-weight: 800;
}

.source-body small {
    color: var(--muted);
    font-size: 11px;
}

.source-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.source-settings,
.source-remove {
    color: var(--muted);
    text-align: center;
    font-weight: 900;
    border-radius: 6px;
}

.source-settings {
    min-width: 22px;
    padding: 4px 0;
    font-size: 14px;
}

.source-remove {
    min-width: 22px;
    padding: 4px 0;
}

.source-settings:hover,
.source-remove:hover {
    background: #fff;
    color: var(--ink);
}

.color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.color-grid input[type="color"] {
    min-height: 42px;
    padding: 4px;
}

.settings-preview {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--ink);
    padding: 0 12px;
    font-weight: 850;
}

.color-clear-row {
    margin-top: -4px;
}

.cron-card {
    margin-top: auto;
    display: grid;
    gap: 10px;
    background: #f9fbfb;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.cron-card code {
    display: block;
    max-height: 70px;
    overflow: auto;
    overflow-wrap: anywhere;
    color: #2d403c;
    font-size: 11px;
}

.reader {
    min-width: 0;
    width: 100%;
    padding: 26px;
}

.reader-top {
    align-items: flex-start;
    margin: 0 auto 18px;
    max-width: 1040px;
}

.reader-titlebar {
    min-width: 0;
}

.section-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.reader-top h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.12;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.toolbar[hidden] {
    display: none;
}

.toolbar-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: stretch;
}

.segmented {
    display: inline-flex;
    background: #e8efed;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 3px;
    min-height: 42px;
}

.segmented button {
    min-height: 34px;
    background: transparent;
    color: var(--muted);
    border: 0;
    padding: 0 12px;
    font-weight: 850;
}

.segmented button.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(23, 33, 31, 0.08);
}

.search-input {
    width: min(250px, 100%);
}

.idea-tag-filter {
    width: min(210px, 100%);
}

.notice {
    max-width: 1040px;
    margin: 0 auto 16px;
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(245, 130, 32, 0.2);
    color: var(--accent-strong);
    font-weight: 750;
}

.notice[data-tone="bad"],
.error-box {
    background: var(--warn-soft);
    border: 1px solid rgba(185, 70, 47, 0.24);
    color: var(--warn);
}

.progress-box {
    max-width: 1040px;
    margin: 0 auto 16px;
    border: 1px solid rgba(245, 130, 32, 0.2);
    border-radius: 8px;
    background: #fff;
    padding: 13px 14px 14px;
    box-shadow: 0 10px 28px rgba(33, 48, 45, 0.08);
}

.progress-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.progress-copy strong {
    font-size: 14px;
}

.progress-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--panel-soft);
}

.progress-track span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    animation: progress-sweep 1.15s ease-in-out infinite;
}

@keyframes progress-sweep {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(240%);
    }
}

.error-box {
    border-radius: 8px;
    padding: 12px;
}

.entry-list {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.entry-list[data-loading="true"] .entry-card {
    opacity: 0.68;
}

.entry-card,
.empty-state {
    min-width: 0;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(33, 48, 45, 0.08);
}

.entry-card,
.video-card {
    padding: 18px;
}

.entry-card.auto-hiding {
    opacity: 0.45;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.entry-meta {
    color: var(--muted);
    font-size: 13px;
}

.entry-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.create-post-btn {
    min-width: 78px;
}

.idea-rewrite-btn {
    min-width: 106px;
}

.idea-undo-btn {
    min-width: 72px;
}

.feed-pill {
    min-height: 30px;
    background: var(--panel-soft);
    color: var(--accent-strong);
    border-color: transparent;
    padding: 0 10px;
    font-weight: 900;
}

.entry-title {
    margin: 13px 0 10px;
    font-size: 20px;
    line-height: 1.32;
    overflow-wrap: anywhere;
}

.entry-title a {
    color: var(--ink);
    text-decoration: none;
}

.entry-title a:hover {
    color: var(--accent-strong);
}

.entry-content {
    min-width: 0;
    max-width: 100%;
    color: #293936;
    line-height: 1.58;
    overflow-wrap: anywhere;
}

.entry-content > * {
    max-width: 100%;
}

.entry-content a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.entry-content pre,
.entry-content code {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.entry-content pre {
    overflow-x: auto;
}

.entry-content p {
    margin: 0 0 10px;
}

.entry-content p:last-child {
    margin-bottom: 0;
}

.generated-posts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.generated-posts-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.generated-post-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.entry-content img,
.entry-content video {
    display: block;
    max-width: 100%;
    max-height: 520px;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    border: 1px solid var(--line);
}

.entry-content video {
    width: min(100%, 760px);
    background: #111817;
}

.entry-content video[poster] {
    background: #f5f8f7;
    object-fit: contain;
}

.iptv-player-wrap {
    width: min(100%, 860px);
    display: grid;
    gap: 8px;
    margin: 12px 0 2px;
}

.iptv-player-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #070b0a;
}

.entry-content .iptv-video {
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    background: #070b0a;
}

.iptv-player-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.iptv-player-status[data-tone="bad"] {
    color: var(--warn);
}

.iptv-source-link {
    min-width: max-content;
    color: var(--accent-strong);
    text-decoration: none;
}

.iptv-source-link:hover {
    text-decoration: underline;
}

.radio-player-wrap {
    width: min(100%, 640px);
    display: grid;
    gap: 8px;
    margin: 10px 0 2px;
}

.radio-player-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px 12px;
    padding: 12px;
    border: 1px solid rgba(122, 79, 24, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 246, 0.96)),
        var(--panel);
}

.radio-live-badge {
    min-width: 46px;
    min-height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #163f3a;
    color: #fff;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.radio-player-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.radio-player-copy strong,
.radio-player-copy span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.radio-player-copy strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.2;
}

.radio-player-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.entry-content .radio-audio {
    grid-column: 1 / -1;
    width: 100%;
    height: 36px;
    margin: 2px 0 0;
    border: 0;
    border-radius: 0;
    accent-color: var(--accent);
}

.radio-player-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.radio-player-status[data-tone="bad"] {
    color: var(--warn);
}

.radio-source-link {
    min-width: max-content;
    color: var(--accent-strong);
    text-decoration: none;
}

.radio-source-link:hover {
    text-decoration: underline;
}

.entry-content img.broken-media {
    display: none;
}

.media-status {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 800;
}

.media-status[data-tone="bad"] {
    background: var(--warn-soft);
    color: var(--warn);
}

.media-action {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--accent-strong);
    padding: 0 11px;
    font-size: 12px;
    font-weight: 850;
}

.media-action:hover {
    background: var(--accent-soft);
    border-color: rgba(245, 130, 32, 0.24);
}

.media-action:disabled {
    cursor: wait;
    opacity: 0.72;
}

.media-action[data-tone="bad"] {
    color: var(--warn);
    background: var(--warn-soft);
    border-color: rgba(185, 70, 47, 0.22);
}

.embedded-media {
    max-width: 100%;
    margin: 12px 0;
}

.embedded-preview {
    max-width: 100%;
    margin: 12px 0;
}

.link-preview {
    display: grid;
    grid-template-columns: minmax(120px, 32%) 1fr;
    width: 100%;
    max-width: 760px;
    min-height: 116px;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.link-preview:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 26px rgba(22, 57, 50, 0.1);
}

.link-preview.no-image {
    grid-template-columns: 1fr;
}

.link-preview-media {
    min-height: 116px;
    background: var(--panel-soft);
}

.entry-content .link-preview img {
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    object-fit: cover;
    border: 0;
    border-radius: 0;
}

.link-preview-body {
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 12px 14px;
    min-width: 0;
}

.link-preview-body strong,
.link-preview-body span,
.link-preview-body small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-body strong {
    font-size: 15px;
    line-height: 1.35;
}

.link-preview-body span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.link-preview-body small {
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
}

.entry-content blockquote {
    margin: 12px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    background: #f7faf9;
}

.video-card {
    display: grid;
    grid-template-columns: minmax(280px, 44%) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(33, 48, 45, 0.08);
}

.youtube-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #111817;
}

.youtube-frame iframe,
.playlist-player iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.video-card-body {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.video-meta,
.video-actions,
.playlist-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.video-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status-pill {
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    padding: 0 9px;
    background: var(--panel-soft);
    color: var(--muted);
}

.status-pill.live {
    background: #ffe8e8;
    color: #b4232c;
}

.status-pill.entry-video-tag {
    background: #ffe8e8;
    border: 1px solid rgba(180, 35, 44, 0.22);
    color: #b4232c;
    font-weight: 900;
}

.status-pill.upcoming {
    background: #fff2d8;
    color: #8a5a00;
}

.status-pill.ended {
    background: #e8efed;
    color: #50605c;
}

.live-tabs {
    width: max-content;
    max-width: 100%;
}

.video-playlist.active {
    cursor: default;
}

.remote-bridge-card {
    width: min(460px, calc(100vw - 28px));
}

.remote-bridge-status {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.remote-bridge-status strong {
    color: var(--ink);
    font-size: 15px;
}

.remote-bridge-devices {
    display: grid;
    gap: 8px;
}

.remote-device-row {
    width: 100%;
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
}

.remote-device-row strong,
.remote-device-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remote-device-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.remote-device-row.active {
    border-color: var(--warn);
    background: var(--warn-soft);
}

.remote-device-badge {
    min-height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    padding: 0 9px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.remote-device-row.active .remote-device-badge {
    background: var(--warn);
    color: #fff;
}

.task-manager-folder {
    border-color: rgba(28, 90, 132, 0.16);
    background: rgba(28, 90, 132, 0.07);
}

.task-manager-view {
    display: grid;
    gap: 16px;
}

.task-manager-toolbar {
    display: grid;
    grid-template-columns: minmax(190px, 240px) auto minmax(280px, 1fr);
    align-items: center;
    gap: 12px;
}

.task-manager-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.task-project-filter {
    min-height: 42px;
}

.task-project-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.task-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    align-items: center;
    gap: 12px;
}

.task-due-filters {
    justify-self: start;
}

.task-search-input {
    width: 100%;
    justify-self: end;
}

.task-project-card {
    min-height: 92px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-content: center;
    align-items: center;
    gap: 4px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    text-align: left;
}

.task-project-card.active,
.task-project-card:hover {
    border-color: rgba(28, 90, 132, 0.28);
    background: #e9f3f7;
}

.task-project-logo,
.task-project-chip-logo,
.task-project-entry-logo {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    background: #24445a;
    color: #fff;
    font-weight: 950;
}

.task-project-logo {
    width: 42px;
    height: 42px;
    grid-row: 1 / 4;
    font-size: 12px;
}

.task-project-logo img,
.task-project-chip-logo img,
.task-project-entry-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-project-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.task-project-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.task-project-edit {
    width: max-content;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 900;
}

.task-upcoming-list,
.task-doc-grid {
    display: grid;
    gap: 12px;
}

.task-date-line {
    min-height: 34px;
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.task-date-line::after {
    content: "";
    height: 1px;
    flex: 1;
    margin-left: 12px;
    background: var(--line);
}

.task-date-line.overdue {
    color: #a83224;
}

.task-date-line.overdue::after {
    background: #d73324;
}

.task-date-line.upcoming {
    color: #1f6a3a;
}

.task-date-line.upcoming::after {
    background: #2fa757;
}

.task-date-line.today {
    color: #765300;
}

.task-date-line.today::after {
    background: #f0c12f;
}

.task-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 32px rgba(33, 48, 45, 0.08);
}

.task-card-route-focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.18), 0 10px 32px rgba(33, 48, 45, 0.08);
}

.task-card-summary,
.task-card-details {
    display: grid;
    gap: 12px;
}

.task-card-details[hidden] {
    display: none !important;
}

.task-card-details {
    border: 1px solid rgba(101, 114, 122, 0.22);
    border-radius: 8px;
    background: rgba(246, 248, 245, 0.62);
    padding: 14px;
}

.task-card-summary-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.task-card-summary-top .task-card-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.task-card-summary-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-card-summary-actions .ghost-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
}

.task-card-toggle {
    flex: 0 0 auto;
    width: 34px;
    min-height: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    font-size: 15px;
    font-weight: 950;
}

.task-card-toggle-mark {
    display: block;
    transform-origin: center;
    transition: transform 150ms ease;
}

.task-card[data-expanded="true"] .task-card-toggle-mark {
    transform: rotate(90deg);
}

.task-card-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.task-card-meta,
.task-card-actions,
.task-card-attachments,
.task-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.task-card-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.task-project-entry-box,
.task-date-entry-box,
.task-type-entry-box,
.task-type-chip,
.task-time-chip,
.task-reminder-chip,
.task-attachment-chip {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    padding: 0 10px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 850;
}

.task-project-entry-box,
.task-date-entry-box,
.task-type-entry-box {
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

.task-project-entry-box {
    gap: 10px;
    padding: 4px 12px 4px 4px;
}

.task-date-entry-box,
.task-type-entry-box {
    padding: 0 14px;
    font-size: 13px;
    font-weight: 900;
}

.task-type-entry-box {
    background: #f2edf7;
    color: #664181;
}

.task-project-entry-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 12px;
}

.task-project-entry-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.task-project-chip-logo {
    width: 22px;
    height: 22px;
    font-size: 9px;
    border-radius: 6px;
}

.task-type-chip {
    background: #f2edf7;
    color: #664181;
}

.task-reminder-chip {
    background: #fff1dc;
    color: #8a5a00;
}

.task-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
}

.task-card-title-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.task-card-title-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.task-priority-dot {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 1px solid #111817;
    border-radius: 50%;
}

.task-priority-dot.high {
    background: #d73324;
    border-color: #d73324;
}

.task-priority-dot.medium {
    background: #f0c12f;
    border-color: #d5a918;
}

.task-priority-dot.low {
    background: #2fa757;
    border-color: #2fa757;
}

.task-priority-dot.neutral {
    background: #fff;
    border-color: #111817;
}

.task-card-description {
    color: #293936;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.task-card-description p,
.task-card-description div {
    margin: 0 0 8px;
}

.task-card-description h2,
.task-card-description h3,
.task-card-description h4 {
    margin: 12px 0 6px;
    line-height: 1.2;
}

.task-card-description h2 {
    font-size: 22px;
}

.task-card-description h3 {
    font-size: 18px;
}

.task-card-description h4 {
    font-size: 15px;
}

.task-card-description img {
    display: block;
    max-width: 100%;
    max-height: 420px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 10px 0;
}

.task-card-description hr,
.task-description-editor hr {
    height: 1px;
    border: 0;
    background: var(--line);
    margin: 16px 0;
}

.task-inverse {
    background: var(--ink);
    color: #fff;
    padding: 1px 4px;
    border-radius: 4px;
}

.task-card-links {
    display: grid;
    gap: 8px;
}

.task-card-section-title {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.task-card-url-list {
    display: grid;
    gap: 6px;
}

.task-card-url-list a {
    display: block;
}

.task-card-links a,
.task-card-attachments a {
    overflow-wrap: anywhere;
}

.task-card-actions {
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.task-pagination {
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.task-item-modal {
    width: min(900px, calc(100vw - 28px));
}

.task-item-card {
    max-height: calc(100dvh - 36px);
    overflow-x: hidden;
    overflow-y: auto;
    overflow-anchor: none;
    overscroll-behavior: contain;
    align-content: start;
    scrollbar-gutter: stable;
}

.task-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.task-form-grid > label,
.task-form-grid input,
.task-form-grid select {
    min-width: 0;
}

.task-form-grid .switch-row {
    overflow: hidden;
}

.task-form-grid .switch-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.task-recurrence-field {
    grid-column: span 1;
}

.task-item-card .task-recurrence-field select:disabled {
    background: var(--panel-soft);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.72;
}

.task-editor-wrap,
.task-links-editor,
.task-attachment-editor {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.task-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.task-description-editor {
    min-height: 190px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 12px;
    line-height: 1.55;
    outline: none;
}

.task-description-editor:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.task-section-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.task-section-head > strong {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
}

.task-link-input {
    display: grid;
    grid-template-columns: minmax(190px, 1.25fr) minmax(180px, 0.85fr) auto;
    gap: 8px;
    min-width: 0;
}

.task-link-input input {
    min-height: 32px;
    min-width: 0;
}

.task-link-list,
.task-attachment-list {
    display: grid;
    gap: 8px;
}

.task-link-row,
.task-attachment-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 6px 8px;
}

.task-attachment-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.task-link-row.dragging {
    opacity: 0.45;
}

.task-link-handle {
    color: var(--muted);
    font-weight: 950;
    cursor: grab;
}

.task-link-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.task-link-description {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-link-url,
.task-attachment-row a,
.task-attachment-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-file-pick {
    position: relative;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
}

.task-file-pick input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.task-editor-empty {
    min-height: 38px;
    display: flex;
    align-items: center;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
}

.empty-state {
    padding: 42px;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

.empty-state.compact {
    padding: 20px;
    box-shadow: none;
}

.modal {
    border: 0;
    background: transparent;
    width: min(430px, calc(100vw - 28px));
    padding: 0;
}

.wide-modal {
    width: min(760px, calc(100vw - 28px));
}

.playlist-modal {
    width: min(1040px, calc(100vw - 28px));
}

.post-modal {
    width: min(760px, calc(100vw - 28px));
}

.ai-options-modal {
    width: min(760px, calc(100vw - 28px));
}

.idea-drop-modal {
    width: min(620px, calc(100vw - 28px));
}

.modal::backdrop {
    background: rgba(23, 33, 31, 0.36);
    backdrop-filter: blur(4px);
}

.modal-card {
    display: grid;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.source-modal-card {
    max-height: calc(100dvh - 36px);
    overflow: auto;
}

.headline-filter {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.headline-filter[hidden] {
    display: none;
}

.headline-filter > small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.filter-tag-editor {
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.filter-tag-editor:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-tag-list {
    display: contents;
}

.filter-tag {
    min-height: 28px;
    max-width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.filter-tag:hover {
    background: var(--warn-soft);
    color: var(--warn);
}

.filter-tag-editor input[data-filter-tag-input] {
    width: min(100%, 230px);
    flex: 1 1 180px;
    min-height: 30px;
    border: 0;
    padding: 3px 2px;
    background: transparent;
    box-shadow: none;
}

.headline-filter-mode {
    min-height: 34px;
}

.confirm-modal .modal-card {
    border-color: rgba(185, 70, 47, 0.2);
    background:
        linear-gradient(180deg, rgba(255, 239, 234, 0.92), #fff 88px),
        #fff;
}

.confirm-modal .modal-head h2::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-right: 9px;
    border-radius: 50%;
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 16px;
    font-weight: 950;
}

.confirm-modal .confirm-copy {
    padding: 12px;
    border: 1px solid rgba(185, 70, 47, 0.16);
    border-radius: 8px;
    background: rgba(255, 247, 244, 0.84);
    color: #2d211d;
    font-weight: 800;
}

.playlist-modal-card {
    max-height: calc(100dvh - 36px);
    min-height: 0;
    overflow: auto;
}

.post-modal-card {
    max-height: calc(100dvh - 36px);
}

.ai-options-card {
    max-height: calc(100dvh - 36px);
    overflow: auto;
}

.idea-drop-app-form {
    max-height: calc(100dvh - 36px);
    overflow: auto;
}

.idea-drop-app-form textarea {
    min-height: min(340px, 48dvh);
    resize: vertical;
    line-height: 1.5;
}

#generatedPostText {
    min-height: min(420px, 58dvh);
    resize: vertical;
    line-height: 1.55;
    white-space: pre-wrap;
}

#aiOptionsForm textarea[name="prompt"] {
    min-height: min(360px, 52dvh);
    resize: vertical;
    line-height: 1.45;
    font-family: var(--font-mono);
    font-size: 13px;
}

.playlist-player-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
}

.playlist-stage {
    width: min(100%, 640px);
    aspect-ratio: 16 / 9;
    justify-self: center;
    min-height: 0;
    max-height: min(360px, 42dvh);
    overflow: hidden;
    border-radius: 8px;
    background: #111817;
    border: 1px solid var(--line);
}

.playlist-player {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.playlist-stream-wrap {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
}

.playlist-stream-wrap .iptv-player-frame {
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
}

.playlist-stream-wrap .iptv-video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    background: #070b0a;
}

.playlist-stream-wrap .iptv-player-footer {
    min-height: 30px;
    padding: 6px 10px;
    background: #111817;
}

.playlist-queue {
    min-height: 0;
    max-height: min(300px, 34vh);
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 8px;
}

.playlist-queue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.playlist-row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-self: stretch;
    justify-self: end;
}

.playlist-first-btn,
.playlist-save-btn,
.playlist-remove-btn {
    width: 40px;
    align-self: stretch;
    font-weight: 900;
    touch-action: manipulation;
}

.playlist-first-btn {
    color: var(--accent);
    font-size: 20px;
}

.playlist-remove-btn {
    color: #fff;
    background: var(--warn);
    border-color: var(--warn);
}

.playlist-remove-btn:hover {
    background: #953522;
    border-color: #953522;
}

.playlist-queue-row.dragging {
    opacity: 0.45;
}

.playlist-queue-row.drop-ready .playlist-queue-main {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.playlist-queue-main {
    min-height: 54px;
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 8px 10px;
    text-align: left;
}

.playlist-queue-main strong,
.playlist-queue-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-queue-main strong {
    font-size: 13px;
}

.playlist-queue-main span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.playlist-queue-row.active .playlist-queue-main {
    background: var(--accent-soft);
    border-color: rgba(245, 130, 32, 0.24);
}

.modal-head h2 {
    margin: 0;
    font-size: 20px;
}

.website-feed-head {
    display: grid;
    gap: 4px;
}

.website-feed-head strong {
    font-size: 15px;
}

.website-feed-head span,
.ai-key-status {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.ai-key-status[data-tone="good"] {
    color: var(--accent-strong);
}

.ai-key-status[data-tone="bad"] {
    color: var(--warn);
}

.website-feed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.website-candidates {
    max-height: min(480px, 58vh);
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-right: 4px;
}

.website-candidate {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: var(--ink);
}

.website-candidate input {
    width: 18px;
    min-height: 18px;
    margin-top: 3px;
}

.website-candidate-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.website-candidate-title {
    font-size: 14px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.website-candidate small,
.website-candidate p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.website-candidate-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.website-candidate-badges span {
    min-height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    padding: 0 8px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 900;
}

.ai-options {
    display: grid;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.switch-row {
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    color: var(--ink);
}

.switch-row input {
    appearance: none;
    width: 46px;
    min-height: 26px;
    height: 26px;
    border-radius: 999px;
    padding: 2px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    position: relative;
}

.switch-row input::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    left: 2px;
    top: 2px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(23, 33, 31, 0.18);
    transition: transform 160ms ease;
}

.switch-row input:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.switch-row input:checked::before {
    transform: translateX(20px);
}

.options-cleanup {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.cleanup-days-row {
    gap: 9px;
    color: var(--ink);
}

.cleanup-days-row strong {
    color: var(--accent-strong);
}

.cleanup-days-row input[type="range"] {
    min-height: 28px;
    padding: 0;
    accent-color: var(--warn);
}

.cleanup-range-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.options-cleanup .danger-btn {
    justify-self: end;
}

.confirm-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.item-settings-actions {
    justify-content: space-between;
}

:root[data-theme="dark"] body {
    background:
        linear-gradient(180deg, rgba(255, 155, 61, 0.12), rgba(16, 24, 32, 0) 280px),
        var(--bg);
}

:root[data-theme="dark"] .auth-wrap {
    background:
        linear-gradient(135deg, #211a14 0%, #101820 54%, #111d2b 100%);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .filter-tag-editor,
:root[data-theme="dark"] .auth-panel,
:root[data-theme="dark"] .idea-drop-card,
:root[data-theme="dark"] .ghost-btn,
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .folder-action,
:root[data-theme="dark"] .folder-toggle,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .media-status,
:root[data-theme="dark"] .media-action,
:root[data-theme="dark"] .link-preview,
:root[data-theme="dark"] .website-candidate,
:root[data-theme="dark"] .task-project-card,
:root[data-theme="dark"] .task-project-entry-box,
:root[data-theme="dark"] .task-date-entry-box,
:root[data-theme="dark"] .task-type-entry-box,
:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .task-description-editor,
:root[data-theme="dark"] .task-link-row,
:root[data-theme="dark"] .task-attachment-row,
:root[data-theme="dark"] .progress-box,
:root[data-theme="dark"] .cron-card,
:root[data-theme="dark"] .playlist-panel,
:root[data-theme="dark"] .playlist-queue-main {
    background: var(--panel);
    color: var(--ink);
    border-color: var(--line);
}

:root[data-theme="dark"] .sidebar {
    background: rgba(16, 24, 32, 0.88);
}

:root[data-theme="dark"] .sidebar-top {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 237, 0.94));
    border-color: rgba(255, 209, 161, 0.4);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .sidebar-top .user-mail {
    color: #65727a;
}

:root[data-theme="dark"] .sidebar-top .ghost-btn,
:root[data-theme="dark"] .sidebar-top .icon-btn {
    background: #ffffff;
    color: #0b2947;
    border-color: #dce5df;
}

:root[data-theme="dark"] .sidebar-top .ghost-btn:hover,
:root[data-theme="dark"] .sidebar-top .icon-btn:hover {
    background: #fff0dc;
    border-color: rgba(245, 130, 32, 0.35);
}

:root[data-theme="dark"] .entry-card,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .video-card,
:root[data-theme="dark"] .task-card {
    background: rgba(24, 33, 31, 0.94);
    box-shadow: var(--shadow);
}

:root[data-theme="dark"] .segmented {
    background: var(--panel-soft);
}

:root[data-theme="dark"] .segmented button.active,
:root[data-theme="dark"] .source-settings:hover,
:root[data-theme="dark"] .source-remove:hover {
    background: var(--panel);
}

:root[data-theme="dark"] .entry-content {
    color: var(--ink);
}

:root[data-theme="dark"] .task-card-description {
    color: var(--ink);
}

:root[data-theme="dark"] .task-card-details {
    background: rgba(34, 48, 67, 0.42);
    border-color: rgba(168, 181, 189, 0.2);
}

:root[data-theme="dark"] .entry-content blockquote {
    background: var(--panel-soft);
}

:root[data-theme="dark"] .cron-card code {
    color: var(--ink);
}

:root[data-theme="dark"] .entry-content video[poster] {
    background: var(--panel-soft);
}

:root[data-theme="dark"] .radio-player-shell {
    background:
        linear-gradient(135deg, rgba(33, 43, 40, 0.96), rgba(26, 35, 33, 0.98)),
        var(--panel);
    border-color: rgba(218, 166, 72, 0.22);
}

:root[data-theme="dark"] .radio-live-badge {
    background: #d49b2a;
    color: #111817;
}

:root[data-theme="dark"] .live-folder,
:root[data-theme="dark"] .article-folder,
:root[data-theme="dark"] .idea-folder,
:root[data-theme="dark"] .task-manager-folder,
:root[data-theme="dark"] .playlist-queue-row.active .playlist-queue-main {
    background: var(--accent-soft);
}

:root[data-theme="dark"] .task-project-card.active,
:root[data-theme="dark"] .task-project-card:hover {
    background: var(--panel-soft);
}

:root[data-theme="dark"] .task-priority-dot.neutral {
    border-color: #fff;
}

:root[data-theme="dark"] .confirm-modal .modal-card {
    background:
        linear-gradient(180deg, rgba(58, 32, 27, 0.72), var(--panel) 92px),
        var(--panel);
    border-color: rgba(241, 120, 92, 0.24);
}

:root[data-theme="dark"] .confirm-modal .confirm-copy {
    background: rgba(58, 32, 27, 0.78);
    border-color: rgba(241, 120, 92, 0.3);
    color: #fff4ef;
}

:root[data-theme="dark"] .remote-control-btn {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

@media (min-width: 861px) {
    .remote-control-btn {
        display: none;
    }

    .task-item-modal {
        width: min(940px, calc(100vw - 56px));
    }

    .task-item-card {
        max-height: min(860px, calc(100dvh - 56px));
    }
}

@media (max-width: 1080px) {
    .task-section-head {
        grid-template-columns: 1fr;
    }

    .task-link-input {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .mobile-menu-btn {
        position: fixed;
        left: 14px;
        top: 14px;
        z-index: 60;
        width: 42px;
        height: 42px;
        display: grid;
        place-content: center;
        gap: 4px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.94);
        color: var(--ink);
        box-shadow: 0 10px 26px rgba(33, 48, 45, 0.12);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        background: rgba(23, 33, 31, 0.36);
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease;
    }

    .app-shell[data-sidebar-open="true"] .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 50;
        width: min(320px, calc(100vw - 44px));
        max-width: 88vw;
        height: 100dvh;
        padding-top: 72px;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        transform: translateX(-102%);
        transition: transform 180ms ease;
        box-shadow: var(--shadow);
    }

    .app-shell[data-sidebar-open="true"] .sidebar {
        transform: translateX(0);
    }

    .app-shell[data-sidebar-open="true"] .mobile-menu-btn {
        background: var(--ink);
        color: #fff;
        border-color: var(--ink);
    }

    :root[data-theme="dark"] .mobile-menu-btn,
    :root[data-theme="dark"] .app-shell[data-sidebar-open="true"] .mobile-menu-btn {
        background: rgba(255, 255, 255, 0.94);
        color: #0b2947;
        border-color: #dce5df;
    }

    :root[data-theme="dark"] .mobile-menu-btn span {
        background: #0b2947;
    }

    .remote-control-btn {
        display: flex;
    }

    .sidebar-brand-graphic {
        width: min(178px, 72%);
    }

    .reader {
        padding: 18px;
        padding-top: 70px;
    }

    .reader-top {
        display: grid;
        padding-left: 0;
    }

    .toolbar {
        justify-content: stretch;
    }

    .toolbar > * {
        flex: 1 1 180px;
    }

    .toolbar-actions {
        flex: 1 1 180px;
        flex-wrap: wrap;
    }

    .toolbar-actions > * {
        flex: 1 1 0;
        min-width: 96px;
    }

    .segmented {
        width: 100%;
    }

    .segmented button {
        flex: 1;
        padding: 0 8px;
    }

    .link-preview {
        grid-template-columns: minmax(0, 1fr);
    }

    .link-preview-media {
        aspect-ratio: 16 / 9;
    }

    .video-card,
    .playlist-player-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .task-manager-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .task-search {
        grid-template-columns: 1fr;
    }

    .task-due-filters {
        width: 100%;
    }

    .task-due-filters:empty {
        display: none;
    }

    .task-manager-actions {
        justify-content: stretch;
    }

    .task-manager-actions > * {
        flex: 1 1 130px;
    }

    .task-form-grid {
        grid-template-columns: 1fr;
    }

    .task-section-head {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .task-link-input {
        grid-template-columns: minmax(0, 1fr);
    }

    .task-link-input .ghost-btn {
        width: 100%;
    }

    .playlist-queue {
        max-height: 220px;
        overflow-x: hidden;
    }

    .playlist-queue-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .playlist-row-actions {
        width: 100%;
        justify-self: stretch;
        display: flex;
        gap: 8px;
    }

    .playlist-first-btn,
    .playlist-save-btn,
    .playlist-remove-btn {
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
        height: 44px;
        min-height: 44px;
    }

    .video-actions,
    .entry-actions {
        width: 100%;
    }

    .iptv-player-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .radio-player-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .entry-meta {
        display: grid;
        justify-content: stretch;
    }

    .video-actions > *,
    .entry-actions > * {
        flex: 1 1 120px;
    }
}

@media (max-width: 520px) {
    .idea-drop-public {
        place-items: stretch;
        padding: 12px;
    }

    .auth-panel,
    .idea-drop-card {
        padding: 24px;
    }

    .idea-drop-card {
        min-height: calc(100dvh - 24px);
        gap: 18px;
    }

    .idea-drop-public .brand-row strong {
        font-size: 30px;
    }

    .idea-drop-public .brand-mark.small {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .idea-drop-public .idea-drop-form label {
        font-size: 16px;
    }

    .idea-drop-public .idea-drop-form textarea {
        min-height: 42dvh;
        font-size: 19px;
    }

    .idea-drop-public .idea-drop-form input,
    .idea-drop-public .idea-drop-form select {
        font-size: 18px;
    }

    .idea-drop-send {
        width: 100%;
        min-height: 58px;
    }

    .auth-panel::before {
        margin: -24px -24px 22px;
    }

    .auth-graphic {
        width: min(238px, 100%);
    }

    .auth-panel h1 {
        font-size: 26px;
    }

    .playlist-url-row,
    .color-grid {
        grid-template-columns: 1fr;
    }

    .reader-top h1 {
        font-size: 28px;
    }

    .entry-card {
        padding: 14px;
    }

    .entry-actions {
        width: 100%;
        justify-content: stretch;
    }

    .entry-actions > button {
        flex: 1;
    }

    .generated-posts {
        align-items: stretch;
        flex-direction: column;
    }

    .generated-post-buttons {
        justify-content: stretch;
    }

    .generated-post-buttons > button {
        flex: 1 1 130px;
    }

    .task-project-strip {
        grid-template-columns: 1fr;
    }

    .task-card {
        padding: 14px;
    }

    .task-card-actions > button {
        flex: 1;
    }

    .task-link-row,
    .task-attachment-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .task-link-handle {
        display: none;
    }
}

@media (max-width: 360px) {
    .sidebar-actions {
        grid-template-columns: 1fr;
    }
}

/* Workbench redesign — additive visual layer; application behavior stays in app.js. */

html,
body {
    overflow-x: clip;
}

html {
    background: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
}

body {
    min-width: 20rem;
    background: var(--color-paper);
    color: var(--color-ink);
    line-height: 1.5;
}

h1,
h2,
h3,
.reader-top h1,
.entry-title,
.task-card-title {
    min-width: 0;
    font-family: var(--font-display);
    font-style: normal;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

a {
    color: var(--color-brand-navy);
    text-decoration-thickness: var(--rule-thin);
    text-underline-offset: var(--space-2xs);
}

button,
[role="button"],
a,
.task-file-pick {
    -webkit-tap-highlight-color: var(--color-transparent);
}

button,
.task-file-pick,
.feed-pill,
.source-chip,
.folder-row,
.folder-action,
.folder-toggle {
    white-space: nowrap;
}

:focus-visible {
    outline: var(--rule-strong) solid var(--color-focus-outer);
    outline-offset: var(--space-2xs);
}

.primary-btn,
.danger-btn,
.ghost-btn,
.icon-btn,
.folder-row,
.source-chip,
.feed-pill,
.segmented button,
.folder-toggle,
.folder-action,
.task-project-card {
    border-radius: var(--radius-md);
    transition:
        background-color var(--dur-short) var(--ease-out),
        border-color var(--dur-short) var(--ease-out),
        color var(--dur-short) var(--ease-out),
        opacity var(--dur-micro) var(--ease-out),
        transform var(--dur-micro) var(--ease-out);
}

.primary-btn,
.danger-btn,
.ghost-btn,
.icon-btn {
    min-height: var(--size-control);
    padding-inline: var(--space-md);
    border-width: var(--rule-thin);
    font-weight: 750;
}

.primary-btn {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-accent-ink);
}

.danger-btn {
    border-color: var(--color-error);
    background: var(--color-error);
    color: var(--color-paper-raised);
}

.ghost-btn,
.icon-btn,
.folder-toggle,
.folder-action {
    border-color: var(--color-rule);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    box-shadow: var(--shadow-whisper);
}

.ghost-btn.compact,
.primary-btn.compact,
.danger-btn.compact,
.icon-btn.compact {
    min-height: var(--size-control-compact);
    font-size: var(--text-xs);
}

.icon-btn.compact {
    min-width: var(--size-control-compact);
}

.primary-btn:active,
.danger-btn:active,
.ghost-btn:active,
.icon-btn:active,
.folder-row:active,
.source-chip:active,
.task-project-card:active {
    transform: translateY(var(--shift-press));
}

button:disabled,
button[aria-disabled="true"],
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

button[data-state="loading"] {
    cursor: progress;
    opacity: 0.72;
}

button[data-state="error"] {
    border-color: var(--color-error);
    background: var(--color-error-soft);
    color: var(--color-error);
}

button[data-state="success"] {
    border-color: var(--color-success);
    background: var(--color-success-soft);
    color: var(--color-success);
}

button[data-state="success"]::after {
    content: "✓";
    margin-inline-start: var(--space-xs);
}

input,
select,
textarea,
.filter-tag-editor,
.task-description-editor {
    min-height: var(--size-control);
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-md);
    outline: var(--rule-strong) solid var(--color-transparent);
    outline-offset: var(--rule-thin);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    transition:
        background-color var(--dur-short) var(--ease-out),
        border-color var(--dur-short) var(--ease-out);
}

textarea,
.task-description-editor {
    min-height: 6rem;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-muted);
    opacity: 1;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.task-description-editor:focus-visible {
    border-color: var(--color-rule-strong);
    outline-color: var(--color-focus-outer);
    box-shadow: 0 0 0 var(--rule-strong) var(--color-focus-inner);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--color-error);
    background: var(--color-error-soft);
}

input[data-state="success"],
select[data-state="success"],
textarea[data-state="success"] {
    border-color: var(--color-success);
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.25rem;
    min-height: 1.25rem;
}

input[type="checkbox"],
input[type="radio"],
input[type="range"] {
    accent-color: var(--color-accent);
}

.app-shell {
    min-height: 100dvh;
    grid-template-columns: var(--size-sidebar) minmax(0, 1fr);
    background: var(--color-paper);
}

.sidebar {
    z-index: var(--z-sticky);
    top: 0;
    height: 100dvh;
    padding: var(--space-md);
    gap: var(--space-lg);
    border-inline-end: var(--rule-thin) solid var(--color-rule);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    backdrop-filter: none;
    scrollbar-color: var(--color-rule-strong) var(--color-paper-raised);
}

.sidebar-top {
    display: grid;
    justify-items: start;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-xs) var(--space-lg);
    border: 0;
    border-block-end: var(--rule-thin) solid var(--color-rule);
    border-radius: 0;
    background: var(--color-paper-raised);
    color: var(--color-ink);
}

.sidebar-brand-graphic {
    width: min(11.25rem, 78%);
    filter: none;
}

.sidebar-top .user-mail {
    max-width: 100%;
    margin: 0;
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    text-align: start;
}

.sidebar-top .account-actions {
    width: 100%;
    justify-content: flex-start;
    gap: var(--space-xs);
}

.sidebar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs);
}

.sidebar-actions .remote-control-btn {
    grid-column: 1 / -1;
}

.sidebar-actions .folder-create-btn {
    grid-column: 1 / -1;
}

.remote-control-btn,
.remote-control-btn.active {
    min-height: var(--size-control);
    border-color: var(--color-error);
    background: var(--color-error);
    color: var(--color-paper-raised);
    box-shadow: none;
}

.remote-control-btn::before {
    width: var(--space-xs);
    height: var(--space-xs);
    background: currentColor;
    box-shadow: 0 0 0 var(--space-2xs) var(--color-error-soft);
}

.playlist-panel {
    gap: var(--space-xs);
    padding: var(--space-sm) 0 var(--space-lg);
    border: 0;
    border-block-end: var(--rule-thin) solid var(--color-rule);
    border-radius: 0;
    background: var(--color-paper-raised);
    color: var(--color-ink);
}

.playlist-url-row {
    gap: var(--space-xs);
}

.folder-list,
.folder-group {
    gap: var(--space-2xs);
}

.folder-list {
    padding-block-end: var(--space-xl);
}

.folder-head {
    grid-template-columns: var(--size-control-compact) minmax(0, 1fr) var(--size-control-compact);
    gap: var(--space-2xs);
}

.folder-toggle,
.folder-action {
    width: var(--size-control-compact);
    height: var(--size-control-compact);
    min-height: var(--size-control-compact);
}

.folder-row {
    min-height: var(--size-control);
    padding-inline: var(--space-sm);
    border: var(--rule-thin) solid var(--color-transparent);
    background: var(--color-transparent);
    color: var(--color-ink);
    font-weight: 750;
}

.folder-row b {
    min-width: var(--size-control-compact);
    height: var(--size-control-compact);
    border-radius: var(--radius-sm);
    background: var(--color-paper-soft);
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
}

.folder-row.active,
.source-chip.active {
    border-color: var(--color-rule-strong);
    background: var(--color-paper-soft);
    color: var(--color-ink);
}

.live-folder {
    border-color: var(--color-live);
    background: var(--color-live-soft);
}

.article-folder {
    border-color: var(--color-article);
    background: var(--color-article-soft);
}

.idea-folder {
    border-color: var(--color-idea);
    background: var(--color-idea-soft);
}

.task-manager-folder {
    border-color: var(--color-info);
    background: var(--color-info-soft);
}

.source-list {
    gap: var(--space-2xs);
    margin-inline-start: var(--space-md);
    padding-inline-start: var(--space-sm);
    border-inline-start: var(--rule-thin) solid var(--color-rule);
}

.source-chip {
    min-height: var(--size-control);
    grid-template-columns: var(--size-control-compact) minmax(0, 1fr) auto;
    gap: var(--space-xs);
    padding: var(--space-2xs);
}

.source-avatar {
    width: var(--size-control-compact);
    height: var(--size-control-compact);
    border-radius: var(--radius-sm);
}

.cron-card {
    gap: var(--space-xs);
    margin-block-start: auto;
    padding: var(--space-lg) var(--space-xs) var(--space-xs);
    border: 0;
    border-block-start: var(--rule-thin) solid var(--color-rule);
    border-radius: 0;
    background: var(--color-paper-raised);
    color: var(--color-ink);
    font-family: var(--font-mono);
}

.cron-card code {
    color: var(--color-muted);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.reader {
    min-width: 0;
    width: 100%;
    padding: 0 0 var(--space-3xl);
    background: var(--color-paper);
}

.reader-top {
    position: sticky;
    z-index: var(--z-raised);
    top: 0;
    max-width: none;
    min-height: 6.5rem;
    margin: 0 0 var(--space-xl);
    padding: var(--space-lg) clamp(var(--space-md), 3vw, var(--space-xl));
    align-items: flex-end;
    border-block-end: var(--rule-thin) solid var(--color-rule);
    background: var(--color-paper-raised);
    color: var(--color-ink);
}

.reader-titlebar {
    flex: 1 1 18rem;
}

.section-label {
    margin: 0 0 var(--space-2xs);
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 650;
    letter-spacing: 0.08em;
}

.reader-top h1 {
    max-width: 18ch;
    margin: 0;
    color: var(--color-ink);
    font-size: var(--text-2xl);
    line-height: 1.08;
}

.toolbar {
    flex: 1 1 32rem;
    justify-content: flex-end;
    gap: var(--space-xs);
}

.toolbar-actions {
    gap: var(--space-xs);
}

.segmented {
    min-height: var(--size-control);
    padding: var(--space-2xs);
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-soft);
}

.segmented button {
    min-height: calc(var(--size-control) - var(--space-xs));
    padding-inline: var(--space-sm);
    color: var(--color-muted);
}

.segmented button.active {
    background: var(--color-paper-raised);
    color: var(--color-ink);
    box-shadow: var(--shadow-whisper);
}

.search-input {
    width: min(17rem, 100%);
}

.notice,
.progress-box,
.entry-list {
    width: calc(100% - clamp(2rem, 6vw, 5rem));
    max-width: var(--size-content);
    margin-inline: auto;
}

.notice,
.progress-box {
    margin-block-end: var(--space-md);
    border-radius: var(--radius-md);
}

.notice {
    border: var(--rule-thin) solid var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-brand-navy);
}

.notice[data-tone="bad"],
.error-box {
    border-color: var(--color-error);
    background: var(--color-error-soft);
    color: var(--color-error);
}

.progress-box {
    border: var(--rule-thin) solid var(--color-rule);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    box-shadow: var(--shadow-whisper);
}

.progress-track {
    background: var(--color-paper-soft);
}

.progress-track span {
    background: var(--color-accent);
    animation-timing-function: var(--ease-in-out);
}

.entry-list {
    gap: var(--space-md);
}

.entry-card,
.empty-state,
.video-card,
.task-card {
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    box-shadow: var(--shadow-whisper);
}

.entry-card,
.video-card {
    padding: clamp(var(--space-md), 2vw, var(--space-lg));
}

.entry-meta {
    gap: var(--space-sm);
    padding-block-end: var(--space-sm);
    border-block-end: var(--rule-thin) solid var(--color-rule);
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
}

.entry-actions {
    gap: var(--space-xs);
}

.feed-pill,
.task-type-chip,
.task-time-chip,
.task-reminder-chip,
.task-attachment-chip {
    border-radius: var(--radius-sm);
}

.feed-pill {
    min-height: var(--size-control-compact);
    border-color: var(--color-rule);
    background: var(--color-paper-soft);
    color: var(--color-brand-navy);
}

.entry-title {
    margin: var(--space-lg) 0 var(--space-sm);
    color: var(--color-ink);
    font-size: var(--text-lg);
    line-height: 1.2;
}

.entry-title a {
    color: var(--color-ink);
}

.entry-content,
.task-card-description {
    max-width: 72ch;
    color: var(--color-ink);
    font-size: var(--text-base);
    line-height: 1.62;
}

.entry-content blockquote {
    border-inline-start: var(--rule-strong) solid var(--color-accent);
    background: var(--color-paper-soft);
    color: var(--color-ink);
}

.entry-content img,
.entry-content video,
.task-card-description img,
.iptv-player-frame {
    border-color: var(--color-rule);
    border-radius: var(--radius-md);
}

.generated-posts,
.task-card-actions {
    border-block-start-color: var(--color-rule);
}

.task-manager-view {
    gap: var(--space-lg);
}

.task-manager-toolbar {
    grid-template-columns: minmax(12rem, 15rem) auto minmax(18rem, 1fr);
    gap: var(--space-sm);
    align-items: end;
}

.task-manager-actions {
    gap: var(--space-xs);
}

.task-project-strip {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    padding-block-end: var(--space-xs);
    scroll-snap-type: x proximity;
    scrollbar-color: var(--color-rule-strong) var(--color-paper);
}

.task-project-card {
    flex: 0 0 min(15rem, 78vw);
    min-height: 5.5rem;
    scroll-snap-align: start;
    border-color: var(--color-rule);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    box-shadow: none;
}

.task-project-card.active {
    border-color: var(--color-info);
    background: var(--color-info-soft);
    color: var(--color-ink);
}

.task-project-logo,
.task-project-chip-logo,
.task-project-entry-logo {
    border-radius: var(--radius-md);
    background: var(--color-brand-navy);
    color: var(--color-paper-raised);
}

.task-search {
    gap: var(--space-sm);
}

.task-card {
    gap: var(--space-md);
    padding: clamp(var(--space-md), 2vw, var(--space-lg));
    box-shadow: none;
}

.task-card-route-focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 var(--space-2xs) var(--color-accent-soft);
}

.task-card-details {
    gap: var(--space-md);
    padding: var(--space-md) 0 0;
    border: 0;
    border-block-start: var(--rule-thin) solid var(--color-rule);
    border-radius: 0;
    background: var(--color-paper-raised);
    color: var(--color-ink);
}

.task-project-entry-box,
.task-date-entry-box,
.task-type-entry-box {
    border-color: var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-soft);
    color: var(--color-ink);
}

.task-type-entry-box,
.task-type-chip {
    background: var(--color-article-soft);
    color: var(--color-article);
}

.task-reminder-chip {
    background: var(--color-idea-soft);
    color: var(--color-idea);
}

.task-card-description,
.task-card-details,
.task-description-editor,
.task-link-row,
.task-attachment-row {
    background: var(--color-paper-raised);
    color: var(--color-ink);
}

.task-date-line::after,
.task-card-description hr,
.task-description-editor hr {
    background: var(--color-rule);
}

.task-card-actions {
    border-color: var(--color-rule);
}

.task-item-card {
    scrollbar-color: var(--color-rule-strong) var(--color-paper-raised);
}

.modal {
    position: fixed;
    inset: 0;
    height: fit-content;
    max-height: min(88dvh, 48rem);
    margin: auto;
    overflow: hidden;
}

.modal::backdrop {
    background: var(--color-backdrop);
}

.modal[open] .modal-card {
    animation: workbench-modal-in var(--dur-long) var(--ease-out) both;
}

.modal-card {
    max-height: min(88dvh, 48rem);
    overflow-y: auto;
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-lg);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    box-shadow: var(--shadow-raised);
}

.modal-head {
    position: sticky;
    z-index: var(--z-raised);
    top: 0;
    padding-block-end: var(--space-sm);
    border-block-end: var(--rule-thin) solid var(--color-rule);
    background: var(--color-paper-raised);
    color: var(--color-ink);
}

.modal-head h2 {
    color: var(--color-ink);
    font-size: var(--text-xl);
}

@keyframes workbench-modal-in {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(var(--space-xs));
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.auth-wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(var(--space-md), 5vw, var(--space-2xl));
    background: var(--color-paper);
}

.auth-panel {
    width: min(58rem, 100%);
    max-width: 58rem;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(18rem, 0.88fr);
    grid-template-rows: auto auto 1fr;
    gap: var(--space-md) var(--space-2xl);
    align-items: start;
    padding: clamp(var(--space-lg), 5vw, var(--space-2xl));
    border: var(--rule-thin) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-paper-raised);
    color: var(--color-ink);
    box-shadow: var(--shadow-raised);
    text-align: start;
}

.auth-panel::before {
    display: none;
}

.auth-graphic {
    grid-column: 1;
    grid-row: 1 / -1;
    width: min(26rem, 100%);
    align-self: center;
    justify-self: center;
}

.auth-panel h1,
.auth-panel > p,
.auth-panel > form {
    grid-column: 2;
}

.auth-panel h1 {
    margin: 0;
    color: var(--color-ink);
    font-size: var(--text-display);
    line-height: 1.03;
}

.auth-panel .muted {
    margin: 0;
    color: var(--color-muted);
}

.auth-form {
    display: grid;
    gap: var(--space-md);
    align-self: end;
}

.auth-form label,
.modal-card label {
    gap: var(--space-xs);
    color: var(--color-ink);
    font-weight: 700;
}

.auth-form label > small,
.modal-card label > small,
.modal-card > small {
    min-height: 1lh;
    display: block;
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: 400;
}

.error-box {
    border-radius: var(--radius-md);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .auth-wrap,
:root[data-theme="dark"] .reader,
:root[data-theme="dark"] .app-shell {
    background: var(--color-paper);
    color: var(--color-ink);
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .sidebar-top,
:root[data-theme="dark"] .playlist-panel,
:root[data-theme="dark"] .cron-card,
:root[data-theme="dark"] .reader-top,
:root[data-theme="dark"] .entry-card,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .video-card,
:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .task-card-details,
:root[data-theme="dark"] .task-description-editor,
:root[data-theme="dark"] .task-link-row,
:root[data-theme="dark"] .task-attachment-row,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .modal-head,
:root[data-theme="dark"] .auth-panel,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .filter-tag-editor,
:root[data-theme="dark"] .ghost-btn,
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .folder-toggle,
:root[data-theme="dark"] .folder-action,
:root[data-theme="dark"] .progress-box,
:root[data-theme="dark"] .task-project-card {
    background: var(--color-paper-raised);
    color: var(--color-ink);
}

:root[data-theme="dark"] .segmented,
:root[data-theme="dark"] .folder-row b,
:root[data-theme="dark"] .feed-pill,
:root[data-theme="dark"] .task-project-entry-box,
:root[data-theme="dark"] .task-date-entry-box {
    background: var(--color-paper-soft);
    color: var(--color-ink);
}

:root[data-theme="dark"] .segmented button.active,
:root[data-theme="dark"] .folder-row.active,
:root[data-theme="dark"] .source-chip.active,
:root[data-theme="dark"] .task-project-card.active {
    background: var(--color-paper-soft);
    color: var(--color-ink);
}

:root[data-theme="dark"] .entry-content,
:root[data-theme="dark"] .task-card-description,
:root[data-theme="dark"] .task-card-details,
:root[data-theme="dark"] .cron-card code {
    color: var(--color-ink);
}

@media (hover: hover) and (pointer: fine) {
    .primary-btn:hover {
        border-color: var(--color-accent-hover);
        background: var(--color-accent-hover);
        color: var(--color-accent-ink);
        transform: translateY(var(--shift-hover));
    }

    .danger-btn:hover,
    .remote-control-btn:hover {
        border-color: var(--color-error-hover);
        background: var(--color-error-hover);
        color: var(--color-paper-raised);
        transform: translateY(var(--shift-hover));
    }

    .ghost-btn:hover,
    .icon-btn:hover,
    .folder-toggle:hover,
    .folder-action:hover {
        border-color: var(--color-rule-strong);
        background: var(--color-paper-soft);
        color: var(--color-ink);
    }

    .folder-row:hover,
    .source-chip:hover {
        border-color: var(--color-rule);
        background: var(--color-paper-soft);
        color: var(--color-ink);
    }

    .task-project-card:hover {
        border-color: var(--color-info);
        background: var(--color-info-soft);
        color: var(--color-ink);
    }

    input:hover,
    select:hover,
    textarea:hover,
    .task-description-editor:hover {
        background: var(--color-paper-soft);
    }
}

@media (max-width: 59.999rem) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        width: min(22rem, calc(100% - var(--space-md)));
        max-width: none;
        padding-block-start: calc(var(--space-3xl) + env(safe-area-inset-top));
        box-shadow: var(--shadow-raised);
    }

    .reader-top {
        min-height: auto;
        padding-inline-start: calc(var(--space-3xl) + var(--space-sm));
    }

    .mobile-menu-btn {
        z-index: var(--z-modal);
        top: max(var(--space-md), env(safe-area-inset-top));
        left: max(var(--space-md), env(safe-area-inset-left));
        width: var(--size-control);
        height: var(--size-control);
        border: var(--rule-thin) solid var(--color-rule-strong);
        border-radius: var(--radius-md);
        background: var(--color-paper-raised);
        color: var(--color-ink);
        box-shadow: var(--shadow-whisper);
    }

    .sidebar-backdrop {
        z-index: var(--z-sticky);
        background: var(--color-backdrop);
    }

    .toolbar {
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .task-manager-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .task-manager-actions {
        grid-column: 2;
    }

    .task-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 39.999rem) {
    .reader-top {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-md);
        margin-block-end: var(--space-lg);
        padding: calc(var(--space-3xl) + env(safe-area-inset-top)) var(--space-md) var(--space-md);
    }

    .reader-top h1 {
        max-width: none;
        font-size: var(--text-xl);
    }

    .toolbar,
    .toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar-actions > *,
    .search-input,
    .idea-tag-filter,
    .segmented {
        width: 100%;
    }

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

    .segmented button {
        min-width: 0;
        padding-inline: var(--space-xs);
        overflow: hidden;
        font-size: var(--text-xs);
        text-overflow: ellipsis;
    }

    .notice,
    .progress-box,
    .entry-list {
        width: calc(100% - (var(--space-md) * 2));
    }

    .entry-card,
    .video-card,
    .task-card {
        padding: var(--space-md);
    }

    .entry-meta,
    .task-card-summary-top,
    .generated-posts {
        align-items: stretch;
        flex-direction: column;
    }

    .entry-actions,
    .generated-post-buttons,
    .task-card-actions {
        width: 100%;
        justify-content: stretch;
    }

    .entry-actions > button,
    .generated-post-buttons > button,
    .task-card-actions > button {
        flex: 1 1 auto;
    }

    .task-manager-toolbar,
    .task-search,
    .task-form-grid,
    .task-section-head,
    .task-link-input {
        grid-template-columns: minmax(0, 1fr);
    }

    .task-manager-actions,
    .task-search {
        grid-column: 1;
    }

    .task-manager-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-manager-toolbar > .segmented {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-manager-actions > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .task-due-filters,
    .task-search-input {
        width: 100%;
    }

    .modal,
    .wide-modal,
    .playlist-modal,
    .post-modal,
    .ai-options-modal,
    .task-item-modal {
        width: calc(100% - (var(--space-md) * 2));
        max-height: calc(100dvh - (var(--space-md) * 2));
    }

    .modal-card,
    .task-item-card {
        max-height: calc(100dvh - (var(--space-md) * 2));
    }

    .auth-wrap {
        padding: var(--space-md);
    }

    .auth-panel {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        gap: var(--space-md);
        padding: var(--space-lg);
    }

    .auth-graphic,
    .auth-panel h1,
    .auth-panel > p,
    .auth-panel > form {
        grid-column: 1;
        grid-row: auto;
    }

    .auth-graphic {
        width: min(15rem, 72vw);
    }

    .auth-panel h1 {
        font-size: var(--text-2xl);
    }
}

@media (pointer: coarse) {
    .primary-btn,
    .danger-btn,
    .ghost-btn,
    .icon-btn,
    .folder-row,
    .source-chip,
    .folder-toggle,
    .folder-action,
    .segmented button,
    .task-project-card {
        min-height: var(--size-control);
    }
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
.task-file-pick:focus-visible,
.folder-row:focus-visible,
.source-chip:focus-visible,
.task-project-card:focus-visible {
    outline-color: var(--color-focus-outer);
    box-shadow: 0 0 0 var(--rule-strong) var(--color-focus-inner);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 150ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 150ms !important;
    }

    .modal[open] .modal-card {
        animation-name: workbench-modal-fade;
    }
}

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

/* Focused refinement · dark logo plate · switches · quiet folder labels */
:root[data-theme="dark"] .sidebar-brand-graphic {
    box-sizing: border-box;
    width: min(12rem, 82%);
    padding: var(--space-sm);
    border: var(--rule-thin) solid var(--color-logo-plate-rule);
    border-radius: var(--radius-lg);
    background: var(--color-logo-plate);
    color: var(--color-accent-ink);
    box-shadow: var(--shadow-whisper);
}

.switch-row {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-md);
    color: var(--color-ink);
    cursor: pointer;
}

.switch-row > span {
    min-width: 0;
}

.switch-row input[type="checkbox"] {
    appearance: none;
    box-sizing: border-box;
    position: relative;
    display: block;
    flex: none;
    width: var(--size-switch-track);
    min-width: var(--size-switch-track);
    height: var(--size-switch-height);
    min-height: var(--size-switch-height);
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: var(--rule-thin) solid var(--color-rule-strong);
    border-radius: var(--radius-round);
    background: var(--color-paper-soft);
    color: var(--color-ink);
    box-shadow: none;
    cursor: pointer;
}

.switch-row input[type="checkbox"]::before {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: calc(var(--space-2xs) - var(--rule-thin));
    width: var(--size-switch-thumb);
    height: var(--size-switch-thumb);
    border-radius: var(--radius-round);
    background: var(--color-muted);
    box-shadow: var(--shadow-whisper);
    transform: translate(0, -50%);
    transition: transform var(--dur-micro) var(--ease-out);
}

.switch-row input[type="checkbox"]:checked {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-accent-ink);
}

.switch-row input[type="checkbox"]:checked::before {
    background: var(--color-accent-ink);
    transform: translate(var(--shift-switch-thumb), -50%);
}

.switch-row input[type="checkbox"]:active::before {
    transform: translate(0, -50%) scale(0.92);
}

.switch-row input[type="checkbox"]:checked:active::before {
    transform: translate(var(--shift-switch-thumb), -50%) scale(0.92);
}

.switch-row:has(input:disabled) {
    cursor: not-allowed;
}

.switch-row input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.switch-row input[type="checkbox"][data-state="loading"] {
    cursor: progress;
}

.folder-row {
    justify-content: flex-start;
}

.folder-row > b {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .switch-row input[type="checkbox"]:hover:not(:disabled) {
        border-color: var(--color-brand-navy);
        background: var(--color-paper-raised);
        color: var(--color-ink);
    }

    .switch-row input[type="checkbox"]:checked:hover:not(:disabled) {
        border-color: var(--color-accent-hover);
        background: var(--color-accent-hover);
        color: var(--color-accent-ink);
    }
}
