/* AMAADOR 8D Problem Solving & RCA Pro Studio — Apple iOS / iPadOS Pro Design System (2026-11-25)
   Luminous iOS Inset Grouped Surfaces · Frosted Vibrancy Glass · SF-Style Segmented Controls · Concentric Rings */
:root {
  --ios-canvas: #f2f2f7;
  --ios-card: #ffffff;
  --ios-card-2: #f9f9fb;
  --ios-glass: rgba(255, 255, 255, 0.78);
  --ios-sep: rgba(60, 60, 67, 0.12);
  --ios-sep-s: rgba(60, 60, 67, 0.22);
  --ios-text: #1c1c1e;
  --ios-text-2: #636366;
  --ios-text-3: #8e8e93;
  --ios-blue: #007aff;
  --ios-indigo: #5856d6;
  --ios-teal: #0f766e;
  --ios-green: #34c759;
  --ios-orange: #ff9500;
  --ios-red: #ff3b30;
  --ios-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 18px 44px rgba(0, 0, 0, 0.06);
  --ios-pill-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
}
html[data-theme="dark"] {
  --ios-canvas: #000000;
  --ios-card: #1c1c1e;
  --ios-card-2: #2c2c2e;
  --ios-glass: rgba(28, 28, 30, 0.80);
  --ios-sep: rgba(255, 255, 255, 0.10);
  --ios-sep-s: rgba(255, 255, 255, 0.20);
  --ios-text: #f2f2f7;
  --ios-text-2: #aeaeb2;
  --ios-text-3: #8e8e93;
  --ios-blue: #0a84ff;
  --ios-indigo: #5e5ce6;
  --ios-green: #30d158;
  --ios-orange: #ff9f0a;
  --ios-red: #ff453a;
  --ios-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 24px 60px rgba(0, 0, 0, 0.55);
}

#d8-app {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Geist', 'Segoe UI', sans-serif;
  color: var(--ios-text);
  max-width: 1320px;
  margin: 0 auto 56px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
#d8-app *, #d8-app *::before, #d8-app *::after { box-sizing: border-box; }

.ios-shell {
  background: var(--ios-canvas);
  border: 1px solid var(--ios-sep);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--ios-shadow);
}

/* iOS Vibrancy Frosted Header & Segmented Control */
.ios-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--ios-glass);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--ios-sep);
}
.ios-seg {
  display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap;
  padding: 4px; border-radius: 14px;
  background: rgba(118, 118, 128, 0.12);
}
.ios-seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 10px; border: 0;
  background: transparent; color: var(--ios-text-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .18s cubic-bezier(.25,.8,.25,1);
}
.ios-seg-btn:hover { color: var(--ios-text); }
.ios-seg-btn.is-active {
  background: var(--ios-card); color: var(--ios-text); font-weight: 600;
  box-shadow: var(--ios-pill-shadow);
}
.ios-seg-btn svg, .ios-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ios-chip-cnt {
  font-size: 10.5px; font-weight: 650; padding: 1px 6px; border-radius: 999px;
  background: rgba(0, 122, 255, 0.12); color: var(--ios-blue);
}

/* iOS Live D1-D8 Discipline Stepper */
.ios-stepper {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 14px 22px; background: var(--ios-card); border-bottom: 1px solid var(--ios-sep);
}
.ios-step-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ios-dpill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--ios-sep);
  background: var(--ios-card-2); color: var(--ios-text-2);
  font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.ios-dpill:hover { border-color: var(--ios-blue); color: var(--ios-blue); }
.ios-dpill.is-done { background: rgba(52, 199, 89, 0.13); border-color: rgba(52, 199, 89, 0.35); color: #15803d; }
html[data-theme="dark"] .ios-dpill.is-done { color: #30d158; }
.ios-dpill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ios-text-3); }
.ios-dpill.is-done .ios-dpill-dot { background: var(--ios-green); }

/* Executive Apple Ring Summary Strip */
.ios-hero-strip {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 18px 22px; background: var(--ios-card); border-bottom: 1px solid var(--ios-sep);
}
.ios-ring-box { display: flex; align-items: center; gap: 12px; }
.ios-ring-svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.ios-title-block h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.025em; }
.ios-title-block p { margin: 3px 0 0; font-size: 13px; color: var(--ios-text-2); }
.ios-stat-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.ios-stat {
  padding: 9px 14px; border-radius: 14px; background: var(--ios-canvas);
  min-width: 96px; text-align: center;
}
.ios-stat span { display: block; font-size: 10.5px; font-weight: 600; color: var(--ios-text-3); text-transform: uppercase; letter-spacing: .04em; }
.ios-stat b { display: block; font-size: 17px; font-weight: 700; margin-top: 2px; }

/* Inset Grouped Content Body */
.ios-body { padding: 22px; animation: iosFade .18s ease; }
@keyframes iosFade { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.ios-ai-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(52, 199, 89, 0.14); color: #15803d; font-size: 11.5px; font-weight: 650;
}
html[data-theme="dark"] .ios-ai-pill { color: #30d158; }
.ios-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ios-green); box-shadow: 0 0 0 3px rgba(52,199,89,.25); }
.ios-tl-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(118,118,128,.14); }
.ios-tl-btn { border: 0; padding: 4px 8px; border-radius: 7px; font-size: 10.5px; font-weight: 700; cursor: pointer; background: transparent; color: var(--ios-text-2); }
.ios-tl-btn.is-red { background: var(--ios-red); color: #fff; }
.ios-tl-btn.is-orange { background: var(--ios-orange); color: #fff; }
.ios-tl-btn.is-green { background: var(--ios-green); color: #fff; }
.ios-cases-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 22px; background: var(--ios-canvas); border-bottom: 1px solid var(--ios-sep); font-size: 12px;
}
.ios-card {
  background: var(--ios-card); border-radius: 20px; padding: 20px 22px;
  border: 1px solid var(--ios-sep);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.ios-card + .ios-card { margin-top: 16px; }
.ios-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ios-card-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; }
.ios-card-head p { margin: 2px 0 0; font-size: 13px; color: var(--ios-text-2); }

/* Domain Quick-Select Pills */
.ios-domain-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ios-domain-pill {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--ios-sep);
  background: var(--ios-card-2); color: var(--ios-text-2);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.ios-domain-pill:hover { border-color: var(--ios-blue); color: var(--ios-blue); }
.ios-domain-pill.is-sel {
  background: var(--ios-blue); border-color: var(--ios-blue); color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.28);
}

/* iOS Buttons */
.ios-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 12px; border: 1px solid var(--ios-sep-s);
  background: var(--ios-card); color: var(--ios-text);
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, filter .15s ease, background .15s ease;
}
.ios-btn:hover { transform: translateY(-1px); background: var(--ios-card-2); }
.ios-btn:active { transform: scale(0.98); }
.ios-btn-blue { background: var(--ios-blue); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(0, 122, 255, 0.25); }
.ios-btn-blue:hover { background: var(--ios-blue); filter: brightness(1.06); color: #fff; }
.ios-btn-ai {
  background: linear-gradient(135deg, #007aff, #5856d6); color: #fff; border-color: transparent;
  padding: 11px 20px; font-size: 14px; border-radius: 14px;
  box-shadow: 0 6px 20px rgba(88, 86, 214, 0.30);
}
.ios-btn-ai:hover { filter: brightness(1.06); color: #fff; background: linear-gradient(135deg, #007aff, #5856d6); }
.ios-btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 10px; }
.ios-btn-danger { color: var(--ios-red); border-color: rgba(255, 59, 48, 0.28); }

/* iOS Inputs */
.ios-field { display: flex; flex-direction: column; gap: 6px; }
.ios-field label { font-size: 11.5px; font-weight: 600; color: var(--ios-text-2); letter-spacing: .01em; }
.ios-input, .ios-select, .ios-textarea {
  width: 100%; padding: 10px 13px; border-radius: 12px;
  border: 1px solid var(--ios-sep-s); background: var(--ios-card-2); color: var(--ios-text);
  font-family: inherit; font-size: 13.5px; transition: all .15s ease;
}
.ios-textarea { min-height: 82px; resize: vertical; line-height: 1.45; }
.ios-input:focus, .ios-select:focus, .ios-textarea:focus {
  outline: none; background: var(--ios-card); border-color: var(--ios-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.14);
}

/* 5-Why Visual Flow Cards */
.ios-why-chain {
  border: 1px solid var(--ios-sep); border-radius: 18px; padding: 16px;
  background: var(--ios-card-2); margin-bottom: 14px;
}
.ios-why-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 10px; }
.ios-why-box {
  background: var(--ios-card); border: 1px solid var(--ios-sep); border-radius: 12px; padding: 10px;
}
.ios-why-box.is-root { border-color: rgba(255, 59, 48, 0.45); background: rgba(255, 59, 48, 0.04); }
.ios-why-box label { display: block; font-size: 10.5px; font-weight: 700; color: var(--ios-text-3); margin-bottom: 5px; text-transform: uppercase; }
.ios-why-box.is-root label { color: var(--ios-red); }

/* Photos & Storyboard */
.d8-photo-drop {
  border: 1.5px dashed var(--ios-sep-s); border-radius: 16px; padding: 16px 18px;
  background: var(--ios-card-2); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; transition: all .15s ease;
}
.d8-photo-drop:hover { border-color: var(--ios-blue); background: rgba(0, 122, 255, 0.04); }
.d8-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.d8-photo-grid figure { margin: 0; border: 1px solid var(--ios-sep); border-radius: 14px; overflow: hidden; background: var(--ios-card); }
.d8-photo-grid img { width: 100%; height: 136px; object-fit: cover; display: block; }
.d8-photo-grid figcaption { padding: 8px; font-size: 11.5px; color: var(--ios-text-2); }

.d8-ppt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
.d8-slide {
  border: 1px solid #cbd5e1; border-radius: 14px; padding: 15px 17px; background: #ffffff;
  aspect-ratio: 16 / 9; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.d8-slide.is-dark { background: #0f172a; color: #ffffff; border-color: #0f172a; }
.d8-slide-num { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: #0f766e; margin-bottom: 4px; }
.d8-slide.is-dark .d8-slide-num { color: #5eead4; }
.d8-slide h4 { margin: 0 0 6px; font-size: 13.5px; line-height: 1.25; }
.d8-slide-sub { font-size: 11px; color: #94a3b8; margin-bottom: 8px; }
.d8-slide-body { font-size: 10.5px; line-height: 1.45; overflow: hidden; color: #334155; }
.d8-slide.is-dark .d8-slide-body { color: #cbd5e1; }

/* iOS Modal Sheet for Plant Access Code */
.ios-sheet-bg {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.ios-sheet {
  width: 100%; max-width: 420px; background: var(--ios-card); border-radius: 24px;
  padding: 26px; border: 1px solid var(--ios-sep); box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.ios-sheet h3 { margin: 10px 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.ios-sheet p { margin: 0 0 18px; font-size: 13.5px; color: var(--ios-text-2); line-height: 1.45; }

/* Responsive */
@media (max-width: 1024px) {
  .ios-hero-strip { grid-template-columns: 1fr; }
  .ios-why-steps { grid-template-columns: 1fr; }
}
@media (max-width: 780px) { .d8-ppt-grid { grid-template-columns: 1fr; } }
@media print {
  body:not([data-d8-print-unlocked="1"]) .jp-preview-box::before {
    content: "PREVIEW ONLY — Unlock Export Pack ($20) or enter Plant Access Code to print official 8D Report.";
    display: block; padding: 14px; margin-bottom: 14px; border: 2px solid #dc2626; color: #b91c1c; font-weight: 700; text-align: center;
  }
}
