/* ---------- AI in the dock (section 26e) ----------
   Make and Ask are dock buttons like the rest: a glyph and a word (the glyph alone on a phone), set off from the view
   buttons by a hairline. No colour of their own: the depth colour stays Z's. */
.aibtn { display: flex; align-items: center; gap: 6px; }
.aibtn svg { flex: none; width: 14px; height: 14px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.45px; stroke-linecap: round; stroke-linejoin: round; }
#aiMake { position: relative; margin-left: 7px; }
#aiMake::before { content: ""; position: absolute; left: -5px; top: 7px; bottom: 7px; width: 1px; background: var(--rule-2); pointer-events: none; }
body.dv #aiMake { opacity: .38; pointer-events: none; }      /* the box makes things on a flat canvas */
@media (max-width: 480px) {
  .aibtn { padding: 0 7px; }
  .aibtn .l-w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #aiMake { margin-left: 5px; }
  #aiMake::before { left: -4px; }
}

/* The beta card: the menu's surface under the button, a small tracked label, a line in the book serif, then what it
   is and the one thing to do. */
#aibeta {
  position: fixed; left: 0; top: 0; z-index: 31; width: 300px; max-width: calc(100vw - 16px); padding: 14px 14px 12px 16px; box-sizing: border-box;
  border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule), var(--pop);
}
#aibeta p { margin: 0; }
.ib-k { display: flex; align-items: center; gap: 7px; font: 500 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-q); }
.ib-k svg { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--ink-2); stroke-width: 1.3px; stroke-linecap: round; stroke-linejoin: round; }
.ib-t { margin-top: 10px !important; font: 500 19px/1.2 var(--f-display); letter-spacing: -.012em; color: var(--ink); text-wrap: balance; font-optical-sizing: auto; }
.ib-s { margin-top: 6px !important; font: 400 13px/19px var(--f-ui); color: var(--ink-2); text-wrap: pretty; }
.ib-e { margin-top: 8px !important; font: 500 12px/16px var(--f-ui); color: var(--ink); }
.ib-row { display: flex; justify-content: flex-end; gap: 4px; margin-top: 14px; }
.ib-row .btn { height: 30px; }
.ib-go { color: var(--surface); background: var(--ink); }
@media (hover: hover) { .ib-go:hover { color: var(--surface); background: color-mix(in srgb, var(--ink) 84%, var(--surface)); } }
.ib-go:active { box-shadow: none; background: color-mix(in srgb, var(--ink) 76%, var(--surface)); }
.ib-go:disabled { cursor: default; color: var(--ink-2); background: var(--press-bg); box-shadow: var(--press); }
#aibeta[data-s="list"] .ib-go:disabled { animation: ai-pulse 1.6s ease-in-out infinite; }     /* Requesting… */
/* An invite code: a quiet link under the text opens a field in its place, with Turn on as the one in ink (Request
   access steps back to a plain button meanwhile). The code is set in the mono face and in capitals, as codes are
   (the server reads it in any case). */
.ib-have {
  display: block; width: max-content; max-width: 100%; margin: 6px 0 0 -2px; height: 26px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font: 500 12px/26px var(--f-ui); color: var(--ink-2); text-decoration: underline 1px; text-decoration-color: var(--rule-2); text-underline-offset: 3px;
}
@media (hover: hover) { .ib-have:hover { color: var(--ink); text-decoration-color: currentColor; } }
.ib-have:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
.ib-inv { display: flex; gap: 6px; margin-top: 12px; }
.ib-code {
  flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 0; border-radius: 5px; outline: none; background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule-2); font: 500 12px/30px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
  transition: box-shadow 120ms ease-out;
}
.ib-code::placeholder { color: var(--ink-3); }
.ib-code:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }
.ib-code:read-only { color: var(--ink-2); }
.ib-use { height: 30px; color: var(--surface); background: var(--ink); }
@media (hover: hover) { .ib-use:hover { color: var(--surface); background: color-mix(in srgb, var(--ink) 84%, var(--surface)); } }
.ib-use:active { box-shadow: none; background: color-mix(in srgb, var(--ink) 76%, var(--surface)); }
.ib-use:disabled { cursor: default; color: var(--ink-2); background: var(--press-bg); box-shadow: var(--press); animation: ai-pulse 1.6s ease-in-out infinite; }   /* Checking… */
#aibeta[data-inv] .ib-go:not(:disabled) { color: var(--ink); background: transparent; }
@media (pointer: coarse) { .ib-row .btn, .ib-have, .ib-code, .ib-use { height: 36px; } .ib-have, .ib-code { line-height: 36px; } }
@media (prefers-reduced-motion: reduce) { #aibeta .ib-go, #aibeta .ib-use { animation: none !important; } }
