/* Shell styles. Tokens first; dark mode follows the system unless data-theme is set. No external fonts or CDNs. */
:root {
  --brand: #2f6df6;
  --brand-ink: #ffffff;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #12161c;
  --muted: #5d6675;
  --line: #e2e6ec;
  --ok: #11785a;
  --ok-bg: #e3f5ee;
  --warn: #9a5b00;
  --warn-bg: #fdf1dc;
  --bad: #b3261e;
  --bad-bg: #fbe7e5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1015; --card: #161a21; --ink: #eef1f5; --muted: #9aa3b2; --line: #272d38;
    --ok: #4fd1a1; --ok-bg: #12342a; --warn: #f2b34a; --warn-bg: #3a2b0e; --bad: #ff8f86; --bad-bg: #3d1a17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1015; --card: #161a21; --ink: #eef1f5; --muted: #9aa3b2; --line: #272d38;
  --ok: #4fd1a1; --ok-bg: #12342a; --warn: #f2b34a; --warn-bg: #3a2b0e; --bad: #ff8f86; --bad-bg: #3d1a17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 460px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.top .brand { font-weight: 700; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); display: inline-block; }
.top .where { color: var(--muted); }
.top .space { flex: 1; }
.iconbtn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; min-width: 40px; height: 40px; cursor: pointer; font: inherit; position: relative; }
.badge { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; }

/* cards + tiles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-height: 118px; }
.tile:hover, .tile:focus-visible { border-color: var(--brand); outline: none; }
.tile .ico { font-size: 1.9rem; line-height: 1; }
.tile .nm { font-weight: 650; margin-top: 8px; }
.tile .tg { color: var(--muted); font-size: .85rem; margin-top: 2px; }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
.field + .field { margin-top: 12px; }
.help { color: var(--muted); font-size: .85rem; margin-top: 4px; }

.btn { font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 10px 16px; min-height: 44px; cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }

.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; background: var(--line); color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

.banner { border-radius: var(--radius); padding: 12px 14px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--line); }
.error { color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.tablewrap { overflow-x: auto; }

/* wizard */
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--brand); }
.pick { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.pick.on { border-color: var(--brand); }
.pick input { margin-top: 4px; flex: none; }
ol.steplist { padding-left: 1.2em; margin: .3em 0 .8em; color: var(--muted); font-size: .9rem; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 99; max-width: 90vw; box-shadow: var(--shadow); }
@media (min-width: 720px) { .wrap { padding: 24px; } h1 { font-size: 1.9rem; } }

/* the client's own logo */
.logo { height: 30px; width: auto; max-width: 140px; object-fit: contain; border-radius: 6px; display: inline-block; }
.hero-logo { height: 64px; max-width: 220px; margin: 0 auto 8px; display: block; object-fit: contain; }
.center { text-align: center; }
.credits { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.credits .amt { font-size: 1.6rem; font-weight: 700; }
.logo-pick { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logo-pick .preview { width: 72px; height: 72px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--bg); }
.logo-pick .preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* links styled as buttons behave like buttons */
a.btn { display: inline-block; text-decoration: none; text-align: center; line-height: 1.4; }
.btn.block { display: block; width: 100%; }
