/* components.css
   Reusable UI atoms: pill, card, button, chip, tag, figure, flash.
   Every view composes these; none of them knows which view it is in.
   ------------------------------------------------------------------------- */

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-m); cursor: pointer; color: var(--ink-2);
  transition: all .16s var(--ease);
}

.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

.icon-btn svg { width: 16px; height: 16px; }

.dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--lane-c); color: var(--on-brand);
  font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
  font-family: var(--mono); letter-spacing: -.04em;
}

.dot.ghost { background: transparent; border: 1px dashed var(--lane-c); color: var(--lane-c); }

.field {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 9px 11px; font-size: 14px; font-family: inherit;
  transition: border-color .16s var(--ease);
}

.field:hover { border-color: var(--line-2); }

.field::placeholder { color: var(--ink-3); }

select.field {
  appearance: none; cursor: pointer; padding-right: 30px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 11px center; background-size: 11px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  cursor: pointer; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); transition: all .16s var(--ease); display: inline-flex; align-items: center; gap: 6px;
}

.chip:hover { border-color: var(--line-2); color: var(--ink); }

.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.chip .swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--sw, var(--line-2)); }

.chip[aria-pressed="true"] .swatch { background: currentColor; }

.chip .n { opacity: .65; font-variant-numeric: tabular-nums; }

.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font-size: 13px; font-weight: 650;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}

.linkbtn:hover { color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 18px; }

.card {
  position: relative; display: flex; flex-direction: column; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); cursor: pointer; overflow: hidden; padding: 0;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}

.card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--m-c, var(--c-red)); transition: width .22s var(--ease); z-index: 3;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }

.card:hover::before { width: 3px; }

.card-shot {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--bg-3); border-bottom: 1px solid var(--line);
}

.card-shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: top left;
  transition: transform .5s var(--ease);
}

.card:hover .card-shot img { transform: scale(1.035); }

.card-no {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  font-family: var(--mono); font-size: 10.5px; font-weight: 800; letter-spacing: 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(6px); color: var(--ink);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px;
}

.card-feat {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  font-size: 10.5px; font-weight: 750; letter-spacing: .02em;
  background: var(--c-red); color: var(--on-brand); border-radius: 5px; padding: 4px 8px;
  display: inline-flex; align-items: center; gap: 5px;
}

.card-feat svg { width: 11px; height: 11px; }

.card-b { padding: 16px 17px 17px; display: flex; flex-direction: column; flex: 1; }

.card-mod {
  font-size: 10.5px; font-weight: 750; letter-spacing: .075em; text-transform: uppercase;
  color: var(--m-c, var(--ink-3)); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

.card-mod::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }

.card h3 { font-size: 16.5px; margin-bottom: 8px; letter-spacing: -.018em; }

.card-tag { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; flex: 1; }

.card-ft {
  margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.card-go {
  margin-left: auto; font-size: 12.5px; font-weight: 650; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 5px; transition: color .18s var(--ease), gap .18s var(--ease);
}

.card:hover .card-go { color: var(--accent); gap: 8px; }

.card-go svg { width: 13px; height: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; border-radius: 999px;
  padding: 3px 9px; border: 1px solid transparent; white-space: nowrap;
}

.pill.ok { background: var(--ok-soft);   color: var(--ok); }

.pill.warn { background: var(--warn-soft); color: var(--warn); }

.pill.idle { background: var(--idle-soft); color: var(--ink-3); }

.pill.env { background: var(--bg-3); color: var(--ink-2); border-color: var(--line); }

.pill.adapt { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-2); }

.pill .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.empty {
  text-align: center; padding: 76px 24px; border: 1px dashed var(--line-2);
  border-radius: var(--r-l); color: var(--ink-3);
}

.empty b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 7px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: 11px 20px; border-radius: var(--r-m); font-size: 14.5px; font-weight: 700;
  text-decoration: none; transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); filter: brightness(1.06); }

.btn svg { width: 15px; height: 15px; }

.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }

.btn.ghost:hover { border-color: var(--ink-3); }

.kband {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-l); overflow: hidden; margin-top: 4px;
}

.kband div { background: var(--surface); padding: 18px 19px; }

.kband b {
  display: block; font-size: clamp(22px, 2.6vw, 29px); font-weight: 800;
  letter-spacing: -.032em; line-height: 1.05; margin-bottom: 7px;
  color: var(--m-c, var(--c-red)); font-variant-numeric: tabular-nums;
}

.kband span { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; display: block; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }

.panel > h3 {
  font-size: 11.5px; font-weight: 750; letter-spacing: .085em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px 17px; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.kv { display: grid; }

.kv > div { padding: 11px 17px; border-bottom: 1px solid var(--line); }

.kv > div:last-child { border-bottom: 0; }

.kv dt { font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }

.kv dd { margin: 0; font-size: 14px; color: var(--ink); }

.kv dd a { color: var(--accent); word-break: break-all; text-decoration: none; }

.kv dd a:hover { text-decoration: underline; text-underline-offset: 3px; }

.taglist { display: flex; flex-wrap: wrap; gap: 5px; padding: 13px 17px; }

.taglist span {
  font-family: var(--mono); font-size: 11px; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; color: var(--ink-2);
}

.panel-p { padding: 14px 17px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }

.note-card {
  border: 1px solid var(--line); border-left: 3px solid var(--c-gold);
  border-radius: var(--r-m); padding: 17px 19px; background: var(--surface); margin-top: 30px;
}

.note-card h3 { font-size: 14px; margin-bottom: 8px; letter-spacing: -.012em; }

.note-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin: 0; }

.cards > .card { animation: rise .44s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .card-shot img, .card:hover .card-shot img { transition: none; transform: none; }
  .btn:hover, .rel-card:hover { transform: none; }
}

@media (max-width: 660px) {
  .cards { grid-template-columns: minmax(0,1fr); }
  .btn { width: 100%; justify-content: center; }
  .kband { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 420px) {
  .icon-btn { width: 30px; height: 30px; }
  .icon-btn svg { width: 15px; height: 15px; }
}

@media print {
  .card, .panel, .p2-card { break-inside: avoid; }
}

.pill.env, .pill.plan {
  white-space: normal; text-align: left; align-items: flex-start;
  max-width: 100%; line-height: 1.4; padding-top: 4px; padding-bottom: 4px;
}

.pill.env .swatch { margin-top: 5px; }

.shot-ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--m-c, var(--c-red)) 9%, var(--bg-2)) 0%,
                            var(--bg-2) 60%);
}

.shot-ph span {
  font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: -.04em;
  color: color-mix(in srgb, var(--m-c, var(--c-red)) 42%, transparent);
}

.card-p2 {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  font-size: 10.5px; font-weight: 750; letter-spacing: .02em;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px);
  color: var(--ink-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px;
}

.pill.plan {
  background: transparent; color: var(--ink-2);
  border: 1px dashed var(--line-2);
}

.pill .swatch { width: 7px; height: 7px; border-radius: 2px; background: var(--sw, var(--line-2)); }

.icon-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }

.btn.sm svg { width: 13px; height: 13px; }

.icon-btn.sm { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }

.icon-btn.sm:disabled { opacity: .35; cursor: not-allowed; }

.icon-btn.sm.danger:hover { color: var(--c-red); border-color: var(--c-red); }

.flash {
  display: flex; align-items: center; gap: 9px; margin-top: 24px;
  background: var(--ok-soft); color: var(--ok); border-radius: var(--r-m);
  padding: 11px 15px; font-size: 13.5px; font-weight: 650;
}

.flash svg { width: 16px; height: 16px; }

textarea.field { resize: vertical; min-height: 42px; line-height: 1.55; font-family: inherit; }

.pill.p-high { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 24%, transparent); }

.pill.p-med { background: var(--warn-soft);   color: var(--warn); }

.pill.p-low { background: var(--idle-soft);   color: var(--ink-3); }

.inline-ok {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 650; color: var(--ok);
  background: var(--ok-soft); border-radius: var(--r-s); padding: 7px 12px;
}

.inline-ok svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------- v1.1 ---
   Added with the AI-agent badge and the wide aside button. Tones stay in the
   pill family so they inherit the same shape, size and dark-mode behaviour. */
.pill.ai {
  background: color-mix(in srgb, var(--c-teal) 14%, transparent);
  color: var(--c-teal);
  border-color: color-mix(in srgb, var(--c-teal) 30%, transparent);
}
.pill.ai svg { width: 13px; height: 13px; margin-right: 1px; }

.btn.wide { width: 100%; justify-content: center; font-size: 13.5px; }
