/* WP Launcher Lite — one stylesheet for the launcher, installer and panel. */

:root {
  --accent: #2563eb;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --fg: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --surface: #121925;
    --surface-2: #1a2231;
    --fg: #e5e7eb;
    --muted: #9aa3b2;
    --border: #253043;
    --ok: #34d399;
    --ok-bg: #062b20;
    --warn: #fbbf24;
    --warn-bg: #2b2108;
    --bad: #f87171;
    --bad-bg: #2d1111;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .82rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  padding: .55em 1em; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; font-size: .92rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-danger.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { padding: .32em .7em; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: .8em 1.4em; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.linkish:hover { color: var(--fg); }
.when-busy { display: none; }
.busy .when-idle { display: none; }
.busy .when-busy { display: inline-flex; align-items: center; gap: .5em; }
.spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ── Forms ───────────────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > span, legend { font-weight: 600; font-size: .88rem; }
.field small, .check small { color: var(--muted); font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  width: 100%; padding: .6em .75em; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: .93rem;
}
input[readonly] { background: var(--surface-2); }
input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
textarea { resize: vertical; }
fieldset.card { border: 1px solid var(--border); margin: 0; }
fieldset.card > legend { float: left; width: 100%; margin-bottom: 4px; font-size: 1.02rem; }
fieldset.card > legend + * { clear: both; }
.choice, .check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.choice { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice input, .check input { margin-top: .3em; accent-color: var(--accent); }
.check span { display: flex; flex-direction: column; }
.check.locked { color: var(--muted); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.grid-2, .grid-3 { display: grid; gap: 14px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.form-wide { max-width: 860px; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.form-foot .fine { margin-right: auto; }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: 12px; }
.consent { font-size: .78rem; color: var(--muted); }

/* ── Surfaces ────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { width: 100%; max-width: 420px; margin: 40px auto; }
.card.narrow > h1 + .muted { margin: -4px 0 6px; }
.card.center { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.card.center .btn { margin-top: 8px; }
.empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.flash { padding: 11px 14px; border-radius: 10px; border: 1px solid; font-size: .92rem; }
.flash-success { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash-error { color: var(--bad); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.flash-warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.flash a { color: inherit; font-weight: 600; }
.badge { display: inline-block; padding: .12em .55em; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.progress-wrap { display: flex; flex-direction: column; gap: 8px; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0; }
.meta dt { font-size: .78rem; color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.card.flush { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-dense td { padding: 7px 16px; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
td .row-actions { justify-content: flex-end; }
.row-actions form { margin: 0; }
.inline-select { display: inline-flex; gap: 4px; }
.inline-select select { width: auto; padding: .28em .5em; font-size: .82rem; border-radius: 8px; }

/* ── Checks list (installer / system) ────────────────────────────────── */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li div { display: flex; flex-direction: column; min-width: 0; }
.checks small { color: var(--muted); overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; margin-top: .45em; border-radius: 50%; flex: none; background: var(--muted); }
.checks .ok .dot { background: var(--ok); }
.checks .warn .dot { background: var(--warn); }
.checks .fail .dot { background: var(--bad); }
.checks .fail strong { color: var(--bad); }

/* ── Public pages ────────────────────────────────────────────────────── */
.topbar { max-width: 1080px; margin: 0 auto; padding: 18px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #9333ea)); }
.brand-logo { height: 30px; width: auto; }
.page { max-width: 1080px; margin: 0 auto; padding: 8px 16px 48px; display: flex; flex-direction: column; gap: 24px; }
.footer { max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: .85rem; }
.hero { text-align: center; padding: 28px 0 8px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.hero-sm h1 { font-size: 1.9rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 620px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 360px)); justify-content: center; gap: 20px; }
.cards-single { padding-top: clamp(16px, 6vh, 64px); }
.demo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.demo-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.demo-img-blank { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.demo-img-blank span { font-size: 2.6rem; font-weight: 700; color: var(--accent); opacity: .7; }
.demo-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.launch-form { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.launch-form .fine { text-align: center; }
.mine { background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.mine h2 { font-size: .95rem; }
.mine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mine-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ready { max-width: 560px; margin: 24px auto; display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; padding: 32px 24px; }
.ready-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); font-size: 1.5rem; font-weight: 700; }
.creds { width: 100%; margin: 8px 0 0; text-align: left; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.creds div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); align-items: center; }
.creds div:last-child { border-bottom: 0; }
.creds dt { color: var(--muted); font-size: .84rem; }
.creds dd { margin: 0; overflow-wrap: anywhere; font-size: .9rem; }
[data-copy] { cursor: copy; }
.copied { outline: 2px solid var(--ok); }
.install-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 880px) { .install-grid { grid-template-columns: 340px 1fr; } }

/* ── Panel ───────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex: none; border-right: 1px solid var(--border); background: var(--surface); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 4px 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: .92rem; }
.sidebar nav a:hover { background: var(--surface-2); color: var(--fg); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 10px; font-size: .86rem; }
.sidebar-foot a { color: var(--muted); text-decoration: none; }
.sidebar-foot form { margin: 0; }
.main { flex: 1; min-width: 0; padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .muted { margin-top: 4px; }
.crumb { font-size: .85rem; margin-bottom: 4px; }
.crumb a { color: var(--muted); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--muted); font-size: .82rem; }
.stat strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.split { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) 300px; } }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; gap: 10px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; gap: 4px; margin: 0 -4px; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar-foot { flex-direction: row; justify-content: space-between; margin: 0; padding: 0 4px; }
  .main { padding: 20px 16px 48px; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  .creds div { grid-template-columns: 1fr; gap: 2px; }
}
