:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #101f37;
  --panel-2: #0b1930;
  --line: rgba(158, 180, 213, 0.22);
  --ink: #eef5ff;
  --muted: #a8b7ce;
  --accent: #4f9cff;
  --good: #35d07f;
  --warn: #ffce5c;
  --bad: #ff6b6b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 156, 255, 0.18), transparent 34rem),
    linear-gradient(145deg, #07111f 0%, #09182b 46%, #0b213b 100%);
}

.shell {
  display: grid;
  gap: 22px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) 0;
}

.login-shell {
  min-height: 100vh;
  align-content: center;
  width: min(460px, calc(100% - 32px));
}

.panel {
  display: grid;
  gap: 20px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 31, 55, 0.98), rgba(13, 28, 50, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.admin-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.92);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.admin-tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
}

.admin-tab.is-active,
.admin-tab:hover {
  border-color: rgba(79, 156, 255, 0.42);
  color: var(--ink);
  background: rgba(79, 156, 255, 0.16);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-head.compact {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2,
.section-head h3,
.section-head p {
  margin-bottom: 0;
}

.section-head form {
  margin: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.login-panel {
  gap: 18px;
}

.hero {
  gap: 14px;
}

.eyebrow {
  margin: 0;
  color: #86b9ff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4.8vw, 4.2rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 2.8vw, 2.3rem);
  line-height: 1.05;
}

p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.65;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
  text-decoration: none;
}

.button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #06101d;
}

.checks {
  display: grid;
  gap: 10px;
}

.check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.check strong {
  overflow-wrap: anywhere;
}

.check span {
  color: var(--warn);
  font-weight: 900;
}

.check[data-ok="true"] span {
  color: var(--good);
}

.check[data-required="false"] span {
  color: #86b9ff;
}

.check p {
  grid-column: 1 / -1;
  margin: 0;
  overflow-wrap: anywhere;
}

pre {
  overflow: auto;
  max-height: 460px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #050b14;
  color: #d9e6f7;
  white-space: pre-wrap;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.install-form p {
  max-width: 820px;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #09182b;
  font: inherit;
  outline: none;
}

.error {
  color: var(--bad);
  font-weight: 800;
}

.success {
  color: var(--good);
  font-weight: 800;
}

.settings-form,
.form-section {
  display: grid;
  gap: 18px;
}

.form-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 11, 20, 0.32);
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

.settings-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.settings-form label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
}

.settings-form input,
.settings-form select,
.settings-form textarea,
.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #09182b;
  font: inherit;
  outline: none;
}

.settings-form textarea {
  resize: vertical;
}

.settings-form input[type="color"] {
  min-height: 46px;
  padding: 6px;
}

.settings-form input[type="file"] {
  padding: 9px 12px;
}

.wide {
  grid-column: 1 / -1;
}

.checkline {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  grid-template-columns: none;
}

.checkline input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.message-preview {
  display: grid;
  gap: 6px;
  max-width: 420px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #050b14;
}

.message-preview p {
  margin: 0;
}

.widget-preview {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: calc(12px * var(--widget-scale, 1));
  border: 1px solid var(--line);
  border-radius: var(--widget-radius);
  background: var(--widget-bg);
  color: var(--widget-text);
  font-size: calc(1rem * var(--widget-scale, 1));
}

.widget-preview[data-shape="top-banner"] {
  width: min(620px, 100%);
  justify-content: center;
}

.widget-preview[data-shape="circle"] {
  width: calc(58px * var(--widget-scale, 1));
  height: calc(58px * var(--widget-scale, 1));
  padding: 0;
  justify-content: center;
  border-radius: 999px;
}

.widget-preview[data-shape="circle"] .widget-preview__icon {
  display: none;
}

.widget-preview__icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--widget-button);
  color: var(--widget-button-text);
  font-weight: 900;
}

.widget-preview button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: max(4px, calc(var(--widget-radius) - 2px));
  background: var(--widget-button);
  color: var(--widget-button-text);
  font: inherit;
  font-weight: 900;
}

.widget-preview[data-shape="circle"] button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  font-size: calc(1.45rem * var(--widget-scale, 1));
}

.tab-panel {
  display: none !important;
}

.tab-panel.is-active {
  display: grid !important;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 18px 0;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .check {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .section-head .button,
  .section-head button {
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
