/* =========================================================
   Search Pilot — dashboard interface
   ========================================================= */

:root {
    --font-display: "Bebas Neue", "Oswald", "Arial Narrow", Impact, sans-serif;
    --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --rail: 56px;
    --rail-gap: 40px;
    --control-h: 56px;
    --radius-card: 32px;
    --card-pad: 28px;
    --tri-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14'%3E%3Cpath d='M8 2.5 14 12H2Z' stroke='%23000' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E");
    --tri-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14'%3E%3Cpath d='M2 2h12L8 11.5Z' stroke='%23000' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E");
    --bs-body-font-family: var(--font-body);
}

:root,
html[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #000000;
    --surface: #1b1b1b;
    --surface-raised: #262626;
    --surface-hover: #303030;
    --line: rgba(255, 255, 255, 0.08);
    --grid: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --text-soft: #d4d4d4;
    --muted: #8f8f8f;
    --lime: #c2f25b;
    --lime-hover: #d1f77f;
    --lime-ink: #c2f25b;
    --orange: #ff9a22;
    --orange-hover: #ffad4d;
    --ink: #ffffff;
    --on-ink: #0b0b0b;
    --on-accent: #0b0b0b;
    --focus-ring: #c2f25b;
    --backdrop-opacity: 0.74;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

html[data-theme="light"] {
    color-scheme: light;
    --canvas: #e9e8e2;
    --surface: #ffffff;
    --surface-raised: #f1f0ea;
    --surface-hover: #e6e5de;
    --line: rgba(0, 0, 0, 0.08);
    --grid: rgba(0, 0, 0, 0.22);
    --text: #0b0b0b;
    --text-soft: #2b2b2b;
    --muted: #6a6963;
    --lime: #b9ee4a;
    --lime-hover: #aee23a;
    --lime-ink: #4a7a00;
    --orange: #ff9419;
    --orange-hover: #ff8500;
    --ink: #0b0b0b;
    --on-ink: #ffffff;
    --on-accent: #0b0b0b;
    --focus-ring: #0b0b0b;
    --backdrop-opacity: 0.4;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0b0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

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

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
}

button {
    color: inherit;
    font: inherit;
}

p {
    margin: 0;
}

.icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--lime);
    color: #0b0b0b;
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    color: #0b0b0b;
    transform: translateY(0);
}

/* ---------- Shell ---------- */

.app {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: min(100%, 1560px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 32px 40px;
}

/* ---------- Top bar ---------- */

.topbar {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    column-gap: var(--rail-gap);
    align-items: center;
}

.logo {
    display: grid;
    place-items: center;
    width: var(--rail);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--ink);
    color: var(--on-ink);
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.logo:hover {
    color: var(--on-ink);
    transform: rotate(-10deg);
}

.logo svg {
    width: 100%;
    height: 100%;
}

.logo rect {
    fill: currentColor;
}

.logo circle,
.logo path {
    fill: none;
    stroke: currentColor;
    stroke-width: 7;
    stroke-linecap: round;
}

.topbar__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    min-width: 0;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar__aside {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    min-width: 0;
}

/* ---------- Pills & circular buttons ---------- */

.nav-pill,
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: var(--control-h);
    padding: 0 26px 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-pill:hover,
.filter-pill:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-pill[aria-current="page"] .icon {
    color: var(--lime-ink);
}

.filter-pill {
    gap: 6px;
    padding: 0 20px 0 24px;
}

.filter-pill__key {
    color: var(--muted);
    font-weight: 600;
}

.filter-pill .icon {
    width: 18px;
    height: 18px;
    margin-left: 6px;
    color: var(--muted);
}

.icon-button {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: var(--control-h);
    height: var(--control-h);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

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

.nav-pill:active,
.filter-pill:active,
.icon-button:active {
    transform: scale(0.96);
}

.theme-icon {
    grid-area: 1 / 1;
    transition: opacity 0.2s ease, transform 0.35s ease;
}

html[data-theme="dark"] .theme-icon--moon,
html[data-theme="light"] .theme-icon--sun {
    opacity: 0;
    transform: rotate(-70deg) scale(0.5);
}

/* ---------- Brand block ---------- */

.brand-block {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 16px;
}

.brand-block__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}

.brand-block__copy strong {
    font-size: 16px;
    font-weight: 800;
}

.brand-block__copy span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.brand-block__avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--control-h);
    aspect-ratio: 1;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.brand-block__avatar img {
    width: 66%;
    height: 66%;
    object-fit: contain;
}

.brand-block__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border: 3px solid var(--canvas);
    border-radius: 50%;
    background: var(--lime);
}

body.is-running .brand-block__badge {
    background: var(--orange);
    animation: badge-pulse 1.6s ease-in-out infinite;
}

/* ---------- Carbon ad ---------- */

.carbonads-container {
    display: flex;
    flex: 0 1 330px;
    justify-content: flex-end;
    min-width: 0;
    max-width: 330px;
}

.carbonads-container #carbonads,
.carbonads-container #carbon-responsive {
    width: 100%;
    min-width: 0;
}

#carbonads,
#carbon-responsive .carbon-responsive-wrap {
    display: block;
    max-width: 100%;
    padding: 8px 18px 8px 8px !important;
    overflow: hidden;
    border: 0 !important;
    border-radius: 28px !important;
    background: var(--surface) !important;
    color: var(--muted) !important;
    font-family: inherit !important;
}

.carbon-wrap,
#carbon-responsive .carbon-responsive-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.carbon-img,
.carbon-img-large {
    width: auto !important;
    flex: 0 0 auto !important;
    line-height: 0;
}

.carbon-img img,
.carbon-img-large img {
    display: block;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
}

.carbon-text,
.carbon-description {
    padding: 0 !important;
    color: var(--text-soft) !important;
    font-size: 11px !important;
    font-weight: 600;
    line-height: 1.4 !important;
    text-align: left;
    text-decoration: none !important;
}

.carbon-poweredby {
    display: none !important;
}

/* ---------- Workspace ---------- */

.workspace {
    display: grid;
    grid-template-columns: var(--rail) minmax(max-content, 1fr) auto;
    grid-template-areas:
        ".    title filters"
        "rail board board";
    align-items: center;
    column-gap: var(--rail-gap);
    row-gap: 28px;
}

.page-title {
    grid-area: title;
    margin: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(48px, 4.4vw, 68px);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.filters {
    display: flex;
    grid-area: filters;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.rail {
    position: sticky;
    top: 28px;
    display: flex;
    grid-area: rail;
    flex-direction: column;
    align-self: start;
    gap: 16px;
}

.dashboard {
    display: grid;
    grid-area: board;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
    grid-template-areas:
        "progress timer   timeline"
        "session  session timeline";
    align-self: stretch;
    gap: 24px;
}

/* ---------- Cards ---------- */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--card-pad);
    overflow: hidden;
    border-radius: var(--radius-card);
    background: var(--surface);
    container-type: inline-size;
    transition: background-color 0.25s ease;
    animation: rise-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.card--progress {
    grid-area: progress;
}

.card--timer {
    grid-area: timer;
    animation-delay: 0.06s;
}

.card--session {
    grid-area: session;
    animation-delay: 0.12s;
}

.card--timeline {
    grid-area: timeline;
    animation-delay: 0.18s;
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
}

.card__title {
    margin: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.card__meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: auto;
    padding-top: 24px;
}

.card__total {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.card__total strong {
    color: var(--text);
    font-weight: 800;
}

/* ---------- Stat blocks ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat::before {
    width: 15px;
    height: 13px;
    margin-bottom: 14px;
    background: var(--lime);
    content: "";
}

.stat--up::before {
    -webkit-mask: var(--tri-up) center / contain no-repeat;
    mask: var(--tri-up) center / contain no-repeat;
}

.stat--down::before {
    background: var(--orange);
    -webkit-mask: var(--tri-down) center / contain no-repeat;
    mask: var(--tri-down) center / contain no-repeat;
}

.stat--lime::before,
.stat--orange::before {
    width: 13px;
    border-radius: 50%;
}

.stat--orange::before {
    background: var(--orange);
}

.stat__value {
    order: 1;
    margin: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(40px, 17cqi, 66px);
    font-variant-numeric: tabular-nums;
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.stat__value.is-compact {
    font-size: clamp(30px, 13cqi, 52px);
}

.stat__label {
    order: 2;
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

/* ---------- Pace chart ---------- */

.pace-chart {
    display: block;
    flex: 0 0 auto;
    width: calc(100% + (var(--card-pad) * 2));
    height: 104px;
    margin: auto calc(var(--card-pad) * -1) calc(var(--card-pad) * -1);
    overflow: visible;
}

.pace-chart path {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.pace-chart__plan {
    stroke: var(--orange);
}

.pace-chart__actual {
    stroke: var(--lime);
}

/* ---------- Dot field ---------- */

.dot-field {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: auto;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ink);
    transition: background-color 0.35s ease, transform 0.35s ease;
}

.dot[data-state="done"] {
    background: var(--lime);
}

.dot[data-state="running"] {
    background: var(--orange);
    animation: dot-pulse 1.6s ease-in-out infinite;
}

/* ---------- Session card ---------- */

.session-state {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 36px;
    padding: 0 16px 0 14px;
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.session-state__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 22%, transparent);
}

body.is-running .session-state__dot {
    background: var(--orange);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 24%, transparent);
    animation: status-pulse 1.6s ease-out infinite;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.primary-action {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    height: 72px;
    padding: 0 24px 0 10px;
    border: 0;
    border-radius: 999px;
    background: var(--lime);
    color: var(--on-accent);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.primary-action:hover {
    background: var(--lime-hover);
}

.primary-action:active {
    transform: scale(0.985);
}

#btn-stop {
    display: none;
    background: var(--orange);
}

#btn-stop:hover {
    background: var(--orange-hover);
}

.primary-action__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--on-accent);
    color: var(--lime);
}

#btn-stop .primary-action__icon {
    color: var(--orange);
}

.primary-action__icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.primary-action__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.primary-action__copy strong {
    font-size: 17px;
    font-weight: 800;
}

.primary-action__copy small {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.7;
}

.primary-action__arrow {
    width: 24px;
    height: 24px;
    margin-left: auto;
    stroke-width: 2.2;
    transition: transform 0.2s ease;
}

.primary-action:hover .primary-action__arrow {
    transform: translateX(4px);
}

.icon-button--xl {
    width: 72px;
    height: 72px;
    background: var(--surface-raised);
}

.timer-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    margin-top: 14px;
    padding: 12px 22px 12px 18px;
    border-radius: 28px;
    background: var(--surface-raised);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.timer-panel .icon {
    color: var(--muted);
}

body.is-running .timer-panel .icon {
    color: var(--orange);
}

#div-timer strong {
    color: var(--text);
    font-weight: 800;
}

.now-searching {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-top: 14px;
    font-size: 14px;
}

.now-searching[hidden] {
    display: none;
}

.now-searching__label {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 700;
}

.now-searching__term {
    min-width: 0;
    overflow: hidden;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--on-ink);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-progress {
    margin: 22px 0 24px;
}

.session-progress__copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.session-progress__copy strong {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.progress-track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-raised);
}

.progress-track > span {
    position: relative;
    display: block;
    width: 0;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background: var(--lime);
    transition: width 0.45s ease;
}

body.is-running .progress-track > span::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    content: "";
    transform: translateX(-100%);
    animation: progress-shine 1.8s linear infinite;
}

.card__foot--session {
    align-items: flex-start;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.settings-summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.settings-summary strong {
    color: var(--text);
    font-weight: 800;
}

.keep-open-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.keep-open-note .icon {
    width: 18px;
    height: 18px;
    color: var(--lime-ink);
}

/* ---------- Timeline ---------- */

.timeline {
    --label-w: 62px;
    --axis-h: 34px;
    --bar-h: 44px;
    --bar-min: 86px;
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 380px;
    margin-top: 26px;
}

.timeline.is-seconds {
    --label-w: 82px;
}

.timeline__grid {
    position: absolute;
    top: 0;
    right: 0;
    bottom: var(--axis-h);
    left: var(--label-w);
    pointer-events: none;
}

.timeline__grid span {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1.5px dashed var(--grid);
}

.timeline__rows {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-around;
    gap: 10px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
}

.timeline__row {
    display: grid;
    grid-template-columns: var(--label-w) minmax(0, 1fr);
    align-items: center;
}

.timeline__time {
    color: var(--text);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    white-space: nowrap;
}

.timeline__lane {
    position: relative;
    height: var(--bar-h);
}

.timeline__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: min(var(--start, 0%), calc(100% - var(--bar-min)));
    display: flex;
    align-items: center;
    gap: 8px;
    width: max(var(--size, 10%), var(--bar-min));
    padding: 0 16px 0 6px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--on-ink);
    transition: background-color 0.35s ease, color 0.35s ease;
}

.timeline__row[data-state="done"] .timeline__bar {
    background: var(--lime);
    color: var(--on-accent);
}

.timeline__row[data-state="running"] .timeline__bar {
    background: var(--orange);
    color: var(--on-accent);
    animation: bar-glow 1.8s ease-in-out infinite;
}

.timeline__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
}

.timeline__icon .icon {
    grid-area: 1 / 1;
    width: 16px;
    height: 16px;
    stroke-width: 2.4;
}

.timeline__icon .icon--check,
.timeline__row[data-state="done"] .timeline__icon .icon--search {
    display: none;
}

.timeline__row[data-state="done"] .timeline__icon .icon--check {
    display: block;
}

.timeline__count {
    margin-left: auto;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.timeline__axis {
    position: relative;
    flex: 0 0 auto;
    height: var(--axis-h);
    margin-left: var(--label-w);
}

.timeline__axis span {
    position: absolute;
    bottom: 0;
    color: var(--text);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    transform: translateX(-50%);
}

.timeline__axis span:first-child {
    transform: none;
}

.timeline__axis span:last-child {
    transform: translateX(-100%);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.legend li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.legend__dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--surface) 0 3px, transparent 3.5px), var(--dot-color, var(--ink));
}

.legend__dot--done {
    --dot-color: var(--lime);
}

.legend__dot--running {
    --dot-color: var(--orange);
}

.legend__dot--queued {
    --dot-color: var(--ink);
}

/* ---------- Hidden Bing frame ---------- */

#div-bing {
    position: fixed !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
}

/* ---------- Settings modal ---------- */

.modal {
    --bs-modal-width: 640px;
}

.modal-backdrop {
    --bs-backdrop-bg: #000000;
}

.modal-backdrop.show {
    opacity: var(--backdrop-opacity);
}

.modal-content {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.8);
}

.modal-header {
    align-items: center;
    gap: 16px;
    padding: 26px 28px 18px;
    border-bottom: 0;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.modal-title-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--lime);
    color: #0b0b0b;
}

.modal-title {
    margin: 2px 0 0;
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.section-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.modal-close {
    width: 48px;
    height: 48px;
    margin-left: auto;
    background: var(--surface-raised);
}

.modal-body {
    padding: 4px 28px 8px;
}

.settings-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.settings-heading h3 {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 800;
}

.autosave-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.autosave-badge span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lime);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-group {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border-radius: 24px;
    background: var(--surface-raised);
}

.field-group--wide {
    grid-column: 1 / -1;
}

.field-group label {
    font-size: 15px;
    font-weight: 800;
}

.field-group p {
    margin: 2px 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.form-select {
    height: 52px;
    margin-top: auto;
    padding: 0 48px 0 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background-color: var(--surface);
    background-image: var(--chevron);
    background-position: right 18px center;
    background-size: 18px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 30%, transparent);
}

.form-select:disabled {
    background-color: var(--surface);
    opacity: 0.55;
    cursor: not-allowed;
}

.form-select option {
    background: var(--surface);
    color: var(--text);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 28px 26px;
    border-top: 0;
}

.modal-footer > * {
    margin: 0;
}

.modal-footer p {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.modal-done {
    flex: 0 0 auto;
    height: 52px;
    padding: 0 32px;
    border: 0;
    border-radius: 999px;
    background: var(--lime);
    color: #0b0b0b;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.modal-done:hover {
    background: var(--lime-hover);
}

/* ---------- Motion ---------- */

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes status-pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 55%, transparent);
    }

    100% {
        box-shadow: 0 0 0 9px transparent;
    }
}

@keyframes badge-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.18);
    }
}

@keyframes dot-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }
}

@keyframes bar-glow {
    0%,
    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 40%, transparent);
    }

    50% {
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--orange) 14%, transparent);
    }
}

@keyframes progress-shine {
    to {
        transform: translateX(100%);
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 1279px) {
    .brand-block__copy {
        display: none;
    }
}

@media (max-width: 1179px) {
    .dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "progress timer"
            "session  session"
            "timeline timeline";
    }

    .timeline {
        min-height: 420px;
    }
}

@media (max-width: 899px) {
    :root {
        --rail: 48px;
        --rail-gap: 14px;
        --control-h: 48px;
    }

    .app {
        gap: 24px;
        padding: 20px 20px 32px;
    }

    .topbar__main {
        flex-wrap: wrap;
    }

    .topbar__aside {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .carbonads-container {
        flex: 1 1 auto;
        justify-content: flex-start;
        max-width: 420px;
    }

    .brand-block {
        display: none;
    }

    .nav-pill {
        padding: 0 20px 0 16px;
        font-size: 14px;
    }

    .workspace {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title   rail"
            "filters filters"
            "board   board";
        row-gap: 18px;
    }

    .filters {
        justify-content: flex-start;
    }

    .rail {
        position: static;
        flex-direction: row;
        align-self: center;
        gap: 10px;
    }
}

@media (max-width: 639px) {
    .topnav {
        gap: 8px;
    }

    .nav-pill {
        justify-content: center;
        width: var(--control-h);
        padding: 0;
    }

    .nav-pill__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .page-title {
        font-size: 46px;
    }

    .filters {
        gap: 8px;
    }

    .filter-pill {
        height: 44px;
        padding: 0 14px 0 16px;
        font-size: 13px;
    }

    .filter-pill .icon {
        margin-left: 2px;
    }

    .dashboard {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "session"
            "progress"
            "timer"
            "timeline";
        gap: 16px;
    }

    .card {
        --card-pad: 22px;
        --radius-card: 28px;
    }

    .primary-action {
        height: 64px;
        padding-right: 18px;
    }

    .primary-action__icon {
        width: 46px;
        height: 46px;
    }

    .primary-action__copy strong {
        font-size: 16px;
    }

    .icon-button--xl {
        width: 64px;
        height: 64px;
    }

    .timeline {
        --label-w: 52px;
        --bar-h: 38px;
        --bar-min: 58px;
        min-height: 360px;
    }

    .timeline.is-seconds {
        --label-w: 70px;
    }

    .timeline__time,
    .timeline__axis span {
        font-size: 12px;
    }

    .timeline__icon {
        display: none;
    }

    .timeline__bar {
        padding: 0 14px;
    }

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

    .modal-header,
    .modal-footer {
        padding-right: 22px;
        padding-left: 22px;
    }

    .modal-body {
        padding-right: 22px;
        padding-left: 22px;
    }

    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-done {
        width: 100%;
    }
}

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