/* The grown-ups' sheets (P10): the gate's lines, the grown-ups sheet (dialog#grownups: account, toys, toy care, the
   little book), the link question and printing the family key. The sheet base (.sheet, .btn, #gate-input) is
   version.css's; colours and sizes come from the core tokens. Grown-up text: 60 px targets stay, type a little
   smaller than the child's screens. */

/* ---- the gate ---- */
#gate .gate-why { color: var(--muted); font-size: var(--muted-size); }
#gate .gate-msg { min-height: 1.3em; color: var(--coral-deep); font-weight: 700; }
#gate.locked #gate-input { opacity: .5; }
#gate-input.ok { border-color: var(--green); }
#gate-input.nope { animation: gu-nope .32s ease-in-out; }
@keyframes gu-nope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---- the grown-ups sheet ---- */
.sheet.gu-sheet { width: min(560px, calc(100vw - 20px)); padding: 0; overflow: auto; overscroll-behavior: contain; }
#gu-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
.gu-head { position: sticky; top: -18px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -18px -18px 0; padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--hair); }
.gu-head h2 { margin: 0; }
.gu-head .ico { width: 26px; height: 26px; color: var(--muted); }
.round.gu-close { position: static; width: 48px; height: 48px; }
.round.gu-close .ico { width: 22px; height: 22px; }
.gu-status { color: var(--muted); font-size: var(--muted-size); }
.gu-notice { padding: 12px 14px; border-radius: 16px; background: var(--coral-field); color: var(--ink); font-weight: 700; }

.gu-section { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--hair); border-radius: 22px; background: var(--paper); }
.gu-section h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 1.12rem; font-weight: 800; }
.gu-section h3 .ico { width: 24px; height: 24px; color: var(--coral-deep); }
.gu-section h4 { margin: 6px 0 0; font-size: var(--label); font-weight: 800; color: var(--muted); }
.gu-panel { border: 2px solid var(--sand-deep); background: var(--card); }
.gu-note { color: var(--ink); font-size: var(--muted-size); font-weight: 600; line-height: 1.35; }
.gu-small { color: var(--muted); font-size: .95rem; }
.gu-warn { color: var(--coral-deep); font-weight: 700; }
.gu-ask { font-size: 1.08rem; font-weight: 800; }
.gu-msg { min-height: 1.2em; font-size: var(--muted-size); font-weight: 700; color: var(--green); }
.gu-msg[data-kind="error"] { color: var(--coral-deep); }
.gu-msg:empty { display: none; }

.gu-stack { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.gu-sub { padding: 12px; border-radius: 18px; background: var(--card); }
.gu-section .btn { width: 100%; justify-content: flex-start; padding: 0 18px; font-size: var(--label); }
.gu-section .row .btn { width: auto; flex: 1 1 auto; justify-content: center; }
.btn.quiet { background: transparent; box-shadow: none; }
.btn.danger { color: var(--coral-deep); border-color: var(--coral-deep); }
.btn.danger.primary, .btn.danger:not(.quiet) { background: var(--card); }
.btn .ico { width: 24px; height: 24px; }

/* lists: devices, passkeys, joined devices, toys */
.gu-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.gu-list > li { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 8px 10px; border-radius: 16px; background: var(--card); }
.gu-list > li > .ico { width: 24px; height: 24px; color: var(--muted); }
.gu-list > li .btn { width: auto; min-height: 48px; padding: 0 14px; }
.gu-list > li[data-current="1"] { outline: 2px solid var(--mint); }
.gu-list > li[data-suspect="1"] { outline: 2px solid var(--coral); }
.gu-grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gu-strong { font-weight: 800; overflow-wrap: anywhere; }
.gu-sub-line { color: var(--muted); font-size: .95rem; font-weight: 600; }
.gu-chip { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--butter); color: var(--ink); }
.gu-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.gu-toys > li { flex-wrap: wrap; }
.gu-toys .gu-actions { flex: 1 1 100%; }
.gu-toys .gu-actions .btn { flex: 1 1 auto; justify-content: center; }
.gu-thumb { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 14px; background: var(--sand); }
.gu-bullets { margin: 4px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }

/* typed answers (only here and in the gate: the child types nothing) */
.gu-enter { display: flex; flex-direction: column; gap: 8px; }
.gu-enter label { font-size: var(--muted-size); font-weight: 700; color: var(--muted); }
.gu-enter input, .gu-field select {
  min-height: var(--tap); padding: 0 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--paper);
  font: 800 1.15rem/1 var(--font); color: var(--ink);
}
#gu-code-input, #gu-key-input { text-transform: uppercase; letter-spacing: .08em; }

/* the code, its QR and the family key */
.gu-code { font: 800 2.2rem/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-align: center; }
.gu-qr-wrap { display: grid; place-items: center; }
.gu-qr-wrap svg.qr { width: min(240px, 62vw); height: auto; aspect-ratio: 1; border-radius: 12px; }
.gu-key-text { padding: 14px; border-radius: 16px; background: var(--paper); border: 2px dashed var(--line);
  font: 800 1.4rem/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; text-align: center; overflow-wrap: anywhere; user-select: all; }

/* toy care: switches and choices */
.gu-switches > li { padding: 0; }
.gu-switch label { flex: 1; display: flex; align-items: center; gap: 14px; min-height: var(--tap); padding: 8px 12px; cursor: pointer; }
.gu-switch-text { display: flex; flex-direction: column; gap: 2px; }
.gu-switch input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; margin: 0; border-radius: 999px;
  background: var(--sand-deep); position: relative; transition: background var(--t-micro);
}
.gu-switch input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow); transition: transform var(--t-micro) var(--spring);
}
.gu-switch input[type="checkbox"]:checked { background: var(--green); }
.gu-switch input[type="checkbox"]:checked::after { transform: translateX(20px); }
.gu-switch input[type="checkbox"]:focus-visible { outline: 4px solid var(--cobalt); outline-offset: 2px; }
.gu-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.gu-field label { display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
.gu-field select { min-width: 9.5rem; font-size: 1rem; }

/* the little book */
.gu-book-toy { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 16px; background: var(--card); }

/* the link question */
#link-ask #link-signed-in { color: var(--ink); font-weight: 700; }
#link-ask .gu-msg { color: var(--coral-deep); }

@media (prefers-reduced-motion: reduce) {
  #gate-input.nope { animation: none; }
  .gu-switch input[type="checkbox"], .gu-switch input[type="checkbox"]::after { transition: none; }
}

/* Printing the family key: only the key panel goes on paper. */
@media print {
  body > *:not(dialog) { display: none !important; }
  dialog:not(#grownups) { display: none !important; }
  dialog#grownups { position: static; max-height: none; box-shadow: none; overflow: visible; }
  dialog#grownups::backdrop { display: none; }
  #gu-body > *:not(#gu-key) { display: none !important; }
  #gu-key .row { display: none !important; }
}
