/* KitRecovery — placeholder styling.
 *
 * Brand aesthetic is an OPEN QUESTION in the skill (Airbnb-adjacent direction,
 * no visual design decided). Nothing here is a design proposal. It is neutral
 * scaffolding so the app is usable and legible while that decision is made.
 * Every colour is a variable, so restyling later is one block, not a rewrite.
 */

:root {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --border: #e2e2e6;
  --text: #16161a;
  --muted: #6a6a75;
  --accent: #1f4fd8;
  --accent-text: #ffffff;
  --warn-bg: #fff5e0;
  --warn-border: #e8c37a;
  --danger: #b3261e;
  --ok: #1a7f4b;
  --radius: 8px;
  --gap: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --surface: #1c1c21;
    --border: #2e2e36;
    --text: #f2f2f4;
    --muted: #a0a0ad;
    --accent: #6f95f5;
    --accent-text: #10101a;
    --warn-bg: #322614;
    --warn-border: #6d5526;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 900px; margin: 0 auto; padding: var(--gap); }

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
p.lede { color: var(--muted); margin: 0 0 24px; }

a { color: var(--accent); }

/* ---------------------------------------------------------------- chrome */

.chrome {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap); padding: 12px var(--gap);
  border-bottom: 1px solid var(--border);
}
.chrome__brand { font-weight: 600; text-decoration: none; color: var(--text); }
.chrome__right { display: flex; align-items: center; gap: 12px; }
.chrome__company { color: var(--muted); font-size: 0.9rem; }

.banner {
  padding: 12px var(--gap);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.banner--warn { background: var(--warn-bg); border-bottom-color: var(--warn-border); }

/* --------------------------------------------------------------- controls */

.btn {
  font: inherit; cursor: pointer; text-decoration: none;
  display: inline-block; text-align: center;
  padding: 9px 14px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--quiet { background: transparent; color: var(--text); border-color: var(--border); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Applied to every control, not only those inside .field — the chat box and
   the return-date picker live outside one. */
input, select, textarea {
  font: inherit; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
input[type="range"] { padding: 0; border: none; background: none; }
input[type="file"] { padding: 7px; }

.field { display: block; margin-bottom: var(--gap); }
.field > span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 84px; resize: vertical; }
.field--inline { display: flex; align-items: center; gap: 8px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: var(--gap); }

/* ----------------------------------------------------------------- cards */

.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: var(--gap); margin-bottom: 12px;
}

.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 32px var(--gap); text-align: center; color: var(--muted);
}

.kit-list { list-style: none; margin: 0; padding: 0; }
.kit-item {
  display: flex; gap: 12px; align-items: baseline; justify-content: space-between;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 8px; text-decoration: none; color: inherit;
}
.kit-item__main { min-width: 0; }
/* The card stacks title / counterparty / reference, so each part is its own line. */
.kit-item__main > span { display: block; }
.kit-item__side {
  flex: 0 0 auto; display: flex; flex-direction: column;
  align-items: flex-end; gap: 6px; text-align: right;
}
.kit-item__title { font-weight: 600; }
.kit-item__meta { color: var(--muted); font-size: 0.85rem; }
.kit-item__ref { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 0.78rem; white-space: nowrap;
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
}
.pill--done { border-color: var(--ok); color: var(--ok); }
.pill--stale { border-color: var(--warn-border); }

/* --------------------------------------------------------- status trail */

.trail { list-style: none; margin: 0 0 var(--gap); padding: 0;
         display: flex; flex-wrap: wrap; gap: 6px; }
.trail li {
  font-size: 0.78rem; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.trail li[data-state="done"] { border-color: var(--ok); color: var(--ok); }
.trail li[data-state="current"] {
  border-color: var(--accent); color: var(--accent-text); background: var(--accent);
}

/* ----------------------------------------------------------- definitions */

.defs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.defs dt { color: var(--muted); font-size: 0.85rem; }
.defs dd { margin: 0; }

.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.photos img {
  width: 120px; height: 120px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
}

/* ------------------------------------------------------------- liability */

.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; }
.slider-value { font-variant-numeric: tabular-nums; min-width: 18ch; text-align: right; }

.proposals { display: flex; gap: var(--gap); margin: 12px 0; flex-wrap: wrap; }
.proposal { flex: 1 1 140px; }
.proposal span { display: block; font-size: 0.85rem; color: var(--muted); }
.proposal strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ chat */

.thread {
  max-height: 380px; overflow-y: auto; display: flex; flex-direction: column;
  gap: 8px; padding: 4px; margin-bottom: 12px;
}
.msg { padding: 8px 12px; border-radius: var(--radius); background: var(--bg);
       border: 1px solid var(--border); max-width: 78%; }
.msg--mine { align-self: flex-end; background: var(--accent); color: var(--accent-text);
             border-color: var(--accent); }
.msg__meta { font-size: 0.75rem; opacity: 0.75; margin-bottom: 2px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  padding: 10px 16px; border-radius: var(--radius); max-width: 90vw;
  background: var(--danger); color: #fff; box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
}
.toast--ok { background: var(--ok); }

.muted { color: var(--muted); }
.stack > * + * { margin-top: 12px; }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .defs { grid-template-columns: 1fr; }
  .defs dd { margin-bottom: 8px; }
}
