:root {
    /* Existing theme variables stay authoritative so cultural subdomains can override them. */
    --bg: #f5f8f5;
    --primary: #5ca370;
    --primary-dark: #467f56;
    --soft: #edf5ef;

    --color-bg: var(--bg);
    --color-bg-elevated: #f8faf8;
    --color-surface: #ffffff;
    --color-surface-soft: #f0f5f1;

    --color-brand: var(--primary);
    --color-brand-hover: var(--primary-dark);
    --color-brand-deep: var(--primary-dark);
    --color-brand-soft: var(--soft);
    --color-brand-glow: rgba(92, 163, 112, .18);
    --color-brand-glow: color-mix(in srgb, var(--color-brand) 18%, transparent);

    --color-text: #26352a;
    --color-text-2: #66766a;
    --color-text-3: #95a198;

    --color-border: rgba(45, 72, 52, .10);
    --color-border-strong: rgba(45, 72, 52, .16);

    --color-danger: #b55252;
    --color-danger-soft: #fbeeee;
    --color-warning: #b8873d;
    --color-warning-soft: #fbf4e7;
    --color-info: #587b96;
    --color-info-soft: #edf3f7;

    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(32, 48, 36, .04);
    --shadow-sm: 0 4px 14px rgba(32, 48, 36, .05);
    --shadow-md: 0 12px 32px rgba(32, 48, 36, .07);
    --shadow-focus: 0 0 0 4px rgba(92, 163, 112, .12);

    --ease-standard: cubic-bezier(.2, .8, .2, 1);
    --motion-micro: 140ms;
    --motion-standard: 220ms;
    --motion-reveal: 320ms;

    /* Compatibility aliases used by pages that have not reached their UI milestone yet. */
    --panel: var(--color-surface);
    --text: var(--color-text);
    --muted: var(--color-text-2);
    --line: var(--color-border);
    --danger: var(--color-danger);
    --shadow: var(--shadow-xs);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: appPageOut 120ms ease both;
}

::view-transition-new(root) {
    animation: appPageIn 180ms ease both;
}

@keyframes appPageOut {
    to { opacity: .84; transform: translateX(-4px); }
}

@keyframes appPageIn {
    from { opacity: .82; transform: translateX(7px); }
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
summary {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

svg {
    display: block;
}

.app-shell,
.shell {
    width: min(calc(100% - 40px), 1200px);
    margin: 0 auto;
    padding: 18px 0 42px;
}

.app-header,
.topbar {
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
    align-items: center;
    gap: 24px;
    margin-bottom: 26px;
    padding: 0 4px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 720;
    letter-spacing: .08em;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .75);
    box-shadow: var(--shadow-xs);
    color: var(--primary);
}

.brand-mark svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.7;
}

.app-nav,
.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
}

.nav a,
.nav-item {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--color-text-2);
    white-space: nowrap;
    transition:
        color var(--motion-micro) var(--ease-standard),
        background var(--motion-micro) var(--ease-standard),
        border-color var(--motion-micro) var(--ease-standard);
}

.nav a:hover,
.nav-item:hover {
    color: var(--color-brand-deep);
    background: rgba(255, 255, 255, .55);
}

.nav-item-active,
.nav a.active {
    color: var(--color-brand-deep);
    background: rgba(255, 255, 255, .82);
    border-color: var(--color-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), var(--shadow-xs);
}

.nav-icon {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.header-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .72);
    color: var(--color-text-2);
    box-shadow: var(--shadow-xs);
    transition: background var(--motion-micro) var(--ease-standard), color var(--motion-micro) var(--ease-standard);
}

.header-icon-btn:hover {
    background: var(--color-surface);
    color: var(--color-brand-deep);
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border: 2px solid var(--color-bg);
    border-radius: var(--radius-pill);
    background: var(--color-brand-deep);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.nav-tab-badge {
    display: none;
}

.mobile-tabbar {
    display: none;
}

/* PWA install prompt */
.pwa-install-prompt {
    position: fixed;
    z-index: 140;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: min(calc(100% - 28px), 430px);
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 15px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 18px 54px rgba(32, 48, 36, .16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px) scale(.985);
    transition:
        opacity 180ms var(--ease-standard),
        transform 220ms var(--ease-standard);
}

.pwa-install-prompt.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

.app-mode .pwa-install-prompt {
    bottom: calc(78px + env(safe-area-inset-bottom));
}

.pwa-install-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--color-brand) 16%, transparent);
    border-radius: 14px;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
}

.pwa-install-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
}

.pwa-install-copy {
    min-width: 0;
}

.pwa-install-copy strong,
.pwa-install-copy > span {
    display: block;
}

.pwa-install-copy strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.pwa-install-copy > span {
    margin-top: 3px;
    color: var(--color-text-3);
    font-size: 11px;
    line-height: 1.45;
}

.pwa-install-guide {
    margin-top: 8px;
    color: var(--color-text-2);
    font-size: 11px;
    line-height: 1.55;
}

.pwa-install-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pwa-install-primary,
.pwa-install-later {
    min-width: 60px;
    min-height: 32px;
    padding: 6px 11px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.pwa-install-primary {
    background: var(--color-brand);
    color: #fff;
}

.pwa-install-later {
    background: transparent;
    color: var(--color-text-3);
}

.pwa-install-close {
    position: absolute;
    top: 4px;
    right: 5px;
    width: 24px;
    height: 24px;
    display: none;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--color-text-3);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 420px) {
    .pwa-install-prompt {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 13px 13px 12px;
    }

    .pwa-install-icon {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }

    .pwa-install-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
        margin-top: 2px;
    }

    .pwa-install-primary,
    .pwa-install-later {
        min-width: 72px;
    }
}

.user-menu {
    position: relative;
}

.user-menu summary {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 9px 5px 5px;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, .72);
    color: var(--color-text-2);
    cursor: pointer;
    list-style: none;
    box-shadow: var(--shadow-xs);
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
}

.user-avatar svg {
    width: 15px;
    height: 15px;
}

.user-menu-label {
    font-size: 12px;
    font-weight: 650;
}

.user-menu-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    width: 176px;
    padding: 6px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--shadow-md);
}

.user-menu-panel a {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 9px 10px;
    border-radius: 9px;
    color: var(--color-text-2);
    font-size: 13px;
}

.user-menu-panel a:hover {
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.surface-card,
.card {
    background: var(--panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: 26px;
}

.elevated-card {
    background: var(--panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.hero-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 72% 45%, rgba(92, 163, 112, .10), transparent 24rem),
        rgba(255, 255, 255, .92);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.interactive-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition:
        border-color var(--motion-standard) var(--ease-standard),
        box-shadow var(--motion-standard) var(--ease-standard),
        transform var(--motion-standard) var(--ease-standard);
}

.interactive-card:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.page-eyebrow {
    margin: 0 0 6px;
    color: var(--color-brand-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.page-title {
    margin: 0 0 6px;
    color: var(--color-text);
    font-size: clamp(28px, 4vw, 34px);
    line-height: 1.25;
    font-weight: 620;
    letter-spacing: -.02em;
}

.page-description,
.page-subtitle {
    max-width: 680px;
    margin: 0;
    color: var(--color-text-2);
    line-height: 1.75;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 17px;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    font-weight: 650;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(32, 48, 36, .08);
    transition:
        background var(--motion-micro) var(--ease-standard),
        color var(--motion-micro) var(--ease-standard),
        border-color var(--motion-micro) var(--ease-standard),
        transform var(--motion-micro) var(--ease-standard),
        box-shadow var(--motion-micro) var(--ease-standard);
}

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

.btn:active {
    transform: translateY(1px);
}

.btn.secondary,
.btn-secondary {
    background: rgba(255, 255, 255, .78);
    border-color: var(--color-border);
    color: var(--color-brand-deep);
    box-shadow: var(--shadow-xs);
}

.btn.secondary:hover,
.btn-secondary:hover {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
}

.btn.ghost,
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-2);
    box-shadow: none;
}

.btn.ghost:hover,
.btn-ghost:hover {
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.btn-danger {
    background: var(--color-danger-soft);
    border-color: rgba(181, 82, 82, .14);
    color: var(--color-danger);
    box-shadow: none;
}

.btn-danger:hover {
    background: #f8e4e4;
}

.btn.block {
    width: 100%;
}

.field {
    margin-bottom: 19px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: var(--color-text-2);
    font-size: 13px;
    font-weight: 560;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, .84);
    color: var(--text);
    border-radius: 11px;
    padding: 11px 13px;
    outline: none;
    transition: border-color var(--motion-micro) var(--ease-standard), box-shadow var(--motion-micro) var(--ease-standard), background var(--motion-micro) var(--ease-standard);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    background: #fff;
    border-color: rgba(92, 163, 112, .56);
    box-shadow: var(--shadow-focus);
}

.alert {
    margin-bottom: 18px;
    border: 1px solid rgba(181, 82, 82, .12);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--color-danger-soft);
    color: var(--color-danger);
    font-size: 14px;
    line-height: 1.6;
}

.success-box {
    margin-bottom: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 15px 16px;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
    line-height: 1.65;
    word-break: break-all;
}

.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-pill);
    padding: 4px 9px;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
    font-size: 12px;
    font-weight: 600;
}

.status-dot,
.device-presence {
    width: 8px;
    height: 8px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px currentColor;
    opacity: .82;
}

.status-pill.warning {
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.status-pill.danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.status-pill.neutral {
    background: #f1f3f1;
    color: var(--color-text-2);
}

.auth-wrap {
    width: min(calc(100% - 28px), 430px);
    margin: 0 auto;
    padding: 8vh 0 40px;
}

.auth-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 620;
    letter-spacing: -.02em;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--color-text-2);
    line-height: 1.7;
}

/* Landing */
.landing {
    padding: 56px 0 16px;
}

.landing-hero {
    min-height: 590px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    align-items: center;
    gap: clamp(44px, 8vw, 100px);
    padding: clamp(36px, 6vw, 72px);
}

.landing-copy {
    position: relative;
    z-index: 2;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--color-brand-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
}

.landing-kicker::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--color-brand);
}

.landing h1 {
    max-width: 670px;
    margin: 0;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.12;
    font-weight: 560;
    letter-spacing: -.045em;
}

.landing-copy > p {
    max-width: 590px;
    margin: 22px 0 30px;
    color: var(--color-text-2);
    font-size: 16px;
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.landing-visual {
    min-height: 390px;
    display: grid;
    place-items: center;
    position: relative;
}

.landing-orb-note {
    position: absolute;
    right: 8%;
    bottom: 10%;
    min-width: 170px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 13px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.landing-orb-note strong {
    display: block;
    margin-bottom: 2px;
    color: var(--color-text);
    font-size: 13px;
}

.landing-orb-note span {
    color: var(--color-text-2);
    font-size: 12px;
}

.landing-flow {
    padding: 62px 0 30px;
}

.section-kicker {
    margin: 0 0 10px;
    color: var(--color-brand-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
}

.section-title {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 600;
    letter-spacing: -.03em;
}

.process-line {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 38px;
}

.process-line::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 16.5%;
    right: 16.5%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-strong) 14%, var(--color-border-strong) 86%, transparent);
}

.process-step {
    position: relative;
    z-index: 1;
    text-align: center;
}

.process-node {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-brand-deep);
    box-shadow: var(--shadow-xs);
}

.process-node svg {
    width: 17px;
    height: 17px;
}

.process-step h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 620;
}

.process-step p {
    max-width: 280px;
    margin: 0 auto;
    color: var(--color-text-2);
    font-size: 13px;
    line-height: 1.75;
}

/* Presence / signed-in home */
.presence-page {
    padding: 40px 0 24px;
}

.presence-minimal {
    min-height: calc(100vh - 154px);
    display: grid;
    place-items: center;
    padding: 12px 0 28px;
}

.presence-minimal-stage {
    width: min(100%, 620px);
    min-height: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.status-title.presence-message {
    max-width: 560px;
    min-height: 1.5em;
    margin: 0 0 10px;
    padding: 0 24px;
    font-size: clamp(18px, 2.2vw, 21px);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
}

.presence-time-group {
    height: 46px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 30px;
}

.presence-time-record {
    color: var(--color-text-3);
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    transition: color 120ms ease, transform 120ms ease;
}

.presence-time-record.time-flash {
    color: var(--color-brand-deep);
    transform: scale(1.035);
}

.presence-hero {
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(390px, 1.06fr);
    align-items: center;
    gap: 48px;
    padding: clamp(34px, 6vw, 68px);
}

.presence-copy {
    max-width: 520px;
}

.presence-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--color-text-2);
    font-size: 13px;
}

.presence-eyebrow .status-dot {
    box-shadow: 0 0 0 4px rgba(92, 163, 112, .10);
}

.status-title {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 560;
    line-height: 1.16;
    letter-spacing: -.04em;
}

.presence-lead {
    max-width: 500px;
    margin: 18px 0 0;
    color: var(--color-text-2);
    font-size: 15px;
    line-height: 1.85;
}

.presence-facts {
    display: grid;
    gap: 0;
    margin-top: 32px;
    border-top: 1px solid var(--color-border);
}

.presence-fact {
    min-height: 64px;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
}

.presence-fact-label {
    color: var(--color-text-3);
    font-size: 12px;
}

.presence-fact-value {
    color: var(--color-text);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.presence-fact-value a {
    font-weight: 600;
}

.presence-action-note {
    margin-top: 20px;
    color: var(--color-text-3);
    font-size: 12px;
    line-height: 1.65;
}

.presence-orb-wrap {
    min-height: 430px;
    display: grid;
    place-items: center;
    position: relative;
}

.safety-orb {
    --orb-color: var(--color-brand);
    position: relative;
    z-index: 2;
    width: min(31vw, 330px);
    min-width: 260px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--orb-color) 18%, transparent);
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, .98), rgba(255, 255, 255, .82) 37%, color-mix(in srgb, var(--orb-color) 8%, transparent) 74%, color-mix(in srgb, var(--orb-color) 13%, transparent));
    color: var(--orb-color);
    box-shadow:
        0 16px 54px rgba(32, 48, 36, .07),
        inset 0 1px 0 rgba(255, 255, 255, .92);
    transition:
        transform var(--motion-micro) var(--ease-standard),
        box-shadow var(--motion-standard) var(--ease-standard),
        border-color var(--motion-standard) var(--ease-standard);
}

button.safety-orb {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

button.safety-orb:hover {
    border-color: color-mix(in srgb, var(--orb-color) 26%, transparent);
    box-shadow:
        0 20px 62px rgba(32, 48, 36, .09),
        0 0 0 16px color-mix(in srgb, var(--orb-color) 2.5%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}

button.safety-orb:active {
    transform: scale(.98);
}

button.safety-orb:disabled {
    cursor: wait;
    opacity: .82;
}

.safety-orb::before,
.safety-orb::after {
    content: "";
    position: absolute;
    inset: -24px;
    z-index: -1;
    border: 1px solid color-mix(in srgb, var(--orb-color) 9%, transparent);
    border-radius: inherit;
    pointer-events: none;
}

.safety-orb::after {
    inset: -56px;
    border-color: color-mix(in srgb, var(--orb-color) 5%, transparent);
}

.safety-orb.normal {
    --orb-color: var(--color-brand);
    animation: orbBreath 5.8s var(--ease-standard) infinite;
}

.safety-orb.warning,
.safety-orb.remind_user,
.safety-orb.waiting_confirm {
    --orb-color: var(--color-warning);
}

.safety-orb.danger,
.safety-orb.contact_guardian {
    --orb-color: var(--color-danger);
}

.safety-orb.neutral,
.safety-orb.disabled,
.safety-orb.awaiting_first_checkin,
.safety-orb.unknown {
    --orb-color: #707e74;
}

.safety-orb.pulse .orb-ripple {
    animation: okRipple 1s var(--ease-standard);
}

.orb-ripple {
    position: absolute;
    inset: 0;
    border: 1px solid color-mix(in srgb, var(--orb-color) 38%, transparent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.orb-content {
    display: grid;
    place-items: center;
    text-align: center;
}

.orb-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border: 1px solid color-mix(in srgb, var(--orb-color) 14%, transparent);
    border-radius: 14px;
    background: rgba(255, 255, 255, .56);
    color: var(--orb-color);
}

.orb-mark svg {
    width: 21px;
    height: 21px;
}

.ok-main {
    display: block;
    color: var(--orb-color);
    font-size: 30px;
    font-weight: 720;
    letter-spacing: .02em;
}

.ok-sub {
    display: block;
    margin-top: 6px;
    color: var(--color-text-2);
    font-size: 12px;
    font-weight: 560;
}

.orb-caption {
    position: absolute;
    bottom: 20px;
    z-index: 3;
    color: var(--color-text-3);
    font-size: 11px;
    letter-spacing: .08em;
}

.guest-orb {
    width: min(28vw, 300px);
    min-width: 250px;
}

.guest-orb .ok-main {
    font-size: 25px;
}

@keyframes orbBreath {
    0%, 100% {
        box-shadow: 0 16px 54px rgba(32, 48, 36, .07), 0 0 0 0 rgba(92, 163, 112, 0), inset 0 1px 0 rgba(255, 255, 255, .92);
    }
    50% {
        box-shadow: 0 18px 58px rgba(32, 48, 36, .08), 0 0 0 12px rgba(92, 163, 112, .025), inset 0 1px 0 rgba(255, 255, 255, .94);
    }
}

@keyframes okRipple {
    0% { transform: scale(1); opacity: .55; }
    100% { transform: scale(1.52); opacity: 0; }
}

.install-btn {
    margin-top: 18px;
    display: none;
}

/* Guardian UI-3 */
.guardian-page-header {
    margin-top: 20px;
    margin-bottom: 24px;
}

.guardian-status-hero {
    --guardian-accent: var(--color-brand);
    padding: 30px 32px 28px;
}

.guardian-status-hero.guardian-tone-warning {
    --guardian-accent: var(--color-warning);
}

.guardian-status-hero.guardian-tone-danger {
    --guardian-accent: var(--color-danger);
}

.guardian-status-hero.guardian-tone-neutral {
    --guardian-accent: #707e74;
}

.guardian-status-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 36px;
}

.guardian-status-kicker {
    margin: 0 0 10px;
    color: var(--color-text-3);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .08em;
}

.guardian-status-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.guardian-status-orb {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 5px solid color-mix(in srgb, var(--guardian-accent) 18%, transparent);
    border-radius: 50%;
    background: var(--guardian-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--guardian-accent) 22%, transparent);
}

.guardian-status-heading strong {
    display: block;
    color: var(--color-text);
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 620;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.guardian-status-heading span {
    display: block;
    margin-top: 4px;
    color: var(--color-text-3);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .09em;
}

.guardian-status-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, auto));
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .66);
}

.guardian-status-facts > div {
    min-width: 128px;
    padding: 13px 16px;
}

.guardian-status-facts > div + div {
    border-left: 1px solid var(--color-border);
}

.guardian-status-facts span,
.guardian-status-facts strong {
    display: block;
}

.guardian-status-facts span {
    margin-bottom: 3px;
    color: var(--color-text-3);
    font-size: 11px;
}

.guardian-status-facts strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 620;
    font-variant-numeric: tabular-nums;
}

.guardian-rail {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 34px;
}

.guardian-rail::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: var(--color-border-strong);
}

.guardian-rail-step {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 9px;
    color: var(--color-text-3);
}

.guardian-rail-node {
    width: 15px;
    height: 15px;
    border: 3px solid var(--color-surface);
    border-radius: 50%;
    background: #cbd4cd;
    box-shadow: 0 0 0 1px var(--color-border-strong);
}

.guardian-rail-step.completed .guardian-rail-node,
.guardian-rail-step.current .guardian-rail-node {
    background: var(--guardian-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--guardian-accent) 28%, transparent);
}

.guardian-rail-step.current .guardian-rail-node {
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--guardian-accent) 32%, transparent),
        0 0 0 5px color-mix(in srgb, var(--guardian-accent) 10%, transparent);
}

.guardian-rail-step.completed,
.guardian-rail-step.current {
    color: var(--color-text);
}

.guardian-rail-label {
    font-size: 12px;
    font-weight: 570;
}

.guardian-connection-card {
    padding: 24px 26px;
}

.guardian-section-title {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.guardian-section-title h2,
.guardian-section-title .card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 620;
}

.guardian-section-title .help-text {
    margin-top: 4px;
}

.guardian-section-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    background: var(--color-bg-elevated);
    color: var(--color-brand-deep);
}

.guardian-section-icon svg {
    width: 18px;
    height: 18px;
}

.guardian-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 18px;
}

.guardian-rule-card,
.guardian-add-card {
    padding: 24px 26px;
}

.guardian-rule-card > form,
.guardian-add-card > form {
    margin-top: 20px;
}

.guardian-rule-card form .toggle-row,
.guardian-rule-card form .field {
    min-height: 58px;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: center;
    gap: 18px;
    border-top: 1px solid var(--color-border);
}

.guardian-rule-card form .toggle-row {
    display: flex;
    justify-content: space-between;
}

.guardian-rule-card form .toggle-row input {
    order: 2;
    width: 38px;
    height: 22px;
    appearance: none;
    position: relative;
    border: 0;
    border-radius: var(--radius-pill);
    background: #d9dfda;
    cursor: pointer;
    transition: background var(--motion-micro) var(--ease-standard);
}

.guardian-rule-card form .toggle-row input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(32, 48, 36, .18);
    transition: transform var(--motion-micro) var(--ease-standard);
}

.guardian-rule-card form .toggle-row input:checked {
    background: var(--color-brand);
}

.guardian-rule-card form .toggle-row input:checked::after {
    transform: translateX(16px);
}

.guardian-rule-card form .field label {
    margin: 0;
    color: var(--color-text);
    font-size: 13px;
}

.guardian-rule-card form .field input {
    min-height: 38px;
    padding: 8px 10px;
    text-align: right;
    background: var(--color-bg-elevated);
}

.guardian-rule-card form > .btn {
    margin-top: 18px;
}

.guardian-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 16px;
}

.guardian-contact-card {
    padding: 22px;
}

.guardian-contact-card .device-name {
    margin-bottom: 3px;
}

.guardian-contact-card .contact-method-item {
    background: var(--color-bg-elevated);
}

.guardian-contact-card .contact-method-add {
    margin-top: 16px;
}

.guardian-empty-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-bg-elevated);
    color: var(--color-brand-deep);
}

.guardian-empty-icon svg {
    width: 20px;
    height: 20px;
}

.empty-state strong {
    display: block;
    color: var(--color-text);
    font-size: 15px;
}

.empty-state p {
    max-width: 440px;
    margin: 6px auto 0;
    font-size: 13px;
    line-height: 1.7;
}

.guardian-connection-card .push-actions {
    justify-content: flex-start;
}

.guardian-connection-card .btn.ghost {
    padding-inline: 12px;
}

/* Notification UI-4 */
.notification-page-header {
    margin-top: 20px;
    margin-bottom: 22px;
}

.notification-segmented {
    margin-bottom: 20px;
}

.notification-policy {
    margin-bottom: 8px;
    padding: 18px 20px;
    border-left: 3px solid color-mix(in srgb, var(--color-brand) 45%, transparent);
    box-shadow: none;
    color: var(--color-text-2);
    font-size: 13px;
}

.notification-policy strong {
    color: var(--color-text);
    font-weight: 650;
}

.notification-channel-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.notification-channel-row {
    padding: 18px 20px;
    box-shadow: none;
}

.notification-channel-row .channel-card-head {
    align-items: center;
}

.notification-channel-row .channel-card-head > div:first-child {
    min-width: 0;
}

.notification-channel-row .channel-meta {
    margin-top: 6px;
}

.notification-channel-row > .help-text {
    margin: 8px 0 0;
    max-width: 820px;
}

.notification-channel-row .push-actions {
    margin-top: 12px;
}

.channel-config {
    margin-top: 14px;
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}

.channel-config > summary {
    width: max-content;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--color-brand-deep);
    font-size: 13px;
    font-weight: 620;
    cursor: pointer;
    list-style: none;
}

.channel-config > summary::-webkit-details-marker {
    display: none;
}

.channel-config > summary::after {
    content: "＋";
    color: var(--color-text-3);
    font-size: 14px;
    font-weight: 500;
}

.channel-config[open] > summary::after {
    content: "−";
}

.channel-config .channel-form {
    max-width: 720px;
    margin-top: 12px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-bg-elevated);
}

.channel-config .inline-form {
    margin-top: 10px;
}

.notification-about {
    padding: 20px 22px;
}

.notification-about .card-title {
    margin-bottom: 8px;
    font-size: 15px;
}

.notification-about .help-text {
    margin-top: 0;
}

.notification-center .notice-list {
    gap: 8px;
}

.notification-center .notice-item {
    box-shadow: none;
}

/* Device UI-5 */
.device-page-header {
    margin-top: 20px;
    margin-bottom: 22px;
}

.device-presence-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.device-presence-card {
    padding: 22px;
}

.device-card-head {
    display: flex;
    align-items: center;
    gap: 13px;
}

.device-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--color-border);
    border-radius: 13px;
    background: var(--color-bg-elevated);
    color: var(--color-brand-deep);
}

.device-icon svg {
    width: 20px;
    height: 20px;
}

.device-status-line {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 2px;
    color: var(--color-text-2);
    font-size: 12px;
}

.device-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #aeb8b0;
}

.device-status-line.online {
    color: var(--color-brand-deep);
}

.device-status-line.online .device-status-dot {
    background: var(--color-brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand) 10%, transparent);
}

.device-status-line.offline {
    color: var(--color-text-3);
}

.device-facts {
    margin: 20px 0 0;
    border-top: 1px solid var(--color-border);
}

.device-facts > div {
    min-height: 48px;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
}

.device-facts dt {
    color: var(--color-text-3);
    font-size: 12px;
}

.device-facts dd {
    margin: 0;
    color: var(--color-text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.device-sn {
    color: var(--color-text-2) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px !important;
    word-break: break-all;
}

.device-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.device-empty {
    padding-block: 42px;
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.device-technical-note {
    padding: 20px 22px;
    background: rgba(255, 255, 255, .62);
    box-shadow: none;
}

.device-technical-note .card-title {
    margin-bottom: 8px;
    font-size: 15px;
}

/* UI-6: Activity / Auth / Bind / Setup */
.activity-page-header,
.bind-page-header,
.setup-page-header {
    margin-top: 20px;
    margin-bottom: 22px;
}

.activity-table-card {
    margin-top: 4px;
}

.activity-table td:first-child {
    color: var(--color-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.activity-table .badge {
    background: var(--color-bg-elevated);
    color: var(--color-text-2);
}

.activity-timeline {
    display: none;
}

/* My hub */
.my-center {
    max-width: 1200px;
}

.my-page-header {
    margin-top: 20px;
}

.my-profile {
    width: min(100%, 720px);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 20px 22px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
}

.my-profile-avatar {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
}

.my-profile-avatar svg,
.my-menu-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.my-profile-copy {
    min-width: 0;
}

.my-profile-copy strong,
.my-profile-copy span {
    display: block;
}

.my-profile-copy strong {
    color: var(--color-text);
    font-size: 17px;
    font-weight: 680;
}

.my-profile-copy span {
    margin-top: 3px;
    overflow: hidden;
    color: var(--color-text-3);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-menu {
    width: min(100%, 720px);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
}

.my-menu-row {
    width: 100%;
    min-height: 72px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--motion-micro) var(--ease-standard);
}

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

.my-menu-row:hover {
    background: var(--color-bg-elevated);
}

.my-menu-row:active {
    background: color-mix(in srgb, var(--color-brand-soft) 56%, white);
}

.my-menu-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--color-bg-elevated);
    color: var(--color-brand-deep);
}

.my-menu-copy {
    min-width: 0;
}

.my-menu-copy strong,
.my-menu-copy small {
    display: block;
}

.my-menu-copy strong {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 650;
}

.my-menu-copy small {
    margin-top: 3px;
    color: var(--color-text-3);
    font-size: 11px;
    line-height: 1.45;
}

.my-menu-tail {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.my-menu-chevron {
    color: var(--color-text-3);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.my-row-status {
    max-width: 120px;
    overflow: hidden;
    color: var(--color-text-3);
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-row-status.is-on {
    color: var(--color-brand-deep);
}

.my-unread-badge {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--color-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

.my-install-row[hidden] {
    display: none !important;
}

@media (display-mode: standalone) {
    [data-pwa-install] {
        display: none !important;
    }
}

.my-install-help {
    display: block;
    margin-top: 6px;
    color: var(--color-brand-deep);
    font-size: 11px;
    line-height: 1.55;
}

.my-secondary-actions {
    width: min(100%, 720px);
    padding: 18px 4px 0;
    text-align: center;
}

.my-secondary-actions a {
    color: var(--color-text-3);
    font-size: 12px;
}

.mobile-back-link,
.mobile-subpage-title,
.mobile-header-action {
    display: none;
}

.device-list-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
}

.device-list-row .device-icon {
    margin: 0;
}

.device-list-copy {
    min-width: 0;
}

.device-list-copy .device-name,
.device-list-copy .device-status-line,
.device-list-last {
    display: block;
}

.device-list-copy .device-name {
    margin: 0 0 4px;
}

.device-list-last {
    margin-top: 6px;
    overflow: hidden;
    color: var(--color-text-3);
    font-size: 11px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-list-chevron {
    color: var(--color-text-3);
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
}

.device-detail-center {
    max-width: 1200px;
}

.device-detail-header {
    max-width: 720px;
    margin-top: 20px;
}

.device-detail-hero {
    width: min(100%, 720px);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
}

.device-detail-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 17px;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
}

.device-detail-icon svg {
    width: 25px;
    height: 25px;
    stroke-width: 1.7;
}

.device-detail-hero strong {
    display: block;
    margin-top: 5px;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 650;
}

.native-settings-list {
    width: min(100%, 720px);
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
}

.native-settings-row {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
}

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

.native-settings-row > span {
    color: var(--color-text-2);
    font-size: 13px;
}

.native-settings-row > strong {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.native-danger-zone {
    width: min(100%, 720px);
    margin-top: 18px;
    text-align: center;
}

.native-danger-zone button {
    width: 100%;
    min-height: 48px;
    border: 1px solid color-mix(in srgb, var(--color-danger) 22%, transparent);
    border-radius: 14px;
    background: rgba(255, 255, 255, .75);
    color: var(--color-danger);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.native-danger-zone p {
    margin: 7px 0 0;
    color: var(--color-text-3);
    font-size: 10px;
}

.native-hub-list {
    width: min(100%, 760px);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
}

.native-hub-row {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
    color: inherit;
    text-decoration: none;
}

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

.native-hub-row > span:first-child {
    min-width: 0;
}

.native-hub-row strong,
.native-hub-row small {
    display: block;
}

.native-hub-row strong {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 650;
}

.native-hub-row small {
    margin-top: 3px;
    color: var(--color-text-3);
    font-size: 11px;
    line-height: 1.45;
}

.native-hub-tail {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--color-text-3);
    font-size: 11px;
}

.native-hub-tail b {
    color: var(--color-text-3);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.native-disclosure {
    overflow: hidden;
}

.native-disclosure > summary {
    list-style: none;
}

.native-disclosure > summary::-webkit-details-marker {
    display: none;
}

.native-disclosure-summary {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    user-select: none;
}

.native-disclosure-summary > span:first-child {
    min-width: 0;
}

.native-disclosure-summary strong,
.native-disclosure-summary small {
    display: block;
}

.native-disclosure-summary strong {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 650;
}

.native-disclosure-summary small {
    margin-top: 3px;
    color: var(--color-text-3);
    font-size: 11px;
    line-height: 1.45;
}

.native-disclosure-tail {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.native-disclosure-chevron {
    flex: 0 0 auto;
    color: var(--color-text-3);
    font-size: 25px;
    font-weight: 300;
    line-height: 1;
    transition: transform var(--motion-micro) var(--ease-standard);
}

.native-disclosure[open] .native-disclosure-chevron {
    transform: rotate(90deg);
}

.native-disclosure-body {
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
}

@media (min-width: 921px) {
    .native-disclosure:not([open]) > .native-disclosure-body {
        display: block;
    }

    .native-disclosure:not([open]) > summary .native-disclosure-chevron {
        transform: rotate(90deg);
    }
}

.auth-page {
    min-height: 100vh;
    background: var(--color-bg);
}

.auth-shell {
    width: min(calc(100% - 40px), 1120px);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    align-items: stretch;
    gap: clamp(36px, 7vw, 90px);
}

.auth-brand-panel {
    position: relative;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 0;
    overflow: hidden;
}

.auth-brand-copy {
    position: relative;
    z-index: 2;
    max-width: 560px;
    margin: auto 0;
    padding: 70px 0;
}

.auth-brand-copy h2 {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.18;
    font-weight: 560;
    letter-spacing: -.045em;
}

.auth-brand-copy > p:last-child {
    max-width: 500px;
    margin: 20px 0 0;
    color: var(--color-text-2);
    line-height: 1.85;
}

.auth-orb {
    position: absolute;
    right: 7%;
    bottom: 13%;
    width: 230px;
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--color-brand) 10%, transparent);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 30%, rgba(255,255,255,.9), color-mix(in srgb, var(--color-brand) 8%, transparent) 68%, color-mix(in srgb, var(--color-brand) 13%, transparent));
    opacity: .72;
}

.auth-orb::before,
.auth-orb::after {
    content: "";
    position: absolute;
    inset: -30px;
    border: 1px solid color-mix(in srgb, var(--color-brand) 6%, transparent);
    border-radius: 50%;
}

.auth-orb::after {
    inset: -66px;
    border-color: color-mix(in srgb, var(--color-brand) 3%, transparent);
}

.auth-form-panel {
    display: grid;
    place-items: center;
    padding: 48px 0;
}

.auth-card {
    width: min(100%, 430px);
    padding: 34px;
    box-shadow: var(--shadow-sm);
}

.auth-card .auth-title {
    font-size: 30px;
}

.auth-card .auth-subtitle {
    margin-bottom: 28px;
}

.auth-foot {
    margin: 20px 0 0;
    color: var(--color-text-2);
    text-align: center;
    font-size: 13px;
}

.auth-foot a {
    font-weight: 650;
}

.compact-header {
    margin-bottom: 20px;
}

.bind-page-header,
.setup-page-header {
    max-width: 820px;
}

.bind-form-card,
.bind-result-card {
    width: min(100%, 680px);
    margin-top: 8px;
    padding: 28px;
}

.bind-form-intro {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.bind-form-intro strong {
    display: block;
    font-size: 15px;
}

.bind-form-intro p {
    margin: 3px 0 0;
    color: var(--color-text-2);
    font-size: 12px;
}

.setup-flow {
    width: min(100%, 860px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 28px;
}

.setup-flow .setup-step {
    min-height: 118px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 18px;
    align-content: center;
    padding: 22px 24px;
}

.setup-flow .step-number {
    grid-row: 1 / span 3;
    margin: 0;
    align-self: start;
}

.setup-flow .card-title {
    margin: 0 0 4px;
    font-size: 16px;
}

.setup-flow .help-text {
    margin: 0;
}

.setup-flow .btn {
    width: max-content;
    margin-top: 12px;
}

.setup-step-final {
    border-color: color-mix(in srgb, var(--color-brand) 22%, transparent);
    background: linear-gradient(90deg, rgba(255,255,255,.98), color-mix(in srgb, var(--color-brand) 5%, white));
}

.setup-status-note {
    width: min(100%, 860px);
    padding: 20px 22px;
    box-shadow: none;
}

.setup-status-note .card-title {
    margin-bottom: 8px;
    font-size: 15px;
}

/* Existing staged pages: refreshed material, unchanged structure. */
.table-card {
    overflow: hidden;
    padding: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    font-size: 14px;
}

.table th {
    color: var(--color-text-2);
    font-weight: 550;
    background: var(--color-bg-elevated);
}

.table tr:last-child td {
    border-bottom: 0;
}

.table tbody tr {
    transition: background var(--motion-micro) var(--ease-standard);
}

.table tbody tr:hover {
    background: rgba(240, 245, 241, .55);
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.device-card {
    padding: 20px;
}

.device-name {
    margin: 0 0 7px;
    font-size: 17px;
}

.device-meta {
    color: var(--color-text-2);
    font-size: 13px;
    line-height: 1.7;
    word-break: break-all;
}

.code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #f4f7f4;
    border-radius: var(--radius-xs);
    padding: 2px 6px;
    font-size: 12px;
}

.section {
    margin-top: 22px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head h2 {
    margin: 0;
    font-size: 18px;
}

.page-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.card-title {
    margin: 0 0 18px;
    font-size: 18px;
}

.card-actions {
    margin-top: 16px;
}

.inline-form {
    margin-top: 12px;
}

.danger-text {
    color: var(--color-danger) !important;
}

.help-text {
    margin: 12px 0 0;
    color: var(--color-text-2);
    font-size: 13px;
    line-height: 1.7;
}

.push-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

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

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--color-text);
}

.toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-brand);
}

.status-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.status-label {
    margin-bottom: 4px;
    color: var(--color-text-2);
    font-size: 12px;
}

.setup-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.setup-step {
    position: relative;
}

.step-number {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
    font-weight: 700;
    font-size: 13px;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 16px;
}

.channel-card {
    padding: 22px;
}

.channel-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.channel-card h3 {
    margin: 0;
    font-size: 17px;
}

.channel-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.badge-muted,
.channel-state.off {
    background: #f1f3f1;
    color: var(--color-text-2);
}

.channel-state {
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
    padding: 5px 9px;
    font-size: 12px;
}

.channel-state.on {
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
}

.channel-form {
    margin-top: 18px;
}

.compact-field {
    margin-bottom: 12px;
}

.compact-field input {
    padding: 10px 12px;
    font-size: 14px;
}

.priority-field {
    max-width: 220px;
}

.config-mask {
    margin: -2px 0 12px;
    color: var(--color-text-2);
    font-size: 12px;
    line-height: 1.6;
    word-break: break-all;
}

.audience-tabs,
.segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    background: var(--color-surface-soft);
    border-radius: 13px;
}

.audience-tabs a,
.segmented-item {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--color-text-2);
    font-size: 13px;
}

.audience-tabs a.active,
.segmented-item.active {
    background: var(--color-surface);
    color: var(--color-brand-deep);
    box-shadow: var(--shadow-xs);
}

.notification-policy {
    padding: 18px 20px;
    line-height: 1.7;
}

.notice-list {
    display: grid;
    gap: 10px;
}

.notice-item {
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.notice-item h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.notice-item p {
    margin: 0;
    color: var(--color-text-2);
    line-height: 1.65;
    font-size: 13px;
}

.contact-method-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.contact-method-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    background: var(--color-bg-elevated);
}

.contact-method-item strong {
    font-size: 13px;
    font-weight: 600;
}

.contact-method-add {
    margin-top: 14px;
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}

.contact-method-add summary {
    cursor: pointer;
    color: var(--color-brand-deep);
    font-size: 13px;
    font-weight: 600;
}

.contact-method-add[open] summary {
    margin-bottom: 12px;
}

.empty,
.empty-state {
    padding: 34px;
    text-align: center;
    color: var(--color-text-2);
}

.footer-note {
    text-align: center;
    color: var(--color-text-3);
    font-size: 10px;
    letter-spacing: .24em;
    padding: 26px 0 8px;
}

/* Legacy homepage selectors retained for safe rollback/compatibility. */
.hero {
    min-height: calc(100vh - 115px);
    display: grid;
    place-items: center;
    text-align: center;
    padding-bottom: 50px;
}

.hero-inner {
    width: min(100%, 560px);
}

.checkin-page {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 70px;
}

.ok-button {
    position: relative;
    width: min(66vw, 290px);
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    color: var(--color-brand);
}

@media (max-width: 920px) {
    .app-header,
    .topbar {
        grid-template-columns: 1fr auto;
    }

    .app-nav,
    .nav {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .app-nav::-webkit-scrollbar,
    .nav::-webkit-scrollbar {
        display: none;
    }

    .landing-hero,
    .presence-hero {
        grid-template-columns: 1fr;
    }

    .guardian-status-summary {
        flex-direction: column;
    }

    .guardian-status-facts {
        width: 100%;
    }

    .guardian-settings-grid {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        min-height: auto;
    }

    .landing-visual {
        min-height: 350px;
    }

    .presence-copy {
        max-width: 680px;
    }

    .presence-orb-wrap {
        min-height: 390px;
    }

    .safety-orb {
        width: min(58vw, 320px);
    }
}

@media (max-width: 920px) {
    .app-shell,
    .shell {
        width: min(calc(100% - 32px), 1200px);
        padding-top: 10px;
    }

    .app-header,
    .topbar {
        min-height: 58px;
        gap: 10px;
        margin-bottom: 12px;
    }

    .brand {
        font-size: 12px;
        letter-spacing: .05em;
    }

    .brand-mark {
        width: 28px;
        height: 28px;
        border-radius: 9px;
    }

    .app-nav,
    .nav {
        margin-inline: -2px;
        gap: 2px;
    }

    .nav a,
    .nav-item {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .nav-icon {
        display: none;
    }

    .header-icon-btn {
        width: 40px;
        height: 40px;
    }

    .user-menu-label {
        display: none;
    }

    .user-menu summary {
        width: 40px;
        height: 40px;
        justify-content: center;
        padding: 5px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    /* Mobile App shell: top app bar + native-style bottom tab bar. */
    .app-mode {
        overscroll-behavior-y: contain;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .app-mode .app-shell {
        width: min(calc(100% - 24px), 1200px);
        padding-top: 0;
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .app-mode .app-header {
        position: sticky;
        top: 0;
        z-index: 60;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: calc(54px + env(safe-area-inset-top));
        margin: 0 -12px 12px;
        padding: max(7px, env(safe-area-inset-top)) 12px 7px;
        border-bottom: 1px solid color-mix(in srgb, var(--color-border) 82%, transparent);
        background: color-mix(in srgb, var(--color-bg) 94%, transparent);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .app-mode .app-header .brand {
        max-width: calc(100vw - 104px);
        overflow: hidden;
        gap: 9px;
    }

    .app-mode .app-header .brand > span:last-child {
        font-size: 0;
        overflow: visible;
        white-space: nowrap;
    }

    .app-mode .app-header .brand > span:last-child::after {
        content: attr(data-mobile-brand);
        color: var(--color-text);
        font-size: 15px;
        font-weight: 680;
        letter-spacing: -.01em;
    }

    .app-mode .app-header .brand-mark {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    .app-subpage .app-header .brand {
        display: none;
    }

    .app-subpage .mobile-back-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-height: 38px;
        color: var(--color-brand-deep);
        font-size: 13px;
        font-weight: 620;
        -webkit-tap-highlight-color: transparent;
    }

    .app-subpage .mobile-back-link > span {
        margin-top: -2px;
        font-size: 28px;
        font-weight: 300;
        line-height: .8;
    }

    .app-subpage .header-actions {
        display: none;
    }

    .app-subpage .app-header {
        position: sticky;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }

    .app-subpage .mobile-subpage-title {
        position: absolute;
        left: 50%;
        display: block;
        max-width: 46vw;
        overflow: hidden;
        color: var(--color-text);
        font-size: 15px;
        font-weight: 680;
        letter-spacing: -.01em;
        text-overflow: ellipsis;
        white-space: nowrap;
        transform: translateX(-50%);
    }

    .app-subpage .mobile-header-action {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        justify-self: end;
        border-radius: 11px;
        background: rgba(255, 255, 255, .58);
        color: var(--color-brand-deep);
        font-size: 24px;
        font-weight: 320;
        line-height: 1;
        -webkit-tap-highlight-color: transparent;
    }

    .app-subpage .mobile-header-action:active {
        transform: scale(.94);
    }

    .app-subpage .page-header {
        display: none;
    }

    .onboarding-subpage .app-shell {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    .app-mode .header-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .app-mode .header-icon-btn {
        display: none;
    }

    .app-mode .user-menu summary {
        border-color: transparent;
        background: rgba(255, 255, 255, .54);
        box-shadow: none;
    }

    .app-mode .nav-icon {
        display: block;
    }

    .app-mode .app-nav-auth {
        display: none;
    }

    .app-mode .mobile-tabbar {
        position: fixed;
        z-index: 100;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        min-height: calc(62px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        gap: 0;
        margin: 0;
        padding: 3px 7px max(4px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--color-border);
        background: rgba(255, 255, 255, .975);
        box-shadow: 0 -5px 22px rgba(32, 48, 36, .045);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .app-mode .mobile-tab {
        position: relative;
        min-width: 0;
        min-height: 54px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 4px 2px 2px;
        border-radius: 12px;
        color: var(--color-text-3);
        font-size: 10px;
        font-weight: 570;
        line-height: 1.15;
        transition:
            color var(--motion-micro) var(--ease-standard),
            transform 100ms var(--ease-standard);
        -webkit-tap-highlight-color: transparent;
    }

    .app-mode .mobile-tab:active {
        transform: scale(.94);
    }

    .app-mode .mobile-tab:hover {
        color: var(--color-text-2);
    }

    .app-mode .mobile-tab .nav-icon {
        width: 21px;
        height: 21px;
        stroke-width: 1.65;
        transition: transform var(--motion-micro) var(--ease-standard);
    }

    .app-mode .mobile-tab.active {
        color: var(--color-brand-deep);
        font-weight: 650;
    }

    .app-mode .mobile-tab.active::after {
        content: "";
        position: absolute;
        top: 1px;
        left: 50%;
        width: 22px;
        height: 2px;
        border-radius: var(--radius-pill);
        background: var(--color-brand);
        transform: translateX(-50%);
    }

    .app-mode .mobile-tab.active .nav-icon {
        transform: translateY(-1px);
    }

    .app-mode .mobile-tab .nav-tab-badge {
        position: absolute;
        top: 4px;
        left: calc(50% + 7px);
        min-width: 16px;
        height: 16px;
        display: grid;
        place-items: center;
        padding: 0 4px;
        border: 2px solid #fff;
        border-radius: var(--radius-pill);
        background: var(--color-danger);
        color: #fff;
        font-size: 8px;
        font-weight: 700;
        line-height: 1;
    }

    .app-mode .page-eyebrow {
        display: none;
    }

    .app-mode .page-title {
        margin-bottom: 4px;
        font-size: clamp(23px, 6.6vw, 27px);
        font-weight: 650;
        letter-spacing: -.025em;
    }

    .app-mode .page-description,
    .app-mode .page-subtitle {
        max-width: 94%;
        color: var(--color-text-3);
        font-size: 12px;
        line-height: 1.6;
    }

    .app-mode .page-header {
        gap: 12px;
        margin-top: 2px;
        margin-bottom: 16px;
    }

    .app-mode .page-actions .btn {
        min-height: 38px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 12px;
    }

    .app-mode .section {
        margin-top: 24px;
    }

    .app-mode .section-head {
        margin-bottom: 10px;
    }

    .app-mode .section-head h2 {
        font-size: 15px;
        font-weight: 650;
    }

    .app-mode .section-head .help-text {
        margin-top: 3px;
        font-size: 11px;
        line-height: 1.55;
    }

    .app-mode .alert,
    .app-mode .success-box {
        display: grid;
        grid-template-columns: 20px minmax(0, 1fr);
        align-items: start;
        gap: 9px;
        margin: 0 0 12px;
        padding: 11px 12px;
        border-radius: 13px;
        font-size: 11px;
        line-height: 1.55;
        word-break: break-word;
    }

    .app-mode .alert::before,
    .app-mode .success-box::before {
        width: 20px;
        height: 20px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        font-size: 11px;
        font-weight: 760;
        line-height: 1;
    }

    .app-mode .alert::before {
        content: "!";
        background: color-mix(in srgb, var(--color-danger) 12%, white);
        color: var(--color-danger);
    }

    .app-mode .success-box::before {
        content: "✓";
        background: color-mix(in srgb, var(--color-brand) 13%, white);
        color: var(--color-brand-deep);
    }

    .app-mode .success-box a {
        color: var(--color-brand-deep);
        font-weight: 650;
    }

    .app-mode .empty-state {
        padding: 28px 16px;
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }

    .app-mode .empty-state p {
        max-width: 320px;
        font-size: 11px;
        line-height: 1.6;
    }

    .app-mode button,
    .app-mode a,
    .app-mode summary,
    .app-mode input,
    .app-mode select {
        touch-action: manipulation;
    }

    .my-page-header {
        margin-top: 2px;
        margin-bottom: 14px;
    }

    .my-profile {
        margin-bottom: 12px;
        padding: 16px;
        border-radius: 16px;
        box-shadow: none;
    }

    .my-profile-avatar {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .my-profile-copy strong {
        font-size: 15px;
    }

    .my-menu {
        border-radius: 16px;
    }

    .my-menu-row {
        min-height: 68px;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 11px;
        padding: 12px 14px;
        -webkit-tap-highlight-color: transparent;
    }

    .my-menu-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .my-menu-copy strong {
        font-size: 13px;
    }

    .my-menu-copy small {
        font-size: 10px;
    }

    .my-secondary-actions {
        padding-top: 16px;
    }

    .app-mode .footer-note {
        display: none;
    }

    .surface-card,
    .card {
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .landing {
        padding-top: 14px;
    }

    .landing-hero,
    .presence-hero {
        gap: 26px;
        padding: 28px 20px;
        border-radius: 22px;
    }

    .home-screen {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .home-screen .app-shell {
        height: 100dvh;
        min-height: 0;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
        box-sizing: border-box;
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .home-screen .app-header {
        margin-bottom: 0;
    }

    .presence-minimal {
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }

    .presence-minimal-stage {
        width: 100%;
        height: 100%;
        min-height: 0;
        justify-content: center;
        transform: translateY(-18px);
    }

    .presence-minimal .safety-orb {
        width: min(66.6vw, 280px);
        min-width: 0;
        max-width: 280px;
    }

    .status-title.presence-message {
        max-width: 100%;
        margin-bottom: 8px;
        padding: 0 28px;
        font-size: 19px;
        font-weight: 400;
        line-height: 1.5;
        letter-spacing: 0;
    }

    .presence-time-group {
        height: 44px;
        margin-bottom: 28px;
    }

    .presence-time-record {
        font-size: 12px;
    }

    .guardian-page-header,
    .notification-page-header,
    .device-page-header,
    .activity-page-header,
    .bind-page-header,
    .setup-page-header {
        margin-top: 14px;
    }

    .guardian-status-hero {
        padding: 20px 17px 18px;
        border-radius: 18px;
        box-shadow: none;
    }

    .guardian-status-kicker {
        margin-bottom: 8px;
        font-size: 10px;
        letter-spacing: .07em;
    }

    .guardian-status-heading {
        gap: 10px;
    }

    .guardian-status-heading strong {
        font-size: 22px;
    }

    .guardian-status-heading span {
        display: none;
    }

    .guardian-native-hub {
        margin-top: 12px;
        border-radius: 16px;
    }

    .native-hub-row {
        min-height: 62px;
        padding: 11px 14px;
        -webkit-tap-highlight-color: transparent;
    }

    .native-hub-row:active {
        background: color-mix(in srgb, var(--color-brand-soft) 45%, white);
    }

    .native-hub-row strong {
        font-size: 13px;
    }

    .native-hub-row small,
    .native-hub-tail {
        font-size: 10px;
    }

    #guardian-push,
    #guardian-rules,
    #guardian-contacts {
        scroll-margin-top: 72px;
    }

    .guardian-status-facts {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 4px;
    }

    .guardian-status-facts > div {
        min-width: 0;
        padding: 10px 8px;
        text-align: center;
    }

    .guardian-status-facts > div + div {
        border-left: 1px solid var(--color-border);
        border-top: 0;
    }

    .guardian-status-facts span {
        font-size: 9px;
        white-space: nowrap;
    }

    .guardian-status-facts strong {
        overflow: hidden;
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .guardian-rail {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
        margin-top: 22px;
        padding-left: 0;
    }

    .guardian-rail::before {
        top: 7px;
        bottom: auto;
        left: 12.5%;
        right: 12.5%;
        width: auto;
        height: 1px;
    }

    .guardian-rail-step {
        min-height: auto;
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: start;
        gap: 7px;
    }

    .guardian-rail-label {
        margin-top: 0;
        padding: 0 2px;
        font-size: 9px;
        line-height: 1.3;
        text-align: center;
    }

    .guardian-connection-card,
    .guardian-rule-card,
    .guardian-add-card {
        padding: 0;
        border-radius: 16px;
        box-shadow: none;
    }

    .guardian-connection-card .native-disclosure-summary,
    .guardian-rule-card .native-disclosure-summary,
    .guardian-add-card .native-disclosure-summary {
        padding: 13px 15px;
    }

    .guardian-connection-card .native-disclosure-body,
    .guardian-rule-card .native-disclosure-body,
    .guardian-add-card .native-disclosure-body {
        padding: 0 15px 15px;
    }

    .guardian-connection-card:not([open]) .native-disclosure-body,
    .guardian-rule-card:not([open]) .native-disclosure-body,
    .guardian-add-card:not([open]) .native-disclosure-body {
        display: none;
    }

    .guardian-section-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .guardian-section-title {
        gap: 10px;
    }

    .guardian-section-title h2,
    .guardian-section-title .card-title,
    .guardian-section-title strong {
        font-size: 15px;
    }

    .guardian-section-title small {
        margin-top: 3px;
        color: var(--color-text-3);
        font-size: 10px;
        line-height: 1.45;
    }

    .contact-disclosure {
        padding: 0;
        border-radius: 14px;
        box-shadow: none;
    }

    .contact-disclosure .native-disclosure-summary {
        min-height: 62px;
        padding: 12px 14px;
    }

    .contact-disclosure .native-disclosure-body {
        padding: 0 14px 14px;
    }

    .contact-disclosure:not([open]) .native-disclosure-body {
        display: none;
    }

    .guardian-grid {
        gap: 10px;
    }

    .notification-channel-list {
        gap: 0;
        overflow: hidden;
        border: 1px solid var(--color-border);
        border-radius: 16px;
        background: var(--color-surface);
    }

    .notification-channel-row {
        padding: 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

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

    .notification-channel-row > .help-text {
        display: none;
    }

    .notification-channel-row .channel-meta {
        display: none;
    }

    .notification-channel-row .channel-card-head {
        align-items: center;
    }

    .notification-channel-row .channel-card-toggle {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto 18px;
        gap: 9px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .notification-channel-row .channel-card-toggle::after {
        content: "›";
        align-self: center;
        color: var(--color-text-3);
        font-size: 24px;
        font-weight: 300;
        line-height: 1;
        transition: transform var(--motion-micro) var(--ease-standard);
    }

    .notification-channel-row .channel-card-toggle[aria-expanded="true"]::after {
        transform: rotate(90deg);
    }

    .notification-channel-row .channel-card-toggle:active {
        opacity: .72;
    }

    .notification-channel-row .channel-card-head h3 {
        margin: 0;
        font-size: 13px;
    }

    .notification-channel-row .channel-state {
        padding: 4px 7px;
        border-radius: 8px;
        font-size: 9px;
    }

    .channel-config {
        margin-top: 9px;
        padding-top: 10px;
    }

    .channel-config:not([open]) {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .channel-config > summary {
        display: none;
    }

    .channel-config .channel-form {
        margin-top: 0;
        padding: 12px 0 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .channel-config .channel-form > .push-actions .btn {
        width: 100%;
    }

    .channel-config .inline-form .btn {
        width: 100%;
    }

    .notification-center .section-head > div > .help-text {
        display: none;
    }

    .notification-about {
        display: none;
    }

    .notification-policy {
        padding: 14px 15px;
        border-radius: 14px;
        font-size: 12px;
        line-height: 1.6;
    }

    .notice-item {
        padding: 14px 15px;
        border-radius: 14px;
    }

    .device-presence-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .device-presence-card {
        padding: 16px;
        border-radius: 16px;
        box-shadow: none;
    }

    .device-list-row {
        grid-template-columns: 38px minmax(0, 1fr) 18px;
        min-height: 72px;
        padding: 13px 14px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .device-list-row + .device-list-row {
        margin-top: -1px;
    }

    .device-list-row:hover {
        transform: none;
        box-shadow: none;
    }

    .device-list-row:active {
        background: color-mix(in srgb, var(--color-brand-soft) 45%, white);
    }

    .device-native-list {
        gap: 0;
        overflow: hidden;
        border: 1px solid var(--color-border);
        border-radius: 16px;
        background: var(--color-surface);
    }

    .device-native-list .device-list-row {
        border: 0;
        border-radius: 0;
    }

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

    .device-list-last {
        margin-top: 4px;
        font-size: 10px;
    }

    .device-list-chevron {
        font-size: 24px;
    }

    .device-detail-header {
        margin-top: 2px;
        margin-bottom: 14px;
    }

    .device-detail-hero {
        padding: 16px;
        border-radius: 16px;
    }

    .device-detail-icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .native-settings-list {
        margin-top: 12px;
        border-radius: 16px;
    }

    .native-settings-row {
        min-height: 50px;
        padding: 11px 14px;
    }

    .native-settings-row > span {
        font-size: 12px;
    }

    .native-settings-row > strong {
        max-width: 58%;
        font-size: 11px;
    }

    .native-danger-zone {
        margin-top: 14px;
    }

    .native-danger-zone button {
        min-height: 45px;
        border-radius: 13px;
        font-size: 12px;
    }

    .device-card-head {
        gap: 11px;
    }

    .device-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .device-name {
        font-size: 15px;
    }

    .device-facts {
        margin-top: 14px;
    }

    .device-facts > div {
        padding: 10px 0;
    }

    .device-technical-note {
        display: none;
    }

    .activity-table-card {
        margin-inline: -2px;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .activity-table {
        display: none;
    }

    .activity-timeline {
        display: block;
        padding: 0 4px;
    }

    .activity-timeline-item {
        position: relative;
        display: grid;
        grid-template-columns: 76px 11px minmax(0, 1fr);
        gap: 10px;
        min-height: 58px;
        padding: 13px 0;
    }

    .activity-timeline-item + .activity-timeline-item {
        border-top: 1px solid var(--color-border);
    }

    .activity-time {
        color: var(--color-text-3);
        font-size: 11px;
        font-variant-numeric: tabular-nums;
    }

    .activity-dot {
        width: 8px;
        height: 8px;
        margin-top: 5px;
        border-radius: 50%;
        background: var(--color-brand);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand) 9%, transparent);
    }

    .activity-content strong {
        display: block;
        color: var(--color-text);
        font-size: 13px;
        font-weight: 650;
    }

    .activity-content p {
        margin: 3px 0 0;
        color: var(--color-text-3);
        font-size: 11px;
        line-height: 1.45;
    }

    .auth-page {
        min-height: 100dvh;
    }

    .auth-shell {
        width: min(calc(100% - 36px), 520px);
        min-height: 100dvh;
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0;
    }

    .auth-brand-panel {
        min-height: auto;
        padding: max(22px, env(safe-area-inset-top)) 2px 0;
    }

    .auth-brand-panel .brand {
        gap: 9px;
        font-size: 14px;
        letter-spacing: -.01em;
    }

    .auth-brand-panel .brand-mark {
        width: 31px;
        height: 31px;
        border-radius: 10px;
    }

    .auth-brand-copy,
    .auth-orb {
        display: none;
    }

    .auth-form-panel {
        display: block;
        padding: clamp(48px, 11vh, 92px) 0 48px;
    }

    .auth-card {
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .auth-card .auth-title {
        font-size: 27px;
        font-weight: 650;
        letter-spacing: -.025em;
    }

    .auth-card .auth-subtitle {
        margin: 7px 0 26px;
        color: var(--color-text-3);
        font-size: 13px;
        line-height: 1.6;
    }

    .auth-card .field {
        margin-bottom: 15px;
    }

    .auth-card .field label {
        margin-bottom: 7px;
        font-size: 12px;
        font-weight: 600;
    }

    .auth-card .field input {
        min-height: 50px;
        border-radius: 13px;
        background: rgba(255, 255, 255, .78);
    }

    .auth-card .btn.block {
        min-height: 48px;
        margin-top: 6px;
        border-radius: 13px;
    }

    .auth-foot {
        margin-top: 22px;
        font-size: 12px;
    }

    .compact-header {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: calc(54px + env(safe-area-inset-top));
        margin: 0 0 14px;
        padding-top: max(7px, env(safe-area-inset-top));
    }

    .compact-header .app-nav {
        display: none;
    }

    .compact-header .brand {
        max-width: calc(100vw - 130px);
        gap: 9px;
    }

    .compact-header .brand > span:last-child {
        overflow: hidden;
        font-size: 14px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .compact-header .header-actions .btn {
        min-height: 36px;
        padding: 7px 10px;
        border-radius: 10px;
        font-size: 11px;
    }

    .bind-page,
    .setup-page {
        width: min(calc(100% - 28px), 680px);
        padding-top: 0;
    }

    .bind-page-header,
    .setup-page-header {
        margin-top: 2px;
        margin-bottom: 18px;
    }

    .bind-form-card,
    .bind-result-card {
        margin-top: 0;
        padding: 18px 17px;
        border-radius: 16px;
        box-shadow: none;
    }

    .bind-form-intro {
        gap: 10px;
        margin-bottom: 18px;
        padding-bottom: 16px;
    }

    .bind-form-card .field {
        margin-bottom: 14px;
    }

    .bind-form-card .field input {
        min-height: 48px;
        border-radius: 12px;
    }

    .bind-form-card .btn.block {
        min-height: 46px;
        border-radius: 12px;
    }

    .setup-flow {
        position: relative;
        gap: 0;
        margin-top: 10px;
    }

    .setup-flow::before {
        content: "";
        position: absolute;
        top: 28px;
        bottom: 28px;
        left: 16px;
        width: 1px;
        background: var(--color-border-strong);
        pointer-events: none;
    }

    .setup-flow .setup-step {
        min-height: 0;
        grid-template-columns: 34px 1fr;
        column-gap: 13px;
        padding: 15px 0 18px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .setup-flow .setup-step + .setup-step {
        border-top: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
    }

    .setup-flow .step-number {
        position: relative;
        z-index: 1;
        width: 32px;
        height: 32px;
        border: 5px solid var(--color-bg);
        background: var(--color-brand-soft);
        color: var(--color-brand-deep);
        font-size: 11px;
        font-weight: 700;
    }

    .setup-flow .card-title {
        margin-top: 4px;
        font-size: 15px;
    }

    .setup-flow .help-text {
        font-size: 12px;
        line-height: 1.62;
    }

    .setup-flow .btn {
        min-height: 38px;
        margin-top: 10px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 11px;
    }

    .setup-step-final {
        background: transparent;
    }

    .setup-status-note {
        padding: 16px;
        border-radius: 15px;
    }

    .setup-status-note .device-meta {
        font-size: 11px;
        line-height: 1.7;
    }

    .notification-channel-row .channel-card-head {
        align-items: flex-start;
    }

    .channel-config .channel-form {
        padding: 14px;
    }

    .guardian-connection-card .section-head {
        align-items: flex-start;
    }

    .guardian-rule-card form .field {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 11px 0;
    }

    .guardian-rule-card form .field input {
        text-align: left;
    }

    .guardian-rule-card > .help-text,
    .guardian-rule-card .native-disclosure-body > .help-text {
        display: none;
    }

    .guardian-delivery-log {
        display: none;
    }

    .guardian-rule-card form > .btn,
    .guardian-add-card form > .btn {
        width: 100%;
    }

    .contact-disclosure .contact-method-add {
        margin-top: 12px;
    }

    .contact-disclosure > .native-disclosure-body > .inline-form:last-child .btn {
        width: 100%;
    }

    .guardian-connection-card .push-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .guardian-connection-card .push-actions .btn {
        width: 100%;
        min-height: 40px;
        padding-inline: 10px;
        font-size: 11px;
    }

    .guardian-connection-card .push-actions .btn.ghost {
        grid-column: 1 / -1;
        min-height: 34px;
    }

    .notification-segmented {
        width: 100%;
    }

    .notification-segmented a {
        flex: 1 1 0;
        justify-content: center;
        text-align: center;
    }

    .notification-channel-row .channel-card-head h3 {
        font-size: 14px;
    }

    .notification-channel-row .channel-state {
        flex: 0 0 auto;
        font-size: 10px;
    }

    .channel-config > summary {
        min-height: 32px;
        font-size: 12px;
    }

    .channel-config .channel-form {
        border-radius: 12px;
        background: color-mix(in srgb, var(--color-bg-elevated) 88%, transparent);
    }

    .landing h1 {
        font-size: clamp(38px, 11vw, 52px);
    }

    .landing-copy > p {
        margin-top: 18px;
        font-size: 15px;
    }

    .landing-visual {
        min-height: 330px;
    }

    .landing-orb-note {
        right: 0;
        bottom: 2%;
    }

    .guest-orb {
        min-width: 230px;
        width: 64vw;
    }

    .landing-flow {
        padding-top: 46px;
    }

    .process-line {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 28px;
    }

    .process-line::before {
        top: 16px;
        bottom: 16px;
        left: 18px;
        right: auto;
        width: 1px;
        height: auto;
        background: linear-gradient(180deg, transparent, var(--color-border-strong) 12%, var(--color-border-strong) 88%, transparent);
    }

    .process-step {
        min-height: 58px;
        display: grid;
        grid-template-columns: 36px 1fr;
        grid-template-rows: auto auto;
        column-gap: 16px;
        text-align: left;
    }

    .process-node {
        grid-row: 1 / span 2;
        margin: 0;
    }

    .process-step h2 {
        margin-top: -2px;
    }

    .process-step p {
        max-width: none;
        margin: 0;
    }

    .presence-page {
        padding-top: 14px;
    }

    .presence-hero {
        min-height: auto;
    }

    .status-title {
        font-size: clamp(34px, 10vw, 46px);
    }

    .presence-fact {
        grid-template-columns: 100px 1fr;
        gap: 10px;
    }

    .presence-orb-wrap {
        min-height: 360px;
    }

    .safety-orb {
        min-width: 240px;
        width: 67vw;
    }

    .presence-action-note {
        margin-bottom: 4px;
    }

    .orb-caption {
        bottom: 2px;
    }

    .page-header,
    .page-head-row {
        flex-direction: column;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

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

    .table-card {
        overflow-x: auto;
    }

    .table {
        min-width: 620px;
    }

    .footer-note {
        padding-top: 20px;
    }
}

@media (max-width: 420px) {
    .app-shell,
    .shell {
        width: min(calc(100% - 24px), 1200px);
    }

    .landing-hero,
    .presence-hero {
        padding-inline: 17px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .presence-fact {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 12px 0;
    }

    .presence-orb-wrap {
        min-height: 334px;
    }

    .safety-orb {
        min-width: 226px;
        width: 70vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .interactive-card:hover {
        transform: none;
    }
}
