/*
 * JLR toolkit theme.
 * Copied from the Royalty Dashboard (maximini22/royalty-dashboard src/base.css + src/app.css
 * and jeremylegalrecords.com/royalty-dashboard/landing.css) so this tool looks like part of
 * the same toolkit. Keep variable names in sync with those files.
 */
:root {
  --bg: #0b1220;
  --bg-deep: #070c16;
  --bg2: #111827;
  --card: #151d2e;
  --card2: #1a2233;
  --line: #2a3548;
  --text: #f3f6fb;
  --muted: #9aa6b8;
  --dim: #6b778a;
  --teal: #2ec4b6;
  --teal-dim: rgba(46,196,182,.15);
  --neon: #3dff8a;
  --neon-dim: rgba(61,255,138,.12);
  --blue: #4f8cff;
  --purple: #a78bfa;
  --amber: #f5b942;
  --amber-dim: rgba(245,185,66,.12);
  --red: #ff5c6c;
  --green-chip: #22c55e;
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100dvh; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; background: none; border: 0; cursor: pointer; }
a { color: var(--teal); }

/* Header + brand (logo links home, as on the dashboard landing page) */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11,18,32,.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo-mark { display: block; height: 44px; width: auto; object-fit: contain; flex-shrink: 0; }
.brand-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.brand-title .w { color: #fff; }
.brand-title .dot { color: var(--teal); margin: 0 4px; }
.brand-title .t { color: var(--teal); }

/* Icon button */
.icon-btn {
  position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer;
}
.icon-btn svg { width: 36px; height: 36px; padding: 8px; border: 1px solid var(--line); border-radius: 999px; background: #151d2e; }
.icon-btn:hover svg, .icon-btn:focus-visible svg { border-color: var(--teal); color: var(--teal); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.1rem; border-radius: 12px; font-weight: 700; font-size: .95rem;
  text-decoration: none; border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  white-space: nowrap; transition: filter .15s, border-color .15s;
}
.btn:hover, .btn:focus-visible { border-color: var(--teal); outline: none; }
.btn.go { background: var(--neon); border-color: var(--neon); color: #062312; box-shadow: 0 8px 34px rgba(61,255,138,.22); }
.btn.go:hover { filter: brightness(1.06); }
.btn.warn { color: var(--red); }
.btn.sm { min-height: 44px; padding: .45rem .85rem; font-size: .86rem; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { opacity: .4; cursor: default; }

/* Labels, cards, chips */
.sec-lab, .card-h {
  font-size: .72rem; font-weight: 700; color: var(--teal);
  letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; display: block;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px;
  font-size: .85rem; font-weight: 650; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: #151d2e; color: var(--muted);
}
.chip.on { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }

/* Inputs + dark select (caret from the dashboard) */
.field {
  width: 100%; background-color: #1a2233; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  min-height: 48px; font-size: 16px; /* >=16px: no iOS focus zoom */ outline: none;
}
.field:focus { border-color: var(--teal); }
select.field {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239aa6b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; padding-right: 32px;
}
select.field option { background: #1a2233; color: var(--text); }
