:root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-alt: #f2f5fa;
    --line: #d7dde6;
    --ink: #122033;
    --muted: #586579;
    --blue: #006b68;
    --blue-soft: rgba(0, 107, 104, 0.08);
    --green: #157347;
    --ios-green: #34c759;
    --focus-blue: #2563eb;
    --red: #b42318;
    --shadow: none;
    --control-height: 52px;
    --field-button-gap: 22px;
    --radius-lg: 8px;
    --radius-md: 8px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: "Aptos", "Segoe UI", sans-serif;
    background: #ffffff;
}

body {
    padding: 16px;
}

body[data-page="auth"] {
    background: #ffffff;
}

body[data-page="modal-demo"] {
    min-height: 100vh;
    padding: 0;
    background: #ffffff;
}

body[data-page="modal-demo"] {
    width: 100%;
    height: 100%;
}

body.modal-open {
    overflow: hidden;
}

body[data-page="dashboard"] {
    overflow-x: hidden;
    padding: 12px;
}

button,
input,
a {
    font: inherit;
}

h1,
h2 {
    margin: 0;
    font-family: "Aptos", "Segoe UI", sans-serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--blue);
}

.auth-copy,
.panel-copy,
.secondary-link,
.mono-cell,
.empty-row,
.error-text {
    color: var(--muted);
}

.auth-shell,
.gate-shell {
    min-height: calc(100vh - 32px);
    display: grid;
    place-items: center;
}

.auth-shell {
    align-content: center;
    gap: 12px;
}

.gate-card,
.dashboard-section,
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.gate-card {
    width: min(500px, 100%);
    padding: 22px;
}

.auth-card-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.1;
}

.auth-page-title {
    width: min(392px, 100%);
    justify-self: center;
    text-align: center;
}

.verification-page-title {
    width: 100%;
    justify-self: stretch;
    text-align: center;
}

.auth-card-subtitle {
    width: min(392px, 100%);
    justify-self: center;
    margin: 0;
    max-width: none;
    font-size: 0.98rem;
    line-height: 1.5;
    text-align: center;
}

.legal-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.signup-legal {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: center;
}

.auth-header,
.panel-head {
    display: grid;
    gap: 10px;
}

.auth-header {
    width: min(392px, 100%);
    justify-items: center;
    padding-bottom: 10px;
    text-align: center;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #000000;
    color: #ffffff;
    font-weight: 900;
    box-shadow: none;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.page-brand-mark {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    text-decoration: none;
    cursor: pointer;
}

/* The page logo is a wide wordmark, so drop the square black tile. */
.page-brand-mark.brand-mark {
    display: flex;
    align-items: center;
    width: auto;
    height: 34px;
    border-radius: 0;
    background: transparent;
}

.page-brand-mark img {
    width: auto;
    height: 34px;
}

.page-brand-mark:focus-visible {
    outline: 2px solid var(--focus-blue);
    outline-offset: 5px;
    border-radius: 4px;
}

.business-portal-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 101;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.business-portal-btn:hover,
.business-portal-btn:focus {
    background: #e7e9ed;
    border-color: var(--line);
}

.business-portal-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-copy,
.panel-copy {
    margin: 0;
    max-width: 60ch;
    line-height: 1.6;
}

.notification-stack {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(440px, calc(100vw - 32px));
    pointer-events: none;
    transform: translateX(-50%);
}

.notification-stack[hidden] {
    display: none;
}

.notification {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
    pointer-events: auto;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-14px);
    animation: notification-in 180ms ease forwards;
}

.notification.is-error {
    border-color: rgba(180, 35, 24, 0.28);
}

.notification.is-leaving {
    animation: notification-out 180ms ease forwards;
}

.notification-message,
.notification-detail {
    margin: 0;
    line-height: 1.45;
}

.notification-message {
    font-weight: 400;
    color: var(--ink);
}

.notification-detail {
    margin-top: 8px;
    color: var(--muted);
}

.notification.is-error .notification-message,
.notification.is-error .notification-detail {
    color: var(--red);
}

@keyframes notification-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notification-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-14px);
    }
}

.status-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 28px;
}

.status-pill,
.surface-panel {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.status-pill {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
}

.status-pill span {
    font-size: 0.8rem;
    color: var(--muted);
}

.status-pill strong {
    font-size: 1rem;
}

.primary-button,
.secondary-button,
.ghost-button {
    border: 0;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-panel {
    width: min(392px, 100%);
    display: grid;
    justify-items: center;
    gap: 12px;
}

.panel-title-block {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-form {
    width: min(392px, 100%);
    display: flex;
    flex-direction: column;
    gap: 22px;
    justify-self: center;
    padding: 0;
    background: var(--surface);
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.admin-session-form {
    gap: 18px;
}

.admin-session-identity {
    display: grid;
    gap: 4px;
    margin: 0;
    text-align: center;
}

.admin-session-identity span {
    color: var(--muted);
    font-size: 0.8rem;
}

.admin-session-identity strong {
    font-size: 1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.admin-session-actions {
    display: grid;
    gap: 10px;
}

.admin-session-actions .primary-button,
.admin-session-actions .secondary-button {
    width: 100%;
    height: 44px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-form.is-auth-complete {
    pointer-events: none;
    opacity: 0.46;
    transform: scale(0.985);
    transition: opacity 220ms ease, transform 220ms ease;
}

.login-success-state {
    width: min(392px, 100%);
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-top: 2px;
    text-align: center;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
}

.login-success-state.is-visible {
    animation: login-success-in 260ms ease forwards;
}

.login-success-check {
    width: 58px;
    height: 58px;
    overflow: visible;
}

.login-success-circle,
.login-success-tick {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-success-circle {
    stroke: var(--ios-green);
    stroke-width: 4;
    stroke-dasharray: 170;
    stroke-dashoffset: 170;
}

.login-success-tick {
    stroke: var(--ios-green);
    stroke-width: 5;
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
}

.login-success-state.is-visible .login-success-circle {
    animation: login-success-ring 520ms cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
}

.login-success-state.is-visible .login-success-tick {
    animation: login-success-tick 300ms ease 210ms forwards;
}

.login-success-copy p {
    margin: 0;
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 600;
}

.login-success-copy span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.84rem;
}

@keyframes login-success-in {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes login-success-ring {
    60% { stroke-dashoffset: 0; }
    78% { transform: scale(1.06); transform-origin: 36px 36px; }
    100% { stroke-dashoffset: 0; transform: scale(1); transform-origin: 36px 36px; }
}

@keyframes login-success-tick {
    to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-form.is-auth-complete,
    .login-success-state.is-visible,
    .login-success-state.is-visible .login-success-circle,
    .login-success-state.is-visible .login-success-tick {
        animation-duration: 1ms;
        transition-duration: 1ms;
    }
}

.auth-form-grid {
    width: min(392px, 100%);
}

#business-panel {
    width: min(720px, 100%);
}

.business-form-grid {
    width: min(720px, 100%);
}

.business-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.business-section-divider {
    margin-top: 2px;
    color: var(--muted);
    text-transform: uppercase;
}

.business-field-note {
    margin: -12px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.business-field-note a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 600px) {
    .business-form-row {
        grid-template-columns: 1fr;
    }
}

.auth-form label {
    display: flex;
    flex-direction: column;
    /* gap: 8px; */
    width: 100%;
}

.auth-form span {
    font-size: 0.88rem;
    font-weight: 400;
}

.auth-form input {
    width: 100%;
    height: var(--control-height);
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: var(--ink);
}

.auth-form input:focus {
    outline: none;
}

.auth-form label.floating-field {
    position: relative;
    display: block;
    width: 100%;
    gap: 0;
}

.auth-form label.floating-field input {
    height: var(--control-height);
    padding: 0 18px;
    font-family: "Aptos", "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.auth-form label.floating-field input:focus,
.auth-form label.floating-field input:autofill,
.auth-form label.floating-field input:-webkit-autofill {
    font-family: "Aptos", "Segoe UI", sans-serif !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    -webkit-text-fill-color: var(--ink);
}

.auth-form label.field-with-action input {
    padding-right: 92px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.phone-entry {
    width: 100%;
}

.phone-entry[hidden] {
    display: none;
}

.phone-entry-fields {
    display: grid;
    gap: 12px;
    width: 100%;
}

.login-credential-fields {
    display: grid;
    gap: 18px;
    width: 100%;
}

.modal-credential-fields {
    display: grid;
    gap: 18px;
    width: 100%;
}

.modal-contact-fields {
    display: grid;
    gap: 10px;
    width: 100%;
}

.modal-credential-fields .email-field {
    margin-bottom: 0;
}

.select-field {
    position: relative;
    display: block;
    width: 100%;
}

.select-field select {
    appearance: none;
    width: 100%;
    height: var(--control-height);
    padding: 0 46px 0 18px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    line-height: 1.2;
    outline: none;
    cursor: pointer;
}

.select-field.has-country-flag select {
    padding-left: 50px;
}

.select-field .country-flag {
    position: absolute;
    top: 50%;
    left: 18px;
    z-index: 2;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    pointer-events: none;
    transform: translateY(-50%);
}

.select-field select:focus {
    border-color: var(--focus-blue);
}

.country-picker {
    position: relative;
    width: 100%;
}

.country-picker-button {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: var(--control-height);
    padding: 0 46px 0 18px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    line-height: 1.2;
    outline: none;
    text-align: left;
}

.country-picker-button:focus,
.country-picker.is-open .country-picker-button {
    border-color: var(--focus-blue);
}

.country-picker-button:disabled {
    cursor: default;
    opacity: 0.7;
}

.country-picker-label {
    min-width: 0;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-picker-caret {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    border-right: 1.8px solid var(--ink);
    border-bottom: 1.8px solid var(--ink);
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.country-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    gap: 2px;
    max-height: 260px;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.country-picker-menu::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.country-picker-menu[hidden] {
    display: none;
}

.country-picker-option {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.2;
    outline: none;
    text-align: left;
}

.country-picker-option span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.95rem;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-picker-option::after {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 10px;
    margin-left: auto;
    margin-right: 4px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    opacity: 0;
    transform: rotate(45deg);
}

.country-picker-option[aria-selected="true"]::after {
    opacity: 1;
}

.country-picker-option:hover,
.country-picker-option:focus,
.country-picker-option[aria-selected="true"] {
    background: #eff6ff;
}

.country-picker .country-flag {
    flex: 0 0 auto;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.select-field::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    border-right: 1.8px solid var(--ink);
    border-bottom: 1.8px solid var(--ink);
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.phone-entry .floating-field {
    position: relative;
    display: block;
    width: 100%;
}

.phone-entry .floating-field input {
    width: 100%;
    height: var(--control-height);
    padding: 0 18px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    line-height: 1.2;
    outline: none;
    caret-color: var(--focus-blue);
}

.phone-entry .phone-number-field.has-phone-prefix input {
    padding-left: 66px;
}

.phone-entry .phone-prefix {
    position: absolute;
    top: 50%;
    left: 18px;
    z-index: 2;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.phone-entry .phone-number-field.has-phone-prefix .floating-label {
    left: 64px;
}

.phone-entry .floating-field input:focus {
    border-color: var(--focus-blue);
}

.phone-entry .floating-field .floating-label {
    position: absolute;
    top: 50%;
    left: 18px;
    z-index: 1;
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left center;
    transition: top 160ms ease, color 160ms ease, transform 160ms ease, font-size 160ms ease;
}

.phone-entry .floating-field input:focus + .floating-label,
.phone-entry .floating-field input:not(:placeholder-shown) + .floating-label {
    top: 0;
    color: #000000;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
}

.phone-entry .floating-field input:focus + .floating-label {
    color: var(--focus-blue);
}

.auth-form label.floating-field .floating-label {
    position: absolute;
    top: 50%;
    left: 18px;
    z-index: 1;
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left center;
    transition: top 160ms ease, color 160ms ease, transform 160ms ease, font-size 160ms ease;
}

.auth-form label.floating-field input:focus + .floating-label,
.auth-form label.floating-field input:not(:placeholder-shown) + .floating-label,
.auth-form label.floating-field input:autofill + .floating-label,
.auth-form label.floating-field input:-webkit-autofill + .floating-label,
.auth-form label.floating-field.has-value .floating-label {
    top: 0;
    color: #000000;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
}

.auth-form label.floating-field input:focus + .floating-label {
    color: var(--focus-blue);
}

.auth-form label.floating-field input:focus {
    border-color: var(--focus-blue);
    caret-color: var(--focus-blue);
}

.auth-provider-stack,
.auth-provider-options {
    display: grid;
    width: 100%;
}

.auth-provider-stack {
    gap: 16px;
}

.auth-provider-options {
    gap: 12px;
}

.auth-provider-buttons {
    gap: 10px;
}

.auth-provider-buttons .provider-oauth-button {
    justify-content: center;
}

.auth-provider-buttons .provider-button-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-provider-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, 76px);
    justify-content: center;
    gap: 10px;
}

.auth-provider-icons .provider-icon-button {
    flex-direction: column;
    width: 76px;
    min-width: 76px;
    height: 76px;
    padding: 8px 4px 7px;
    gap: 6px;
    border-radius: var(--radius-md);
}

.auth-provider-icons .provider-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.auth-provider-icons .more-options-icon {
    grid-template-columns: repeat(3, 4px);
    gap: 3px;
    color: var(--muted);
}

.auth-provider-icons .more-options-icon span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.auth-provider-icons .provider-icon img,
.auth-provider-icons .provider-icon svg {
    display: block;
    width: auto;
    max-width: 22px;
    height: 22px;
}

.auth-provider-icons .provider-icon.phone {
    width: 24px;
    height: 24px;
    font-size: 1.18rem;
    line-height: 1;
}

.auth-provider-divider {
    gap: 14px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.signup-method-toggle {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 4px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f8fafc;
}

.signup-method-toggle::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    z-index: 0;
    width: calc((100% - 16px) / 2);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.1);
    transition: transform 180ms ease;
}

.signup-method-toggle:has(.signup-method-option:nth-child(2) input:checked)::before {
    transform: translateX(calc(100% + 8px));
}

.signup-method-toggle.method-toggle-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signup-method-toggle.method-toggle-3::before {
    width: calc((100% - 24px) / 3);
}

.signup-method-toggle.method-toggle-3:has(.signup-method-option:nth-child(3) input:checked)::before {
    transform: translateX(calc(200% + 16px));
}

.auth-form .signup-method-option,
.auth-modal .signup-method-option {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    height: 36px;
    border-radius: 999px;
    cursor: pointer;
}

.signup-method-option input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.auth-form .signup-method-option span,
.auth-modal .signup-method-option span {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    line-height: 1;
    transition: color 160ms ease;
}

.signup-method-option:has(input:checked) {
    color: #111827;
}

.field-inline-action {
    position: absolute;
    top: 50%;
    right: 18px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--focus-blue);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    transform: translateY(-50%);
}

.field-inline-action:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
    border-radius: 999px;
}

.field-error {
    margin: -10px 0 0 18px;
    color: var(--red);
    font-size: 0.88rem;
    line-height: 1.35;
}

.auth-form [data-reset-password-error] {
    width: 100%;
    margin: -10px 0 0;
    text-align: center;
}

.field-error a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-form input[aria-invalid="true"] {
    border-color: var(--red);
}

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    padding-right: 48px;
}

.auth-form label.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.password-field .password-toggle {
    top: 50%;
}

.password-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .eye-icon,
.password-toggle.is-visible .eye-off-icon {
    display: none;
}

.password-toggle.is-visible .eye-icon {
    display: block;
}

.password-requirements {
    display: grid;
    gap: 18px;
    width: 100%;
    max-height: 0;
    padding: 18px 18px 20px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: #ffffff;
    color: #111827;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    text-align: left;
    transform: translateY(-6px);
    transition: max-height 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.password-requirements.is-visible {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.password-requirements-field {
    display: grid;
    width: 100%;
}

.password-requirements-signup {
    margin-top: 0;
    padding-top: 22px;
    border-top: 0;
    border-radius: 0 0 calc(var(--control-height) / 2) calc(var(--control-height) / 2);
}

.password-requirements-field .password-field:has(+ .password-requirements-signup:not([hidden])) input {
    border-radius: calc(var(--control-height) / 2) calc(var(--control-height) / 2) 0 0;
}

.password-requirements[hidden] {
    display: none;
}

.password-requirements p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
}

.password-rule-error {
    color: var(--red);
}

.password-requirements-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.password-requirement {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
}

.password-requirement span {
    font-size: inherit;
}

.password-requirement-text {
    display: grid;
    gap: 2px;
}

.password-symbol-list {
    display: block;
}

.password-requirement.is-met {
    color: var(--green);
}

.password-requirement-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--red);
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
}

.password-requirement.is-met .password-requirement-check {
    color: var(--green);
}

.password-requirement-check::before {
    content: "x";
    color: currentColor;
}

.password-requirement.is-met .password-requirement-check::before {
    content: "\2713";
}

@media (max-width: 460px) {
    .password-requirements-grid {
        grid-template-columns: 1fr;
    }
}

.signin-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    margin-top: -8px;
}

.forgot-password-button {
    font-size: 0.84rem;
    font-weight: 400;
}

.forgot-password-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
    text-align: right;
}

.field-span-two {
    width: 100%;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    /* margin-top: calc(var(--field-button-gap) - 14px); */
}

.auth-form .primary-button,
.auth-form .secondary-button,
.auth-form .ghost-button,
.auth-form .text-button {
    width: 100%;
}

.account-prompt {
    display: grid;
    gap: 10px;
    padding-top: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.account-prompt-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 400;
    white-space: nowrap;
}

.account-prompt-inline span {
    font-size: inherit;
    font-weight: inherit;
}

.account-prompt-inline .text-button {
    width: auto;
    padding: 0;
    color: var(--focus-blue);
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}

.wide-button {
    width: 100%;
}

.primary-button,
.secondary-button,
.ghost-button,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-height);
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
}

.primary-button {
    background: #000000;
    color: #ffffff;
    box-shadow: none;
}

.secondary-button,
.secondary-link,
.ghost-button {
    background: #f0f3f7;
    color: var(--ink);
    border: 1px solid transparent;
}

.text-button {
    border: 0;
    background: transparent;
    color: #000000;
    cursor: pointer;
    font: inherit;
    font-weight: 400;
    padding: 6px 0;
    text-decoration: none;
}

.verification-header {
    display: grid;
    gap: 12px;
}

.verification-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.1;
}

.verification-copy {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.45;
    text-align: center;
}

.verification-email {
    display: block;
}

.verification-form {
    display: grid;
    gap: var(--field-button-gap);
}

.code-field,
.email-field {
    position: relative;
    display: block;
    width: 100%;
}

.email-field {
    margin-bottom: var(--field-button-gap);
}

.code-field input,
.email-field input {
    width: 100%;
    height: var(--control-height);
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    line-height: 1.2;
    outline: none;
    caret-color: var(--focus-blue);
    letter-spacing: 0;
    transition: border-color 160ms ease, caret-color 160ms ease;
}

.email-field.password-field input {
    padding-right: 48px;
}

.code-field input {
    padding-inline: 28px;
    font-size: 1.15rem;
}

.code-field input:focus,
.email-field input:focus {
    border-color: var(--focus-blue);
}

.code-field .floating-label,
.email-field .floating-label {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left center;
    transition: top 160ms ease, color 160ms ease, transform 160ms ease, font-size 160ms ease;
}

.code-field .floating-label {
    left: 28px;
}

.email-field .floating-label {
    left: 18px;
}

.code-field input:focus + .floating-label,
.code-field input:not(:placeholder-shown) + .floating-label,
.email-field input:focus + .floating-label,
.email-field input:not(:placeholder-shown) + .floating-label {
    top: 0;
    color: var(--ink);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
}

.code-field input:focus + .floating-label,
.email-field input:focus + .floating-label {
    color: var(--focus-blue);
}

.verification-form .primary-button,
.verification-form .secondary-button,
.verification-form .text-button {
    width: 100%;
    min-height: var(--control-height);
    font-size: 1rem;
    font-weight: 400;
}

.verification-form .text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
}

.divider {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    flex: 0 0 auto;
}

.auth-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-legal-links a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.top-right-actions {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 3;
}

.top-right-actions button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-height);
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.top-right-actions .login {
    background: #000000;
    color: #ffffff;
    box-shadow: none;
}

.top-right-actions .signup {
    border-color: var(--line);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 4;
}

.modal-backdrop[hidden] {
    display: none;
}

.auth-modal {
    position: relative;
    z-index: 1;
    width: min(392px, calc(100vw - 32px));
    padding: 28px 20px 22px;
    border: 1px solid #d7dde6;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal-header {
    display: grid;
    gap: 12px;
    padding: 18px 14px;
    text-align: center;
}

.modal-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.modal-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.modal-options,
.modal-actions {
    display: grid;
    gap: 12px;
}

.auth-modal .divider {
    gap: 14px;
    margin: 18px 0 16px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.auth-modal .modal-provider-stack .divider {
    margin: 0 0 18px;
}

.auth-modal .modal-method-toggle {
    margin-bottom: 18px;
}

.modal-actions .primary-button {
    width: 100%;
}

.provider-modal {
    width: min(420px, calc(100vw - 32px));
    padding-top: 22px;
}

.provider-modal .provider-modal-header {
    padding: 6px 14px 14px;
}

.provider-modal-search {
    margin-bottom: 14px;
}

.provider-search-input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
}

.provider-search-input:focus {
    outline: none;
    border-color: var(--focus-blue);
}

.provider-modal-grid {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.provider-modal .provider-icon-label {
    display: block;
    max-width: 100%;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
}

.provider-modal-empty {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.provider-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: var(--control-height);
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.98rem;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
}

.provider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-weight: 700;
}

.provider-icon img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.provider-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.provider-icon.google {
    color: #4285f4;
}

.provider-icon.apple,
.provider-icon.phone {
    color: #111111;
}

.provider-icon.phone {
    font-size: 17px;
}

.email-field.is-invalid input,
.email-field.is-invalid input:focus {
    border-color: var(--red);
    caret-color: var(--ink);
}

.email-field.is-invalid .floating-label,
.email-field.is-invalid input:focus + .floating-label {
    color: var(--red);
}

.email-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -10px 0 18px;
    color: var(--red);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
}

.email-error[hidden] {
    display: none;
}

.email-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.auth-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 26px;
}

.surface-panel {
    padding: 22px;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 18px 0 0;
}

.meta-grid div {
    display: grid;
    gap: 6px;
}

.meta-grid dt {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.meta-grid dd {
    margin: 0;
    font-weight: 700;
}

.error-text,
.error-banner {
    color: var(--red);
}

.error-banner {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(180, 35, 24, 0.08);
    border: 1px solid rgba(180, 35, 24, 0.14);
}

.dashboard-shell {
    width: min(1480px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
}

.dashboard-shell > *,
.dashboard-audit-area,
.dashboard-drilldown {
    min-width: 0;
    max-width: 100%;
}

.dashboard-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.dashboard-header > div:first-child {
    min-width: 0;
}

.dashboard-header h1 {
    max-width: 100%;
}

.dashboard-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    margin-left: auto;
}

.dashboard-header-actions form {
    width: auto;
    margin: 0;
}

.dashboard-icon-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.dashboard-icon-button:hover,
.dashboard-icon-button:focus {
    border-color: rgba(37, 99, 235, 0.34);
    background: #f8fafc;
    color: #1d4ed8;
}

.dashboard-icon-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 12px;
    min-width: 0;
}

.metric-card {
    padding: 16px;
    display: grid;
    gap: 10px;
    min-width: 0;
}

.metric-card span {
    color: var(--muted);
    font-size: 0.88rem;
}

.metric-card strong {
    font-size: 1.65rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    min-width: 0;
}

.dashboard-section {
    padding: 16px;
    border-radius: var(--radius-md);
    min-width: 0;
}

.section-head {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.section-head > div:first-child {
    min-width: 0;
}

.section-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    text-align: right;
}

.section-head > .table-row-count {
    margin-left: auto;
}

.table-row-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.directory-search input {
    width: min(260px, 45vw);
    min-height: 38px;
    box-sizing: border-box;
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
}

.directory-search input:focus {
    border-color: #2563eb;
    outline: 3px solid rgba(37, 99, 235, 0.14);
}

.dashboard-activity-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.dashboard-activity-section .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.dashboard-activity-section .metric-card {
    padding: 14px;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.chart-controls-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.date-range-picker,
.chart-filter-picker {
    position: relative;
    width: 100%;
}

.date-range-button,
.chart-filter-button {
    appearance: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    width: 100%;
    min-height: 58px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.date-range-button > span,
.chart-filter-button > span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.date-range-button > strong,
.chart-filter-button > strong {
    font-size: 0.94rem;
    font-weight: 600;
}

.chart-filter-button.has-component {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-self: start;
    width: min(330px, 100%);
    min-height: 0;
    padding: 0;
    border-color: #dfe3ea;
    border-radius: 6px;
    background: #ffffff;
}

.chart-filter-button.is-static {
    cursor: default;
}

.chart-filter-button.is-static:hover,
.chart-filter-button.is-static:focus,
.chart-filter-button.is-static[aria-expanded="true"] {
    border-color: #dfe3ea;
    background: #ffffff;
}

.chart-filter-button.has-component .manual-date-time-range {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 16px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    width: 100%;
    min-height: 36px;
    margin-top: 0;
    padding: 4px 10px;
    pointer-events: none;
}

.chart-filter-button.has-component .manual-date-time-range.is-single-day {
    grid-template-columns: 22px minmax(78px, 1fr) minmax(42px, auto) minmax(42px, auto);
    column-gap: 8px;
}

.manual-date-time-icon {
    position: relative;
    display: inline-block;
    width: 15px;
    height: 15px;
    justify-self: center;
    border: 1.5px solid var(--ink);
    border-radius: 3px;
}

.manual-date-time-icon::before,
.manual-date-time-icon::after {
    position: absolute;
    content: "";
}

.manual-date-time-icon::before {
    left: -1.5px;
    right: -1.5px;
    top: 4px;
    border-top: 1.5px solid var(--ink);
}

.manual-date-time-icon::after {
    left: 3px;
    right: 3px;
    top: -3px;
    height: 5px;
    border-left: 1.5px solid var(--ink);
    border-right: 1.5px solid var(--ink);
}

.chart-filter-button.has-component .manual-date-time-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chart-filter-button.has-component .manual-date-time-field {
    min-width: 0;
}

.chart-filter-button.has-component .manual-date-time-controls {
    grid-template-columns: minmax(0, 1fr) minmax(148px, auto);
    gap: 8px;
}

.chart-filter-button.has-component .manual-date-box,
.chart-filter-button.has-component .manual-time-box {
    min-height: 42px;
}

.chart-filter-button.has-component .manual-date-box {
    justify-content: flex-start;
    font-weight: 600;
}

.chart-filter-button.has-component .manual-date-time-summary {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.chart-filter-button.has-component .manual-summary-date,
.chart-filter-button.has-component .manual-summary-time {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-filter-button.has-component .manual-date-time-separator {
    min-height: 0;
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
}

.date-range-button:hover,
.date-range-button:focus,
.date-range-button[aria-expanded="true"],
.chart-filter-button:hover,
.chart-filter-button:focus,
.chart-filter-button[aria-expanded="true"] {
    border-color: rgba(37, 99, 235, 0.34);
    background: #f8fafc;
}

.date-range-button:disabled,
.chart-filter-button:disabled {
    cursor: default;
    color: var(--muted);
    background: #f6f8fb;
}

.date-range-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(520px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.date-range-panel[hidden] {
    display: none;
}

.manual-date-range-panel {
    top: calc(100% + 8px);
    bottom: auto;
    display: block;
    width: min(640px, calc(100vw - 48px));
    padding: 16px;
}

.manual-range-calendars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.manual-range-calendars.is-single-day {
    grid-template-columns: minmax(0, 1fr);
}

.manual-range-calendar {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.manual-calendar-head {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    min-height: 32px;
    margin-bottom: 12px;
    text-align: center;
}

.manual-calendar-head strong {
    font-size: 0.9rem;
    font-weight: 700;
}

.manual-calendar-nav {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
}

.manual-calendar-nav:hover,
.manual-calendar-nav:focus {
    background: #f1f5f9;
}

.manual-calendar-nav:disabled {
    color: #cbd5e1;
    cursor: default;
}

.manual-calendar-weekdays,
.manual-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.manual-calendar-weekdays {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.manual-calendar-day {
    appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-width: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
}

.manual-calendar-day:hover,
.manual-calendar-day:focus {
    background: #eef2ff;
}

.manual-calendar-day.is-muted {
    color: #94a3b8;
}

.manual-calendar-day.is-in-range {
    background: #e8f0ff;
    border-radius: 0;
}

.manual-calendar-day.is-selected {
    background: var(--ink);
    color: #ffffff;
    font-weight: 700;
}

.manual-calendar-day.is-range-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.manual-calendar-day.is-range-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.manual-calendar-day.is-range-start.is-range-end {
    border-radius: var(--radius-sm);
}

.manual-calendar-day.is-today:not(.is-selected) {
    outline: 1px solid rgba(37, 99, 235, 0.45);
    outline-offset: -1px;
}

.manual-calendar-day.has-activity::after {
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #2563eb;
    content: "";
}

.manual-calendar-day.is-selected.has-activity::after {
    background: #ffffff;
}

.manual-calendar-day:disabled {
    color: #cbd5e1;
    cursor: default;
    opacity: 0.65;
}

.manual-calendar-day:disabled::after {
    display: none;
}

.manual-date-time-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    margin-top: 14px;
}

.manual-date-time-range.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.manual-date-time-range.is-single-day {
    grid-template-columns: minmax(140px, 1fr) minmax(106px, auto) minmax(106px, auto);
}

.manual-date-time-field {
    min-width: 0;
}

.manual-date-time-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.manual-date-time-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
    gap: 8px;
}

.manual-date-time-field.is-date-only .manual-date-time-controls,
.manual-date-time-field.is-time-only .manual-date-time-controls,
.manual-date-time-range.is-single-day .manual-date-time-controls {
    grid-template-columns: 1fr;
}

.manual-date-box,
.manual-time-box {
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.manual-date-box {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    padding: 0 12px;
    color: var(--ink);
    cursor: default;
    font: inherit;
    font-size: 0.92rem;
}

.manual-date-box.has-select,
.manual-time-box.has-select {
    padding: 0;
}

.manual-date-box.has-select {
    justify-content: stretch;
}

.manual-time-box.has-select {
    display: block;
}

.manual-date-select,
.manual-time-select {
    appearance: none;
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
}

.manual-date-select {
    padding: 0 34px 0 12px;
}

.manual-time-select {
    padding: 0 34px 0 12px;
}

.manual-date-select:disabled,
.manual-time-select:disabled {
    color: var(--muted);
    cursor: default;
}

.manual-date-box.has-select::after,
.manual-time-box.has-select::after {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
    content: "";
}

.manual-date-box.has-select,
.manual-time-box.has-select {
    position: relative;
}

.manual-time-selects {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
}

.manual-time-box .manual-time-select {
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
    text-align: center;
}

.manual-date-divider {
    margin: 0 3px;
    color: var(--muted);
}

.manual-time-box {
    display: inline-grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    padding: 0;
}

.manual-time-box.is-read-only {
    grid-template-columns: auto auto auto;
    justify-content: start;
    gap: 6px;
}

.manual-time-label {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.manual-time-value,
.manual-time-colon {
    font-size: 0.88rem;
    font-weight: 600;
}

.manual-time-period {
    min-width: 38px;
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
}

.manual-time-period.readonly {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    font-size: 0.78rem;
}

.manual-date-time-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    color: var(--muted);
    font-size: 1.25rem;
}

.manual-date-time-range[data-show-time="false"] .manual-date-time-controls {
    grid-template-columns: 1fr;
}

.manual-date-time-range[data-show-time="false"] .manual-time-box {
    display: none;
}

.manual-range-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 16px -16px -16px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}

.range-action-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
}

.range-action-button.secondary {
    background: #ffffff;
    color: var(--ink);
}

.range-action-button.primary {
    border-color: var(--ink);
    background: var(--ink);
    color: #ffffff;
}

.range-action-button:disabled {
    border-color: var(--line);
    background: #f6f8fb;
    color: var(--muted);
    cursor: default;
}

.compact-filter {
    width: 100%;
}

.table-filter-picker {
    width: min(330px, 100%);
}

.table-date-time-filter-panel,
.dev-inbox-filter-panel,
.visitors-filter-panel {
    top: calc(100% + 8px);
    right: 0;
    bottom: auto;
    left: auto;
    display: block;
    width: min(420px, calc(100vw - 32px));
    padding: 16px;
}

.table-date-time-filter-panel .manual-date-time-range,
.dev-inbox-filter-panel .manual-date-time-range,
.visitors-filter-panel .manual-date-time-range {
    margin-top: 14px;
}

.table-filter {
    width: min(180px, 100%);
}

.section-head-meta .table-filter span {
    font-size: 0.68rem;
}

.section-head-meta .table-filter select {
    min-height: 34px;
    font-size: 0.82rem;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    justify-content: start;
    min-width: 0;
}

.dashboard-chart {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.chart-head {
    display: grid;
    gap: 4px;
}

.chart-head h3 {
    margin: 0;
    font-size: 1rem;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.chart-legend button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.chart-legend button:hover,
.chart-legend button[aria-pressed="true"] {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: var(--ink);
}

.chart-legend button[aria-pressed="true"] {
    font-weight: 800;
}

.chart-legend button.is-muted {
    opacity: 0.45;
}

.chart-legend i {
    width: 18px;
    height: 3px;
    background: var(--series-color);
}

.chart-frame {
    width: 100%;
    aspect-ratio: 640 / 230;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.chart-axis {
    stroke: #98a2b3;
    stroke-width: 1.25;
}

@media (max-width: 980px) {
    .dashboard-activity-section {
        grid-template-columns: 1fr;
    }

    .dashboard-activity-section .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    }
}
.chart-grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.chart-axis-label {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.chart-line {
    fill: none;
    stroke: #2563eb;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.chart-series {
    transition: opacity 120ms ease;
}

.chart-line-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 16;
    cursor: crosshair;
    pointer-events: stroke;
}

.chart-svg.has-series-hover .chart-series:not(.is-hovered) {
    opacity: 0.18;
}

.chart-series.is-hovered .chart-line {
    stroke-width: 5;
}

.chart-series.is-hovered .chart-point {
    r: 5px;
}

.chart-point {
    fill: #ffffff;
    stroke: #2563eb;
    stroke-width: 2.5;
}

.chart-bar {
    fill: #16a34a;
}

.chart-bar-empty {
    fill: #dbe3ee;
}

.chart-empty {
    padding: 18px;
    color: var(--muted);
    font-style: italic;
    text-align: center;
}

.compact-head {
    margin-bottom: 14px;
}

.table-shell {
    width: 100%;
    max-width: 100%;
    max-height: min(460px, 62vh);
    min-width: 0;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.table-shell::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.table-shell::-webkit-scrollbar-track {
    background: #eef2f7;
}

.table-shell::-webkit-scrollbar-thumb {
    border: 3px solid #eef2f7;
    border-radius: 999px;
    background: #98a2b3;
}

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #ebeff5;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.data-table th {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #fbfcfe;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mono-cell {
    font-family: "Cascadia Code", "IBM Plex Mono", Consolas, monospace;
    font-size: 0.78rem;
    word-break: normal;
}

.compact-cell {
    white-space: nowrap;
}

.row-number-cell {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: right;
}

.action-cell {
    white-space: nowrap;
}

.session-actions {
    display: flex;
    gap: 6px;
}

.session-grouping-control {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid #d8e0ea;
    border-radius: 7px;
    background: #f3f6fa;
}

.session-grouping-control > span {
    padding: 0 7px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.session-grouping-button {
    appearance: none;
    min-height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
}

.session-grouping-button:hover,
.session-grouping-button:focus-visible {
    color: var(--ink);
    background: #e8edf4;
}

.session-grouping-button.is-active {
    color: #173f73;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 36, 64, 0.14);
}

.session-group-row td {
    vertical-align: middle;
    background: #ffffff;
}

.session-group-row.has-shared-ip td {
    background: #fff9e8;
}

.session-group-row.has-shared-ip td:first-child {
    box-shadow: inset 3px 0 0 #eaaa08;
}

.session-group-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.session-group-toggle span {
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 140ms ease;
}

.session-group-toggle[aria-expanded="true"] span {
    transform: rotate(90deg);
}

.session-group-details > td {
    padding: 0;
    background: #f8fafc;
}

.session-detail-table-wrap {
    max-width: calc(100vw - 96px);
    padding: 10px 14px 14px 34px;
    overflow-x: auto;
}

.session-detail-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.session-detail-table th,
.session-detail-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e6ebf2;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.session-detail-table th {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.session-presence {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 700;
}

.session-presence::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #98a2b3;
    content: "";
}

.session-presence.is-online {
    color: #067647;
}

.session-presence.is-online::before {
    background: #12b76a;
    box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.14);
}

.session-presence.is-away {
    color: var(--muted);
}

.session-version {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.session-version.is-current {
    background: rgba(18, 183, 106, 0.12);
    color: #067647;
}

.session-version.is-outdated {
    background: rgba(180, 35, 24, 0.1);
    color: var(--red);
}

.session-version.is-unknown {
    background: rgba(152, 162, 179, 0.14);
    color: var(--muted);
}

.danger-action-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(180, 35, 24, 0.22);
    border-radius: 999px;
    background: rgba(180, 35, 24, 0.08);
    color: var(--red);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
}

.danger-action-button:hover,
.danger-action-button:focus {
    border-color: rgba(180, 35, 24, 0.36);
    background: rgba(180, 35, 24, 0.12);
}

.danger-action-button:disabled {
    cursor: default;
    opacity: 0.55;
}

.secondary-action-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(15, 36, 64, 0.16);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
}

.secondary-action-button:hover,
.secondary-action-button:focus {
    border-color: rgba(37, 99, 235, 0.28);
    background: #eef4ff;
    color: #1d4ed8;
}

.secondary-action-button:disabled {
    cursor: default;
    opacity: 0.55;
}

.empty-row {
    text-align: center;
    font-style: italic;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge-active {
    background: rgba(21, 115, 71, 0.1);
    color: var(--green);
}

.badge-muted {
    background: rgba(18, 32, 51, 0.08);
    color: var(--muted);
}

@media (max-width: 420px) {
    .top-right-actions {
        top: 12px;
        right: 12px;
        gap: 8px;
    }

    .top-right-actions button {
        padding: 0 14px;
        font-size: 14px;
    }

    .auth-modal {
        width: calc(100vw - 24px);
        padding: 26px 16px 18px;
    }

    .modal-header {
        padding-left: 8px;
        padding-right: 8px;
    }

    body[data-page="dashboard"] {
        padding: 8px;
    }

    .dashboard-shell {
        gap: 10px;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .dashboard-header-actions {
        justify-content: flex-start;
        margin-left: 0;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .dashboard-section,
    .metric-card {
        padding: 14px;
    }

    .section-head {
        flex-direction: column;
        gap: 8px;
    }

    .section-head-meta,
    .section-head > .table-row-count {
        margin-left: 0;
        text-align: left;
    }

    .section-head-meta {
        justify-content: flex-start;
    }

    .chart-controls-two {
        grid-template-columns: 1fr;
    }

    .date-range-panel {
        grid-template-columns: 1fr;
        width: min(320px, calc(100vw - 32px));
    }

    .manual-date-range-panel {
        width: min(340px, calc(100vw - 32px));
        padding: 12px;
    }

    .manual-range-calendars,
    .manual-date-time-range {
        grid-template-columns: 1fr;
    }

    .manual-date-time-controls {
        grid-template-columns: 1fr;
    }

    .manual-date-time-separator {
        min-height: 24px;
        transform: rotate(90deg);
    }

    .manual-range-actions {
        margin: 12px -12px -12px;
        padding: 12px;
    }

    .panel-copy,
    .auth-copy {
        line-height: 1.45;
    }
}

.settings-fab {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.settings-fab:hover {
    background: var(--surface-alt);
    box-shadow: 0 6px 18px rgba(18, 32, 51, 0.12);
}

.settings-fab svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(18, 32, 51, 0.42);
}

.settings-modal {
    display: grid;
    grid-template-columns: 232px 1fr;
    width: min(900px, 100%);
    height: min(640px, 92vh);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(18, 32, 51, 0.24);
}

.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 12px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.settings-sidebar .settings-close {
    align-self: flex-start;
    margin: 4px 4px 0;
}

.settings-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px;
}

.settings-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--blue);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

.settings-identity-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.settings-identity-name {
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-identity-contact {
    font-size: 0.82rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-nav {
    display: grid;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.settings-nav-item svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-nav-item:hover {
    background: rgba(18, 32, 51, 0.06);
}

.settings-nav-item.is-active {
    background: rgba(18, 32, 51, 0.07);
    color: var(--ink);
    font-weight: 500;
}

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

.settings-nav-logout {
    margin-top: auto;
    color: var(--red);
}

.settings-nav-logout:hover {
    background: rgba(180, 35, 24, 0.08);
}

.settings-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 22px 26px 26px;
    overflow: hidden auto;
    scrollbar-gutter: stable;
}

.settings-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.settings-main-title {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.settings-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.settings-close:hover {
    background: var(--surface-alt);
    color: var(--ink);
}

.settings-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.settings-panel {
    display: none;
}

.settings-panel.is-active {
    display: block;
}

.settings-detail-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.settings-detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.settings-detail-row:last-child {
    border-bottom: 0;
}

.settings-detail-row dt {
    color: var(--muted);
    font-size: 0.9rem;
}

.settings-detail-row dd {
    margin: 0;
    color: var(--ink);
    word-break: break-word;
}

.settings-panel-title {
    margin: 0 0 22px;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.settings-section + .settings-section {
    margin-top: 26px;
}

.settings-section-title {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.settings-rows {
    display: grid;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.settings-row-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.settings-row-title {
    color: var(--ink);
    font-size: 1rem;
}

.settings-row-subtitle {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.settings-row-action {
    flex: 0 0 auto;
}

.settings-row-message {
    margin: 0;
    padding: 12px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.ios-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 26px;
    padding: 2px;
    border: 0;
    border-radius: 999px;
    background: #cfd6df;
    cursor: pointer;
    transition: background 180ms ease;
}

.ios-switch:disabled {
    cursor: default;
    opacity: 0.6;
}

.ios-switch-thumb {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.2);
    transition: transform 180ms ease;
}

.ios-switch[aria-checked="true"] {
    background: var(--focus-blue);
}

.ios-switch[aria-checked="true"] .ios-switch-thumb {
    transform: translateX(18px);
}

.settings-2fa-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.settings-2fa-actions .primary-button,
.settings-2fa-actions .secondary-button {
    width: auto;
    padding: 0 22px;
}

.settings-2fa-setup,
.settings-2fa-disable {
    display: grid;
    gap: 16px;
    padding: 18px 0 6px;
}

.settings-2fa-steps {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.settings-2fa-enroll {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.settings-2fa-qr {
    flex: 0 0 auto;
    width: 160px;
    height: 160px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.settings-2fa-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.settings-2fa-manual {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.settings-2fa-manual-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.settings-2fa-secret {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface-alt);
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    word-break: break-all;
}

.settings-2fa-verify {
    display: grid;
    gap: 14px;
    max-width: 320px;
}

.settings-2fa-verify-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-2fa-verify-actions .primary-button,
.settings-2fa-verify-actions .secondary-button {
    width: auto;
    padding: 0 22px;
}

.settings-2fa-verify-actions .text-button {
    width: auto;
}

.settings-2fa-danger {
    background: var(--red);
    color: #ffffff;
}

.settings-2fa-setup .field-error,
.settings-2fa-disable .field-error {
    margin: 0;
}

.settings-logout {
    display: grid;
    gap: 16px;
    max-width: 360px;
}

.settings-logout-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.settings-logout .primary-button {
    width: auto;
    padding: 0 24px;
    justify-self: start;
}

@media (max-width: 720px) {
    .settings-modal {
        grid-template-columns: 1fr;
        height: 94vh;
    }

    .settings-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .settings-nav {
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
    }

    .settings-nav-item {
        justify-content: center;
    }

    .settings-nav-logout {
        margin-top: 0;
    }
}

.chart-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-period-select {
    min-height: 34px;
    padding: 4px 30px 4px 10px;
    border: 1px solid #d7dde6;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
}

.registration-metric-card small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.registration-metric-card small.is-material-increase {
    color: #166534;
    font-weight: 700;
}

.registration-metric-card small.is-material-decrease {
    color: #9f1239;
    font-weight: 700;
}

.audience-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

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

.audience-summary-grid h3 {
    margin: 0 0 10px;
    font-size: 0.88rem;
}

.audience-summary-list {
    display: grid;
    gap: 8px;
}

.audience-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.audience-summary-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
}

.audience-summary-row span {
    color: var(--muted);
    font-size: 0.78rem;
}

.audience-summary-bar {
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    background: #e2e8f0;
}

.audience-summary-bar i {
    display: block;
    height: 100%;
    background: var(--blue);
}

.dashboard-drilldown {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.dashboard-drilldown > summary {
    width: max-content;
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.ip-search-form {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.ip-search-form label,
.investigation-events-title {
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.ip-search-controls {
    display: grid;
    grid-template-columns: minmax(180px, 420px) auto auto;
    gap: 8px;
    justify-content: start;
}

.ip-search-controls input {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.ip-search-controls input:focus {
    border-color: var(--focus-blue);
    outline: 2px solid rgba(37, 99, 235, 0.18);
    outline-offset: 1px;
}

.ip-search-results {
    margin-top: 10px;
}

.investigation-events-title {
    margin: 20px 0 10px;
}

.summary-period-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.access-funnel {
    display: grid;
    gap: 14px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.access-funnel-stage {
    display: grid;
    grid-template-columns: minmax(230px, 0.55fr) minmax(240px, 1fr);
    gap: 18px;
    align-items: center;
}

.access-funnel-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 12px;
    align-items: baseline;
}

.access-funnel-copy span,
.access-funnel-copy strong {
    font-size: 0.86rem;
}

.access-funnel-copy small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.75rem;
}

.access-funnel-track {
    height: 22px;
    overflow: hidden;
    background: #e2e8f0;
}

.access-funnel-track i {
    display: block;
    height: 100%;
    background: #15803d;
}

.access-funnel-empty,
.dashboard-data-note {
    color: var(--muted);
    font-size: 0.78rem;
}

.dashboard-data-note {
    margin: 14px 0 0;
}

.auth-problem-metrics,
.basket-failure-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.auth-problem-metrics article,
.basket-failure-metrics article {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.auth-problem-metrics span,
.auth-problem-metrics small,
.basket-failure-metrics span,
.basket-failure-metrics small {
    color: var(--muted);
    font-size: 0.75rem;
}

.auth-problem-metrics strong,
.basket-failure-metrics strong {
    font-size: 1.35rem;
}

.basket-failures-table-shell {
    margin-top: 14px;
}

.basket-failure-alert-row {
    background: #fff7ed;
}

.basket-failure-alert-status {
    color: #9f1239;
    font-weight: 700;
}

.basket-failure-detail-button {
    border: 0;
    background: transparent;
    color: #0369a1;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
}

.basket-failure-detail-button:hover,
.basket-failure-detail-button:focus-visible {
    text-decoration: underline;
}

.basket-failure-detail-panel {
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    margin-top: 14px;
    padding: 16px;
}

.basket-failure-detail-panel[hidden] {
    display: none;
}

.basket-failure-detail-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.basket-failure-detail-head h3 {
    font-size: 1rem;
    margin: 0;
}

.basket-failure-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.basket-failure-detail-grid {
    display: grid;
    gap: 12px 20px;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.basket-failure-detail-grid div {
    min-width: 0;
}

.basket-failure-detail-grid span,
.basket-failure-detail-grid strong {
    display: block;
    overflow-wrap: anywhere;
}

.basket-failure-detail-grid span {
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 3px;
}

.basket-failure-detail-grid strong {
    font-size: 0.875rem;
}

.basket-failure-outcome-note {
    color: #475569;
    font-size: 0.8rem;
    grid-column: 1 / -1;
    margin: 2px 0 0;
}

.basket-failure-metrics strong.is-alert {
    color: #9f1239;
}

.auth-problem-trend-shell {
    margin-top: 20px;
}

.auth-problem-trend-shell h3,
.auth-failure-reasons h3 {
    margin: 0 0 10px;
    font-size: 0.88rem;
}

.auth-failure-reasons {
    max-width: 420px;
    margin-top: 18px;
}

.auth-problem-trend {
    min-height: 190px;
    border: 1px solid var(--line);
    background: #f8fafc;
    overflow: hidden;
}

.auth-problem-trend > p {
    margin: 76px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
}

.auth-problem-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 190px;
}

.auth-problem-bar {
    shape-rendering: crispEdges;
}

.auth-problem-bar.is-failed,
.auth-problem-legend span:first-child i {
    fill: #be123c;
    background: #be123c;
}

.auth-problem-bar.is-blocked,
.auth-problem-legend span:last-child i {
    fill: #d97706;
    background: #d97706;
}

.auth-problem-value {
    fill: #334155;
    font-size: 10px;
    font-weight: 800;
    pointer-events: none;
}

.auth-problem-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.72rem;
}

.auth-problem-legend span {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.auth-problem-legend i {
    width: 8px;
    height: 8px;
}

.drilldown-controls {
    margin: 12px 0;
}

@media (max-width: 760px) {
    .audience-summary-grid,
    .location-summary-grid {
        grid-template-columns: 1fr;
    }

    .access-funnel-stage {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .auth-problem-metrics,
    .basket-failure-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .auth-problem-metrics,
    .basket-failure-metrics {
        grid-template-columns: 1fr;
    }

    .ip-search-controls {
        grid-template-columns: 1fr 1fr;
    }

    .ip-search-controls input {
        grid-column: 1 / -1;
    }
}

.auth-problem-metrics small.is-material-increase {
    color: #9f1239;
    font-weight: 700;
}

.auth-problem-metrics small.is-material-decrease {
    color: #166534;
    font-weight: 700;
}

.dashboard-audit-area {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.dashboard-audit-area > summary {
    width: max-content;
    max-width: 100%;
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.dashboard-audit-area[open] > summary {
    margin-bottom: 12px;
}