:root {
    --bg: #07090f;
    --bg-elevated: #0d121c;
    --bg-card: rgba(16, 22, 35, 0.72);
    --bg-card-hover: rgba(22, 31, 48, 0.9);
    --border: rgba(120, 145, 190, 0.16);
    --border-strong: rgba(120, 190, 255, 0.28);
    --text: #e8eefc;
    --text-muted: #8b9bb8;
    --accent: #4cc9f0;
    --accent-2: #7b61ff;
    --accent-3: #00f5d4;
    --danger: #ff6b8a;
    --success: #3ddc97;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius: 18px;
    --radius-sm: 12px;
    --font: "Manrope", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(76, 201, 240, 0.16), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(123, 97, 255, 0.18), transparent 50%),
        radial-gradient(700px 500px at 50% 100%, rgba(0, 245, 212, 0.08), transparent 45%),
        var(--bg);
    line-height: 1.5;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.topbar {
    display: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 240px;
    width: 240px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    border-right: 1px solid var(--border);
    background: rgba(7, 9, 15, 0.85);
    backdrop-filter: blur(16px);
    z-index: 50;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.is-active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.14), rgba(123, 97, 255, 0.12));
    border-color: var(--border-strong);
}

.sidebar-ico {
    width: 1.25em;
    font-family: var(--mono);
    font-size: 0.95rem;
    opacity: 0.9;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-text {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.logo-mark {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.85rem;
    color: #041018;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 28px rgba(76, 201, 240, 0.35);
}

.logo-mark.sm {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.72rem;
}

.user-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--mono);
    text-align: center;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 36px 36px 72px;
}

.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.page-hero h1 {
    margin: 6px 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: -0.03em;
}

.eyebrow {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-3);
}

.muted {
    margin: 0;
    color: var(--text-muted);
    max-width: 42ch;
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    color: #041018;
    background: linear-gradient(135deg, var(--accent), #6ee7ff 40%, var(--accent-2));
    box-shadow: 0 10px 30px rgba(76, 201, 240, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 14px 36px rgba(76, 201, 240, 0.35);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong);
}

.btn-ghost {
    color: var(--text-muted);
    background: transparent;
    border-color: var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.88rem;
}

.btn-block {
    width: 100%;
}

.btn-ico {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(4, 16, 24, 0.2);
    font-size: 1rem;
    line-height: 1;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.site-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        linear-gradient(160deg, rgba(76, 201, 240, 0.06), transparent 40%),
        var(--bg-card);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.site-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
    min-height: 0;
}

.site-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123, 97, 255, 0.22), transparent 70%);
    pointer-events: none;
}

.site-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}

.site-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-3);
    box-shadow: 0 0 12px rgba(0, 245, 212, 0.7);
}

.site-meta {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.site-card h2,
.site-title {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.site-title,
.project-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.site-favicon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    object-fit: contain;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.site-favicon-lg {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.site-favicon-fallback {
    display: inline-grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--mono);
    color: #041018;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
}

.site-favicon-fallback.site-favicon-lg {
    font-size: 0.85rem;
}

.site-open-tasks {
    margin: 8px 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-open-tasks.is-empty {
    color: #f0a44a;
}

.site-open-tasks.is-ok {
    color: var(--success);
}

.site-open-tasks.is-overdue {
    color: var(--danger);
}

.site-card-footer {
    margin-top: auto;
    padding-top: 22px;
    display: flex;
    justify-content: flex-end;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-card:hover .arrow {
    color: var(--accent);
    transform: translateX(4px);
}

.arrow {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

.site-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-admin-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.site-admin-btn:hover {
    opacity: 1;
    color: var(--accent);
    background: rgba(76, 201, 240, 0.12);
    transform: rotate(18deg);
}

.site-delete-btn {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.site-delete-btn:hover {
    opacity: 1;
    color: var(--danger);
    background: rgba(255, 107, 138, 0.12);
}

.empty-state {
    text-align: center;
    padding: 72px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
}

.empty-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.empty-state h2 {
    margin: 0 0 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin: 0 0 20px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 520px;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.panel-tasks {
    background:
        linear-gradient(180deg, rgba(76, 201, 240, 0.08), transparent 28%),
        var(--bg-card);
}

.panel-ideas {
    background:
        linear-gradient(180deg, rgba(123, 97, 255, 0.1), transparent 28%),
        var(--bg-card);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-header h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
}

.panel-editor {
    flex: 1;
    width: 100%;
    min-height: 380px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    color: var(--text);
    background: rgba(4, 8, 16, 0.55);
    outline: none;
    line-height: 1.6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel-editor:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.12);
}

.save-status {
    min-height: 1.4em;
    margin-top: 10px;
    font-size: 0.85rem;
    font-family: var(--mono);
    color: var(--text-muted);
}

.save-status.ok {
    color: var(--success);
}

.save-status.error {
    color: var(--danger);
}

.save-status.pending {
    color: var(--accent);
}

.modal[hidden] {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 10, 0.72);
    backdrop-filter: blur(6px);
}

.modal-panel {
    position: relative;
    width: min(460px, 100%);
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    background:
        linear-gradient(160deg, rgba(76, 201, 240, 0.08), transparent 40%),
        #0d1320;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-body {
    padding: 18px 22px 22px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.field span {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(4, 8, 16, 0.65);
    color: var(--text);
    outline: none;
}

.field input:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.12);
}

.field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(4, 8, 16, 0.65);
    color: var(--text);
    outline: none;
    resize: vertical;
    line-height: 1.55;
}

.field textarea:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.12);
}

.field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(4, 8, 16, 0.65);
    color: var(--text);
    outline: none;
}

.field select:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.12);
}

.task-meta-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.task-project {
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    color: var(--accent);
    background: rgba(76, 201, 240, 0.08);
}

.task-project.is-empty {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 16px;
}

.section-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.section-head h2 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.section-link {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.linkish {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.linkish:hover {
    color: #7dd8f7;
}


.section-link:hover {
    color: var(--accent);
}

.dashboard-tasks {
    margin-bottom: 36px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-row {
    display: flex;
    align-items: stretch;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(123, 97, 255, 0.08), transparent 42%),
        var(--bg-card);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.task-row:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.task-row.is-closed {
    opacity: 0.62;
}

.task-row-main {
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.task-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 8px;
}

.task-status {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-3);
}

.task-row.is-closed .task-status {
    color: var(--text-muted);
}

.task-status-inline {
    color: var(--accent-3);
    font-family: var(--mono);
}

.task-status-inline.is-closed {
    color: var(--text-muted);
}

.task-dates {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-row h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.task-preview {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    white-space: pre-wrap;
}

.task-row-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.task-edit-panel {
    max-width: 860px;
}

.task-desc-editor {
    min-height: 280px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.expiry-panel {
    margin-top: 28px;
    margin-bottom: 24px;
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        linear-gradient(160deg, rgba(0, 245, 212, 0.06), transparent 40%),
        var(--bg-card);
}

.expiry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.expiry-head h2 {
    margin: 4px 0 0;
    font-size: 1.25rem;
}

.expiry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.expiry-card {
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(4, 8, 16, 0.45);
}

.expiry-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.expiry-value {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.expiry-meta {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.expiry-sub {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    min-height: 1.2em;
}

.expiry-checked {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--mono);
}

.expiry-card.status-ok {
    border-color: rgba(61, 220, 151, 0.35);
}

.expiry-card.status-ok .expiry-value {
    color: var(--success);
}

.expiry-card.status-warn {
    border-color: rgba(255, 196, 86, 0.4);
}

.expiry-card.status-warn .expiry-value {
    color: #ffc456;
}

.expiry-card.status-danger,
.expiry-card.status-expired {
    border-color: rgba(255, 107, 138, 0.45);
}

.expiry-card.status-danger .expiry-value,
.expiry-card.status-expired .expiry-value {
    color: var(--danger);
}

.alert-panel {
    margin-bottom: 28px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 107, 138, 0.4);
    background: rgba(255, 107, 138, 0.1);
}

.alert-panel-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffd0da;
}

.alert-list {
    margin: 0;
    padding-left: 18px;
    color: #ffd0da;
}

.alert-list a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.alert-list a:hover {
    color: #fff;
}

.site-expiry-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 0.75rem;
}

.site-expiry-item {
    color: var(--text-muted);
}

.site-expiry-item.status-ok {
    color: var(--success);
}

.site-expiry-item.status-warn {
    color: #ffc456;
}

.site-expiry-item.status-danger,
.site-expiry-item.status-expired {
    color: var(--danger);
}

.feed-date.status-ok {
    color: var(--success);
}

.feed-date.status-warn {
    color: #ffc456;
}

.feed-date.status-danger,
.feed-date.status-expired {
    color: var(--danger);
}

.site-expiry-item small {
    opacity: 0.8;
}

.project-dates-line strong {
    color: var(--text);
    font-weight: 600;
}

.sober-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 26px 28px;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 185, 66, 0.32);
    background:
        linear-gradient(125deg, rgba(245, 185, 66, 0.14), rgba(0, 245, 212, 0.05) 48%, transparent 80%),
        var(--bg-card);
    box-shadow: 0 0 0 1px rgba(245, 185, 66, 0.06), 0 18px 50px rgba(0, 0, 0, 0.28);
}

.sober-glow {
    position: absolute;
    inset: -40% auto auto -10%;
    width: 55%;
    height: 140%;
    background: radial-gradient(circle at center, rgba(245, 185, 66, 0.22), transparent 68%);
    pointer-events: none;
    animation: soberPulse 6s ease-in-out infinite;
}

.sober-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.sober-eyebrow {
    color: #f5b942;
    letter-spacing: 0.12em;
}

.sober-headline {
    margin: 6px 0 10px;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.sober-days {
    display: inline-block;
    font-family: var(--mono);
    color: #ffe08a;
    font-variant-numeric: tabular-nums;
    animation: soberTick 1.2s ease-out;
}

.sober-earned {
    margin: 0 0 10px;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    color: var(--text);
}

.sober-pot {
    font-family: var(--mono);
    font-weight: 500;
    color: #3ddc97;
    font-variant-numeric: tabular-nums;
}

.sober-hint {
    margin: 0;
    max-width: 52ch;
}

.sober-aside {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.sober-task-btn {
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-sober {
    min-width: 132px;
    padding: 14px 22px;
    border: 1px solid rgba(245, 185, 66, 0.55);
    border-radius: 14px;
    background: linear-gradient(180deg, #f5c85a, #e8a317);
    color: #1a1408;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 28px rgba(232, 163, 23, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-sober:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 14px 32px rgba(232, 163, 23, 0.38);
}

.btn-sober:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(0.35);
}

@keyframes soberPulse {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}

@keyframes soberTick {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.earn-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 22px 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(61, 220, 151, 0.28);
    background:
        linear-gradient(135deg, rgba(61, 220, 151, 0.12), rgba(76, 201, 240, 0.06) 50%, transparent),
        var(--bg-card);
}

.earn-panel h2 {
    margin: 4px 0 8px;
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.earn-motto {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--text);
    max-width: 28ch;
}

.earn-right {
    text-align: right;
}

.tasks-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.task-row-compact {
    padding: 12px 14px;
    min-height: 0;
}

.task-row-compact h2 {
    font-size: 0.98rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-row-compact .task-row-actions {
    flex-direction: row;
    align-items: center;
}

.site-card.has-warning {
    border-color: rgba(255, 107, 138, 0.45);
}

@media (max-width: 900px) {
    .sober-content,
    .earn-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .sober-aside {
        width: 100%;
    }

    .btn-sober,
    .sober-task-btn {
        width: 100%;
    }

    .earn-right {
        text-align: left;
    }

    .tasks-grid-2 {
        grid-template-columns: 1fr;
    }
}

.expiry-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.goal-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.goal-field {
    margin-bottom: 0;
    min-width: 220px;
}

.auto-fill-task-toggle {
    margin: 14px 0 0;
    color: var(--text);
    font-size: 0.92rem;
}

.auto-fill-task-hint {
    margin: 6px 0 0;
    font-size: 0.82rem;
    max-width: 42rem;
}

.project-checklist-panel {
    margin-top: 28px;
    scroll-margin-top: 24px;
}

.project-checklist-panel .panel-header {
    margin-bottom: 18px;
    align-items: flex-start;
}

.project-checklist-panel .checklist-board {
    margin-top: 4px;
}

.project-checklist-panel .muted {
    margin: 6px 0 0;
}

.checklist-progress-hero {
    min-width: 180px;
    text-align: right;
}

.checklist-progress-num {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.checklist-progress-num .sep {
    color: var(--text-muted);
    margin: 0 4px;
}

.checklist-progress-bar {
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin: 8px 0 6px;
}

.checklist-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 99px;
    transition: width 0.25s ease;
}

.checklist-progress-label {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.checklist-board {
    display: grid;
    gap: 18px;
}

.checklist-group {
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        linear-gradient(160deg, rgba(76, 201, 240, 0.05), transparent 40%),
        var(--bg-card);
}

.checklist-group h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}

.checklist-items {
    display: grid;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(4, 8, 16, 0.4);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.checklist-item:hover {
    border-color: var(--border-strong);
}

.checklist-item.is-done {
    border-color: rgba(61, 220, 151, 0.3);
    background: rgba(61, 220, 151, 0.08);
}

.checklist-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checklist-box {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
}

.checklist-item.is-done .checklist-box {
    background: var(--success);
    border-color: var(--success);
}

.checklist-item.is-done .checklist-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #041018;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checklist-text {
    line-height: 1.4;
}

.checklist-ext-link {
    margin-left: 8px;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.checklist-ext-link:hover {
    text-decoration: underline;
}

.checklist-item.is-done .checklist-ext-link {
    text-decoration: none;
    opacity: 0.85;
}

.checklist-item.is-done .checklist-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

.checklist-item.is-done .checklist-ext-link {
    text-decoration: none;
}

@media (max-width: 900px) {
    .expiry-grid-3 {
        grid-template-columns: 1fr;
    }
}

.hint {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-error {
    margin: 12px 0 0;
    color: var(--danger);
    font-size: 0.9rem;
}

.auth-page {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 32px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background:
        linear-gradient(160deg, rgba(123, 97, 255, 0.12), transparent 45%),
        var(--bg-elevated);
    box-shadow: var(--shadow);
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand .logo-mark {
    margin: 0 auto 18px;
}

.auth-brand h1 {
    margin: 0 0 8px;
    font-size: 1.55rem;
}

.auth-brand p {
    margin: 0;
    color: var(--text-muted);
}

.auth-form .btn {
    margin-top: 8px;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.alert-error {
    color: #ffd0da;
    background: rgba(255, 107, 138, 0.12);
    border: 1px solid rgba(255, 107, 138, 0.3);
}

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 14px 12px;
    }

    .sidebar-brand {
        padding-bottom: 12px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex: none;
        gap: 8px;
    }

    .sidebar-link {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }

    .sidebar-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 12px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .page-hero {
        flex-direction: column;
    }

    .main-content {
        padding: 24px 16px 56px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .task-row {
        flex-direction: column;
    }

    .task-row-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .expiry-grid {
        grid-template-columns: 1fr;
    }
}

/* —— Напоминалки —— */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reminder-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.reminder-row.is-off {
    opacity: 0.55;
}

.reminder-time {
    font-family: var(--mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: #7be0ff;
    font-variant-numeric: tabular-nums;
}

.reminder-body h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.reminder-body p {
    margin: 0;
    font-size: 0.9rem;
}

.reminder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.field-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.field-inline input {
    width: auto;
}

.reminder-toast-host {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.reminder-toast {
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    padding: 18px 18px 16px;
    border-radius: 16px;
    border: 1px solid rgba(76, 201, 240, 0.35);
    background:
        linear-gradient(145deg, rgba(18, 28, 44, 0.97), rgba(10, 14, 22, 0.96));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.reminder-toast.is-in {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.reminder-toast.is-leaving {
    transform: translateY(16px) scale(0.96);
    opacity: 0;
}

.reminder-toast-glow {
    position: absolute;
    inset: -30% auto auto -20%;
    width: 70%;
    height: 120%;
    background: radial-gradient(circle, rgba(76, 201, 240, 0.22), transparent 70%);
    pointer-events: none;
}

.reminder-toast-top {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reminder-toast-label {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.reminder-toast-time {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.reminder-toast-title {
    position: relative;
    margin: 0 0 8px;
    font-size: 1.15rem;
    line-height: 1.3;
}

.reminder-toast-note {
    position: relative;
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.reminder-toast-actions {
    position: relative;
    display: flex;
    gap: 8px;
}

.reminder-toast-actions .btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
}

.reminder-toast.is-checklist {
    border-color: rgba(123, 97, 255, 0.4);
}

.reminder-toast.is-checklist .reminder-toast-label {
    color: #b9a6ff;
}

.reminders-extra-hint {
    margin-top: 8px;
    max-width: 52ch;
}

.reminder-toast-close {
    position: relative;
    width: 100%;
}

@media (max-width: 700px) {
    .reminder-row {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .reminder-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .reminder-toast-host {
        right: 12px;
        bottom: 12px;
    }
}

/* —— Мониторинг воркеров —— */
.monitor-panel {
    padding: 20px 22px 24px;
}

.monitor-meta {
    margin-bottom: 16px;
    font-size: 0.88rem;
}

.monitor-meta code {
    font-family: var(--mono);
    font-size: 0.85em;
    color: var(--accent);
}

.monitor-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(120, 145, 190, 0.22);
    background:
        linear-gradient(180deg, rgba(18, 26, 42, 0.92), rgba(12, 17, 28, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.monitor-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    min-width: 880px;
}

.monitor-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 14px;
    background: rgba(10, 14, 24, 0.95);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid rgba(120, 145, 190, 0.2);
    text-align: left;
    white-space: nowrap;
}

.monitor-table tbody td {
    padding: 14px;
    border-bottom: 1px solid rgba(120, 145, 190, 0.1);
    vertical-align: middle;
    text-align: left;
}

.monitor-table tbody tr:last-child td {
    border-bottom: none;
}

.monitor-table tr.is-online td {
    background: rgba(61, 220, 151, 0.045);
}

.monitor-table tr.is-offline td {
    background: rgba(255, 196, 86, 0.05);
}

.monitor-table tbody tr:hover td {
    background: rgba(76, 201, 240, 0.06);
}

.monitor-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-family: var(--mono);
    border: 1px solid transparent;
}

.monitor-badge.is-on {
    background: rgba(61, 220, 151, 0.14);
    color: #3ddc97;
    border-color: rgba(61, 220, 151, 0.28);
}

.monitor-badge.is-off {
    background: rgba(255, 196, 86, 0.14);
    color: #ffc456;
    border-color: rgba(255, 196, 86, 0.3);
}

.monitor-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
}

.monitor-badge.is-on .monitor-pulse {
    animation: monitorPulse 1.6s ease-out infinite;
}

@keyframes monitorPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(61, 220, 151, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(61, 220, 151, 0);
    }
}

.monitor-server {
    font-weight: 650;
    letter-spacing: -0.01em;
}

.monitor-ip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.84rem;
    font-weight: 650;
    padding: 4px 9px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.monitor-ip.is-on {
    color: #3ddc97;
    background: rgba(61, 220, 151, 0.12);
    border-color: rgba(61, 220, 151, 0.28);
}

.monitor-ip.is-off {
    color: #ffc456;
    background: rgba(255, 196, 86, 0.12);
    border-color: rgba(255, 196, 86, 0.32);
}

.monitor-site {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.monitor-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 110px;
}

.monitor-progress-bar {
    height: 5px;
    border-radius: 999px;
    background: rgba(120, 145, 190, 0.18);
    overflow: hidden;
    position: relative;
}

.monitor-progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: var(--pct, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, #3ddc97, #4cc9f0);
}

.monitor-table tr.is-offline .monitor-progress-bar::after {
    background: linear-gradient(90deg, #ffc456, #ff9f43);
}

.monitor-seen {
    font-variant-numeric: tabular-nums;
}

.monitor-actions {
    text-align: right;
    white-space: nowrap;
}

.mono-sm {
    font-family: var(--mono);
    font-size: 0.82rem;
}

.reminder-toast.is-monitor {
    border-color: rgba(255, 196, 86, 0.45);
}

.reminder-toast.is-monitor .reminder-toast-label {
    color: #ffc456;
}

.reminder-toast.is-monitor .reminder-toast-glow {
    background: radial-gradient(circle at 20% 0%, rgba(255, 196, 86, 0.35), transparent 55%);
}

