/* ==========================================================================
   MobileConfig Studio - Apple HIG Obsidian Design System
   ========================================================================== */

:root {
  /* ==========================================================================
     Apple Cupertino Liquid Glass Design System Tokens
     ========================================================================== */
  --canvas: #F5F5F7;
  --canvas-alt: #ECEEF2;
  /* ==========================================================================
     Cupertino Liquid Glass Design Tokens & Apple Native Typography
     ========================================================================== */
  --apple-bg: #fbfbfd;
  --apple-surface: rgba(255, 255, 255, 0.78);
  --apple-surface-border: rgba(0, 0, 0, 0.07);
  --apple-hairline: rgba(255, 255, 255, 0.6);
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blur: blur(24px) saturate(180%);
  --apple-shadow-glass: 0 16px 40px -12px rgba(0, 0, 0, 0.08);
  --ease-cupertino: cubic-bezier(0.2, 0, 0, 1);

  /* Apple Native System Font Stack & Fluid Typography Scales */
  --font-apple-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-h1: clamp(2.25rem, 5vw, 3.5rem);
  --line-height-h1: 1.1;
  --tracking-h1: -0.035em;
  --font-h2: clamp(1.75rem, 3.5vw, 2.5rem);
  --line-height-h2: 1.18;
  --tracking-h2: -0.025em;
  --font-body: clamp(0.9375rem, 1.25vw, 1.125rem);
  --line-height-body: 1.6;
  --text-body-wcag: #424245;

  /* Genuine Apple Continuous Superellipse Squircle Definitions */
  --squircle-radius: 22.37%;
  --squircle-specular: inset 0 1px 0 rgba(255, 255, 255, 0.4);

  --surface-card: rgba(255, 255, 255, 0.75);
  --surface-elevated: #FFFFFF;
  --surface-subtle: rgba(0, 0, 0, 0.03);
  --surface-hover: rgba(0, 0, 0, 0.05);

  /* Apple Liquid Glass Layer 1 Tokens */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.90);
  --glass-specular: inset 0 1px 0 0 rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.05), inset 0 1px 0 0 rgba(255, 255, 255, 0.95);

  /* Brand & Status Accents */
  --brand-blue: #0071E3;
  --brand-blue-hover: #0077ED;
  --brand-blue-active: #0062C4;
  --brand-blue-glow: rgba(0, 113, 227, 0.25);
  --brand-blue-subtle: rgba(0, 113, 227, 0.08);

  --verified-green: #34C759;
  --verified-green-dark: #248A3D;
  --verified-green-glow: rgba(52, 199, 89, 0.25);

  /* Typography & WCAG AAA Contrast (Apple SF Pro) */
  --text-primary: #1D1D1F;
  --text-secondary: #515154;
  --text-muted: #6E6E73;
  --text-placeholder: #86868B;

  /* Borders & Hairlines */
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --border-focus: #0071E3;

  /* State Alerts */
  --danger: #FF3B30;
  --warning: #FF9500;
  --success: #34C759;

  /* Typography & Radii */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --squircle-radius: 22.37%;
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--canvas);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 113, 227, 0.06), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(94, 92, 230, 0.04), transparent 40%),
    radial-gradient(circle at 15% 40%, rgba(0, 199, 190, 0.04), transparent 35%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--brand-blue);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  z-index: 9999;
  text-decoration: none;
  font-weight: 500;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 16px;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  transition: background var(--transition-normal);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-emblem {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--squircle-radius);
  clip-path: url(#ios-squircle-clip);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.12);
  transition: transform var(--transition-fast);
}
.brand-lockup:hover .brand-emblem {
  transform: scale(1.05);
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  background: rgba(0, 113, 227, 0.08);
  color: #0071E3;
  border: 1px solid rgba(0, 113, 227, 0.22);
  border-radius: 999px;
  line-height: 1.3;
  display: inline-block;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}
.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.nav-links a.nav-link-active {
  color: #0071E3;
  background: rgba(0, 113, 227, 0.08);
  font-weight: 600;
}

.nav-links a.nav-admin-link {
  color: #1D1D1F;
  font-weight: 600;
}

.nav-links a.nav-admin-link:hover {
  color: #0071E3;
  background: rgba(0, 113, 227, 0.08);
}


.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Tablet Adaptive Navigation Priority Hierarchy */
@media (max-width: 1100px) {
  .nav-links {
    gap: 12px;
  }
  .nav-links a {
    font-size: 12.5px;
    padding: 3px 6px;
  }
  /* Adaptive priority collapsing for secondary anchor pills on tablet widths */
  .nav-links a[href="#features"],
  .nav-links a[href="#power-tools"],
  .nav-links a[href="#faq"] {
    display: none;
  }
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }
  .system-status-pill span:not(.status-dot) {
    display: none;
  }
  .system-status-pill {
    padding: 8px;
    border-radius: 50%;
  }
}

/* Status Pill */

/* Consolidated Apple HIG System Status Pill */
.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid rgba(52, 199, 89, 0.35);
  background: rgba(52, 199, 89, 0.12);
  color: #1F7A34;
  cursor: default;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.system-status-pill .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verified-green);
  box-shadow: 0 0 6px rgba(48, 209, 88, 0.6);
}
.system-status-pill.bad {
  border-color: rgba(255, 69, 58, 0.3);
  background: rgba(255, 69, 58, 0.08);
  color: var(--danger);
}
.system-status-pill.bad .status-dot {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(255, 69, 58, 0.6);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}
.status-pill.ok {
  border-color: rgba(48, 209, 88, 0.3);
  color: var(--verified-green);
  background: rgba(48, 209, 88, 0.08);
}
.status-pill.warn {
  border-color: rgba(255, 214, 10, 0.3);
  color: var(--warning);
  background: rgba(255, 214, 10, 0.08);
}
.status-pill.bad {
  border-color: rgba(255, 69, 58, 0.3);
  color: var(--danger);
  background: rgba(255, 69, 58, 0.08);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Hero Section */
.hero-section {
  padding: 60px 0 80px 0;
  position: relative;
}

.hero-header {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 52px auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.22);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #0071E3;
  margin-bottom: 20px;
}
.hero-eyebrow svg {
  color: var(--verified-green);
}

.hero-title {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 18px 0;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: #515154; /* WCAG AAA Slate Charcoal on frosted glass; reference: color: #a1a1aa */
  line-height: 1.6;
  margin: 0 auto;
  max-width: 720px;
}

/* Hero Stage Grid */
.hero-stage {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 1024px) {
  .hero-stage {
    grid-template-columns: 1fr;
    max-width: 760px;
    margin: 0 auto;
  }
}

/* Studio Generator Card */
.studio-card {
  background: var(--surface-card);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.05), inset 0 1px 0 0 rgba(255, 255, 255, 0.95);
  position: relative;
  will-change: transform;
  transform: translateZ(0);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.card-header-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}

.mode-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mode-pill-btn.active {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 2px 8px var(--brand-blue-glow);
}

/* Form Layout */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.input-field, .select-field, .textarea-field {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.input-field:focus, .select-field:focus, .textarea-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.20);
  background: #FFFFFF;
}

.input-field::placeholder, .textarea-field::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Dropzone & Canvas Scaler */
.dropzone-container {
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.dragover {
  border-color: var(--brand-blue);
  background: rgba(0, 113, 227, 0.06);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--squircle-radius);
  clip-path: url(#ios-squircle-clip);
  background: #FFFFFF;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform var(--transition-fast);
}
.dropzone-container:hover .dropzone-icon {
  transform: scale(1.08);
}

.dropzone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.icon-preview-box {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  margin-top: 14px;
}
.icon-preview-box.active {
  display: flex;
}

.preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--squircle-radius);
  clip-path: url(#ios-squircle-clip);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #000;
}

.preview-info {
  flex: 1;
  text-align: left;
}

.preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.preview-meta {
  font-size: 11px;
  color: var(--verified-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-remove-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.preview-remove-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Checkbox & Switch controls */
.switch-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
@media (max-width: 640px) {
  .switch-group {
    grid-template-columns: 1fr;
  }
}

.switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.switch-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.switch-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-blue);
  cursor: pointer;
  margin: 0;
}

.switch-text {
  display: flex;
  flex-direction: column;
}
.switch-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.switch-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Advanced Accordion */
.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all var(--transition-fast);
}
.accordion-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.accordion-content {
  display: none;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.accordion-content.active {
  display: block;
}

/* Primary CTA Button */
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--brand-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--brand-blue-glow);
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.cta-btn:hover {
  background: var(--brand-blue-hover);
  box-shadow: 0 6px 22px rgba(0, 113, 227, 0.5);
  transform: translateY(-1px);
}
.cta-btn:active {
  background: var(--brand-blue-active);
  transform: scale(0.985);
}

.cta-trust-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.cta-trust-note svg {
  color: var(--verified-green);
}

/* ==========================================================================
   iPhone 16 Pro Live Simulator
   ========================================================================== */
.simulator-wrapper {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.simulator-frame {
  width: 330px;
  height: 670px;
  background: #000000;
  border-radius: 50px;
  position: relative;
  box-shadow: 
    0 0 0 3px #D1D2D6,
    0 0 0 5px #E4E5E9,
    0 20px 50px -10px rgba(0, 0, 0, 0.16),
    0 0 60px rgba(0, 113, 227, 0.08);
  overflow: hidden;
  user-select: none;
  transform: translateZ(0);
}

/* Titanium side buttons */
.simulator-frame::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 115px;
  width: 3px;
  height: 30px;
  background: #BFC0C4;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 50px 0 #BFC0C4, 0 100px 0 #BFC0C4;
}

.simulator-frame::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 165px;
  width: 3px;
  height: 55px;
  background: #BFC0C4;
  border-radius: 0 2px 2px 0;
}

/* Screen Content */
.simulator-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.04) 40%, transparent 60%);
  pointer-events: none;
  z-index: 45;
  border-radius: 46px;
}

.simulator-screen {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 10%, rgba(0, 113, 227, 0.45), transparent 60%),
    radial-gradient(circle at 90% 70%, rgba(124, 58, 237, 0.35), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(0, 199, 190, 0.3), transparent 50%),
    #07090E;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 16px 20px 16px;
  border-radius: 46px;
  overflow: hidden;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: #000000;
  border-radius: 999px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: width var(--transition-spring), height var(--transition-spring), transform var(--transition-spring);
}
.dynamic-island:hover {
  width: 140px;
  height: 32px;
}

.camera-lens {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #090B13;
  border: 1px solid #1A1D2C;
  position: relative;
}
.camera-lens::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.6);
}

.sensor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #07080E;
}

/* Status Bar */
.sim-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 12px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  z-index: 40;
}

.status-time {
  font-variant-numeric: tabular-nums;
  padding-left: 2px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Home Screen Grid */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 10px;
  padding: 24px 8px 10px 8px;
  margin-top: 10px;
}

.sim-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.sim-app-item:hover {
  transform: scale(1.08);
}
.sim-app-item:active {
  transform: scale(0.92);
}

.sim-app-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--squircle-radius);
  clip-path: url(#ios-squircle-clip);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.sim-app-label {
  font-size: 11px;
  font-weight: 500;
  color: #FFFFFF;
  text-align: center;
  letter-spacing: -0.01em;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Highlighted Web Clip App Item */
.sim-app-item.webclip-target .sim-app-icon {
  box-shadow: 0 0 0 2px var(--brand-blue), 0 8px 20px rgba(0, 113, 227, 0.5);
  animation: pulseTarget 3s infinite ease-in-out;
}

@keyframes pulseTarget {
  0%, 100% { box-shadow: 0 0 0 2px var(--brand-blue), 0 4px 14px rgba(0, 113, 227, 0.4); }
  50% { box-shadow: 0 0 0 3px #2997FF, 0 8px 22px rgba(0, 113, 227, 0.7); }
}

.sim-app-item.webclip-target .sim-app-label {
  font-weight: 600;
  color: #FFFFFF;
}

/* Frosted Dock */
.sim-dock {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 32px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.sim-dock-item {
  display: flex;
  justify-content: center;
}
.sim-dock-item .sim-app-icon {
  width: 50px;
  height: 50px;
}

/* Home Indicator */
.sim-home-indicator {
  width: 120px;
  height: 4px;
  background: #FFFFFF;
  border-radius: 999px;
  margin: 0 auto;
  opacity: 0.85;
}

/* Simulator Badge (Cupertino Status Pill) */
.sim-fps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: #86868b;
  margin-top: 16px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 9999px;
  box-sizing: border-box;
  user-select: none;
}
.sim-fps-badge .sim-fps-dot,
.sim-fps-badge > span:first-child:empty {
  display: inline-block;
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  border-radius: 50%;
  background: var(--verified-green, #34C759);
  box-shadow: 0 0 8px var(--verified-green-glow, rgba(52, 199, 89, 0.4));
  flex-shrink: 0;
}
.sim-fps-badge .sim-fps-text,
.sim-fps-badge > span:not(:first-child) {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  color: inherit;
}
@media (prefers-color-scheme: dark) {
  .sim-fps-badge {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #a1a1a6;
  }
}

/* Section Common Styling */
.section-wrap {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 52px auto;
}

.section-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2997FF;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.section-desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Comparison Matrix Section
   ========================================================================== */
.table-container {
  background: var(--surface-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th, .comparison-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.comparison-table th {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-secondary);
}

.comparison-table th.col-highlight,
.comparison-table td.col-highlight {
  background: rgba(0, 113, 227, 0.08);
  border-left: 1px solid rgba(0, 113, 227, 0.25);
  border-right: 1px solid rgba(0, 113, 227, 0.25);
}

.comparison-table td.col-highlight {
  font-weight: 600;
  color: var(--text-primary);
}

.col-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}

.metric-name {
  font-weight: 600;
  color: var(--text-primary);
}

.badge-yes {
  color: var(--verified-green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-no {
  color: var(--danger);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
  }
  .comparison-table {
    min-width: 640px;
  }
}

/* ==========================================================================
   3-Step Safari OTA Walkthrough
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
}

.step-card {
  background: var(--surface-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.step-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 113, 227, 0.4);
}

.step-num-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.15);
  border: 1px solid rgba(0, 113, 227, 0.3);
  color: #2997FF;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step-card:nth-child(3) .step-num-badge {
  background: rgba(48, 209, 88, 0.15);
  border-color: rgba(48, 209, 88, 0.3);
  color: var(--verified-green);
}

.step-visual {
  height: 140px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.step-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px 0;
  letter-spacing: -0.015em;
}

.step-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Bento Grid - E-Commerce & PWA
   ========================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

.bento-card {
  background: var(--surface-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.bento-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
}

.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  margin-bottom: 22px;
}
.bento-card:nth-child(2) .bento-icon { color: var(--verified-green); }
.bento-card:nth-child(3) .bento-icon { color: #BF5AF2; }
.bento-card:nth-child(4) .bento-icon { color: #FF9F0A; }

.bento-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.bento-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   AEO Direct-Answer Block
   ========================================================================== */
.aeo-block {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.05) 0%, rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--glass-shadow);
  margin-bottom: 50px;
}

.aeo-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2997FF;
  margin-bottom: 14px;
}

.aeo-quote {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-primary);
  margin: 0;
  font-weight: 400;
}

/* ==========================================================================
   Power Tools Section (Batch, Sign, Diagnostics)
   ========================================================================== */
.power-tools-wrap {
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.power-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.power-tab-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.power-tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.power-tab-btn.active {
  background: var(--brand-blue);
  color: #FFFFFF;
  border-color: var(--brand-blue);
  box-shadow: 0 2px 10px var(--brand-blue-glow);
}

.power-panel {
  display: none;
}
.power-panel.active {
  display: block;
}

/* Icon URL checker */
.icon-checker-box {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.icon-check-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
}
.icon-check-result.ok {
  border-color: rgba(48, 209, 88, 0.4);
  color: var(--verified-green);
  background: rgba(48, 209, 88, 0.08);
}
.icon-check-result.warn {
  border-color: rgba(255, 214, 10, 0.4);
  color: var(--warning);
  background: rgba(255, 214, 10, 0.08);
}
.icon-check-result.bad {
  border-color: rgba(255, 69, 58, 0.4);
  color: var(--danger);
  background: rgba(255, 69, 58, 0.08);
}

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--surface-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.faq-item:hover {
  border-color: var(--border-strong);
}

.faq-summary {
  padding: 20px 24px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
}
.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}
.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--brand-blue);
}

.faq-answer {
  padding: 0 24px 22px 24px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 60px 0;
  color: var(--text-secondary, #515154);
  font-size: 13px;
}
.footer-top .brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-top .brand-lockup span,
.footer-brand-title {
  color: var(--text-primary, #1D1D1F);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* Utilities */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Auto-Sign Host SSL Switch Card */
.auto-sign-wrapper {
  margin: 14px 0 20px 0;
}
.auto-sign-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(48, 209, 88, 0.05);
  border: 1px solid rgba(48, 209, 88, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.auto-sign-card:hover {
  background: rgba(48, 209, 88, 0.08);
  border-color: rgba(48, 209, 88, 0.4);
}
.auto-sign-card.disabled {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.65;
}
.auto-sign-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
  cursor: pointer;
  margin-top: 2px;
}
.auto-sign-content {
  flex: 1;
  min-width: 0;
}
.auto-sign-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.auto-sign-icon {
  color: var(--success);
  display: flex;
  align-items: center;
}
.auto-sign-card.disabled .auto-sign-icon {
  color: var(--text-tertiary);
}
.auto-sign-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.auto-sign-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}
.auto-sign-sub code {
  color: var(--brand-blue);
  background: rgba(0, 113, 227, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* ==========================================================================
   Multi-App Web Clip Bundling (Apple HIG Obsidian Design)
   ========================================================================== */

.webclips-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 12px;
}

.webclip-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  position: relative;
}

.webclip-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.webclip-card.primary-clip-card {
  border-left: 3px solid var(--brand-blue);
}

.webclip-card.additional-clip-card {
  border-left: 3px solid #BF5AF2;
  background: rgba(191, 90, 242, 0.02);
  animation: slideInClip 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.clip-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.clip-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.clip-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-blue);
  box-shadow: 0 0 8px var(--brand-blue);
}

.clip-badge-dot.secondary {
  background: #BF5AF2;
  box-shadow: 0 0 8px #BF5AF2;
}

.clip-badge-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.clip-status-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-remove-clip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 69, 58, 0.08);
  border: 1px solid rgba(255, 69, 58, 0.25);
  color: #FF453A;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-remove-clip:hover {
  background: rgba(255, 69, 58, 0.18);
  border-color: rgba(255, 69, 58, 0.45);
  transform: translateY(-1px);
}

.add-clip-action-bar {
  margin: 14px 0 22px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.btn-add-clip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  background: rgba(0, 113, 227, 0.06);
  border: 1.5px dashed rgba(0, 113, 227, 0.35);
  color: #2997FF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.btn-add-clip:hover {
  background: rgba(0, 113, 227, 0.12);
  border-color: rgba(0, 113, 227, 0.65);
  transform: translateY(-1px);
}

.btn-add-clip:active {
  transform: scale(0.99);
}

.multi-clip-counter {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.add-clip-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

/* Secondary Web Clip simulator icon highlight */
.sim-app-item.secondary-target .sim-app-icon {
  box-shadow: 0 0 0 2px #BF5AF2, 0 8px 20px rgba(191, 90, 242, 0.45);
  animation: pulseSecondaryTarget 3s infinite ease-in-out;
}

@keyframes pulseSecondaryTarget {
  0%, 100% {
    box-shadow: 0 0 0 2px #BF5AF2, 0 8px 20px rgba(191, 90, 242, 0.35);
  }
  50% {
    box-shadow: 0 0 0 3px #BF5AF2, 0 10px 24px rgba(191, 90, 242, 0.65);
  }
}

.clip-presets-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.clip-preset-tag {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.clip-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clip-preset-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Apple HIG Glassmorphism Processing Modal & Safari QR OTA Delivery Sheet
   ========================================================================== */
.ota-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ota-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ota-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.20), inset 0 1px 0 0 rgba(255, 255, 255, 1);
  color: var(--text-primary);
  overflow: hidden;
  will-change: transform;
  transform: translateZ(0);
}

.ota-modal-overlay.active .ota-modal-card {
  transform: scale(1) translateY(0);
}

.ota-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-secondary, #515154);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast, 0.15s ease);
  z-index: 2;
}

.ota-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Modal Headers */
.ota-processing-header,
.ota-delivery-header {
  text-align: center;
  margin-bottom: 24px;
}

.ota-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 6px;
  color: var(--text-primary, #1D1D1F);
}

.ota-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #515154);
  margin: 0;
  line-height: 1.45;
}

/* Spinner */
.ota-spinner-ring {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--brand-blue, #0071E3), var(--verified-green, #30D158), transparent 70%);
  animation: ota-spin 1s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ota-spinner-inner {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-radius: 50%;
}

@keyframes ota-spin {
  100% { transform: rotate(360deg); }
}

/* Milestones */
.ota-milestones {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 24px;
}

.ota-milestone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md, 14px);
  transition: all 0.25s ease;
}

.ota-milestone-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.ota-milestone-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted, #636366);
  transition: all 0.25s ease;
}

.ota-milestone-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #86868B);
  transition: color 0.25s ease;
}

.ota-milestone-desc {
  font-size: 11px;
  color: var(--text-muted, #636366);
}

/* Milestone States */
.ota-milestone[data-status=active] {
  background: rgba(0, 113, 227, 0.1);
  border-color: rgba(0, 113, 227, 0.3);
}

.ota-milestone[data-status=active] .ota-milestone-indicator {
  background: var(--brand-blue, #0071E3);
  box-shadow: 0 0 12px var(--brand-blue-glow, rgba(0, 113, 227, 0.5));
}

.ota-milestone[data-status=active] .ota-milestone-icon {
  background: #fff;
  animation: ota-pulse 1s infinite alternate;
}

.ota-milestone[data-status=active] .ota-milestone-title {
  color: var(--text-primary, #F5F5F7);
}

.ota-milestone[data-status=completed] {
  background: rgba(48, 209, 88, 0.06);
  border-color: rgba(48, 209, 88, 0.2);
}

.ota-milestone[data-status=completed] .ota-milestone-indicator {
  background: var(--verified-green, #30D158);
  box-shadow: 0 0 10px var(--verified-green-glow, rgba(48, 209, 88, 0.3));
}

.ota-milestone[data-status=completed] .ota-milestone-icon {
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 0;
  background: transparent;
  transform: rotate(-45deg) translate(1px, -1px);
}

.ota-milestone[data-status=completed] .ota-milestone-title {
  color: var(--text-primary, #F5F5F7);
}

@keyframes ota-pulse {
  from { opacity: 0.5; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* Progress Bar */
.ota-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.ota-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue, #0071E3), var(--verified-green, #30D158));
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* Delivery Stage */
.ota-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(48, 209, 88, 0.12);
  border: 1px solid rgba(48, 209, 88, 0.3);
  color: var(--verified-green, #30D158);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ota-badge-verified.unsigned {
  background: rgba(255, 149, 0, 0.12);
  border-color: rgba(255, 149, 0, 0.35);
  color: #B25E00;
}

.ota-qr-wrapper {
  text-align: center;
  margin: 16px 0 20px;
}

.ota-qr-card {
  display: inline-block;
  background: #ffffff;
  padding: 14px;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
  line-height: 0;
}

.ota-qrcode-box img,
.ota-qrcode-box canvas {
  display: block;
  margin: 0 auto;
}

.ota-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 14px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary, #515154);
  font-family: var(--font-mono, monospace);
  transition: all 0.25s ease;
}

.ota-timer-pill.warning {
  background: rgba(255, 214, 10, 0.15);
  border-color: rgba(255, 214, 10, 0.35);
  color: var(--warning, #FFD60A);
}

.ota-timer-pill.expired {
  background: rgba(255, 69, 58, 0.15);
  border-color: rgba(255, 69, 58, 0.35);
  color: var(--danger, #FF453A);
}

/* Instructions */
.ota-instructions {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md, 14px);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary, #515154);
}

.ota-instruction-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ota-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-blue, #0071E3);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.ota-unsigned-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.25);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #8C4700;
  text-align: left;
}

.ota-unsigned-note svg {
  flex-shrink: 0;
  color: #B25E00;
  margin-top: 1px;
}

/* Actions */
.ota-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ota-btn-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md, 14px);
  cursor: pointer;
  box-sizing: border-box;
}

.ota-btn-main:disabled,
.ota-btn-main.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.ota-secondary-actions {
  display: flex;
  gap: 8px;
}

.ota-btn-sec {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: var(--text-primary, #1D1D1F);
  transition: var(--transition-fast, 0.15s ease);
}

.ota-btn-sec:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.ota-error-icon {
  text-align: center;
  margin-bottom: 12px;
}


/* ==========================================================================
   Saved Apps Drawer & Persistence Engine (Phase 2)
   ========================================================================== */

/* Header & Card Nav Saved Apps Buttons */
.btn-saved-apps {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-saved-apps:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: #fff;
}
.saved-apps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 980px;
  background: rgba(0, 113, 227, 0.2);
  border: 1px solid rgba(0, 113, 227, 0.35);
  color: #2997FF;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: all var(--transition-fast);
}
.saved-apps-badge.has-items {
  background: var(--brand-blue);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 10px rgba(0, 113, 227, 0.5);
  animation: badge-glow-pulse 2.5s infinite ease-in-out;
}
@keyframes badge-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 6px rgba(0, 113, 227, 0.4);
  }
  50% {
    box-shadow: 0 0 14px rgba(0, 113, 227, 0.85);
  }
}

/* Active Profile Banner in Studio */
.active-profile-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.28);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-primary);
  animation: fadeIn 0.25s ease;
}
.active-profile-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-profile-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-blue);
  box-shadow: 0 0 8px var(--brand-blue);
  flex-shrink: 0;
}
.active-profile-label {
  color: var(--text-secondary);
}
.active-profile-name {
  color: #fff;
  font-weight: 600;
}
.btn-unlink-profile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.btn-unlink-profile:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* CTA Actions Row */
.cta-actions-group {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.cta-actions-group .cta-btn {
  flex: 1;
}
.btn-save-template {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-save-template:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.save-template-opt-row {
  margin-top: 10px;
}
.save-template-check-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.save-template-check-card:hover {
  color: var(--text-primary);
}
.save-template-check-card input[type="checkbox"] {
  accent-color: var(--brand-blue);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Apple HIG Slide-over Drawer: Saved Apps */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: rgba(18, 22, 32, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.drawer-overlay.active .drawer-panel {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.drawer-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.14);
  border: 1px solid rgba(0, 113, 227, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drawer-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: #fff;
  letter-spacing: -0.01em;
}
.drawer-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 0;
}
.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.drawer-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.drawer-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-secondary);
  transition: border-color var(--transition-fast);
}
.drawer-search-box:focus-within {
  border-color: var(--brand-blue);
  color: var(--text-primary);
}
.drawer-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
.drawer-search-input::placeholder {
  color: var(--text-muted);
}
.drawer-refresh-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.drawer-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.drawer-toast {
  margin: 10px 20px 0;
  padding: 8px 12px;
  background: rgba(48, 209, 88, 0.14);
  border: 1px solid rgba(48, 209, 88, 0.35);
  border-radius: var(--radius-sm);
  color: #30D158;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.drawer-btn-save-current {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand-blue);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.drawer-btn-save-current:hover {
  background: var(--brand-blue-hover);
  transform: translateY(-1px);
}

/* Saved App Cards */
.saved-app-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), inset 0 1px 0 0 rgba(255, 255, 255, 0.95);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.saved-app-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}
.saved-app-card.is-active {
  border-color: var(--brand-blue);
  background: rgba(0, 113, 227, 0.06);
}
.saved-app-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.saved-app-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  overflow: hidden;
  background: #1C202E;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.saved-app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.saved-app-icon-placeholder {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-blue);
}
.saved-app-info {
  flex: 1;
  min-width: 0;
}
.saved-app-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.saved-app-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-app-active-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 980px;
  background: rgba(0, 113, 227, 0.25);
  color: #2997FF;
  border: 1px solid rgba(0, 113, 227, 0.4);
}
.saved-app-url {
  font-size: 12px;
  color: var(--brand-blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.saved-app-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-app-bundle {
  font-family: var(--font-mono);
}
.saved-app-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}
.btn-app-load {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 113, 227, 0.15);
  border: 1px solid rgba(0, 113, 227, 0.35);
  color: #2997FF;
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-app-load:hover {
  background: var(--brand-blue);
  color: #fff;
}
.btn-app-delete {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.25);
  color: #FF453A;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.btn-app-delete:hover {
  background: var(--danger);
  color: #fff;
}
.saved-apps-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
}
.saved-apps-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.saved-apps-empty h4 {
  font-size: 15px;
  color: #fff;
  margin: 0 0 6px;
}
.saved-apps-empty p {
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0;
}
.drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

@media (max-width: 640px) {
  .drawer-panel {
    max-width: 100%;
  }
  .cta-actions-group {
    flex-direction: column;
  }
}

/* ==========================================================================
   Phase 3: Smart URL Auto-Detect & Web App Manifest Scraper
   ========================================================================== */

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.url-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-action {
  padding-right: 140px !important;
}

.btn-auto-detect {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.2) 0%, rgba(94, 92, 230, 0.25) 100%);
  border: 1px solid rgba(0, 122, 255, 0.4);
  border-radius: var(--radius-sm, 8px);
  color: #38bdf8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-fast, 0.15s ease);
  user-select: none;
}

.btn-auto-detect:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.35) 0%, rgba(94, 92, 230, 0.4) 100%);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
  transform: translateY(-50%) scale(1.02);
}

.btn-auto-detect:focus-visible {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--brand-blue-glow);
}

.btn-auto-detect:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.btn-auto-detect.success {
  background: rgba(48, 209, 88, 0.2);
  border-color: rgba(48, 209, 88, 0.5);
  color: #30D158;
}

.detect-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinner-svg {
  animation: detect-spin 0.8s linear infinite;
}

@keyframes detect-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.detect-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: fadeIn 0.2s ease;
}

.detect-badge.success {
  background: rgba(48, 209, 88, 0.15);
  border: 1px solid rgba(48, 209, 88, 0.35);
  color: #30D158;
}

.detect-badge.error {
  background: rgba(255, 69, 58, 0.15);
  border: 1px solid rgba(255, 69, 58, 0.35);
  color: #FF453A;
}

.detect-feedback {
  margin-top: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.2s ease;
}

.detect-feedback.success {
  color: #30D158;
}

.detect-feedback.error {
  color: #FF453A;
}

@media (max-width: 480px) {
  .url-input-container {
    flex-direction: column;
    gap: 8px;
  }
  .input-with-action {
    padding-right: 16px !important;
  }
  .btn-auto-detect {
    position: static;
    transform: none;
    width: 100%;
    justify-content: center;
  }
  .btn-auto-detect:hover:not(:disabled) {
    transform: none;
  }
}


/* ==========================================================================
   Apple Cupertino Liquid Glass Auth Modal & Member Telemetry
   ========================================================================== */
.user-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-full, 9999px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 0 rgba(255, 255, 255, 0.95);
  font-size: 0.84rem;
  font-weight: 500;
  color: #1D1D1F;
}

.user-avatar-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0071E3, #0077ED);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-pill-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(0, 113, 227, 0.10);
  color: #0071E3;
  border: 1px solid rgba(0, 113, 227, 0.22);
  line-height: 1.3;
}


.btn-auth-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #6E6E73;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-auth-logout:hover {
  color: #FF3B30;
}

.btn-guest-auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.20);
  border-radius: var(--radius-full, 9999px);
  color: #0071E3;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-guest-auth:hover {
  background: #0071E3;
  color: #FFFFFF;
  border-color: #0071E3;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 18, 26, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.glass-auth-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.16), inset 0 1px 0 0 rgba(255, 255, 255, 0.95);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.active .glass-auth-modal {
  transform: scale(1) translateY(0);
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #6E6E73;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-modal-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1D1D1F;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.18);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.10);
}

.auth-modal-title {
  margin: 0 0 6px 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #1D1D1F;
}

.auth-modal-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #515154;
}

.auth-tabs {
  display: flex;
  padding: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #6E6E73;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: #FFFFFF;
  color: #1D1D1F;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.auth-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.4;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.auth-alert.error {
  background: rgba(255, 59, 48, 0.10);
  border-color: rgba(255, 59, 48, 0.25);
  color: #D70015;
}

.auth-alert.success {
  background: rgba(52, 199, 89, 0.10);
  border-color: rgba(52, 199, 89, 0.25);
  color: #248A3D;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px 18px;
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
}
/* ==========================================================================
   iPhone 16 Pro Hardware Chassis & Responsive Scaling
   ========================================================================== */
.iphone-16-pro-wrapper {
  --sim-base-w: 380px;
  --sim-scale: clamp(0.72, 85vw / var(--sim-base-w), 1);
  transform: scale(var(--sim-scale));
  transform-origin: top center;
  transition: transform 0.25s var(--ease-cupertino);
}

.sim-hardware-buttons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.sim-btn {
  position: absolute;
  background: linear-gradient(180deg, #E4E5E9 0%, #D1D2D6 50%, #BFC0C4 100%);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.sim-btn-action {
  left: -5px;
  top: 96px;
  width: 4px;
  height: 24px;
  border-radius: 3px 0 0 3px;
}

.sim-btn-vol-up {
  left: -5px;
  top: 136px;
  width: 4px;
  height: 48px;
  border-radius: 3px 0 0 3px;
}

.sim-btn-vol-down {
  left: -5px;
  top: 196px;
  width: 4px;
  height: 48px;
  border-radius: 3px 0 0 3px;
}

.sim-btn-power {
  right: -5px;
  top: 156px;
  width: 4px;
  height: 72px;
  border-radius: 0 3px 3px 0;
}

.apple-squircle {
  border-radius: var(--squircle-radius, 22.37%);
  box-shadow: var(--squircle-specular, inset 0 1px 0 rgba(255, 255, 255, 0.4));
}
