: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; }
}
