html {
  --bg-color: #0b0f19;
  --bg-grad-start: #121a2d;
  --bg-grad-mid: #0b0f19;
  --bg-grad-end: #070a12;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-light: rgba(255, 255, 255, 0.18);
  --text-main: #eef2ff;
  --text-muted: #94a3b8;
  --label-color: #dbe7ff;
  --spotlight-color: rgba(255, 255, 255, 0.06);
  --orb-1: rgba(99, 102, 241, 0.35);
  --orb-2: rgba(236, 72, 153, 0.26);
  --orb-3: rgba(20, 184, 166, 0.24);
  --shadow-base: rgba(0, 0, 0, 0.45);
  --ok: #22c55e;
  --danger: #ef4444;
  --brand: #6366f1;
  --btn-brand-start: #6366f1;
  --btn-brand-end: #4f46e5;
  --btn-brand-shadow: rgba(79, 70, 229, 0.35);
  --btn-danger-start: #ef4444;
  --btn-danger-end: #dc2626;
  --btn-danger-shadow: rgba(220, 38, 38, 0.34);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-placeholder: #8da0c0;
  --input-focus: #8ea2ff;
  --input-focus-ring: rgba(99, 102, 241, 0.35);
  --site-card-bg: rgba(7, 11, 20, 0.46);
  --popup-bg: rgba(8, 12, 22, 0.95);
  --site-text: #d6def1;
  --site-strong: #ffffff;
  --code-bg: rgba(255, 255, 255, 0.08);
  --code-color: #dbe8ff;
  --code-area-bg: rgba(2, 6, 14, 0.62);
  --code-area-color: #d8e5ff;
  --flash-success-bg: rgba(34, 197, 94, 0.16);
  --flash-success-border: rgba(34, 197, 94, 0.35);
  --flash-success-text: #b4f5cb;
  --flash-error-bg: rgba(239, 68, 68, 0.15);
  --flash-error-border: rgba(239, 68, 68, 0.32);
  --flash-error-text: #ffd3d3;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg-color: #e2e8f0;
  --bg-grad-start: #f3f7ff;
  --bg-grad-mid: #e2e8f0;
  --bg-grad-end: #d9e1ee;
  --glass-bg: rgba(255, 255, 255, 0.64);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-light: rgba(0, 0, 0, 0.2);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --label-color: #1e293b;
  --spotlight-color: rgba(0, 0, 0, 0.04);
  --orb-1: rgba(99, 102, 241, 0.23);
  --orb-2: rgba(236, 72, 153, 0.2);
  --orb-3: rgba(20, 184, 166, 0.19);
  --shadow-base: rgba(0, 0, 0, 0.08);
  --btn-brand-start: #4f46e5;
  --btn-brand-end: #4338ca;
  --btn-brand-shadow: rgba(67, 56, 202, 0.25);
  --btn-danger-start: #dc2626;
  --btn-danger-end: #b91c1c;
  --btn-danger-shadow: rgba(185, 28, 28, 0.26);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-placeholder: #6b7280;
  --input-focus: #4f46e5;
  --input-focus-ring: rgba(79, 70, 229, 0.22);
  --site-card-bg: rgba(255, 255, 255, 0.74);
  --popup-bg: rgba(249, 251, 255, 0.97);
  --site-text: #1e293b;
  --site-strong: #0f172a;
  --code-bg: rgba(255, 255, 255, 0.82);
  --code-color: #0f172a;
  --code-area-bg: rgba(255, 255, 255, 0.97);
  --code-area-color: #0f172a;
  --flash-success-bg: rgba(22, 163, 74, 0.12);
  --flash-success-border: rgba(22, 163, 74, 0.32);
  --flash-success-text: #166534;
  --flash-error-bg: rgba(220, 38, 38, 0.11);
  --flash-error-border: rgba(220, 38, 38, 0.3);
  --flash-error-text: #991b1b;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color, #0b0f19);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("https://grainy-gradients.vercel.app/noise.svg");
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  animation: orbFloat 9s ease-in-out infinite alternate;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: var(--orb-1);
  top: -180px;
  left: -90px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--orb-2);
  right: -180px;
  bottom: -220px;
  animation-delay: 1.5s;
}

.orb-3 {
  width: 420px;
  height: 420px;
  background: var(--orb-3);
  left: 35%;
  top: 28%;
  animation-delay: 3s;
}

@keyframes orbFloat {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(-12px) translateX(14px);
  }
}

.topbar,
.container,
.login-card,
.floating-theme {
  position: relative;
  z-index: 2;
}

.topbar {
  width: min(1280px, calc(100% - 24px));
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.2px;
}

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

.topbar-actions form {
  margin: 0;
}

.container {
  width: min(1280px, calc(100% - 24px));
  margin: 16px auto 28px;
  display: grid;
  gap: 14px;
}

.tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px;
  scrollbar-width: thin;
}

.tab-button {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.tab-button:hover {
  box-shadow: none;
  transform: none;
  border-color: var(--glass-border-light);
}

.tab-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--btn-brand-start), var(--btn-brand-end));
  box-shadow: 0 10px 22px var(--btn-brand-shadow);
}

.tab-panel {
  display: none;
  gap: 14px;
}

.tab-panel.active {
  display: grid;
}

.tab-panel.active > .card {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: panelCardAppear 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--panel-entry-index, 0) * 75ms);
}

.tab-panel.active > .card:nth-child(1) {
  --panel-entry-index: 0;
}

.tab-panel.active > .card:nth-child(2) {
  --panel-entry-index: 1;
}

.tab-panel.active > .card:nth-child(3) {
  --panel-entry-index: 2;
}

.tab-panel.active > .card:nth-child(4) {
  --panel-entry-index: 3;
}

.editor-page .container > .card {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: panelCardAppear 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--editor-entry-index, 0) * 75ms);
}

.editor-page .container > .card:nth-of-type(1) {
  --editor-entry-index: 0;
}

.editor-page .container > .card:nth-of-type(2) {
  --editor-entry-index: 1;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(820px circle at 0% 0%, var(--spotlight-color), transparent 40%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.32rem;
  letter-spacing: 0.2px;
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row form {
  margin: 0;
}

.row form button,
.row .button-link {
  min-height: 40px;
}

label {
  font-weight: 500;
  color: var(--label-color);
  font-size: 0.96rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text-main);
  background: var(--input-bg);
  outline: none;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.01);
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px var(--input-focus-ring);
}

button,
.button-link {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 13px;
  background: linear-gradient(135deg, var(--btn-brand-start), var(--btn-brand-end));
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px var(--btn-brand-shadow);
}

button.ghost,
.ghost-link {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--glass-border);
  color: var(--text-main);
  box-shadow: none;
}

button.ghost:hover,
.ghost-link:hover {
  border-color: var(--glass-border-light);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, var(--btn-danger-start), var(--btn-danger-end));
}

button.danger:hover {
  box-shadow: 0 8px 18px var(--btn-danger-shadow);
}

.tabs-nav .tab-button {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  box-shadow: none;
}

.tabs-nav .tab-button:hover {
  box-shadow: none;
  transform: none;
  border-color: var(--glass-border-light);
}

.tabs-nav .tab-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--btn-brand-start), var(--btn-brand-end));
  box-shadow: 0 10px 22px var(--btn-brand-shadow);
}

button.theme-switch {
  width: 110px;
  height: 46px;
  border-radius: 30px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 5px;
  transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] button.theme-switch {
  background: #5ab1f5;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.switch-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.6);
  position: absolute;
  left: 5px;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform: translateX(64px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

html[data-theme="light"] .switch-thumb {
  transform: translateX(0);
  background: #fcd34d;
  box-shadow: 0 0 15px rgba(252, 211, 77, 0.8);
}

.crater {
  position: absolute;
  background: #e2e8f0;
  border-radius: 50%;
  transition: opacity 0.4s ease;
}

.crater-1 {
  width: 8px;
  height: 8px;
  top: 8px;
  left: 18px;
}

.crater-2 {
  width: 5px;
  height: 5px;
  top: 20px;
  left: 10px;
}

.crater-3 {
  width: 6px;
  height: 6px;
  top: 22px;
  left: 22px;
}

html[data-theme="light"] .crater {
  opacity: 0;
}

.switch-decor {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.stars-container {
  position: absolute;
  width: 100%;
  height: 100%;
  transition: opacity 0.4s, transform 0.6s;
  opacity: 1;
  transform: translateY(0);
}

.s-star {
  position: absolute;
  color: white;
  transition: all 0.5s;
  font-size: 7px;
  line-height: 1;
}

.s-1 {
  top: 12px;
  left: 25px;
}

.s-2 {
  top: 22px;
  left: 40px;
}

.s-dot {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
}

.sd-1 {
  top: 18px;
  left: 16px;
}

.sd-2 {
  top: 32px;
  left: 30px;
}

.clouds-container {
  position: absolute;
  width: 100%;
  height: 100%;
  transition: opacity 0.4s, transform 0.6s;
  opacity: 0;
  transform: translateY(20px);
}

.cloud-puff {
  position: absolute;
  background: white;
  border-radius: 50%;
}

.cp-1 {
  width: 20px;
  height: 20px;
  bottom: 8px;
  right: 15px;
}

.cp-2 {
  width: 14px;
  height: 14px;
  bottom: 8px;
  right: 8px;
}

.cp-3 {
  width: 12px;
  height: 12px;
  bottom: 15px;
  right: 22px;
}

.cp-4 {
  width: 16px;
  height: 16px;
  bottom: 18px;
  right: 35px;
  background: rgba(255, 255, 255, 0.6);
}

.cp-5 {
  width: 10px;
  height: 10px;
  bottom: 15px;
  right: 45px;
  background: rgba(255, 255, 255, 0.6);
}

html[data-theme="light"] .stars-container {
  opacity: 0;
  transform: translateY(-20px);
}

html[data-theme="light"] .clouds-container {
  opacity: 1;
  transform: translateY(0);
}

.floating-theme {
  position: fixed;
  top: 16px;
  right: 16px;
}

.site-grid {
  display: block;
  column-count: 3;
  column-gap: 14px;
  
}

@media (max-width: 1180px) {
  .site-grid {
    column-count: 2;
  }

  .site-slide {
    flex-basis: calc((100% - 14px) / 2);
  }

  .site-name-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.site-slider-shell {
  display: grid;
  gap: 10px;
}

.site-slider-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.site-name-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  margin: 6px 0;
  padding: 2px 4px 6px 2px;
  scrollbar-width: thin;
}

.site-name-chip {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 34px;
  max-width: none;
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  animation: chipAppear 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--entry-index, 0) * 45ms);
}

.site-name-chip:hover {
  border-color: var(--glass-border-light);
  box-shadow: none;
  transform: none;
}

.site-name-chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--btn-brand-start), var(--btn-brand-end));
  box-shadow: 0 10px 22px var(--btn-brand-shadow);
}

.site-slider-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 0;
}

.preview-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.03);
}

.preview-mode-btn {
  min-height: 30px;
  border-radius: 9px;
  padding: 4px 10px;
  font-size: 0.78rem;
  line-height: 1.1;
}

.preview-mode-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--btn-brand-start), var(--btn-brand-end));
  box-shadow: 0 8px 18px var(--btn-brand-shadow);
}

.slider-mini-btn {
  min-height: 32px;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 10px;
}

.site-slider {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.site-card {
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 8px;
  background: var(--site-card-bg);
  position: relative;
  overflow: visible;
  align-content: start;
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

.site-slide {
  flex: 0 0 calc((100% - 14px) / 2);
  scroll-snap-align: start;
  width: auto;
  margin: 0;
  break-inside: auto;
  -webkit-column-break-inside: auto;
  page-break-inside: auto;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: cardAppear 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--entry-index, 0) * 65ms);
}

.site-preview {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(6, 10, 20, 0.7);
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  isolation: isolate;
}

.site-preview > iframe,
.site-preview > img,
.site-preview > .site-preview-fallback {
  position: absolute;
  inset: 0;
}

.site-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0) 65%
  );
  transform: translateX(-120%);
  animation: previewSweep 1.2s ease 0.35s 1 both;
  z-index: 2;
}

.site-preview iframe,
.site-preview img {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0f19;
  z-index: 1;
}

.site-preview img {
  object-fit: cover;
  display: block;
}

.site-preview-fallback {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  z-index: 1;
}

.site-preview [hidden] {
  display: none !important;
}

.preview-open-link {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(4, 8, 18, 0.75);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  z-index: 3;
}

.preview-open-link:hover {
  border-color: var(--glass-border-light);
}

.site-card.popup-open {
  z-index: 20;
}

.site-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.site-title-wrap {
  min-width: 0;
  flex: 1;
}

.site-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-form {
  margin: 0;
}

.icon-btn,
.site-toggle-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.icon-btn:hover,
.site-toggle-btn:hover {
  border-color: var(--glass-border-light);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: none;
}

.icon-btn.danger-tone {
  border-color: rgba(239, 68, 68, 0.35);
  color: #ffb7b7;
}

.site-toggle-btn {
  width: 44px;
}

.site-toggle-track {
  width: 28px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  padding: 1px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-toggle-bubble {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.site-toggle-btn.is-enabled .site-toggle-track {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.42);
}

.site-toggle-btn.is-enabled .site-toggle-bubble {
  transform: translateX(12px);
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.55);
}

.site-toggle-btn.is-disabled .site-toggle-track {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.42);
}

.site-toggle-btn.is-disabled .site-toggle-bubble {
  transform: translateX(0);
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.meta-line {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 2px 8px;
}

.site-section {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
  display: grid;
  gap: 8px;
}

.site-section h4 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--site-strong);
}

.compact-hint {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.compact-hint strong {
  color: var(--site-strong);
}

.status-ok {
  color: #22c55e;
}

.status-danger {
  color: #ef4444;
}

.service-create-launcher {
  overflow: visible;
}

.service-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.service-create-head h2 {
  margin: 0;
}

.service-create-trigger {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 999px;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.service-create-launcher.popup-open {
  z-index: 24;
}

.service-create-popup {
  top: 56px;
  right: 12px;
  width: min(760px, calc(100vw - 32px));
  max-height: min(82vh, 900px);
  overflow: auto;
  gap: 10px;
  padding: 14px;
  z-index: 26;
}

.service-create-popup hr {
  margin: 4px 0 2px;
  border: 0;
  border-top: 1px solid var(--glass-border);
}

.service-card {
  display: grid;
  gap: 12px;
}

.service-status-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.service-status-grid p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill-ok {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.status-pill-danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

.service-toggle-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.service-toggle-form {
  margin: 0;
}

.service-switch {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.service-switch:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--glass-border-light);
  background: rgba(255, 255, 255, 0.08);
}

.service-switch:active {
  transform: none;
}

.service-switch .site-toggle-track {
  width: 28px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  padding: 1px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.service-switch .site-toggle-bubble {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.service-switch.is-enabled .site-toggle-track {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.42);
}

.service-switch.is-enabled .site-toggle-bubble {
  transform: translateX(12px);
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.55);
}

.service-switch.is-disabled .site-toggle-track {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.42);
}

.service-switch.is-disabled .site-toggle-bubble {
  transform: translateX(0);
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.service-switch-text {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.service-switch.is-enabled .service-switch-text {
  color: #4ade80;
}

.service-switch.is-disabled .service-switch-text {
  color: #f87171;
}

.origin-popup {
  position: absolute;
  top: 48px;
  right: 8px;
  width: min(360px, calc(100vw - 32px), calc(100% - 16px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border-light);
  background: var(--popup-bg);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  z-index: 12;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top right;
  transition:
    opacity 0.22s ease,
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.24s;
}

.origin-popup.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.origin-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.origin-popup-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.popup-close-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.site-card h3 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.1;
  letter-spacing: 0.15px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-card p {
  margin: 0;
  color: var(--site-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-card strong {
  color: var(--site-strong);
}

.show-more-btn {
  width: auto;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  margin-top: 2px;
  justify-self: start;
  align-self: start;
}

.site-more {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.36s ease, opacity 0.24s ease, transform 0.3s ease;
}

.site-more[hidden] {
  display: none !important;
}

.site-more.open {
  max-height: 2400px;
  opacity: 1;
  transform: translateY(0);
}

.hint {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.ip-line {
  margin: 0 0 10px;
  color: var(--site-text);
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  transform: scale(1.05);
}

.flash-list {
  display: grid;
  gap: 8px;
}

.flash {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

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

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

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(460px, 94vw);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 24px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  animation: panelCardAppear 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-card h1 {
  margin: 0;
  font-size: 2rem;
}

.login-card p {
  margin: 8px 0 14px;
  color: var(--text-muted);
}

code {
  background: var(--code-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 2px 6px;
  color: var(--code-color);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  display: inline-block;
  max-width: 100%;
}

.code-area {
  min-height: 520px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  line-height: 1.45;
  font-size: 0.9rem;
  color: var(--code-area-color);
  background: var(--code-area-bg);
}

@keyframes chipAppear {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardAppear {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panelCardAppear {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes previewSweep {
  to {
    transform: translateX(140%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-page .container > .card,
  .tab-panel.active > .card,
  .login-card,
  .site-name-chip,
  .site-slide,
  .site-preview::after {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .site-more,
  .origin-popup {
    transition: none !important;
    transform: none;
  }
}

@media (max-width: 720px) {
  .topbar,
  .container {
    width: calc(100% - 16px);
  }

  .topbar {
    margin-top: 8px;
    padding: 12px 14px;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .tabs-nav {
    margin-top: 2px;
    padding-bottom: 2px;
  }

  .tab-button {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.93rem;
  }

  .card {
    padding: 14px;
    border-radius: 16px;
  }

  .card h2 {
    font-size: 1.12rem;
  }

  .row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .row form,
  .row .button-link {
    width: 100%;
  }

  .row form button,
  .row .button-link {
    width: 100%;
  }

  .site-grid {
    column-count: 1;
  }

  .site-name-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 4px 0;
    padding-bottom: 6px;
  }

  .service-create-popup {
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 74vh;
  }

  .site-slider-head {
    gap: 6px;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-slider-controls {
    width: 100%;
    justify-content: space-between;
  }

  .preview-mode-toggle {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .preview-mode-btn {
    flex: 1 1 0;
  }

  .site-slider {
    gap: 10px;
  }

  .site-slide {
    flex-basis: 100%;
  }

  .site-card {
    padding: 12px;
  }

  .site-card-head {
    gap: 8px;
  }

  .site-card h3 {
    font-size: 1.35rem;
  }

  input,
  textarea,
  select,
  button,
  .button-link {
    font-size: 16px;
  }

  .floating-theme {
    top: 10px;
    right: 10px;
  }
}
