:root {
    --overlay-blur: 8px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;

    --font-heading: "Lexend Deca", system-ui, sans-serif;
    --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;

    --app-max-width: 430px;
    --nav-height: 72px;
    --nav-offset: 16px;
    --layer-peek: 64px;
    --layer-trigger-height: 64px;
    --top-sheet-height: 78%;
    --overlay-edge-inset: var(--space-4);
    --overlay-block-inset: var(--space-5);
}

/* base */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    overflow: hidden;
    background-color: #D4C9A8;
}

body {
    margin: 0;
    background-color: #D4C9A8;
    color: var(--color-text);
    font-family: var(--font-ui);
    line-height: 1.5;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-overflow-scrolling: touch;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

button:disabled {
    background-color: var(--btn-primary-disabled-bg);
    color: var(--btn-primary-disabled-text);
    cursor: default;
    opacity: 0.78;
}

p {
    margin: 0;
}

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

.icon {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

/* layout */
.app-viewport {
    height: 100dvh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: var(--space-3);
    overflow: hidden;
    overscroll-behavior-y: none;
}

.app-shell {
    position: relative;
    width: min(100%, var(--app-max-width));
    height: min(100dvh - calc(var(--space-3) * 2), 920px);
    min-height: 640px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg-app);
    border: 1px solid var(--color-shell-border);
    border-radius: 0;
}

.app-shell--login {
    background: var(--color-bg-app);
}

.app-main {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior-y: none;
}

.app-shell--login .app-main {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.login-screen {
    min-height: 100%;
    display: grid;
    align-content: start;
    gap: var(--space-5);
    padding: calc(var(--space-6) * 2) var(--space-4) calc(var(--space-6) * 2);
    transform: translateY(0);
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

.login-screen[data-state="exiting"] {
    opacity: 0;
    transform: translateY(-16px);
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.login-brand img {
    width: 68px;
    height: 68px;
    display: block;
    object-fit: contain;
}

.login-brand p {
    font-family: var(--font-heading);
    font-size: 25px;
    font-weight: 600;
    letter-spacing: 0;
}

.login-card {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-active);
    box-shadow: 0 12px 28px var(--color-shadow-soft);
}

.login-error {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--status-negative);
    border-radius: var(--radius-md);
    background: var(--status-negative-subtle);
    color: var(--status-negative-text);
    font-size: 12px;
    font-weight: 700;
}

.login-field {
    display: grid;
}

.login-field input {
    height: 48px;
    width: 100%;
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-muted);
    color: var(--color-text);
    font: inherit;
    font-weight: 600;
    outline: none;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.login-field input::placeholder {
    color: var(--color-text-faint);
    font-weight: 500;
}

.login-field input:focus {
    border-color: var(--color-border-strong);
    background: var(--color-surface-active);
}

.login-button {
    height: 48px;
    width: 100%;
    display: grid;
    place-items: center;
    margin-top: var(--space-2);
    border: 1px solid var(--btn-primary-bg);
    border-radius: var(--radius-pill);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        transform 160ms ease,
        opacity 160ms ease;
}

.login-button:hover {
    background: var(--btn-primary-pressed-bg);
}

.login-button:active,
.login-button[data-state="loading"] {
    transform: translateY(1px) scale(0.995);
}

.login-button[data-state="loading"] {
    opacity: 0.72;
    cursor: wait;
}

.login-links {
    display: grid;
    justify-items: center;
    gap: var(--space-3);
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.login-links button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
    transition:
        color 160ms ease,
        transform 160ms ease;
}

.login-links button:active {
    transform: translateY(1px);
}

.login-links__invite {
    color: inherit;
}

.login-links__invite span {
    color: inherit;
}

.login-sheet-layer {
    position: absolute;
    inset: 0;
    z-index: 70;
    pointer-events: none;
}

.login-sheet-layer[data-state="open"] {
    pointer-events: auto;
}

.login-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--color-overlay);
    opacity: 0;
    backdrop-filter: blur(0);
    cursor: pointer;
    transition:
        opacity 240ms ease,
        backdrop-filter 240ms ease;
}

.login-sheet-layer[data-state="open"] .login-sheet-backdrop {
    opacity: 1;
    backdrop-filter: blur(var(--overlay-blur));
}

.login-sheet {
    position: absolute;
    right: var(--space-4);
    bottom: 0;
    left: var(--space-4);
    width: auto;
    margin: 0;
    max-height: var(--top-sheet-height);
    padding-bottom: var(--safe-area-bottom);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sheet-border);
    border-bottom-width: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--sheet-bottom-bg);
    color: var(--color-text);
    box-shadow: 0 12px 28px var(--color-shadow-soft);
    opacity: 0;
    pointer-events: none;
    transform: translateY(110%);
    transition:
        opacity 220ms ease,
        transform 260ms cubic-bezier(0.22, 0.72, 0.22, 1);
    will-change: transform;
    -webkit-transform: translateZ(0);
}

.login-sheet[data-state="open"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    -webkit-transform: translateZ(0) translateY(0);
}

.login-sheet__handle {
    width: 36px;
    height: 4px;
    flex: 0 0 auto;
    margin: var(--space-3) auto var(--space-1);
    border-radius: var(--radius-pill);
    background: var(--sheet-handle);
}

.login-sheet__body {
    display: grid;
    gap: var(--space-5);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-3) var(--space-4) var(--space-5);
    -webkit-overflow-scrolling: touch;
}

.login-sheet__header {
    display: grid;
    gap: var(--space-2);
}

.login-sheet__header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0;
}

.login-sheet__header p {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.login-sheet__form {
    display: grid;
    gap: var(--space-4);
}

.login-sheet-field {
    display: grid;
    gap: var(--space-2);
}

.login-sheet-field span {
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.login-sheet-field input {
    height: 48px;
    width: 100%;
    padding: 0 var(--space-4);
    border: 1px solid var(--form-input-border);
    border-radius: var(--radius-pill);
    background: var(--form-input-bg);
    color: var(--form-input-text);
    font: inherit;
    font-weight: 600;
    outline: none;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
}

.login-sheet-field input::placeholder {
    color: var(--form-input-placeholder);
    font-weight: 500;
}

.login-sheet-field input:focus {
    border-color: var(--form-input-focus-border);
    background: var(--color-surface-active);
}

.login-sheet-button {
    min-height: 48px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--btn-primary-bg);
    border-radius: var(--radius-pill);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        transform 160ms ease;
}

.login-sheet-button:hover {
    background: var(--btn-primary-pressed-bg);
}

.login-sheet-button:active {
    transform: translateY(1px) scale(0.995);
}

.login-sheet-button[data-state="loading"] {
    opacity: 0.72;
}

/* components */
.section-systems,
.layered-surface-system {
    position: relative;
    height: 100%;
    min-height: 0;
}

.layered-surface-system {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.layered-surface-system[data-state="active"] {
    opacity: 1;
    pointer-events: auto;
}

.layered-surface-system__stack {
    position: absolute;
    inset: 0;
    background: var(--nav-tab-inactive-surface);
}

.layered-surface {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    border-style: solid;
    border-width: 1px 1px 0;
    border-color: var(--color-border-strong);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--nav-tab-inactive-surface);
    overflow: hidden;
    transition:
        top 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease;
}

.sheet-header {
    height: var(--layer-trigger-height);
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
}

.surface-title {
    width: 100%;
    min-width: 0;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: var(--font-heading);
    letter-spacing: 0;
    cursor: pointer;
    transition: color 180ms ease;
}

.sheet-title {
    overflow: hidden;
    color: currentColor;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-action {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-muted);
    color: var(--color-icon);
    transition:
        opacity 160ms ease,
        visibility 160ms ease,
        background-color 180ms ease,
        border-color 180ms ease;
}

.sheet-action .icon {
    width: 24px;
    height: 24px;
}

.sheet-action__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0 var(--space-1);
    border: 2px solid var(--color-surface-active);
    border-radius: var(--radius-pill);
    background: var(--nav-bottom-active-bg);
    color: var(--nav-bottom-active-fg);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.sheet-action__badge[data-critical="true"] {
    background: var(--status-negative);
    color: var(--color-text-inverse);
}

.layered-surface[data-state="active"] {
    top: var(--layer-peek);
    z-index: 4;
    background: var(--nav-tab-active-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.layered-surface[data-state="active"] .sheet-title {
    font-size: 16px;
}

.layered-surface[data-state="active"] .sheet-action {
    visibility: hidden;
    opacity: 0;
}

.layered-surface[data-state="inactive"] {
    top: 0;
    z-index: 1;
    border-color: transparent;
    color: var(--nav-bottom-inactive-fg);
}

.layered-surface[data-state="inactive"] .sheet-action {
    background: var(--nav-tab-inactive-surface);
    border-color: var(--color-border-strong);
}

.layered-surface[data-state="inactive"] .layered-surface__content {
    visibility: hidden;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.layered-surface__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-4) var(--space-4) calc(var(--nav-height) + var(--nav-offset) + var(--safe-area-bottom) + var(--space-5));
    background: transparent;
    opacity: 1;
    -webkit-overflow-scrolling: touch;
    transition: opacity 120ms ease, visibility 120ms ease;
}

.hero-card-stack {
    position: relative;
    min-height: 336px;
}

.hero-card {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: grid;
    align-content: start;
    grid-template-rows: auto auto minmax(0, 1fr) 46px;
    gap: 0;
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-hero-surface);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity 220ms ease,
        transform 220ms ease,
        border-color 180ms ease,
        background-color 180ms ease;
}

.hero-card[data-state="active"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hero-card[data-tone="positive"] {
    background: var(--hero-positive-bg);
    border-color: var(--hero-positive-border);
}

.hero-card[data-tone="attention"] {
    background: var(--hero-attention-bg);
    border-color: var(--hero-attention-border);
}

.hero-card[data-tone="stale"] {
    background: var(--hero-stale-bg);
    border-color: var(--hero-stale-border);
    color: var(--color-text-soft);
}

.hero-card[data-tone="negative"] {
    background: var(--hero-negative-bg);
    border-color: var(--hero-negative-border);
}

.hero-card[data-tone="empty"] {
    background: var(--hero-empty-bg);
    border-color: var(--hero-empty-border);
}

.hero-card__title h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: 0;
}

.hero-card__body {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.hero-card__metric {
    min-height: 72px;
    min-width: 0;
    display: grid;
    align-content: center;
    gap: var(--space-1);
    padding: var(--space-3);
    border: 1px solid var(--hero-metric-card-border);
    border-radius: var(--radius-xs);
    background: var(--hero-metric-card-bg);
}

.hero-card__metric:only-child {
    grid-column: 1 / -1;
    min-height: 112px;
    padding: var(--space-4);
}

.hero-card__metric-label {
    overflow: hidden;
    color: var(--color-text-faint);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.hero-card__metric strong {
    min-width: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 700;
}

.hero-card__metric:only-child strong {
    font-size: 36px;
    line-height: 1;
}

.hero-card__metric-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-card__metric strong .icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.hero-card__metric[data-trend="down"] strong {
    color: var(--weight-decrease-on-light);
}

.hero-card__metric[data-trend="up"] strong {
    color: var(--weight-increase-on-light);
}

.hero-card__metric[data-tone="muted"] strong {
    color: var(--color-text-faint);
}

.hero-card__metric-note {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.hero-card__metric-note .icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.hero-card__metric[data-trend="down"] .hero-card__metric-note {
    color: var(--weight-decrease-on-light);
}

.hero-card__metric[data-trend="up"] .hero-card__metric-note {
    color: var(--weight-increase-on-light);
}

.hero-card__metric[data-trend="stable"] .hero-card__metric-note {
    color: var(--color-text-soft);
}

.hero-card__metric[data-tone="stale"] .hero-card__metric-note {
    color: var(--color-reminder);
}

.hero-card__body--input {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.hero-card__input {
    min-height: 112px;
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-active);
}

.hero-card__input input {
    width: 5ch;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    text-align: right;
    outline: 0;
}

.hero-card__input input::placeholder {
    color: var(--color-text);
    opacity: 0.52;
}

.hero-card__input > span:not(.visually-hidden) {
    color: var(--color-text-faint);
    font-size: 16px;
    font-weight: 700;
}

.hero-card__data-point {
    overflow: hidden;
    max-width: 100%;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-card__data-point strong {
    color: var(--color-text-soft);
    font-weight: 700;
}

.hero-card__summary {
    display: -webkit-box;
    overflow: hidden;
    margin: var(--space-5) 0 var(--space-4);
    color: var(--color-text-soft);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hero-card__pill {
    position: relative;
    z-index: 1;
    grid-row: 4;
    align-self: end;
    width: 100%;
    min-width: 0;
    height: 46px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-active);
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: default;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.hero-card__pill[data-pill-type="info"] {
    justify-items: stretch;
    text-align: left;
}

.hero-card__pill[data-pill-type="cta"] {
    justify-items: stretch;
    color: var(--color-text);
    cursor: pointer;
}

.hero-card__pill:has(.hero-card__pill-arrow) {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
}

.hero-card__pill[data-pill-type="primary"] {
    border-color: var(--btn-primary-bg);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.hero-card__pill[data-pill-type="primary"]:active {
    transform: translateY(1px) scale(0.995);
    background: var(--btn-primary-pressed-bg);
}

.hero-card__pill[data-pill-type="cta"]:hover {
    border-color: var(--color-border-strong);
    background: var(--color-navigation-active);
}

.hero-card__pill[data-pill-type="cta"]:active {
    transform: translateY(1px) scale(0.995);
    border-color: var(--color-border-strong);
    background: var(--color-navigation-active);
}

.hero-card__pill > span:first-child {
    min-width: 0;
    overflow: hidden;
    grid-column: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-card__pill:has(.hero-card__pill-arrow) > span:first-child {
    grid-column: 2;
    text-align: center;
}

.hero-card__pill-arrow {
    grid-column: 3;
    justify-self: end;
    color: var(--color-text-soft);
}

.hero-card__pill[data-pill-type="primary"] .hero-card__pill-arrow {
    color: var(--color-surface-active);
    opacity: 0.82;
}

.hero-card__pill-arrow .icon {
    width: 18px;
    height: 18px;
}

.supporting-surface {
    margin-top: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    overflow: hidden;
}

.supporting-surface__header {
    padding: var(--space-4) var(--space-4) var(--space-3);
}

.supporting-surface__header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
}

.supporting-surface__rows {
    padding: 0 var(--space-4) var(--space-3);
}

.supporting-surface__row {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 500;
}

.supporting-surface__row + .supporting-surface__row {
    border-top: 1px solid var(--color-border);
}

.supporting-surface__row strong {
    color: var(--color-text);
    font-weight: 600;
    text-align: right;
}

.supporting-space {
    height: 96px;
}

.challenge-list {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.challenge-card {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.challenge-card[data-focus-overlay-trigger] {
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.challenge-card[data-focus-overlay-trigger]:active {
    transform: scale(0.992);
    background: var(--color-navigation);
}

.challenge-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-3);
}

.challenge-card__header:has(.challenge-card__icon) {
    grid-template-columns: 32px minmax(0, 1fr) auto;
}

.challenge-card__icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--card-accent, var(--color-navigation-active));
    color: currentColor;
}

.challenge-card__icon .icon {
    width: 17px;
    height: 17px;
}

.challenge-card__header h3 {
    overflow: hidden;
    margin: 0;
    color: currentColor;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-card__header p {
    margin-top: var(--space-1);
    color: currentColor;
    opacity: 0.72;
    font-size: 12px;
    font-weight: 600;
}

.challenge-card__header > span {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: var(--card-accent, var(--color-navigation-active));
    color: currentColor;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.challenge-card[data-status="avslutad"] .challenge-card__header > span {
    opacity: 0.72;
}

.challenge-card[data-status="klarad"] .challenge-card__header > span {
    font-weight: 800;
}

.challenge-card__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.challenge-card__stats div {
    min-width: 0;
    display: grid;
    gap: var(--space-1);
}

.challenge-card__stats span {
    overflow: hidden;
    color: currentColor;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    opacity: 0.68;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.challenge-card__stats strong {
    overflow: hidden;
    color: currentColor;
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-card__progress {
    height: 5px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--card-accent, var(--color-border));
}

.challenge-card__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: currentColor;
}

.challenge-card__action {
    height: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-active);
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.challenge-card__action .icon {
    width: 18px;
    height: 18px;
    justify-self: end;
    color: var(--color-text-soft);
}

.challenge-card__action:active,
.one-row-action:active {
    transform: scale(0.985);
    background: var(--color-navigation-active);
}

.progress-overview,
.group-overview,
.logbook-flow,
.checkin-flow {
    display: grid;
    gap: var(--space-5);
    margin-top: var(--space-6);
}

.progress-overview__period {
    display: grid;
    gap: var(--space-5);
}

.progress-overview__period[hidden] {
    display: none;
}

.period-selector,
.insight-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
}

.period-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    padding: var(--space-2);
}

.period-selector__option {
    min-width: 0;
    height: 38px;
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--form-segmented-bg);
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.period-selector__option[data-state="selected"] {
    background: var(--form-segmented-selected-bg);
    color: var(--form-segmented-selected-text);
    font-weight: 700;
}

.period-selector__option:active {
    transform: scale(0.98);
}

.insight-card {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-4);
}

.insight-card[data-focus-overlay-trigger] {
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease;
}

.insight-card[data-focus-overlay-trigger]:active {
    border-color: var(--color-border-strong);
    transform: scale(0.995);
}

.insight-card__label {
    color: var(--color-text-faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.insight-card__header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: var(--space-2);
}

.insight-card__header > div {
    min-width: 0;
    display: grid;
    align-items: center;
}

.insight-card__header .insight-card__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-card__tooltip-wrap {
    position: static;
    justify-self: end;
    flex: 0 0 auto;
}

.icon-button,
.insight-card__icon-button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-active);
    color: var(--color-text-faint);
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.icon-button:hover,
.insight-card__icon-button:hover {
    border-color: var(--color-border-strong);
    background: var(--color-navigation);
    color: var(--color-text-soft);
}

.icon-button:active,
.insight-card__icon-button:active {
    transform: scale(0.96);
    border-color: var(--color-border-strong);
    background: var(--color-navigation);
    color: var(--color-text-soft);
}

.icon-button .icon,
.insight-card__icon-button .icon {
    width: 21px;
    height: 21px;
}

.insight-card__tooltip {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    right: 0;
    z-index: 6;
    width: auto;
    max-width: none;
    padding: var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface-active);
    box-shadow: 0 8px 20px var(--color-shadow-soft);
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.insight-card__tooltip-wrap[data-state="open"] .insight-card__tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chart-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: var(--space-2);
}

.chart-card__y-axis {
    height: 136px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--chart-axis-text);
    font-size: 10px;
    font-weight: 600;
}

.line-chart {
    width: 100%;
    height: 136px;
    overflow: visible;
}

.line-chart line {
    stroke: var(--chart-grid-line);
    stroke-width: 1;
}

.line-chart__trend {
    fill: none;
    stroke: var(--chart-trend-line);
    stroke-dasharray: 4 5;
    stroke-linecap: round;
    stroke-width: 1.25;
}

.line-chart__weight {
    fill: none;
    stroke: var(--chart-main-line);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.line-chart__points circle {
    fill: var(--chart-data-point-fill);
    stroke: var(--chart-data-point-stroke);
    stroke-width: 1.5;
}

.chart-card__x-axis,
.bar-chart__x-axis {
    display: flex;
    justify-content: space-between;
    color: var(--chart-axis-text);
    font-size: 10px;
    font-weight: 600;
}

.chart-card__x-axis {
    grid-column: 2;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4) var(--space-3);
}

.metric-grid__item {
    min-width: 0;
    display: grid;
    gap: var(--space-1);
}

.metric-grid__item span,
.projected-goal span {
    overflow: hidden;
    color: var(--color-text-faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.metric-grid__item strong,
.projected-goal strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-grid__item strong[data-direction="down"],
.activity-list__change[data-direction="down"] {
    color: var(--weight-decrease-on-light);
}

.metric-grid__item strong[data-direction="up"],
.activity-list__change[data-direction="up"] {
    color: var(--weight-increase-on-light);
}

.projected-goal {
    display: grid;
    gap: var(--space-1);
}

.projected-goal p {
    margin-top: var(--space-2);
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 500;
}

.insight-card__action {
    height: 44px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-active);
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.insight-card__action span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-card__action .icon {
    width: 18px;
    height: 18px;
    justify-self: end;
    color: var(--color-text-soft);
}

.insight-card__action--muted {
    background: var(--color-navigation);
    color: var(--color-text-soft);
    font-weight: 500;
}

.bar-chart {
    display: grid;
    gap: var(--space-2);
}

.bar-chart__plot {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: end;
    gap: var(--space-2);
    height: 104px;
    padding: 0 var(--space-1);
}

.bar-chart__plot span {
    display: block;
    width: 100%;
    min-height: 4px;
    border-radius: var(--radius-pill) var(--radius-pill) 0 0;
    background: var(--chart-bar-neutral);
}

.bar-chart--weekly .bar-chart__plot span {
    height: calc(var(--bar-value) * 1%);
}

.bar-chart--delta .bar-chart__plot {
    position: relative;
    align-items: center;
}

.bar-chart--delta .bar-chart__plot::before {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    top: 50%;
    height: 1px;
    background: var(--chart-zero-line);
}

.bar-chart--delta .bar-chart__plot span {
    position: relative;
    z-index: 1;
    height: calc(var(--bar-value) * 0.48px);
    align-self: center;
    background: var(--chart-bar-neutral);
}

.bar-chart--delta .bar-chart__plot span[data-direction="up"] {
    align-self: start;
    margin-top: calc(52px - (var(--bar-value) * 0.48px));
    border-radius: var(--radius-pill) var(--radius-pill) 0 0;
    background: var(--chart-bar-positive);
}

.bar-chart--delta .bar-chart__plot span[data-direction="down"] {
    align-self: end;
    margin-bottom: calc(52px - (var(--bar-value) * 0.48px));
    border-radius: 0 0 var(--radius-pill) var(--radius-pill);
    background: var(--chart-bar-negative);
    opacity: 0.82;
}

.milestone-list {
    display: grid;
}

.milestone-list__row {
    min-height: 54px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
}

.milestone-list__row + .milestone-list__row {
    border-top: 1px solid var(--color-border);
}

.milestone-list__icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
}

.milestone-list__icon .icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.25;
}

.milestone-list__row strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.milestone-list__row time {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.activity-list,
.history-list {
    display: grid;
}

.activity-list__row,
.history-list__row {
    min-height: 64px;
    display: grid;
    align-items: center;
    gap: var(--space-3);
}

.activity-list__row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
}

.history-list__row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
}

.activity-list__row + .activity-list__row,
.history-list__row + .history-list__row {
    border-top: 1px solid var(--color-border);
}

.activity-list__avatar,
.history-list__icon {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
}

.activity-list__avatar {
    position: relative;
    width: 36px;
    height: 36px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.activity-list__avatar[data-stale="true"]::after,
.activity-list__avatar--stale::after {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 6px;
    height: 6px;
    border: 2px solid var(--color-surface-active);
    border-radius: 50%;
    background: var(--detail-late-indicator);
    content: "";
}

.history-list__icon {
    width: 32px;
    height: 32px;
}

.history-list__icon .icon {
    width: 17px;
    height: 17px;
    stroke-width: 1.25;
}

.activity-list__content,
.history-list__content {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.activity-list__content strong,
.history-list__content strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-list__content span,
.history-list__content span {
    overflow: hidden;
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-list__change {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.history-list__row time {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.weighin-card {
    gap: var(--space-5);
}

.large-entry-field {
    min-height: 72px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-active);
}

.large-entry-field input {
    width: 5ch;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: right;
    outline: 0;
}

.large-entry-field input::placeholder {
    color: var(--color-text);
    opacity: 0.48;
}

.large-entry-field > span:not(.visually-hidden) {
    color: var(--color-text-faint);
    font-size: 16px;
    font-weight: 700;
}

.large-entry-field--compact {
    min-height: 64px;
}

.large-entry-field--compact input {
    width: 4ch;
    font-size: 34px;
}

.primary-action {
    width: 100%;
    height: 46px;
    border: 1px solid var(--btn-primary-bg);
    border-radius: var(--radius-pill);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;
}

.primary-action:active {
    transform: scale(0.985);
    background: var(--btn-primary-pressed-bg);
}

.one-row-action {
    min-height: 52px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-navigation);
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.one-row-action span:not(.one-row-action__icon) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.one-row-action__icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface-active);
    color: var(--color-text-soft);
}

.one-row-action__icon .icon {
    width: 16px;
    height: 16px;
}

.one-row-action > .icon {
    width: 18px;
    height: 18px;
    justify-self: end;
}

.input-hint {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.simple-row-list {
    display: grid;
}

.simple-row-list__row {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 500;
}

.simple-row-list__row + .simple-row-list__row {
    border-top: 1px solid var(--color-border);
}

.simple-row-list__row strong {
    color: var(--color-text);
    font-weight: 700;
    white-space: nowrap;
}

.compact-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.compact-field {
    min-width: 0;
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
}

.compact-field span {
    color: var(--color-text-faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.compact-field input {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    outline: 0;
}

.checkin-card {
    gap: var(--space-4);
}

.checkin-card__top {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
}

.checkin-card__icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
}

.checkin-card__icon .icon {
    width: 17px;
    height: 17px;
    stroke-width: 1.25;
}

.checkin-card__top strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkin-card__top > span:last-child {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.checkin-card__question {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.choice-button {
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-navigation);
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.choice-button--primary {
    border-color: var(--btn-primary-bg);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-weight: 700;
}

.stepper-control {
    display: grid;
    grid-template-columns: 36px minmax(0, 72px) 36px;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
}

.stepper-control button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface-active);
    color: var(--color-text);
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.stepper-control strong {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 700;
    text-align: center;
}

.completed-row {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-navigation);
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 700;
}

.completed-row .icon {
    width: 16px;
    height: 16px;
}

.bottom-navigation {
    position: absolute;
    right: var(--space-4);
    bottom: calc(var(--nav-offset) + var(--safe-area-bottom));
    left: var(--space-4);
    z-index: 30;
    min-height: var(--nav-height);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-2) calc(var(--space-2) + var(--safe-area-bottom));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-navigation);
}

.bottom-navigation__item {
    min-width: 0;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-soft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.bottom-navigation__item[data-state="active"] {
    background: var(--color-navigation-active);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.bottom-navigation__item .icon {
    width: 22px;
    height: 22px;
}

.top-sheet-layer {
    position: absolute;
    inset: 0;
    z-index: 60;
    pointer-events: none;
}

.top-sheet-layer[data-state="open"] {
    pointer-events: auto;
}

.top-sheet-overlay {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--color-overlay);
    opacity: 0;
    backdrop-filter: blur(0);
    cursor: pointer;
    transition: opacity 240ms ease, backdrop-filter 240ms ease;
}

.top-sheet-layer[data-state="open"] .top-sheet-overlay {
    opacity: 1;
    backdrop-filter: blur(var(--overlay-blur));
}

.top-sheet {
    position: absolute;
    top: 0;
    right: var(--space-4);
    left: var(--space-4);
    width: auto;
    margin: 0;
    max-height: var(--top-sheet-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-104%);
    border: 1px solid var(--color-border-strong);
    border-top-width: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--color-surface-active);
    box-shadow: 0 12px 28px var(--color-shadow-soft);
    color: var(--color-text);
    opacity: 0;
    transition:
        transform 260ms cubic-bezier(0.22, 0.72, 0.22, 1),
        opacity 220ms ease;
    will-change: transform;
    -webkit-transform: translateZ(0) translateY(-104%);
}

.top-sheet[data-state="open"] {
    transform: translateY(0);
    -webkit-transform: translateZ(0) translateY(0);
    opacity: 1;
}

.top-sheet__header {
    padding: calc(var(--space-5) + var(--safe-area-top)) var(--space-4) var(--space-4);
}

.top-sheet__header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0;
    text-align: center;
}

.top-sheet__body {
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    gap: var(--space-5);
    padding: 0 var(--space-4) var(--space-5);
    -webkit-overflow-scrolling: touch;
}

.top-sheet[data-top-sheet="notifications"] .top-sheet__body {
    gap: var(--space-5);
}

.top-sheet[data-top-sheet="notifications"] .top-sheet__header {
    padding-bottom: var(--space-2);
}

.top-sheet__handle {
    width: 48px;
    height: 4px;
    flex: 0 0 auto;
    margin: 0 auto var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
}

.profile-summary {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-4);
}

.profile-summary__avatar {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-muted);
}

.profile-summary__avatar img {
    width: 58px;
    height: 58px;
    display: block;
    object-fit: contain;
}

.profile-summary__copy {
    min-width: 0;
    display: grid;
    gap: var(--space-2);
}

.profile-summary__copy h2 {
    text-align: left;
}

.profile-summary__copy p {
    margin: 0;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
}

.sheet-section {
    display: grid;
    gap: var(--space-3);
}

.sheet-section__title {
    margin: 0;
    padding: 0 var(--space-1);
    color: var(--color-text-faint);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sheet-list {
    display: grid;
    gap: var(--space-3);
}

.sheet-row-form {
    margin: 0;
}

.sheet-row {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
}

.sheet-row--button {
    cursor: pointer;
    font-family: var(--font-ui);
    text-align: left;
}

.sheet-row__icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: var(--color-icon);
}

.sheet-row__icon .icon {
    width: 22px;
    height: 22px;
}

.notification-row {
    position: relative;
    min-height: 64px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 38px;
    align-items: start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    color: var(--color-text);
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        background-color 160ms ease;
    cursor: pointer;
}

.notification-row + .notification-row {
    border-top: 1px solid var(--color-border);
}

.notification-row[data-notification-type="social"] {
    margin: 0 calc(var(--space-2) * -1);
    padding: var(--space-3) var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--color-warm-soft);
}

.notification-row[data-notification-category="framsteg"],
.notification-row[data-notification-category="varning"],
.notification-row[data-notification-category="handelse"] {
    padding-left: var(--space-2);
    border-left: 3px solid transparent;
}

.notification-row[data-notification-category="framsteg"] {
    border-left-color: var(--status-positive);
}

.notification-row[data-notification-category="varning"] {
    border-left-color: var(--status-negative);
}

.notification-row[data-notification-category="handelse"] {
    border-left-color: var(--status-warning);
}

.notification-row[data-notification-read="true"] {
    opacity: 0.74;
}

.notification-row__unread {
    position: absolute;
    top: var(--space-3);
    left: 0;
    width: 7px;
    height: 7px;
    border-radius: var(--radius-pill);
    background: var(--notif-unread-dot);
}

.notification-row:hover {
    transform: translateY(-1px);
}

.notification-row:active {
    transform: translateY(0);
    opacity: 0.82;
}

.notification-row__mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-muted);
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 800;
}

.notification-row__mark .icon {
    width: 20px;
    height: 20px;
}

.notification-row[data-notification-type="reminder"] .notification-row__mark {
    background: var(--color-reminder-soft);
    border-color: var(--color-reminder-soft);
    color: var(--status-warning-text);
}

.notification-row[data-notification-type="missed"] .notification-row__mark {
    background: var(--color-missed-soft);
    border-color: var(--color-missed-soft);
    color: var(--status-negative-text);
}

.notification-row[data-notification-type="system"] .notification-row__mark {
    background: var(--color-system-blue);
    border-color: var(--color-system-blue);
    color: var(--notif-system-icon-stroke);
}

.notification-row[data-notification-type="placement"] .notification-row__mark {
    background: var(--color-system-neutral);
    border-color: var(--color-system-neutral);
    color: var(--color-text);
}

.notification-row__content {
    min-width: 0;
    display: grid;
    gap: var(--space-1);
}

.notification-row__content p {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-row__content span {
    display: -webkit-box;
    overflow: hidden;
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notification-row__time {
    justify-self: end;
    color: var(--color-text-faint);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.sheet-divider {
    height: 1px;
    background: var(--color-border);
}

.sheet-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--color-text-soft);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.dev-state-switcher {
    position: absolute;
    right: var(--space-4);
    bottom: calc(var(--nav-height) + var(--nav-offset) + var(--space-4));
    z-index: 80;
    pointer-events: none;
}

.dev-state-switcher__controls {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

.dev-state-switcher__toggle {
    min-width: 52px;
    height: 32px;
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface-active);
    color: var(--color-text-soft);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    pointer-events: auto;
}

.dev-state-switcher__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + var(--space-2));
    width: 280px;
    max-height: 420px;
    overflow: auto;
    display: none;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
    box-shadow: 0 12px 28px var(--color-shadow-soft);
    pointer-events: auto;
}

.dev-state-switcher[data-state="open"] .dev-state-switcher__panel {
    display: grid;
}

.dev-state-switcher__panel p {
    color: var(--color-text);
    font-size: 12px;
    font-weight: 800;
}

.dev-state-switcher__field {
    display: grid;
    gap: var(--space-1);
    color: var(--color-text-soft);
    font-size: 11px;
    font-weight: 700;
}

.dev-state-switcher__field select {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-muted);
    color: var(--color-text);
    font: inherit;
}

.panel {
    margin: var(--space-4);
    padding: var(--space-5);
    background: var(--color-surface-active);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.form {
    display: grid;
    gap: 14px;
    max-width: 360px;
}

.field {
    display: grid;
    gap: 6px;
}

input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 16px;
}

.button {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font: inherit;
    cursor: pointer;
}

.muted {
    color: var(--color-text-soft);
}

.focus-overlay-layer {
    position: absolute;
    inset: 0;
    z-index: 80;
    pointer-events: none;
}

.focus-overlay-layer[data-state="open"] {
    pointer-events: auto;
}

.focus-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: var(--color-overlay);
    opacity: 0;
    backdrop-filter: blur(0);
    transition: opacity 240ms ease, backdrop-filter 240ms ease;
}

.focus-overlay-layer[data-state="open"] .focus-overlay-backdrop {
    opacity: 1;
    backdrop-filter: blur(var(--overlay-blur));
}

.focus-overlay {
    position: absolute;
    inset: var(--space-5) var(--space-4);
    width: auto;
    height: auto;
    max-height: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface-active);
    color: var(--color-text);
    box-shadow: 0 12px 28px var(--color-shadow-soft);
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    -webkit-transform: translateZ(0) translateY(10px) scale(0.985);
    pointer-events: none;
    transition: opacity 240ms ease, transform 260ms cubic-bezier(0.22, 0.72, 0.22, 1);
}

.focus-overlay[data-state="open"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    -webkit-transform: translateZ(0) translateY(0) scale(1);
    pointer-events: auto;
}

.focus-overlay--drawer {
    right: var(--space-4);
    top: auto;
    bottom: 0;
    left: var(--space-4);
    height: auto;
    max-height: var(--top-sheet-height);
    padding-bottom: var(--safe-area-bottom);
    border-bottom-width: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(110%) scale(0.985);
    -webkit-transform: translateZ(0) translateY(110%) scale(0.985);
}

.focus-overlay--drawer[data-state="open"] {
    transform: translateY(0) scale(1);
    -webkit-transform: translateZ(0) translateY(0) scale(1);
}

.focus-overlay--drawer::before {
    content: "";
    width: 36px;
    height: 4px;
    flex: 0 0 auto;
    margin: var(--space-3) auto var(--space-1);
    border-radius: var(--radius-pill);
    background: var(--sheet-handle);
}

.focus-overlay__close {
    width: max-content;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin: var(--space-3) 0 var(--space-2) var(--space-3);
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.focus-overlay__close .icon {
    width: 20px;
    height: 20px;
}

.admin-pill {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-navigation);
    color: var(--color-text-soft);
    font-size: 11px;
    font-weight: 700;
}

.admin-pill .icon {
    width: 15px;
    height: 15px;
}

.focus-overlay__body {
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    gap: var(--space-5);
    padding: 0 var(--space-4) var(--space-6);
    -webkit-overflow-scrolling: touch;
}

.focus-overlay__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0;
}

.focus-overlay-heading {
    display: grid;
    gap: var(--space-2);
}

.focus-overlay-heading p {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.welcome-heading {
    gap: var(--space-3);
    padding-top: var(--space-1);
    justify-items: start;
}

.welcome-heading p {
    max-width: 30ch;
    line-height: 1.45;
}

.welcome-logo {
    width: 60%;
    height: auto;
    margin-bottom: var(--space-1);
    justify-self: center;
}

.welcome-feature-card,
.welcome-action-card {
    background: var(--color-surface-active);
}

.welcome-feature-row {
    min-height: 78px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
}

.welcome-feature-row + .welcome-feature-row,
.welcome-action-row + .welcome-action-row {
    border-top: 1px solid var(--color-divider);
}

.welcome-feature-row__icon,
.welcome-action-row__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--milestone-icon-bg);
    color: var(--milestone-icon-stroke);
}

.welcome-feature-row__icon .icon,
.welcome-action-row__icon .icon {
    width: 20px;
    height: 20px;
}

.welcome-feature-row__copy {
    min-width: 0;
    display: grid;
    gap: var(--space-1);
}

.welcome-feature-row__copy strong {
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 700;
}

.welcome-feature-row__copy small {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.welcome-action-row {
    width: 100%;
    min-height: 60px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 20px;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 0;
    background: transparent;
    color: var(--color-text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.welcome-action-row__chevron {
    color: var(--color-text-muted);
}

.welcome-action-row__chevron .icon {
    width: 18px;
    height: 18px;
}

.period-selector--detail {
    margin: 0;
}

.detail-chart-card {
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}

.detail-chart {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: var(--space-2);
}

.detail-chart__y-axis {
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--chart-axis-text);
    font-size: 10px;
    font-weight: 700;
}

.detail-chart svg {
    width: 100%;
    height: 220px;
}

.detail-chart line {
    stroke: var(--chart-grid-line);
    stroke-width: 1;
}

.detail-chart__trend {
    fill: none;
    stroke: var(--chart-trend-line);
    stroke-dasharray: 5 6;
    stroke-linecap: round;
    stroke-width: 1.25;
}

.detail-chart__line {
    fill: none;
    stroke: var(--chart-main-line);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.25;
}

.detail-chart__points circle {
    fill: var(--chart-data-point-fill);
    stroke: var(--chart-data-point-stroke);
    stroke-width: 1.5;
}

.detail-chart__x-axis,
.detail-bar-chart__x-axis {
    display: flex;
    justify-content: space-between;
    color: var(--chart-axis-text);
    font-size: 10px;
    font-weight: 700;
}

.detail-chart__x-axis {
    grid-column: 2;
}

.detail-bar-chart {
    display: grid;
    gap: var(--space-2);
}

.detail-bar-chart__plot {
    position: relative;
    height: 200px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: end;
    gap: var(--space-2);
    padding: 0 var(--space-1);
}

.detail-bar-chart__plot::before {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    top: 50%;
    height: 1px;
    background: var(--chart-zero-line);
}

.detail-bar-chart__plot span {
    position: relative;
    z-index: 1;
    min-height: 5px;
    border-radius: var(--radius-pill) var(--radius-pill) 0 0;
    background: var(--chart-bar-neutral);
}

.detail-bar-chart--delta .detail-bar-chart__plot span {
    height: calc(var(--bar-value) * 0.72px);
    align-self: center;
}

.detail-bar-chart--delta .detail-bar-chart__plot span[data-direction="up"] {
    align-self: start;
    margin-top: calc(100px - (var(--bar-value) * 0.72px));
    background: var(--chart-bar-positive);
}

.detail-bar-chart--delta .detail-bar-chart__plot span[data-direction="down"] {
    align-self: end;
    margin-bottom: calc(100px - (var(--bar-value) * 0.72px));
    border-radius: 0 0 var(--radius-pill) var(--radius-pill);
    background: var(--chart-bar-negative);
}

.detail-bar-chart--weekly .detail-bar-chart__plot::before {
    display: none;
}

.detail-bar-chart--weekly .detail-bar-chart__plot span {
    height: calc(var(--bar-value) * 1%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.detail-bar-chart--weekly .detail-bar-chart__plot em {
    color: var(--color-text);
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    transform: translateY(-18px);
}

.detail-list-row {
    min-height: 50px;
    display: grid;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    color: var(--color-text-soft);
}

.detail-list-row + .detail-list-row {
    border-top: 1px solid var(--color-border);
}

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

.detail-list-row--scenario,
.detail-list-row--change {
    grid-template-columns: minmax(0, 1fr) auto;
}

.detail-list-row span {
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-list-row strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.detail-list-row small {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.detail-list-row--scenario[data-state="default"] span,
.detail-list-row--scenario[data-state="default"] strong {
    color: var(--color-text);
    font-weight: 800;
}

.detail-list-row--scenario[data-state="muted"] {
    color: var(--color-text-faint);
}

.detail-list-row--change[data-direction="down"] {
    background: var(--status-positive-subtle);
}

.detail-list-row--change[data-direction="up"] {
    background: var(--status-negative-subtle);
}

.projected-detail-card {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4);
}

.projected-detail-card strong {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
}

.projected-detail-card span,
.projected-detail-card p,
.detail-body-text {
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.detail-body-text--center {
    text-align: center;
}

.group-total-card {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4);
}

.group-total-card strong {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.group-total-card span {
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.group-member-metric-row {
    min-height: 64px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
}

.group-member-metric-row + .group-member-metric-row {
    border-top: 1px solid var(--color-border);
}

.group-member-metric-row > strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-member-metric-row > div {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.group-member-metric-row > div strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.group-member-metric-row > div span {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.completed-challenge-list {
    display: grid;
    gap: var(--space-4);
}

.completed-challenge-card {
    display: grid;
}

.completed-challenge-card header {
    display: grid;
    gap: 2px;
    padding: var(--space-4);
}

.completed-challenge-card h3 {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.completed-challenge-card header span {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
}

.challenge-detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-3);
}

.challenge-detail-header--challenge,
.challenge-detail-header--detail {
    margin-bottom: 2px;
}

.focus-overlay[data-focus-overlay^="shared-challenge-edit-"] .challenge-detail-header--challenge {
    margin-bottom: calc(-1 * var(--space-2));
}

.challenge-detail-header div {
    min-width: 0;
    display: grid;
    gap: var(--space-1);
}

.challenge-detail-header p {
    margin: 0;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
}

.challenge-detail-header > span {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.challenge-detail-header--challenge > span,
.challenge-detail-header--detail > span {
    border: 0.5px solid var(--color-border-soft);
}

.challenge-detail-header[data-challenge-color] > span {
    background: var(--card-accent, var(--color-navigation-active));
}

.challenge-detail-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--color-border);
}

.challenge-detail-tabs button {
    min-height: 40px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--color-text-faint);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.challenge-detail-tabs button[data-state="active"] {
    border-bottom-color: var(--color-text);
    color: var(--color-text);
}

.challenge-detail-panel {
    display: grid;
    gap: var(--space-5);
}

.challenge-detail-panel[data-state="inactive"] {
    display: none;
}

.challenge-detail-panel[data-challenge-detail-panel="standings"] {
    gap: var(--space-1);
}

.challenge-detail-updated,
.challenge-detail-summary {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
}

.challenge-detail-updated {
    text-align: center;
}

.challenge-detail-summary {
    text-align: center;
    margin-top: var(--space-1);
}

.challenge-section-heading {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.challenge-section-heading h3 {
    margin: 0;
    color: var(--color-text-faint);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.challenge-section-heading .insight-card__icon-button {
    width: 28px;
    height: 28px;
}

.challenge-section-heading .insight-card__icon-button .icon {
    width: 18px;
    height: 18px;
}

.challenge-standing-card {
    overflow: visible;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
}

.challenge-standing-card__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

.challenge-standing-card__header h3 {
    margin: 0;
    color: var(--color-text-muted);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.challenge-standing-card__header .insight-card__icon-button {
    width: 28px;
    height: 28px;
}

.challenge-standing-card__header .insight-card__icon-button .icon {
    width: 18px;
    height: 18px;
}

.challenge-standing-card__header .insight-card__tooltip-wrap {
    position: relative;
}

.challenge-standing-card__header .insight-card__tooltip {
    right: 0;
    left: auto;
    width: min(260px, calc(100vw - 64px));
    max-width: 260px;
}

.challenge-standing-list {
    display: grid;
}

.challenge-standing-row {
    min-height: 60px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
}

.challenge-standing-row + .challenge-standing-row {
    border-top: 1px solid var(--color-divider);
}

.challenge-standing-row--current {
    background: var(--detail-highlight-row-bg);
}

.challenge-standing-row__left {
    display: flex;
    align-items: center;
    min-width: 66px;
}

.challenge-standing-row__position {
    width: 24px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 400;
    text-align: right;
}

.challenge-standing-row__avatar-wrap {
    position: relative;
    width: 34px;
    height: 34px;
    margin-left: var(--space-2);
}

.challenge-standing-row__avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--card-member-avatar-bg);
    color: var(--card-member-avatar-text);
}

.challenge-standing-row__avatar img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.challenge-standing-row__late {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 6px;
    height: 6px;
    border: 2px solid var(--color-surface-active);
    border-radius: 50%;
    background: var(--detail-late-indicator);
}

.challenge-standing-row__center {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding-left: var(--space-1);
}

.challenge-standing-row__name,
.challenge-standing-row__weights {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-standing-row__name {
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 500;
}

.challenge-standing-row__weights {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
}

.challenge-standing-row__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    text-align: right;
}

.challenge-standing-row__change {
    color: var(--weight-stable-color);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.challenge-standing-row__change[data-direction="down"] {
    color: var(--weight-decrease-on-light);
}

.challenge-standing-row__change[data-direction="up"] {
    color: var(--weight-increase-on-light);
}

.challenge-standing-row__percent {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.challenge-days-card {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
}

.challenge-days-context {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.challenge-days-card > strong {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
}

.challenge-days-card > span,
.challenge-days-card > p {
    margin: 0;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 700;
}

.challenge-days-card .challenge-card__progress {
    width: 100%;
    margin-top: var(--space-2);
}

.challenge-days-card > div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 700;
}

.challenge-days-card > .challenge-progress-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.challenge-progress-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-progress-meta span:nth-child(2) {
    text-align: center;
}

.challenge-progress-meta span:last-child {
    text-align: right;
}

.challenge-rank-row {
    min-height: 56px;
    display: grid;
    grid-template-columns: 24px 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
}

.challenge-rank-row + .challenge-rank-row {
    border-top: 1px solid var(--color-border);
}

.challenge-rank-row--highlight {
    background: var(--detail-highlight-row-bg);
}

.challenge-rank-row--large {
    min-height: 68px;
    grid-template-columns: 32px 32px minmax(0, 1fr) auto;
}

.challenge-rank-row > span:first-child {
    color: var(--color-text-soft);
    font-size: 14px;
    font-weight: 700;
}

.challenge-rank-row--large > span:first-child {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 24px;
}

.challenge-rank-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
    font-size: 10px;
    font-weight: 800;
}

.challenge-rank-avatar-wrap {
    position: relative;
    width: 30px;
    height: 30px;
}

.challenge-late-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 7px;
    height: 7px;
    border: 1.5px solid var(--color-surface-muted);
    border-radius: 50%;
    background: var(--color-text-soft);
}

.challenge-rank-avatar--current {
    width: 32px;
    height: 32px;
    background: var(--color-text);
    color: var(--color-surface-active);
}

.challenge-rank-row strong,
.challenge-rank-row em {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-rank-row em {
    font-weight: 700;
}

.challenge-detail-info-row {
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    border-top: 1px solid var(--color-border);
}

.challenge-detail-info-row span {
    overflow: hidden;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-detail-info-row strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.challenge-detail-subrow {
    margin: calc(-1 * var(--space-2)) var(--space-4) var(--space-3);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.challenge-participant-row {
    min-height: 52px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
}

.challenge-participant-row + .challenge-participant-row {
    border-top: 1px solid var(--color-border);
}

.challenge-participant-row strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-participant-row em {
    color: var(--color-text-faint);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.goal-dot-matrix {
    display: grid;
    grid-template-columns: repeat(7, 8px);
    gap: 4px;
    justify-content: center;
    padding-top: var(--space-2);
}

.goal-dot-matrix span {
    width: 8px;
    height: 8px;
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    background: transparent;
}

.goal-dot-matrix span[data-state="filled"] {
    border-color: var(--color-text);
    background: var(--color-text);
}

.goal-dot-matrix span[data-state="muted"] {
    border-color: var(--color-border);
    opacity: 0.35;
}

.route-map-card {
    display: block;
    gap: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--color-surface-active);
    border: 0.5px solid var(--color-border-soft);
    border-radius: 16px;
    box-shadow: none;
}

.route-map-card h3 {
    margin: 0;
    color: var(--color-text-faint);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.route-map {
    width: 100%;
    height: auto;
    display: block;
    background: var(--color-surface-active);
}

#map_europe:not(.route-map) path {
    fill: var(--map-country-fill) !important;
    stroke: var(--map-country-stroke) !important;
    stroke-width: 6 !important;
}

#map_europe:not(.route-map) #nl,
#map_europe:not(.route-map) #be,
#map_europe:not(.route-map) #de {
    fill: var(--map-country-highlight-fill) !important;
}

.route-map path {
    fill: var(--p-neutral-150) !important;
    stroke: var(--color-surface-active) !important;
    stroke-width: 1.5px !important;
    vector-effect: non-scaling-stroke;
}

.route-map[data-route-key="edinburgh_glasgow"] #gb,
.route-map[data-route-key="edinburgh_glasgow"] #gb-gbn,
.route-map[data-route-key="edinburgh_glasgow"] #gb-nir {
    fill: var(--p-neutral-200) !important;
}

.route-map[data-route-key="amsterdam_cologne"] #nl,
.route-map[data-route-key="amsterdam_cologne"] #be,
.route-map[data-route-key="amsterdam_cologne"] #de {
    fill: var(--p-neutral-200) !important;
}

.route-map__line-halo {
    fill: none;
    stroke: var(--color-surface-active);
    stroke-width: 6px;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.6;
    vector-effect: non-scaling-stroke;
}

.route-map__line {
    fill: none;
    stroke: var(--p-blue-300);
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.route-map__line--remaining {
    stroke-dasharray: 8 5;
    opacity: 0.4;
}

.route-map__marker,
.route-map__checkpoint {
    vector-effect: non-scaling-stroke;
}

.route-map__marker--start {
    fill: var(--p-blue-300);
    stroke: var(--color-surface-active);
    stroke-width: 2px;
    vector-effect: non-scaling-stroke;
}

.route-map__marker--current {
    fill: var(--p-blue-300);
    stroke: var(--color-surface-active);
    stroke-width: 3px;
    animation: route-map-current-pulse 2s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.route-map__marker--end {
    stroke: var(--p-neutral-400);
    stroke-width: 2px;
    fill: none;
}

.route-map__checkpoint {
    fill: var(--color-surface-active);
    stroke: var(--p-blue-200);
    stroke-width: 2px;
}

.route-map__checkpoint--passed {
    fill: var(--p-blue-200);
}

@keyframes route-map-current-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .route-map__marker--current {
        animation: none;
    }
}

.route-map-caption {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 700;
}

.route-map-caption span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.goal-history-row {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-3);
    padding-left: var(--space-4);
}

.goal-history-row--weight {
    grid-template-columns: minmax(0, 1fr) auto auto 88px;
}

.goal-history-row + .goal-history-row {
    border-top: 1px solid var(--color-border);
}

.goal-history-row > span:first-child {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.goal-history-row strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.goal-history-row small {
    display: block;
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.challenge-detail-link,
.challenge-leave-button,
.challenge-edit-button,
.challenge-edit-add-date {
    width: 100%;
    min-height: 44px;
    display: grid;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-navigation);
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.challenge-detail-link {
    grid-template-columns: minmax(0, 1fr) 18px;
    padding: 0 var(--space-4);
    text-align: left;
}

.challenge-detail-link .icon {
    width: 18px;
    height: 18px;
    justify-self: end;
}

.challenge-leave-button {
    justify-content: center;
    background: var(--detail-leave-btn-bg);
    color: var(--detail-leave-btn-text);
}

.challenge-edit-button,
.challenge-edit-add-date {
    justify-content: center;
}

.challenge-edit-add-date:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.challenge-detail-actions,
.challenge-edit-form {
    display: grid;
    gap: var(--space-3);
}

.challenge-edit-fields {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-4);
}

.challenge-weighin-day-row,
.challenge-edit-participant-row {
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    border-top: 1px solid var(--color-border);
}

.challenge-edit-participant-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
}

.challenge-weighin-day-row:first-child,
.challenge-edit-participant-row:first-child {
    border-top: 0;
}

.challenge-weighin-day-row span,
.challenge-edit-participant-row strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
}

.challenge-edit-participant-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.challenge-edit-participant-row em {
    color: var(--color-text-faint);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.challenge-weighin-day-row form,
.challenge-edit-participant-row form {
    margin: 0;
}

.challenge-weighin-day-row button,
.challenge-edit-participant-row button {
    min-height: 36px;
    border: 0;
    background: transparent;
    color: var(--detail-leave-btn-text);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.challenge-archive-label {
    margin: 0;
    padding-bottom: var(--space-4);
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.ranking-list {
    display: grid;
}

.ranking-row {
    min-height: 54px;
    display: grid;
    grid-template-columns: 34px 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    color: var(--color-text-soft);
}

.ranking-row + .ranking-row {
    border-top: 1px solid var(--color-border);
}

.ranking-row__position {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 700;
}

.ranking-row strong {
    overflow: hidden;
    color: var(--color-text-soft);
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-row > span:last-child {
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.ranking-row[data-rank="1"] strong,
.ranking-row[data-rank="1"] > span:last-child {
    color: var(--color-text);
    font-weight: 800;
}

.ranking-row[data-rank="2"] strong,
.ranking-row[data-rank="2"] > span:last-child {
    color: var(--color-text);
    font-weight: 600;
}

.profile-focus-hero {
    display: grid;
    justify-items: center;
    gap: var(--space-3);
    padding-top: var(--space-2);
}

.profile-focus-hero__avatar {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface-muted);
}

.profile-focus-hero__avatar img {
    width: 64px;
    height: 64px;
    display: block;
    object-fit: contain;
}

.profile-focus-hero h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0;
    text-align: center;
}

.secondary-action {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-navigation);
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.secondary-action--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.secondary-action--icon .icon {
    width: 18px;
    height: 18px;
}

.focus-section {
    display: grid;
    gap: var(--space-3);
}

.focus-section h3 {
    margin: 0;
    padding: 0 var(--space-1);
    color: var(--color-text-faint);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.focus-card {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}

.profile-account-form {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
}

.profile-account-list {
    display: grid;
    padding: 0;
}

.profile-edit-row {
    min-width: 0;
}

.profile-edit-row summary {
    cursor: pointer;
    list-style: none;
}

.profile-edit-row summary::-webkit-details-marker {
    display: none;
}

.profile-account-list > .settings-row,
.profile-edit-row > .settings-row {
    min-height: 56px;
    padding: 0 var(--space-4);
}

.profile-account-list > .settings-row + .profile-edit-row,
.profile-edit-row + .profile-edit-row,
.profile-edit-row + .settings-row {
    border-top: 1px solid var(--color-divider);
}

.profile-account-form .settings-row {
    margin-right: calc(var(--space-4) * -1);
    margin-left: calc(var(--space-4) * -1);
    padding-right: var(--space-4);
    padding-left: var(--space-4);
}

.profile-account-field {
    display: grid;
    gap: var(--space-2);
}

.profile-account-field span {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.profile-account-field input {
    min-height: 48px;
    width: 100%;
    padding: 0 var(--space-3);
    border: 1px solid var(--form-input-border);
    border-radius: var(--radius-md);
    background: var(--form-input-bg);
    color: var(--form-input-text);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    outline: 0;
}

.profile-account-field input:focus {
    border-color: var(--form-input-focus-border);
}

.insight-card__empty {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.focus-card > .metric-grid {
    padding: var(--space-4);
}

.settings-row {
    width: 100%;
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

button.settings-row {
    cursor: pointer;
}

a.settings-row {
    text-decoration: none;
    cursor: pointer;
}

.settings-row + .settings-row {
    border-top: 1px solid var(--color-border);
}

.settings-row--tall {
    min-height: 68px;
}

.settings-row--tall > span:first-child {
    display: grid;
    gap: 2px;
}

.settings-row--tall strong {
    font-size: 14px;
    font-weight: 500;
}

.settings-row--tall small {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.settings-row__value {
    min-width: 0;
    max-width: 164px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    overflow: hidden;
    color: var(--color-text-faint);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-row__value .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.settings-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 var(--space-2);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-pill);
    background: var(--card-status-pill-bg);
    color: var(--card-status-active-text);
    font-size: 11px;
    font-weight: 600;
}

.settings-status-pill[data-state="inactive"] {
    color: var(--card-status-completed-text);
}

.settings-status-pill[data-state="version"] {
    color: var(--color-text-secondary);
}

.toast-container {
    position: fixed;
    top: calc(16px + var(--safe-area-top));
    left: 50%;
    z-index: 90;
    width: min(calc(100vw - 32px), 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    max-width: 320px;
    min-width: 180px;
    padding: 12px 20px;
    overflow: hidden;
    border: 0.5px solid var(--color-border-soft);
    border-radius: 12px;
    background: var(--color-surface-active);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--color-shadow) 22%, transparent);
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: auto;
    transition: transform 220ms ease-out, opacity 220ms ease-out;
}

.toast[data-type="error"] {
    border-color: var(--status-negative);
    background: var(--hero-negative-bg);
}

.toast[data-state="visible"] {
    transform: translateY(0);
    opacity: 1;
}

.toast[data-state="exiting"] {
    transform: translateY(-8px);
    opacity: 0;
    transition-duration: 180ms;
    transition-timing-function: ease-in;
}

.version-current-card {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
}

.version-current-card span {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.version-current-card strong {
    color: var(--color-text-primary);
    font-size: 16px;
    font-weight: 700;
}

.version-history-list {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
}

.version-history-entry {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
}

.version-history-entry[data-state="current"] {
    border-left: 3px solid var(--detail-tab-active-border);
    background: var(--detail-highlight-row-bg);
}

.version-history-entry h3 {
    margin: 0;
    padding: 0;
    color: var(--color-text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.version-history-entry ul {
    display: grid;
    gap: var(--space-1);
    margin: 0;
    padding-left: var(--space-4);
}

.version-history-entry li {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.todo-list {
    display: grid;
    padding: var(--space-2);
}

.todo-list .insight-card__empty {
    padding: var(--space-3);
}

.todo-row {
    min-height: 48px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: var(--space-3);
    padding: var(--space-3);
}

.todo-row + .todo-row {
    border-top: 1px solid var(--color-divider);
}

.todo-row__check {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    margin-top: 1px;
    border: 1px solid var(--color-border-strong);
    border-radius: 4px;
    color: var(--color-text-inverse);
    font-size: 11px;
    font-weight: 800;
}

.todo-row[data-state="checked"] .todo-row__check {
    border-color: var(--color-border-selected);
    background: var(--color-border-selected);
}

.todo-row__text {
    min-width: 0;
    color: var(--color-text-primary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

[data-todo-section="pagaende"] .todo-row__text {
    font-weight: 700;
}

[data-todo-section="parkerat"] .todo-row__text,
[data-todo-section="klart"] .todo-row__text {
    color: var(--color-text-muted);
}

.todo-row__text small {
    display: block;
    margin-top: var(--space-1);
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.event-log-filter {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: end;
}

.event-log-filter label {
    display: grid;
    gap: var(--space-1);
    min-width: 0;
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.event-log-filter select,
.event-log-filter input {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--form-input-border);
    border-radius: var(--radius-sm);
    background: var(--form-input-bg);
    color: var(--form-input-text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

.event-log-filter button {
    height: 38px;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-size: 12px;
    font-weight: 700;
}

.event-log-count {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.event-log-list {
    display: grid;
    padding: 0;
    overflow: hidden;
}

.event-log-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-3);
    min-height: 58px;
    padding: var(--space-3);
    border-left: 3px solid var(--color-border-soft);
}

.event-log-row + .event-log-row {
    border-top: 1px solid var(--color-divider);
}

.event-log-row[data-category="sakerhet"] {
    border-left-color: var(--status-negative);
}

.event-log-row[data-category="admin"] {
    border-left-color: var(--status-warning);
}

.event-log-row__main {
    display: grid;
    gap: var(--space-1);
    min-width: 0;
}

.event-log-row__main span,
.event-log-row__main small,
.event-log-row__meta {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.event-log-row__main strong {
    min-width: 0;
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.event-log-row__meta {
    display: grid;
    gap: var(--space-1);
    justify-items: end;
    text-align: right;
    white-space: nowrap;
}

.event-log-row__meta small {
    color: var(--color-text-faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.event-log-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.event-log-pagination a {
    color: var(--color-text-link);
    text-decoration: none;
}

.event-log-pagination [data-state="disabled"] {
    color: var(--color-text-disabled);
}

.avatar-render svg {
    display: block;
}

.avatar-form {
    display: grid;
    gap: var(--space-5);
}

.avatar-icon-grid,
.avatar-color-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
}

.avatar-icon-grid button,
.avatar-color-grid button {
    display: grid;
    place-items: center;
    padding: var(--space-2);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
    color: var(--color-text-primary);
}

.avatar-icon-grid button[data-state="selected"],
.avatar-color-grid button[data-state="selected"] {
    border-color: var(--color-border-selected);
    box-shadow: 0 0 0 2px var(--color-border-selected);
}

.avatar-color-grid button {
    width: 44px;
    height: 44px;
    justify-self: center;
    padding: 0;
    border-radius: 50%;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
    padding: var(--space-1);
    border-radius: var(--radius-pill);
    background: var(--form-segmented-bg);
}

.segmented-control--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control button {
    min-width: 48px;
    height: 28px;
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.segmented-control button[data-state="selected"] {
    background: var(--form-segmented-selected-bg);
    color: var(--form-segmented-selected-text);
}

.toggle-control {
    position: relative;
    width: 44px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: var(--color-border);
}

.toggle-control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-surface-active);
    box-shadow: 0 1px 2px var(--color-shadow-soft);
}

.toggle-control[data-state="on"] {
    background: var(--color-text-soft);
}

.toggle-control[data-state="on"]::after {
    transform: translateX(18px);
}

.weighin-history-row {
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 88px;
    align-items: center;
    gap: var(--space-2);
    padding-left: var(--space-4);
}

.weighin-history-row + .weighin-history-row,
.archive-row + .archive-row {
    border-top: 1px solid var(--color-border);
}

.weighin-history-row > span,
.weighin-history-row > strong,
.weighin-history-row > small {
    white-space: nowrap;
}

.weighin-history-row > span {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
}

.weighin-history-row > strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
}

.weighin-history-row > small {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 700;
}

.row-icon-actions {
    display: flex;
    justify-content: flex-end;
}

.weighin-row-state {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-muted);
}

.weighin-row-state__field {
    display: grid;
    gap: var(--space-2);
}

.weighin-row-state__field span {
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.weighin-row-state__field input {
    min-height: 44px;
    padding: 0 var(--space-4);
    border: 1px solid var(--form-input-border);
    border-radius: var(--radius-pill);
    background: var(--form-input-bg);
    color: var(--form-input-text);
    font: inherit;
    font-weight: 700;
    outline: 0;
}

.weighin-row-state__field input:focus {
    border-color: var(--form-input-focus-border);
}

.weighin-row-state__actions {
    display: flex;
    gap: var(--space-2);
}

.weighin-row-state__actions button {
    min-height: 44px;
    flex: 1;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.weighin-row-state__actions button:first-child {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.weighin-row-state__actions button:disabled,
.drawer-primary-button:disabled,
.hero-card__pill:disabled {
    cursor: wait;
    opacity: 0.7;
}

.row-icon-actions button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--color-surface-active);
    color: var(--color-text-soft);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.row-icon-actions button:active {
    transform: scale(0.96);
    background: var(--color-navigation-active);
}

.row-icon-actions .icon {
    width: 20px;
    height: 20px;
}

.archive-row {
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-3);
    padding: var(--space-4);
}

.archive-row > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.archive-row strong,
.archive-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-row strong {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
}

.archive-row span {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 500;
}

.archive-row em {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
}

.archive-row em[data-status="klarad"] {
    color: var(--color-text);
    font-weight: 800;
}

.drawer-title {
    display: grid;
    gap: var(--space-1);
}

.drawer-title p,
.drawer-field > span,
.drawer-date-grid label > span {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 700;
}

.drawer-title p {
    font-size: 13px;
    font-weight: 600;
}

.drawer-form-card,
.drawer-step {
    display: grid;
    gap: var(--space-4);
}

.drawer-step {
    grid-column: 1;
    grid-row: 1;
    align-content: start;
    transition: opacity 180ms ease, transform 180ms ease;
}

.drawer-step[data-state="inactive"] {
    opacity: 0;
    pointer-events: none;
    transform: translateX(12px);
    visibility: hidden;
}

.drawer-step[data-state="active"] {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

[data-focus-overlay="create-challenge-drawer"] .focus-overlay__body,
[data-personal-flow] .focus-overlay__body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.drawer-form-card {
    padding: var(--space-4);
}

.drawer-field {
    min-width: 0;
    display: grid;
    gap: var(--space-2);
}

.drawer-field > span:first-child,
.drawer-date-grid label > span:first-child {
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.drawer-weight-input {
    min-height: 76px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-active);
}

.drawer-weight-input input {
    width: 5ch;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 700;
    text-align: right;
    outline: 0;
}

.drawer-weight-input em,
.drawer-inline-input em {
    color: var(--color-text-faint);
    font-size: 15px;
    font-style: normal;
    font-weight: 700;
}

.drawer-date-field,
.drawer-text-input,
.drawer-inline-input {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
}

.drawer-textarea {
    width: 100%;
    min-height: 128px;
    resize: vertical;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    outline: 0;
}

.drawer-textarea::placeholder {
    color: var(--form-input-placeholder);
    font-weight: 500;
}

.drawer-textarea:focus {
    border-color: var(--form-input-focus-border);
}

.drawer-date-field .icon {
    width: 18px;
    height: 18px;
    color: var(--color-text-soft);
}

.drawer-date-field input,
.drawer-text-input,
.drawer-inline-input input {
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    outline: 0;
}

.drawer-primary-button {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid var(--btn-primary-bg);
    border-radius: var(--radius-pill);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.drawer-primary-button:disabled {
    border-color: var(--color-border);
    background: var(--color-navigation);
    color: var(--color-text-faint);
    cursor: default;
}

.drawer-primary-button:disabled .icon {
    color: var(--color-text-faint);
}

.drawer-primary-button .icon {
    width: 18px;
    height: 18px;
}

.drawer-secondary-button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-soft);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.step-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
}

.step-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-border-strong);
    opacity: 0.55;
}

.step-dots span[data-state="active"] {
    width: 10px;
    height: 10px;
    background: var(--color-text);
    opacity: 1;
}

.drawer-divider {
    height: 1px;
    background: var(--color-border);
}

.option-stack,
.option-grid {
    display: grid;
    gap: var(--space-2);
}

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

.option-stack button,
.option-grid button {
    display: grid;
    gap: 2px;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-active);
    color: var(--color-text);
    font-family: var(--font-ui);
    text-align: left;
    cursor: pointer;
}

.option-stack button[data-state="selected"],
.option-grid button[data-state="selected"] {
    border-color: var(--color-border-strong);
    background: var(--color-navigation-active);
}

.option-stack strong,
.option-grid strong {
    font-size: 13px;
    font-weight: 700;
}

.option-stack small,
.option-grid small {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
}

.drawer-help-text {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.preview-row__right {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-soft);
}

.preview-row__right .icon {
    width: 17px;
    height: 17px;
}

.preview-circle {
    width: 18px;
    height: 18px;
    display: inline-block;
    border: 1px solid var(--color-border-strong);
    border-radius: 50%;
    background: var(--color-navigation-active);
    vertical-align: middle;
}

.drawer-date-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.drawer-date-grid label {
    min-width: 0;
    display: grid;
    gap: var(--space-2);
}

.date-chip-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.date-chip-row > span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 700;
}

.date-chip-row .icon {
    width: 14px;
    height: 14px;
}

.date-chip-row button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface-active);
    color: var(--color-text);
    font-size: 18px;
    font-weight: 600;
}

.settings-row .toggle-control,
.participant-row .toggle-control {
    padding: 0;
    border: 0;
    appearance: none;
    cursor: pointer;
}

.drawer-field[hidden],
.drawer-divider[hidden],
.summary-row[hidden] {
    display: none;
}

.participant-row {
    min-height: 62px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
}

.participant-row + .participant-row,
.summary-row + .summary-row {
    border-top: 1px solid var(--color-border);
}

.participant-row div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.participant-row strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-row small {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
}

.participant-row__lock {
    color: var(--color-text-faint);
}

.participant-row__lock .icon {
    width: 18px;
    height: 18px;
}

.summary-row {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 var(--space-4);
}

.summary-row span {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
}

.summary-row strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.application-row {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
}

.application-row + .application-row,
.member-row + .member-row {
    border-top: 1px solid var(--color-border);
}

.admin-person-row,
.member-row,
.invitation-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
}

.admin-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.admin-person-row div,
.member-row div,
.invitation-row div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.admin-person-row strong,
.member-row strong,
.invitation-row strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-person-row span:not(.admin-avatar),
.member-row span:not(.admin-avatar),
.invitation-row span:not(.admin-avatar),
.admin-person-row time {
    overflow: hidden;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-person-row time {
    align-self: start;
    padding-top: 2px;
}

.member-row {
    min-height: 64px;
    padding: 0 0 0 var(--space-4);
}

.member-row > button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-right: var(--space-2);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-soft);
    cursor: pointer;
}

.member-row > button .icon {
    width: 20px;
    height: 20px;
}

.admin-list-card {
    display: grid;
    padding: 0;
}

.admin-empty-row {
    min-height: 56px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 var(--space-4);
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
}

.admin-avatar--initials {
    display: grid;
}

.member-row--admin-list {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 var(--space-3) 0 var(--space-4);
}

.member-row__identity {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
}

.member-role-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.member-role-indicator .icon {
    width: 14px;
    height: 14px;
}

.member-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--btn-icon-border);
    border-radius: var(--radius-pill);
    background: var(--btn-icon-bg);
    color: var(--btn-icon-fg);
    text-decoration: none;
    cursor: pointer;
}

.member-icon-button:active {
    background: var(--btn-icon-pressed-bg);
}

.member-icon-button .icon {
    width: 18px;
    height: 18px;
}

.admin-invitation-actions {
    padding: var(--space-3);
}

.admin-invite-button {
    width: 100%;
    justify-content: center;
}

.admin-invite-button span {
    display: grid;
    gap: 2px;
    justify-items: center;
}

.admin-invite-button strong {
    font-size: 13px;
    font-weight: 700;
}

.admin-invite-button small {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
}

.admin-invite-button--disabled,
.admin-invite-button--disabled:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.25);
}

.invitation-row--compact {
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 64px;
    padding: 0 var(--space-4);
}

.invitation-row--compact + .invitation-row--compact {
    border-top: 1px solid var(--color-border);
}

.invitation-row--compact time {
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.admin-text-action {
    min-height: 44px;
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-trend-up);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.member-edit-card {
    display: grid;
    padding: 0;
}

.member-edit-row {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
}

.member-edit-row + .member-edit-row,
.member-edit-action-row + .member-edit-action-row {
    border-top: 1px solid var(--color-divider);
}

.member-edit-row > span:first-child {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
}

.member-edit-row__controls {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.member-edit-row__controls--compact {
    gap: var(--space-1);
}

.member-edit-row__controls--edit {
    grid-column: 1 / -1;
    display: grid;
    justify-content: stretch;
    gap: var(--space-2);
    padding-top: var(--space-2);
}

.member-edit-row__value {
    min-width: 0;
    max-width: 176px;
    overflow: hidden;
    color: var(--settings-row-value);
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-edit-row__value--muted {
    color: var(--color-text-faint);
}

.member-edit-row .field-error {
    grid-column: 1 / -1;
}

.member-inline-input {
    min-height: 46px;
    width: 100%;
    padding: 0 var(--space-3);
    border: 1px solid var(--form-input-border);
    border-radius: var(--radius-md);
    background: var(--form-input-bg);
    color: var(--form-input-text);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 600;
    outline: 0;
}

.member-inline-input:focus {
    border-color: var(--form-input-focus-border);
}

.member-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

.member-save-button,
.member-cancel-button {
    min-height: 44px;
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-pill);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.member-save-button {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.member-cancel-button {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.member-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 3px;
    border-radius: var(--radius-pill);
    background: var(--form-segmented-bg);
}

.member-segmented button {
    min-height: 40px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-muted);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.member-segmented button[data-state="selected"] {
    background: var(--form-segmented-selected-bg);
    color: var(--form-segmented-selected-text);
}

.member-confirm-copy,
.member-edit-help,
.member-edit-note {
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.member-edit-note {
    margin: 0;
    padding: var(--space-4);
}

.member-create-field {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4);
}

.member-create-field + .member-create-field {
    border-top: 1px solid var(--color-divider);
}

.member-create-field > span:first-child {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.member-create-field input[type="text"],
.member-create-field input[type="email"],
.member-create-field input[type="password"] {
    min-height: 48px;
    width: 100%;
    padding: 0 var(--space-3);
    border: 1px solid var(--form-input-border);
    border-radius: var(--radius-md);
    background: var(--form-input-bg);
    color: var(--form-input-text);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 600;
    outline: 0;
}

.member-create-field input:focus {
    border-color: var(--form-input-focus-border);
}

.member-edit-action-row {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
}

.member-danger-button {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-pill);
    background: var(--status-warning-subtle);
    color: var(--status-warning-text);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.admin-broadcast-row {
    min-height: 88px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
}

.admin-broadcast-row__icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-muted);
    color: var(--color-icon);
}

.admin-broadcast-row__icon .icon {
    width: 20px;
    height: 20px;
}

.admin-broadcast-row + .admin-broadcast-row {
    border-top: 1px solid var(--color-border);
}

.admin-broadcast-row div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.admin-broadcast-row strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-broadcast-row div > span,
.admin-broadcast-row small {
    overflow: hidden;
    color: var(--color-text-faint);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
}

.admin-broadcast-row div > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.admin-broadcast-row small {
    white-space: nowrap;
}

.admin-broadcast-row em {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.admin-broadcast-empty {
    margin: 0;
    padding: var(--space-4);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.broadcast-icon-preview {
    min-height: 72px;
    display: grid;
    place-items: center;
    gap: var(--space-1);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    color: var(--color-icon);
}

.broadcast-icon-preview span {
    display: grid;
    place-items: center;
}

.broadcast-icon-preview .icon {
    width: 24px;
    height: 24px;
}

.broadcast-icon-preview small {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
}

.invitation-row {
    padding: var(--space-4) var(--space-4) var(--space-2);
}

.invitation-row__status {
    justify-items: end;
}

.invitation-row__status em {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: var(--color-navigation-active);
    color: var(--color-text-soft);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
}

.invitation-row__status time {
    color: var(--color-text-faint);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.invite-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 var(--space-4) var(--space-3);
}

.invite-actions button {
    min-height: 44px;
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-trend-up);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.inline-confirm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.inline-confirm-row input {
    min-height: 44px;
    border: 1px solid var(--form-input-border);
    border-radius: var(--radius-pill);
    background: var(--form-input-bg);
    color: var(--form-input-text);
}

.inline-confirm-row button {
    min-height: 44px;
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-pill);
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    font-size: 12px;
    font-weight: 700;
}

.inline-confirm-row [data-inline-confirm] {
    background: var(--status-warning-subtle);
    color: var(--status-warning-text);
}

input,
select,
textarea {
    font-size: 16px;
}

@media (max-width: 460px) {
    .app-viewport {
        padding: 0;
    }

    .app-shell {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        border-width: 0;
    }
}

@media (max-height: 670px) {
    .focus-overlay,
    .floating-card {
        max-height: 92vh;
    }
}
