:root {
  --font: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --white: #f7f7f4;
  --white-2: #ffffff;
  --white-3: #ecebe6;
  --ink: #080a0d;
  --graphite: #11151b;
  --soft-dark: #171c22;
  --line: rgba(255,255,255,.12);
  --line-light: rgba(8,10,13,.10);
  --gold: #c9a45c;
  --gold-2: #e0b35b;
  --teal: #7fa6a1;
  --green: #4fa37a;
  --red: #c75c5c;
  --blue: #8fb7d6;
  --muted: #a7adb7;
  --muted-dark: #606a76;
  --shadow-dark: 0 28px 90px rgba(0,0,0,.25);
  --shadow-soft: 0 20px 70px rgba(8,10,13,.11);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at 14% 12%, rgba(201,164,92,.22), transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(127,166,161,.24), transparent 28%),
    radial-gradient(circle at 48% 86%, rgba(199,92,92,.08), transparent 30%),
    linear-gradient(135deg, var(--white), #ffffff 50%, #f2f1ed);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}
body[dir="rtl"] { direction: rtl; }
button, input, textarea, select { font-family: inherit; }
button, select { cursor: pointer; }
.ambient { position: fixed; border-radius: 999px; filter: blur(24px); opacity: .55; pointer-events: none; z-index: -2; animation: floaty 12s ease-in-out infinite alternate; }
.ambient-one { width: 360px; height: 360px; background: rgba(201,164,92,.18); top: 70px; left: -140px; }
.ambient-two { width: 480px; height: 480px; background: rgba(127,166,161,.16); bottom: -180px; right: -120px; animation-delay: -5s; }
.ambient-three { width: 260px; height: 260px; background: rgba(199,92,92,.08); top: 52%; left: 52%; animation-delay: -2s; }
@keyframes floaty { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(30px,-26px,0) scale(1.08); } }
.app-shell { max-width: 1540px; margin: 0 auto; padding: 22px; }
.glass-light { background: rgba(255,255,255,.74); border: 1px solid rgba(255,255,255,.86); box-shadow: var(--shadow-soft); backdrop-filter: blur(18px); }
.topbar { position: sticky; top: 16px; z-index: 30; border-radius: 28px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.brand-block.no-logo { display: grid; gap: 2px; }
.eyebrow { margin: 0 0 4px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 800; }
body[dir="rtl"] .eyebrow { letter-spacing: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
h1 { font-size: clamp(1.08rem, 1.1vw + .9rem, 1.8rem); }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.primary-btn, .ghost-btn, .chip-btn, .close-btn, .help-dot, .event-option, .demo-select, .seg-btn { border: 0; border-radius: 999px; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
.primary-btn { background: linear-gradient(135deg, var(--gold), #f0d18a); color: #17110a; font-weight: 800; padding: 12px 18px; box-shadow: 0 12px 30px rgba(201,164,92,.28); }
.primary-btn:hover, .ghost-btn:hover, .chip-btn:hover, .event-option:hover, .seg-btn:hover { transform: translateY(-2px); }
.ghost-btn { background: rgba(8,10,13,.06); color: var(--ink); padding: 11px 16px; font-weight: 700; border: 1px solid rgba(8,10,13,.08); }
.ghost-btn.dark { background: rgba(255,255,255,.07); color: #f7f7f4; border: 1px solid rgba(255,255,255,.12); }
.demo-select { background: rgba(8,10,13,.06); color: var(--ink); padding: 11px 16px; font-weight: 700; border: 1px solid rgba(8,10,13,.08); min-width: 210px; }
.workspace { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 22px; padding-top: 22px; align-items: start; }
.dark-card { background: radial-gradient(circle at top left, rgba(201,164,92,.13), transparent 34%), radial-gradient(circle at 90% 4%, rgba(127,166,161,.10), transparent 34%), linear-gradient(145deg, rgba(8,10,13,.985), rgba(17,21,27,.97)); color: #f5f1e8; border: 1px solid rgba(255,255,255,.10); box-shadow: var(--shadow-dark); }
.live-card { position: relative; overflow: visible; border-radius: var(--radius-xl); }
.live-card::before { content: ''; position: absolute; inset: 1px; border-radius: inherit; background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 40%, rgba(201,164,92,.10)); pointer-events: none; }
.case-panel { padding: 22px; position: sticky; top: 108px; max-height: calc(100vh - 126px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(201,164,92,.55) rgba(255,255,255,.06); }
.case-panel::-webkit-scrollbar { width: 7px; }
.case-panel::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 999px; }
.case-panel::-webkit-scrollbar-thumb { background: rgba(201,164,92,.45); border-radius: 999px; }
.case-topline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 800; }
.status-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--green); box-shadow: 0 0 18px var(--green); }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.25); opacity: .7; } }
.progress-wrap { margin: 22px 0; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 8px; font-weight: 800; }
.progress-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--teal)); border-radius: inherit; transition: width .3s ease; }
.mini-dashboard { display: grid; gap: 10px; }
.metric-card { border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.045); border-radius: 18px; padding: 12px 14px; display: grid; gap: 5px; }
.metric-card span { color: var(--muted); font-size: .82rem; }
.metric-card strong { font-size: .98rem; }
.stage-list { margin-top: 18px; display: grid; gap: 8px; }
.stage-item { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: .88rem; padding: 8px 9px; border-radius: 14px; }
.stage-item.active { background: rgba(201,164,92,.13); color: #fff2ca; }
.stage-item.done { color: #d7e6dc; }
.stage-bullet { width: 25px; height: 25px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .76rem; }
.main-flow { min-width: 0; display: grid; gap: 16px; align-content: start; }

.completed-summary { padding: 16px 20px; min-height: 0; display: grid; gap: 6px; transform-origin: top center; animation: summaryReveal .45s cubic-bezier(.2,.8,.2,1) both; }
.summary-kicker { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 900; }
body[dir="rtl"] .summary-kicker { letter-spacing: 0; }
.summary-title { color: #fff6df; font-weight: 900; font-size: 1.02rem; }
.summary-text { margin: 0; color: var(--muted); line-height: 1.6; }
@keyframes summaryReveal { from { opacity: 0; transform: translateY(-16px) scale(.985); filter: blur(8px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
.interview-card.card-enter { animation: cardEnter .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cardEnter { from { opacity: .15; transform: translateY(22px) scale(.992); filter: blur(7px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }

.interview-card, .report-card { padding: clamp(22px, 3vw, 36px); min-height: 610px; display: grid; grid-template-rows: auto 1fr auto; gap: 24px; overflow: visible; }
.interview-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.interview-top h2 { font-size: clamp(1.35rem, 2vw, 2.18rem); color: #fff9ee; }
.muted { color: var(--muted); margin: 8px 0 0; line-height: 1.7; }
.help-dot { flex: 0 0 auto; width: 42px; height: 42px; background: rgba(127,166,161,.14); color: #dff1ee; border: 1px solid rgba(127,166,161,.35); font-size: 1.15rem; font-weight: 900; }
.question-body { align-self: stretch; display: grid; align-content: start; gap: 18px; overflow: visible; }
textarea, .input-dark, .search-input, .number-input, .select-dark { width: 100%; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.055); color: #fffdf6; border-radius: 20px; padding: 16px 18px; outline: none; font-size: 1rem; line-height: 1.6; }
textarea { resize: vertical; min-height: 160px; max-height: 42vh; }
textarea::placeholder, input::placeholder { color: rgba(255,255,255,.40); }
.inline-actions, .wrap-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.file-chip input { display: none; }
.chip-btn { background: rgba(255,255,255,.075); color: #edf1ee; border: 1px solid rgba(255,255,255,.12); padding: 12px 16px; font-weight: 800; }
.chip-btn.active { background: rgba(201,164,92,.20); border-color: rgba(201,164,92,.55); color: #ffefc3; box-shadow: 0 0 0 3px rgba(201,164,92,.08); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.four-col { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.event-results { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.event-option { text-align: start; padding: 14px; background: rgba(255,255,255,.055); color: #f8f3ea; border: 1px solid rgba(255,255,255,.10); display: grid; gap: 4px; }
.event-option span { color: var(--muted); font-size: .82rem; }
.event-option.selected { border-color: rgba(201,164,92,.70); background: rgba(201,164,92,.13); }
.smart-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.suggest-item { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.10); border-radius: 18px; padding: 12px; }
.suggest-label { color: var(--muted); font-size: .78rem; font-weight: 800; }
.suggest-value { color: #fff7e7; font-weight: 900; margin-top: 5px; }
.check-list { display: grid; gap: 10px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.055); color: #f8f3ea; }
.check-row input { accent-color: var(--gold); width: 18px; height: 18px; }
.evidence-grid, .pill-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 999px; font-weight: 800; font-size: .82rem; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.065); color: #f8f3ea; }
.pill.success { color: #d6f4df; background: rgba(79,163,122,.13); border-color: rgba(79,163,122,.35); }
.pill.warn { color: #ffe4a9; background: rgba(224,179,91,.13); border-color: rgba(224,179,91,.35); }
.pill.danger { color: #ffd2d2; background: rgba(199,92,92,.13); border-color: rgba(199,92,92,.40); }
.pill.info { color: #d8eefb; background: rgba(143,183,214,.13); border-color: rgba(143,183,214,.40); }
.interview-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; border-top: 1px solid rgba(255,255,255,.10); padding-top: 18px; }
.step-indicator { color: var(--muted); font-weight: 800; }
.seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btn { padding: 9px 12px; color: #e7ece9; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.11); font-weight: 800; }
.seg-btn.active.yes { background: rgba(79,163,122,.22); border-color: rgba(79,163,122,.55); }
.seg-btn.active.no { background: rgba(199,92,92,.18); border-color: rgba(199,92,92,.55); }
.seg-btn.active.pending { background: rgba(224,179,91,.18); border-color: rgba(224,179,91,.55); }
.tech-grid { display: grid; gap: 10px; }
.tech-row { display: grid; grid-template-columns: minmax(240px,1fr) auto; gap: 12px; align-items: center; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.045); border-radius: 18px; padding: 12px 14px; }
.tech-row strong { color: #fff7e7; }
.tech-row small { display: block; color: var(--muted); margin-top: 2px; }
.risk-matrix { display: grid; grid-template-columns: repeat(5, minmax(68px,1fr)); gap: 7px; }
.risk-cell { min-height: 58px; border-radius: 14px; display: grid; place-items: center; text-align: center; border: 1px solid rgba(255,255,255,.09); color: #0b0e11; font-weight: 900; }
.risk-low { background: #70bd87; }
.risk-med { background: #e1bd62; }
.risk-high { background: #df8953; }
.risk-crit { background: #c75c5c; color: #fff; }
.rate-card { border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05); border-radius: 20px; padding: 16px; display: grid; gap: 12px; }
.form-label { color: var(--muted); font-size: .84rem; font-weight: 800; display: block; margin-bottom: 6px; }
.report-preview { display: grid; gap: 16px; }
.report-section { border: 1px solid rgba(255,255,255,.10); border-radius: 20px; background: rgba(255,255,255,.045); padding: 16px; }
.report-section h4 { color: #fff3d2; margin-bottom: 8px; }
.report-kv { display: grid; grid-template-columns: minmax(160px,.5fr) 1fr; gap: 8px 14px; }
.report-kv span { color: var(--muted); }
.report-table { width: 100%; border-collapse: collapse; color: #f7f3ea; }
.report-table th, .report-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.10); text-align: start; vertical-align: top; }
.report-table th { color: #fff3d2; }
.drawer { position: fixed; inset: 0; z-index: 60; display: none; justify-content: flex-end; background: rgba(8,10,13,.32); backdrop-filter: blur(10px); }
.drawer.open { display: flex; }
.drawer-panel { width: min(570px, 100%); height: 100%; border-radius: 30px 0 0 30px; padding: 26px; overflow: auto; }
body[dir="rtl"] .drawer { justify-content: flex-start; }
body[dir="rtl"] .drawer-panel { border-radius: 0 30px 30px 0; }
.drawer-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.close-btn { width: 38px; height: 38px; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.13); font-size: 1.3rem; }
.close-btn.floating { position: absolute; top: 16px; inset-inline-end: 16px; }
.standards-list { display: grid; gap: 12px; margin-top: 20px; }
.standard-item { padding: 16px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.10); border-radius: 20px; }
.standard-item h4 { color: #fff3d2; margin-bottom: 6px; }
.standard-item p { color: var(--muted); line-height: 1.6; margin: 0; }
.help-dialog { width: min(620px, calc(100% - 24px)); border: 1px solid rgba(255,255,255,.12); border-radius: 28px; padding: 28px; color: #f7f3ea; background: linear-gradient(145deg, #080a0d, #151a20); box-shadow: var(--shadow-dark); }
.help-dialog::backdrop { background: rgba(8,10,13,.45); backdrop-filter: blur(8px); }
.help-dialog h3 { color: #fff3d2; margin-bottom: 10px; }
.help-dialog p, .help-dialog li { color: var(--muted); line-height: 1.7; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); opacity: 0; padding: 12px 18px; border-radius: 999px; background: #11151b; color: #fff3d2; border: 1px solid rgba(255,255,255,.14); box-shadow: var(--shadow-dark); z-index: 90; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.print-report { display: none; }
@media print {
  body > *:not(.print-report) { display: none !important; }
  .print-report { display: block; padding: 20px; color: #111; font-family: var(--font); }
  .print-report h1 { font-size: 24px; }
  .print-report h2 { font-size: 18px; margin-top: 20px; color: #111; }
  .print-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
  .print-table th, .print-table td { border: 1px solid #bbb; padding: 8px; text-align: start; vertical-align: top; }
  .print-table th { background: #efefef; }
  .print-small { font-size: 12px; color: #555; }
}
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 1fr; }
  .case-panel { position: relative; top: auto; max-height: none; overflow: visible; }
  .stage-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .app-shell { padding: 12px; }
  .topbar { position: relative; top: auto; align-items: flex-start; flex-direction: column; border-radius: 22px; }
  .top-actions { width: 100%; }
  .ghost-btn, .primary-btn, .demo-select { flex: 1; min-width: 140px; }
  .event-results, .smart-summary, .two-col, .three-col, .four-col { grid-template-columns: 1fr; }
  .tech-row { grid-template-columns: 1fr; }
  
.completed-summary { padding: 16px 20px; min-height: 0; display: grid; gap: 6px; transform-origin: top center; animation: summaryReveal .45s cubic-bezier(.2,.8,.2,1) both; }
.summary-kicker { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 900; }
body[dir="rtl"] .summary-kicker { letter-spacing: 0; }
.summary-title { color: #fff6df; font-weight: 900; font-size: 1.02rem; }
.summary-text { margin: 0; color: var(--muted); line-height: 1.6; }
@keyframes summaryReveal { from { opacity: 0; transform: translateY(-16px) scale(.985); filter: blur(8px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
.interview-card.card-enter { animation: cardEnter .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cardEnter { from { opacity: .15; transform: translateY(22px) scale(.992); filter: blur(7px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }

.interview-card, .report-card { min-height: auto; border-radius: 24px; padding: 20px; }
  .interview-top, .interview-footer { align-items: stretch; flex-direction: column; }
  .stage-list { grid-template-columns: 1fr; max-height: 210px; overflow: auto; }
  .mini-dashboard { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .risk-matrix { grid-template-columns: repeat(5, minmax(48px,1fr)); }
  .risk-cell { min-height: 48px; font-size: .78rem; }
}

/* ===== OTIS v6 — Simplified field mode refinements ===== */
.workspace { grid-template-columns: 1fr !important; }
.main-flow { width: 100%; }
.topbar { align-items: center; }
.compact-actions { flex-wrap: nowrap; }
.menu-btn { min-width: 110px; }

/* Foldable summary panel: hidden by default and opened only on click */
.case-panel {
  position: fixed !important;
  inset-block-start: 24px;
  inset-inline-start: 22px;
  width: min(380px, calc(100vw - 34px));
  height: calc(100dvh - 48px);
  max-height: none !important;
  z-index: 58;
  transform: translateX(calc(-100% - 38px));
  transition: transform .42s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
  opacity: .0;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
body[dir="rtl"] .case-panel { transform: translateX(calc(100% + 38px)); }
.case-panel.open { transform: translateX(0); opacity: 1; }
.panel-close { position: sticky; top: 0; inset-inline-start: calc(100% - 42px); z-index: 2; margin-bottom: 10px; }
.case-topline { display: none !important; }

/* Right side action panel */
.action-drawer {
  position: fixed;
  inset: 0;
  z-index: 59;
  display: none;
  justify-content: flex-end;
  background: rgba(8,10,13,.20);
  backdrop-filter: blur(10px);
}
.action-drawer.open { display: flex; }
body[dir="rtl"] .action-drawer { justify-content: flex-start; }
.action-panel {
  width: min(420px, 100%);
  height: 100%;
  border-radius: 30px 0 0 30px;
  padding: 26px;
  overflow-y: auto;
}
body[dir="rtl"] .action-panel { border-radius: 0 30px 30px 0; }
.action-head h3 { color: var(--ink); }
.action-list { display: grid; gap: 12px; margin-top: 22px; }
.action-wide { width: 100%; min-width: 0 !important; justify-content: center; text-align: center; }
select.action-wide { text-align: center; }

/* Cleaner first-screen focus */
.completed-summary[hidden] + .interview-card,
.interview-card { max-width: 1160px; margin-inline: auto; }
.interview-card, .report-card { min-height: 560px; }

/* Avoid old 1120 breakpoint making the panel visible in document flow */
@media (max-width: 1120px) {
  .case-panel { position: fixed !important; max-height: none !important; overflow-y: auto !important; }
  .stage-list { grid-template-columns: 1fr; }
}

/* Mobile Field Mode */
@media (max-width: 820px) {
  html, body { min-height: 100%; }
  .app-shell { padding: 12px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .topbar {
    position: sticky;
    top: 8px;
    z-index: 35;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 14px;
    border-radius: 22px;
  }
  .brand-block.no-logo { min-width: 0; }
  .eyebrow { font-size: .58rem; letter-spacing: .10em; margin-bottom: 2px; }
  h1 { font-size: 1.05rem; line-height: 1.2; }
  .compact-actions { width: auto; justify-self: end; display: flex; gap: 8px; }
  .compact-actions .ghost-btn,
  .compact-actions .primary-btn {
    min-width: 0 !important;
    flex: 0 0 auto;
    padding: 9px 12px;
    font-size: .78rem;
  }
  #caseSummaryBtn { width: 44px; height: 44px; padding: 0; overflow: hidden; color: transparent; position: relative; }
  #caseSummaryBtn::after { content: '☰'; color: var(--ink); position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.18rem; }
  #actionsPanelBtn { width: 44px; height: 44px; padding: 0; overflow: hidden; color: transparent; position: relative; }
  #actionsPanelBtn::after { content: '⋯'; color: #17110a; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.45rem; line-height: 1; }

  .workspace { padding-top: 12px; }
  .main-flow { gap: 10px; }
  .completed-summary { padding: 12px 14px; border-radius: 18px; }
  .summary-kicker { font-size: .62rem; }
  .summary-title { font-size: .92rem; }
  .summary-text { font-size: .84rem; max-height: 48px; overflow: hidden; }

  .interview-card, .report-card {
    min-height: calc(100dvh - 190px);
    border-radius: 24px;
    padding: 18px;
    gap: 16px;
  }
  .interview-top { display: grid; grid-template-columns: 1fr 42px; align-items: start; gap: 12px; }
  .interview-top h2 { font-size: 1.42rem; line-height: 1.22; }
  .muted { font-size: .9rem; line-height: 1.55; margin-top: 6px; }
  textarea { min-height: 220px; max-height: 42dvh; font-size: .96rem; border-radius: 18px; }
  .question-body { gap: 12px; }
  .inline-actions { display: grid; grid-template-columns: 1fr; }
  .chip-btn, .ghost-btn.dark { width: 100%; }
  .interview-footer {
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin: 0 -6px -6px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(8,10,13,.85);
    backdrop-filter: blur(14px);
  }
  .interview-footer .ghost-btn,
  .interview-footer .primary-btn { min-width: 0 !important; width: 100%; padding: 11px 12px; }
  .step-indicator { text-align: center; min-width: 56px; font-size: .9rem; }

  .smart-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .suggest-item { padding: 10px; border-radius: 16px; }
  .suggest-label { font-size: .68rem; }
  .suggest-value { font-size: .86rem; }
  .event-results, .two-col, .three-col, .four-col { grid-template-columns: 1fr !important; }
  .event-option { padding: 13px; }
  .tech-row { grid-template-columns: 1fr !important; gap: 10px; }
  .seg-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .seg-btn { width: 100%; }
  .risk-matrix { display: none; }
  .report-kv { grid-template-columns: 1fr; }
  .report-table { font-size: .86rem; }
  .report-table th, .report-table td { padding: 8px 6px; }

  .case-panel {
    inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px;
    width: auto;
    height: min(75dvh, 620px);
    border-radius: 28px;
    transform: translateY(calc(100% + 30px)) !important;
  }
  .case-panel.open { transform: translateY(0) !important; }
  .mini-dashboard { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-card { padding: 11px; }
  .metric-card span { font-size: .74rem; }
  .metric-card strong { font-size: .9rem; }

  .action-drawer { align-items: flex-end; justify-content: center !important; }
  .action-panel {
    width: calc(100% - 24px);
    height: auto;
    max-height: 82dvh;
    border-radius: 28px 28px 0 0 !important;
    padding: 20px;
    margin-bottom: 0;
  }
  .action-list { gap: 10px; }
  .action-wide { padding: 13px 15px; }
  .drawer-panel {
    width: 100%;
    height: 88dvh;
    align-self: flex-end;
    border-radius: 28px 28px 0 0 !important;
  }
  .toast { width: calc(100% - 30px); bottom: calc(14px + env(safe-area-inset-bottom)); text-align: center; border-radius: 18px; }
}

@media (max-width: 430px) {
  .app-shell { padding: 10px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .topbar { padding: 12px; }
  h1 { font-size: .98rem; }
  .eyebrow { font-size: .54rem; }
  .interview-card, .report-card { padding: 16px; min-height: calc(100dvh - 176px); }
  .interview-top h2 { font-size: 1.24rem; }
  .smart-summary { grid-template-columns: 1fr; }
}

/* ===== OTIS v7 Professional Fixes ===== */
.close-btn, .close-btn.floating, .panel-close {
  width: 32px !important;
  height: 32px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: rgba(255,255,255,.82) !important;
  box-shadow: none !important;
  display: inline-grid;
  place-items: center;
}
.action-panel .close-btn { color: rgba(8,10,13,.45) !important; }
.close-btn:hover { transform: scale(1.08); color: var(--gold) !important; }
.stage-item {
  border: 0;
  background: transparent;
  text-align: start;
  width: 100%;
  cursor: pointer;
}
.stage-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.event-option span { color: rgba(255,255,255,.50); }
.risk-editor { border: 1px solid rgba(255,255,255,.10); border-radius: 20px; padding: 14px 16px; background: rgba(255,255,255,.045); }
.risk-editor summary { color: #fff3d2; font-weight: 900; cursor: pointer; }
.risk-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.detailed-tech { grid-template-columns: 1fr !important; align-items: stretch; }
.tech-evidence-panel { display: grid; gap: 10px; border-top: 1px solid rgba(255,255,255,.09); margin-top: 8px; padding-top: 12px; }
.tech-remark { min-height: 86px; max-height: 150px; }
.event-evidence-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); border-radius: 16px; padding: 12px; }
.event-evidence-item small { display:block; color: var(--muted); margin-top: 4px; }
.date-input, input[type="date"] { color: #fffdf6 !important; color-scheme: dark; }
.date-input::-webkit-calendar-picker-indicator, input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .9; cursor: pointer; }
.report-hero { display:flex; justify-content:space-between; gap:18px; align-items:center; border:1px solid rgba(201,164,92,.32); border-radius:24px; padding:18px; background:linear-gradient(135deg, rgba(201,164,92,.15), rgba(127,166,161,.07)); }
.report-hero h3 { color:#fff8e6; font-size:1.6rem; }
.otis-mark { width:86px; height:86px; border-radius:22px; display:grid; place-items:center; font-weight:900; color:#1a1307; background:linear-gradient(135deg, var(--gold), #f0d18a); box-shadow:0 20px 50px rgba(201,164,92,.28); }
.visual-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.visual-cards > div { border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.055); border-radius:18px; padding:14px; display:grid; gap:7px; }
.visual-cards span { color:var(--muted); font-size:.82rem; font-weight:800; }
.visual-cards strong { color:#fff7e7; font-size:1rem; }
.visual-bar { display:grid; gap:8px; margin:12px 0; }
.visual-bar > div:first-child { display:flex; justify-content:space-between; color:#fff7e7; font-weight:800; }
.bar-track { height:11px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden; }
.bar-track i { display:block; height:100%; border-radius:inherit; }
.bar-track i.success { background:linear-gradient(90deg, var(--green), var(--teal)); }
.bar-track i.info { background:linear-gradient(90deg, var(--blue), var(--teal)); }
.bar-track i.warn { background:linear-gradient(90deg, var(--gold), #df8953); }
.bar-track i.danger { background:linear-gradient(90deg, #df8953, var(--red)); }
.timeline-visual { display:grid; gap:12px; }
.timeline-visual div { display:grid; grid-template-columns:34px 1fr; gap:10px; align-items:start; }
.timeline-visual b { width:30px; height:30px; display:grid; place-items:center; border-radius:999px; background:rgba(201,164,92,.20); color:#fff0bd; }
.timeline-visual span { color:var(--muted); line-height:1.6; }
.cause-card, .capa-card { border:1px solid rgba(201,164,92,.22); background:rgba(201,164,92,.06); border-radius:18px; padding:16px; display:grid; gap:8px; }
.cause-card strong, .capa-card strong { color:#fff3d2; }
.cause-card p, .capa-card p, .capa-card small { color:var(--muted); margin:0; line-height:1.7; }
.capa-card span { color:#ffe1a0; font-weight:900; }
.guide-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.guide-grid section { border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.045); border-radius:16px; padding:13px; }
.guide-grid h4 { color:#fff3d2; margin:0 0 6px; }
.guide-grid p { margin:0; }
@media (max-width:820px){
  .risk-editor-grid, .visual-cards, .guide-grid { grid-template-columns:1fr; }
  .event-evidence-item { grid-template-columns:1fr; }
  .report-hero { align-items:flex-start; }
  .otis-mark { width:64px; height:64px; border-radius:18px; }
}
@media print {
  .report-hero, .visual-cards, .visual-bar, .timeline-visual, .cause-card, .capa-card { break-inside: avoid; }
}
@media print {
  .print-hero { display:flex; justify-content:space-between; align-items:center; padding:16px; border:2px solid #c9a45c; border-radius:16px; margin-bottom:14px; background:#fff8e8; }
  .print-mark { width:70px; height:70px; border-radius:16px; display:grid; place-items:center; background:#c9a45c; color:#111; font-weight:900; }
  .print-kpi { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:10px 0 16px; }
  .print-kpi span { display:grid; gap:4px; border:1px solid #ddd; border-radius:12px; padding:10px; background:#fafafa; font-size:12px; color:#555; }
  .print-kpi b { color:#111; font-size:14px; }
}

/* ===== OTIS v8 Intelligence/report refinements ===== */
.context-toggle { margin-bottom: 4px; }
.why-input { min-height: 78px; max-height: 130px; }
.fivewhy-visual div { border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 10px; background: rgba(255,255,255,.035); }
.executive-section { border-color: rgba(201,164,92,.28); background: rgba(201,164,92,.055); }
@media print {
  @page { margin: 12mm; }
  .print-report { display:block; padding:0; color:#111; font-family:var(--font); font-size:12px; }
  .print-kicker { margin:0 0 6px; color:#a77f2d; text-transform:uppercase; letter-spacing:.12em; font-weight:900; font-size:10px; }
  .print-report h1 { margin:0 0 6px; font-size:22px; color:#111; }
  .print-report h2 { margin:18px 0 8px; padding:8px 10px; border-left:5px solid #c9a45c; background:#f6f1e5; border-radius:8px; font-size:16px; color:#111; break-after:avoid; }
  body[dir="rtl"] .print-report h2, .print-report[dir="rtl"] h2 { border-left:0; border-right:5px solid #c9a45c; }
  .print-hero { display:flex; justify-content:space-between; align-items:center; padding:16px; border:2px solid #c9a45c; border-radius:16px; margin-bottom:14px; background:linear-gradient(135deg,#fff8e8,#edf5f2) !important; }
  .print-mark { width:76px; height:76px; border-radius:18px; display:grid; place-items:center; background:#11151b !important; color:#e8c36d; font-weight:900; font-size:18px; }
  .print-kpi { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:10px 0 16px; }
  .print-kpi span { display:grid; gap:4px; border:1px solid #ddd; border-radius:12px; padding:10px; background:#fafafa; font-size:12px; color:#555; }
  .print-kpi b { color:#111; font-size:13px; }
  .print-table { width:100%; border-collapse:separate; border-spacing:0; margin:8px 0 12px; border:1px solid #d2d2d2; border-radius:10px; overflow:hidden; }
  .print-table th, .print-table td { border-bottom:1px solid #ddd; padding:8px; text-align:start; vertical-align:top; }
  .print-table tr:last-child th, .print-table tr:last-child td { border-bottom:0; }
  .print-table th { background:#f4f2ed; width:28%; color:#111; }
  .print-small { font-size:11px; color:#666; }
  .print-risk { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:10px 0; }
  .print-risk span { border:1px solid #dbc78f; background:#fffaf0; border-radius:12px; padding:10px; display:grid; gap:5px; }
  .print-risk b { color:#8d6a25; }
  .report-kv { display:grid; grid-template-columns:160px 1fr; border:1px solid #ddd; border-radius:10px; overflow:hidden; }
  .report-kv span, .report-kv strong { padding:8px 10px; border-bottom:1px solid #e2e2e2; }
  .report-kv span { background:#f4f2ed; color:#555; }
  .report-kv strong { background:#fff; color:#111; font-weight:700; }
  .report-kv span:nth-last-child(-n+2), .report-kv strong:nth-last-child(-n+1) { border-bottom:0; }
  ol, ul { margin-top:6px; }
}
