/* Red Door phase B, batch 4: in-world app styles (see js/README.md §7).
   Browser, Calculator, Weather, Camera, Comms, Cipher, Trace, Deaddrop + the shared confirmationDialog (os/confirmation-dialog.js).
   Numbers are the SwiftUI values from the matching Views/OS/*.swift file. */

.serif { font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif; }
.b4-white55 { color: rgba(255, 255, 255, 0.55); } .b4-white65 { color: rgba(255, 255, 255, 0.65); } .b4-white70 { color: rgba(255, 255, 255, 0.7); }
.b4-fill-center { min-height: 100%; display: grid; place-items: center; }
.b4-panel-rows, .b4-comms .form-rows { background: var(--panel); }
.b4-destructive { color: #ff453a; }
.b4-destructive:active, .b4-comms-row:active, .b4-trace-row:active { background: rgba(255, 255, 255, 0.06); }
.b4-grouped { padding: 0 16px 24px; }

/* ---------- confirmationDialog (action sheet) ---------- */
.cdialog-wrap { position: absolute; inset: 0; z-index: 50; }
.cdialog-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.cdialog { position: absolute; left: 8px; right: 8px; bottom: calc(var(--sab) + 8px); display: flex; flex-direction: column; gap: 8px; }
.cdialog-group { border-radius: 14px; overflow: hidden; background: rgba(40, 40, 40, 0.86); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); }
.cdialog-group:last-child { background: #2c2c2e; }
.cdialog-head { padding: 14px 16px; text-align: center; color: var(--text2); }
.cdialog-title { font-size: 13px; line-height: 18px; font-weight: 600; }
.cdialog-message { font-size: 13px; line-height: 18px; margin-top: 2px; }
.cdialog-btn { display: block; width: 100%; min-height: 57px; padding: 0 16px; font-size: 20px; text-align: center; color: inherit; }
.cdialog-head + .cdialog-btn, .cdialog-btn + .cdialog-btn { border-top: 0.5px solid var(--separator); }
.cdialog-btn.cancel { font-weight: 600; }
.cdialog-btn.destructive { color: #ff453a; }
.cdialog-btn:active, .cdialog-btn:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }

/* ---------- Calculator ---------- */
.b4-calc-body { display: flex; flex-direction: column; }
.b4-calc { flex: 1 0 auto; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.b4-calc-egg { padding: 0 16px; text-align: center; }
.b4-calc-display { padding: 0 24px; font: 300 64px/1.2 var(--mono); color: var(--text); text-align: right; white-space: nowrap; overflow: hidden; }
.b4-calc-keys { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 12px 24px; }
.b4-calc-row { display: flex; gap: 10px; }
.b4-calc-row:has(.wide) { align-self: stretch; }
.b4-calc-key { display: grid; place-items: center; min-width: 64px; min-height: 64px; border-radius: 16px; background: var(--panel); color: var(--text); text-align: center; transition: opacity 0.15s; }
.b4-calc-key.op { color: var(--accent); }
.b4-calc-key.wide { flex: 1 1 auto; }
.b4-calc-key:active { opacity: 0.4; transition: none; }

/* ---------- Weather ---------- */
.b4-wx-body { overflow-x: hidden; }
.b4-ptr-wrap { position: relative; will-change: transform; }
.b4-ptr { position: absolute; left: 50%; top: -42px; width: 28px; height: 28px; margin-left: -14px; opacity: 0; pointer-events: none; }
.b4-ptr i { position: absolute; left: 12.75px; top: 0; width: 2.5px; height: 8px; border-radius: 2px; background: var(--text2); transform-origin: 1.25px 14px; }
.b4-ptr.spin i { animation: b4-tick 0.8s linear infinite; }
@keyframes b4-tick { from { opacity: 1; } to { opacity: 0.25; } }
.b4-wx { display: flex; flex-direction: column; align-items: stretch; gap: 28px; }
.b4-wx-hero-wrap { padding: 0 20px; }
.b4-wx-hero { position: relative; height: 150px; border-radius: 18px; overflow: hidden; background: var(--panel); }
.b4-wx-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b4-wx-hero-title { position: absolute; left: 0; bottom: 0; padding: 16px; color: #fff; text-shadow: 0 0 4px rgba(0, 0, 0, 0.33); }
.b4-wx-now { padding-top: 24px; }
.b4-wx-temp { font: 100 76px/1.19 var(--rounded); color: var(--text); }
.b4-wx-note { padding: 0 32px; text-align: center; }
.b4-wx-label { letter-spacing: 2px; }
.b4-wx-strip { display: flex; gap: 22px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.b4-wx-strip::-webkit-scrollbar { display: none; }
.b4-wx-strip > * { flex: none; }
.b4-wx-days { margin: 0 20px; background: var(--panel); border-radius: 14px; overflow: hidden; }
.b4-wx-day { display: flex; align-items: center; gap: 8px; padding: 10px 20px; }
.b4-wx-day-icon { width: 30px; display: grid; place-items: center; font-size: 17px; }
.b4-wx-divider { height: 0.5px; background: var(--panel-light); }
.b4-wx-panel { display: flex; flex-direction: column; align-items: flex-start; margin: 0 20px; padding: 20px; background: var(--panel); border-radius: 18px; }
.b4-wx-panel .label { gap: 8px; }
.b4-wx-route { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); color: var(--text); text-align: left; }
.b4-wx-route.on { color: var(--accent); }
.b4-wx-route .c-text2 { color: var(--text2); }
.b4-wx-route-mark { font-size: 17px; line-height: 0; }
.b4-wx-route:active { opacity: 0.6; }

/* ---------- Comms ---------- */
.b4-comms-row { padding-top: 15px; padding-bottom: 15px; }
.b4-comms-transcript { padding: 20px; }
.b4-comms-full { line-height: 24px; }

/* ---------- Cipher ---------- */
.b4-cipher { padding: 20px; }
.b4-cipher-buttons { min-height: 44px; }
.b4-cipher-caption { letter-spacing: 1px; }
.b4-cipher-input { display: block; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--panel); color: var(--text); line-height: 18px; resize: none; outline: none; overflow-y: auto; }
.b4-cipher-input::placeholder { color: rgba(235, 235, 245, 0.3); }
.b4-cipher-output { padding: 12px; border-radius: 10px; background: var(--panel); white-space: pre-wrap; overflow-wrap: anywhere; }
.b4-cipher-copy { align-self: flex-start; }
.b4-cipher-copy:active { opacity: 0.4; }
/* Slider(value:in:step:).tint(Theme.accent) */
.b4-slider { --fill: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; }
.b4-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill), rgba(120, 120, 128, 0.32) var(--fill)); }
.b4-slider::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill), rgba(120, 120, 128, 0.32) var(--fill)); }
.b4-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12); }
.b4-slider::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12); }

/* ---------- Trace ---------- */
.b4-trace-stats { display: flex; gap: 8px; margin-top: 20px; }
.b4-trace-stat { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; border-radius: 12px; background: var(--panel); }
.b4-trace-row { align-items: stretch; gap: 12px; }
.b4-trace-rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; flex: none; }
.b4-trace-rail .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.b4-trace-rail .line { width: 2px; flex: 1 1 auto; min-height: 8px; background: var(--panel-light); }
.b4-row-chevron { align-self: center; font-size: 12px; color: var(--text2); }
.b4-row-chevron .sf { stroke-width: 2.6; }
.b4-trace-photo img { display: block; width: 100%; border-radius: 16px; }

/* ---------- Deaddrop ---------- */
.b4-dd { padding: 18px; }
.b4-dd-header { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--panel); }
.b4-dd-glyph { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 24px; }
.b4-dd-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 14px; background: var(--panel); text-align: left; }
.b4-dd-row:active { filter: brightness(1.3); }
.b4-dd-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--panel-light); font-size: 20px; flex: none; }
.b4-dd-chevron { font-size: 12px; margin-left: 4px; }
.b4-dd-chevron .sf { stroke-width: 3; }

/* ---------- Camera ---------- */
.screen.b4-camera { background: #000; }
.b4-camera .navbar { z-index: 3; background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.b4-camera .screen-inset { position: relative; z-index: 3; }
.b4-cam-layer { position: absolute; inset: 0; z-index: 0; background: #000; overflow: hidden; }
.b4-cam-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.b4-cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.b4-cam-body { position: relative; z-index: 1; display: flex; flex-direction: column; overflow: hidden; color: #fff; }
.b4-cam-unavailable { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: rgba(255, 255, 255, 0.4); pointer-events: none; }
.b4-cam-meter { font-size: 40px; line-height: 1; }
.b4-cam-grid { position: absolute; inset: 0; pointer-events: none; }
.b4-cam-grid i { position: absolute; background: rgba(255, 255, 255, 0.3); }
.b4-cam-grid i:nth-child(1), .b4-cam-grid i:nth-child(2) { top: 0; bottom: 0; width: 1px; }
.b4-cam-grid i:nth-child(1) { left: 33.333%; } .b4-cam-grid i:nth-child(2) { left: 66.667%; }
.b4-cam-grid i:nth-child(3), .b4-cam-grid i:nth-child(4) { left: 0; right: 0; height: 1px; }
.b4-cam-grid i:nth-child(3) { top: 33.333%; } .b4-cam-grid i:nth-child(4) { top: 66.667%; }
.b4-cam-controls { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; align-items: stretch; }
.b4-cam-top { padding: 20px; color: #fff; }
.b4-cam-icon { display: grid; place-items: center; width: 44px; height: 44px; font-size: 22px; color: #fff; }
.b4-cam-icon:active { opacity: 0.4; }
.b4-cam-toast { align-self: center; padding: 0 40px 8px; color: #fff; }
.b4-cam-recent-row { padding: 0 24px 14px; }
.b4-cam-recent-row:has(.tappable) { cursor: pointer; }
.b4-cam-recent { color: #fff; }
.b4-cam-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65); flex: none; }
.b4-cam-shutter-wrap { display: flex; justify-content: center; padding-bottom: 50px; }
.b4-cam-shutter { position: relative; width: 80px; height: 80px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
.b4-cam-shutter span { width: 64px; height: 64px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.b4-cam-shutter:active:not(:disabled) span { opacity: 0.7; }
.b4-cam-shutter:disabled { opacity: 1; }
.b4-cam-shutter.dim { opacity: 0.3; }

/* ---------- Browser ---------- */
.b4-br-body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.b4-br { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.b4-br-panel { flex: none; margin: 12px; border-radius: 14px; background: var(--panel); }
.b4-br-bar { gap: 8px; padding-left: 14px; }
.b4-br-archive { font-size: 17px; line-height: 0; }
.b4-br-input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); outline: none; }
.b4-br-input::placeholder { color: rgba(235, 235, 245, 0.3); }
.b4-br-go { display: grid; place-items: center; width: 44px; height: 44px; font-size: 20px; flex: none; }
.b4-br-go:active { opacity: 0.4; }
.b4-br-suggest { padding-bottom: 6px; }
.b4-br-sugg { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; text-align: left; color: var(--text); }
.b4-br-sugg:active { background: rgba(255, 255, 255, 0.06); }
.b4-br-sugg-img { width: 32px; height: 28px; border-radius: 5px; object-fit: cover; flex: none; }
.b4-br-sugg-img.glyph { display: grid; place-items: center; font-size: 17px; }
.b4-br-content { position: relative; flex: 1 1 auto; min-height: 0; }
.b4-br-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.b4-br-toolbar { flex: none; display: flex; align-items: center; padding: 0 12px var(--sab); background: var(--panel); }
.b4-br-tool { display: grid; place-items: center; width: 44px; height: 44px; font-size: 20px; color: var(--accent); }
.b4-br-tool:active { opacity: 0.4; }
.b4-br-tool:disabled { opacity: 1; color: rgba(235, 235, 245, 0.3); }
.b4-br-hero { font: 500 34px/41px ui-serif, "New York", "Iowan Old Style", Georgia, serif; }
.b4-br-tiles { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; row-gap: 12px; }
.b4-br-tile { display: flex; flex-direction: column; gap: 8px; border-radius: 14px; overflow: hidden; background: var(--panel); text-align: left; color: var(--text); }
.b4-br-tile img { display: block; width: 100%; height: 104px; object-fit: cover; }
.b4-br-tile-name { padding: 0 10px 12px; }
.b4-br-tile:active { filter: brightness(1.3); }
.b4-br-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; text-align: left; color: var(--text); }
.b4-br-row:active { opacity: 0.6; }
.b4-br-row-img { width: 52px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; }
.b4-br-row-img.glyph { display: grid; place-items: center; background: var(--panel-light); }
.b4-br-lrow { padding: 3px 16px; }

/* ArchivePageView — a saved site in its own house style */
.b4-ap { --ink: rgb(33, 46, 48); --paper: rgb(247, 245, 235); --ap: rgb(140, 56, 46); background: var(--paper); color: var(--ink); }
.b4-ap.style-industrial { --ap: rgb(23, 71, 99); }
.b4-ap.style-parcel { --ap: rgb(97, 46, 148); }
.b4-ap.style-cafe { --ap: rgb(79, 92, 51); }
.b4-ap.style-travel { --ap: rgb(41, 102, 110); }
.b4-ap.style-terminal { --ink: var(--text); --paper: var(--panel); --ap: var(--accent); }
.b4-ap-brand { padding: 20px; font-weight: 900; background: var(--ap); color: #fff; }
.b4-ap.style-terminal .b4-ap-brand { color: #000; }
.b4-ap-category { padding: 20px; letter-spacing: 1px; color: var(--ap); }
.b4-ap-head { padding: 0 20px 24px; }
.b4-ap-image { display: block; width: 100%; height: 210px; object-fit: cover; }
.b4-ap-body { padding: 22px; }
.b4-ap-accent { color: var(--ap); }
.b4-ap-text { line-height: 28px; }
.b4-ink75 { color: color-mix(in srgb, var(--ink) 75%, transparent); }
.b4-ink65 { color: color-mix(in srgb, var(--ink) 65%, transparent); }
.b4-ink60 { color: color-mix(in srgb, var(--ink) 60%, transparent); }
.b4-ap-divider { height: 0.5px; background: color-mix(in srgb, var(--ink) 20%, transparent); }
.b4-ap-related { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 0; color: var(--ap); text-align: left; }
.b4-ap-related:active { opacity: 0.5; }
.b4-ap-form { padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--ap) 8%, transparent); }
.b4-ap-field { flex: 1 1 auto; min-width: 0; padding: 12px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.55); color: var(--ink); outline: none; font-size: 17px; }
.b4-ap-field::placeholder { color: color-mix(in srgb, var(--ink) 35%, transparent); }
.b4-ap-check { flex: none; min-height: 44px; padding: 0 12px; border-radius: 999px; background: var(--ap); color: #fff; }
.b4-ap-check:active { opacity: 0.7; }
.b4-ap ::selection { background: color-mix(in srgb, var(--ap) 30%, transparent); }
.b4-wx-now { align-items: center; }
