:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #66707d;
  --line: #e3e7ec;
  --accent: #1f6feb;
  --accent-dark: #1a5fd0;
  --ok: #1a7f37;
  --ok-bg: #e6f4ea;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --wait: #8a6d00;
  --wait-bg: #fdf6df;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand span { color: var(--accent); }
.brand-logo { height: 26px; width: auto; display: block; }

.top nav { display: flex; align-items: center; gap: 1rem; }
.who { color: var(--muted); font-size: 0.9rem; }

main { flex: 1; width: 100%; max-width: 760px; margin: 2.5rem auto; padding: 0 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem;
}
.card.narrow { max-width: 420px; margin: 0 auto; }

h1 { margin: 0 0 1rem; font-size: 1.45rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 0.6rem; }

label { display: block; margin: 0 0 1rem; font-weight: 600; font-size: 0.92rem; }
label small { font-weight: 400; color: var(--muted); }
label.radio { font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

.inline { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.inline input { margin-top: 0; }
.suffix { color: var(--muted); white-space: nowrap; }

fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1.2rem; padding: 0.8rem 1rem; }
legend { font-weight: 600; font-size: 0.92rem; padding: 0 0.4rem; }

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-dark); }

button.linklike {
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 400;
}
button.linklike:hover { background: none; text-decoration: underline; }

.error {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid #f2c4bf;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
}

.notice {
  background: var(--wait-bg);
  border: 1px solid #ecd9a0;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin: 1rem 0;
}
.notice ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok); }
.badge.bad  { background: var(--bad-bg);  color: var(--bad); }
.badge.wait { background: var(--wait-bg); color: var(--wait); }
.badge.plat { background: #eef2ff; color: #4338ca; }

.inline-verify { display: flex; gap: 0.5rem; max-width: 440px; flex-wrap: wrap; }
.inline-verify input { margin: 0; flex: 1; min-width: 200px; }

.platform-pick { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 0.8rem 0 1.4rem; }
.plat-card {
  display: flex; flex-direction: column; gap: 0.15rem;
  border: 2px solid var(--line); border-radius: 10px;
  padding: 0.7rem 1rem; min-width: 130px; cursor: pointer;
}
.plat-card input { position: absolute; opacity: 0; }
.plat-card.selected { border-color: var(--accent); background: #f0f4fd; }
.plat-card.disabled { opacity: 0.55; cursor: not-allowed; background: #f8fafc; }
.plat-name { font-weight: 700; color: var(--ink); }
.plat-note { font-size: 0.78rem; color: var(--muted); }
.plat-card.selected .plat-note { color: var(--accent); font-weight: 600; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.4rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.connector {
  background: #f0f4fa;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  padding: 0.8rem;
  overflow-x: auto;
}
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.9em; }

.alt, .muted { color: var(--muted); font-size: 0.9rem; }

.hint { display: block; margin-top: 0.25rem; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.hint.ok  { color: var(--ok); }
.hint.bad { color: var(--bad); }

button:disabled { background: var(--muted); cursor: not-allowed; }

/* ---- admin ---- */

.top.admin { border-bottom: 3px solid var(--accent); }
.brand .tag {
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  vertical-align: middle;
}

main.wide { max-width: 1100px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.stat .n { display: block; font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.ok-text  { color: var(--ok) !important; }
.bad-text { color: var(--bad) !important; }

.scroll-x { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.list th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  padding: 0.45rem 0.6rem;
}
table.list td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list td.actions form { display: inline; }

button.small { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
button.danger { background: var(--bad); }
button.danger:hover { background: #93261d; }

.btnrow { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.card + .card { margin-top: 1.2rem; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.15rem 1rem;
  margin: 0.8rem 0 1rem;
}
.check-grid.tall {
  max-height: 24rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.check-grid label { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toolbar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

/* ---- enterprise dashboard shell (shared portal + admin) ---- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.page-head h1 { margin: 0; }
.page-head .sub { margin: 0.2rem 0 0; color: var(--muted); }
.head-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.hero { text-align: center; padding: 3rem 1rem; }
.hero .lead { color: var(--muted); font-size: 1.05rem; margin: 0.5rem 0 1.5rem; }
.button.lg { font-size: 1.05rem; padding: 0.8rem 1.6rem; }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.button.ghost:hover { background: #eef4fd; }

.tabs { display: flex; gap: 0.3rem; border-bottom: 2px solid var(--line); margin: 1.2rem 0; flex-wrap: wrap; }
.tab {
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.stat-label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.2rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
.chip {
  font-size: 0.85rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.chip.on  { background: var(--ok-bg);  color: var(--ok);  border-color: #b7e0c2; }
.chip.off { background: #f1f3f5; color: var(--muted); text-decoration: line-through; }

.card.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px #e8f1fe; }

textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.step { font-size: 1rem; color: var(--accent); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.4rem; }
.step:first-of-type { border-top: 0; padding-top: 0; margin-top: 0.5rem; }

.filetree {
  list-style: none;
  margin: 0.4rem 0 1rem;
  padding: 0.7rem 0.9rem;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.filetree li { padding: 0.15rem 0; }
.filetree .muted { font-family: system-ui, sans-serif; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.2rem;
}
