:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef4ff;
  --text: #152033;
  --muted: #65728a;
  --line: #dfe7f2;
  --accent: #1769e0;
  --accent-dark: #0f4fb0;
  --ok: #0f9f6e;
  --warn: #b36b00;
  --bad: #c23838;
  --shadow: 0 20px 50px rgba(22, 38, 63, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.nav-link {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 36px;
  align-items: center;
  padding: 38px 0 28px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.06;
  font-weight: 820;
}

.hero-copy p {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.metric {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.recommend-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.recommend-panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.primary-card {
  padding: 18px;
  border: 1px solid #cfe0f8;
  border-radius: 8px;
  background: var(--surface-strong);
}

.domain-url {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
}

.domain-url.compact {
  margin-top: 3px;
}

.domain-name {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

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

.button.primary:hover {
  background: var(--accent-dark);
}

.button.danger {
  border-color: #f2c9c9;
  color: var(--bad);
}

.button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.domain-list {
  display: grid;
  gap: 10px;
  margin: 28px 0 56px;
}

.domain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.domain-row .domain-name {
  font-size: 16px;
}

.domain-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #edf2f8;
  color: #48566d;
  font-size: 12px;
  font-weight: 700;
}

.chip.ok {
  background: #e7f7ef;
  color: var(--ok);
}

.chip.bad {
  background: #fbebeb;
  color: var(--bad);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.72);
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  padding-bottom: 48px;
}

.panel {
  padding: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.divider {
  height: 1px;
  margin: 20px 0;
  border: 0;
  background: var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.icon-button {
  position: absolute;
  right: 8px;
  top: 50%;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  background: #edf2f8;
  color: var(--text);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.checkbox-row input {
  width: auto;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #142033;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
}

@media (max-width: 820px) {
  .hero,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 18px;
  }

  .domain-row,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}
