/* ==========================================================================
   Font
   ========================================================================== */
@font-face {
    font-family: "Gabarito";
    src: url("/fonts/gabarito-latin-wght-normal.woff2") format("woff2");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
    color-scheme: light dark;

    --color-pine: #123a30;
    --color-marigold: #ffc42e;
    --color-marigold-hover: #f5b400;
    --color-marigold-text: #14241e;

    --color-bg: #f1f4ef;
    --color-surface: #ffffff;
    --color-hover: rgba(18, 58, 48, 0.07);
    --color-text: #14241e;
    --color-text-muted: #55665e;
    --color-border: #dde3dc;
    --color-border-strong: #bfc9c1;
    --color-solid: #123a30;
    --color-solid-text: #ffffff;
    --color-danger: #c0362c;
    --color-danger-soft: #fbe9e7;
    --color-focus: #123a30;
    --status-open: #2a78d6;
    --status-in-progress: #eb6834;
    --status-done: #1baf7a;

    --sidebar-bg: #123a30;
    --sidebar-text: #eaf2ec;
    --sidebar-muted: #a3bcb0;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(255, 255, 255, 0.14);
    --sidebar-border: rgba(255, 255, 255, 0.14);

    --avatar-bg-l: 88%;
    --avatar-bg-s: 62%;
    --avatar-fg-l: 26%;
    --avatar-fg-s: 65%;

    --radius-ticket: 6px;
    --radius-panel: 10px;

    --font-sans: "Gabarito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --sidebar-width: 252px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f1613;
        --color-surface: #18211d;
        --color-hover: rgba(255, 255, 255, 0.07);
        --color-text: #e8efe9;
        --color-text-muted: #9dada5;
        --color-border: #2a3631;
        --color-border-strong: #41514a;
        --color-solid: #e8efe9;
        --color-solid-text: #0f1613;
        --color-danger: #f0695f;
        --color-danger-soft: #36191a;
        --color-focus: #ffc42e;
        --status-open: #3987e5;
        --status-in-progress: #d95926;
        --status-done: #199e70;

        --sidebar-bg: #0d2c24;

        --avatar-bg-l: 26%;
        --avatar-bg-s: 34%;
        --avatar-fg-l: 85%;
        --avatar-fg-s: 80%;
    }
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font: 400 15px/1.5 var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    line-height: 1.2;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.icon {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
}

/* ==========================================================================
   App shell
   ========================================================================== */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.main {
    padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.main__inner {
    max-width: 1280px;
    margin-inline: auto;
}

.narrow {
    max-width: 560px;
    margin-inline: auto;
}

/* Sidebar ----------------------------------------------------------------- */
.sidebar {
    --color-focus: var(--color-marigold);
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100vh;
    padding: 1.125rem 0.75rem 0.75rem;
    overflow-y: auto;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.125rem 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}

/* The logo is the "done" state of the status circle */
.brand__mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background: var(--color-marigold);
    color: var(--color-pine);
}

.brand__mark .icon {
    width: 1rem;
    height: 1rem;
    stroke-width: 3.5;
}

.sidebar__nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
}

.sidebar__label {
    margin: 1.125rem 0 0.25rem;
    padding-inline: 0.625rem;
    color: var(--sidebar-muted);
    font-size: 0.8125rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 2.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-ticket);
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--sidebar-hover);
}

.nav-item.is-active {
    background: var(--sidebar-active);
    box-shadow: inset 3px 0 0 var(--color-marigold);
    font-weight: 600;
}

.nav-item--muted {
    color: var(--sidebar-muted);
}

.nav-item__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.25rem 0 0.5rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar__user-text {
    flex: 1;
    min-width: 0;
}

.sidebar__user-name,
.sidebar__user-email {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__user-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.sidebar__user-email {
    color: var(--sidebar-muted);
    font-size: 0.75rem;
}

.sidebar .icon-btn {
    color: var(--sidebar-muted);
}

.sidebar .icon-btn:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Avatars and group tiles ------------------------------------------------- */
.hue-0 { --hue: 165; }
.hue-1 { --hue: 205; }
.hue-2 { --hue: 340; }
.hue-3 { --hue: 42; }
.hue-4 { --hue: 265; }
.hue-5 { --hue: 15; }

.avatar,
.group-tile {
    display: inline-grid;
    place-items: center;
    flex: none;
    background: hsl(var(--hue, 150) var(--avatar-bg-s) var(--avatar-bg-l));
    color: hsl(var(--hue, 150) var(--avatar-fg-s) var(--avatar-fg-l));
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 0.75rem;
}

.avatar--more {
    background: var(--color-border);
    color: var(--color-text-muted);
}

.group-tile {
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 5px;
    font-size: 0.8125rem;
}

.group-tile--lg {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    font-size: 1.0625rem;
}

.avatar-stack {
    display: inline-flex;
}

.avatar-stack .avatar {
    box-shadow: 0 0 0 2px var(--avatar-ring, var(--color-surface));
}

.avatar-stack .avatar + .avatar {
    margin-left: -3px;
}

.page-head {
    --avatar-ring: var(--color-bg);
}

/* Buttons ----------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.375rem;
    padding: 0.45rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.btn--primary {
    background: var(--color-marigold);
    color: var(--color-marigold-text);
}

.btn--primary:hover {
    background: var(--color-marigold-hover);
}

.btn--outline {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.btn--outline:hover {
    background: var(--color-hover);
}

.btn--danger {
    background: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn--danger:hover {
    background: var(--color-danger-soft);
}

.btn--ghost-danger {
    background: transparent;
    color: var(--color-text-muted);
}

.btn--ghost-danger:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.btn--sm {
    min-height: 1.875rem;
    padding: 0.25rem 0.7rem;
    font-size: 0.875rem;
}

.btn--lg {
    min-height: 3rem;
    font-size: 1.0625rem;
}

.btn--block {
    width: 100%;
}

.btn__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

.icon-btn--bordered {
    border-color: var(--color-border-strong);
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;
}

/* Panels, pills, chips ---------------------------------------------------- */
.card {
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-panel);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: none;
    padding: 0.125rem 0.55rem;
    border-radius: 999px;
    background: var(--color-hover);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.pill--accent {
    background: var(--color-solid);
    color: var(--color-solid-text);
}

.pill--status {
    padding: 0.3rem 0.7rem 0.3rem 0.4rem;
    font-size: 0.875rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.chip .icon {
    width: 0.875rem;
    height: 0.875rem;
}

.chip--danger {
    color: var(--color-danger);
    font-weight: 600;
}

.section-title {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.section-text {
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

/* Flash messages ---------------------------------------------------------- */
.flash {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-ticket);
    background: var(--color-solid);
    color: var(--color-solid-text);
    font-size: 0.9375rem;
    font-weight: 500;
}

.flash--error {
    background: var(--color-danger);
}

/* Page header ------------------------------------------------------------- */
.page-head {
    margin-bottom: 1.5rem;
}

.page-head--simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-head__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.page-head__title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    text-decoration: none;
}

.back-link:hover {
    color: var(--color-text);
}

.back-link .icon {
    width: 1rem;
    height: 1rem;
}

/* Tabs -------------------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid var(--color-border-strong);
    overflow-x: auto;
}

.tabs__link {
    margin-bottom: -1px;
    padding: 0.375rem 0 0.625rem;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tabs__link:hover,
.tabs__link.is-active {
    color: var(--color-text);
}

.tabs__link.is-active {
    border-bottom-color: var(--color-solid);
}

/* Empty states ------------------------------------------------------------ */
.empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    padding: 2rem 0;
    color: var(--color-text-muted);
}

.empty__title {
    color: var(--color-text);
    font-size: 1.5rem;
    font-weight: 700;
}

.empty .btn {
    margin-top: 0.875rem;
}

/* Forms ------------------------------------------------------------------- */
.form {
    display: grid;
    gap: 1rem;
}

.form > div:has(> div) {
    display: grid;
    gap: 1rem;
}

.form label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.form ul {
    margin-bottom: 0.3rem;
    color: var(--color-danger);
    font-size: 0.875rem;
}

.form input,
.form textarea,
.form select {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.7rem;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-ticket);
    font: inherit;
}

.form input,
.form select {
    height: 2.625rem;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: -1px;
    border-color: transparent;
}

.form div:has(> ul) > input,
.form div:has(> ul) > textarea,
.form div:has(> ul) > select {
    border-color: var(--color-danger);
}

.form textarea {
    min-height: 7rem;
    resize: vertical;
}

.form__grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.danger-zone .section-title {
    margin-bottom: 0.125rem;
    font-size: 1rem;
}

.danger-zone .section-text {
    margin-bottom: 0;
}

/* ==========================================================================
   Pages
   ========================================================================== */

/* Login ------------------------------------------------------------------- */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    min-height: 100vh;
}

.auth__hero {
    --color-focus: var(--color-marigold);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
}

.auth__hero .brand {
    align-self: flex-start;
    padding: 0;
}

.auth__flow {
    display: grid;
    gap: 0.15em;
    font-size: clamp(2.5rem, 6.5vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.auth__step {
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.auth__flow .status-check {
    --check-color: var(--color-marigold);
    width: 0.62em;
    height: 0.62em;
    padding: 0.05em;
    border-width: 0.07em;
    color: var(--color-pine);
}

.auth__flow .status-check--done {
    padding: 0;
}

.auth__flow .status-check .icon {
    width: 0.4em;
    height: 0.4em;
}

.auth__panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin-inline: auto;
    padding: 2rem 1.5rem;
}

.auth__title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth__text {
    margin: 0.5rem 0 1.75rem;
    color: var(--color-text-muted);
    font-size: 1.0625rem;
}

.auth__providers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth__footer {
    margin-top: 2rem;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* Overview ---------------------------------------------------------------- */
.group-rows {
    padding: 0;
    overflow: hidden;
}

.group-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) 8.5rem;
    align-items: center;
    gap: 1rem 1.25rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
}

.group-row:hover {
    background: var(--color-hover);
}

.group-rows li + li {
    border-top: 1px solid var(--color-border);
}

.group-row__name {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.group-row__role {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.group-row__progress {
    display: block;
    margin-top: 0.3rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.group-row .avatar-stack {
    justify-content: flex-end;
}

.flowbar {
    display: flex;
    gap: 2px;
    height: 8px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.flowbar__seg--open {
    background: var(--status-open);
}

.flowbar__seg--in_progress {
    background: var(--status-in-progress);
}

.flowbar__seg--done {
    background: var(--status-done);
}

/* Task board -------------------------------------------------------------- */
.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.125rem;
}

.toolbar__cta {
    margin-left: auto;
}

.segmented {
    display: inline-flex;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
}

.segmented__item {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.segmented__item:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

.segmented__item.is-active {
    background: var(--color-solid);
    color: var(--color-solid-text);
}

.person-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem;
}

.person-filter__item {
    display: inline-flex;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: 50%;
    text-decoration: none;
}

.person-filter__item:hover {
    border-color: var(--color-border-strong);
}

.person-filter__item.is-active {
    border-color: var(--color-solid);
}

/* Workflow rail: the column heads interlock into one forward-pointing track */
.board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.board--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 680px;
}

.column {
    --tip: 14px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.column--open {
    --lane: var(--status-open);
}

.column--in_progress {
    --lane: var(--status-in-progress);
}

.column--done {
    --lane: var(--status-done);
}

.column__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding-inline: calc(var(--tip) + 0.75rem);
    background: color-mix(in srgb, var(--lane) 32%, var(--color-surface));
    clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%, var(--tip) 50%);
    font-size: 1rem;
    font-weight: 700;
}

.column + .column .column__head {
    margin-left: calc(var(--tip) * -1 + 3px);
}

.column:first-child .column__head {
    padding-left: 0.875rem;
    clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%);
}

.column:last-child .column__head {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, var(--tip) 50%);
}

.column:only-child .column__head {
    padding-inline: 0.875rem;
    clip-path: none;
}

.column__count {
    margin-left: auto;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.column__body {
    flex: 1;
    min-height: 22rem;
    margin-top: 3px;
    padding: 0.5rem;
    background: color-mix(in srgb, var(--lane) 9%, var(--color-bg));
}

.column + .column .column__body {
    margin-left: 3px;
}

.column:first-child .column__body {
    border-bottom-left-radius: var(--radius-panel);
}

.column:last-child .column__body {
    border-bottom-right-radius: var(--radius-panel);
}

.column__empty {
    padding: 1.5rem 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    text-align: center;
}

.task-list {
    display: grid;
    gap: 0.5rem;
}

.task {
    position: relative;
    display: flex;
    gap: 0.625rem;
    padding: 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-ticket);
}

.task:hover {
    border-color: var(--color-text-muted);
}

.task__status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex: none;
    margin-top: 1px;
}

.task__body {
    flex: 1;
    min-width: 0;
}

.task__title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    overflow-wrap: anywhere;
}

/* The whole ticket opens the task; the status button sits above this layer */
.task__title::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-ticket);
}

.task__description {
    display: -webkit-box;
    margin-top: 0.125rem;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.task__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.625rem;
}

.task__moves {
    position: relative;
    z-index: 1;
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
}

.task__move {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}

.task__move:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

/* Touch screens have no hover, so the arrows stay visible there */
@media (hover: hover) {
    .task__moves {
        opacity: 0;
    }

    .task:hover .task__moves,
    .task:focus-within .task__moves {
        opacity: 1;
    }
}

.task.is-dragging {
    opacity: 0.4;
}

.column.is-drop-target .column__body {
    outline: 2px dashed var(--lane);
    outline-offset: -4px;
}

.task--done .task__title {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

/* Status circle: ring = open, half = in progress, filled = done */
.status-check {
    --check-color: var(--status-open);
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    padding: 2px;
    border: 2px solid var(--check-color);
    border-radius: 50%;
    background-color: transparent;
    background-clip: content-box;
    color: #fff;
    cursor: pointer;
}

/* Larger touch target than the visible circle */
button.status-check::before {
    content: "";
    position: absolute;
    inset: -12px;
}

button.status-check:hover {
    background-color: color-mix(in srgb, var(--check-color) 35%, transparent);
}

.status-check--in_progress {
    --check-color: var(--status-in-progress);
    background-image: conic-gradient(var(--check-color) 0 50%, transparent 0);
}

.status-check--done {
    --check-color: var(--status-done);
    padding: 0;
    background-color: var(--check-color);
    background-clip: border-box;
    cursor: default;
}

.status-check--done .icon {
    width: 0.75rem;
    height: 0.75rem;
    stroke-width: 3.5;
}

.status-check--static {
    width: 1rem;
    height: 1rem;
    cursor: default;
}

.status-check--static.status-check--done .icon {
    width: 0.625rem;
    height: 0.625rem;
}

/* Members ----------------------------------------------------------------- */
.members {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.members--with-invite {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.member-list {
    padding-block: 0.25rem;
}

.member {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.member:last-child {
    border-bottom: 0;
}

.member .avatar {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.875rem;
}

.member__text {
    flex: 1;
    min-width: 8rem;
}

.member__name {
    display: block;
    font-weight: 600;
}

.member__email {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

/* Statistics -------------------------------------------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
}

.stats__part {
    padding: 1.5rem;
}

.stats__part + .stats__part {
    border-left: 1px solid var(--color-border);
}

.pie-layout {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
    padding-block: 0.5rem;
}

.pie {
    display: block;
    flex: none;
    width: 180px;
    height: 180px;
}

.pie__slice--open {
    stroke: var(--status-open);
}

.pie__slice--in_progress {
    stroke: var(--status-in-progress);
}

.pie__slice--done {
    stroke: var(--status-done);
}

.pie__slice:hover {
    opacity: 0.85;
}

.legend {
    flex: 1;
    min-width: 190px;
}

.legend__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.3rem;
}

.legend__swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 2px;
    flex: none;
}

.legend__swatch--open {
    background: var(--status-open);
}

.legend__swatch--in_progress {
    background: var(--status-in-progress);
}

.legend__swatch--done {
    background: var(--status-done);
}

.legend__value {
    margin-left: auto;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.bars__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-block: 0.5rem;
}

.bars__content {
    flex: 1;
    min-width: 0;
}

.bars__label {
    display: block;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bars__track {
    display: block;
}

.bars__bar {
    display: block;
    height: 8px;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--color-solid);
}

.bars__value {
    min-width: 1.5rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
    .board {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }

    .board--single {
        max-width: none;
    }

    .column .column__head,
    .column:first-child .column__head,
    .column:last-child .column__head,
    .column + .column .column__head {
        margin-left: 0;
        padding-inline: 0.875rem;
        clip-path: none;
        border-radius: var(--radius-panel) var(--radius-panel) 0 0;
    }

    .column .column__body,
    .column + .column .column__body {
        min-height: 0;
        margin-left: 0;
        border-radius: 0 0 var(--radius-panel) var(--radius-panel);
    }

    .members--with-invite {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .stats__part + .stats__part {
        border-left: 0;
        border-top: 1px solid var(--color-border);
    }
}

@media (max-width: 820px) {
    .app {
        display: block;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
        height: auto;
        padding: 0.625rem 1rem;
    }

    .brand {
        padding-left: 0;
    }

    .sidebar__user {
        grid-column: 2;
        grid-row: 1;
        padding: 0;
        border-top: 0;
    }

    .sidebar__user-text {
        display: none;
    }

    .sidebar__nav {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row;
        gap: 0.25rem;
        margin-inline: -1rem;
        padding-inline: 1rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sidebar__label {
        display: none;
    }

    .nav-item {
        flex: none;
    }

    .nav-item.is-active {
        box-shadow: none;
    }

    .nav-item__text {
        max-width: 11rem;
    }

    .main {
        padding-top: 1.25rem;
    }

    .page-head__title {
        font-size: 1.75rem;
    }

    .auth {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .group-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .group-row__flow {
        grid-column: 1 / -1;
    }

    .group-row .avatar-stack {
        display: none;
    }
}

@media (max-width: 480px) {
    .toolbar__cta {
        width: 100%;
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
