/* Field investigator demo — dark-mode iPhone + dual voice channel
   Accent from Locarda iOS dark mode: Color(red: 0.35, green: 0.6, blue: 0.9) → #5999E6 */

.scene-field.workflow-section {
    --sf-accent: #5999e6;
    --sf-surface: #0b0b0d;
    --sf-glass: rgba(255, 255, 255, 0.08);
    max-width: none;
    padding: 5rem clamp(1.25rem, 4vw, 3rem) 4.5rem;
    background: linear-gradient(180deg, #070709 0%, #101218 50%, #0a0a0c 100%);
    overflow: hidden;
    text-align: left;
}

.scene-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
    text-align: left;
}

.scene-field .sf-intro {
    text-align: left;
}

.scene-field .pb-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.scene-field .pb-feature-icon {
    display: grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    color: var(--sf-accent);
}

.scene-field .pb-feature-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.scene-field .workflow-title {
    margin: 0 0 0.85rem;
    color: #f4f4f6;
    font-size: clamp(1.85rem, 3.4vw, 2.55rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
    text-align: left;
}

.scene-field .workflow-subtitle {
    margin: 0 0 1.35rem;
    max-width: 34rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 1.02rem;
    line-height: 1.55;
    text-align: left;
}

.scene-field .pb-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.75rem;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 0.92rem;
    font-weight: 650;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scene-field .pb-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.scene-field .pb-cta svg {
    width: 1rem;
    height: 1rem;
}

/* —— Command rail —— */
.sf-rail {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sf-rail-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        opacity 0.25s ease;
    opacity: 0.55;
}

.sf-rail-item:hover,
.sf-rail-item:focus-visible {
    opacity: 0.9;
    outline: none;
    border-color: rgba(89, 153, 230, 0.35);
}

.sf-rail-item.is-current {
    opacity: 1;
    background: rgba(89, 153, 230, 0.1);
    border-color: rgba(89, 153, 230, 0.45);
    box-shadow: 0 0 0 1px rgba(89, 153, 230, 0.15);
}

.sf-rail-item.is-done {
    opacity: 0.7;
}

.sf-rail-tag {
    display: inline-flex;
    align-items: center;
    margin-top: 0.15rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sf-rail-tag.is-content {
    background: rgba(89, 153, 230, 0.18);
    color: #9ec5f2;
}

.sf-rail-tag.is-command {
    background: rgba(196, 90, 82, 0.22);
    color: #f0b4ae;
}

.sf-rail-body strong {
    display: block;
    margin-bottom: 0.15rem;
    color: #f2f2f5;
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.35;
}

.sf-rail-body span {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    line-height: 1.35;
}

.scene-field-note {
    margin: 1.35rem 0 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

/* —— Phone stage + night backdrop —— */
.sf-phone-stage {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 640px;
}

.sf-night {
    position: absolute;
    inset: -8% -18%;
    border-radius: 40%;
    background:
        radial-gradient(ellipse 45% 55% at 72% 38%, rgba(255, 236, 180, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 80% at 50% 60%, rgba(20, 28, 48, 0.9), transparent 70%),
        radial-gradient(circle at 30% 80%, rgba(0, 0, 0, 0.55), transparent 50%);
    pointer-events: none;
    filter: blur(2px);
}

.sf-phone {
    --sf-w: 292px;
    --sf-h: 600px;
    --sf-r: 48px;
    --sf-bezel: 10px;
    position: relative;
    z-index: 1;
    width: var(--sf-w);
    height: var(--sf-h);
    border-radius: calc(var(--sf-r) + 2px);
    background: linear-gradient(160deg, #3a3a3e 0%, #1c1c1f 40%, #0e0e10 100%);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.65),
        0 2px 0 rgba(255, 255, 255, 0.12) inset,
        0 -1px 0 rgba(0, 0, 0, 0.5) inset;
    padding: var(--sf-bezel);
}

.sf-phone::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 118px;
    width: 3px;
    height: 28px;
    border-radius: 2px 0 0 2px;
    background: #2a2a2e;
    box-shadow: 0 42px 0 #2a2a2e, 0 78px 0 #2a2a2e;
}

.sf-phone::after {
    content: "";
    position: absolute;
    right: -2px;
    top: 160px;
    width: 3px;
    height: 56px;
    border-radius: 0 2px 2px 0;
    background: #2a2a2e;
}

.sf-phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--sf-r);
    overflow: hidden;
    background: var(--sf-surface);
    color: #f2f2f5;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.sf-status {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px 0;
    height: 54px;
    font-size: 12px;
    font-weight: 650;
    color: #f5f5f7;
    pointer-events: none;
}

.sf-dynamic-island {
    position: absolute;
    top: 11px;
    left: 50%;
    z-index: 6;
    width: 96px;
    height: 28px;
    margin-left: -48px;
    border-radius: 20px;
    background: #000;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.sf-home-bar {
    position: absolute;
    left: 50%;
    bottom: 7px;
    z-index: 8;
    width: 108px;
    height: 4px;
    margin-left: -54px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.sf-app {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding-top: 54px;
    background:
        radial-gradient(120% 70% at 50% -8%, rgba(89, 153, 230, 0.16), transparent 50%),
        var(--sf-surface);
}

.sf-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 14px 10px;
}

.sf-nav-back {
    color: var(--sf-accent);
    font-size: 13px;
    font-weight: 550;
}

.sf-nav-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.sf-nav-title strong {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sf-nav-title span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

.sf-nav-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(89, 153, 230, 0.18);
    color: var(--sf-accent);
    font-size: 10px;
    font-weight: 700;
}

.sf-mode-pill {
    align-self: center;
    display: flex;
    gap: 2px;
    margin: 0 14px 8px;
    padding: 3px;
    border-radius: 999px;
    background: var(--sf-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.sf-mode-pill span {
    padding: 5px 10px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-weight: 650;
}

.sf-mode-pill span.is-on {
    background: rgba(255, 255, 255, 0.12);
    color: var(--sf-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Scene photos strip — reveals after photo beat */
.sf-photos {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 8px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transition:
        max-height 0.45s ease,
        opacity 0.35s ease,
        margin 0.35s ease,
        padding 0.35s ease;
}

.sf-phone[data-beat="photo"] .sf-photos,
.sf-phone[data-beat="bullets"] .sf-photos,
.sf-phone[data-beat="drop"] .sf-photos,
.sf-phone[data-beat="undo"] .sf-photos,
.sf-phone[data-beat="pause"] .sf-photos,
.sf-phone[data-beat="done"] .sf-photos {
    max-height: 56px;
    opacity: 1;
    margin: 0 12px 8px;
    padding: 6px 8px;
}

.sf-photos-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.sf-photos-row {
    display: flex;
    gap: 6px;
}

.sf-photo-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 236, 180, 0.35), transparent 50%),
        linear-gradient(180deg, #2a3144 0%, #151820 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transform: scale(0.6);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.sf-phone[data-beat="photo"] .sf-photo-thumb,
.sf-phone[data-beat="bullets"] .sf-photo-thumb,
.sf-phone[data-beat="drop"] .sf-photo-thumb,
.sf-phone[data-beat="undo"] .sf-photo-thumb,
.sf-phone[data-beat="pause"] .sf-photo-thumb,
.sf-phone[data-beat="done"] .sf-photo-thumb {
    transform: scale(1);
    opacity: 1;
}

/* Continuous document */
.sf-doc {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0 10px 110px;
}

.sf-doc-scroll {
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sf-section {
    position: relative;
    padding: 12px 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 0.45;
    max-height: 200px;
    overflow: hidden;
    transition:
        opacity 0.4s ease,
        background 0.35s ease,
        box-shadow 0.35s ease,
        max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.45s ease,
        border-width 0.35s ease,
        margin 0.45s ease;
}

.sf-section:last-child {
    border-bottom: 0;
}

.sf-section.has-text,
.sf-section.is-focus {
    opacity: 1;
}

.sf-section.is-focus {
    background: rgba(89, 153, 230, 0.08);
    box-shadow: inset 3px 0 0 var(--sf-accent);
}

.sf-section-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.sf-section-h strong {
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.4);
}

.sf-section.is-focus .sf-section-h strong {
    color: var(--sf-accent);
}

.sf-section-h em {
    font-style: normal;
    font-size: 10px;
    font-weight: 650;
    color: rgba(255, 255, 255, 0.35);
    font-variant-numeric: tabular-nums;
}

.sf-section-h em.is-done {
    color: #5dce7a;
}

.sf-section-body {
    min-height: 2.4em;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12.5px;
    line-height: 1.45;
}

.sf-section-body .sf-placeholder {
    color: rgba(255, 255, 255, 0.32);
}

.sf-section-body .sf-text {
    display: none;
}

.sf-section.has-text .sf-placeholder {
    display: none;
}

.sf-section.has-text .sf-text:not(.sf-text-bullets) {
    display: inline;
}

.sf-section.has-text .sf-text-bullets {
    display: none;
}

/* Bullets beat: reflow notification section */
.sf-phone[data-beat="bullets"] .sf-section[data-sf="notify"].has-text .sf-text-para,
.sf-phone[data-beat="drop"] .sf-section[data-sf="notify"].has-text .sf-text-para,
.sf-phone[data-beat="undo"] .sf-section[data-sf="notify"].has-text .sf-text-para,
.sf-phone[data-beat="pause"] .sf-section[data-sf="notify"].has-text .sf-text-para,
.sf-phone[data-beat="done"] .sf-section[data-sf="notify"].has-text .sf-text-para {
    display: none;
}

.sf-phone[data-beat="bullets"] .sf-section[data-sf="notify"].has-text .sf-text-bullets,
.sf-phone[data-beat="drop"] .sf-section[data-sf="notify"].has-text .sf-text-bullets,
.sf-phone[data-beat="undo"] .sf-section[data-sf="notify"].has-text .sf-text-bullets,
.sf-phone[data-beat="pause"] .sf-section[data-sf="notify"].has-text .sf-text-bullets,
.sf-phone[data-beat="done"] .sf-section[data-sf="notify"].has-text .sf-text-bullets {
    display: block;
    margin: 0;
    padding-left: 1.1em;
}

.sf-text-bullets li {
    margin: 0.15em 0;
}

.sf-section.is-streaming .sf-cursor {
    display: inline;
    margin-left: 1px;
    color: var(--sf-accent);
    animation: sf-blink 0.7s steps(1) infinite;
}

.sf-cursor {
    display: none;
}

@keyframes sf-blink {
    50% { opacity: 0; }
}

/* Drop clothing section — driven by .is-removed from the beat engine */
.sf-section.is-removed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0;
    opacity: 0 !important;
    border-bottom-width: 0;
    pointer-events: none;
}

/* Camera overlay */
.sf-camera {
    position: absolute;
    inset: 54px 0 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: #0a0a0c;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12%);
    transition:
        opacity 0.4s ease,
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.4s;
}

.sf-phone[data-beat="photo"] .sf-camera {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.sf-camera-view {
    position: relative;
    flex: 1;
    margin: 8px 10px;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 55% 40%, rgba(255, 230, 160, 0.18), transparent 55%),
        linear-gradient(180deg, #1a2030 0%, #0e121a 100%);
}

.sf-camera-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 33% / 100% 33%,
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 33% 0 / 33% 100%;
    opacity: 0.5;
}

.sf-camera-hint {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    font-weight: 600;
}

.sf-shutter-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.sf-phone[data-beat="photo"].is-flash .sf-shutter-flash {
    animation: sf-flash 0.35s ease-out;
}

@keyframes sf-flash {
    0% { opacity: 0.85; }
    100% { opacity: 0; }
}

.sf-camera-chrome {
    display: flex;
    justify-content: center;
    padding: 14px 0 28px;
}

.sf-shutter-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35) inset;
}

/* Undo toast */
.sf-undo-toast {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 108px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(28, 28, 32, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.sf-phone[data-beat="drop"] .sf-undo-toast {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sf-undo-toast strong {
    font-size: 11px;
    font-weight: 700;
    color: #f2f2f5;
}

.sf-undo-toast span {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.55);
}

/* Floating dictation island */
.sf-island-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 22px;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 14px 10px;
    border-radius: 26px;
    background: var(--sf-glass);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 -4px 16px rgba(0, 0, 0, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: blur(22px) saturate(1.45);
    -webkit-backdrop-filter: blur(22px) saturate(1.45);
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.sf-phone[data-beat]:not([data-beat="idle"]) .sf-island-bar {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sf-orb-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}

.sf-orb-shell {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 210, 205, 0.35);
    background:
        radial-gradient(circle at 30% 26%, rgba(255, 180, 170, 0.55), transparent 42%),
        radial-gradient(circle at 70% 78%, rgba(90, 20, 18, 0.45), transparent 55%),
        linear-gradient(155deg, #c45a52 0%, #a03d38 48%, #7a2a26 100%);
    box-shadow:
        0 0 0 5px rgba(176, 70, 64, 0.14),
        0 8px 16px rgba(90, 28, 24, 0.26),
        inset 0 1.5px 0 rgba(255, 220, 215, 0.35);
}

.sf-orb-canvas {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.sf-island-cap {
    font-size: 11px;
    font-weight: 650;
    color: rgba(255, 255, 255, 0.85);
}

/* Paused state */
.sf-phone[data-beat="pause"] .sf-orb-wrap {
    opacity: 0.45;
    filter: grayscale(0.35);
    transform: scale(0.92);
}

.sf-phone[data-beat="pause"] .sf-island-cap {
    color: rgba(255, 255, 255, 0.5);
}

.sf-phone[data-beat="pause"] .sf-section.is-streaming .sf-cursor {
    animation: none;
    opacity: 0.3;
}

@media (max-width: 980px) {
    .scene-field-grid {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }

    .sf-phone-stage {
        min-height: 0;
        order: -1;
    }
}

@media (max-width: 420px) {
    .sf-phone {
        --sf-w: 270px;
        --sf-h: 556px;
        --sf-r: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sf-section.is-streaming .sf-cursor,
    .sf-phone[data-beat="photo"].is-flash .sf-shutter-flash {
        animation: none !important;
    }

    .sf-rail-item,
    .sf-section,
    .sf-island-bar,
    .sf-camera,
    .sf-undo-toast,
    .sf-photos,
    .sf-photo-thumb,
    .sf-orb-wrap {
        transition: none !important;
    }

    /* Finished end state: photo attached, bullets applied, clothing restored, paused */
    .scene-field .sf-phone[data-beat="done"] .sf-photos,
    .scene-field .sf-phone[data-beat="done"] .sf-photo-thumb {
        max-height: 56px;
        opacity: 1;
        margin: 0 12px 8px;
        padding: 6px 8px;
        transform: scale(1);
    }

    .scene-field .sf-phone[data-beat="done"] .sf-camera,
    .scene-field .sf-phone[data-beat="done"] .sf-undo-toast {
        opacity: 0;
        visibility: hidden;
    }

    .scene-field .sf-phone[data-beat="done"] .sf-orb-wrap {
        opacity: 0.45;
        filter: grayscale(0.35);
        transform: scale(0.92);
    }
}
