/* The settings sheet: a panel that slides in from the right, or a sheet that
   rises from the bottom on a phone. */
.sheet {
  position: fixed; inset: 0 0 0 auto; z-index: 40; margin: 0; padding: 0;
  width: 440px; max-width: 100vw; height: 100dvh; max-height: none;
  background: var(--surface); color: var(--fg); border: 0; border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet.open { transform: none; }
.sheet::backdrop { background: rgba(0, 0, 0, 0); transition: background 220ms; }
.sheet.open::backdrop { background: rgba(0, 0, 0, .5); }
@media (max-width: 759.98px) {
  .sheet { inset: auto 0 0 0; width: 100%; height: 92dvh; border-left: 0; border-radius: 20px 20px 0 0; transform: translateY(100%); transition-duration: 240ms; }
}
.reduced .sheet, .reduced .sheet.open { transform: none; opacity: 0; transition: opacity 120ms; }
.reduced .sheet.open { opacity: 1; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 17px; line-height: 24px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); scrollbar-width: thin; }

.group { padding: 20px 0 8px; border-bottom: 1px solid var(--line); }
.group:last-child { border-bottom: 0; }
.group h3 { margin: 0 0 12px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.group h4 { margin: 12px 0 4px; font-size: 13px; }
.note, .help { margin: 4px 0 12px; font-size: 12px; line-height: 16px; color: var(--muted); }
.help { margin: 0; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-label { font-size: 13px; line-height: 18px; font-weight: 600; }
.counter { font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; color: var(--muted); }
.counter.over { color: var(--danger); }
.sheet input[type="text"], .sheet input[type="number"], .sheet textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  font-size: 16px; line-height: 22px;
}
.sheet textarea { resize: vertical; }
.sheet textarea.mono { padding: 10px 12px; font: 12px/18px var(--mono); }

.problem { margin: -4px 0 12px; font-size: 12px; line-height: 16px; color: var(--danger); }
.status { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.status[data-found="true"] { color: var(--ok); }
.status[data-found="false"] { color: var(--danger); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; margin-bottom: 8px; }
.switch-text { display: flex; flex-direction: column; font-size: 13px; line-height: 18px; }
.switch { appearance: none; position: relative; flex: none; width: 48px; height: 28px; margin: 0; background: #2b3a46; border-radius: 14px; transition: background 120ms; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 120ms; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .6; }


.row-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.confirm { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-left: 2px solid var(--danger); border-radius: 8px; }
.confirm p { margin: 0 0 8px; font-size: 13px; }

.model-picker { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.model-picker label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.model-picker select { max-width: 190px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: inherit; font: inherit; }
