/* ==========================================================================
   HOW IT WORKS — Interactive Guided Phone Walkthrough
   Matches RingLink's warm cream-blush theme (#FCF3EE) and authentic iOS UI
   ========================================================================== */

.hiw-page {
    background-color: #FCF3EE;
    color: #070604;
}

.hiw-page .nav-link.active {
    opacity: 1;
    color: #070604;
}

.hiw-page .nav-link.active::after {
    width: 100%;
    left: 0;
}

/* ── Centered Editorial Layout ── */
.hiw-main {
    padding: 86px 0 72px;
    min-height: calc(100vh - 140px);
}

/* Embedded Homepage Placement (Seamless Rhythm After Challenges) */
.hiw-embed-section {
    padding: 56px 0 92px;
    background-color: #FCF3EE;
    width: 100%;
    overflow: hidden;
}

@media (max-width: 560px) {
    .hiw-embed-section {
        padding: 36px 0 64px;
    }
}

.hiw-centered-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Centered Intro Header ── */
.hiw-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hiw-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #EFE4DC;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5C544E;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(25, 15, 10, 0.04);
}

.hiw-eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FF4B42;
}

.hiw-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: #070604;
    margin: 0 0 10px 0;
}

.hiw-lead {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.04rem;
    line-height: 1.48;
    color: #5C544E;
    max-width: 520px;
    margin: 0;
}

/* ── Centerpiece Wide Pastel Stage with Perfectly Scaled Centered iPhone ── */
.hiw-stage-card {
    --phone-scale: 0.78;
    position: relative;
    width: 100%;
    padding: 54px 24px 30px;
    border-radius: 36px;
    background: linear-gradient(160deg, #E8F2FC 0%, #D4E8FA 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 22px 58px rgba(30, 50, 80, 0.08);
    transition: background 0.7s ease;
    margin-bottom: 18px;
}

/* Exact-footprint scaler wrapper so the full phone fits cleanly on screen */
.hiw-phone-box {
    width: calc(372px * var(--phone-scale));
    height: calc(768px * var(--phone-scale));
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
}

.hiw-phone-box .hiw-iphone {
    transform: scale(var(--phone-scale));
    transform-origin: top center;
}

.hiw-stage-card[data-mood="setup"] {
    background: linear-gradient(160deg, #E7F0FD 0%, #CEE2FA 100%);
}

.hiw-stage-card[data-mood="accepted"] {
    background: linear-gradient(160deg, #E8F6EE 0%, #D2EEDD 100%);
}

.hiw-stage-card[data-mood="ringing"] {
    background: linear-gradient(160deg, #FCE7E6 0%, #FAD0CE 100%);
}

.hiw-stage-card[data-mood="results"] {
    background: linear-gradient(160deg, #E0F0DC 0%, #CBE3C5 100%);
}

/* Floating Stage Toolbar (Sound & Replay neatly anchored top corners) */
.hiw-stage-toolbar {
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.hiw-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #2A2421;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 25, 40, 0.06);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hiw-ctrl-btn:hover {
    background: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 25, 40, 0.1);
}

.hiw-ctrl-btn .hiw-icon-sound {
    display: none;
}

.hiw-ctrl-btn[aria-pressed="true"] {
    background: #070604;
    color: #FFFFFF;
    border-color: #070604;
}

.hiw-ctrl-btn[aria-pressed="true"] .hiw-icon-muted {
    display: none;
}

.hiw-ctrl-btn[aria-pressed="true"] .hiw-icon-sound {
    display: inline-block;
}

/* ── Below Mockup: Clean Route-Map Progress UI Dock ── */
.hiw-minimap-dock {
    width: 100%;
    background: #FFFFFF;
    border-radius: 28px;
    padding: 20px 28px 24px;
    border: 1px solid #EFE6DF;
    box-shadow: 0 14px 40px rgba(35, 20, 10, 0.055);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hiw-minimap-dock.is-pulse {
    animation: coachCardPop 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes coachCardPop {
    0% { transform: scale(0.993); }
    50% { transform: scale(1.005); }
    100% { transform: scale(1); }
}

.hiw-minimap-head {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 20px;
}

.hiw-minimap-narrative {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hiw-coach-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.hiw-coach-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: #F4EAE3;
    color: #5C493E;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.hiw-coach-status {
    font-size: 0.76rem;
    font-weight: 700;
    color: #FF4B42;
}

.hiw-coach-status.is-auto {
    color: #B45309;
}

.hiw-coach-status.is-done {
    color: #15803D;
}

.hiw-coach-heading {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
    color: #070604;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
}

.hiw-coach-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #5C544E;
    margin: 0;
}

.hiw-coach-text strong {
    color: #070604;
    font-weight: 700;
}

/* Route-Map Progress Track (Continuous Map Line + Circular Waypoints) */
.hiw-route-wrap {
    position: relative;
    padding: 6px 4px 0;
}

.hiw-minimap-line-bg {
    position: absolute;
    top: 15px;
    left: calc(100% / 14);
    right: calc(100% / 14);
    height: 3px;
    border-radius: 999px;
    background: #EDE7E2;
    overflow: hidden;
    z-index: 1;
}

.hiw-minimap-line-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22C55E 0%, #34D399 72%, #FF4B42 100%);
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.hiw-steps-rail {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    list-style: none;
    padding: 0;
    margin: 0;
}

.hiw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

/* Circular Map Waypoint Pin */
.hiw-waypoint {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2.5px solid #D9CFC7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.hiw-wp-pulse {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: rgba(255, 75, 66, 0.22);
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

.hiw-wp-check {
    color: #FFFFFF;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hiw-step-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    color: #9A8F87;
    line-height: 1.2;
    transition: color 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

/* Active Waypoint ("You are here" beacon) */
.hiw-step.is-active .hiw-waypoint {
    background: #FF4B42;
    border-color: #FFFFFF;
    transform: scale(1.18);
    box-shadow: 0 0 0 2.5px #FF4B42, 0 4px 12px rgba(255, 75, 66, 0.32);
}

.hiw-step.is-active .hiw-wp-pulse {
    opacity: 1;
    animation: wpRadar 1.8s ease-out infinite;
}

@keyframes wpRadar {
    0%   { transform: scale(0.8); opacity: 0.7; }
    100% { transform: scale(1.7); opacity: 0; }
}

.hiw-step.is-active .hiw-step-label {
    color: #070604;
    font-weight: 800;
}

/* Completed Waypoint */
.hiw-step.is-done .hiw-waypoint {
    background: #22C55E;
    border-color: #22C55E;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.28);
}

.hiw-step.is-done .hiw-wp-check {
    opacity: 1;
    transform: scale(1);
}

.hiw-step.is-done .hiw-step-label {
    color: #15803D;
    font-weight: 700;
}

/* Post-Walkthrough Centered Completion CTA Banner */
.hiw-complete-cta {
    width: 100%;
    border-radius: 26px;
    background: linear-gradient(155deg, #E8F7EE 0%, #D9F1E2 100%);
    border: 1px solid #C5E8D2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    padding: 0 26px;
    margin-top: 0;
    border-width: 0;
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.45s ease, padding 0.45s ease, margin 0.45s ease;
}

.hiw-complete-cta.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 220px;
    padding: 20px 26px;
    margin-top: 18px;
    border-width: 1px;
}

.hiw-complete-kicker {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: #15803D;
    margin-bottom: 3px;
}

.hiw-complete-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: #070604;
    margin: 0;
    letter-spacing: -0.02em;
}

.hiw-complete-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.hiw-complete-actions .app-store-link img {
    display: block;
    height: 42px;
    width: auto;
}

.hiw-replay-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1.5px solid #1C1008;
    background: #FFFFFF;
    color: #070604;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.hiw-replay-primary:hover {
    background: #070604;
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* iPhone 16 Pro Realistic Hardware Frame */
.hiw-iphone {
    position: relative;
    width: 372px;
    height: 768px;
    border-radius: 56px;
    padding: 11px;
    background: linear-gradient(145deg, #2C2C30 0%, #151518 52%, #242428 100%);
    box-shadow:
        0 32px 72px rgba(15, 20, 30, 0.28),
        0 6px 18px rgba(15, 20, 30, 0.14),
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.22);
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

/* Side Physical Buttons */
.iphone-btn-silent,
.iphone-btn-vol-up,
.iphone-btn-vol-down,
.iphone-btn-power {
    position: absolute;
    background: #232327;
    border-radius: 3px;
}

.iphone-btn-silent   { left: -3px; top: 122px; width: 3px; height: 26px; }
.iphone-btn-vol-up   { left: -3px; top: 170px; width: 3px; height: 48px; }
.iphone-btn-vol-down { left: -3px; top: 230px; width: 3px; height: 48px; }
.iphone-btn-power    { right: -3px; top: 192px; width: 3px; height: 74px; }

/* Inner Screen Canvas */
.iphone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 45px;
    background: #F6F6F7;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Text', 'Segoe UI', sans-serif;
    color: #0D0D0F;
    -webkit-font-smoothing: antialiased;
}

/* ── Persistent iOS Status Bar ── */
.ios-statusbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 60;
    pointer-events: none;
    color: #0D0D0F;
    transition: color 0.3s ease;
}

.ios-statusbar.is-light {
    color: #0D0D0F;
}

.ios-status-left {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 84px;
}

.ios-clock {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.ios-mute-icon {
    opacity: 0.85;
}

.ios-dynamic-island {
    width: 96px;
    height: 27px;
    border-radius: 999px;
    background: #09090B;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 9px;
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.ios-island-cam {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #263B59 0%, #0E131D 60%, #050507 100%);
}

.ios-status-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    width: 84px;
}

.ios-battery {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 12px;
    border-radius: 3.5px;
    background: #0D0D0F;
    color: #FFFFFF;
    font-size: 8.5px;
    font-weight: 800;
    line-height: 1;
    position: relative;
}

.ios-battery::after {
    content: '';
    position: absolute;
    right: -2.5px;
    top: 3.5px;
    width: 1.5px;
    height: 5px;
    border-radius: 0 1px 1px 0;
    background: rgba(13, 13, 15, 0.45);
}

.ios-home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 122px;
    height: 4.5px;
    border-radius: 999px;
    background: rgba(15, 15, 18, 0.24);
    z-index: 95;
    pointer-events: none;
}

/* ── Inside-Phone iOS Notification Banner (Step 5) ── */
.ios-notif-banner {
    position: absolute;
    top: 52px;
    left: 12px;
    right: 12px;
    z-index: 85;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow: 0 14px 34px rgba(10, 15, 25, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: translateY(-135%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.52s cubic-bezier(0.22, 1.15, 0.36, 1), opacity 0.32s ease;
}

.ios-notif-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.ios-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ios-notif-body {
    flex: 1;
    min-width: 0;
}

.ios-notif-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.ios-notif-title {
    font-size: 13px;
    font-weight: 700;
    color: #0D0D0F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ios-notif-time {
    font-size: 11px;
    color: #8E8E93;
    flex-shrink: 0;
}

.ios-notif-sub {
    display: block;
    font-size: 12.5px;
    color: #3A3A3C;
    margin-top: 1px;
}

/* ── Inside-Phone Time Jump Overlay (Step 6 transition) ── */
.ios-timejump-overlay {
    position: absolute;
    inset: 0;
    z-index: 82;
    background: rgba(15, 16, 22, 0.56);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.ios-timejump-overlay.is-visible {
    opacity: 1;
}

.ios-timejump-card {
    width: 100%;
    max-width: 268px;
    padding: 24px 20px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    text-align: center;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.25);
    transform: scale(0.92);
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-timejump-overlay.is-visible .ios-timejump-card {
    transform: scale(1);
}

.ios-timejump-kicker {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #8E8E93;
    margin-bottom: 6px;
}

.ios-timejump-clock {
    font-size: 46px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #0D0D0F;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.ios-timejump-cue {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #FFF0EE;
    color: #E0352B;
    font-size: 12px;
    font-weight: 700;
}

/* ── Anchored Non-Overlapping In-Phone Guidance Cues ── */
.phone-cue {
    position: absolute;
    z-index: 40;
    padding: 6px 12px;
    border-radius: 999px;
    background: #141417;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.phone-cue.is-visible {
    opacity: 1;
    transform: scale(1);
}

.phone-cue::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #141417;
    transform: rotate(45deg);
}

.phone-cue.cue-left {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(0.92);
}

.phone-cue.cue-left.is-visible {
    transform: translateY(-50%) scale(1);
}

.phone-cue.cue-left::after {
    right: -3.5px;
    top: 50%;
    margin-top: -4px;
}

.phone-cue.cue-below {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.92);
}

.phone-cue.cue-below.is-visible {
    transform: translateX(-50%) scale(1);
}

.phone-cue.cue-below::after {
    top: -3.5px;
    left: 50%;
    margin-left: -4px;
}

.phone-cue.cue-below-right {
    top: calc(100% + 10px);
    right: 0;
}

.phone-cue.cue-below-right::after {
    top: -3.5px;
    right: 22px;
}

.phone-cue.cue-above {
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) scale(0.92);
}

.phone-cue.cue-above.is-visible {
    transform: translateX(-50%) scale(1);
}

.phone-cue.cue-above::after {
    bottom: -3.5px;
    left: 50%;
    margin-left: -4px;
}

/* Subtle Interactive Pulse Ring on Target Controls */
@keyframes targetRingPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 75, 66, 0.45); }
    70%  { box-shadow: 0 0 0 10px rgba(255, 75, 66, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 75, 66, 0); }
}

.is-highlighted {
    animation: targetRingPulse 1.8s ease-out infinite;
}

/* ── Base App Screen Stack & Transitions ── */
.app-screen {
    position: absolute;
    inset: 0;
    background: #F6F6F7;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
    z-index: 10;
}

.app-screen.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
}

.app-screen-set {
    transform: translate3d(100%, 0, 0);
    z-index: 20;
    background: #F7F7F8;
}

.app-screen-set.is-active {
    transform: translate3d(0, 0, 0);
}

.app-screen-ringing {
    background: #FFFFFF;
    z-index: 30;
    transform: scale(1.03);
}

.app-screen-ringing.is-active {
    transform: scale(1);
}

.app-screen-complete {
    background: #FFFFFF;
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.app-screen-stats {
    background: #F7F7F8;
    z-index: 32;
    transform: translate3d(0, 18px, 0);
}

.app-screen-stats.is-active {
    transform: translate3d(0, 0, 0);
}

/* ==========================================================================
   SCREEN 1 & 5: ALARMS HOME SCREEN
   ========================================================================== */
.home-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 52px 16px 120px;
    scrollbar-width: none;
}

.home-scroll::-webkit-scrollbar {
    display: none;
}

.home-top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.home-bell-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0D0D0F;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.home-heading {
    font-size: 31px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0D0D0F;
    margin: 0 0 12px 2px;
    line-height: 1.1;
}

.home-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.home-filter {
    padding: 7px 16px;
    border-radius: 999px;
    background: #E7E7EA;
    color: #3A3A3C;
    font-size: 13px;
    font-weight: 600;
}

.home-filter.is-selected {
    background: #0D0D0F;
    color: #FFFFFF;
}

.home-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
    margin-bottom: 14px;
}

.home-countdown {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #6E6E73;
}

.home-streak {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: #FF4B42;
}

.home-alarm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Authentic RingLink Alarm Card */
.app-alarm-card {
    background: #FFFFFF;
    border-radius: 22px;
    padding: 15px 16px 13px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.035);
}

.app-alarm-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.app-alarm-title-group {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.app-alarm-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #0D0D0F;
    letter-spacing: -0.015em;
}

.app-shared-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 999px;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.app-shared-badge.is-pending {
    background: #FEF3E2;
    color: #B45309;
}

.app-shared-badge.is-accepted {
    background: #DCFCE7;
    color: #15803D;
}

.app-ios-switch {
    width: 48px;
    height: 28px;
    border-radius: 999px;
    padding: 2.5px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.app-ios-switch.is-green {
    background: #28C95E;
}

.app-ios-switch.is-coral {
    background: #FF4B42;
}

.app-ios-knob {
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.2);
}

.app-alarm-mid {
    display: flex;
    align-items: center;
    margin: 4px 0 10px;
}

.app-alarm-time {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: #0D0D0F;
    line-height: 1;
}

.app-alarm-div {
    width: 1px;
    height: 24px;
    background: #E5E5EA;
    margin: 0 12px;
    flex-shrink: 0;
}

.app-alarm-days {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    color: #E5483B;
}

.app-alarm-once-label {
    font-size: 12px;
    font-weight: 600;
    color: #6E6E73;
}

.app-alarm-bot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.app-alarm-note {
    font-size: 11.5px;
    color: #8E8E93;
    padding-bottom: 3px;
}

.app-alarm-owner {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.app-alarm-type {
    font-size: 10.5px;
    color: #8E8E93;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.app-alarm-avatars {
    display: flex;
    align-items: center;
}

.app-mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-mini-avatar + .app-mini-avatar {
    margin-left: -7px;
}

.app-mini-avatar.is-waiting {
    opacity: 0.45;
    filter: grayscale(0.65);
    border-style: dashed;
    border-color: #C7C7CC;
}

/* New Shared Alarm Insertion & Acceptance Animation */
.app-alarm-shared-card {
    display: none;
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
    transition: opacity 0.48s ease, transform 0.52s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}

.app-alarm-shared-card.is-mounted {
    display: block;
}

.app-alarm-shared-card.is-inserted {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-alarm-shared-card.is-accepted-glow {
    border-color: rgba(38, 201, 94, 0.45);
    box-shadow: 0 8px 24px rgba(38, 201, 94, 0.16);
}

/* Home Floating Red + Button */
.home-fab-wrap {
    position: absolute;
    right: 16px;
    bottom: 92px;
    z-index: 25;
}

.home-fab {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    border: none;
    background: linear-gradient(145deg, #FF554C 0%, #FF3B30 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 59, 48, 0.38);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-fab:hover {
    transform: scale(1.06);
}

.home-fab:active {
    transform: scale(0.94);
}

/* Home Floating Pill Tab Bar */
.home-tabbar {
    position: absolute;
    left: 34px;
    right: 34px;
    bottom: 22px;
    height: 56px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    z-index: 20;
}

.home-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 999px;
    color: #1C1C1E;
    font-size: 10px;
    font-weight: 600;
}

.home-tab.is-active {
    background: #EAEAEB;
    color: #FF3B30;
}

/* ==========================================================================
   SCREEN 2 & 4: SET ALARM SCREEN
   ========================================================================== */
.set-header {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    height: 50px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(247, 247, 248, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 15;
}

.set-back-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0D0D0F;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.set-title {
    font-size: 16px;
    font-weight: 700;
    color: #0D0D0F;
}

.set-header-spacer {
    width: 38px;
}

.set-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 102px 14px 108px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.set-scroll::-webkit-scrollbar {
    display: none;
}

/* Authentic iOS Drum Picker */
.set-picker {
    position: relative;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 44px;
    margin: 2px 10px 6px;
}

.set-picker-band {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    height: 36px;
    transform: translateY(-50%);
    border-radius: 11px;
    background: rgba(118, 118, 128, 0.11);
    pointer-events: none;
}

.set-picker-col {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-variant-numeric: tabular-nums;
}

.sp-far  { font-size: 13px; color: #C7C7CC; font-weight: 500; line-height: 1.1; }
.sp-near { font-size: 17px; color: #8E8E93; font-weight: 500; line-height: 1.15; }
.sp-val  { font-size: 22px; color: #0D0D0F; font-weight: 700; line-height: 1.3; }

.set-date-row {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #8E8E93;
    margin-bottom: 16px;
}

/* Setup Cards */
.set-target-wrap {
    position: relative;
    margin-bottom: 12px;
}

.set-card {
    width: 100%;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.035);
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 12px;
}

.set-target-wrap .set-card {
    margin-bottom: 0;
}

.set-add-friend-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: #0D0D0F;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.set-add-friend-btn:hover {
    background: #FFF9F8;
    border-color: rgba(255, 75, 66, 0.35);
}

.set-add-friend-btn:active {
    transform: scale(0.98);
}

.set-af-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.set-chevron {
    font-size: 20px;
    color: #8E8E93;
    line-height: 1;
}

/* Recipients Card (Step 4) */
.set-recipients-card.is-hidden,
.set-target-wrap.is-hidden {
    display: none;
}

.set-recipients-card {
    animation: fadeSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.set-card-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #0D0D0F;
}

.set-recipients-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 12px;
}

.set-recip-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.set-recip-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.set-recip-x {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #FFFFFF;
    color: #FF3B30;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.set-recip-name {
    font-size: 11px;
    font-weight: 600;
    color: #3A3A3C;
}

.set-recip-plus {
    width: 34px;
    height: 34px;
    margin-top: 5px;
    border-radius: 50%;
    background: #F2F2F7;
    color: #3A3A3C;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
}

.set-card-divider {
    height: 1px;
    background: #EFEFF4;
    margin: 12px 0;
}

.set-also-ring {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.set-also-copy {
    display: flex;
    flex-direction: column;
}

.set-also-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0D0D0F;
}

.set-also-sub {
    font-size: 11px;
    color: #8E8E93;
    margin-top: 1px;
}

/* Repeat Card */
.set-repeat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.set-repeat-label {
    font-size: 13.5px;
    font-weight: 700;
}

.set-repeat-days {
    display: flex;
    gap: 5px;
}

.set-repeat-days span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F2F2F7;
    color: #3A3A3C;
    font-size: 10.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.set-repeat-check {
    color: #6E6E73;
    display: inline-flex;
}

/* Add Challenge Card */
.set-card-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.set-muted-val {
    font-size: 13px;
    color: #8E8E93;
}

.set-challenge-body {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.set-dashed-plus {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    border: 1.5px dashed #C7C7CC;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #8E8E93;
}

.set-challenge-copy {
    display: flex;
    flex-direction: column;
}

.set-ch-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0D0D0F;
}

.set-ch-sub {
    font-size: 11.5px;
    color: #8E8E93;
    margin-top: 2px;
}

/* Sound & Color Card */
.set-vol-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.set-vol-track {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: #E5E5EA;
}

.set-vol-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 78%;
    border-radius: 999px;
    background: #FF4B42;
}

.set-vol-thumb {
    position: absolute;
    left: 72%;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 16px;
    border-radius: 999px;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.set-color-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.set-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    color: #8E8E93;
}

.sc-swatch {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-none   { border: 1.5px dashed #1C1C1E; color: #1C1C1E; font-size: 14px; font-weight: 700; }
.sc-sky    { background: #38BDF8; }
.sc-purple { background: #A78BFA; }
.sc-pink   { background: #F472B6; }
.sc-green  { background: #34D399; }
.sc-yellow { background: #FACC15; }

/* Alarm Name & Note Card */
.set-input-readonly {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #F2F2F7;
    font-size: 13.5px;
    font-weight: 600;
    color: #0D0D0F;
}

.set-textarea-readonly {
    margin-top: 8px;
    height: 54px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #F2F2F7;
    font-size: 12.5px;
    color: #AEAEB2;
}

/* Sticky Bottom Create Alarm Button */
.set-bottom-cta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px 26px;
    background: linear-gradient(180deg, rgba(247, 247, 248, 0) 0%, rgba(247, 247, 248, 0.96) 28%, #F7F7F8 100%);
    z-index: 18;
}

.set-create-btn {
    width: 100%;
    height: 50px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #FF554A 0%, #FF3B30 100%);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(255, 59, 48, 0.3);
    transition: opacity 0.25s ease, transform 0.2s ease;
}

.set-create-btn.is-disabled {
    opacity: 0.42;
    cursor: default;
    box-shadow: none;
}

.set-create-btn:not(.is-disabled):hover {
    transform: translateY(-1px);
}

.set-create-btn:not(.is-disabled):active {
    transform: scale(0.98);
}

/* ==========================================================================
   STEP 3: SELECT FRIENDS BOTTOM SHEET
   ========================================================================== */
.ios-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 20, 0.28);
    z-index: 44;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
}

.ios-sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ios-friends-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 56px;
    z-index: 48;
    background: #F6F6F7;
    border-radius: 30px 30px 0 0;
    padding: 16px 16px 32px;
    box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.16);
    transform: translateY(105%);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.ios-friends-sheet.is-open {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: #0D0D0F;
    margin: 0;
}

.sheet-pill-btn {
    padding: 8px 16px;
    border-radius: 999px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #0D0D0F;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.sheet-done-wrap {
    position: relative;
}

.sheet-done-btn {
    color: #FF3B30;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.22s ease, transform 0.2s ease, background-color 0.2s ease;
}

.sheet-done-btn.is-disabled {
    opacity: 0.42;
    cursor: default;
}

.sheet-done-btn:not(.is-disabled):hover {
    background: #FFF2F1;
    transform: scale(1.03);
}

.sheet-counter {
    font-size: 12px;
    color: #6E6E73;
    margin: 0 4px 12px;
}

.sheet-counter strong {
    color: #0D0D0F;
    font-weight: 600;
}

.sheet-list-wrap {
    position: relative;
}

.sheet-friend-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 18px;
    background: #FFFFFF;
    border: 1.5px solid transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.18s ease;
}

.sheet-friend-row:hover {
    background: #FAFAFC;
}

.sheet-friend-row:active {
    transform: scale(0.985);
}

.sheet-friend-row.is-selected {
    border-color: #FF4B42;
    background: #FFF9F8;
}

.sheet-friend-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sheet-friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.sheet-friend-meta {
    display: flex;
    flex-direction: column;
}

.sheet-friend-name {
    font-size: 15px;
    font-weight: 700;
    color: #0D0D0F;
}

.sheet-friend-handle {
    font-size: 12.5px;
    color: #8E8E93;
}

.sheet-radio {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.8px solid #C7C7CC;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.22s ease, border-color 0.22s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sheet-radio svg {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.25s ease;
}

.sheet-friend-row.is-selected .sheet-radio {
    background: #FF4B42;
    border-color: #FF4B42;
    transform: scale(1.06);
}

.sheet-friend-row.is-selected .sheet-radio svg {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================================
   SCREEN 6: ALARM RINGING SCREEN
   ========================================================================== */
.app-screen-ringing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 112px 24px 52px;
    text-align: center;
}

.ringing-glow {
    position: absolute;
    top: 18%;
    left: 50%;
    width: 320px;
    height: 320px;
    transform: translate(-50%, -20%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 59, 48, 0.14) 0%, rgba(255, 145, 77, 0.06) 45%, transparent 72%);
    pointer-events: none;
    animation: ringingGlowPulse 1.6s ease-in-out infinite;
}

@keyframes ringingGlowPulse {
    0%, 100% { transform: translate(-50%, -20%) scale(0.95); opacity: 0.65; }
    50%      { transform: translate(-50%, -20%) scale(1.12); opacity: 1; }
}

.ringing-top {
    position: relative;
    z-index: 2;
}

.ringing-date {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #8E8E93;
    margin-bottom: 4px;
}

.ringing-time {
    font-size: 76px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #0D0D0F;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ringing-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 288px;
    background: #FFFFFF;
    border-radius: 28px;
    padding: 30px 24px 26px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.app-screen-ringing.is-ringing .ringing-card {
    animation: alarmCardVibrate 1.5s ease-in-out infinite;
}

@keyframes alarmCardVibrate {
    0%, 76%, 100% { transform: translateX(0) rotate(0deg); }
    80% { transform: translateX(-2.5px) rotate(-0.6deg); }
    84% { transform: translateX(2.5px) rotate(0.6deg); }
    88% { transform: translateX(-2px) rotate(-0.4deg); }
    92% { transform: translateX(2px) rotate(0.4deg); }
    96% { transform: translateX(-1px) rotate(0deg); }
}

.ringing-alarm-title {
    font-size: 22px;
    font-weight: 800;
    color: #0D0D0F;
    letter-spacing: -0.02em;
}

.ringing-divider {
    height: 1px;
    background: #EFEFF4;
    margin: 18px 0;
}

.ringing-avatars {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.ringing-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ringing-avatar + .ringing-avatar {
    margin-left: -10px;
}

.ringing-members {
    font-size: 13px;
    font-weight: 500;
    color: #8E8E93;
}

.ringing-action-wrap {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 296px;
}

.ringing-stop-btn {
    width: 100%;
    height: 58px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #FF3B30 0%, #FF261C 100%);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(255, 45, 38, 0.36);
    transition: transform 0.2s ease;
}

.ringing-stop-btn:hover {
    transform: scale(1.02);
}

.ringing-stop-btn:active {
    transform: scale(0.96);
}

.stop-square-icon {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    background: #FFFFFF;
    display: inline-block;
}

/* ==========================================================================
   SCREEN 7: NATIVE COMPLETION ANIMATION
   ========================================================================== */
.complete-burst {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.complete-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(38, 201, 94, 0.22);
    transform: scale(0.7);
    opacity: 0;
}

.app-screen-complete.is-active .complete-ripple {
    animation: completeRippleOut 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes completeRippleOut {
    0%   { transform: scale(0.75); opacity: 0.85; }
    100% { transform: scale(1.75); opacity: 0; }
}

.complete-check-circle {
    position: relative;
    z-index: 2;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(145deg, #32D46A 0%, #22B856 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 32px rgba(34, 184, 86, 0.32);
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-screen-complete.is-active .complete-check-circle {
    transform: scale(1);
}

.complete-check-path {
    stroke-dasharray: 42;
    stroke-dashoffset: 42;
}

.app-screen-complete.is-active .complete-check-path {
    animation: drawCheck 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.complete-heading {
    font-size: 25px;
    font-weight: 800;
    color: #0D0D0F;
    letter-spacing: -0.025em;
    margin: 0 0 6px 0;
}

.complete-sub {
    font-size: 13.5px;
    color: #6E6E73;
    margin: 0;
}

/* ==========================================================================
   SCREEN 8: SHARED RESULTS (STATISTICS SCREEN)
   ========================================================================== */
.stats-scroll {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 34px;
    scrollbar-width: none;
}

.stats-scroll::-webkit-scrollbar {
    display: none;
}

.stats-hero-banner {
    position: relative;
    width: 100%;
    height: 248px;
    border-radius: 0 0 26px 26px;
    overflow: hidden;
    background: linear-gradient(155deg, #FFE4B8 0%, #B8E2F4 55%, #F8CFA0 100%);
}

.stats-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
    display: block;
}

.stats-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.08) 48%, rgba(28, 22, 18, 0.72) 100%);
    pointer-events: none;
}

.stats-hero-nav {
    position: absolute;
    top: 56px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 3;
}

.stats-hero-nav-right {
    display: flex;
    gap: 8px;
}

.stats-circle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #0D0D0F;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.stats-circle-soft {
    background: rgba(255, 255, 255, 0.72);
    color: #555;
}

.stats-hero-meta {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    color: #FFFFFF;
}

.stats-alarm-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #FFFFFF;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.stats-alarm-sub {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.94);
}

.stats-alarm-sub span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Stats Body */
.stats-body {
    padding: 14px 14px 16px;
}

.stats-settling-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #EAEAEA;
    font-size: 11.5px;
    font-weight: 600;
    color: #5C544E;
    margin-bottom: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    transition: opacity 0.35s ease, max-height 0.35s ease, margin 0.35s ease, padding 0.35s ease;
    max-height: 44px;
    overflow: hidden;
}

.stats-settling-pill.is-hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-width: 0;
}

.settling-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #F59E0B;
    animation: settlingBlink 0.9s ease-in-out infinite;
}

@keyframes settlingBlink {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 1; }
}

/* Summary Card */
.stats-summary-card {
    background: #FFFFFF;
    border-radius: 22px;
    padding: 15px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.035);
    margin-bottom: 20px;
}

.stats-ring-wrap {
    position: relative;
    width: 94px;
    height: 94px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-ring-progress {
    transition: stroke-dashoffset 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
}

.stats-ring-ratio {
    font-size: 18px;
    font-weight: 800;
    color: #0D0D0F;
}

.stats-ring-label {
    font-size: 10.5px;
    font-weight: 600;
    color: #3A3A3C;
}

.stats-ring-date {
    font-size: 9.5px;
    font-weight: 500;
    color: #8E8E93;
}

.stats-summary-right {
    flex: 1;
    min-width: 0;
}

.stats-summary-title {
    font-size: 16px;
    font-weight: 800;
    color: #0D0D0F;
    letter-spacing: -0.02em;
}

.stats-summary-sub {
    font-size: 11px;
    color: #6E6E73;
    margin: 2px 0 10px;
    line-height: 1.35;
}

/* Equal Green & Red Distribution Bar */
.stats-dist-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    height: 9px;
    margin-bottom: 11px;
}

.stats-dist-green {
    border-radius: 999px;
    background: #26C95E;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-dist-red {
    border-radius: 999px;
    background: #EAEAEB;
    transition: background-color 0.5s ease;
}

.stats-dist-bar.is-half .stats-dist-green {
    transform: scaleX(1);
}

.stats-dist-bar.is-settled .stats-dist-red {
    background: #F05252;
}

.stats-counts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
}

.stats-count-col {
    display: flex;
    flex-direction: column;
    position: relative;
}

.stats-count-col + .stats-count-col::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: #EFEFF4;
}

.stats-count-num {
    font-size: 14px;
    font-weight: 800;
    color: #0D0D0F;
}

.stats-count-lbl {
    font-size: 9.5px;
    color: #8E8E93;
}

/* Participants List */
.stats-part-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
    margin-bottom: 10px;
}

.stats-part-title {
    font-size: 16.5px;
    font-weight: 800;
    color: #0D0D0F;
}

.stats-part-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6E6E73;
}

.stats-part-list {
    display: flex;
    flex-direction: column;
}

.stats-part-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 2px;
    border-bottom: 1px solid #ECECEF;
}

.stats-part-row:last-child {
    border-bottom: none;
}

.stats-part-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-part-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.stats-part-name {
    font-size: 14.5px;
    font-weight: 600;
    color: #0D0D0F;
}

.stats-part-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}

.stats-status-txt {
    font-size: 13.5px;
    font-weight: 700;
    transition: color 0.35s ease;
}

.stats-status-txt.is-ontime  { color: #24B956; }
.stats-status-txt.is-waiting { color: #B45309; }
.stats-status-txt.is-missed  { color: #EF4444; }

.stats-status-time {
    font-size: 12px;
    font-weight: 500;
    color: #6E6E73;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Compact Laptop, Tablet & Mobile)
   ========================================================================== */
@media (max-height: 820px) and (min-width: 781px) {
    .hiw-stage-card {
        --phone-scale: 0.72;
        padding: 48px 24px 24px;
    }
}

@media (max-width: 780px) {
    .hiw-title {
        font-size: 2.25rem;
    }

    .hiw-stage-card {
        --phone-scale: 0.75;
    }

    .hiw-minimap-dock {
        padding: 18px 18px 20px;
        border-radius: 24px;
    }

    .hiw-step-label {
        font-size: 0.68rem;
    }

    .hiw-complete-cta.is-visible {
        flex-direction: column;
        text-align: center;
        max-height: 280px;
    }

    .hiw-complete-actions {
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .hiw-main {
        padding: 80px 0 48px;
    }

    .hiw-centered-wrap {
        padding: 0 12px;
    }

    .hiw-header {
        margin-bottom: 16px;
    }

    .hiw-eyebrow {
        font-size: 0.72rem;
        margin-bottom: 8px;
    }

    .hiw-title {
        font-size: 2rem;
        line-height: 1.1;
        letter-spacing: -0.03em;
        margin-bottom: 10px;
    }

    .hiw-lead {
        font-size: 0.96rem;
        line-height: 1.48;
    }

    /* Perfect compact mobile phone scale so entire device + progress map fit cleanly */
    .hiw-stage-card {
        --phone-scale: 0.72;
        padding: 50px 8px 20px;
        border-radius: 26px;
        margin-bottom: 12px;
    }

    .hiw-stage-toolbar {
        top: 12px;
        left: 12px;
        right: 12px;
    }

    .hiw-ctrl-btn {
        padding: 6px 11px;
        font-size: 0.75rem;
    }

    /* Compact Mobile Map Progress UI: keeps single sleek horizontal route line! */
    .hiw-minimap-dock {
        padding: 14px 14px 16px;
        border-radius: 22px;
    }

    .hiw-minimap-head {
        margin-bottom: 14px;
    }

    .hiw-coach-heading {
        font-size: 1.08rem;
    }

    .hiw-coach-text {
        font-size: 0.84rem;
    }

    .hiw-route-wrap {
        padding: 4px 2px 2px;
    }

    .hiw-minimap-line-bg {
        top: 12px;
    }

    .hiw-waypoint {
        width: 17px;
        height: 17px;
        border-width: 2px;
    }

    /* Hide cluttered labels on narrow phones — active step title is shown cleanly right above! */
    .hiw-step-label {
        display: none;
    }
}

@media (max-width: 390px) {
    .hiw-stage-card {
        --phone-scale: 0.66;
    }
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .is-highlighted,
    .ringing-glow,
    .app-screen-ringing.is-ringing .ringing-card,
    .settling-dot,
    .hiw-wp-pulse,
    .hiw-minimap-dock.is-pulse {
        animation: none !important;
    }

    .app-screen,
    .ios-friends-sheet,
    .ios-notif-banner,
    .ios-timejump-overlay,
    .stats-ring-progress,
    .stats-dist-green,
    .hiw-minimap-line-fill,
    .phone-cue {
        transition-duration: 0.08s !important;
    }
}
