:root {
    color-scheme: light;
    --surface: #e8edf3;
    --shell: #e1e7ef;
    --panel: #edf1f6;
    --ink: #283248;
    --muted: #57657a;
    --light: #fcfdff;
    --shadow: #c1cbd9;
    --edge: #d4dce8;
    --accent: #3858b4;
    --gradient: linear-gradient(135deg, #49d1ec 0%, #5399ee 51%, #7558e9 100%);
    --raised: 8px 10px 20px var(--shadow), -7px -8px 17px var(--light);
    --low: 4px 5px 10px var(--shadow), -4px -5px 10px var(--light);
    --inset: inset 4px 4px 10px var(--shadow), inset -4px -4px 10px var(--light);
    --danger: #a52e46;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --surface: #263148;
    --shell: #222c40;
    --panel: #2a354d;
    --ink: #edf3ff;
    --muted: #c0cce1;
    --light: #35415c;
    --shadow: #172033;
    --edge: #414d64;
    --accent: #a6c9ff;
    --danger: #ffadbb;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        color-scheme: dark;
        --surface: #263148;
        --shell: #222c40;
        --panel: #2a354d;
        --ink: #edf3ff;
        --muted: #c0cce1;
        --light: #35415c;
        --shadow: #172033;
        --edge: #414d64;
        --accent: #a6c9ff;
        --danger: #ffadbb;
    }
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    min-width: 300px;
    background: var(--surface);
    color: var(--ink);
    font: 400 .875rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1, h2, h3, p { margin: 0 0 .5em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.024em; }
h1 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h2 { font-size: 1.13rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.hub-skip { position: fixed; left: 1rem; top: -5rem; z-index: 10; padding: .7rem; background: var(--panel); }
.hub-skip:focus { top: 1rem; }
.hub-visually-hidden, .hub-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.hub-shell {
    display: grid;
    grid-template-columns: 62px auto minmax(0, 1fr) clamp(178px, 21.8%, 260px);
    align-items: stretch;
    max-width: 1490px;
    min-height: calc(100vh - 68px);
    margin: 34px auto;
    width: calc(100% - clamp(32px, 8vw, 132px));
    border-radius: 34px;
    background: var(--shell);
    box-shadow: 19px 27px 56px var(--shadow), -14px -16px 35px var(--light);
}
.hub-rail, .hub-profile, .hub-sidebar { background: var(--panel); }
.hub-rail {
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 25px;
    border-radius: 33px;
    box-shadow: 5px 8px 16px var(--shadow), inset 1px 1px 3px var(--light);
}
.hub-brand {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gradient);
    box-shadow: var(--low);
}
.hub-brand img { width: 42px; height: 42px; object-fit: contain; }
.hub-rail-links, .hub-rail-footer { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.hub-rail-footer { margin-top: auto; }
.hub-rail-link {
    display: grid;
    place-items: center;
    width: 100%;
    height: 47px;
    border-radius: 11px;
}
.hub-rail-footer .hub-rail-link {
    margin: auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-shadow: var(--low);
}
.hub-rail-link:hover, .hub-rail-link[aria-current="page"] { box-shadow: var(--inset); }
.hub-icon { display: inline-block; vertical-align: middle; flex: none; opacity: .76; }
.hub-rail-link[aria-current="page"] .hub-icon { filter: invert(36%) sepia(75%) saturate(1755%) hue-rotate(190deg); opacity: 1; }
html[data-theme="dark"] .hub-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .hub-icon { filter: invert(1); } }

.hub-sidebar {
    width: clamp(140px, 17vw, 213px);
    padding: 19px 7px 22px 16px;
    border-radius: 0 33px 33px 0;
    box-shadow: 7px 8px 18px var(--shadow);
}
.hub-sidebar:empty { display: none; }
.hub-shell:has(.hub-sidebar:empty) .hub-main { grid-column: 2 / 4; }
.hub-sidebar-search { margin: 0 4px 30px 0; }
.hub-sidebar-search input { width: 100%; min-width: 0; padding: 7px 11px; border-radius: 20px; font-size: .78rem; }
.hub-section-title { font-size: 1rem; margin: 0 0 19px; }
.hub-sidebar-label { display: block; color: var(--muted); font-size: .79rem; margin: 18px 0 10px; }
.hub-sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: .8rem;
    text-decoration: none;
}
.hub-sidebar-link:hover, .hub-sidebar-link[aria-current="page"] { box-shadow: var(--inset); color: var(--accent); }
.hub-sidebar-link .hub-icon { width: 16px; height: 16px; }

.hub-main { padding: 49px clamp(15px, 2.5vw, 34px) 36px; min-width: 0; }
.hub-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 130px;
    margin-bottom: 20px;
    padding: 24px clamp(18px, 2.5vw, 36px);
    background: var(--panel);
    border-radius: 19px;
    box-shadow: var(--raised);
}
.hub-banner p { color: var(--muted); margin: .4rem 0 0; }
.hub-banner-art { width: clamp(85px, 13vw, 165px); height: 115px; object-fit: contain; margin: -28px -4px; flex: none; }
.hub-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hub-card, .hub-empty {
    padding: 16px;
    min-width: 0;
    background: var(--panel);
    border-radius: 16px;
    box-shadow: var(--low);
    overflow-wrap: anywhere;
}
.hub-card-grid .hub-empty { grid-column: 1 / -1; }
.hub-card h2, .hub-card h3 { margin-bottom: 8px; }
.hub-card-header, .hub-split { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hub-card-header h2, .hub-card-header h3 { font-size: .94rem; }
.hub-meta { color: var(--muted); font-size: .82rem; }
.hub-pill {
    display: inline-block;
    margin-top: .3rem;
    padding: .17rem .68rem;
    border-radius: 20px;
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    color: var(--accent);
    font-size: .74rem;
    font-weight: 650;
}
.hub-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.hub-actions form { margin: 0; }
.hub-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    min-height: 36px;
    border-radius: 22px;
    border: 0;
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--low);
    text-decoration: none;
    font-size: .83rem;
    font-weight: 640;
}
.hub-button:hover, .hub-button:active { box-shadow: var(--inset); }
.hub-button-primary { background: #344bb0; color: #fff; }
.hub-button-primary:hover, .hub-button-primary:active { background: #293b88; box-shadow: var(--low); }
.hub-button-quiet { background: transparent; box-shadow: none; }
.hub-button-danger { color: var(--danger); }
.hub-context { position: relative; }
.hub-context > summary { cursor: pointer; color: var(--accent); }

.hub-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px clamp(13px, 2.3vw, 30px) 18px;
    min-width: 0;
    text-align: center;
    border-radius: 31px;
    box-shadow: inset 1px 1px 3px var(--light), -4px -4px 12px color-mix(in srgb, var(--light) 60%, transparent);
}
.hub-avatar {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    flex: none;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--panel);
    box-shadow: var(--raised);
    overflow: hidden;
}
.hub-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hub-avatar-small { width: 34px; height: 34px; margin: 0; }
.hub-greeting { font-size: .95rem; font-weight: 650; overflow-wrap: anywhere; }
.hub-profile-stats { width: 100%; margin-top: 21px; padding-top: 23px; border-top: 1px solid var(--edge); }
.hub-metric {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 143px);
    aspect-ratio: 1;
    margin: 25px auto 30px;
    border-radius: 50%;
    background: var(--panel);
    box-shadow: var(--raised);
    isolation: isolate;
}
.hub-metric::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: conic-gradient(#546ff0 0, #43c5e9 var(--value), var(--edge) 0);
    box-shadow: inset 2px 3px 5px var(--shadow);
    z-index: -1;
}
.hub-metric-center {
    width: calc(100% - 25px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    align-content: center;
    background: var(--panel);
    box-shadow: var(--inset);
}
.hub-metric-center strong { font-size: clamp(1.35rem, 2.45vw, 2.1rem); line-height: 1.1; }
.hub-metric-center span { color: var(--muted); font-size: .7rem; }
.hub-profile-logout { margin-top: auto; padding-top: 12px; }
.hub-profile-logout .hub-icon { width: 16px; height: 16px; }

.hub-form { display: grid; gap: 13px; }
.hub-form > div, .hub-form-field { display: grid; gap: 4px; }
.hub-form label { font-weight: 650; }
.hub-form .helptext { color: var(--muted); font-size: .79rem; }
.hub-form .helptext ul { padding-inline-start: 1.35rem; }
.hub-form input:not([type=checkbox], [type=hidden]), .hub-form select, .hub-form textarea, .hub-sidebar-search input {
    min-width: 0;
    max-width: 100%;
    border: 1px solid transparent;
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--inset);
}
.hub-form input:not([type=checkbox], [type=hidden]), .hub-form select, .hub-form textarea { width: 100%; padding: 9px 12px; }
.hub-form input[type=checkbox] { accent-color: var(--accent); }
.hub-form textarea { resize: vertical; }
.hub-form > .hub-button { justify-self: start; }
.errorlist { margin: 3px 0; padding-inline-start: 1.3rem; color: var(--danger); }
.hub-messages { padding: 0; margin: 0 0 14px; list-style: none; }
.hub-messages li { padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 8px; background: var(--panel); }
.hub-settings-card { max-width: 480px; padding: 22px; }

.hub-auth { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.hub-auth-card {
    display: grid;
    grid-template-columns: minmax(200px, .95fr) minmax(0, 1fr);
    width: min(100%, 810px);
    min-height: 423px;
    border-radius: 35px;
    box-shadow: var(--raised);
    background: var(--panel);
}
.hub-auth-art {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    border-radius: 35px;
    background: radial-gradient(at 64% 46%, color-mix(in srgb, #519aef 17%, var(--shell)), transparent 71%), var(--shell);
    box-shadow: var(--inset);
    padding: 49px 15px 0;
}
.hub-auth-brand {
    display: inline-flex;
    position: absolute;
    align-items: center;
    gap: 5px;
    top: 19px;
    left: 21px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}
.hub-auth-mark { max-width: 95%; width: 310px; height: auto; }
.hub-auth-content { align-self: center; padding: clamp(24px, 5vw, 55px); }
.hub-auth-form { margin-top: 20px; }
.hub-auth-form .hub-button { margin-top: 6px; }
.hub-auth-logout { margin-top: 12px; }

@media (max-width: 1120px) {
    .hub-shell { grid-template-columns: 54px auto minmax(0, 1fr) clamp(155px, 19%, 204px); }
    .hub-main { padding-inline: 18px; }
}
@media (max-width: 885px) {
    .hub-shell { grid-template-columns: 51px auto minmax(0, 1fr); }
    .hub-profile { grid-column: 2 / -1; margin: 0 15px 15px; padding: 12px 16px; flex-flow: row wrap; text-align: left; gap: 10px; }
    .hub-profile .hub-avatar { width: 42px; height: 42px; margin: 0; }
    .hub-profile .hub-greeting, .hub-profile .hub-meta { margin: 0; }
    .hub-profile-stats { display: none; }
    .hub-profile-logout { margin: 0 0 0 auto; padding: 0; }
    .hub-rail { grid-row: 1 / 3; }
}
@media (max-width: 620px) {
    .hub-shell { display: flex; flex-direction: column; width: calc(100% - 20px); margin: 10px auto; min-height: calc(100vh - 20px); border-radius: 22px; }
    .hub-rail { position: sticky; top: 0; flex-direction: row; gap: 5px; justify-content: space-between; padding: 5px 6px; border-radius: 18px; }
    .hub-brand, .hub-brand img { width: 35px; height: 35px; }
    .hub-rail-links { flex: 1; flex-direction: row; width: auto; gap: 2px; }
    .hub-rail-link { min-width: 31px; height: 37px; }
    .hub-rail-link .hub-icon { width: 17px; height: 17px; }
    .hub-rail-footer { width: auto; margin: 0; }
    .hub-rail-footer .hub-rail-link { width: 33px; height: 33px; }
    .hub-sidebar { width: auto; border-radius: 18px; margin: 12px 10px 0; padding: 10px; }
    .hub-sidebar-search { margin: 0 0 8px; }
    .hub-sidebar-label, .hub-section-title { margin: 8px 0 3px; }
    .hub-sidebar-link { width: auto; display: inline-flex; }
    .hub-main { padding: 18px 11px; }
    .hub-card-grid { grid-template-columns: 1fr; }
    .hub-banner { padding: 15px; min-height: 96px; }
    .hub-banner-art { width: 85px; height: 80px; }
    .hub-auth { padding: 16px; }
    .hub-auth-card { grid-template-columns: 1fr; }
    .hub-auth-art { min-height: 130px; }
    .hub-auth-mark { width: 120px; margin: -25px 0 0 auto; }
}

.hub-sidebar-search { position: relative; }
.hub-sidebar-search input { padding-inline-end: 34px; }
.hub-sidebar-search button {
    position: absolute;
    inset: 1px 3px 1px auto;
    width: 29px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 20px;
}
.hub-sidebar-link[aria-current="true"], .hub-button[aria-current="true"] { box-shadow: var(--inset); color: var(--accent); }
.hub-banner-art img { width: 100%; height: 100%; object-fit: contain; }
.hub-banner .hub-button { margin-top: 8px; }
.hub-task-heading { margin: 4px 0 12px; align-items: center; }
.hub-task-heading h2, .hub-task-heading .hub-actions { margin: 0; }
.hub-task-tags { margin-top: 6px; gap: 5px; }
.hub-task-description { font-size: .84rem; }
.hub-pill[data-priority="important"] { color: var(--accent); font-weight: 750; }
.hub-pill[data-priority="flexible"] { color: var(--muted); }
.hub-task-move { display: grid; gap: 3px; }

.hub-drag-handle { cursor: grab; color: var(--muted); font-size: 1.25rem; padding: 2px 4px; }
.hub-task-card[data-dragging] { opacity: .62; box-shadow: var(--inset); }
.hub-task-card[data-drag-hover] { outline: 2px solid var(--accent); box-shadow: var(--inset); }
.hub-card-progress { display: block; margin-top: 9px; color: var(--muted); font-size: .78rem; }
.hub-card-progress progress { display: block; width: 100%; height: 6px; margin-top: 4px; accent-color: var(--accent); }
.hub-context > summary {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: -3px -4px 0 0;
    border-radius: 8px;
    list-style: none;
    cursor: pointer;
}
.hub-context > summary::-webkit-details-marker { display: none; }
.hub-context[open] { z-index: 3; }
.hub-context[open] > summary, .hub-context > summary:hover { box-shadow: var(--inset); }
.hub-context-items {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 2;
    display: grid;
    gap: 3px;
    width: max-content;
    max-width: min(220px, 72vw);
    padding: 6px;
    border: 1px solid var(--edge);
    border-radius: 13px;
    background: var(--panel);
    box-shadow: var(--raised);
}
.hub-context-items .hub-button { width: 100%; justify-content: flex-start; box-shadow: none; font-size: .76rem; }
.hub-context-items .hub-button:hover { box-shadow: var(--inset); }
.hub-pagination { justify-content: center; margin-block: 17px 0; }

.hub-calendar { background: var(--panel); border-radius: 16px; padding: 14px; box-shadow: var(--low); }
.hub-calendar > nav { align-items: center; margin-bottom: 11px; }
.hub-calendar > nav h2, .hub-calendar > nav .hub-actions { margin: 0; }
.hub-calendar-weekdays, .hub-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hub-calendar-weekdays { color: var(--muted); text-align: center; font-size: .72rem; margin-bottom: 5px; }
.hub-calendar-day {
    min-width: 0;
    min-height: 72px;
    border: 1px solid var(--edge);
    border-radius: 9px;
    background: var(--surface);
    padding: 4px;
}
.hub-calendar-day .hub-split { gap: 1px; }
.hub-calendar-day > .hub-split > a { color: var(--ink); text-decoration: none; padding: 0 3px; border-radius: 5px; }
.hub-calendar-day .hub-context > summary { width: 19px; height: 22px; margin: -1px 0 0; }
.hub-calendar-day .hub-context .hub-icon { width: 15px; height: 15px; }
.hub-day-selected { border-color: var(--accent); box-shadow: var(--inset); }
.hub-day-today { color: var(--accent); font-weight: 800; }
.hub-outside-month > .hub-split > a { color: var(--muted); }
.hub-calendar-items { display: grid; gap: 3px; }
.hub-calendar-items .hub-calendar-item { border-radius: 5px; padding: 1px 3px; background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.hub-calendar-items .hub-calendar-item[data-kind="event"] { background: color-mix(in srgb, #5bbde7 19%, var(--panel)); }
.hub-calendar-items .hub-calendar-item a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--ink); }
.hub-calendar-items .hub-calendar-item > div > a { font-size: .67rem; }
.hub-calendar-detail, .hub-calendar-events, #open-tasks { margin-top: 21px; }
.hub-calendar-detail > .hub-calendar-item + .hub-calendar-item { border-top: 1px solid var(--edge); padding-top: 10px; }
.hub-calendar-detail .hub-calendar-item h3, .hub-calendar-events .hub-calendar-item h3 { font-size: .93rem; }
.hub-progress-list { display: grid; gap: 12px; }
.hub-calendar-day:nth-child(7n+1) .hub-context-items, .hub-calendar-day:nth-child(7n+2) .hub-context-items { left: 0; right: auto; }

@media (max-width: 650px) {
    .hub-task-heading { flex-wrap: wrap; }
    .hub-calendar { padding: 7px; }
    .hub-calendar-weekdays, .hub-calendar-grid { gap: 2px; }
    .hub-calendar-day { padding: 3px 1px; min-height: 56px; }
    .hub-calendar-day .hub-context > summary { width: 15px; }
}

@media (min-width: 886px) and (max-width: 1120px) {
    .hub-shell { grid-template-columns: 54px auto minmax(0, 1fr) 22.7%; }
    .hub-profile { padding-inline: 22px; }
}
@media (min-width: 621px) {
    .hub-main { padding-top: 51px; }
    .hub-banner h1 { font-size: clamp(1.18rem, 2.08vw, 1.65rem); }
    .hub-banner { min-height: 123px; padding-block: 19px; }
    .hub-banner-art { width: clamp(102px, 12vw, 159px); height: 138px; margin-block: -35px; }
}
.hub-mode-exit { color: var(--accent); }
.hub-card-grid { column-gap: clamp(14px, 3vw, 35px); }
.hub-task-card { padding: 12px 13px; }
.hub-task-card .hub-card-header h3 { font-size: .83rem; font-weight: 650; line-height: 1.33; margin-bottom: 4px; }
.hub-task-card .hub-meta { font-size: .73rem; }
.hub-task-card > .hub-actions { gap: 6px; margin-top: 5px; }
.hub-task-card > .hub-actions .hub-button { min-height: 26px; padding: 3px 7px; font-size: .72rem; }
.hub-task-card > .hub-actions .hub-icon { width: 14px; height: 14px; }
.hub-task-card .hub-card-progress { margin-top: 5px; font-size: .7rem; }
.hub-profile-stats h2 { font-size: .97rem; }
.hub-profile-stats { margin-top: 21px; }
.hub-sidebar-search input { padding-inline-end: 29px; }
.hub-banner-art img { transform: scale(1.12); }

@media (max-width: 360px) {
    .hub-rail-link { min-width: 27px; }
    .hub-rail-footer .hub-rail-link { width: 29px; }
}

.hub-task-card .hub-context > summary { width: 22px; height: 21px; }
.hub-context > summary .hub-icon, .hub-task-card .hub-pill .hub-icon, .hub-drag-handle .hub-icon { width: 14px; height: 14px; }
.hub-task-card .hub-pill .hub-icon { vertical-align: -2px; }
.hub-task-card .hub-meta { margin-bottom: 3px; line-height: 1.35; }
.hub-task-card .hub-task-tags { margin-top: 2px; }
.hub-task-card .hub-pill {
    margin-top: 0;
    padding: 2px 7px;
    font-size: .68rem;
    line-height: 1.3;
}
.hub-task-card .hub-card-progress { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hub-task-card .hub-card-progress progress { flex: 1; min-width: 30px; width: auto; margin: 0; }
.hub-card-tools { display: flex; align-items: flex-start; }
.hub-task-card .hub-drag-handle { padding-block: 0; line-height: 1.1; }
.hub-profile > .hub-meta { font-size: .75rem; }
@media (min-width: 621px) {
    .hub-banner-art img { transform: translateY(-11px) scale(1.42); }
}
