/* ============================================================
   PDF ← EPUB · Surya — واجهة عربية (فاتح/داكن)
   ============================================================ */

@font-face {
  font-family: "Amiri UI";
  src: url("/static/fonts/Amiri-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --bg: #f6f3ee;
  --bg-glow-1: rgba(15, 118, 110, .10);
  --bg-glow-2: rgba(180, 83, 9, .07);
  --topbar: rgba(246, 243, 238, .82);

  --surface: #fffdfa;
  --surface-2: #f3ede4;
  --surface-3: #eae2d6;
  --surface-inset: #fbf8f3;

  --ink: #221f1b;
  --ink-2: #4c463e;
  --muted: #7c756b;

  --line: #e4dccf;
  --line-strong: #d2c7b6;

  --accent: #0f766e;
  --accent-2: #0b5f59;
  --accent-soft: #d8efe9;
  --accent-ink: #ffffff;

  --gold: #b45309;
  --gold-soft: #fbead2;

  --green: #15803d;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;

  --shadow-xs: 0 1px 2px rgba(34, 31, 27, .06);
  --shadow-sm: 0 4px 14px rgba(34, 31, 27, .06);
  --shadow: 0 12px 34px rgba(34, 31, 27, .09);
  --shadow-lg: 0 28px 70px rgba(34, 31, 27, .18);
  --ring: 0 0 0 3px rgba(15, 118, 110, .22);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  --ui: "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;
  --display: "Amiri UI", "Amiri", "Noto Naskh Arabic", serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d1116;
  --bg-glow-1: rgba(45, 212, 191, .10);
  --bg-glow-2: rgba(251, 191, 36, .05);
  --topbar: rgba(13, 17, 22, .82);

  --surface: #151b21;
  --surface-2: #1b232b;
  --surface-3: #232d36;
  --surface-inset: #10151a;

  --ink: #e9eef3;
  --ink-2: #c6cfd8;
  --muted: #93a1b0;

  --line: #27313b;
  --line-strong: #38454f;

  --accent: #2dd4bf;
  --accent-2: #14b8a6;
  --accent-soft: rgba(45, 212, 191, .14);
  --accent-ink: #04201d;

  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, .12);

  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, .12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .12);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .28);
  --shadow: 0 14px 36px rgba(0, 0, 0, .38);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  --ring: 0 0 0 3px rgba(45, 212, 191, .25);
}

* { box-sizing: border-box; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 620px at 100% -12%, var(--bg-glow-1), transparent 62%),
    radial-gradient(900px 560px at -8% 108%, var(--bg-glow-2), transparent 58%),
    var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.sidebar-open { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

svg.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ------------------------------------------------------------
   الشريط العلوي
   ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.topbar-inner {
  max-width: 1480px;
  margin: 0 auto;
  min-height: 68px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(255, 255, 255, .35), transparent 45%),
    linear-gradient(145deg, var(--accent), var(--accent-2) 60%, var(--gold));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .25);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; stroke-width: 1.9; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.brand-text strong .arrow { color: var(--muted); font-family: var(--ui); font-size: 15px; margin: 0 2px; }
.brand-text strong .accent { color: var(--accent); }
.brand-text small { color: var(--muted); font-size: 11.5px; letter-spacing: .1px; }

.topbar-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  box-shadow: var(--shadow-xs);
  max-width: 340px;
}
.server-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
  transition: background .2s, box-shadow .2s;
}
.server-pill .dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.server-pill .dot.off { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.server-pill .dot.busy { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); animation: pulse 1.2s ease-in-out infinite; }
.server-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-pill .icon-btn { width: 28px; height: 28px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.96); }
.icon-btn.subtle { border-color: var(--line); background: var(--surface); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

.menu-btn { display: none; }

/* ------------------------------------------------------------
   الهيكل
   ------------------------------------------------------------ */

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 116px);
}

.sidebar-head { display: flex; align-items: center; gap: 8px; }
.sidebar-title {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-title .count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}
#closeSidebar { display: none; margin-inline-start: auto; }

.search {
  position: relative;
}
.search svg {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  outline: none;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }

.book-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-inline-end: 2px;
  margin-inline-end: -2px;
}

.book-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: start;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s, border-color .15s, transform .12s;
}
.book-item:hover { background: var(--surface-2); }
.book-item:active { transform: scale(.995); }
.book-item.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
}

.book-item .ring {
  --p: 0;
  width: 38px; height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0);
  position: relative;
}
.book-item .ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface);
}
.book-item.active .ring::after { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.book-item .ring b {
  position: relative;
  z-index: 1;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.book-item .ring.done { background: var(--green); }
.book-item .ring.done b { color: #fff; }
[data-theme="dark"] .book-item .ring.done b { color: #06210f; }

.book-item .info { min-width: 0; flex: 1; }
.book-item .title {
  display: block;
  font-weight: 650;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-item .meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.sidebar-foot .ver { margin-inline-start: auto; opacity: .7; }

.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(10, 14, 18, .45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .2s;
}

/* ------------------------------------------------------------
   الأزرار
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 11px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn.primary {
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn.primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 38%, transparent);
}
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; }
.btn.outline { background: transparent; border-color: var(--line-strong); }
.btn.danger { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 32%, transparent); color: var(--red); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red-soft) 70%, var(--red) 8%); }
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn.icon-only { padding: 8px; width: 36px; height: 36px; }

.btn .spin { animation: spin 1s linear infinite; }

/* ------------------------------------------------------------
   الحقول
   ------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.field .hint { font-size: 11.5px; color: var(--muted); }

input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
select { cursor: pointer; }

/* ------------------------------------------------------------
   البطاقات
   ------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card > h2, .card-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.1px;
}
.card .sub { color: var(--muted); font-size: 12.5px; margin: 3px 0 0; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-head .grow { min-width: 0; }
.card-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ------------------------------------------------------------
   الهيدر/البطل
   ------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 240px at 100% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(400px 200px at 0% 100%, var(--gold-soft), transparent 70%);
  opacity: .7;
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-top { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.book-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.2px;
  overflow-wrap: anywhere;
}
.hero-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}
.hero-meta .sep { opacity: .5; }
.hero-progress { margin-inline-start: auto; text-align: center; min-width: 132px; }
.hero-progress .pct {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hero-progress .pct small { font-size: 16px; color: var(--muted); font-family: var(--ui); font-weight: 600; }
.hero-progress .lbl { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.hero-bar { margin-top: 18px; }

/* ------------------------------------------------------------
   شريط التقدم
   ------------------------------------------------------------ */

.progress {
  position: relative;
  height: 10px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width .5s cubic-bezier(.2, .7, .2, 1);
}
.progress.active > i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.8s infinite;
}
[data-theme="dark"] .progress.active > i::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent); }
.progress.slim { height: 6px; }

/* ------------------------------------------------------------
   الإحصاءات
   ------------------------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.stat {
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.stat .ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
  flex: none;
}
.stat .ico svg { width: 16px; height: 16px; }
.stat .txt { min-width: 0; }
.stat b {
  display: block;
  font-size: 17px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat span { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------------
   الشارات
   ------------------------------------------------------------ */

.badges { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 28%, transparent); background: var(--green-soft); }
.badge.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); background: var(--amber-soft); }
.badge.err { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); background: var(--red-soft); }
.badge.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }
.badge.gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, transparent); background: var(--gold-soft); }

/* ------------------------------------------------------------
   أدوات الكتاب
   ------------------------------------------------------------ */

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .spacer { flex: 1; }

.advanced {
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface-inset);
}
.advanced > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary svg { width: 14px; height: 14px; transition: transform .2s; }
.advanced[open] > summary svg { transform: rotate(90deg); }
.advanced .advanced-body { padding: 2px 0 14px; }
.advanced .row { align-items: flex-end; }

/* ------------------------------------------------------------
   شبكة الصفحات
   ------------------------------------------------------------ */

.pages-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }
.legend i {
  width: 9px; height: 9px;
  border-radius: 3px;
  display: inline-block;
  margin-inline-end: 4px;
  vertical-align: -1px;
}
.legend .l-done { background: var(--green); }
.legend .l-failed { background: var(--red); }
.legend .l-pending { background: var(--surface-3); border: 1px solid var(--line-strong); }

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
}
.page-chip {
  position: relative;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform .1s, border-color .15s, background .15s, color .15s;
}
.page-chip:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.page-chip.done { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); background: var(--green-soft); }
.page-chip.failed { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); background: var(--red-soft); }
.page-chip.current { outline: 2px solid var(--accent); outline-offset: 1px; color: var(--ink); }
.page-chip.current::after {
  content: "";
  position: absolute;
  top: 4px; inset-inline-end: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------
   سجل العمل
   ------------------------------------------------------------ */

.job-card .job-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.job-card .job-head b { font-size: 14px; }
.job-card .job-head .muted { font-size: 12px; }
.job-card .progress { margin-top: 12px; }

.log {
  margin-top: 12px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  max-height: 210px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-2);
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  scrollbar-width: thin;
}
.log .ln { display: block; }
.log .ln.err { color: var(--red); }
.log .ln.ok { color: var(--green); }

/* ------------------------------------------------------------
   المراجعة
   ------------------------------------------------------------ */

.review-card { padding: 0; overflow: hidden; }
.review-toolbar {
  position: sticky;
  top: 68px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 13px 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.review-toolbar h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}
.review-toolbar .spacer { flex: 1; }
.dirty-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
}
.dirty-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.viewer {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 220px;
}
.viewer img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}
.viewer .open-full {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: rgba(255, 255, 255, .92);
  color: #222;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.viewer .open-full:hover { text-decoration: none; background: #fff; }

.blocks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 78vh;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.block {
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s;
}
.block:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.block .head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.block .head select {
  width: auto;
  padding: 4px 26px 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  background: var(--surface-2);
}
.block .conf { font-size: 10.5px; color: var(--muted); margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.block textarea {
  min-height: 64px;
  resize: none;
  line-height: 1.95;
  direction: rtl;
  font-size: 14.5px;
  background: var(--surface);
  overflow: hidden;
}
.block .del {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.block .del:hover { color: var(--red); background: var(--red-soft); }
.block .del svg { width: 14px; height: 14px; }

.add-block {
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  padding: 11px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color .15s, color .15s, background .15s;
}
.add-block:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.add-block svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------
   الرفع
   ------------------------------------------------------------ */

.upload-card { max-width: 900px; width: 100%; margin: 0 auto; }
.upload-head { text-align: center; margin-bottom: 18px; }
.upload-head h1 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
}
.upload-head p { margin: 0; color: var(--muted); font-size: 13px; }

.dropzone {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  background:
    radial-gradient(400px 180px at 50% 0%, var(--accent-soft), transparent 75%),
    var(--surface-inset);
  transition: border-color .18s, background .18s, transform .18s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background:
    radial-gradient(400px 180px at 50% 0%, var(--accent-soft), transparent 75%),
    color-mix(in srgb, var(--accent-soft) 30%, var(--surface-inset));
}
.dropzone.drag { transform: scale(1.005); }
.dropzone .dz-icon {
  width: 62px; height: 62px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.dropzone .dz-icon svg { width: 28px; height: 28px; }
.dropzone b { display: block; font-size: 15px; }
.dropzone .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-inset);
  margin-top: 14px;
}
.file-chip .ficon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.file-chip .fname { font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fsize { color: var(--muted); font-size: 11.5px; }
.file-chip .icon-btn { margin-inline-start: auto; }

.upload-form { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.dpi-fieldset { border: 0; padding: 0; margin: 0; }
.dpi-fieldset legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0;
}
.dpi-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dpi-option {
  position: relative;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dpi-option:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.dpi-option input { position: absolute; opacity: 0; pointer-events: none; }
.dpi-option .dpi-num {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dpi-option .dpi-lbl { font-size: 12px; font-weight: 650; }
.dpi-option .dpi-time { font-size: 10.5px; color: var(--muted); }
.dpi-option .dpi-check {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: none;
  place-items: center;
}
.dpi-option .dpi-check svg { width: 11px; height: 11px; stroke-width: 3; }
.dpi-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.dpi-option.selected .dpi-check { display: grid; }

.dpi-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin-top: 9px;
}
.dpi-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--gold); }

.upload-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-actions .spacer { flex: 1; }

/* ------------------------------------------------------------
   الحالة الفارغة / الهيكل العظمي
   ------------------------------------------------------------ */

.empty {
  text-align: center;
  padding: 56px 24px;
}
.empty .art {
  width: 92px; height: 92px;
  margin: 0 auto 16px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.empty .art svg { width: 44px; height: 44px; stroke-width: 1.5; }
.empty h2 { margin: 0 0 6px; font-family: var(--display); font-size: 24px; }
.empty p { margin: 0 auto 18px; color: var(--muted); max-width: 420px; font-size: 13.5px; }

.skeleton { padding: 8px 0; }
.sk-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: sk 1.4s ease-in-out infinite;
  margin-bottom: 12px;
}
.sk-line.w40 { width: 40%; }
.sk-line.w70 { width: 70%; }
.sk-line.w90 { width: 90%; }
.sk-card { height: 150px; border-radius: var(--radius-lg); }

/* ------------------------------------------------------------
   التنبيهات
   ------------------------------------------------------------ */

.toast-wrap {
  position: fixed;
  inset-inline-start: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  animation: toast-in .22s cubic-bezier(.2, .8, .2, 1);
}
.toast .tico { color: var(--accent); margin-top: 1px; flex: none; }
.toast .tico svg { width: 16px; height: 16px; }
.toast.ok { border-inline-start-color: var(--green); }
.toast.ok .tico { color: var(--green); }
.toast.err { border-inline-start-color: var(--red); }
.toast.err .tico { color: var(--red); }
.toast .msg { flex: 1; min-width: 0; }
.toast .x {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 0; margin-top: 1px;
}
.toast .x:hover { color: var(--ink); }

/* ------------------------------------------------------------
   النافذة المنبثقة
   ------------------------------------------------------------ */

.modal-root { position: fixed; inset: 0; z-index: 90; display: none; }
.modal-root.open { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 18, .5);
  backdrop-filter: blur(3px);
  animation: fade .18s;
}
.modal {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  margin: 12vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: modal-in .22s cubic-bezier(.2, .8, .2, 1);
}
.modal .modal-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
  margin-bottom: 12px;
}
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ------------------------------------------------------------
   تسجيل الدخول
   ------------------------------------------------------------ */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-body::before,
.login-body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  pointer-events: none;
}
.login-body::before {
  width: 520px; height: 520px;
  top: -180px; inset-inline-end: -120px;
  background: var(--accent-soft);
}
.login-body::after {
  width: 420px; height: 420px;
  bottom: -160px; inset-inline-start: -120px;
  background: var(--gold-soft);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
.login-card h1 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
}
.login-card .sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-card .field { margin-bottom: 16px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 42px; }
.pw-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.pw-toggle:hover { color: var(--ink); background: var(--surface-3); }
.pw-toggle svg { width: 17px; height: 17px; }
.login-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
}
.login-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.error {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12.5px;
  margin: 0 0 14px;
}

/* ------------------------------------------------------------
   الحركات
   ------------------------------------------------------------ */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ------------------------------------------------------------
   الاستجابة
   ------------------------------------------------------------ */

@media (max-width: 1180px) {
  .shell { grid-template-columns: 280px minmax(0, 1fr); gap: 18px; padding: 18px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .menu-btn { display: inline-grid; }
  #closeSidebar { display: inline-grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    z-index: 50;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(86vw, 340px);
    max-height: none;
    border-radius: 0;
    border: 0;
    border-inline-end: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1);
    padding: 18px;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .overlay { display: block; opacity: 1; }
  .overlay { display: block; opacity: 0; pointer-events: none; }
  body.sidebar-open .overlay { pointer-events: auto; }
  .review { grid-template-columns: 1fr; }
  .blocks, .viewer img { max-height: 60vh; }
  .review-toolbar { top: 60px; }
}

@media (max-width: 720px) {
  .topbar-inner { padding: 8px 14px; min-height: 60px; gap: 8px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 18px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .server-pill span { display: none; }
  .server-pill { padding: 4px; }
  .server-pill .dot { margin: 0 4px; }
  .shell { padding: 14px; gap: 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .hero { padding: 18px; }
  .hero-progress { min-width: 100%; display: flex; align-items: baseline; gap: 8px; text-align: start; margin-top: 6px; }
  .hero-progress .pct { font-size: 32px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dpi-options { grid-template-columns: 1fr 1fr; }
  .pages-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); max-height: 220px; }
  .review { padding: 12px; gap: 12px; }
  .review-toolbar { padding: 11px 12px; }
  .toast-wrap { inset-inline: 12px; bottom: 12px; max-width: none; }
  .modal { margin-top: 8vh; }
}

@media (max-width: 430px) {
  .brand-text strong .arrow { display: none; }
  .toolbar .btn span.lbl { display: none; }
  .toolbar .btn { padding: 9px; }
  .stat b { font-size: 15px; }
}

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

/* ============================================================
   إضافات واجهة Gemini PDF2EPUB
   ============================================================ */

.cookie-pill {
  cursor: pointer;
  font-family: var(--ui);
  transition: border-color .15s, background .15s, transform .1s;
}
.cookie-pill:hover { border-color: var(--line-strong); background: var(--surface-2); }
.cookie-pill:active { transform: scale(.98); }
.cookie-pill .icon { width: 15px; height: 15px; color: var(--muted); }

.warn-card {
  border-color: color-mix(in srgb, var(--gold) 36%, var(--line));
  background: linear-gradient(135deg, var(--gold-soft), var(--surface) 70%);
}
.warn-card .warn-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.warn-card h3 { margin: 0 0 3px; font-size: 15px; }
.warn-card p { margin: 0; color: var(--muted); font-size: 12.5px; }

.book-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.book-actions .spacer { flex: 1; }

.ops-list { display: flex; flex-direction: column; gap: 14px; }
.ops-list .job-card { margin: 0; }

.job-book {
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 220px;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
}
.job-meta .num { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }

.job-card .log {
  max-height: 170px;
  margin-top: 10px;
}
.job-card.details-open .log { max-height: 420px; }

.cookie-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  text-align: start;
}
.cookie-modal h3 { display: flex; align-items: center; gap: 9px; }
.cookie-modal h3 svg { width: 20px; height: 20px; color: var(--accent); }

.cookie-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 15px;
  font-size: 12.5px;
}
.cookie-status .grow { min-width: 0; }
.cookie-status b { display: block; font-size: 13px; }
.cookie-status small { color: var(--muted); font-size: 11.5px; }

.cookie-input {
  width: 100%;
  min-height: 155px;
  resize: vertical;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
  color: var(--ink);
  outline: none;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  direction: ltr;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.cookie-input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.cookie-input::placeholder { color: var(--muted); opacity: .7; }

.cookie-help {
  display: flex;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
  margin: 11px 0 15px;
}
.cookie-help svg { width: 16px; height: 16px; flex: none; color: var(--accent); margin-top: 2px; }
.cookie-help code {
  font-family: var(--mono);
  font-size: 11px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  padding: 1px 5px;
  border-radius: 5px;
  direction: ltr;
  display: inline-block;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.cookie-actions .spacer { flex: 1; }

.modal .form-grid { margin-top: 2px; }
.modal .field input, .modal .field select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.modal .field input:focus, .modal .field select:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}
.modal .check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 16px;
}
.modal .check-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.modal .check-row input { accent-color: var(--accent); width: 15px; height: 15px; }
.modal .modal-actions { flex-wrap: wrap; }
.modal .modal-actions .spacer { flex: 1; }
.modal textarea { font: inherit; }

.detail-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(25px, 3.2vw, 37px);
  line-height: 1.35;
  letter-spacing: .1px;
}
.detail-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.ops-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ops-head h2 { margin: 0; font-family: var(--display); font-size: 25px; }
.ops-head .spacer { flex: 1; }

.empty-ops {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty-ops svg { width: 34px; height: 34px; display: block; margin: 0 auto 10px; opacity: .55; }

@media (max-width: 720px) {
  .cookie-pill span:not(.dot) { max-width: 120px; }
  .job-book { max-width: 140px; }
  .book-actions .spacer { display: none; }
  .book-actions .btn { flex: 1 1 auto; }
  .detail-title { font-size: 26px; }
}
