:root {
  --ncc-blue: #2563eb;
  --ncc-blue-dark: #1d4ed8;
  --ncc-sky: #e0f2fe;
  --ncc-ink: #0f172a;
  --ncc-muted: #64748b;
  --ncc-border: #e2e8f0;
  --ncc-soft: #f8fafc;
  --ncc-danger: #dc2626;
  --ncc-warning: #f59e0b;
  --ncc-radius: 18px;
  --ncc-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}
.ncc-modal { position: fixed; inset: 0; z-index: var(--ncc-z, 99999); font-family: 'Noto Kufi Arabic', 'Tajawal', Arial, sans-serif; color: var(--ncc-ink); }
.ncc-overlay { position: absolute; inset: 0; background: rgba(2, 6, 23, .62); backdrop-filter: blur(4px); }
.ncc-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(1040px, 94vw); max-height: 92vh; background: #fff; border-radius: 22px; box-shadow: var(--ncc-shadow); overflow: hidden; border: 1px solid rgba(255,255,255,.3); }
.ncc-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--ncc-border); background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%); }
.ncc-header h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.3; }
.ncc-subtitle { margin: 0; color: var(--ncc-muted); font-size: 13px; }
.ncc-close { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #f1f5f9; color: #334155; cursor: pointer; font-size: 30px; line-height: 1; }
.ncc-close:hover { background: #e2e8f0; }
.ncc-body { padding: 22px; max-height: calc(92vh - 88px); overflow: auto; }
.ncc-step { display: none; }
.ncc-step.active { display: block; }
.ncc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ncc-toolbar h4 { margin: 0; font-size: 17px; }
.ncc-input { width: 100%; box-sizing: border-box; border: 1px solid var(--ncc-border); border-radius: 12px; padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--ncc-ink); background: #fff; direction: rtl; transition: border .2s, box-shadow .2s; }
.ncc-input:focus { outline: none; border-color: var(--ncc-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.ncc-search { max-width: 340px; }
.ncc-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 14px; }
.ncc-type-card { border: 1px solid var(--ncc-border); background: #fff; border-radius: 18px; padding: 15px 12px; text-align: right; cursor: pointer; transition: transform .18s, border .18s, box-shadow .18s, background .18s; min-height: 118px; display: flex; flex-direction: column; gap: 6px; }
.ncc-type-card:hover { transform: translateY(-3px); border-color: var(--ncc-blue); box-shadow: 0 12px 30px rgba(37, 99, 235, .12); background: #f8fbff; }
.ncc-type-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.ncc-type-icon img, .ncc-inline-icon { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.18em; }
.ncc-type-icon img { width: 28px; height: 28px; }
.ncc-type-title { font-weight: 800; font-size: 14px; }
.ncc-type-hint { color: var(--ncc-muted); font-size: 11px; line-height: 1.5; }
.ncc-type-group { align-self: flex-start; font-size: 10px; color: var(--ncc-blue-dark); background: #dbeafe; border-radius: 999px; padding: 2px 8px; margin-top: auto; }
.ncc-back { border: 1px solid var(--ncc-border); background: #f8fafc; border-radius: 999px; padding: 9px 15px; cursor: pointer; margin-bottom: 14px; font-family: inherit; }
.ncc-back:hover { background: #eef2ff; border-color: #c7d2fe; }
.ncc-selected-meta { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--ncc-border); border-radius: 14px; background: #f8fafc; font-size: 13px; color: var(--ncc-muted); }
.ncc-form-preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .78fr); gap: 20px; align-items: start; }
.ncc-form { display: grid; gap: 14px; }
.ncc-field label { display: block; margin: 0 0 7px; font-weight: 700; font-size: 13px; }
.ncc-small-label { margin-top: 10px !important; }
.ncc-extra { display: none; }
.ncc-inline-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ncc-mini-btn { border: 1px solid var(--ncc-border); background: #f8fafc; border-radius: 12px; padding: 0 14px; font-family: inherit; cursor: pointer; }
.ncc-mini-btn:hover { background: #e2e8f0; }
.ncc-radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.ncc-radio-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: #334155; }
.ncc-field small { color: var(--ncc-muted); display: block; margin-top: 6px; line-height: 1.6; }
.ncc-preview-panel { position: sticky; top: 0; border: 1px solid var(--ncc-border); border-radius: 18px; background: linear-gradient(180deg, #f8fafc, #fff); padding: 14px; min-height: 260px; }
.ncc-preview-panel strong { display: block; margin-bottom: 12px; }
.ncc-preview { padding: 8px; background: #fff; border-radius: 14px; border: 1px dashed #cbd5e1; min-height: 180px; overflow: auto; }
.ncc-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--ncc-border); }
.ncc-btn { border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer; font-family: inherit; font-weight: 800; }
.ncc-primary { background: var(--ncc-blue); color: #fff; }
.ncc-primary:hover { background: var(--ncc-blue-dark); }
.ncc-secondary { background: #e2e8f0; color: #0f172a; }
.ncc-secondary:hover { background: #cbd5e1; }

/* Editor cards */
.ncc-card, .custom-card { margin: 24px 0; padding: 22px; border-radius: var(--ncc-radius); direction: rtl; box-sizing: border-box; position: relative; overflow: hidden; font-family: inherit; }
.ncc-card *, .custom-card * { box-sizing: border-box; }
.ncc-card-title, .card-title { margin: 0 0 14px; font-size: 20px; font-weight: 900; line-height: 1.4; color: inherit; }
.ncc-card p { margin-top: 0; }
.ncc-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; margin-bottom: 12px; }
.ncc-muted { color: var(--ncc-muted); }
.ncc-card-quote { background: #f8fafc; border-right: 5px solid var(--ncc-blue); color: #1e293b; }
.ncc-card-quote blockquote { margin: 0; font-size: 20px; line-height: 1.9; font-style: italic; }
.ncc-card-quote cite { display: block; margin-top: 14px; text-align: left; color: var(--ncc-muted); font-size: 14px; }
.ncc-card-about { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.ncc-card-about .ncc-kicker { background: #dbeafe; color: #1d4ed8; }
.ncc-card-summary { background: #0f172a; color: #f8fafc; box-shadow: 0 18px 40px rgba(15, 23, 42, .2); }
.ncc-card-summary .ncc-kicker { background: rgba(255,255,255,.12); color: #bfdbfe; }
.ncc-card-keypoints { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.ncc-card-keypoints ul, .ncc-card-related-links ul { margin: 0; padding: 0 20px 0 0; line-height: 1.9; }
.ncc-card-featured { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 52%, #db2777 100%); color: #fff; box-shadow: 0 18px 45px rgba(79, 70, 229, .25); }
.ncc-card-featured .ncc-card-title { border-bottom: 1px solid rgba(255,255,255,.28); padding-bottom: 10px; }
.ncc-card-featured-2 { background: #111827; color: #e5e7eb; border-right: 6px solid #22d3ee; }
.ncc-card-featured-2 .ncc-card-title { color: #67e8f9; }
.ncc-card-featured-3 { background: #f1f5f9; color: #334155; border-right: 6px solid #94a3b8; }
.ncc-card-stat { background: #fff; border: 1px solid #bfdbfe; text-align: center; box-shadow: 0 12px 30px rgba(37, 99, 235, .12); padding: 32px 20px; }
.ncc-stat-number { display: inline-flex; align-items: baseline; justify-content: center; gap: 4px; color: var(--ncc-blue-dark); font-size: clamp(42px, 8vw, 76px); font-weight: 950; line-height: 1; letter-spacing: -.04em; }
.ncc-stat-suffix { font-size: .45em; letter-spacing: 0; }
.ncc-stat-label { margin-top: 12px; color: #475569; font-size: 17px; line-height: 1.7; }
.ncc-card-alert { background: #fef2f2; border: 1px solid #fecaca; border-right: 7px solid var(--ncc-danger); color: #7f1d1d; }
.ncc-card-alert .ncc-kicker { background: #fee2e2; color: #b91c1c; }
.ncc-card-footnote { background: #fffbeb; border-right: 4px solid var(--ncc-warning); color: #78350f; padding: 16px 18px; font-size: 14px; }
.ncc-card-footnote .ncc-footnote-marker { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: 8px; border-radius: 50%; background: var(--ncc-warning); color: #fff; font-weight: 900; }
.ncc-card-text-image, .ncc-card-profile { background: #fff; border: 1px solid var(--ncc-border); box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }
.ncc-media-layout { display: flex; gap: 20px; align-items: flex-start; }
.ncc-media-text { flex: 1 1 auto; min-width: 0; line-height: 1.9; }
.ncc-media { flex: 0 0 320px; margin: 0; }
.ncc-media img { width: 100%; height: auto; border-radius: 14px; display: block; }
.ncc-media figcaption { margin-top: 8px; color: var(--ncc-muted); font-size: 12px; line-height: 1.6; }
.ncc-image-left .ncc-media-layout { flex-direction: row-reverse; }
.ncc-image-top .ncc-media-layout { flex-direction: column; }
.ncc-image-top .ncc-media { width: 100%; flex-basis: auto; }
.ncc-card-timeline { background: #f8fafc; border: 1px solid var(--ncc-border); }
.ncc-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.ncc-timeline:before { content: ''; position: absolute; right: 11px; top: 6px; bottom: 6px; width: 2px; background: #cbd5e1; }
.ncc-timeline li { position: relative; padding: 0 34px 16px 0; line-height: 1.75; }
.ncc-timeline li:before { content: ''; position: absolute; right: 3px; top: 7px; width: 18px; height: 18px; border: 4px solid #dbeafe; background: var(--ncc-blue); border-radius: 50%; }
.ncc-card-source { background: #ecfeff; border: 1px solid #a5f3fc; color: #164e63; }
.ncc-card-source a, .ncc-card-related-links a { color: var(--ncc-blue-dark); font-weight: 800; text-decoration: none; }
.ncc-card-source a:hover, .ncc-card-related-links a:hover { text-decoration: underline; }
.ncc-card-related-links { background: #f8fafc; border: 1px solid var(--ncc-border); }
.ncc-card-pros-cons { background: #fff; border: 1px solid var(--ncc-border); }
.ncc-pros-cons-grid, .ncc-comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ncc-pros, .ncc-cons, .ncc-comparison-col { border-radius: 14px; padding: 16px; background: #f8fafc; border: 1px solid var(--ncc-border); }
.ncc-pros h5, .ncc-cons h5, .ncc-comparison-col h5 { margin: 0 0 10px; font-size: 16px; }
.ncc-pros { background: #f0fdf4; border-color: #bbf7d0; }
.ncc-cons { background: #fff7ed; border-color: #fed7aa; }
.ncc-card-mini-chart { background: #fff; border: 1px solid var(--ncc-border); box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }
.ncc-bars { display: grid; gap: 10px; margin-top: 12px; }
.ncc-bar-row { display: grid; grid-template-columns: 90px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; }
.ncc-bar-track { height: 14px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.ncc-bar-fill { height: 100%; width: var(--value, 0%); background: linear-gradient(90deg, #38bdf8, #2563eb); border-radius: inherit; }
.ncc-card-media-embed { background: #0f172a; color: #fff; }
.ncc-embed-box { position: relative; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; background: #020617; display: flex; align-items: center; justify-content: center; }
.ncc-embed-box iframe { width: 100%; height: 100%; border: 0; }
.ncc-embed-fallback { color: #bfdbfe; padding: 22px; text-align: center; }
.ncc-card-profile .ncc-media { flex-basis: 180px; }
.ncc-card-profile .ncc-media img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }

@media (max-width: 860px) {
  .ncc-form-preview-grid { grid-template-columns: 1fr; }
  .ncc-preview-panel { position: static; }
  .ncc-toolbar { flex-direction: column; align-items: stretch; }
  .ncc-search { max-width: none; }
}
@media (max-width: 700px) {
  .ncc-content { width: 96vw; max-height: 94vh; border-radius: 18px; }
  .ncc-body { padding: 16px; }
  .ncc-media-layout, .ncc-image-left .ncc-media-layout { flex-direction: column; }
  .ncc-media { flex: 0 0 auto; width: 100%; }
  .ncc-pros-cons-grid, .ncc-comparison-grid { grid-template-columns: 1fr; }
  .ncc-bar-row { grid-template-columns: 72px 1fr 44px; }
}
@media print {
  .ncc-card, .custom-card { break-inside: avoid; box-shadow: none !important; }
}
