/* Concept 19: the phone dock (below 768px only). */

.dkb, .dkb-sheet { display: none; }

@media (max-width: 767px) {
  html.dkb-on { --dkb-h: calc(62px + env(safe-area-inset-bottom, 0px)); }
  html.dkb-on body { padding-bottom: var(--dkb-h); }

  /* The dock replaces the floating pill and the site's shortlist bar. */
  html.dkb-on .bf-launcher,
  html.dkb-on .fixed.bottom-4.inset-x-4 { display: none !important; }
  html.dkb-on .lg-request { bottom: calc(var(--dkb-h) + 10px); }

  .dkb {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: var(--dkb-h); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: hsl(222 47% 8%); color: hsl(40 20% 96% / 0.62);
    border-top: 1px solid hsl(40 20% 96% / 0.08);
    transition: transform 0.25s ease;
  }
  html.bf-lock .dkb, html.sx-lock .dkb, html.cp-open .dkb, html.eq-open .dkb, html.dkb-typing .dkb { transform: translateY(110%); }
  html.dkb-typing body { padding-bottom: 0; }

  .dkb > a, .dkb > button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    padding: 0; font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
    color: inherit; background: none; border: 0; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .dkb svg { width: 22px; height: 22px; }
  .dkb .is-on { color: #fff; }
  .dkb .is-on::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 24px; height: 1px; margin-left: -12px; background: var(--mf-brass, #a88f5c);
  }
  .dkb :focus-visible { outline: 1px solid #fff; outline-offset: -6px; }
  .dk-n {
    position: absolute; top: 8px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    font-style: normal; font-size: 10px; line-height: 17px; letter-spacing: 0; text-align: center;
    color: hsl(222 47% 8%); background: var(--mf-brass, #a88f5c);
  }
  .dk-n[hidden] { display: none; }

  /* Sheets rise from behind the dock, which stays visible so a second tap closes them. */
  .dkb-sheet { display: block; position: fixed; inset: 0 0 var(--dkb-h); z-index: 69; }
  .dkb-sheet[hidden] { display: none; }
  .dkb-scrim { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: hsl(222 47% 8% / 0.45); animation: dkb-fade 0.2s ease; }
  .dkb-panel {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 78%; overflow-y: auto; overscroll-behavior: contain;
    padding: 10px 20px 22px; background: hsl(var(--background)); color: hsl(var(--foreground));
    box-shadow: 0 -18px 40px -16px hsl(222 47% 8% / 0.35); animation: dkb-up 0.24s ease-out;
  }
  @keyframes dkb-up { from { transform: translateY(24px); opacity: 0; } }
  @keyframes dkb-fade { from { opacity: 0; } }
  .dkb-grip { display: block; width: 36px; height: 3px; margin: 0 auto 14px; border-radius: 2px; background: hsl(var(--border)); }

  .dkb-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid hsl(var(--foreground)); }
  .dkb-head h2 { margin: 0; font-family: var(--mf-serif, serif); font-weight: 500; font-size: 26px; line-height: 1.1; }
  .dkb-head span { font-size: 12px; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }

  .dkb-list, .dkb-lines { list-style: none; margin: 0; padding: 0; }
  .dkb-list li { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; border-bottom: 1px solid hsl(var(--border)); }
  .dkb-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ref side" "type side";
    column-gap: 12px; row-gap: 2px; align-items: center; padding: 12px 0; color: inherit; text-decoration: none;
  }
  .dkb-ref { grid-area: ref; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mf-brass, #a88f5c); }
  .dkb-type { grid-area: type; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dkb-side { grid-area: side; display: flex; flex-direction: column; align-items: flex-end; font-size: 13.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .dkb-side s { font-size: 11px; font-weight: 400; color: hsl(var(--muted-foreground)); }
  .dkb-flag { font-size: 11px; font-weight: 400; color: hsl(var(--muted-foreground)); }
  .is-gone .dkb-type { color: hsl(var(--muted-foreground)); text-decoration: line-through; }
  .dkb-x { height: 40px; padding: 0; font-size: 20px; line-height: 1; color: hsl(var(--muted-foreground)); background: none; border: 0; cursor: pointer; }

  .dkb-lines li { border-bottom: 1px solid hsl(var(--border)); }
  .dkb-lines a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 0; color: inherit; text-decoration: none; }
  .dkb-lines b { font-weight: 400; font-size: 15px; }
  .dkb-lines span { font-size: 13.5px; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; text-align: right; }

  .dkb-empty { margin: 16px 0 0; font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
  .dkb-btn {
    display: flex; justify-content: center; gap: 8px; margin-top: 18px; padding: 14px 18px; font-size: 14px; letter-spacing: 0.03em;
    color: hsl(var(--background)); background: hsl(var(--foreground)); text-decoration: none;
  }
  .dkb-alt {
    display: flex; justify-content: center; width: 100%; margin-top: 8px; padding: 13px 18px; font: inherit; font-size: 14px;
    color: hsl(var(--foreground)); background: none; border: 1px solid hsl(var(--border)); text-decoration: none; cursor: pointer;
  }
  .dkb-panel a:focus-visible, .dkb-panel button:focus-visible { outline: 1px solid hsl(var(--foreground)); outline-offset: 2px; }
}

@media print { .dkb, .dkb-sheet { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .dkb, .dkb-panel, .dkb-scrim { animation: none; transition: none; } }
