@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Outfit:wght@300;400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

:root {
    --obsidian: #0c0a09;
    --obsidian-lift: #181214;
    --maroon-deep: #4a0404;
    --maroon: #7f1d1d;
    --maroon-rose: #881337;
    --gold: #d4af37;
    --gold-bright: #f59e0b;
    --gold-light: #fbbf24;
    --ink: #f5e6d3;
    --muted: #a89a86;
    --glass: rgba(28, 18, 20, 0.72);
    --line: rgba(212, 175, 55, 0.2);
    --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.15);
    --radius: 1.25rem;
    --angle: 0deg;
}

@property --angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body.app-shell {
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(136, 19, 55, 0.28), transparent 55%),
        radial-gradient(800px 380px at 92% 8%, rgba(212, 175, 55, 0.12), transparent 50%),
        linear-gradient(180deg, #0c0a09 0%, #181214 55%, #120d0e 100%);
    overflow: hidden;
}

#dust-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.4));
}

.app-frame {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 16px 18px 14px;
}

.font-display { font-family: 'Cinzel', serif; }

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lux-border {
    position: relative;
    isolation: isolate;
}

.lux-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle), #d4af37, #881337, #4a0404, #f59e0b, #d4af37);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spin-angle 8s linear infinite;
    opacity: 0.55;
    pointer-events: none;
    z-index: -1;
}

.lux-border.active::before,
.lux-border:focus-within::before,
button.lux-border:hover::before {
    opacity: 0.95;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.35));
}

@keyframes spin-angle {
    to { --angle: 360deg; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 18px rgba(212, 175, 55, 0.12); }
    50% { box-shadow: 0 0 28px rgba(212, 175, 55, 0.28); }
}

@keyframes shimmer-bar {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes strike {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ripple-out {
    from { transform: scale(0); opacity: 0.45; }
    to { transform: scale(2.4); opacity: 0; }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    margin-bottom: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #7f1d1d, #4a0404);
    color: var(--gold);
    box-shadow: 0 0 20px rgba(136, 19, 55, 0.45);
    font-size: 20px;
}

.brand h1 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #fff;
}

.brand h1 .cube {
    font-size: 0.62em;
    letter-spacing: 0;
    font-weight: 700;
    vertical-align: super;
    line-height: 0;
    color: var(--gold);
}

.brand p {
    margin: 2px 0 0;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.date-hero {
    text-align: center;
}

.date-hero .dow {
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
}

.date-hero .full {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff8e7;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-btn,
.ghost-btn,
.gold-btn {
    border: 1px solid var(--line);
    background: rgba(12, 10, 9, 0.45);
    color: var(--ink);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
    position: relative;
    overflow: hidden;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: var(--gold);
    text-decoration: none;
}

.ghost-btn,
.gold-btn {
    padding: 8px 12px;
    font-size: 12px;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.gold-btn {
    background: linear-gradient(180deg, #d4af37, #aa8c2c);
    color: #1a1008;
    border-color: #f3d77a;
    font-weight: 600;
}

.icon-btn:hover,
.ghost-btn:hover {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.gold-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.icon-btn.active {
    background: rgba(136, 19, 55, 0.35);
    box-shadow: 0 0 16px rgba(136, 19, 55, 0.35);
}

.ripple {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.45);
    pointer-events: none;
    animation: ripple-out 560ms ease-out forwards;
}

.ribbon-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ribbon-nav {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
}

.calendar-btn {
    position: relative;
    margin: 0;
}

.calendar-btn i {
    pointer-events: none;
    font-size: 1.15rem;
}

.day-ribbon {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.day-chip {
    min-width: 0;
    border: 1px solid transparent;
    background: rgba(12, 10, 9, 0.35);
    color: var(--ink);
    border-radius: 14px;
    padding: 8px 4px 9px;
    cursor: pointer;
    text-align: center;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.day-chip .chip-dow {
    display: block;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.day-chip .chip-num {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    margin-top: 2px;
}

.day-chip:hover { transform: translateY(-2px); border-color: var(--line); }

.day-chip.today {
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45);
}

.day-chip.selected {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.85), rgba(74, 4, 4, 0.92));
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: var(--shadow-gold);
}

.day-chip.selected .chip-dow { color: var(--gold); }

.hidden-date {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    border: 0;
    cursor: pointer;
    font-size: 16px;
}

.dashboard {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 14px;
}

.pane {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px;
    animation: rise-in 420ms ease both;
}

.pane-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pane-head h2 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pane-head .sub {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.progress-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-dial {
    width: 54px;
    height: 54px;
    transform: rotate(-90deg);
    display: block;
    overflow: visible;
}

.progress-dial circle {
    fill: none;
    stroke-width: 3.4;
}

.progress-dial .track { stroke: rgba(212, 175, 55, 0.12); }
.progress-dial .fill {
    stroke: url(#ringGold);
    stroke-linecap: round;
    stroke-dasharray: 0 100;
    transition: stroke-dasharray 700ms ease;
}

.progress-meta strong {
    display: block;
    font-size: 18px;
    color: var(--gold);
}

.progress-meta span {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.1);
    overflow: hidden;
    margin: 2px 0 14px;
}

.bar > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #7f1d1d, #d4af37, #fbbf24, #7f1d1d);
    background-size: 200% 100%;
    animation: shimmer-bar 3.2s linear infinite;
    transition: width 700ms ease;
}

.composer {
    display: grid;
    grid-template-columns: 1fr 140px 118px auto;
    gap: 8px;
    margin-bottom: 14px;
}

.field,
.select,
.note-area,
.rename-input {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(12, 10, 9, 0.55);
    color: var(--ink);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

.field:focus,
.select:focus,
.note-area:focus,
.rename-input:focus {
    border-color: rgba(212, 175, 55, 0.65);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.select { appearance: none; }

.task-scroll,
.note-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.cat-block { margin-bottom: 12px; }

.cat-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 6px 4px;
}

.swatch {
    width: 10px;
    height: 18px;
    border-radius: 999px;
    box-shadow: 0 0 10px currentColor;
}

.cat-head .name {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
}

.cat-head .count {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
}

.cat-body {
    display: grid;
    gap: 8px;
    min-height: 8px;
}

.cat-block.collapsed .cat-body { display: none; }
.cat-block.collapsed .chev { transform: rotate(-90deg); }
.chev { transition: transform 180ms ease; color: var(--muted); }

.task {
    display: grid;
    grid-template-columns: 18px 22px 1fr minmax(110px, 150px) auto auto;
    align-items: start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(12, 10, 9, 0.42);
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
    animation: rise-in 280ms ease both;
}

.task:hover {
    border-color: rgba(212, 175, 55, 0.32);
    box-shadow: var(--shadow-gold);
}

.task.dragging {
    opacity: 0.45;
    transform: scale(0.98);
}

.task.drag-over {
    outline: 1px dashed var(--gold);
}

.drag-handle {
    color: #6b5b4a;
    cursor: grab;
    padding-top: 3px;
}

.check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: transparent;
    color: #1a1008;
    display: grid;
    place-items: center;
    cursor: pointer;
    margin-top: 2px;
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.check i { font-size: 12px; opacity: 0; }
.task.done .check {
    background: linear-gradient(180deg, #d4af37, #aa8c2c);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}
.task.done .check i { opacity: 1; }

.task-title {
    position: relative;
    font-size: 14.5px;
    line-height: 1.35;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    width: 100%;
    outline: none;
}

.task.done .task-title {
    color: #8d8070;
}

.task.done .task-title::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    animation: strike 320ms ease forwards;
}

.task-notes {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    width: 100%;
    border: 0;
    background: transparent;
    resize: vertical;
    min-height: 0;
    outline: none;
}

.task-cat {
    width: 100%;
    min-width: 0;
    padding: 4px 22px 4px 8px;
    font-size: 11px;
    border-radius: 999px;
    margin-top: 1px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--gold) 50%),
        linear-gradient(135deg, var(--gold) 50%, transparent 50%);
    background-position:
        calc(100% - 12px) calc(50% - 2px),
        calc(100% - 7px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.badge {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid transparent;
    cursor: pointer;
    margin-top: 1px;
}

.badge.low { color: #c9b48a; border-color: rgba(201, 180, 138, 0.3); }
.badge.medium { color: var(--gold); border-color: rgba(212, 175, 55, 0.4); background: rgba(212, 175, 55, 0.08); }
.badge.high { color: #ffd0d0; border-color: rgba(136, 19, 55, 0.55); background: rgba(136, 19, 55, 0.28); }

.task-tools {
    display: flex;
    gap: 2px;
}

.tiny {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #6d6256;
    border-radius: 8px;
    cursor: pointer;
}

.tiny:hover { color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.tiny.danger:hover { color: #f3b4b4; background: rgba(136, 19, 55, 0.2); }

.empty-slate {
    text-align: center;
    color: var(--muted);
    padding: 36px 12px;
    font-style: italic;
}

.save-pill {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.save-pill.saving { color: var(--gold-bright); box-shadow: 0 0 12px rgba(245, 158, 11, 0.2); }
.save-pill.saved { color: #d4af37; }
.save-pill.error { color: #f3b4b4; border-color: rgba(136, 19, 55, 0.5); }

.notepad {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(74, 4, 4, 0.35), transparent 70px),
        rgba(10, 8, 8, 0.72);
    border: 1px solid rgba(212, 175, 55, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    position: relative;
}

.notepad::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 28px;
    background: repeating-linear-gradient(
        180deg,
        transparent 0 22px,
        rgba(136, 19, 55, 0.18) 22px 23px
    );
    border-right: 1px solid rgba(212, 175, 55, 0.12);
    pointer-events: none;
}

.note-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 10px 40px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.note-area {
    flex: 1;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 18px 22px 28px 44px;
    resize: none;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 16px;
    line-height: 1.7;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 26px,
        rgba(212, 175, 55, 0.06) 27px
    );
    background-attachment: local;
}

.note-preview {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 18px 22px 28px 44px;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 16px;
    line-height: 1.7;
    white-space: normal;
}

.note-preview[hidden] { display: none !important; }
.note-area[hidden] { display: none !important; }

.note-preview h1,
.note-preview h2,
.note-preview h3,
.note-preview h4 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    margin: 0.7em 0 0.35em;
}

.note-preview p { margin: 0 0 0.7em; }
.note-preview ul,
.note-preview ol {
    margin: 0.4em 0 0.8em 1.3em;
    padding: 0;
}
.note-preview li { margin: 0.2em 0; }
.note-preview hr {
    border: 0;
    border-top: 1px solid rgba(212, 175, 55, 0.22);
    margin: 14px 0;
}
.note-preview blockquote {
    margin: 0.6em 0;
    padding: 0.2em 0 0.2em 14px;
    border-left: 3px solid rgba(212, 175, 55, 0.45);
    color: var(--muted);
}
.note-preview a { color: var(--gold); }
.note-preview code {
    background: rgba(212, 175, 55, 0.1);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.9em;
}
.note-preview pre {
    margin: 10px 0;
    padding: 12px;
    overflow: auto;
    border-radius: 12px;
    background: rgba(8, 6, 6, 0.65);
    border: 1px solid rgba(212, 175, 55, 0.12);
}
.note-preview pre code {
    background: none;
    padding: 0;
}
.note-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 10px 0 14px;
}
.note-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: rgba(8, 6, 6, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.18);
}
.note-table th,
.note-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    text-align: left;
}
.note-table thead th {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.search-shell { position: relative; }

.search-input {
    width: min(260px, 32vw);
    padding-left: 34px;
}

.search-shell i.bi-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 13px;
}

.search-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(420px, 80vw);
    max-height: 420px;
    overflow: auto;
    padding: 8px;
    z-index: 30;
}

.search-hit {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
}

.search-hit:hover { background: rgba(212, 175, 55, 0.08); }
.search-hit strong { display: block; font-size: 13px; }
.search-hit em {
    display: block;
    margin-top: 3px;
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 6, 6, 0.62);
    backdrop-filter: blur(8px);
    padding: 20px;
}

.modal-backdrop.open { display: flex; }

.modal-card {
    width: min(520px, 100%);
    padding: 20px;
    animation: rise-in 240ms ease;
}

.modal-card h3 {
    margin: 0 0 6px;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.08em;
}

.modal-card .hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.calendar-card {
    width: min(380px, calc(100vw - 32px));
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#calendar-modal .cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    min-width: 0;
    width: 100%;
}

#calendar-modal .cal-head .icon-btn {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
}

#calendar-modal .cal-head h3 {
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    font-size: 16px;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#calendar-modal .cal-dows,
#calendar-modal .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

#calendar-modal .cal-dows span {
    display: block;
    min-width: 0;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 4px;
}

#calendar-modal .cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid transparent;
    background: rgba(12, 10, 9, 0.35);
    color: var(--ink);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.cal-day:hover {
    border-color: var(--line);
    box-shadow: var(--shadow-gold);
}

.cal-day.muted { color: #6f675c; background: transparent; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45); }
.cal-day.selected {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.85), rgba(74, 4, 4, 0.92));
    border-color: rgba(212, 175, 55, 0.45);
    color: #fff8e7;
}

.cat-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.color-dot {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.color-dot input {
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.roll-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
    font-size: 14px;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    display: grid;
    gap: 8px;
}

.toast {
    min-width: 220px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(24, 18, 20, 0.92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-gold);
    animation: toast-in 220ms ease;
    font-size: 13px;
}

.kbd {
    font-size: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 5px;
    color: var(--muted);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.35), rgba(127, 29, 29, 0.5));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.is-locked { overflow: auto; }

.login-gate {
    position: relative;
    z-index: 2;
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.login-card {
    width: min(420px, 100%);
    padding: 28px 26px 22px;
    animation: rise-in 420ms ease both;
}

.login-brand { margin-bottom: 18px; }

.login-lead {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.login-label {
    display: block;
    margin: 12px 0 6px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 18px;
    padding: 12px 14px;
    font-size: 13px;
}

.login-foot {
    margin: 14px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

.login-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(136, 19, 55, 0.55);
    background: rgba(136, 19, 55, 0.22);
    color: #ffd0d0;
    font-size: 13px;
}

@media (max-width: 980px) {
    body.app-shell { overflow: auto; }
    .app-frame { height: auto; min-height: 100%; }
    .top-bar { grid-template-columns: 1fr; justify-items: start; }
    .toolbar { justify-content: flex-start; }
    .dashboard { grid-template-columns: 1fr; }
    .pane { min-height: 520px; }
    .composer { grid-template-columns: 1fr 1fr; }
    .search-input { width: min(220px, 70vw); }
    .ribbon-wrap {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) 40px 40px;
        gap: 6px;
        padding: 8px;
        align-items: center;
        overflow: hidden;
    }
    .ribbon-nav {
        flex: none;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
    }
    .ribbon-nav i { font-size: 1.35rem; }
    .day-ribbon { gap: 4px; min-width: 0; }
    .day-chip { padding: 8px 2px 9px; border-radius: 12px; }
    .day-chip .chip-num { font-size: 14px; }
    .modal-backdrop { padding: 12px; align-items: flex-end; }
    .modal-card,
    .calendar-card { width: 100%; max-width: 100%; }
    #calendar-modal .cal-day { min-height: 42px; font-size: 13px; }
}
