/* "Choose your printers": the setup screen and the small printer line on the main page.
   Self-contained: every class starts with cp- and the colours fall back to the app's own
   (ui/app.css) when the page it sits in does not define them. */

.cp-sheet, .cp-menu {
  --cp-bg: var(--bg, #12140f);
  --cp-panel: var(--panel, #1b1e16);
  --cp-panel-2: var(--panel-2, #23271c);
  --cp-line: var(--line, #33382a);
  --cp-text: var(--text, #ecebe1);
  --cp-muted: var(--muted, #a0a391);
  --cp-accent: var(--accent, #ff7a1a);
  --cp-accent-ink: var(--accent-ink, #1a0d00);
  --cp-olive: var(--olive, #7d9658);
  --cp-warn: var(--warn, #e7b84a);
}

/* ── the screen ── */
.cp-sheet {
  position: fixed; inset: 0; z-index: 25; background: rgba(8, 9, 6, .78); display: grid; place-items: center; padding: 24px;
  color: var(--cp-text); color-scheme: dark;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.cp-sheet[hidden] { display: none; }
.cp-sheet *, .cp-menu * { box-sizing: border-box; }
.cp-box {
  width: min(1180px, 100%); height: min(860px, 100%); background: var(--cp-panel); border: 1px solid var(--cp-line);
  border-radius: 18px; display: flex; flex-direction: column; overflow: hidden;
}
.cp-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--cp-line); flex-wrap: wrap; }
.cp-head h2 { font-size: 18px; margin: 0 auto 0 0; }
.cp-search {
  flex: 1 1 220px; max-width: 360px; background: var(--cp-panel-2); border: 1px solid var(--cp-line); border-radius: 10px;
  padding: 9px 12px; font: inherit; color: inherit;
}
.cp-sheet button { font: inherit; color: inherit; cursor: pointer; }
.cp-primary { background: var(--cp-accent); color: var(--cp-accent-ink) !important; border: 0; border-radius: 10px; padding: 9px 18px; font-weight: 700; }
.cp-primary:hover { filter: brightness(1.08); }
.cp-ghost { background: transparent; border: 1px solid var(--cp-line); border-radius: 10px; padding: 8px 14px; }
.cp-ghost:hover { background: var(--cp-panel-2); }
.cp-ghost:disabled { opacity: .45; cursor: default; }
.cp-sheet :focus-visible, .cp-menu :focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 2px; }

.cp-intro { padding: 12px 18px 0; color: var(--cp-muted); margin: 0; }
.cp-tabs { display: flex; gap: 8px; padding: 12px 18px; flex-wrap: wrap; border-bottom: 1px solid var(--cp-line); }
.cp-tab { background: var(--cp-panel-2); border: 1px solid var(--cp-line); border-radius: 99px; padding: 5px 13px; font-size: 14px; }
.cp-tab.cp-on { background: var(--cp-olive); color: #10140a !important; border-color: var(--cp-olive); font-weight: 700; }
.cp-tab i { font-style: normal; margin-left: 6px; background: var(--cp-accent); color: var(--cp-accent-ink); border-radius: 99px; padding: 0 7px; font-size: 12px; font-weight: 700; }

.cp-body { flex: 1; overflow-y: auto; padding: 4px 18px 22px; }
.cp-untried { margin: 14px 0 0; padding: 9px 12px; border: 1px solid #7a6223; border-radius: 10px; color: #f2d589; font-size: 14px; }
.cp-must { margin: 10px 0 0; padding: 9px 12px; border: 1px solid var(--cp-olive); border-radius: 10px; font-size: 14px; }
.cp-must b { color: var(--cp-text); }
.cp-brand { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--cp-muted); margin: 18px 0 10px; font-weight: 700; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 12px; }
.cp-card {
  background: var(--cp-panel-2); border: 1px solid var(--cp-line); border-radius: 12px; padding: 12px; display: grid;
  grid-template-columns: 46px minmax(0, 1fr); gap: 4px 12px; align-content: start;
}
.cp-card.cp-on { border-color: var(--cp-accent); box-shadow: 0 0 0 1px var(--cp-accent); }
.cp-card svg { width: 46px; height: 46px; color: var(--cp-olive); grid-row: span 3; }
.cp-card.cp-on svg { color: var(--cp-accent); }
.cp-card b { font-size: 15px; line-height: 1.25; }
.cp-card span { font-size: 13px; color: var(--cp-muted); }
.cp-card em { font-style: normal; font-size: 12px; color: #f2d589; }
.cp-nozzles { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; align-items: center; font-size: 13px; color: var(--cp-muted); }
.cp-nozzles > span { flex: 0 0 100%; font-size: 12px; }
.cp-nozzle {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--cp-line); border-radius: 8px; padding: 3px 8px 3px 6px;
  cursor: pointer; color: var(--cp-text); background: var(--cp-panel);
}
.cp-nozzle:hover { border-color: var(--cp-olive); }
.cp-nozzle input { width: 16px; height: 16px; margin: 0; accent-color: var(--cp-accent); cursor: pointer; }
.cp-nozzle.cp-on { border-color: var(--cp-accent); }
.cp-more { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--cp-line); }
.cp-more label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.cp-more input { width: 17px; height: 17px; margin: 0; accent-color: var(--cp-accent); cursor: pointer; }
.cp-more p { margin: 6px 0 0; font-size: 13px; color: var(--cp-muted); }
.cp-makers { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--cp-muted); }
.cp-makers span { margin-right: 4px; }
.cp-makers button { background: var(--cp-panel-2); border: 1px solid var(--cp-line); border-radius: 8px; padding: 2px 9px; font-size: 13px; }
.cp-makers button:hover { border-color: var(--cp-olive); }
.cp-source { margin: 18px 0 0; font-size: 13px; color: var(--cp-muted); }
.cp-credit { margin: 10px 0 0; font-size: 12px; color: var(--cp-muted); }
.cp-credit a { color: var(--cp-muted); text-decoration: underline; }
.cp-empty { padding: 34px 0; text-align: center; color: var(--cp-muted); }
.cp-empty button { margin: 4px; }

.cp-foot { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--cp-line); flex-wrap: wrap; }
.cp-count { margin-right: auto; min-width: 0; }
.cp-count small { display: block; color: var(--cp-muted); font-size: 13px; }
.cp-link { background: none; border: 0; padding: 0; color: var(--cp-olive) !important; text-decoration: underline; font-size: 14px; }

@media (max-width: 640px) {
  .cp-sheet { padding: 0; }
  .cp-box { border-radius: 0; height: 100%; border: 0; }
}

/* ── the line on the main page: which printer the file is for ── */
.cp-menu { display: grid; gap: 6px; }
.cp-menu-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-menu select { font: inherit; max-width: 100%; min-width: 0; }
.cp-menu-note { font-size: 13px; opacity: .75; margin: 0; }
.cp-menu-change { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; color: var(--cp-olive); }
