/* AL-HARAMEEN — clock-doctor.css («طبيب الساعة» / Clock Doctor)
   Builds on main.css tokens and tools.css. Every block the script fills has its space
   reserved (min-height), so nothing below it moves when the city or the result arrives. */

.doc { max-width: 1000px; }
.doc .section-head { margin-bottom: 18px; }

/* ---------- the form ---------- */
.doc-form { counter-reset: docstep; }
.doc-group { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.doc-group legend {
  counter-increment: docstep; display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 10px;
  font-family: var(--font-head); font-weight: 800; font-size: 17px; color: var(--green-900);
}
.doc-group legend::before {
  content: counter(docstep); display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%; background: var(--green-700); color: #fff; font-size: 14px;
}
.doc-city-now {
  /* always two lines — the name, then country · code · GMT — so the box keeps its height */
  min-height: 82px; display: flex; flex-wrap: wrap; align-items: baseline; align-content: center; gap: 2px 12px;
  padding: 10px 14px; margin-bottom: 10px; background: var(--green-100); border-radius: 12px;
}
.doc-city-name { flex: 1 0 100%; font-family: var(--font-head); font-weight: 800; font-size: 19px; color: var(--green-900); line-height: 1.4; }
.doc-city-country { color: var(--ink-soft); }
.doc-city-code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--green-700); }
.doc-city-gmt { font-size: 13px; color: var(--ink-faint); }
.doc-pick { min-height: 78px; }   /* the chooser is mounted by script: its height is reserved */

.doc-label { display: block; font-weight: 700; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.doc-input {
  width: 100%; min-height: 48px; font: inherit; font-size: 16px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
}
.doc-date { max-width: 260px; }
.doc-dev { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.doc-field { min-width: 0; }
.doc-msg { min-height: 1.5em; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--green-700); }

.doc-times { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 10px; }
.doc-t { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink-soft); text-align: center; }
.doc-t input {
  width: 100%; min-height: 58px; padding: 8px 4px; text-align: center;
  font-family: var(--font-head); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
}
.doc-t input::placeholder, .doc-input::placeholder { color: var(--ink-faint); opacity: .7; }
.doc-t input[aria-invalid="true"] { border-color: #B3261E; background: #FDF0EF; }
.doc-input:focus-visible, .doc-t input:focus-visible {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(15, 122, 68, .2);
}
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.doc-actions .btn { min-height: 50px; cursor: pointer; }
.doc-actions .btn-green { font-size: 17px; padding-inline: 28px; }
.doc-actions .btn[disabled] { opacity: .6; cursor: progress; }
.doc-err { min-height: 1.6em; margin-top: 10px; font-weight: 700; color: #B3261E; }
.doc-busy { min-height: 1.4em; font-size: 14px; color: var(--ink-faint); }

/* ---------- the diagnosis card ---------- */
.doc-result { min-height: 190px; }
.doc-result:focus { outline: none; }
.doc-result:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }
.doc-empty { padding: 56px 10px; text-align: center; color: var(--ink-faint); }
.doc-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.doc-icon { font-size: 36px; line-height: 1.1; }
.doc-head h2 { margin: 0 0 4px; }
.doc-head p { color: var(--ink-soft); }
.doc-head.is-ok h2 { color: var(--green-700); }
.doc-head.is-warn h2 { color: #7A3E00; }

.doc-ev, .doc-cands { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.doc-ev { margin: 4px 0 16px; }
.doc-ev caption { caption-side: top; text-align: start; padding-bottom: 6px; font-size: 13px; color: var(--ink-faint); }
.doc-ev th, .doc-ev td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.doc-ev thead th, .doc-cands thead th { font-size: 13px; font-weight: 700; color: var(--ink-soft); background: var(--paper); }
.doc-ev tbody th { text-align: start; font-weight: 700; color: var(--green-900); }
.doc-tm { display: inline-block; font-weight: 700; unicode-bidi: isolate; white-space: nowrap; }
.doc-tm .ap { font-size: .75em; font-weight: 600; color: var(--ink-soft); }
.doc-ok { color: var(--green-700); font-weight: 800; }
.doc-bad { color: #B3261E; font-weight: 800; background: #FDF0EF; }

.doc-find { margin: 18px 0; padding: 4px 16px 8px; border-inline-start: 4px solid var(--gold-500); }
.doc-find h3 { margin: 0 0 6px; font-size: 18px; color: var(--green-900); line-height: 1.5; }
.doc-find > p { margin: 6px 0; line-height: 1.8; }
.doc-alt { border-inline-start-color: var(--line); }
.doc-alt ul { margin: 6px 0; padding-inline-start: 20px; }
.doc-conf { display: inline-block; margin: 2px 0 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.doc-conf-high { background: var(--green-100); color: var(--green-700); }
.doc-conf-medium { background: #FFF3D1; color: #6B4A00; }
.doc-conf-low { background: #F1EFE7; color: var(--ink-soft); }

.doc-cands { margin: 8px 0 12px; font-size: 14.5px; }
.doc-cands th, .doc-cands td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.doc-sub { display: block; font-size: 12.5px; color: var(--ink-faint); }
.doc-sub-i { font-size: 12.5px; color: var(--ink-faint); }
.doc-target { padding: 10px 12px; border-radius: 10px; background: var(--green-100); font-weight: 700; color: var(--green-900); }
.doc-code-big { font-family: ui-monospace, Consolas, monospace; font-size: 19px; color: var(--green-700); }
.doc-like { font-size: 15.5px; }
.doc-left { margin: 6px 0; padding-inline-start: 22px; }

.doc-fix { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.doc-fix h4 { margin: 0 0 6px; font-size: 15px; color: var(--green-700); }
.doc-fix-none { color: var(--ink-soft); }
.doc-steps { margin: 6px 0 4px; padding-inline-start: 24px; line-height: 1.8; color: var(--ink); }
.doc-steps li { padding: 3px 0; }
.doc-steps li::marker { font-weight: 800; color: var(--green-700); }
.doc-media { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.doc-vid { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 14px; }
.doc-vid-t { flex: 1 1 240px; min-width: 0; }
.doc-vid a { font-weight: 700; color: var(--green-700); }
.doc-vid a.doc-yt { color: #B3261E; }
.doc-more { margin-top: 10px; }
.doc-more summary { cursor: pointer; font-weight: 700; color: var(--green-700); padding: 4px 0; }
.doc-rank { margin: 8px 0; padding-inline-start: 22px; font-size: 14px; line-height: 1.9; }
.doc-setup { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.doc-setup .btn { cursor: pointer; }
.doc-link { font-weight: 700; color: var(--green-700); }

/* ---------- learn block ---------- */
.doc-learn ul { margin: 10px 0 12px; padding-inline-start: 22px; line-height: 1.9; color: var(--ink-soft); }
.doc-learn li::marker { color: var(--gold-500); }

@media (max-width: 820px) {
  .doc-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .doc-pick { min-height: 131px; } }
@media (max-width: 480px) {
  /* a long country name puts code and GMT on a third line: reserve it */
  .doc-city-now { min-height: 102px; font-size: 14px; }
  .doc-dev { grid-template-columns: 1fr; }
  .doc-date { max-width: none; }
  .doc-t input { font-size: 22px; }
  .doc-ev th, .doc-ev td { padding: 8px 4px; font-size: 14px; }
  .doc-cands { font-size: 13.5px; }
  .doc-find { padding-inline: 12px 4px; }
}
@media print {
  .doc-form, .doc-learn, .doc-intro p, .doc-setup, .doc-more { display: none !important; }
  .doc-result { border: 0; box-shadow: none; padding: 0; }
  .doc-find { break-inside: avoid; }
  .doc-bad { background: none; }
}

/* an option as printed on the clock (setup-kb.json): the LCD text, then the manual's words */
.doc-opt-lcd {
  display: inline-block; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--panel-line);
  background: var(--panel); color: #8CF5B4; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: .95em;
}
.doc-printed { unicode-bidi: isolate; }

/* a model in two editions: both fix blocks, each with the sentence that tells them apart (Reviewer 2) */
.doc-edition { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); }
.doc-ed { font-weight: 700; color: var(--green-700); }
