:root {
  color-scheme: light;
  --bg: #f5f6fb;
  --bg-soft: #eef1fa;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --text: #1c2333;
  --muted: #667085;
  --line: #e3e7f0;
  --primary: #5b5bd6;
  --primary-strong: #4949c7;
  --primary-soft: #ededff;
  --input-bg: #fbfbfe;
  --topbar-bg: rgba(255, 255, 255, 0.8);
  --success-bg: #e7f7f0;
  --success-text: #0f6b4f;
  --error-bg: #fdecef;
  --error-text: #b42346;
  --info-bg: #eaf2ff;
  --info-text: #1d4ed8;
  --shadow: 0 20px 50px rgba(38, 45, 80, 0.08);
  --radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(
      circle at 12% -10%,
      rgba(91, 91, 214, 0.12),
      transparent 38%
    ),
    radial-gradient(
      circle at 92% 0%,
      rgba(14, 165, 233, 0.08),
      transparent 34%
    );
  background-attachment: fixed;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-strong);
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

:focus-visible {
  outline: 3px solid rgba(91, 91, 214, 0.35);
  outline-offset: 2px;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.main-area {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

/* Header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1, #4f46e5 60%, #7c3aed);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}

.brand-name {
  font-size: 1.02rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.main-nav > a {
  color: var(--muted);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav > a:hover,
.main-nav > a.is-active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.nav-form {
  margin: 0;
}

.nav-logout {
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.nav-logout:hover {
  color: var(--error-text);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s ease, background 0.18s ease;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #6366f1, #5b5bd6 58%, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 24px rgba(91, 91, 214, 0.26);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 14px 30px rgba(91, 91, 214, 0.34);
}

.btn-sm {
  padding: 0.48rem 0.9rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.9rem 1.45rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Flash and toast */

.flash-stack {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.flash {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.flash-info {
  background: var(--info-bg);
  color: var(--info-text);
}

.flash.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.flash-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: rgba(22, 28, 46, 0.94);
  color: #fff;
  font-size: 0.88rem;
  box-shadow: 0 12px 30px rgba(15, 20, 40, 0.3);
  animation: toast-in 0.2s ease both;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.copy-fallback {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Cards and common layout */

.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-head h2 {
  margin-bottom: 0.2rem;
  font-size: 1.12rem;
}

.card-head p {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.62rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.page-head h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.page-head p {
  margin-bottom: 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.page-actions.centered {
  justify-content: center;
}

/* Forms */

.stack {
  display: grid;
  gap: 1.1rem;
}

.field {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.field > span {
  font-size: 0.88rem;
  font-weight: 600;
}

.field > span em {
  color: var(--error-text);
  font-style: normal;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.12);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa3b5;
}

.field-error {
  color: var(--error-text);
  font-size: 0.8rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 4.2rem;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.divider {
  height: 1px;
  background: var(--line);
}

.section-title h2 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.15rem;
}

.section-title p {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.question-list {
  display: grid;
  gap: 1rem;
}

.question-list .field > span {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.question-index {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
}

/* Landing page */

.landing-page .main-area {
  padding-top: 1rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: 4rem 0 5.5rem;
}

.hero h1 {
  margin-bottom: 1.2rem;
  font-size: clamp(2.35rem, 5vw, 3.9rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.gradient-text {
  background: linear-gradient(120deg, #4f46e5, #7c3aed 48%, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 36rem;
  margin-bottom: 1.6rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.86rem;
  list-style: none;
}

.hero-points li::before {
  content: "✓";
  margin-right: 0.4rem;
  color: var(--primary);
  font-weight: 800;
}

.hero-preview {
  perspective: 1200px;
}

.preview-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-solid);
  box-shadow: 0 30px 70px rgba(38, 45, 80, 0.16);
  transform: rotateY(-6deg) rotateX(2deg);
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-red {
  background: #fb7185;
}

.dot-yellow {
  background: #fbbf24;
}

.dot-green {
  background: #34d399;
}

.preview-address {
  flex: 1;
  margin-left: 0.5rem;
  padding: 0.28rem 0.65rem;
  border-radius: 7px;
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-body {
  padding: 1.35rem;
}

.preview-profile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.preview-profile div {
  display: grid;
  gap: 0.1rem;
}

.preview-profile strong {
  font-size: 0.98rem;
}

.preview-profile span:not(.avatar) {
  color: var(--muted);
  font-size: 0.76rem;
}

.avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.avatar-lg {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  font-size: 1.85rem;
  box-shadow: 0 16px 34px rgba(99, 102, 241, 0.28);
}

.preview-search {
  margin-bottom: 0.9rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 0.74rem;
}

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.chip {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.is-active,
.chip-active {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.preview-chips .chip {
  padding: 0.22rem 0.6rem;
  font-size: 0.66rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.preview-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-solid);
}

.preview-lines {
  display: grid;
  flex: 1;
  gap: 0.32rem;
}

.preview-lines i {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-soft);
}

.preview-lines i.short {
  width: 62%;
}

.section {
  padding: 3.5rem 0 1rem;
}

.section-head {
  max-width: 640px;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.feature-card {
  padding: 1.6rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.feature-card:hover {
  border-color: rgba(91, 91, 214, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 24px 55px rgba(38, 45, 80, 0.12);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 700;
}

.feature-card h3 {
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}

.step-number {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  opacity: 0.55;
}

.step h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.step p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 3.5rem 0 1rem;
  padding: clamp(1.7rem, 4vw, 2.75rem);
  border-radius: 24px;
  background: linear-gradient(120deg, #4f46e5, #6d5ce7 50%, #7c3aed);
  color: #fff;
  box-shadow: 0 30px 65px rgba(79, 70, 229, 0.28);
}

.cta-card .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.cta-card h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.cta-card p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex-shrink: 0;
}

.cta-card .btn {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cta-card .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.cta-card .btn-primary {
  border-color: transparent;
  background: #fff;
  color: var(--primary-strong);
  box-shadow: none;
}

.cta-card .btn-primary:hover {
  color: var(--primary-strong);
  background: #f7f6ff;
}

/* Auth pages */

.auth-page {
  display: flex;
  justify-content: center;
  padding: 3rem 0 4rem;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  padding: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.auth-card-wide {
  max-width: 800px;
}

.auth-head {
  margin-bottom: 1.6rem;
}

.auth-head h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.65rem, 3vw, 2.05rem);
}

.auth-head p {
  margin-bottom: 0;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
  margin-top: 1.35rem;
  font-size: 0.88rem;
}

.auth-alt {
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.auth-card-wide .question-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Dashboard */

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 1.5rem;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 1.5rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 0.82rem;
}

.text-link {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.account-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.account-row div {
  display: grid;
  min-width: 0;
}

.account-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-row .muted {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
}

.tip-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.tip-list li::marker {
  color: var(--primary);
}

.tip-card h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.link-groups {
  display: grid;
  gap: 1.5rem;
}

.link-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.link-group-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.link-group-head .muted {
  font-size: 0.78rem;
}

.manage-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.manage-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.manage-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.manage-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.manage-title {
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-title:hover {
  color: var(--primary);
}

.manage-url {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-desc {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.manage-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.3rem;
}

.manage-actions form {
  margin: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-btn.danger:hover {
  border-color: rgba(196, 41, 74, 0.35);
  background: var(--error-bg);
  color: var(--error-text);
}

.icon-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.icon-btn:disabled:hover {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.form-card {
  max-width: 820px;
}

/* Site icons */

.site-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.color-0 {
  background: #eef0ff;
  color: #4f46e5;
}

.color-1 {
  background: #e8f7f1;
  color: #0f766e;
}

.color-2 {
  background: #fff3e8;
  color: #c2410c;
}

.color-3 {
  background: #fdeef4;
  color: #be185d;
}

.color-4 {
  background: #e8f4ff;
  color: #0369a1;
}

.color-5 {
  background: #f3efff;
  color: #7e22ce;
}

/* Public navigation page */

.nav-hero {
  padding: 3rem 0 1rem;
}

.nav-profile {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav-profile-copy {
  min-width: 0;
}

.nav-profile-copy h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  letter-spacing: -0.03em;
}

.nav-profile-copy .lead {
  margin-bottom: 0.9rem;
  font-size: 0.98rem;
}

.nav-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.nav-meta span {
  padding: 0.22rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
}

.nav-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 230px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  color: var(--muted);
  font-size: 1.05rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.62rem 0.9rem 0.62rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.88rem;
}

.search-box input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.12);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.result-count strong {
  color: var(--text);
}

.nav-groups {
  display: grid;
  gap: 2.25rem;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.group-head h2 {
  margin: 0;
  font-size: 1.02rem;
}

.group-head span {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 0.85rem;
}

.site-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(38, 45, 80, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.site-card:hover {
  border-color: rgba(91, 91, 214, 0.4);
  color: var(--text);
  box-shadow: 0 16px 34px rgba(38, 45, 80, 0.11);
  transform: translateY(-2px);
}

.site-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.site-title {
  overflow: hidden;
  font-size: 0.94rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-host {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-desc {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.site-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.9rem;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.site-card:hover .site-arrow {
  color: var(--primary);
  opacity: 1;
  transform: translate(0, 0);
}

.public-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(
    120deg,
    rgba(91, 91, 214, 0.1),
    rgba(124, 58, 237, 0.06)
  );
}

.public-cta h2 {
  margin-bottom: 0.3rem;
  font-size: 1.3rem;
}

.public-cta p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Empty and error states */

.empty-state {
  padding: 3rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 0.85rem;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 700;
}

.empty-state h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.empty-state p {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state .btn {
  margin-top: 0.2rem;
}

.error-page {
  padding: 5rem 1rem 6rem;
  text-align: center;
}

.error-code {
  display: block;
  margin-bottom: 0.5rem;
  background: linear-gradient(120deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.error-page h1 {
  margin-bottom: 0.5rem;
  font-size: 1.6rem;
}

.error-page p {
  max-width: 480px;
  margin: 0 auto 1.5rem;
  color: var(--muted);
}

/* Footer */

.site-footer {
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-meta {
  opacity: 0.8;
}

/* Responsive */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 0 4rem;
  }

  .hero-preview {
    max-width: 560px;
  }

  .preview-window {
    transform: none;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-side .tip-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .main-area {
    padding-top: 1.75rem;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .page-actions {
    width: 100%;
  }

  .feature-grid,
  .steps,
  .dashboard-side {
    grid-template-columns: 1fr;
  }

  .cta-card,
  .public-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .cta-actions {
    width: 100%;
  }

  .cta-card .btn {
    flex: 1;
  }

  .nav-profile {
    align-items: flex-start;
  }

  .avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 1.45rem;
  }

  .result-count {
    margin-left: 0;
  }

  .auth-card {
    padding: 1.6rem;
  }

  .auth-card-wide .question-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    width: calc(100% - 28px);
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    padding: 0.65rem 0;
  }

  .main-nav {
    gap: 0.9rem;
    font-size: 0.86rem;
  }

  .main-nav .btn-sm {
    padding: 0.4rem 0.75rem;
  }

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

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

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

  .manage-item {
    flex-wrap: wrap;
  }

  .manage-info {
    flex-basis: calc(100% - 60px);
  }

  .manage-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--line);
  }

  .nav-profile {
    flex-direction: column;
    gap: 0.9rem;
  }

  .nav-toolbar {
    padding: 0.85rem;
  }

  .search-box {
    min-width: 100%;
  }

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

  .flash-stack {
    margin-bottom: 1rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Dark mode */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0f1a;
    --bg-soft: #141a2a;
    --surface: rgba(20, 26, 43, 0.88);
    --surface-solid: #161c2c;
    --text: #e8eaf3;
    --muted: #98a2b8;
    --line: #283049;
    --primary: #8f8ff6;
    --primary-strong: #a9a9ff;
    --primary-soft: rgba(124, 124, 245, 0.17);
    --input-bg: rgba(11, 15, 26, 0.72);
    --topbar-bg: rgba(11, 15, 26, 0.82);
    --success-bg: rgba(16, 124, 91, 0.16);
    --success-text: #64e3b5;
    --error-bg: rgba(196, 41, 74, 0.18);
    --error-text: #ff8da8;
    --info-bg: rgba(29, 78, 216, 0.2);
    --info-text: #93b8ff;
    --shadow: 0 22px 55px rgba(0, 0, 0, 0.32);
  }

  body {
    background-image: radial-gradient(
        circle at 12% -10%,
        rgba(99, 102, 241, 0.16),
        transparent 38%
      ),
      radial-gradient(
        circle at 92% 0%,
        rgba(14, 165, 233, 0.1),
        transparent 34%
      );
  }

  .field input::placeholder,
  .field textarea::placeholder {
    color: #717c93;
  }

  .flash-close {
    background: rgba(255, 255, 255, 0.08);
  }

  .color-0 {
    background: rgba(99, 102, 241, 0.18);
    color: #a5a7ff;
  }

  .color-1 {
    background: rgba(16, 185, 129, 0.15);
    color: #5ee0b5;
  }

  .color-2 {
    background: rgba(249, 115, 22, 0.16);
    color: #fdba74;
  }

  .color-3 {
    background: rgba(236, 72, 153, 0.16);
    color: #f9a8d4;
  }

  .color-4 {
    background: rgba(14, 165, 233, 0.16);
    color: #7dd3fc;
  }

  .color-5 {
    background: rgba(168, 85, 247, 0.16);
    color: #d8b4fe;
  }

  .preview-window,
  .site-card {
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  }

  .cta-card {
    box-shadow: 0 30px 65px rgba(0, 0, 0, 0.35);
  }
}
