/* ==========================================================================
   Double Major OS · Wave1 — 雙鏡橋寮｜雙鏡經案首屏＋唯一 CTA
   2026-11-04 · Creator · 0 deploy / 0 push
   Palette: --fleet-* tokens + existing --prg-* only. 0 new global hex.
   This file only styles the Wave1 shell; it must not break Wave0:
   #bridge-watch-light, Fleet w6 chrome, #action-btn hook, seal hooks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Rhythm — lift the 經案 above the fold (fixed Fleet nav uses a 68px spacer)
   -------------------------------------------------------------------------- */
main {
  margin-top: 0 !important;
  padding-top: 12px !important;
  padding-bottom: 3rem !important;
  justify-content: flex-start !important;
}

main > #dm-hero { margin-bottom: 0.85rem; }

/* --------------------------------------------------------------------------
   2. 題額 — 雙鏡橋寮 (proper noun kept in both languages; EN line under it)
   -------------------------------------------------------------------------- */
#dm-hero {
  text-align: center;
  padding: 0 0.75rem;
}

/* legacy mobile rule gives every <header> 5.5rem top padding for the fixed nav;
   main already handles the offset now. */
header#dm-hero { padding-top: 0 !important; }

#dm-hero .dm-hero__eyebrow {
  margin: 0 0 0.45rem;
  font-family: var(--fleet-ui);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--fleet-muted);
}

#dm-hero .dm-hero__title {
  margin: 0 0 0.25rem;
  font-family: var(--fleet-display);
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.18em;
  text-indent: 0.18em; /* optically centre the tracked CJK title */
  color: var(--fleet-text);
  background: linear-gradient(135deg, var(--fleet-text) 0%, var(--fleet-text) 58%, var(--fleet-amber-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: none;
  filter: none;
}

#dm-hero .dm-hero__en {
  margin: 0 0 0.55rem;
  font-family: var(--fleet-ui-en);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fleet-amber-soft);
}

#dm-hero .dm-hero__sub {
  margin: 0 0 0.4rem;
  font-family: var(--fleet-display);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fleet-body);
}

#dm-hero .dm-hero__lead {
  max-width: 44rem;
  margin: 0 auto 0.5rem;
  font-family: var(--fleet-ui);
  font-size: 12px;
  line-height: 1.75;
  color: var(--fleet-muted-strong);
}

#dm-hero .dm-hero__steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 0 auto 0.4rem;
}

#dm-hero .dm-step {
  padding: 4px 9px;
  border: 1px solid var(--fleet-line-soft);
  border-radius: var(--fleet-r-pill, 999px);
  font-family: var(--fleet-ui);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--fleet-muted);
  white-space: nowrap;
}

#dm-hero .dm-step.is-now {
  border-color: var(--fleet-line);
  background: rgba(245, 158, 11, 0.07);
  color: var(--fleet-amber-soft);
  font-weight: 700;
}

#dm-hero .dm-hero__note {
  margin: 0;
  font-family: var(--fleet-ui);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--fleet-muted);
}

/* --------------------------------------------------------------------------
   3. 雙鏡經案 — one table card
   -------------------------------------------------------------------------- */
#inputArea.dm-case {
  max-width: 62rem !important;
  margin-bottom: 0 !important;
  padding: 1.05rem 1.2rem 1.1rem !important;
  text-align: center !important;
  background: var(--fleet-surface) !important;
  background-image: none !important;
  border: 1px solid var(--fleet-line) !important;
  border-radius: var(--fleet-r-card, 12px) !important;
  box-shadow: var(--fleet-shadow-panel) !important;
  overflow: visible !important;
}

#inputArea.dm-case::before,
#inputArea.dm-case::after { display: none !important; }

#inputArea .dm-case__head { margin: 0 0 0.4rem; }

#inputArea .dm-case__kicker {
  margin: 0 0 0.2rem;
  font-family: var(--fleet-ui);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fleet-amber-soft);
}

#inputArea .dm-case__title {
  margin: 0 0 0.25rem;
  font-family: var(--fleet-display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--fleet-text);
}

#inputArea .dm-case__note {
  margin: 0;
  font-family: var(--fleet-ui);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--fleet-muted-strong);
}

#inputArea .dm-case__guide {
  margin: 0 0 0.45rem;
  font-family: var(--fleet-ui);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--fleet-body);
}

#inputArea .dm-case__guide-tag {
  display: inline;
  margin-left: 0.4em;
  font-size: 10px;
  color: var(--fleet-muted);
}

/* ---- 雙經籤 ------------------------------------------------------------- */
#inputArea .dm-case__slips { margin: 0 0 0.5rem; }

#inputArea .dm-case__slips-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
}

#inputArea .dm-case__slips-title {
  margin: 0;
  font-family: var(--fleet-display);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--fleet-text);
}

#inputArea .dm-case__slips-note {
  margin: 0;
  font-family: var(--fleet-ui);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--fleet-muted);
}

#inputArea .dm-anchor-grid { gap: 0.55rem !important; }

#inputArea .dm-slip {
  min-width: 0;
  padding: 0.5rem 0.6rem 0.45rem !important;
  background: var(--fleet-bg) !important;
  background-image: none !important;
  border: 1px solid var(--fleet-line-soft) !important;
  border-radius: var(--fleet-r-panel, 10px) !important;
  box-shadow: none !important;
}

#inputArea .dm-slip__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.3rem;
  padding: 0 0 0.28rem;
  border-bottom: 1px solid var(--fleet-line-soft);
  text-align: left;
}

#inputArea .dm-slip__icon {
  font-size: 11px;
  color: var(--fleet-amber-soft);
}

#inputArea .dm-slip--buddhist .dm-slip__icon { color: var(--fleet-violet); }

#inputArea .dm-slip__title {
  font-family: var(--fleet-ui);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--fleet-muted-strong);
  text-transform: uppercase;
}

#c-anchors-container,
#b-anchors-container { gap: 0.25rem; }

/* 籤面 = 已選值（放最前），撥換 = 兩個 select */
#inputArea .dm-canon-picked {
  order: -1;
  margin: 0 0 0.1rem;
  font-family: var(--fleet-ui);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--fleet-amber-soft);
  text-align: left;
}

#inputArea .dm-canon-hint,
#inputArea .dm-canon-note { display: none !important; }

#inputArea .dm-canon-field { gap: 0.1rem; }

#inputArea .dm-canon-field span {
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--fleet-muted) !important;
}

#inputArea .dm-canon-field select {
  min-height: 36px !important;
  padding: 0.25rem 1.7rem 0.25rem 0.5rem !important;
  font-size: 12.5px !important;
  line-height: 1.3 !important;
  border: 1px solid var(--fleet-line-cool) !important;
  border-radius: 8px !important;
  background: var(--fleet-raised) !important;
  color: var(--fleet-text) !important;
}

#inputArea .dm-canon-field select:focus {
  outline: 2px solid var(--fleet-focus) !important;
  outline-offset: 1px;
}

/* ---- 處境 --------------------------------------------------------------- */
#inputArea .dm-case__write { text-align: left; }

#inputArea .dm-case__writehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.3rem;
}

#inputArea .dm-case__label {
  font-family: var(--fleet-ui);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fleet-amber-soft);
}

#inputArea .dm-case__mini {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#inputArea .dm-case__mini .dm-text-cta { min-height: 26px !important; }

#inputArea .dm-inspire {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 8px;
  border: 1px solid var(--fleet-line-soft);
  border-radius: var(--fleet-r-pill, 999px);
  background: transparent;
  color: var(--fleet-muted-strong);
  font-family: var(--fleet-ui);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

#inputArea .dm-inspire:hover {
  border-color: var(--fleet-line);
  color: var(--fleet-amber-soft);
}

/* 橋寮引子 Ghost strip */
#inputArea .dm-ghost {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.4rem;
  padding: 0.3rem 0.45rem;
  border: 1px dashed var(--fleet-line-soft);
  border-radius: var(--fleet-r-control, 8px);
  background: rgba(245, 158, 11, 0.03);
}

#inputArea .dm-ghost__scroll {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  flex: 1 1 auto;
}

#inputArea .dm-ghost.is-off { display: none !important; }

#inputArea .dm-ghost__kicker {
  margin: 0 0.15rem 0 0;
  font-family: var(--fleet-ui);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fleet-muted);
}

#inputArea .dm-ghost__chip {
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid var(--fleet-line-soft);
  border-radius: var(--fleet-r-pill, 999px);
  background: transparent;
  color: var(--fleet-body);
  font-family: var(--fleet-ui);
  font-size: 10px;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

#inputArea .dm-ghost__chip:hover {
  border-color: var(--fleet-line);
  color: var(--fleet-amber-soft);
}

#inputArea .dm-ghost__close {
  min-height: 26px;
  flex: 0 0 auto;
  margin-left: 0;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--fleet-muted);
  font-family: var(--fleet-ui);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

#inputArea .dm-ghost__close:hover { color: var(--fleet-text); }

#inputArea #userQuestion {
  width: 100% !important;
  min-height: 5.25rem !important;
  padding: 0.7rem 0.85rem !important;
  font-family: var(--fleet-ui) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  text-align: left !important;
  border: 1px solid var(--fleet-line-cool) !important;
  border-radius: 10px !important;
  background: var(--fleet-raised) !important;
  color: var(--fleet-text) !important;
  box-shadow: none !important;
}

#inputArea #userQuestion:focus {
  border-color: var(--fleet-focus) !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16) !important;
  transform: none !important;
}

#inputArea #userQuestion::placeholder { color: var(--fleet-muted) !important; }

/* ---- 唯一 CTA ----------------------------------------------------------- */
#inputArea .dm-cta-row {
  gap: 0.3rem !important;
  margin-top: 0.4rem;
}

#inputArea #action-btn.dm-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 50px;
  padding: 0.8rem 1rem !important;
  border: 1px solid var(--fleet-amber-soft) !important;
  border-radius: var(--fleet-r-panel, 10px) !important;
  background: linear-gradient(100deg, var(--fleet-amber-deep) 0%, var(--fleet-amber) 55%, var(--fleet-amber-soft) 100%) !important;
  color: var(--fleet-ink) !important;
  font-family: var(--fleet-ui) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em !important;
  text-transform: none !important;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.22) !important;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

#inputArea #action-btn.dm-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  letter-spacing: 0.1em !important;
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.3) !important;
}

#inputArea #action-btn.dm-primary:disabled { filter: grayscale(0.5); opacity: 0.7; }

#inputArea #dm-example-btn.dm-text-cta {
  min-height: 30px !important;
  padding: 0.2rem !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--fleet-muted-strong) !important;
  font-family: var(--fleet-ui) !important;
  font-size: 10.5px !important;
  letter-spacing: 0.06em !important;
  text-transform: none !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#inputArea #dm-example-btn.dm-text-cta:hover { color: var(--fleet-amber-soft) !important; }

/* ---- 案前狀態 + 說明 ---------------------------------------------------- */
#inputArea .dm-case__status {
  min-height: 1.1em;
  margin: 0.4rem 0 0 !important;
  font-family: var(--fleet-ui);
  font-size: 10.5px;
  line-height: 1.55;
  text-align: center;
  color: var(--fleet-muted);
}

#inputArea .dm-case__status.is-ready { color: var(--fleet-amber-soft); }

#inputArea .dm-case__help {
  margin: 0.35rem auto 0;
  max-width: 40rem;
  font-family: var(--fleet-ui);
  font-size: 10px;
  color: var(--fleet-muted);
}

#inputArea .dm-case__help summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
  letter-spacing: 0.05em;
}

#inputArea .dm-case__help summary::-webkit-details-marker { display: none; }

#inputArea .dm-case__help summary::after { content: " +"; }

#inputArea .dm-case__help[open] summary::after { content: " −"; }

#inputArea .dm-case__help ul {
  margin: 0.35rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

#inputArea .dm-case__help li { color: var(--fleet-muted-strong); line-height: 1.55; }

/* --------------------------------------------------------------------------
   4. Mode Tabs — 收編為次層（功能與 #dm-mode-tabs hook 全保留）
   -------------------------------------------------------------------------- */
.dm-modes {
  margin: 0.85rem auto 1.1rem;
  max-width: 62rem;
  text-align: center;
}

.dm-modes .dm-modes__label {
  margin: 0 0 0.3rem;
  font-family: var(--fleet-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fleet-muted);
}

.dm-modes .dm-mode-tabs {
  margin: 0 auto !important;
  gap: 0.28rem !important;
  max-width: 46rem;
}

.dm-modes .dm-mode-tab {
  min-height: 30px !important;
  padding: 0.22rem 0.6rem !important;
  border: 1px solid var(--fleet-line-soft) !important;
  border-radius: var(--fleet-r-pill, 999px) !important;
  background: transparent !important;
  color: var(--fleet-muted) !important;
  font-family: var(--fleet-ui);
  font-size: 9.5px !important;
  letter-spacing: 0.05em !important;
  text-transform: none !important;
}

.dm-modes .dm-mode-tab:hover { color: var(--fleet-text) !important; border-color: var(--fleet-line) !important; }

.dm-modes .dm-mode-tab.is-on {
  background: rgba(245, 158, 11, 0.07) !important;
  border-color: var(--fleet-line) !important;
  color: var(--fleet-amber-soft) !important;
}

.dm-modes .dm-mode-tab em {
  color: var(--fleet-violet) !important;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   5. 生成後 hero 收斂（body.dm-has-result，由 js/wave1.js 加）
   -------------------------------------------------------------------------- */
body.dm-has-result #dm-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  padding: 0;
}

body.dm-has-result #dm-hero .dm-hero__eyebrow,
body.dm-has-result #dm-hero .dm-hero__en,
body.dm-has-result #dm-hero .dm-hero__lead,
body.dm-has-result #dm-hero .dm-hero__steps,
body.dm-has-result #dm-hero .dm-hero__note { display: none; }

body.dm-has-result #dm-hero .dm-hero__title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}

body.dm-has-result #dm-hero .dm-hero__sub {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--fleet-muted-strong);
}

body.dm-has-result .dm-modes { margin-top: 0.6rem; }

/* Wave0 pulls the beacon up under the case (-2.5rem) against the old mb-20.
   Wave1 makes the case the visual base, so the beacon sits just below it. */
#bridge-watch-light { margin-top: 0.9rem; }

/* Wave0 pulls the beacon up under the case (-2.5rem). Once the case is hidden,
   its previous sibling is the collapsed hero, so reset the pull. */
body.dm-has-result #bridge-watch-light { margin-top: 0.6rem; }

/* --------------------------------------------------------------------------
   6. Mobile 390 — 兩籤同屏、引子入口、CTA 仍在首屏
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  main { padding-top: 8px !important; padding-left: 12px !important; padding-right: 12px !important; }

  main > #dm-hero { margin-bottom: 0.8rem; }

  #dm-hero .dm-hero__title { font-size: 2rem; letter-spacing: 0.14em; text-indent: 0.14em; }
  #dm-hero .dm-hero__en { font-size: 7.5px; letter-spacing: 0.24em; }
  #dm-hero .dm-hero__sub { font-size: 0.98rem; letter-spacing: 0.1em; }
  #dm-hero .dm-hero__lead { font-size: 11px; line-height: 1.65; margin-bottom: 0.5rem; }
  #dm-hero .dm-step { font-size: 8.5px; padding: 3px 7px; }
  #dm-hero .dm-hero__note { display: none; }

  #inputArea.dm-case {
    padding: 0.75rem 0.65rem 0.85rem !important;
    border-radius: 10px !important;
  }

  #inputArea .dm-case__title { font-size: 1.12rem; }
  #inputArea .dm-case__note { font-size: 9.5px; }
  #inputArea .dm-case__guide { font-size: 10.5px; margin-bottom: 0.45rem; }
  #inputArea .dm-case__guide-tag { font-size: 9px; }

  #inputArea .dm-anchor-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
  }

  #inputArea .dm-slip { padding: 0.4rem 0.45rem 0.4rem !important; }
  #inputArea .dm-slip__title { font-size: 8.5px; letter-spacing: 0.08em; }
  #inputArea .dm-canon-picked { font-size: 9.5px; }
  #inputArea .dm-canon-field span { font-size: 8px; }
  #inputArea .dm-canon-field select {
    min-height: 38px !important;
    font-size: 12px !important;
    padding: 0.2rem 1.4rem 0.2rem 0.4rem !important;
  }

  #inputArea #userQuestion { height: 4.3rem !important; min-height: 0 !important; font-size: 13px !important; }
  /* 移動：引子一行、說明收斂，令唯一 CTA 留在 coach bar 之上 */
  #inputArea .dm-case__note { display: none !important; }
  #inputArea .dm-case__guide-tag { display: none !important; }
  #inputArea .dm-ghost { gap: 0.3rem; padding: 0.2rem 0.3rem; }
  #inputArea .dm-ghost__scroll { flex-wrap: nowrap; overflow-x: auto; gap: 0.22rem; }
  #inputArea .dm-ghost__kicker { display: none !important; }
  #inputArea .dm-ghost__chip { flex: 0 0 auto; min-height: 28px !important; font-size: 9.5px; padding: 2px 6px; }
  #inputArea .dm-ghost__close { font-size: 9px; }
  #inputArea #action-btn.dm-primary { min-height: 48px; font-size: 13px !important; letter-spacing: 0.06em !important; }
  #inputArea .dm-case__status { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #inputArea #action-btn.dm-primary { transition: none; }
}

/* First-batch local clearance: keep canon selects and the seal block above the fixed coach bar. */
@media (max-width: 480px) {
  main {
    padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #inputArea,
  #oracleResult,
  #life-practice-box,
  .dm-reading,
  #dm-reading {
    scroll-margin-bottom: 168px;
  }
  #c-anchors-container select,
  #b-anchors-container select,
  #dm-sit-seal,
  #dm-sit-bridge {
    scroll-margin-top: 88px;
    scroll-margin-bottom: 176px;
  }
}

/* ==========================================================================
   7. Cascade guards
   Core (bliss-core injected CSS) forces:
     p  { font-size: clamp(.9rem, 2.2vw, 1.05rem) !important }
     h1 { font-size: clamp(1.35rem, 4.2vw, 2.5rem) !important }
     h2 { font-size: clamp(1.05rem, 2.8vw, 1.4rem) !important }
   These guards are the effective values for the Wave1 shell.
   ========================================================================== */
#dm-hero .dm-hero__title { font-size: clamp(2.1rem, 3.6vw, 3rem) !important; }
#dm-hero .dm-hero__sub { font-size: clamp(1rem, 1.5vw, 1.22rem) !important; }
#dm-hero .dm-hero__eyebrow { font-size: 9px !important; }
#dm-hero .dm-hero__en { font-size: 8.5px !important; }
#dm-hero .dm-hero__lead { font-size: 12px !important; line-height: 1.75 !important; }
#dm-hero .dm-hero__note { font-size: 9.5px !important; }

#inputArea .dm-case__title { font-size: 1.32rem !important; }
#inputArea .dm-case__kicker { font-size: 8.5px !important; }
#inputArea .dm-case__note { font-size: 10.5px !important; line-height: 1.6 !important; }
#inputArea .dm-case__guide { font-size: 11.5px !important; line-height: 1.65 !important; }
#inputArea .dm-case__slips-title { font-size: 0.92rem !important; }
#inputArea .dm-canon-picked { font-size: 10.5px !important; line-height: 1.4 !important; }
#inputArea .dm-case__status { font-size: 10.5px !important; line-height: 1.55 !important; }
#inputArea .dm-ghost__kicker { font-size: 8.5px !important; }

body.dm-has-result #dm-hero .dm-hero__title { font-size: 1.4rem !important; }
body.dm-has-result #dm-hero .dm-hero__sub { font-size: 0.78rem !important; }

@media (max-width: 640px) {
  #dm-hero .dm-hero__title { font-size: 2rem !important; }
  #dm-hero .dm-hero__en { font-size: 7.5px !important; }
  #dm-hero .dm-hero__sub { font-size: 0.98rem !important; }
  #dm-hero .dm-hero__lead { font-size: 11px !important; line-height: 1.65 !important; }
  #dm-hero .dm-step { font-size: 8.5px !important; }
  #inputArea .dm-case__title { font-size: 1.12rem !important; }
  #inputArea .dm-case__note { font-size: 9.5px !important; }
  #inputArea .dm-case__guide { font-size: 10.5px !important; }
  #inputArea .dm-case__guide-tag { font-size: 9px !important; }
  #inputArea .dm-slip__title { font-size: 8.5px !important; }
  #inputArea .dm-canon-picked { font-size: 9.5px !important; }
  #inputArea .dm-case__status { font-size: 10px !important; }
}

/* modes: one compact row on narrow screens (scrolls if needed) */
@media (max-width: 640px) {
  .dm-modes .dm-mode-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    justify-content: flex-start !important;
    padding-bottom: 2px;
  }

  .dm-modes .dm-mode-tab {
    flex: 0 0 auto !important;
    font-size: 9px !important;
    padding: 0.2rem 0.5rem !important;
  }
}

/* ==========================================================================
   8. Desktop: two slips side by side; each slip's two selects share one row
   (reads as a slip face and saves a row of height above the fold)
   ========================================================================== */
@media (min-width: 641px) {
  #c-anchors-container,
  #b-anchors-container {
    display: grid !important;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 0.28rem 0.45rem !important;
  }

  #inputArea .dm-canon-picked { grid-column: 1 / -1; }
  #inputArea .dm-canon-field { min-width: 0; }
}

