:root {
  --bg: #f6f5f1;
  --bg-alt: #eceefa;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --text: #10141f;
  --text-soft: #40424f;
  --muted: #5c6270;
  --border: #e4e2da;
  --border-soft: #eff0f8;
  --accent: #2742f5;
  --accent-2: #5c6bf5;
  --accent-dark: #1c33d6;
  --accent-soft: #e8ebfe;
  --ring: rgba(39, 66, 245, 0.3);
  --success: #1dbf6e;
  --success-soft: #e3f8ee;
  --error: #e05b4e;
  --error-soft: #fdeceb;
  --warn: #e8a13c;
  --warn-soft: #fdf1de;
  --code-bg: #14151c;
  --code-text: #e7e8f1;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.05);
  --shadow: 0 6px 20px rgba(24, 20, 60, 0.07);
  --shadow-lg: 0 20px 60px rgba(24, 20, 60, 0.16);
  --font: "Outfit", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #151514;
  --bg-alt: #14151d;
  --surface: #1e1e1c;
  --surface-2: #262624;
  --text: #f5f4ef;
  --text-soft: #c7c9d6;
  --muted: #a6a49d;
  --border: #33332f;
  --border-soft: #1f212b;
  --accent: #2742f5;
  --accent-2: #5c6bf5;
  --accent-dark: #1c33d6;
  --accent-soft: #1e2550;
  --ring: rgba(39, 66, 245, 0.35);
  --success: #34d081;
  --success-soft: #16281e;
  --error: #ec7669;
  --error-soft: #2e1a1a;
  --warn: #f0b429;
  --warn-soft: #302512;
  --code-bg: #0a0b10;
  --code-text: #d8dae6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ---------- Shared bits ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px rgba(39, 66, 245, 0.35);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 20px !important;
}

.ghost-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: all 0.15s ease;
}

.ghost-icon-btn:hover {
  border-color: var(--border);
  color: var(--accent);
  background: var(--surface-2);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--accent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 38%, transparent);
}

.primary-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ---------- Scrollbars ---------- */

.chat-scroll::-webkit-scrollbar,
.dashboard-main::-webkit-scrollbar,
.dashboard-scroll::-webkit-scrollbar,
.project-log-box::-webkit-scrollbar {
  width: 8px;
}

.chat-scroll::-webkit-scrollbar-thumb,
.dashboard-main::-webkit-scrollbar-thumb,
.dashboard-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}

.project-log-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

/* ================= WEBSITES GRID (shared by the dashboard) ================= */

.project-card-cloud-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-projects {
  text-align: center;
  padding: 4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(39, 66, 245, 0.35);
  margin-bottom: 1.2rem;
}

.empty-projects h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.empty-projects p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ================= CREATE WEBSITE VIEW ================= */

.header-spacer {
  width: 34px;
  flex-shrink: 0;
}

.create-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.create-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.create-card {
  width: 100%;
  max-width: 460px;
  height: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.75rem 1.5rem;
  animation: rise 0.3s ease both;
}

/* ================= PROJECT VIEW ================= */

.project-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 60px;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.back-btn:hover {
  color: var(--accent);
  background: var(--bg-alt);
}

.breadcrumb-sep {
  color: var(--border);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.project-header-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.project-header-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-status-pill {
  flex-shrink: 0;
}

.project-header-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.status-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status-pill:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.status-pill:focus-visible,
.ghost-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.live-pill {
  border-color: var(--success-soft);
  background: var(--success-soft);
  color: var(--success);
  font-weight: 700;
}

.live-pill:hover {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(23, 163, 74, 0.28);
}

.live-pill:hover .live-dot {
  background: #fff;
  animation: none;
}

.live-pill .pill-arrow {
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.live-pill:hover .pill-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse 1.8s infinite ease-in-out;
}

/* ---------- Discard changes button ---------- */

.discard-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.discard-btn:hover:not(:disabled) {
  background: var(--bg-alt);
  border-color: var(--error);
  color: var(--error);
}

.discard-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Publish button ---------- */

.publish-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 6px 18px rgba(39, 66, 245, 0.32);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.publish-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(39, 66, 245, 0.4);
}

.publish-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.publish-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring), 0 6px 18px rgba(39, 66, 245, 0.32);
}

.publish-btn:disabled {
  cursor: not-allowed;
}

.publish-btn.busy {
  background: linear-gradient(135deg, var(--warn), var(--warn));
  box-shadow: none;
}

.publish-btn.busy .publish-btn-icon {
  animation: spin 1s linear infinite;
}

.publish-btn.published {
  background: linear-gradient(135deg, var(--success), var(--success));
  box-shadow: none;
}

.publish-btn.needs-publish {
  position: relative;
  background: linear-gradient(135deg, var(--warn), #c77a12);
  box-shadow: 0 6px 18px rgba(214, 138, 26, 0.35);
}

.publish-btn.needs-publish:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(214, 138, 26, 0.42);
}

.publish-btn.needs-publish::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--warn);
  animation: pulse 1.8s infinite ease-in-out;
}

.publish-caption {
  font-size: 0.72rem;
  color: var(--muted);
  min-height: 1em;
  max-width: 220px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Unpublished changes banner ---------- */

.unpublished-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  animation: banner-in 0.2s ease;
}

.unpublished-banner-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
  animation: pulse 1.8s infinite ease-in-out;
}

.unpublished-banner-text {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}

.unpublished-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--warn);
  background: transparent;
  color: var(--warn);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.unpublished-banner-btn:hover {
  background: var(--warn);
  color: #fff;
  transform: translateY(-1px);
}

.unpublished-banner-btn:active {
  transform: translateY(0) scale(0.98);
}

.unpublished-banner-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.unpublished-banner-dismiss:hover {
  background: var(--bg-alt);
  color: var(--text-soft);
}

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

.history-btn {
  width: 36px;
  height: 36px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Split layout ---------- */

.split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 420px 1fr;
}

.builder-left-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.builder-tabs {
  display: inline-flex;
  gap: 2px;
  margin: 1rem 1.25rem 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  flex-shrink: 0;
}

.builder-tab-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.builder-tab-btn:hover {
  color: var(--text);
}

.builder-tab-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.chat-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.chat-dropzone-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(2px);
  pointer-events: none;
  animation: chatDropzoneIn 0.15s ease both;
}

@keyframes chatDropzoneIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chat-dropzone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 320px;
  padding: 2rem 1.25rem;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  text-align: center;
}

.chat-dropzone-card p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.pages-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.pages-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.page-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.page-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.page-row-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.page-row-path {
  color: var(--muted);
  font-size: 0.8rem;
}

.page-status-pill {
  flex-shrink: 0;
}

.page-row-edit {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.82rem;
}

.pages-panel-footer {
  flex-shrink: 0;
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--border);
}

.add-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.add-page-btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

.chat-scroll:empty::before {
  content: "Describe the site you want, or a change to make, and I'll get started.";
  margin: auto;
  max-width: 240px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.preview-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface-2);
}

/* ---------- Chat messages ---------- */

.chat-turn {
  margin-bottom: 1.5rem;
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.user-msg {
  justify-content: flex-end;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.avatar-user {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.avatar-assistant {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 3px 10px rgba(39, 66, 245, 0.3);
}

.avatar-spark {
  width: 9px;
  height: 9px;
  background: #fff;
  border-radius: 3px;
  opacity: 0.95;
  transform: rotate(45deg);
}

.msg-bubble {
  max-width: 260px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  padding: 0.65rem 0.9rem;
}

.msg-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #fff;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-attachments {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  word-break: break-word;
}

.msg-content {
  flex: 1;
  min-width: 0;
  max-width: 320px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
  padding: 0.6rem 0.85rem;
}

.gen-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 26px;
}

.dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.4s infinite ease-in-out both;
}

.dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0.4);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.gen-status-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gen-timer {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

.gen-summary {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.gen-error {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding: 0.65rem 0.8rem;
  background: var(--error-soft);
  color: var(--error);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
}

.gen-error-text {
  margin: 0;
  line-height: 1.5;
}

/* System (activity) messages: GitHub push / Cloudflare deploy */

.system-turn {
  margin-bottom: 1.1rem;
}

.system-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 auto;
  max-width: 100%;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
}

.system-msg-icon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.system-turn.busy .system-msg-icon {
  background: var(--warn);
  animation: pulse 1.2s infinite ease-in-out;
}

.system-turn.success .system-msg {
  color: var(--success);
  border-color: var(--success-soft);
}

.system-turn.success .system-msg-icon {
  background: var(--success);
}

.system-turn.error .system-msg {
  color: var(--error);
  border-color: var(--error-soft);
}

.system-turn.error .system-msg-icon {
  background: var(--error);
}

.system-msg-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- Composer ---------- */

.composer {
  padding: 0.9rem 1.25rem 1.1rem;
  flex-shrink: 0;
}

.qchips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.qchip {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.qchip:hover {
  border-color: var(--muted);
  color: var(--text);
}

.qchip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.composer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 0.55rem 0.65rem 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.composer-card:has(.composer-input:disabled) {
  background: var(--bg-alt);
  opacity: 0.75;
}

.composer-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  padding: 0.1rem 0.5rem 0.35rem;
  max-height: 160px;
  font-family: inherit;
}

.composer-input:disabled {
  cursor: not-allowed;
}

.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.1rem 0.35rem 0;
}

.composer-hint {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-hint kbd {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05rem 0.3rem;
  font-size: 0.66rem;
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(39, 66, 245, 0.4);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.attach-btn:hover:not(:disabled) {
  border-color: var(--muted);
  color: var(--text);
}

.attach-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-attachments {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.chat-attachments-error {
  font-size: 0.78rem;
  color: var(--error);
  margin: 0 0 0.5rem;
}

/* ---------- Preview pane ---------- */

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.toolbar-url {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.toolbar-url:empty {
  display: none;
}

.toolbar-url::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
}

.toolbar-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem 0.4rem 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.toolbar-edit-btn svg {
  flex-shrink: 0;
}

.toolbar-edit-btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.toolbar-edit-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar-edit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toolbar-changes-pill {
  flex-shrink: 0;
}

.toolbar-spacer {
  flex: 1;
}

.viewport-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.viewport-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

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

.viewport-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--accent);
}

.icon-btn.run-btn:hover {
  color: var(--success);
}

.icon-btn.stop-btn:hover {
  color: var(--error);
}

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

.icon-btn .spin {
  animation: spin 1s linear infinite;
}

.icon-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Create project modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(13, 14, 19, 0.45);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.16s ease;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem 1.75rem 1.5rem;
  animation: modal-pop-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text);
}

.modal-header {
  padding-right: 1.5rem;
  margin-bottom: 1.3rem;
}

.modal-header-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px rgba(39, 66, 245, 0.35);
  color: #fff;
  margin-bottom: 0.7rem;
}

.modal-header h2 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.game-modal-card {
  max-width: 400px;
  height: min(660px, calc(100vh - 3rem));
  padding: 0;
  overflow: hidden;
  background: #d9d6c8;
}

.game-modal-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

.game-modal-close-btn {
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(35, 36, 24, 0.35);
  color: #efe9d6;
  border: 1px solid rgba(239, 233, 214, 0.25);
}

.game-modal-close-btn:hover {
  background: rgba(35, 36, 24, 0.55);
  border-color: rgba(239, 233, 214, 0.4);
  color: #fff;
}

.modal-field {
  margin-bottom: 1rem;
}

.modal-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.modal-field-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.modal-input,
.modal-textarea,
.modal-select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.modal-input.available {
  border-color: var(--success);
}

.modal-input.available:focus {
  box-shadow: 0 0 0 3px var(--success-soft);
}

.modal-input.taken {
  border-color: var(--error);
}

.modal-input.taken:focus {
  box-shadow: 0 0 0 3px var(--error-soft);
}

.modal-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.modal-name-status {
  min-height: 1rem;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.4rem;
  padding-left: 0.1rem;
}

.modal-name-status.checking {
  color: var(--muted);
}

.modal-name-status.available {
  color: var(--success);
}

.modal-name-status.taken {
  color: var(--error);
}

.modal-input-wrap {
  position: relative;
}

.modal-input-wrap .modal-input {
  padding-right: 2.4rem;
}

.modal-input-status-icon {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.modal-input-status-icon--valid {
  color: var(--success);
}

.modal-input-status-icon--invalid {
  color: var(--error);
}

.modal-input-status-icon--warn {
  color: var(--warn);
}

.modal-input-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.modal-input-toggle-btn:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.modal-suggest-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.modal-suggest-btn:hover {
  text-decoration: underline;
}

.domain-type-guide {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 1.2rem;
}

.domain-type-guide-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
}

.domain-type-guide-item h4 {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.domain-type-guide-item p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.domain-type-guide-item code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.domain-type-guide-badge {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  margin-top: 0.1rem;
}

.domain-type-guide-badge--recommended {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.modal-cancel-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  transition: all 0.15s ease;
}

.modal-cancel-btn:hover {
  background: var(--bg-alt);
  border-color: var(--muted);
}

.modal-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Create form: optional details + style picker ---------- */

.create-card--wide {
  max-width: 700px;
}

.modal-optional-tag {
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
}

.modal-field-hint {
  margin: -0.15rem 0 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.modal-cover-preview {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.modal-cover-preview-img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.timezone-picker {
  position: relative;
}

.timezone-picker-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.timezone-picker-trigger:hover,
.timezone-picker-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}

.timezone-picker-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timezone-picker-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.timezone-picker-search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  outline: none;
  padding: 0.65rem 0.75rem;
}

.timezone-picker-options {
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.3rem;
}

.timezone-picker-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.5rem 0.55rem;
  text-align: left;
}

.timezone-picker-option:hover,
.timezone-picker-option.selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.timezone-picker-empty {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.75rem 0.55rem;
}

.modal-field-hint {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

/* Ties the trial-credits field visually to the free-trial toggle above it,
   since it only ever appears once a trial is actually configured. */
.modal-field--trial-credits {
  padding: 0.85rem 0.9rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid transparent;
}

/* ---------- $-prefixed number inputs (plan pricing fields) ---------- */

.modal-input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.modal-input-prefix {
  position: absolute;
  left: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
}

.modal-input-prefixed {
  padding-left: 1.6rem;
}

/* ---------- %-suffixed number inputs (yearly discount field) ---------- */

.modal-input-suffix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.modal-input-suffix {
  position: absolute;
  right: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
}

.modal-input-suffixed {
  padding-right: 1.8rem;
}

.modal-field--yearly-discount {
  padding: 0.85rem 0.9rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid transparent;
}

/* ---------- Rich text editor (plan description) ---------- */

.rich-text-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rich-text-editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.rich-text-toolbar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.rich-text-toolbar-btn {
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.4rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.rich-text-toolbar-btn:hover {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text);
}

.rich-text-editor-body {
  min-height: 90px;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  outline: none;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.rich-text-editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.rich-text-editor-body p {
  margin: 0 0 0.5em;
}

.rich-text-editor-body ul,
.rich-text-editor-body ol {
  margin: 0 0 0.5em;
  padding-left: 1.3em;
}

.rich-text-editor-body a {
  color: var(--accent);
}

.plan-card-description {
  margin: 0;
}

.plan-card-description p {
  margin: 0 0 0.4em;
}

.plan-card-description ul,
.plan-card-description ol {
  margin: 0 0 0.4em;
  padding-left: 1.2em;
}

.plan-card-description a {
  color: var(--accent);
}

@media (max-width: 560px) {
  .modal-field-row {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0.75rem;
  }

  .modal-card {
    max-height: calc(100vh - 1.5rem);
    padding: 1.35rem 1.1rem 1.1rem;
  }

  .modal-footer {
    justify-content: stretch;
  }

  .modal-footer button {
    flex: 1;
  }
}

/* ---------- Facebook publishing workspace ---------- */
.facebook-eyebrow { display: flex; align-items: center; gap: 0.42rem; margin-bottom: 0.35rem; color: var(--accent); font-size: 0.63rem; font-weight: 800; letter-spacing: 0.08em; }
.facebook-eyebrow-dot { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.facebook-mode-switcher { display: flex; align-items: center; gap: 0.3rem; margin-bottom: 1rem; padding: 0.28rem; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.facebook-mode-switcher button { padding: 0.55rem 0.8rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.facebook-mode-switcher button.active { background: var(--accent-soft); color: var(--accent); }
.facebook-mode-note { margin-left: auto; padding-right: 0.65rem; color: var(--muted); font-size: 0.67rem; }
.facebook-workspace-header { display: flex; align-items: center; gap: 0.7rem; min-width: 0; margin-bottom: 1rem; padding: 0.28rem; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-sm); }
.facebook-workspace-header .facebook-mode-switcher { flex: 0 0 auto; margin: 0; padding: 0; border: 0; box-shadow: none; }
.facebook-workspace-sections { display: flex; min-width: 0; flex: 1; gap: 0.1rem; overflow-x: auto; scrollbar-width: thin; }
.facebook-workspace-sections button { flex: 0 0 auto; padding: 0.55rem 0.58rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 0.68rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.facebook-workspace-sections button:hover { color: var(--text); background: var(--surface-2); }
.facebook-workspace-sections button.active { border-bottom-color: var(--accent); color: var(--accent); }
.facebook-mode-note-banner { margin: -0.35rem 0 1rem; padding: 0.65rem 0.8rem; border-radius: 8px; background: var(--accent-soft); font-size: 0.7rem; }
.facebook-composer-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 1rem; align-items: start; margin-bottom: 1.5rem; }
.facebook-composer-grid.facebook-schedule-view { display: block; }
.facebook-schedule-view .facebook-composer-card { display: none; }
.facebook-schedule-view .facebook-preview-column { width: 100%; }
.facebook-schedule-view .facebook-upcoming-planner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 0.75rem 1rem; max-width: none; }
.facebook-schedule-view .facebook-upcoming-planner > .facebook-preview-label { grid-column: 1 / -1; margin-bottom: -0.2rem; }
.facebook-schedule-view .facebook-upcoming-planner > .facebook-schedule-calendar-card { grid-column: 2; }
.facebook-schedule-view .facebook-upcoming-planner > .facebook-upcoming-list { grid-column: 1; grid-row: 2; margin-top: 0; }
.facebook-composer-card { gap: 1.15rem; }
.facebook-card-title { display: flex; align-items: flex-start; justify-content: space-between; }
.facebook-card-title > div > span, .facebook-preview-label { color: var(--accent); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; }
.facebook-card-title h3 { margin: 0.22rem 0 0; color: var(--text); font-size: 1rem; }
.facebook-compose-spark { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; }
.facebook-schedule-field small { align-self: flex-end; color: var(--muted); font-size: 0.65rem; }
.facebook-dropzone { align-items: center; justify-content: center; min-height: 7.5rem; text-align: center; }
.facebook-dropzone strong { font-size: 0.8rem; }
.facebook-upload-icon { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; font-weight: 800; }
.facebook-dropzone input { max-width: 100%; }
.facebook-preview-column { min-width: 0; }
.facebook-preview-label { display: flex; justify-content: space-between; margin: 0 0 0.55rem 0.2rem; }
.facebook-preview-label span { color: var(--muted); font-size: 0.65rem; font-weight: 500; letter-spacing: 0; }
.facebook-preview-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.facebook-preview-profile { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem; }
.facebook-preview-profile > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 0.08rem; }
.facebook-preview-profile strong { overflow: hidden; color: var(--text); font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.facebook-preview-profile span:not(.facebook-preview-avatar) { color: var(--muted); font-size: 0.63rem; }
.facebook-preview-profile b { color: var(--muted); letter-spacing: 0.1rem; }
.facebook-preview-avatar { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; background: #2374e1; color: white; font-size: 1rem; font-weight: 800; object-fit: cover; }
.facebook-preview-message { min-height: 3.4rem; margin: 0; padding: 0 0.9rem 0.8rem; color: var(--text-soft); font-size: 0.78rem; line-height: 1.5; }
.facebook-preview-image { display: block; width: 100%; max-height: 18rem; object-fit: cover; }
.facebook-preview-placeholder { display: flex; min-height: 13rem; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; background: linear-gradient(145deg, var(--accent-soft), var(--surface-2)); color: var(--muted); }
.facebook-preview-placeholder span { color: var(--accent); font-size: 1.8rem; }
.facebook-preview-placeholder strong { color: var(--text); font-size: 0.76rem; }
.facebook-preview-placeholder small { font-size: 0.65rem; }
.facebook-preview-actions { display: flex; justify-content: space-around; padding: 0.7rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.68rem; font-weight: 700; }
.facebook-calendar-column { min-width: 0; }
.facebook-schedule-calendar-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.facebook-schedule-calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.9rem; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.facebook-schedule-calendar-toolbar span { color: var(--accent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; }
.facebook-schedule-calendar-toolbar h3 { margin: 0.2rem 0 0; color: var(--text); font-size: 0.92rem; }
.facebook-calendar-controls { display: flex; gap: 0.25rem; }
.facebook-calendar-controls button { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; font-size: 1.15rem; line-height: 1; }
.facebook-calendar-controls button:hover { border-color: var(--accent); color: var(--accent); }
.facebook-calendar-weekdays, .facebook-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.facebook-calendar-weekdays { padding: 0.55rem 0.55rem 0.35rem; color: var(--muted); font-size: 0.56rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.facebook-calendar-day { position: relative; min-height: 3.7rem; padding: 0.32rem; border-top: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--surface); }
.facebook-calendar-day-hovercard { position: absolute; z-index: 20; top: calc(100% + 0.6rem); left: 50%; display: flex; width: 16rem; max-width: min(16rem, 90vw); max-height: 22rem; flex-direction: column; gap: 0.55rem; overflow-y: auto; padding: 0.65rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18); transform: translateX(-50%); pointer-events: none; animation: facebook-hovercard-in 0.12s ease-out; }
.facebook-calendar-day-hovercard::before { position: absolute; top: -0.4rem; left: 50%; width: 0.75rem; height: 0.75rem; border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 2px; background: var(--surface); content: ""; transform: translateX(-50%) rotate(45deg); }
.facebook-calendar-day-hovercard.align-left { left: 0; transform: none; }
.facebook-calendar-day-hovercard.align-left::before { left: 1.2rem; transform: rotate(45deg); }
.facebook-calendar-day-hovercard.align-right { left: auto; right: 0; transform: none; }
.facebook-calendar-day-hovercard.align-right::before { left: auto; right: 1.2rem; transform: rotate(45deg); }
.facebook-calendar-day-hovercard.upward { top: auto; bottom: calc(100% + 0.6rem); }
.facebook-calendar-day-hovercard.upward::before { top: auto; bottom: -0.4rem; border-top: 0; border-left: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@keyframes facebook-hovercard-in { from { opacity: 0; transform: translate(-50%, 0.25rem); } to { opacity: 1; transform: translate(-50%, 0); } }
.facebook-calendar-day-hovercard.align-left, .facebook-calendar-day-hovercard.align-right { animation-name: facebook-hovercard-in-plain; }
@keyframes facebook-hovercard-in-plain { from { opacity: 0; transform: translateY(0.25rem); } to { opacity: 1; transform: translateY(0); } }
.facebook-calendar-hovercard-item { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); text-align: left; }
.facebook-calendar-hovercard-image { width: 100%; height: 6.5rem; border-radius: 8px; object-fit: cover; }
.facebook-calendar-hovercard-body { display: flex; flex-direction: column; gap: 0.3rem; }
.facebook-calendar-hovercard-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.facebook-calendar-hovercard-time { color: var(--accent); font-size: 0.64rem; font-weight: 800; }
.facebook-calendar-hovercard-message { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow-wrap: anywhere; color: var(--text); font-size: 0.7rem; line-height: 1.45; }
.facebook-calendar-hovercard-readmore { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.66rem; font-weight: 700; cursor: pointer; pointer-events: auto; }
.facebook-calendar-hovercard-readmore:hover { text-decoration: underline; }
.facebook-calendar-hovercard-page { overflow: hidden; max-width: 7rem; color: var(--muted); font-size: 0.58rem; font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.facebook-calendar-day:nth-child(7n) { border-right: 0; }
.facebook-calendar-day.empty { background: var(--surface-2); opacity: 0.45; }
.facebook-calendar-grid { border-radius: 0 0 var(--radius) var(--radius); }
.facebook-calendar-day:last-child { border-bottom-right-radius: var(--radius); }
.facebook-calendar-day:nth-last-child(7) { border-bottom-left-radius: var(--radius); }
.facebook-calendar-date { display: block; margin-bottom: 0.22rem; color: var(--text-soft); font-size: 0.62rem; font-weight: 700; }
.facebook-calendar-event { position: relative; display: block; overflow: visible; margin-top: 0.16rem; padding: 0.16rem 0.22rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 0.52rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.facebook-calendar-more { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.5rem; }
.facebook-upcoming-list { margin-top: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.facebook-upcoming-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); }
.facebook-upcoming-list-heading strong { color: var(--text); font-size: 0.72rem; }
.facebook-upcoming-list-heading span { color: var(--muted); font-size: 0.62rem; }
.facebook-upcoming-item { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); }
.facebook-upcoming-item:last-child { border-bottom: 0; }
.facebook-upcoming-dot { flex: 0 0 auto; width: 0.42rem; height: 0.42rem; margin-top: 0.28rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.facebook-upcoming-item div { display: flex; min-width: 0; flex-direction: column; gap: 0.18rem; }
.facebook-upcoming-item strong { overflow-wrap: anywhere; color: var(--text-soft); font-size: 0.68rem; line-height: 1.35; }
.facebook-upcoming-item span:not(.facebook-upcoming-dot) { color: var(--muted); font-size: 0.6rem; }
.facebook-upcoming-actions { display: flex !important; flex: 0 0 auto; flex-direction: row !important; align-items: center; gap: 0.18rem !important; margin-left: auto; }
.facebook-upcoming-icon { display: grid; width: 1.9rem; height: 1.9rem; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.facebook-upcoming-icon svg { width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.facebook-upcoming-icon:hover { border-color: var(--border); background: var(--surface-2); color: var(--accent); }
.facebook-upcoming-icon.danger:hover { border-color: var(--error-soft); color: var(--error); }
.facebook-upcoming-empty { margin: 0; padding: 0.8rem; color: var(--muted); font-size: 0.68rem; line-height: 1.45; }
.scheduled-post-detail-modal { max-width: 680px; }
.scheduled-post-detail-modal .facebook-post-modal-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.scheduled-post-detail-image { display: block; width: 100%; max-height: 26rem; margin: 0 0 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); object-fit: contain; }
.modal-image-preview { display: block; width: 100%; max-height: 14rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); object-fit: contain; }
.modal-file-input-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.modal-image-attachment { display: flex; flex-direction: column; gap: 0.6rem; }
.modal-image-attachment-actions { display: flex; gap: 0.5rem; }
.modal-image-replace-btn, .modal-image-remove-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.45rem 0.9rem; border-radius: 8px; font: inherit; font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.modal-image-replace-btn { border: 1px solid var(--accent); background: transparent; color: var(--accent); }
.modal-image-replace-btn:hover { background: var(--accent-soft); }
.modal-image-remove-btn { border: 1px solid var(--border); background: transparent; color: var(--error); }
.modal-image-remove-btn:hover { background: var(--error-soft); border-color: var(--error-soft); }
.instagram-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.6rem; }
.instagram-media-item { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); aspect-ratio: 1; }
.instagram-media-item img, .instagram-media-item video { display: block; width: 100%; height: 100%; object-fit: cover; }
.instagram-media-item-badge { position: absolute; top: 0.35rem; left: 0.35rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.instagram-media-item-remove { position: absolute; top: 0.35rem; right: 0.35rem; display: grid; width: 1.4rem; height: 1.4rem; place-items: center; border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.75rem; line-height: 1; cursor: pointer; }
.instagram-media-item-remove:hover { background: var(--error); }
.instagram-media-add-tile { display: grid; place-items: center; aspect-ratio: 1; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.instagram-media-add-tile:hover { border-color: var(--accent); color: var(--accent); }
.instagram-media-add-tile input { display: none; }
.facebook-insights-panel { margin-top: 1rem; margin-bottom: 1.5rem; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.facebook-insights-tabs { display: flex; gap: 0.1rem; overflow-x: auto; padding: 0 0.7rem; border-bottom: 1px solid var(--border); }
.facebook-insights-tabs button { flex: 0 0 auto; padding: 0.8rem 0.65rem 0.7rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 0.68rem; font-weight: 700; cursor: pointer; }
.facebook-insights-tabs button.active { border-bottom-color: var(--accent); color: var(--accent); }
.facebook-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.facebook-metric-grid > div { min-height: 6.7rem; padding: 1rem; border-right: 1px solid var(--border); }
.facebook-metric-grid > div:last-child { border-right: 0; }
.facebook-metric-grid span { display: block; color: var(--muted); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em; }
.facebook-metric-grid strong { display: block; margin: 0.5rem 0 0.25rem; color: var(--text); font-size: 1.35rem; letter-spacing: -0.04em; }
.facebook-metric-grid small { color: var(--muted); font-size: 0.63rem; }
.facebook-metric-grid .metric-up { color: var(--success); font-weight: 700; }
.facebook-empty-insight { display: flex; min-height: 8rem; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; text-align: center; }
.facebook-empty-insight span { color: var(--accent); font-size: 1.5rem; }
.facebook-empty-insight strong { margin-top: 0.35rem; color: var(--text); font-size: 0.8rem; }
.facebook-empty-insight p { max-width: 28rem; margin: 0.3rem 0 0; color: var(--muted); font-size: 0.7rem; }
.facebook-permission-warning { display: flex; flex-direction: column; gap: 0.2rem; margin: 1rem 1.1rem 0; padding: 0.75rem 0.85rem; border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); border-radius: 9px; background: var(--warn-soft); color: var(--text); }
.facebook-permission-warning strong { font-size: 0.72rem; }
.facebook-permission-warning span { color: var(--muted); font-size: 0.68rem; line-height: 1.45; }
.facebook-section-heading, .facebook-table-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem 0; }
.facebook-section-heading > div > span { color: var(--accent); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; }
.facebook-section-heading h3, .facebook-table-heading h3 { margin: 0.25rem 0 0; color: var(--text); font-size: 0.9rem; }
.facebook-section-heading small, .facebook-table-heading span { color: var(--muted); font-size: 0.66rem; }
.facebook-posts-section, .facebook-section-detail { margin-top: 0.8rem; border-top: 1px solid var(--border); }
.facebook-posts-table-wrap { overflow-x: auto; padding: 0.7rem 1.1rem 1.1rem; }
.facebook-posts-table { width: 100%; border-collapse: collapse; color: var(--text); font-size: 0.7rem; }
.facebook-posts-table th { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.6rem; font-weight: 800; text-align: left; text-transform: uppercase; white-space: nowrap; }
.facebook-posts-table td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.facebook-posts-table tbody tr:last-child td { border-bottom: 0; }
.facebook-posts-table td:first-child { min-width: 18rem; white-space: normal; }
.facebook-posts-table td:first-child strong, .facebook-posts-table td:first-child span { display: block; }
.facebook-posts-table td:first-child strong { color: var(--text); font-size: 0.72rem; }
.facebook-posts-table td:first-child span { margin-top: 0.2rem; color: var(--muted); font-size: 0.6rem; }
.facebook-post-cell { display: flex; align-items: center; gap: 0.65rem; min-width: 18rem; }
.facebook-post-cell > div { min-width: 0; }
.facebook-post-thumbnail { display: block; flex: 0 0 2.7rem; width: 2.7rem; height: 2.7rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); object-fit: cover; }
.facebook-post-thumbnail-empty { display: grid; place-items: center; font-size: 1rem; }
.facebook-post-view { padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--accent); font: inherit; font-size: 0.65rem; font-weight: 700; cursor: pointer; }
.facebook-post-view:hover { background: var(--accent-soft); }
.facebook-post-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; padding: 0 1.1rem 1rem; color: var(--muted); font-size: 0.68rem; }
.facebook-post-pagination button { padding: 0.38rem 0.65rem; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.66rem; font-weight: 700; cursor: pointer; }
.facebook-post-pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.facebook-post-pagination button:disabled { cursor: not-allowed; opacity: 0.45; }
.facebook-posts-empty { padding: 2rem 1rem; color: var(--muted); text-align: center; font-size: 0.75rem; }
.facebook-section-loading { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.facebook-section-detail > strong { display: block; padding: 1rem 1.1rem 0; color: var(--text); font-size: 0.9rem; }
.facebook-section-detail > p { margin: 0.35rem 1.1rem; color: var(--muted); font-size: 0.72rem; }
.facebook-post-modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.5rem; background: rgb(12 17 30 / 48%); backdrop-filter: blur(3px); }
.facebook-post-modal { display: flex; width: min(100%, 560px); max-height: min(90vh, 760px); flex-direction: column; gap: 0.9rem; overflow: auto; padding: 1.2rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.facebook-post-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.facebook-post-modal-header span { color: var(--accent); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; }
.facebook-post-modal-header h3 { margin: 0.25rem 0 0; color: var(--text); font-size: 1rem; }
.facebook-post-modal-header button { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.facebook-post-modal-image { display: block; width: 100%; max-height: 24rem; border-radius: 10px; background: var(--surface-2); object-fit: contain; }
.facebook-post-modal-message { margin: 0; color: var(--text); font-size: 0.84rem; line-height: 1.55; white-space: pre-wrap; }
.facebook-post-modal-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.68rem; }
.facebook-post-modal-link { align-self: flex-start; color: var(--accent); font-size: 0.72rem; font-weight: 700; text-decoration: none; }
.facebook-post-modal-link:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .facebook-post-modal-backdrop { padding: 0.7rem; }
  .facebook-post-modal { max-height: 92vh; padding: 1rem; border-radius: 13px; }
  .facebook-post-modal-image { max-height: 18rem; }
}
@media (max-width: 760px) {
  .facebook-composer-grid { grid-template-columns: 1fr; }
  .facebook-preview-column { order: -1; }
  .facebook-schedule-view .facebook-upcoming-planner { grid-template-columns: 1fr; }
  .facebook-schedule-view .facebook-upcoming-planner > .facebook-schedule-calendar-card,
  .facebook-schedule-view .facebook-upcoming-planner > .facebook-upcoming-list { grid-column: 1; }
  .facebook-schedule-view .facebook-upcoming-planner > .facebook-upcoming-list { margin-top: 0.75rem; }
  .facebook-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .facebook-metric-grid > div:nth-child(2) { border-right: 0; }
  .facebook-metric-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
}

/* Keep the publishing modes and feature list in one reliable toolbar. */
.facebook-schedule-page .facebook-workspace-header { display: flex; align-items: center; width: 100%; min-height: 3rem; }
.facebook-schedule-page .facebook-workspace-header .facebook-mode-switcher { display: flex; align-items: center; flex: 0 0 auto; }
.facebook-schedule-page .facebook-workspace-header .facebook-workspace-sections { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.facebook-schedule-page .facebook-workspace-header .facebook-workspace-sections button { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; margin: 0; border: 0; border-bottom: 2px solid transparent; border-radius: 7px 7px 0 0; background: transparent; color: var(--muted); font-family: inherit; font-size: 0.68rem; font-weight: 700; line-height: 1; cursor: pointer; }
.facebook-schedule-page .facebook-workspace-header .facebook-workspace-sections button:hover { background: var(--surface-2); color: var(--text); }
.facebook-schedule-page .facebook-workspace-header .facebook-workspace-sections button.active { border-bottom-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
@media (max-width: 760px) {
  .facebook-schedule-page .facebook-workspace-header { align-items: stretch; flex-direction: column; }
  .facebook-schedule-page .facebook-workspace-header .facebook-mode-switcher { align-self: flex-start; }
  .facebook-schedule-page .facebook-workspace-header .facebook-workspace-sections { width: 100%; flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .facebook-mode-switcher { align-items: stretch; flex-wrap: wrap; }
  .facebook-workspace-header { align-items: stretch; flex-direction: column; }
  .facebook-workspace-header .facebook-mode-switcher { align-self: flex-start; }
  .facebook-workspace-sections { width: 100%; flex: none; }
  .facebook-mode-note { flex-basis: 100%; padding: 0.45rem; }
  .facebook-schedule-header h2 { font-size: 1.15rem; }
}

/* Final sizing and page selection treatment for the publishing workspace. */
.facebook-schedule-page { max-width: 1120px; }
.facebook-page-selector-card { display: grid; grid-template-columns: minmax(240px, 0.75fr) minmax(320px, 1.25fr); align-items: end; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.facebook-page-profile { display: flex; align-items: center; min-width: 0; gap: 0.7rem; min-height: 2.7rem; }
.facebook-page-avatar { display: grid; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: 0.8rem; background: #2374e1; color: white; font-size: 1.15rem; font-weight: 800; object-fit: cover; }
.facebook-page-profile > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 0.15rem; }
.facebook-page-profile strong { overflow: hidden; color: var(--text); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.facebook-page-profile > div span { color: var(--muted); font-size: 0.68rem; }
.facebook-page-status { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.67rem; font-weight: 700; white-space: nowrap; }
.facebook-page-status i { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.facebook-page-status.ready { color: var(--success); }
.facebook-page-picker { position: relative; min-width: 0; }
.facebook-page-picker-trigger { display: flex; align-items: center; width: 100%; min-height: 2.65rem; gap: 0.6rem; padding: 0.35rem 0.65rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.facebook-page-picker-trigger:hover, .facebook-page-picker-trigger[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.facebook-picker-avatar { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; border-radius: 0.55rem; background: #2374e1; color: white; font-size: 0.78rem; font-weight: 800; object-fit: cover; }
.facebook-picker-name { min-width: 0; flex: 1; overflow: hidden; font-size: 0.78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.facebook-picker-chevron { color: var(--muted); font-size: 1.1rem; line-height: 1; }
.facebook-page-picker-menu { position: absolute; top: calc(100% + 0.35rem); right: 0; left: 0; z-index: 30; display: flex; max-height: 17rem; flex-direction: column; gap: 0.15rem; overflow-y: auto; padding: 0.35rem; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-lg); }
.facebook-page-picker-option { display: flex; align-items: center; width: 100%; gap: 0.6rem; padding: 0.45rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.facebook-page-picker-option:hover, .facebook-page-picker-option.selected { background: var(--accent-soft); }
.facebook-picker-option-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 0.1rem; }
.facebook-picker-option-copy strong { overflow: hidden; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.facebook-picker-option-copy small { color: var(--muted); font-size: 0.62rem; }
.facebook-picker-check { color: var(--accent); font-size: 0.9rem; font-weight: 800; }
@media (max-width: 760px) {
  .facebook-page-selector-card { grid-template-columns: 1fr; align-items: stretch; }
}

/* ---------- Facebook scheduling ---------- */
.facebook-schedule-page { width: 100%; max-width: min(1120px, 100%); margin: 0 auto; }
.facebook-schedule-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.facebook-schedule-header h2 { margin: 0; color: var(--text); font-size: 1.28rem; }
.facebook-schedule-header p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.84rem; }
.facebook-schedule-card { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 16px; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.facebook-schedule-field { display: flex; flex-direction: column; gap: 0.4rem; }
.facebook-schedule-field > span { color: var(--text); font-size: 0.78rem; font-weight: 700; }
.facebook-schedule-field select, .facebook-schedule-field textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.82rem; outline: none; }
.facebook-schedule-field select { min-height: 2.65rem; padding: 0 0.75rem; }
.facebook-schedule-field textarea { min-height: 10rem; padding: 0.75rem; resize: vertical; }
.facebook-schedule-field select:focus, .facebook-schedule-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.facebook-schedule-upload { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.facebook-schedule-upload strong { overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.facebook-schedule-upload span { color: var(--muted); font-size: 0.7rem; }
.facebook-schedule-upload input { display: none; }
.facebook-schedule-feedback { margin: 0; padding: 0.7rem 0.8rem; border-radius: 9px; font-size: 0.78rem; }
.facebook-schedule-feedback.ok { background: var(--success-soft); color: var(--success); }
.facebook-schedule-feedback.error { background: var(--error-soft); color: var(--error); }
.facebook-schedule-submit { align-self: flex-start; min-width: 8rem; }
.facebook-composer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.facebook-composer-actions .facebook-schedule-submit { margin: 0; }
.facebook-schedule-submit-secondary { border: 1px solid var(--accent); background: transparent; color: var(--accent); }
.facebook-schedule-submit-secondary:hover { background: var(--accent-soft); }
.connections-list-row .facebook-schedule-action { min-width: 7.4rem; }
@media (max-width: 560px) {
  .facebook-schedule-header { align-items: stretch; flex-direction: column; }
  .facebook-schedule-header .connections-action { align-self: flex-start; }
  .facebook-schedule-card { padding: 0.9rem; }
  .connections-list-row .facebook-schedule-action { min-width: 4.5rem; }
}

.modal-field--styles {
  margin-bottom: 1.4rem;
}

.tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tag-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.25rem 0.35rem 0.25rem 0.65rem;
  animation: tag-pop-in 0.12s ease both;
}

@keyframes tag-pop-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tag-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tag-chip-remove:hover {
  background: color-mix(in srgb, currentColor 20%, transparent);
}

.tag-input-field {
  flex: 1 1 90px;
  min-width: 90px;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.25rem 0.1rem;
}

/* ================= SOCIAL LINKS STEP (create wizard) ================= */

.social-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-input-row .step-input {
  flex: 1;
}

.social-input-row .btn {
  flex-shrink: 0;
}

.social-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 8px;
}

.social-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.social-chip {
  max-width: 100%;
  font-size: 0.87rem;
  padding: 8px 8px 8px 16px;
}

.social-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.social-chip .tag-chip-remove {
  width: 20px;
  height: 20px;
  font-size: 1rem;
}

.social-empty-hint {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 14px;
}

/* ================= CREATE WEBSITE WIZARD ================= */

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.wizard-meter {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}

.wizard-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.upload-logo-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0.6rem 0.75rem;
  min-height: 110px;
}

.upload-logo-preview img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.upload-logo-preview span {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-remove-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.upload-remove-btn:hover {
  color: var(--error);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.upload-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(16, 20, 31, 0.65);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 0.4rem;
}

.upload-progress-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0.6rem 0.75rem;
}

.upload-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.upload-progress-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.upload-progress-track {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.upload-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.15s ease;
}

/* ================= STEP FORM (create wizard) ================= */

.step-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.step-main {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.step-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 34px;
}

.step-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--ring);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.step-head h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 9px;
}

.step-head p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}

.step-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.stepper {
  position: sticky;
  top: 100px;
}

.stepper:before {
  content: "";
  position: absolute;
  left: 15px;
  top: 17px;
  bottom: 17px;
  width: 2px;
  background: var(--border);
}

.step-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 600;
}

.step-item .dot {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  z-index: 1;
  flex-shrink: 0;
  font-size: 0.72rem;
}

.step-item.active {
  color: var(--text);
}

.step-item.active .dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px var(--ring);
}

.step-item.done {
  color: var(--accent);
}

.step-item.done .dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.step-card-body {
  padding: 32px;
}

/* ---------- /new capacity gate (loading + limit-reached states) ---------- */

.create-gate {
  max-width: 560px;
  margin: 90px auto 0;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.create-gate .spinner {
  margin-bottom: 22px;
}

.create-gate h1,
.create-gate h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 10px;
}

.create-gate p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
  margin: 0;
}

.create-gate-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--error-soft);
  color: var(--error);
  margin-bottom: 20px;
}

.create-gate-hint {
  margin-top: 16px !important;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text) !important;
  font-size: 0.88rem !important;
  line-height: 1.55;
}

.create-gate-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.question-count {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 9px;
}

.question-title {
  font-size: 1.35rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.question-desc {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 25px;
}

.step-input {
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  min-height: 54px;
  resize: vertical;
}

.step-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

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

.step-option {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 15px;
  padding: 15px 16px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: 0.18s;
}

.step-option:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.step-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--ring);
}

.step-option .checkmark {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  color: #fff;
}

.step-option.selected .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.booking-form-panel {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

.booking-form-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.booking-form-label-hint {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}

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

.booking-field-option {
  padding: 11px 12px;
  border-radius: 12px;
}

.booking-field-option .checkmark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

@media (max-width: 760px) {
  .booking-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stylegrid.step-styles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 760px) {
  .stylegrid.step-styles {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stylecard {
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.stylecard.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.stylecard .sv {
  height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  overflow: hidden;
}

.stylecard .sv .style-thumb-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stylecard .nm {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
}

.step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.step-footer .hint {
  font-size: 0.76rem;
  color: var(--muted);
}

.step-actions {
  display: flex;
  gap: 9px;
}

.step-actions .btn {
  min-width: 105px;
  justify-content: center;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: 0.18s;
  display: block;
  width: 100%;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone .upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  font-size: 1.1rem;
}

.upload-zone b {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.upload-zone span {
  font-size: 0.76rem;
  color: var(--muted);
}

.asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-row {
  display: flex;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.review-row:last-child {
  border-bottom: 0;
}

.review-row .num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.review-row b {
  font-size: 0.82rem;
}

.review-row div:last-child {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .step-main {
    width: min(calc(100% - 22px), 680px);
    padding: 28px 0 45px;
  }

  .step-head h1 {
    font-size: 1.65rem;
  }

  .step-layout {
    display: block;
  }

  .stepper {
    position: static;
    display: flex;
    overflow: auto;
    margin-bottom: 18px;
    padding: 2px 1px;
  }

  .stepper:before {
    display: none;
  }

  .step-item {
    flex: 0 0 auto;
    padding: 0 5px;
  }

  .step-item .label {
    display: none;
  }

  .step-item .dot {
    width: 29px;
    height: 29px;
  }

  .step-card-body {
    padding: 24px 20px;
  }

  .step-footer {
    padding: 15px 20px;
  }

  .step-options,
  .stylegrid.step-styles,
  .asset-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Restore overlay ---------- */

.pull-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem;
  text-align: center;
  animation: modal-pop-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.pull-spinner {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.pull-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 800;
}

.pull-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.pull-card p.error-text {
  color: var(--error);
}

.pull-card .modal-cancel-btn {
  margin-top: 1.2rem;
}

.pull-card-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 0.9rem;
  animation: builder-boot-pulse 1.8s ease-in-out infinite;
}

/* ---------- Website recovery / rebuild screen ---------- */

.recovery-card {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2rem 1.75rem;
  animation: modal-pop-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.recovery-field {
  margin-bottom: 22px;
}

.recovery-field .booking-form-label {
  display: block;
  margin-bottom: 8px;
}

.recovery-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ---------- Builder boot overlay (initial builder-open loading state) ---------- */

.builder-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: modal-fade-in 0.16s ease;
}

.builder-boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.builder-boot-logo-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.builder-boot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: builder-boot-spin 0.9s linear infinite;
}

.builder-boot-ring-2 {
  inset: -10px;
  border-color: transparent;
  border-top-color: var(--accent-2);
  opacity: 0.5;
  animation: builder-boot-spin 1.6s linear infinite reverse;
}

.builder-boot-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  animation: builder-boot-pulse 1.8s ease-in-out infinite;
}

@keyframes builder-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes builder-boot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.85;
  }
}

.builder-boot-text {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.builder-boot-dots span {
  display: inline-block;
  animation: builder-boot-dot-blink 1.4s infinite;
  opacity: 0.2;
}

.builder-boot-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.builder-boot-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes builder-boot-dot-blink {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

/* ---------- Version history panel ---------- */

.version-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  justify-content: flex-end;
  background: rgba(13, 14, 19, 0.45);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.16s ease;
}

.version-panel {
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: panel-slide-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes panel-slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.version-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.version-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.version-panel-hint {
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.version-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.version-row-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.version-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.version-row:first-child .version-row-dot {
  background: var(--success);
}

.version-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.version-row-label {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-row-time {
  font-size: 0.74rem;
  color: var(--muted);
}

.version-current-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.version-preview-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  background: var(--surface);
  transition: all 0.15s ease;
}

.version-preview-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.version-empty {
  text-align: center;
  padding: 2rem 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Version preview overlay ---------- */

.version-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: modal-fade-in 0.16s ease;
}

.version-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.version-preview-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.version-preview-back:hover {
  background: var(--bg-alt);
  color: var(--accent);
}

.version-preview-title {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
}

.version-preview-label {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-preview-time {
  font-size: 0.74rem;
  color: var(--muted);
}

.version-preview-body {
  flex: 1;
  min-height: 0;
  background: var(--surface-2);
}

.version-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.version-preview-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.version-current-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--success);
}

.preview-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--surface-2);
}

.preview-placeholder,
.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.preview-placeholder svg {
  opacity: 0.55;
}

.placeholder-text {
  margin: 0;
  font-size: 0.88rem;
  max-width: 320px;
}

.preview-run-cta {
  margin-top: 0.4rem;
  animation: preview-cta-in 0.35s ease;
}

.preview-run-cta-icon {
  fill: currentColor;
  stroke: none;
}

@keyframes preview-cta-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.preview-loading-spinner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: var(--accent);
}

.preview-loading-spinner-glow {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  animation: preview-glow-pulse 1.6s ease-in-out infinite;
}

.preview-loading-spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}

.preview-loading-spinner-icon {
  position: relative;
  animation: preview-icon-pulse 1.6s ease-in-out infinite;
}

@keyframes preview-glow-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes preview-icon-pulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

.shimmer {
  width: 64%;
  max-width: 220px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--border-soft) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.preview-loading-text {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

/* ---------- Build / update progress (preview pane) ---------- */

.build-progress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 2rem 1.5rem;
  background: radial-gradient(120% 100% at 50% 0%, var(--accent-soft) 0%, transparent 60%), var(--surface-2);
}

.build-progress-card {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: buildCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes buildCardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.build-visual {
  position: relative;
  width: 176px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  flex-shrink: 0;
}

.build-visual-ring {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: buildRingPulse 2.6s ease-out infinite;
}

.build-visual-ring-2 {
  animation-delay: 1.3s;
}

@keyframes buildRingPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.45;
  }
  75%,
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

.build-browser {
  position: relative;
  width: 168px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 1;
  animation: buildFloat 3.2s ease-in-out infinite;
}

@keyframes buildFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.build-browser-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  height: 18px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.build-browser-bar span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.build-browser-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.build-line {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-soft) 25%, var(--border-soft) 50%, var(--accent-soft) 75%);
  background-size: 200% 100%;
  transform-origin: left;
  animation: buildShimmer 1.6s linear infinite, buildDraw 2.4s ease-in-out infinite;
}

.build-line-1 {
  width: 55%;
  animation-delay: 0s, 0s;
}

.build-line-2 {
  width: 85%;
  animation-delay: -0.2s, 0.25s;
}

.build-line-3 {
  width: 70%;
  animation-delay: -0.4s, 0.9s;
}

.build-blocks {
  display: flex;
  gap: 8px;
  margin: 2px 0;
}

.build-block {
  flex: 1;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--accent-soft) 25%, var(--border-soft) 50%, var(--accent-soft) 75%);
  background-size: 200% 100%;
  transform-origin: left;
  animation: buildShimmer 1.6s linear infinite, buildDraw 2.4s ease-in-out infinite;
}

.build-block:nth-child(1) {
  animation-delay: -0.6s, 0.45s;
}

.build-block:nth-child(2) {
  animation-delay: -0.8s, 0.65s;
}

@keyframes buildShimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes buildDraw {
  0%,
  15% {
    transform: scaleX(0.15);
    opacity: 0.5;
  }
  50%,
  85% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

.build-progress-title {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.build-progress-subtitle {
  margin: 0 0 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.3em;
  transition: opacity 0.15s ease;
}

.build-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
  margin-bottom: 1.4rem;
  flex-shrink: 0;
}

.build-progress-fill {
  height: 100%;
  width: 6%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-size: 200% 100%;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  animation: buildFillSheen 1.8s linear infinite;
}

@keyframes buildFillSheen {
  from {
    background-position: 0% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.publish-progress-fill {
  width: 100%;
  animation: buildFillSheen 1.4s linear infinite;
}

.build-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: left;
}

.build-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.build-step.active,
.build-step.done {
  opacity: 1;
}

.build-step-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.build-step.active .build-step-icon {
  border-color: transparent;
  background: conic-gradient(var(--accent) 0deg 270deg, var(--border-soft) 270deg 360deg);
  animation: buildSpin 0.9s linear infinite;
}

.build-step.done .build-step-icon {
  border-color: var(--success);
  background: var(--success);
}

.build-step.done .build-step-icon svg {
  width: 11px;
  height: 11px;
}

@keyframes buildSpin {
  to {
    transform: rotate(360deg);
  }
}

.build-step-label {
  font-size: 0.83rem;
  color: var(--muted);
}

.build-step.active .build-step-label {
  color: var(--text);
  font-weight: 600;
}

.build-step.done .build-step-label {
  color: var(--text-soft);
}

.build-progress-tip {
  margin: 1rem 0 0;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--muted);
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.build-progress-tip:empty {
  display: none;
}

.build-progress-tip.fade-out {
  opacity: 0;
}

.build-progress-timer {
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  flex-shrink: 0;
}

.build-progress-play-btn {
  margin-top: 1.3rem;
  flex-shrink: 0;
  animation: buildPlayBtnPulse 2.4s ease-in-out infinite;
}

.build-progress-play-btn:hover {
  animation-play-state: paused;
}

@keyframes buildPlayBtnPulse {
  0%,
  100% {
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, transparent);
  }
  50% {
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 50%, transparent);
  }
}

.preview-frame-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0;
  transition: padding 0.2s ease;
}

.preview-frame {
  border: none;
  background: #fff;
  width: 100%;
  height: 100%;
  transition: width 0.2s ease, height 0.2s ease, border-radius 0.2s ease;
}

.preview-frame-wrap[data-viewport="tablet"],
.preview-frame-wrap[data-viewport="mobile"] {
  padding: 1.5rem;
  background: var(--bg-alt);
}

.preview-frame-wrap[data-viewport="tablet"] .preview-frame {
  width: 768px;
  height: 100%;
  max-height: 1024px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.preview-frame-wrap[data-viewport="mobile"] .preview-frame {
  width: 390px;
  height: 100%;
  max-height: 844px;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.project-log-box {
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--code-bg);
  color: var(--code-text);
  border-top: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  flex-shrink: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 42vh) 1fr;
  }

  .chat-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .project-header {
    flex-wrap: wrap;
  }

  .project-header-title {
    order: -1;
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .msg-bubble {
    max-width: 190px;
  }

  .project-header-status .pill-label {
    display: none;
  }

  .status-pill {
    padding: 0.4rem;
  }

  .live-pill .pill-label {
    display: inline;
  }

  .live-pill .pill-arrow,
  .header-divider {
    display: none;
  }

  .publish-caption {
    display: none;
  }

  .unpublished-banner {
    flex-wrap: wrap;
  }

  .unpublished-banner-text {
    flex-basis: 100%;
    order: -1;
  }

  .version-panel {
    max-width: 100%;
  }
}

/* ================= DASHBOARD + SIDEBAR ================= */

.dashboard-shell {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 0.9rem 1.1rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.6rem 1.3rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.sidebar-brand img {
  display: block;
  height: 26px;
  width: auto;
  flex-shrink: 0;
  margin-bottom: 20px;
}

.sidebar-brand .brand-name {
  line-height: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.sidebar-lbl {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1rem 0.75rem 0.45rem;
  margin-bottom: 0.3rem;
}

.sidebar-lbl:first-child {
  padding-top: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-link.active {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sidebar-credits {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  background: var(--surface-2);
}

.sidebar-credits-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.sidebar-credits-row b {
  color: var(--text);
}

.sidebar-credits .credit-meter {
  height: 6px;
}

.sidebar-credits-breakdown {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.sidebar-credits-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-credits-stat-right {
  align-items: flex-end;
  text-align: right;
}

.sidebar-credits-stat-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-credits-stat-label {
  font-size: 0.66rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-trial-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--warn, #e0a300);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  background: color-mix(in srgb, var(--warn, #e0a300) 12%, transparent);
  color: var(--warn, #e0a300);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.sidebar-trial-badge:hover {
  opacity: 0.85;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: var(--muted);
}

.dashboard-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.6rem 1.75rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.04);
}

.dashboard-footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
}

.dashboard-footer-social {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dashboard-footer-social-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-footer-social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dashboard-footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-footer-social-link:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.dashboard-footer-social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .dashboard-footer {
    padding: 0.55rem 1rem;
    justify-content: center;
  }
  .dashboard-footer-copy,
  .dashboard-footer-social-title {
    display: none;
  }
  .dashboard-footer-social-list {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-footer-social-link {
    transition: none;
  }
  .dashboard-footer-social-link:hover {
    transform: none;
  }
}

/* ---------- Account switcher (topbar) ---------- */

.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 0.15rem;
}

.account-switcher {
  position: relative;
}

.account-switcher-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 40px;
  padding: 0.3rem 0.9rem 0.3rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.account-switcher-trigger:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 4px 14px rgba(39, 66, 245, 0.12);
}

.account-switcher-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.account-switcher-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(39, 66, 245, 0.35);
}

.account-switcher-label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.2;
}

.account-switcher-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.account-switcher-role {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.account-switcher-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.account-switcher-trigger[aria-expanded="true"] .account-switcher-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.account-switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  width: 270px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.45rem;
  z-index: 60;
  animation: modal-pop-in 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  transform-origin: top right;
}

@media (max-width: 640px) {
  .account-switcher-label {
    display: none;
  }

  .account-switcher-trigger {
    padding: 0.3rem;
    gap: 0;
  }

  .account-switcher-menu {
    width: 240px;
  }
}

.account-switcher-menu-label {
  display: block;
  padding: 0.4rem 0.55rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  text-align: left;
  transition: background 0.12s ease;
}

.account-switcher-item:hover {
  background: var(--surface-2);
}

.account-switcher-item.active {
  background: var(--accent-soft);
}

.account-switcher-item:disabled {
  opacity: 0.6;
  cursor: default;
}

.account-switcher-item-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.account-switcher-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}

.account-switcher-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.account-switcher-item-role {
  font-size: 0.7rem;
  color: var(--muted);
}

.account-switcher-item.active svg {
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  border: none;
  padding: 0;
  background: rgba(10, 10, 20, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Variant with a fixed footer: only .dashboard-scroll scrolls, footer stays put. */
.dashboard-main--fixed-footer {
  overflow: hidden;
}

.dashboard-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.dashboard-topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-crumb-link {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.topbar-crumb-link:hover {
  color: var(--text);
}

.topbar-crumb-sep {
  color: var(--muted);
  font-weight: 400;
  margin: 0 0.15rem;
}

.topbar-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dashboard-body {
  flex: 1;
  min-height: 0;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 1.9rem 2.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem;
  box-shadow: var(--shadow);
}

.stat-tile-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-tile-icon-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.stat-tile-icon-success {
  background: var(--success-soft);
  color: var(--success);
}

.stat-tile-icon-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.stat-tile-value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat-tile-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.stat-tile-trend {
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-tile-trend.up {
  color: var(--success);
}

.stat-tile-trend.down {
  color: var(--error);
}

.stat-tile-trend-detail {
  font-weight: 500;
  color: var(--muted);
}

.billing-body {
  gap: 2rem;
}

.credit-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.credit-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width 0.4s ease;
}

/* ---------- Balance hero ---------- */

.billing-hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 560px;
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-sm);
}

.billing-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.billing-hero-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.billing-hero-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.2rem;
}

.billing-hero-value {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.billing-plan-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
}

.billing-hero-meter {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.billing-hero-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.billing-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.billing-hero-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-plan {
  background: var(--accent);
}

.dot-purchased {
  background: var(--success);
}

.billing-hero-renewal {
  color: var(--accent);
}

.billing-hero-trial {
  color: var(--warn, #e0a300);
  border-color: color-mix(in srgb, var(--warn, #e0a300) 40%, transparent);
  background: color-mix(in srgb, var(--warn, #e0a300) 12%, transparent);
}

/* ---------- Websites usage, inside the credits hero card ---------- */

.billing-hero-websites {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.billing-hero-websites-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.billing-hero-websites-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
}

.billing-hero-websites-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.billing-hero-websites-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.billing-hero-websites-meter {
  height: 6px;
}

.billing-website-stats {
  display: flex;
  gap: 0.6rem;
}

.billing-website-stat {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.billing-website-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.billing-website-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.billing-website-stat-addon {
  background: var(--accent-soft);
  border-color: transparent;
}

.billing-website-stat-addon .billing-website-stat-value {
  color: var(--accent);
}

.billing-website-stat-free {
  background: var(--success-soft);
  border-color: transparent;
}

.billing-website-stat-free .billing-website-stat-value {
  color: var(--success);
}

.billing-website-stat-link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.billing-website-stat-link:hover {
  text-decoration: underline;
}

/* ---------- Suspended-account recovery banner ---------- */

.billing-suspended-banner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--error) 45%, transparent);
  border-radius: var(--radius-lg);
  background: var(--error-soft);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.billing-suspended-text strong {
  display: block;
  color: var(--error);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.billing-suspended-text p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.billing-suspended-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.billing-suspended-refresh {
  margin-left: auto;
}

@media (max-width: 560px) {
  .billing-suspended-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .billing-suspended-actions button {
    justify-content: center;
  }

  .billing-suspended-refresh {
    margin-left: 0;
  }
}

/* ---------- Billing hero + payment method, side by side ---------- */

.billing-top-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.billing-top-row .billing-hero {
  flex: 1 1 420px;
  margin-bottom: 0;
}

.payment-method-card {
  flex: 1 1 280px;
  max-width: 340px;
}

@media (max-width: 860px) {
  .payment-method-card {
    max-width: none;
  }
}

.payment-method-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.payment-method-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.payment-method-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.payment-method-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.payment-method-summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.88rem;
  color: var(--text-soft);
  min-width: 0;
}

.payment-method-brand {
  font-weight: 700;
  color: var(--text);
}

.payment-method-digits {
  letter-spacing: 0.05em;
}

.outline-btn.sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

/* ---------- Payment method card — loading skeleton ---------- */

.payment-method-card-skeleton {
  gap: 0.9rem;
}

.skeleton-bar {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: plan-skeleton-shimmer 1.2s ease-in-out infinite;
}

.payment-method-card-skeleton .skeleton-bar-title {
  width: 40%;
  height: 0.95rem;
}

.payment-method-card-skeleton .skeleton-bar-btn {
  width: 90px;
  height: 1.9rem;
  border-radius: 999px;
}

.payment-method-card-skeleton .skeleton-bar-line {
  width: 75%;
  height: 0.95rem;
}

.payment-method-card-skeleton .skeleton-bar-line-sm {
  width: 45%;
  height: 0.78rem;
}

#refresh-balance {
  width: auto;
  height: auto;
  padding: 0.4rem 0.7rem;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
}

#refresh-balance.spinning svg {
  animation: refresh-spin 0.7s linear infinite;
}

@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.billing-change-plan-btn,
.billing-buy-credits-btn,
.billing-buy-website-btn,
.billing-end-trial-btn {
  align-self: flex-start;
  padding: 0.65rem 1.05rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* Distinct success-green treatment so the trial's primary conversion action
   doesn't blend in with "Change plan" (both use .primary-btn's shape). */
.billing-end-trial-btn {
  background: var(--success);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--success) 30%, transparent);
}

.billing-end-trial-btn:hover {
  box-shadow: 0 12px 28px color-mix(in srgb, var(--success) 38%, transparent);
}

.outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.outline-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(20, 20, 40, 0.08);
}

.outline-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ---------- Change-plan modal ---------- */

.plan-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(13, 14, 19, 0.45);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.16s ease;
}

.plan-modal {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  animation: modal-pop-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.plan-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.plan-modal-header .modal-close-btn {
  position: static;
  flex-shrink: 0;
}

.plan-modal-header h2 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.plan-modal-sub {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 480px;
}

/* ---------- Month/Year billing-interval toggle ---------- */

.billing-interval-toggle {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 0 auto 1.1rem;
}

.billing-interval-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.billing-interval-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.billing-interval-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.billing-interval-save-hint {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
}

.plan-modal-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 600;
}

.plan-modal-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(2px);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.credits-modal {
  max-width: 620px;
}

.free-website-grant-modal {
  max-width: 560px;
}

.free-website-grant-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid transparent;
}

.free-website-grant-note-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.free-website-grant-note p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.website-limit-modal {
  max-width: 480px;
}

.website-limit-modal .modal-footer {
  margin-top: 1.25rem;
}

/* ---------- Shared section chrome ---------- */

.billing-section h2,
.billing-info h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.billing-section-sub {
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 640px;
}

/* ---------- Plan cards ---------- */

/* Fixed 3-equal-columns layout (Bootstrap col-md-4 equivalent) — cards keep
   a consistent size regardless of how many plans exist, instead of
   stretching/shrinking to fill the row like an auto-fit grid would. */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 960px;
}

@media (min-width: 768px) {
  .plan-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 20, 40, 0.08);
}

.plan-card-skeleton {
  min-height: 172px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: plan-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes plan-skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.plan-card-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.plan-card-popular {
  border-color: var(--accent);
}

.plan-card-tag {
  position: absolute;
  top: -10px;
  left: 1.1rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.plan-card-name {
  font-weight: 700;
  font-size: 1rem;
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.plan-card-price-amount {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plan-card-price-period {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.plan-card-price-compare {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: -0.2rem;
}

.plan-card-price-strike {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: line-through;
}

.plan-card-price-yearly-total {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.plan-card-save-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
}

.plan-card-credits {
  font-size: 0.85rem;
  color: var(--muted);
}

.plan-card-btn {
  margin-top: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.plan-card-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.plan-card-btn:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: default;
}

/* ---------- Credit packs ---------- */

.pack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  max-width: 720px;
  margin-bottom: 1.1rem;
}

@media (min-width: 640px) {
  .pack-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pack-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 0.75rem;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pack-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(20, 20, 40, 0.08);
}

.pack-card:disabled {
  opacity: 0.6;
  cursor: default;
}

.pack-card-loading {
  opacity: 0.6;
}

.pack-card-credits {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pack-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.pack-card-price {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.credits-modal-success {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
}

.custom-pack-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.3rem 0 1.1rem;
  max-width: 480px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.custom-pack-divider::before,
.custom-pack-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.custom-pack {
  max-width: 480px;
}

.custom-pack label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.custom-pack-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.custom-pack-row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font-size: 0.92rem;
}

.custom-pack-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.custom-pack-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.custom-pack-row .primary-btn {
  padding: 0.6rem 1.1rem;
  white-space: nowrap;
}

/* ---------- Info card ---------- */

.billing-info {
  max-width: 700px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.billing-info ul {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.billing-info li {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.billing-info li strong {
  color: inherit;
}

/* ---------- Website status pills ---------- */

.project-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.site-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.site-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.site-status-pill.running,
.site-status-pill.publishing {
  animation: none;
}

.site-status-pill.running .site-status-dot,
.site-status-pill.publishing .site-status-dot {
  animation: pulse 1.8s infinite ease-in-out;
}

.site-status-pill.running {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
}

.site-status-pill.publishing {
  border-color: var(--warn-soft);
  background: var(--warn-soft);
  color: var(--warn);
}

.site-status-pill.published {
  border-color: var(--success-soft);
  background: var(--success-soft);
  color: var(--success);
}

/* ---------- Loading skeleton ---------- */

.project-card-skeleton {
  height: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--border-soft) 25%, var(--border) 50%, var(--border-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.project-grid.is-loading {
  pointer-events: none;
}

#view-grid .project-card-skeleton {
  height: 210px;
}

#view-list-rows .project-card-skeleton,
#dashboard-project-rows .project-card-skeleton {
  height: 40px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.pagination-summary {
  font-size: 0.82rem;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-page {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.pagination-page:hover {
  background: var(--surface-2);
  color: var(--text);
}

.pagination-page.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }

  .dashboard-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .dashboard-shell.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar-toggle {
    display: flex;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================= FOWS COMPONENT LIBRARY (ported from design mockups) ================= */
/* Reusable primitives matching the fows-dashboard mockups class-for-class,   */
/* so pages built against these read as visually identical to the reference. */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn.pri {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}

.btn.pri:hover {
  transform: translateY(-1px);
}

.btn.ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

.btn.ghost:hover {
  background: var(--surface-2);
}

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

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

.btn.danger {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 35%, var(--border));
}

.btn.sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none !important;
}

/* ---------- Page header ---------- */

.phead {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.phead h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.phead p {
  color: var(--muted);
  margin: 5px 0 0;
  font-size: 0.93rem;
}

.phead .acts {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.chead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px 0;
}

.chead h3 {
  font-size: 1.02rem;
  margin: 0;
}

.chead .r {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chead .hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.cbody {
  padding: 18px 22px 22px;
}

.grid {
  display: grid;
  gap: 18px;
}

.g4 {
  grid-template-columns: repeat(4, 1fr);
}

.g3 {
  grid-template-columns: repeat(3, 1fr);
}

.g2 {
  grid-template-columns: repeat(2, 1fr);
}

.g23 {
  grid-template-columns: 1.9fr 1fr;
}

@media (max-width: 1100px) {
  .g4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .g3,
  .g23,
  .g2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Stat cards ---------- */

.stat {
  padding: 20px 22px;
}

.stat .lab {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.stat .val {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 8px;
}

.stat .d {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

.stat .up {
  color: var(--success);
  font-weight: 600;
}

.stat .down {
  color: var(--error);
  font-weight: 600;
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 600;
}

.pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  font-style: normal;
}

.pill.live {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: color-mix(in srgb, var(--success) 80%, var(--text));
}

.pill.draft {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.pill.busy {
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--accent);
}

.pill.warn {
  background: color-mix(in srgb, var(--warn) 15%, var(--surface));
  color: color-mix(in srgb, var(--warn) 85%, var(--text));
}

.pill.bad {
  background: color-mix(in srgb, var(--error) 14%, var(--surface));
  color: color-mix(in srgb, var(--error) 80%, var(--text));
}

/* ---------- Tables ---------- */

.card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.card th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 14px 22px 10px;
  border-bottom: 1px solid var(--border);
}

.card td {
  padding: 15px 22px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.card tr:last-child td {
  border-bottom: none;
}

.card td .s2 {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

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

.rowlink:hover td {
  background: var(--surface-2);
}

/* ---------- Forms ---------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 7px;
}

.field .help {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

.in {
  width: 100%;
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.9rem;
  font: inherit;
  color: inherit;
  transition: border 0.15s, box-shadow 0.15s;
}

.in:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

textarea.in {
  resize: vertical;
}

.frow {
  display: flex;
  gap: 14px;
}

.frow .field {
  flex: 1;
}

.check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 9px 0;
  font-size: 0.88rem;
}

.check input {
  margin-top: 3px;
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.check .d {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1px;
}

/* ---------- Toggle ---------- */

.tgl {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  display: inline-block;
}

.tgl input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tgl i {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--muted) 35%, var(--surface));
  border-radius: 99px;
  transition: 0.2s;
  font-style: normal;
}

.tgl i:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.tgl input:checked + i {
  background: var(--success);
}

.tgl input:checked + i:before {
  left: 21px;
}

/* ---------- Setting row ---------- */

.srow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.srow:last-child {
  border-bottom: none;
}

.srow .tx {
  flex: 1;
}

.srow b {
  font-size: 0.9rem;
  font-weight: 600;
}

.srow .d {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.security-row-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--success);
}

.security-row-check.fail {
  color: var(--error);
}

/* ---------- Security banner ---------- */

.security-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
}

.security-banner.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, var(--border));
}

.security-banner-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  flex-shrink: 0;
}

.security-banner.warn .security-banner-icon {
  background: var(--warn);
}

.security-banner-text {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.security-banner-text b {
  color: var(--text);
}

.security-banner-error {
  color: var(--error);
}

/* ---------- Misc ---------- */

.thumb {
  border-radius: 12px;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.kebab {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.15rem;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
}

.kebab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
}

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

.chip.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.codebox {
  font-size: 0.85rem;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.codebox .cp {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.stepnum {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

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

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
}

.seg button,
.seg a {
  border: none;
  background: transparent;
  padding: 6px 15px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

.seg .sel {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(11, 14, 23, 0.12);
}

/* ---------- Auth split layout (login / forgot / verify / reset) ---------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth .aside {
  color: #f6f5f1;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(900px 520px at -10% -10%, rgba(39, 66, 245, 0.5), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(29, 191, 110, 0.22), transparent 60%), #0b0e17;
}

.auth .aside .brand {
  color: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.auth .aside .brand img {
  height: 24px;
  width: auto;
}

.auth .aside .mid {
  margin: auto 0;
  max-width: 460px;
}

.auth .aside h2 {
  font-size: 2.15rem;
  line-height: 1.14;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.auth .aside p.lede {
  color: rgba(246, 245, 241, 0.72);
  font-size: 0.97rem;
  line-height: 1.6;
  margin: 0 0 36px;
}

.auth .step {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.auth .step .stepnum {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.auth .step b {
  display: block;
  font-size: 1rem;
  margin-bottom: 3px;
}

.auth .step span {
  color: rgba(246, 245, 241, 0.66);
  font-size: 0.86rem;
  line-height: 1.55;
}

.auth .pane {
  display: grid;
  place-items: center;
  padding: 44px 26px;
  position: relative;
}

.authcard {
  width: 100%;
  max-width: 410px;
}

.authcard h1 {
  font-size: 1.5rem;
  margin: 0 0 7px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.authcard .lead {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 26px;
}

.authcard .card {
  padding: 28px;
}

.authcard .or {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin: 20px 0;
}

.authcard .or:before,
.authcard .or:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.wide {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

.below {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 20px;
}

.below a {
  color: var(--accent);
  font-weight: 600;
}

.themefloat {
  position: absolute;
  top: 18px;
  right: 18px;
}

@media (max-width: 940px) {
  .auth {
    grid-template-columns: 1fr;
  }

  .auth .aside {
    display: none;
  }
}

/* ================= WEBSITE DETAILS PAGE ================= */

.site-id-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-id-thumb {
  width: 60px;
  height: 60px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.site-id-body {
  flex: 1;
  min-width: 220px;
}

.site-id-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-id-title-row h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.site-id-sub {
  font-size: 0.88rem;
  margin-top: 3px;
}

.site-id-sub a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.site-id-sub a:hover {
  text-decoration: underline;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  padding: 10px 2.25rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab-btn {
  border: none;
  background: transparent;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 16px 13px;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
  background: transparent;
}

.tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: var(--radius-sm);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 70px;
}

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

/* ---------- Detail cards (Overview + Metrics) ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.detail-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.detail-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.detail-card-value {
  font-size: 0.98rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-card-value a,
.detail-card-value .link-reset {
  color: var(--accent);
  text-decoration: none;
}

.detail-card-value a:hover,
.detail-card-value .link-reset:hover {
  text-decoration: underline;
}

.link-reset {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.site-links-modal-card {
  max-width: 420px;
}

.site-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 340px;
  overflow-y: auto;
}

.site-links-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.site-links-row:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.site-links-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.site-links-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-links-row-host {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-links-row-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

.site-links-row-tag--active {
  background: var(--success-soft);
  color: var(--success);
}

.site-links-row-tag--pending,
.site-links-row-tag--initializing,
.site-links-row-tag--verifying {
  background: var(--warn-soft);
  color: var(--warn);
}

.site-links-row-tag--error,
.site-links-row-tag--blocked,
.site-links-row-tag--deactivated {
  background: var(--error-soft);
  color: var(--error);
}

.site-links-row-go {
  flex-shrink: 0;
  display: flex;
  color: var(--muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.site-links-row:hover .site-links-row-go {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ---------- Tab toolbar / hints ---------- */

.tab-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.margin-bottom-half {
  margin-bottom: 0.5rem !important;
}

.margin-bottom-one {
  margin-bottom: 1rem !important;
}

.tab-panel-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.tab-panel-hint-inline {
  font-weight: 400;
  color: var(--muted);
}

.tab-filter-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 99px;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.tab-filter-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Loading skeletons ---------- */

.tab-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.tab-skeleton-grid .project-card-skeleton {
  height: 84px;
}

.tab-skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tab-skeleton-stack .project-card-skeleton {
  height: 62px;
}

/* ---------- Empty / error states ---------- */

.tab-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tab-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}

.tab-empty-state h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.tab-empty-state p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 32rem;
}

.tab-error-state {
  text-align: center;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.tab-error-state p {
  margin: 0;
  color: var(--error);
  font-size: 0.9rem;
}

/* ---------- Deployment / metrics status pills ---------- */

.site-status-pill.status-success {
  border-color: var(--success-soft);
  background: var(--success-soft);
  color: var(--success);
}

.site-status-pill.status-failure {
  border-color: var(--error-soft);
  background: var(--error-soft);
  color: var(--error);
}

.site-status-pill.status-building {
  border-color: var(--warn-soft);
  background: var(--warn-soft);
  color: var(--warn);
}

.site-status-pill.status-building .site-status-dot {
  animation: pulse 1.8s infinite ease-in-out;
}

.site-status-pill.status-pending {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

/* ---------- Metrics activity chart ---------- */

.metrics-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-top: 1.5rem;
}

.metrics-chart-card h3 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.chart-wrap {
  position: relative;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
  border-bottom: 1px solid var(--border-soft);
}

.chart-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
}

.chart-col:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
}

.chart-col:hover .chart-bar,
.chart-col:focus-visible .chart-bar {
  background: var(--accent-dark);
}

.chart-bar {
  width: 100%;
  min-height: 2px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: background 0.12s ease;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  padding-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.chart-tooltip {
  position: absolute;
  bottom: 100%;
  transform: translate(-50%, -8px);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 5;
}

.chart-tooltip strong {
  font-size: 0.82rem;
}

.chart-tooltip span {
  opacity: 0.75;
}

/* ---------- Web Analytics ---------- */

.wa-enable-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.wa-enable-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.wa-enable-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.wa-enable-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 30rem;
}

.wa-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.wa-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.wa-toplists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.wa-toplist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.wa-toplist h4 {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.wa-toplist-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.wa-toplist-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  margin: 0 -0.6rem 2px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  z-index: 0;
}

.wa-toplist-bar {
  position: absolute;
  inset: 0;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  z-index: -1;
}

.wa-toplist-label {
  position: relative;
  font-size: 0.84rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-toplist-count {
  position: relative;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.wa-empty-note {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 1rem;
}

/* ---------- Deployment list ---------- */

.deployment-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.deployment-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}

.deployment-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.deployment-row-branch {
  font-weight: 700;
  font-size: 0.88rem;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deployment-row-meta {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deployment-row-duration {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Confirm dialog ---------- */

.modal-card--confirm {
  max-width: 380px;
}

.modal-card--confirm .modal-header {
  margin-bottom: 1.4rem;
}

.modal-card--confirm .modal-header p {
  margin-top: 0.3rem;
}

/* ---------- Add websites quote ---------- */

.addon-quote {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.addon-quote-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 1rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.addon-quote-rows dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.addon-quote-rows .addon-quote-total {
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.modal-card--confirm .modal-message ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.modal-danger-btn {
  border: 1px solid var(--error);
  background: var(--error);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  transition: all 0.15s ease;
}

.modal-danger-btn:hover {
  filter: brightness(1.08);
}

/* ---------- Domain list ---------- */

.tab-panel-action-btn {
  padding: 0.55rem 1.05rem;
  font-size: 0.85rem;
}

.domain-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.domain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.domain-card:hover {
  border-color: var(--accent-soft);
}

.domain-card.is-removing {
  opacity: 0.5;
  pointer-events: none;
}

.domain-card-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.domain-card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
}

.domain-card-icon--status-success {
  background: var(--success-soft);
  color: var(--success);
}

.domain-card-icon--status-failure {
  background: var(--error-soft);
  color: var(--error);
}

.domain-card-icon--status-building {
  background: var(--warn-soft);
  color: var(--warn);
}

.domain-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.domain-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.domain-card-hostname {
  font-weight: 700;
  font-size: 0.94rem;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-card-meta.is-error {
  color: var(--error);
}

.domain-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.domain-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.domain-action-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.domain-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.domain-action-btn--danger:hover:not(:disabled) {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-soft);
}

.dns-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-top: 0.9rem;
}

.dns-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.dns-step-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  margin-bottom: 0.15rem;
}

.dns-card-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
}

.dns-card-hostname {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}

.dns-card-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.dns-live-url {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.dns-live-url-icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--accent);
}

.dns-live-url-text {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.dns-live-url-label {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.dns-live-url-value {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.dns-live-url-value:hover {
  text-decoration: underline;
}

.dns-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.dns-table-head {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) 1fr 1fr auto;
  gap: 0.7rem;
  background: var(--surface-2);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dns-table-head span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dns-table-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) 1fr 1fr auto;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dns-table-row:last-child {
  border-bottom: none;
}

.dns-type-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
}

.dns-cell {
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.dns-cell code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: none;
  border: none;
  padding: 0;
}

.dns-cell-name code {
  font-weight: 700;
  color: var(--text-soft);
}

.dns-cell-value code {
  font-weight: 600;
  color: var(--accent);
}

.dns-type-badge--remove {
  display: inline-flex;
  color: var(--error);
  background: var(--error-soft);
}

.dns-cell-value--remove code {
  color: var(--error);
}

.dns-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
}

.dns-card-footer-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.dns-card-footer-note svg {
  flex-shrink: 0;
  color: var(--warn);
}

.dns-doc-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.dns-doc-link:hover {
  text-decoration: underline;
}

.copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Manage DNS records modal ---------- */

.dns-records-modal {
  max-width: 820px;
  width: 92vw;
  min-height: min(600px, calc(100vh - 3rem));
}

.dns-records-intro {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.dns-records-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.dns-records-head,
.dns-record-row {
  display: grid;
  /* Fixed widths for the type, TTL and actions columns: the header and every row are separate grids, so "auto" would size each one differently and push TTL out of line with its header. */
  grid-template-columns: 4.5rem 1.1fr 1.3fr 6rem 5rem;
  align-items: start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
}

.dns-records-head {
  align-items: center;
}

.dns-records-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.dns-records-head span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dns-record-row {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dns-record-row:last-child {
  border-bottom: none;
}

.dns-record-name,
.dns-record-value {
  min-width: 0;
  /* Long values (TXT/DKIM keys, etc.) wrap onto extra lines instead of scrolling sideways. */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-soft);
}

.dns-record-value-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: inherit;
}

.dns-record-ttl {
  font-size: 0.78rem;
  color: var(--muted);
}

.dns-record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.dns-record-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  transition: all 0.15s ease;
}

.dns-record-icon-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.dns-record-icon-btn--danger:hover:not(:disabled) {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-soft);
}

.dns-record-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dns-record-protected {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.dns-records-empty {
  padding: 1rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.dns-add-form {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}

.dns-add-form-title {
  margin: 0 0 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
}

.dns-add-form-grid {
  display: grid;
  grid-template-columns: 6.5rem 1fr 1fr 7rem;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.dns-add-form-grid--with-priority {
  grid-template-columns: 6.5rem 1fr 1fr 7rem 5.5rem;
}

.modal-checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: -0.2rem 0 1rem;
}

.modal-checkbox-field input {
  width: 16px;
  height: 16px;
}

.dns-record-edit {
  background: var(--surface-2);
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dns-record-edit:last-child {
  border-bottom: none;
}

.dns-record-edit-label {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
}

.dns-record-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.dns-record-edit-error {
  font-size: 0.76rem;
  color: var(--error);
  margin: 0 0 0.6rem;
}

.dns-record-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ---------- Blog list ---------- */

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.blog-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.blog-row:hover {
  border-color: var(--accent-soft);
}

.blog-row-thumb {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
}

.blog-row-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-row-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.blog-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.1rem;
}

.blog-row-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.blog-row-title {
  font-weight: 700;
  font-size: 0.96rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.blog-row-excerpt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-row-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.blog-row-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.blog-row-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.blog-row-toggle:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.blog-row-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Inbox (booking + contact-form submissions) ---------- */

.ibwrap {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
  min-height: 480px;
}

.iblist {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 680px;
}

.ibrow {
  display: flex;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: flex-start;
  width: 100%;
  border-left: none;
  border-top: none;
  border-right: none;
  background: none;
  text-align: left;
}

.ibrow:hover {
  background: var(--surface-2);
}

.ibrow.sel {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}

.ibrow .icn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: #fff;
}

.ibrow .tx {
  flex: 1;
  min-width: 0;
}

.ibrow .nm {
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
}

.ibrow .nm .unread {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.ibrow .snip {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ibrow .tm {
  font-size: 0.7rem;
  color: var(--faint, var(--muted));
  margin-top: 4px;
}

.ibrow.read .nm {
  font-weight: 500;
}

.ibdetail {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  max-height: 680px;
}

/* ---------- Blog post editor modal ---------- */

.blog-content-textarea {
  min-height: 220px;
}

/* ---------- Blog publish banner ---------- */
/* Fixed + above the modal layer (z-index 100) so it stays visible even while
   the "New post" modal is open on top of it — otherwise a "done" update
   lands invisibly behind the modal and looks stuck until the page reloads. */

.blog-publish-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 150;
  max-width: min(380px, calc(100vw - 2.5rem));
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

.blog-publish-banner.busy {
  border-color: var(--warn-soft);
  background: var(--warn-soft);
  color: var(--warn);
}

.blog-publish-banner.busy::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.8s infinite ease-in-out;
  flex-shrink: 0;
}

.blog-publish-banner.success {
  border-color: var(--success-soft);
  background: var(--success-soft);
  color: var(--success);
}

.blog-publish-banner.error {
  border-color: var(--error-soft);
  background: var(--error-soft);
  color: var(--error);
}

/* ---------- Blog integration CTA ---------- */

.blog-integrate-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.blog-integrate-cta-text h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
}

.blog-integrate-cta-text p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  max-width: 40rem;
  line-height: 1.5;
}

.blog-integrate-cta .tab-panel-action-btn {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .blog-integrate-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
}

/* ---------- Features grid ---------- */

.features-section-title {
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

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

@media (max-width: 720px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
  border-color: var(--accent-soft);
  box-shadow: 0 2px 8px rgba(20, 20, 40, 0.08);
}

.feature-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.feature-card-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.feature-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.feature-card-pill {
  flex-shrink: 0;
}

.feature-card-skeleton {
  cursor: default;
}

.feature-card-disabled {
  cursor: default;
  opacity: 0.6;
}

.feature-card-disabled:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.search-console-connection-card {
  cursor: default;
}

.search-console-connection-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.skeleton-bone {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border-soft) 25%, var(--border) 50%, var(--border-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.feature-card-icon-skeleton {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.feature-card-title-skeleton {
  width: 40%;
  height: 13px;
  margin-bottom: 8px;
}

.feature-card-desc-skeleton {
  width: 88%;
  height: 11px;
}

.feature-card-pill-skeleton {
  width: 54px;
  height: 24px;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .details-header-actions {
    width: 100%;
  }

  .details-header-actions .primary-btn {
    flex: 1;
    justify-content: center;
  }

  .deployment-row {
    flex-wrap: wrap;
  }

  .deployment-row-duration {
    order: 3;
    width: 100%;
    padding-left: 2.6rem;
  }

  .dns-table-head {
    display: none;
  }

  .dns-table-row {
    grid-template-columns: auto 1fr;
    row-gap: 0.4rem;
  }

  .dns-cell-name,
  .dns-cell-value {
    grid-column: 1 / -1;
  }

  .dns-copy-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dns-card-footer {
    flex-wrap: wrap;
  }

  .dns-records-head {
    display: none;
  }

  .dns-record-row {
    grid-template-columns: auto 1fr;
    row-gap: 0.4rem;
  }

  .dns-record-name,
  .dns-record-value {
    grid-column: 1 / -1;
  }

  .dns-add-form-grid,
  .dns-add-form-grid--with-priority,
  .dns-record-edit-grid {
    grid-template-columns: 1fr;
  }

  .blog-row {
    flex-wrap: wrap;
  }

  .blog-row-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0;
  }
}

/* ================= USERS PAGE ================= */

.users-body {
  gap: 1.5rem;
  max-width: 760px;
}

.users-invite-copy {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.users-invite-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.users-invite-form input {
  flex: 1;
  min-width: 220px;
}

.users-invite-form button {
  white-space: nowrap;
}

.users-invite-message {
  margin: 14px 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.4;
}

.users-invite-message-success {
  background: var(--success-soft);
  color: var(--success);
}

.users-invite-message-error {
  background: var(--error-soft);
  color: var(--error);
}

.users-readonly-note {
  margin: -6px 0 18px;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.users-roles-note {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
}

.users-row-skeleton td {
  padding: 15px 22px;
}

.users-row-skeleton-bar {
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: users-skeleton-shimmer 1.4s ease infinite;
}

@keyframes users-skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

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

.users-row-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.users-row-avatar-pending {
  background: var(--surface-2);
  color: var(--muted);
}

.users-row-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.users-row-you-badge {
  flex-shrink: 0;
}

.users-row-resend {
  margin-right: 8px;
}

.btn.pri .spinner-sm {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@media (max-width: 560px) {
  .users-invite-form input {
    min-width: 0;
    flex: 1 1 100%;
  }
}

/* ---------- Help & docs ---------- */

.help-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  width: 280px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

.help-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.87rem;
  font-family: inherit;
  color: var(--text);
}

.help-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.help-nav {
  position: sticky;
  top: 1.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.help-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-nav-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 6px;
}

.help-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.help-nav-link:hover:not(:disabled) {
  background: var(--surface-2);
}

.help-nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.help-nav-link:disabled {
  color: var(--muted);
  cursor: default;
}

.help-nav-icon {
  display: flex;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}

.help-nav-soon {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 999px;
}

.help-content {
  min-width: 0;
}

.help-article {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.9rem 2.1rem 2.3rem;
}

.help-article.active {
  display: block;
}

.help-article-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.help-article h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.help-article .help-lede {
  color: var(--muted);
  font-size: 0.96rem;
  max-width: 640px;
  margin: 0 0 1.7rem;
}

.help-article h2 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  margin: 2.1rem 0 0.9rem;
}

.help-article h2:first-of-type {
  margin-top: 0;
}

.help-article p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 0.9rem;
}

.help-article code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

.help-callout {
  display: flex;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 1.8rem;
}

.help-callout svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

.help-callout p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text);
}

.help-callout strong {
  color: var(--accent);
}

.help-steps {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin: 0 0 1.8rem;
}

.help-step {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.help-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-step-body h3 {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.help-step-body p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.help-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin: 0 0 1.8rem;
}

.help-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.help-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-card h4 {
  margin: 0;
  font-size: 0.9rem;
}

.help-card p {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.5;
  color: var(--muted);
}

.help-article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}

.help-article-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .help-nav-group {
    flex: 1 1 auto;
  }

  .phead .help-search {
    width: 100%;
  }
}

.login-error {
  margin: 0 0 1.1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.85rem;
  display: none;
}

.login-error.visible {
  display: block;
}

.login-submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.form-msg {
  margin: 0 0 1.1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  display: none;
}

.form-msg.visible {
  display: block;
}

.form-msg.err {
  background: var(--error-soft);
  color: var(--error);
}

.form-msg.ok {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: var(--success);
}

.code-input {
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.4rem;
  letter-spacing: 0.5rem;
}

.in:disabled,
.in[readonly] {
  color: var(--muted);
}

/* ================= PHONE INPUT (country code + masking) ================= */

.phone-input {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: border 0.15s, box-shadow 0.15s;
}

.phone-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.phone-input-country {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  padding: 11px 10px 11px 14px;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.phone-input-country:hover {
  background: var(--surface-2);
}

.phone-input-flag {
  display: inline-block;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
  flex-shrink: 0;
}

.phone-input-dial {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.phone-input-chevron {
  font-size: 0.65rem;
  color: var(--muted);
  margin-left: 1px;
}

.phone-input-tel {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  color: inherit;
  padding: 11px 15px 11px 12px;
}

.phone-input-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 300px;
  max-width: min(360px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
  overflow: hidden;
}

.phone-input-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.86rem;
  color: inherit;
  outline: none;
}

.phone-input-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

.phone-input-empty {
  padding: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.phone-input-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.phone-input-option.active,
.phone-input-option:hover {
  background: var(--accent-soft);
}

.phone-input-option.selected {
  color: var(--accent);
  font-weight: 600;
}

.phone-input-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.phone-input-option-dial {
  font-size: 0.82rem;
  color: var(--muted);
  flex-shrink: 0;
}
/* ---------- Connections ---------- */
.connections-page { max-width: 936px; width: 100%; margin: 0 auto; }
.connections-heading { margin: 0 0 1rem; }
.connections-heading h2 { margin: 0; color: var(--text); font-size: 1.28rem; font-weight: 700; letter-spacing: -0.02em; }
.connections-heading p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.84rem; }
.connections-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: start; gap: 1rem; }
.connections-main-column, .connections-side-column { display: flex; min-width: 0; flex-direction: column; gap: 1rem; }
.connections-card { min-width: 0; overflow: hidden; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.connections-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.7rem; }
.connections-card h3 { margin: 0; color: var(--text); font-size: 0.87rem; font-weight: 700; }
.connections-status { display: inline-flex; align-items: center; flex-shrink: 0; gap: 0.34rem; padding: 0.28rem 0.6rem; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 0.67rem; font-weight: 700; white-space: nowrap; }
.connections-status i { width: 0.34rem; height: 0.34rem; border-radius: 50%; background: currentColor; }
.connections-profile-row, .connections-list-row { display: flex; align-items: center; min-width: 0; gap: 0.7rem; }
.connections-profile-row { padding-bottom: 0.7rem; border-bottom: 1px solid var(--border); }
.connections-list { display: flex; flex-direction: column; }
.connections-list-row { min-height: 3.45rem; padding: 0.54rem 0; border-bottom: 1px solid var(--border); }
.connections-list-row:last-child { border-bottom: 0; }
.connections-brand-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2rem; width: 2rem; height: 2rem; overflow: hidden; border-radius: 0.65rem; color: white; font-size: 0.86rem; font-weight: 700; }
.connections-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.connections-brand-mark.facebook { background: #2374e1; }
.connections-brand-mark.google, .connections-brand-mark.bing { background: #fff; border: 1px solid var(--border); }
.connections-brand-mark.gmb { background: #fff; border: 1px solid var(--border); color: #1a73e8; }
.connections-brand-mark.instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.connections-brand-mark.linkedin { background: #1268ad; }
.connections-brand-mark.x { background: #11131a; }
.connections-brand-mark.stripe { background: #635bff; }
.connections-brand-mark.zapier { background: #ff4f00; }
.connections-brand-mark.mailchimp { background: #06a83d; }
.connections-profile-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 0.12rem; }
.connections-profile-copy strong, .connections-toggle-row strong { overflow: hidden; color: var(--text); font-size: 0.78rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.connections-profile-copy span, .connections-toggle-row span { overflow: hidden; color: var(--muted); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.connections-action { flex: 0 0 auto; min-width: 4.9rem; padding: 0.43rem 0.75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.68rem; font-weight: 700; cursor: pointer; transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.connections-action:hover { background: var(--surface-2); }
.connections-action.primary { border-color: transparent; background: var(--accent); color: white; box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.connections-action.primary:hover { box-shadow: 0 9px 22px color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-1px); }
.connections-action:disabled { opacity: 0.5; box-shadow: none; cursor: not-allowed; }
.connections-action:disabled:hover { background: var(--surface); color: var(--text); transform: none; }
.connections-action.primary:disabled,
.connections-action.primary:disabled:hover { background: var(--accent); color: white; }
.connections-options { display: flex; flex-direction: column; }
.connections-toggle-row { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 1rem; padding: 0.68rem 0; border-bottom: 1px solid var(--border); }
.connections-toggle-row:last-child { border-bottom: 0; }
.connections-toggle-row > div { display: flex; min-width: 0; flex-direction: column; gap: 0.08rem; }
.connections-switch { display: flex; align-items: center; flex: 0 0 2.25rem; width: 2.25rem; height: 1.2rem; padding: 0.15rem; border: 0; border-radius: 999px; background: #c7cbd2; cursor: pointer; transition: background 0.15s ease; }
.connections-switch span { display: block; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); transition: transform 0.15s ease; }
.connections-switch.on { background: var(--success); }
.connections-switch.on span { transform: translateX(1.05rem); }
.connections-why-card { padding: 1rem 1.1rem 1.1rem; }
.connections-why-card p { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.55; }
@media (max-width: 820px) {
  .connections-layout { grid-template-columns: 1fr; }
  .connections-side-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr); align-items: start; }
}
@media (max-width: 560px) {
  .connections-heading h2 { font-size: 1.15rem; }
  .connections-card { padding: 0.9rem; }
  .connections-profile-row { align-items: flex-start; flex-wrap: wrap; }
  .connections-profile-row .connections-action { margin-left: 2.7rem; }
  .connections-list-row { gap: 0.55rem; }
  .connections-list-row .connections-status { display: none; }
  .connections-side-column { display: flex; }
  .connections-action { min-width: 4.5rem; padding-inline: 0.55rem; }
}

/* Search console connect modals (GoogleSearchConsoleModal.tsx,
   BingSearchConsoleModal.tsx) — reuse the generic .modal-* shell from
   SiteLinksModal, these are just their shared step/domain-list content. */
.modal-header-mark--google, .modal-header-mark--bing { background: #fff; border: 1px solid var(--border); box-shadow: none; }
.modal-header-mark--google img, .modal-header-mark--bing img { width: 20px; height: 20px; object-fit: contain; }
.sc-step { display: flex; flex-direction: column; gap: 0.9rem; }
.sc-domain-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 220px; overflow-y: auto; }
.sc-domain-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sc-domain-row:hover { background: var(--surface-2); }
.sc-domain-row.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sc-domain-row input { margin: 0; accent-color: var(--accent); }
.sc-domain-row-host { flex: 1; overflow: hidden; font-size: 0.82rem; font-weight: 600; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.sc-step-cta { align-self: stretch; }
.sc-step-status { margin: 0; color: var(--muted); font-size: 0.85rem; text-align: center; }
.sc-step-status--success { color: var(--success); font-weight: 600; }
.sc-step-error { margin: 0; color: var(--danger, #d92d20); font-size: 0.85rem; }
.sc-step-hint { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.sc-step-hint a { color: var(--accent); }
.sc-step-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sc-spin 0.8s linear infinite;
}
@keyframes sc-spin {
  to { transform: rotate(360deg); }
}

/* Instagram schedule page reuses every .facebook-* layout class as-is (same
   generic card/composer/calendar structure) — these overrides just swap the
   hardcoded Facebook blue avatars for the Instagram gradient already used by
   .connections-brand-mark.instagram above. */
.instagram-schedule-page .facebook-preview-avatar,
.instagram-schedule-page .facebook-page-avatar,
.instagram-schedule-page .facebook-picker-avatar {
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}

/* ---------- Change-plan page (/billing/plans) ---------- */

.plans-page-inner {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
}

.plans-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.plans-page-header h2 {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plans-page-current {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.plans-page-current strong {
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

.plans-page .plan-card-current {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.plans-page .plan-grid {
  margin: 0 auto;
}

.plans-page .plan-card-btn {
  margin-top: auto;
}

.plans-page .plan-modal-loading {
  position: fixed;
  z-index: 120;
  border-radius: 0;
}

/* ---------- Primary / default domain badges ---------- */

.domain-primary-badge,
.domain-default-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.domain-primary-badge {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.domain-default-badge {
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* ---------- Features tab: show/hide "Coming soon" cards ---------- */

.features-hide-soon .feature-card-disabled,
.features-hide-soon .features-section-soon {
  display: none;
}

.features-soon-toggle {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* ---------- Help: community / social ---------- */

.help-community-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.help-community-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.help-community-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.help-community-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.help-community-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.help-community-icon svg {
  width: 18px;
  height: 18px;
}

.help-community-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.help-community-name {
  font-size: 0.85rem;
  font-weight: 600;
}

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

.help-community-arrow {
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.help-community-card:hover .help-community-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

@media (prefers-reduced-motion: reduce) {
  .help-community-card,
  .help-community-arrow {
    transition: none;
  }
  .help-community-card:hover,
  .help-community-card:hover .help-community-arrow {
    transform: none;
  }
}

/* ---------- Media Room tab ---------- */
.media-subtabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; overflow-x: auto; }
.media-subtab { padding: 0.55rem 0.95rem; border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 0.88rem; font-weight: 500; white-space: nowrap; cursor: pointer; }
.media-subtab:hover { color: var(--text); }
.media-subtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.media-subtab-empty { min-height: 240px; }
.media-filterbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.media-search { flex: 1; max-width: 300px; padding: 0.5rem 0.95rem; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.86rem; }
.media-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
.media-card { display: flex; flex-direction: column; padding: 0; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; color: inherit; font: inherit; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.media-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.media-thumb { position: relative; display: block; height: 140px; background: var(--bg-alt); }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-kind { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(11, 14, 23, 0.65); color: #fff; font-size: 0.66rem; font-weight: 700; }
.media-card-body { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.7rem 0.8rem 0.8rem; min-width: 0; }
.media-card-name { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.media-tag { padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 0.66rem; font-weight: 600; }
.media-tag.muted { font-weight: 500; opacity: 0.7; }
.media-card-skeleton { height: 220px; border-radius: 14px; background: var(--bg-alt); animation: pulse 1.4s ease-in-out infinite; }
.media-modal-card { max-width: 560px; }
.media-dropzone { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 1.6rem 1rem; border: 2px dashed var(--border); border-radius: 14px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 0.82rem; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.media-dropzone b { color: var(--text); font-size: 0.9rem; }
.media-dropzone svg { color: var(--accent); }
.media-dropzone:hover, .media-dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.media-upload-list { list-style: none; margin: 1rem 0 0; padding: 0; max-height: 200px; overflow-y: auto; }
.media-upload-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.media-upload-row:last-child { border-bottom: none; }
.media-upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.media-upload-size { color: var(--muted); flex-shrink: 0; }
.media-upload-status { flex-shrink: 0; max-width: 45%; color: var(--muted); text-align: right; }
.media-upload-row.done .media-upload-status { color: #1a9e5c; font-weight: 600; }
.media-upload-row.error .media-upload-status { color: #d64b3f; }
.media-modal-tags { margin-top: 1.1rem; }
.media-modal-tags h3 { margin: 0 0 0.2rem; font-size: 0.95rem; }
.media-modal-tags p { margin: 0 0 0.6rem; font-size: 0.8rem; color: var(--muted); }
.media-modal-error { margin: 0.75rem 0 0; font-size: 0.82rem; color: #d64b3f; }
.media-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }
.media-actions-spacer { flex: 1; }
.media-confirm-text { margin-right: auto; font-size: 0.85rem; color: var(--text-soft); }
.media-delete-link { color: #d64b3f; }
.media-danger-btn { background: #d64b3f; border-color: #d64b3f; }
.media-detail-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
.media-detail-preview { display: flex; align-items: center; justify-content: center; max-height: 280px; border-radius: 14px; overflow: hidden; background: var(--bg-alt); }
.media-detail-preview img, .media-detail-preview video { max-width: 100%; max-height: 280px; display: block; }
.media-tag-input-row { display: flex; gap: 0.5rem; }
.media-tag-input { flex: 1; padding: 0.5rem 0.85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.86rem; }
.media-tag-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.media-tag-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.media-tag-chip { padding: 0.3rem 0.8rem; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--muted); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.media-tag-chip:hover { border-color: var(--accent); }
.media-tag-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.media-thumb--contain { background: repeating-conic-gradient(var(--bg-alt) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px; }
.media-thumb--contain img { object-fit: contain; }
.media-card-usage { font-size: 0.72rem; color: var(--muted); }
a.media-card { text-decoration: none; }
.media-card--static { cursor: default; }
.media-card--static:hover { border-color: var(--border); transform: none; }

.media-folder-select { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; font-size: 0.85rem; font-weight: 600; }
.media-folder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 760px) { .media-folder-grid { grid-template-columns: 1fr; } }
.media-folder-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; padding: 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.media-folder-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.media-folder-card svg { color: var(--accent); }
.media-folder-name { font-size: 0.95rem; font-weight: 700; }
.media-folder-count { font-size: 0.78rem; color: var(--muted); }
.media-folder-back { margin-bottom: 0.9rem; padding: 0; border: none; background: none; color: var(--muted); font: inherit; font-size: 0.86rem; cursor: pointer; }
.media-folder-back:hover { color: var(--text); }
.media-folder-back b { color: var(--text); }
.media-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .media-stat-grid { grid-template-columns: repeat(2, 1fr); } }
.media-stat-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm, 0 6px 18px rgba(11, 14, 23, 0.06)); }
.media-stat-label { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.media-stat-value { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.media-stat-sub { font-size: 0.8rem; color: var(--muted); }
.media-stat-spinner { display: inline-block; width: 22px; height: 22px; margin: 0.3rem 0; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
