:root {
  --theme-page-bg: #ffffff;
  --theme-hero-bg: #f5f6ff;
  --theme-primary: #c54ab3;
  --theme-secondary: #4b7de3;
  --theme-accent: #d96ec8;
  --theme-text-dark: #171c34;
  --theme-text-muted: #626986;
  --theme-header-bg: #ffffff;
  --theme-card-bg: #ffffff;
  --theme-button-text: #ffffff;
  --shadow-soft: 0 14px 35px rgba(23, 28, 52, 0.08);
  --shadow-card: 0 28px 60px rgba(23, 28, 52, 0.08);
  --radius-xl: 34px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-display);
  color: var(--theme-text-dark);
}

a {
  color: inherit;
}

.landing-page {
  display: grid;
  place-items: center;
  padding: 18px 12px;
  background:
    radial-gradient(circle at top, rgba(217, 110, 200, 0.12), transparent 24%),
    linear-gradient(180deg, #fafbff 0%, var(--theme-page-bg) 100%);
}

.taplink-shell {
  width: min(100%, 430px);
  min-height: calc(100vh - 36px);
  padding: 18px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 246, 255, 0.98)),
    var(--theme-card-bg);
  box-shadow: 0 32px 80px rgba(23, 28, 52, 0.12);
  border: 1px solid rgba(75, 125, 227, 0.08);
}

.phone-panel {
  width: 100%;
  min-height: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: var(--theme-card-bg);
  border: 1px solid rgba(23, 28, 52, 0.06);
}

.mobile-hero {
  padding: 18px 18px 24px;
  background:
    radial-gradient(circle at top right, rgba(75, 125, 227, 0.08), transparent 30%),
    linear-gradient(180deg, var(--theme-hero-bg) 0%, rgba(245, 246, 255, 0.88) 100%);
}

.brand-stack {
  display: grid;
  gap: 14px;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clinic-logo {
  width: 86px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.logo-copy {
  display: grid;
  gap: 4px;
}

.logo-copy strong {
  font-size: 15px;
  line-height: 1.2;
}

.logo-copy span,
.hero-description,
.section-text,
.admin-text,
.admin-message,
.empty-state,
[data-preview-url] {
  color: var(--theme-text-muted);
}

.logo-copy span {
  font-size: 13px;
  line-height: 1.35;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-badge,
.panel-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(197, 74, 179, 0.12);
  color: var(--theme-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-card-mobile {
  margin-top: 16px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.hero-card-mobile h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 9vw, 42px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.content-area {
  padding: 18px;
}

.cta-row,
.links-grid,
.blocks-stack,
.blocks-editor,
.nested-links,
.admin-form,
.settings-grid,
.theme-grid,
.link-item-grid,
.link-color-grid {
  display: grid;
  gap: 12px;
}

.cta-row {
  margin-bottom: 18px;
}

.links-block {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(23, 28, 52, 0.08);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2,
.dashboard-header h1,
.admin-card h1 {
  margin: 10px 0 8px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--link-border);
  background: var(--link-bg);
  color: var(--link-text);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.link-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.button-icon-wrap,
.preview-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.button-icon,
.preview-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card-title {
  font-weight: 700;
  line-height: 1.3;
}

.link-card-arrow {
  font-size: 20px;
  line-height: 1;
}

.admin-page {
  background: linear-gradient(180deg, #f6f7ff 0%, #fff 100%);
}

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

.admin-card,
.dashboard-card,
.settings-card,
.link-item,
.block-editor-card {
  background: var(--theme-card-bg);
  border: 1px solid rgba(23, 28, 52, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.admin-card,
.dashboard-card {
  padding: 32px;
}

.dashboard-card {
  display: grid;
  gap: 24px;
}

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

.settings-card,
.link-item,
.block-editor-card {
  padding: 24px;
}

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

.hidden {
  display: none;
}

.dashboard-header,
.link-editor-header,
.actions-row,
.link-top,
.item-actions,
.block-top,
.nested-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.block-meta-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.nested-header {
  margin: 20px 0 14px;
}

.block-title-label {
  margin: 0;
  font-size: 22px;
}

.block-title-note {
  margin: 6px 0 0;
  color: var(--theme-text-muted);
  font-size: 14px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(23, 28, 52, 0.12);
  background: #fff;
  color: var(--theme-text-dark);
}

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

.color-field {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
}

input[type="color"] {
  padding: 4px;
  min-height: 48px;
}

input[type="file"] {
  padding: 10px;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.primary-btn {
  background: var(--theme-primary);
  color: var(--theme-button-text);
}

.ghost-btn {
  background: rgba(75, 125, 227, 0.1);
  color: var(--theme-secondary);
}

.danger-btn {
  background: rgba(197, 74, 179, 0.12);
  color: var(--theme-primary);
}

.link-item {
  --preview-bg: #C54AB3;
  --preview-text: #FFFFFF;
  --preview-border: #C54AB3;
}

.link-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--preview-border);
  background: var(--preview-bg);
  color: var(--preview-text);
}

.link-preview p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.empty-state,
.error-message {
  padding: 18px 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px dashed rgba(23, 28, 52, 0.16);
}

@media (max-width: 980px) {
  .settings-grid,
  .theme-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-shell {
    width: min(100%, calc(100% - 20px));
  }

  .dashboard-header,
  .link-editor-header,
  .actions-row,
  .link-top,
  .item-actions,
  .block-top,
  .nested-header {
    align-items: stretch;
    flex-direction: column;
  }
}
