/* Medisyn Examinations Catalog — public index
   Ported from the design bundle (Medisyn Catalog.html).
   Scoped under .medisyn so existing admin/Tailwind UI is untouched.
   ─────────────────────────────────────────────────────────────────────── */

html {
  scrollbar-gutter: stable;
}

.medisyn {
  --brand-deep: #003a73;
  --brand: #005aa9;
  --brand-cyan: #00b8c7;

  --acc-rose: #c97064;
  --acc-amber: #c9954a;
  --acc-sage: #6b9080;
  --acc-violet: #6b6bb5;
  --acc-teal: #4a8fa3;
  --acc-clay: #b78863;
  --acc-stone: #8b95a8;
  --acc-plum: #8e6c88;
  --acc-moss: #7a8c5c;

  --ink: #14202b;
  --ink-2: #2c3a48;
  --ink-3: #4f5b67;
  --ink-4: #6e7985;
  --ink-5: #c5cdd3;
  --line: #ecedef;
  --line-2: #f3f4f5;
  --paper: #ffffff;
  --paper-2: #fafafa;
  --paper-3: #f6f6f7;

  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(20, 32, 43, 0.06);
  --glass-border-strong: rgba(20, 32, 43, 0.1);

  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 32, 43, 0.03);
  --shadow-md:
    0 1px 3px rgba(20, 32, 43, 0.04), 0 8px 24px rgba(20, 32, 43, 0.04);
  --shadow-lg:
    0 2px 8px rgba(20, 32, 43, 0.04), 0 24px 60px rgba(20, 32, 43, 0.07);
  --shadow-glass:
    0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 1px 3px rgba(20, 32, 43, 0.04),
    0 12px 40px rgba(20, 32, 43, 0.06);

  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  font-size: 16px;
  line-height: 1.5;
}

.medisyn h1,
.medisyn h2,
.medisyn h3,
.medisyn h4,
.medisyn p {
  margin: 0;
}
.medisyn h1 {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.medisyn h2 {
  font-weight: 600;
  letter-spacing: -0.02em;
}
.medisyn h3,
.medisyn h4 {
  font-weight: 600;
  letter-spacing: -0.01em;
}
.medisyn .mono {
  font-family: var(--font-mono);
  font-feature-settings: "zero";
}

.medisyn :focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ───── Index shell ───── */
.idx-shell {
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.idx-shell::before {
  content: "";
  position: absolute;
  top: -200px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 184, 199, 0.08), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.idx-shell::after {
  content: "";
  position: absolute;
  top: 100px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(201, 112, 100, 0.06),
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}
.idx-shell > * {
  position: relative;
}

/* Hero */
.idx-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 48px 64px;
  text-align: center;
  position: relative;
  z-index: 30;
}
.idx-hero-logo {
  height: 48px;
  margin: 0 auto 56px;
  display: block;
  opacity: 0.95;
}
.idx-hero h1 {
  font-size: 84px;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 48px;
  font-weight: 600;
}
.idx-hero h1 .pop {
  color: var(--ink-3);
  font-weight: 300;
}

/* Embedded (iframe) mode: the host page already shows Medisyn branding and a
   "Κατάλογος Εξετάσεων" heading, so hide the in-app logo + hero title and
   tighten the top padding down to the search box. */
body[data-embed="true"] .idx-hero > a,
body[data-embed="true"] .idx-hero h1 {
  display: none;
}
body[data-embed="true"] .idx-hero {
  padding-top: 32px;
}

/* Search */
.idx-search-wrap {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 40;
}
.idx-search {
  display: flex;
  align-items: center;
  height: 64px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1.5px solid rgba(20, 32, 43, 0.18);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-glass);
  padding: 0 8px 0 28px;
  position: relative;
  z-index: 2;
  transition:
    box-shadow 0.25s,
    border-color 0.25s;
}
.idx-search:hover {
  border-color: var(--brand);
}
.idx-search:focus-within {
  border-color: var(--brand);
  box-shadow:
    0 0 0 4px rgba(0, 90, 169, 0.12),
    var(--shadow-glass);
}
.idx-search-icon {
  color: var(--ink-3);
  flex-shrink: 0;
}
.idx-search input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  margin: 0 14px;
  letter-spacing: -0.005em;
  min-width: 0;
}
.idx-search input:focus,
.idx-search input:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
}
.idx-search input::placeholder {
  color: var(--ink-2);
  font-weight: 400;
  opacity: 1;
}
.idx-search-kbd {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(20, 32, 43, 0.04);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-right: 8px;
  letter-spacing: 0.02em;
}
.idx-search-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: white;
  font: inherit;
  font-weight: 500;
  font-size: 13.5px;
  border: 0;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background 0.18s;
  text-decoration: none;
  white-space: nowrap;
}
.idx-search-go:hover {
  background: var(--brand);
}

.idx-search-pop {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 50;
}
.idx-search-pop[hidden] {
  display: none;
}
.idx-search-pop h5 {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 8px 12px 6px;
  font-weight: 500;
}
.idx-search-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  border: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.idx-search-row:hover,
.idx-search-row[data-active="true"] {
  background: rgba(20, 32, 43, 0.04);
}
.idx-search-row .name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.idx-search-row .en {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Alphabet bar */
.idx-alpha-bar-wrap {
  max-width: 1180px;
  margin: 16px auto 0;
  padding: 0 32px;
  position: relative;
  z-index: 0;
}
.idx-alpha-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.idx-alpha-letters {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 1px;
  min-width: 0;
}
.idx-alpha-divider {
  flex-shrink: 0;
  width: 1px;
  height: 24px;
  background: var(--glass-border);
}
.idx-alpha-btn {
  font: inherit;
  border: 0;
  cursor: pointer;
  height: 36px;
  min-width: 34px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.12s,
    color 0.12s;
  flex-shrink: 0;
  box-sizing: border-box;
}
.idx-alpha-letters > .idx-alpha-btn:first-child {
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* Below the desktop max-width the letter strip can't fit one row, so allow
   horizontal scroll instead of wrapping. The lang toggle stays anchored to
   the left while only the letters scroll. A thin scrollbar hints at the
   swipe affordance without becoming visual clutter. */
@media (max-width: 1199px) {
  .idx-alpha-letters {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
  }
  .idx-alpha-letters::-webkit-scrollbar {
    height: 4px;
  }
  .idx-alpha-letters::-webkit-scrollbar-track {
    background: transparent;
  }
  .idx-alpha-letters::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
  }
}
.idx-alpha-btn:hover {
  background: var(--paper-3);
  color: var(--ink);
}
.idx-alpha-btn[data-active="true"] {
  background: var(--ink);
  color: white;
}
.idx-alpha-btn[data-empty="true"] {
  color: var(--ink-5);
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

/* Alphabet-range toggle (Α–Ω / A–Z), inline at the start of the bar */
.idx-alpha-lang {
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0;
}
.idx-alpha-lang-btn {
  height: 36px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.12s,
    color 0.12s;
  cursor: pointer;
  box-sizing: border-box;
}
.idx-alpha-lang-btn:hover {
  background: rgba(20, 32, 43, 0.04);
  color: var(--ink);
}
.idx-alpha-lang-btn[data-active="true"] {
  background: rgba(20, 32, 43, 0.08);
  color: var(--ink);
  font-weight: 700;
}

/* Body */
.idx-body {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 48px 96px;
}

.idx-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--line);
}
.idx-results-head h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: -0.005em;
}
.idx-results-head h2 .num {
  font-feature-settings: "tnum";
  color: var(--ink);
}

.idx-group-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}
.idx-group-letter {
  font-size: 36px;
  font-weight: 300;
  color: var(--ink-2);
  line-height: 1;
  letter-spacing: -0.03em;
}
.idx-group-meta {
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* List */
.idx-list {
  background: var(--paper);
}
.idx-list-row {
  display: grid;
  grid-template-columns: auto 1fr 24px;
  align-items: center;
  gap: 16px;
  padding: 22px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  cursor: pointer;
  transition:
    background 0.12s,
    padding 0.15s;
  text-decoration: none;
  color: inherit;
}
.idx-list-row:last-child {
  border-bottom: 0;
}
.idx-list-row:hover {
  background: var(--paper-2);
  padding-left: 16px;
}
.idx-list-row .ltitle {
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  font-size: 17px;
}
.idx-list-row .lsub {
  font-size: 14px;
  color: var(--ink-4);
  margin-top: 4px;
  font-weight: 400;
}
.idx-list-row .lsnippet {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 6px;
  font-weight: 400;
}
.idx-list-row .lchev {
  color: var(--ink-4);
  justify-self: end;
}
.idx-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink-5);
  flex-shrink: 0;
}

/* Empty */
.idx-empty {
  text-align: center;
  padding: 96px 20px;
  color: var(--ink-4);
}
.idx-empty h3 {
  font-weight: 600;
  font-size: 20px;
  color: var(--ink-2);
  margin-bottom: 8px;
}

/* Pagination */
.idx-pager {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.idx-pager > a,
.idx-pager > span {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.idx-pager > a:hover {
  background: var(--paper-3);
  color: var(--ink);
}
.idx-pager > a[data-active="true"] {
  background: var(--ink);
  color: white;
}
.idx-pager > .gap {
  color: var(--ink-4);
  padding: 0 6px;
  font-weight: 500;
  user-select: none;
}
.idx-pager > .prev,
.idx-pager > .next {
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 18px;
  line-height: 1;
}
.idx-pager > .prev:hover,
.idx-pager > .next:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--paper);
}

/* ───── Detail page ───── */
.dt-shell {
  background: var(--paper);
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
}
.dt-shell::before {
  content: "";
  position: absolute;
  top: -150px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 184, 199, 0.07), transparent 65%);
  pointer-events: none;
}
.dt-shell > * {
  position: relative;
}

.dt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  max-width: 1320px;
  margin: 0 auto;
}
.dt-bar-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.15s;
}
.dt-bar-back:hover {
  color: var(--ink);
}
.dt-bar-logo {
  height: 26px;
  opacity: 0.85;
}

.dt-hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 48px 56px;
}

.dt-eyebrow {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 28px;
  font-weight: 500;
}
.dt-eyebrow .code-chip {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--paper-3);
  text-transform: none;
}
.dt-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-cyan);
}
.dt-eyebrow a {
  color: inherit;
  text-decoration: none;
}
.dt-eyebrow a:hover {
  color: var(--ink);
}

.medisyn .dt-title {
  font-weight: 600;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 18px;
}
.dt-title .accent {
  color: var(--ink-3);
  font-weight: 300;
}
.dt-en {
  font-size: 16px;
  color: var(--ink-3);
  font-weight: 400;
  margin-bottom: 0;
  letter-spacing: -0.005em;
}

.dt-body {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px 96px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
}
.dt-body:has(.dt-aside) {
  grid-template-columns: 200px 1fr 320px;
}

.dt-toc {
  position: sticky;
  top: 32px;
  align-self: start;
}
.dt-toc-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 18px;
  font-weight: 500;
}
.dt-toc-list {
  display: grid;
  gap: 1px;
}
.dt-toc-list a {
  display: block;
  padding: 9px 14px;
  border-left: 1px solid var(--line);
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.003em;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.dt-toc-list a:hover {
  color: var(--ink);
  border-left-color: var(--ink-3);
}
.dt-toc-list a[data-active="true"] {
  color: var(--ink);
  border-left-color: var(--ink);
  font-weight: 500;
}

.dt-section {
  margin-bottom: 56px;
  scroll-margin-top: 32px;
}
.dt-section h2 {
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  letter-spacing: -0.02em;
}
.dt-section h2 .ix {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  margin-right: 14px;
  letter-spacing: 0.06em;
  font-weight: 500;
  vertical-align: 8px;
}
.dt-section .dt-edit {
  font-size: 12px;
  color: var(--ink-4);
  text-decoration: none;
  margin-left: 12px;
  vertical-align: middle;
}
.dt-section .dt-edit:hover {
  color: var(--brand);
}

/* Show-page wrapper inherits the shared .lexxy-content rules
 * (loaded as a separate stylesheet from the application layout). */
.dt-prose {
  max-width: none;
}

.dt-empty {
  font-size: 13px;
  color: var(--ink-4);
  font-style: italic;
}

.dt-footnote {
  margin-top: 56px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--paper-3);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
  border-left: 2px solid var(--ink-5);
}
.dt-footnote b {
  color: var(--ink);
  font-weight: 600;
}

/* Right-side aside: Συνοπτικά + Σχετικές εξετάσεις */
.dt-aside {
  display: grid;
  gap: 16px;
  align-self: start;
  position: sticky;
  top: 32px;
}
.dt-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.dt-card.glass {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-glass);
}
.dt-card h4 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 16px;
}
.dt-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 8px 0;
}
.dt-card-row .k {
  color: var(--ink-3);
  flex-shrink: 0;
}
.dt-card-row .v {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.003em;
  text-align: right;
  min-width: 0;
}

.dt-related-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-2);
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: padding 0.15s;
}
.dt-related-row:first-of-type {
  border-top: 0;
  padding-top: 4px;
}
.dt-related-row:hover {
  padding-left: 4px;
}
.dt-related-row .rname {
  font-weight: 500;
  flex: 1;
  letter-spacing: -0.003em;
  color: var(--ink);
}
.dt-related-row .rchev {
  color: var(--ink-4);
  flex-shrink: 0;
}

.dt-quick-stab {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.dt-quick-stab .tile {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  font-size: 12.5px;
  background: var(--paper);
}
.dt-quick-stab .tile .t {
  font-weight: 600;
  color: var(--ink);
}
.dt-quick-stab .tile .d {
  color: var(--ink-3);
  text-align: right;
}
.dt-quick-stab .tile[data-cold="1"] .t::before { content: "❄ "; }
.dt-quick-stab .tile[data-cold="2"] .t::before { content: "❄❄ "; }

@media (max-width: 1180px) {
  .dt-body,
  .dt-body:has(.dt-aside) {
    grid-template-columns: 200px 1fr;
  }
  .dt-aside {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    position: static;
    margin-top: 24px;
  }
}
@media (max-width: 900px) {
  .dt-body,
  .dt-body:has(.dt-aside) {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .dt-toc {
    position: static;
    order: 0;
  }
  .dt-aside {
    grid-template-columns: 1fr;
    margin-top: 0;
    margin-bottom: 24px;
    order: -1;
  }
  .dt-body main,
  .dt-body > main {
    order: 1;
  }
  .dt-title {
    font-size: 36px;
  }
}

@media (max-width: 720px) {
  .dt-bar {
    padding: 16px 20px;
  }
  .dt-hero {
    padding: 32px 20px 32px;
  }
  .dt-body {
    padding: 0 20px 64px;
  }
  .dt-section h2 {
    font-size: 20px;
  }
  .dt-section h2 .ix {
    display: block;
    margin-bottom: 4px;
    vertical-align: baseline;
  }
}

@media (max-width: 720px) {
  .idx-hero {
    padding: 64px 20px 40px;
  }
  .idx-hero h1 {
    font-size: 56px;
    margin-bottom: 32px;
  }
  .idx-hero-logo {
    height: 40px;
    margin-bottom: 36px;
  }
  .idx-search {
    height: 56px;
    padding: 0 6px 0 20px;
  }
  .idx-search input {
    font-size: 16px;
    margin: 0 10px;
  }
  .idx-search-kbd {
    display: none;
  }
  .idx-search-go {
    height: 44px;
    padding: 0 18px;
    font-size: 13px;
  }
  .idx-alpha-bar-wrap {
    padding: 0 16px;
  }
  .idx-body {
    padding: 16px 16px 64px;
  }
  .idx-list-row {
    padding: 18px 4px;
  }
  .idx-list-row:hover {
    padding-left: 8px;
  }
}

/* ───── Status banners ───── */
.medisyn .idx-banner {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin: 12px 0;
  font-size: 14px;
}
.medisyn .idx-banner.warn {
  border-color: var(--acc-amber);
  color: var(--acc-amber);
}
.medisyn .idx-banner.err {
  border-color: var(--acc-rose);
  color: var(--acc-rose);
}

.medisyn .idx-suggest-banner button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  .medisyn *,
  .medisyn *::before,
  .medisyn *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .medisyn .idx-list {
    opacity: 1 !important;
  }
}

/* sr-only utility for live regions */
.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;
}

/* ---------- Suggestions floating panel ---------- */
.idx-search-wrap {
  position: relative;
}

.idx-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  padding: 4px;
}

.idx-suggestion-row {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.idx-suggestion-row:hover,
.idx-suggestion-row[aria-selected="true"] {
  background: #f3f4f6;
}
.idx-suggestion-row .ssug-title {
  display: block;
  font-weight: 600;
}
.idx-suggestion-row .ssug-sub {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 2px;
}
.idx-suggestion-row em {
  background: #fef3c7;
  font-style: normal;
  padding: 0 2px;
  border-radius: 2px;
}

.idx-suggestions-more {
  display: block;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
  font-size: 0.875rem;
  color: #2563eb;
  text-decoration: none;
}
.idx-suggestions-more:hover {
  background: #f3f4f6;
}

/* ---------- Stale main list while fetching ---------- */
.idx-list--stale {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 120ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .idx-list--stale {
    transition: none;
  }
}

/* ---------- Mobile: panel anchored to viewport edges ---------- */
@media (max-width: 640px) {
  .idx-suggestions {
    position: fixed;
    top: auto;
    left: 8px;
    right: 8px;
    max-height: 50vh;
  }
}

@media print {
  .dt-bar,
  .dt-toc,
  .dt-aside,
  .dt-footnote { display: none !important; }
  .dt-shell::before { display: none; }
  .dt-body,
  .dt-body:has(.dt-aside) {
    grid-template-columns: 1fr !important;
    padding: 0 !important;
    max-width: none;
  }
  .dt-prose {
    font-size: 11pt;
    line-height: 1.45;
    max-width: none;
  }
  .dt-prose table { page-break-inside: auto; }
  .dt-prose tr    { page-break-inside: avoid; page-break-after: auto; }
  .dt-section     { page-break-inside: avoid; }
  .dt-hero        { padding: 16px 0 !important; }
}
