@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #f4f4f2;
  --ink: #101012;
  --muted: #6b6b6b;
  --primary: #1f6feb;
  --primary-dark: #1247a6;
  --card: #ffffff;
  --border: #e6e2dc;
  --accent: #ffe9a8;
  --shadow: 0 14px 40px rgba(16, 16, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  background: radial-gradient(circle at top left, #fff8e8 0%, #f2f4f8 45%, #eef0f4 100%);
  color: var(--ink);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  min-width: 0;
}

.brand-link {
  color: var(--ink);
  text-decoration: none;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
}

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

.brand-link:focus,
.brand-link:focus-visible,
.brand-link:active {
  outline: none;
  box-shadow: none;
  border: 0;
}

.brand-logo {
  width: auto;
  height: 56px;
  max-width: 260px;
  max-height: 56px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.brand-text {
  line-height: 1.1;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 16px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding-bottom: 6px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-dark);
}

.nav-link.active,
.nav-primary {
  color: var(--primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

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

.user-email {
  font-size: 14px;
  color: var(--muted);
}

.content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card.accent {
  background: linear-gradient(140deg, #fff3c4 0%, #fffdf6 100%);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

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

.metric {
  font-size: 40px;
  font-weight: 700;
  margin: 12px 0;
}

.muted {
  color: var(--muted);
  margin: 8px 0 0;
}

.list {
  padding-left: 18px;
  margin: 12px 0 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.form-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.privacy-help {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfcff;
  color: #4b5563;
  font-size: 14px;
}

.privacy-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.privacy-option {
  display: inline-flex;
  position: relative;
}

.privacy-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  min-width: 0;
}

.privacy-option-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.privacy-option:hover .privacy-option-card {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 16, 18, 0.08);
}

.privacy-option input:checked + .privacy-option-card {
  border-color: rgba(47, 111, 226, 0.32);
  box-shadow: 0 10px 24px rgba(47, 111, 226, 0.14);
  background: rgba(47, 111, 226, 0.08);
}

.privacy-option-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.privacy-option-text {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.locked-template-panel {
  display: grid;
  gap: 8px;
}

.locked-template-value {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(47, 111, 226, 0.18);
  background: rgba(47, 111, 226, 0.08);
  color: var(--primary);
  font-weight: 700;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  font-weight: 700;
}

.label {
  font-weight: 600;
  margin-bottom: 6px;
  display: inline-block;
}

input, select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  min-width: 220px;
}

textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

input:disabled,
select:disabled {
  background: #f2f2f2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 16, 18, 0.12);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-danger {
  background: #fff2f2;
  border: 1px solid #ffd0d0;
  color: #a61b1b;
}

.btn-danger:hover {
  background: #ffe7e7;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-row .btn {
  min-height: 44px;
}

.inline-form {
  display: flex;
  align-items: center;
  margin: 0;
}

.file-input-hidden {
  display: none;
}

.source-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.source-ai {
  background: #e7f1ff;
  color: #1d4ed8;
}

.source-heuristic {
  background: #eef2f7;
  color: #475569;
}

.source-manual {
  background: #f2fff2;
  color: #166534;
}

.source-empty {
  background: #fff4e8;
  color: #9a3412;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.alert-error {
  background: #ffe5e5;
  color: #8f1f1f;
}

.alert-info {
  background: #e8f0ff;
  color: #1c3f8a;
}

.alert-success {
  background: #e3f7ea;
  color: #1f6b3b;
}

.table {
  display: grid;
  gap: 12px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 6px;
}

.table-scroll .table {
  min-width: 100%;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.admin-table .table-head,
.admin-table .table-row {
  grid-template-columns:
    minmax(150px, 1.2fr)
    minmax(170px, 1.15fr)
    minmax(100px, 0.8fr)
    minmax(220px, 1.35fr)
    minmax(160px, 1fr)
    minmax(90px, 0.7fr)
    minmax(100px, 0.7fr)
    minmax(100px, 0.7fr)
    minmax(120px, 0.8fr)
    minmax(150px, 0.9fr);
}

.plans-table .table-head,
.plans-table .table-row {
  grid-template-columns:
    minmax(120px, 1fr)
    minmax(180px, 1.4fr)
    minmax(110px, 0.8fr)
    minmax(110px, 0.8fr)
    minmax(90px, 0.7fr)
    minmax(230px, 1.5fr)
    minmax(120px, 0.8fr);
}

.plans-table {
  min-width: 1080px;
}

.users-table .table-head,
.users-table .table-row {
  grid-template-columns:
    minmax(260px, 1.65fr)
    minmax(160px, 1.2fr)
    minmax(100px, 0.7fr)
    minmax(100px, 0.7fr)
    minmax(150px, 0.9fr)
    minmax(150px, 0.9fr);
}

.users-table {
  min-width: 1180px;
}

.admin-table {
  min-width: 1480px;
}

.users-table .table-row > form {
  display: none;
}

.table-head > div,
.table-row > div {
  min-width: 0;
}

.table-cell {
  min-width: 0;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cell-tight {
  gap: 4px;
}

.table-meta {
  font-size: 12px;
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-users-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-actions {
  position: relative;
}

.row-actions[open] {
  z-index: 25;
}

.row-actions > summary {
  list-style: none;
}

.row-actions > summary::-webkit-details-marker {
  display: none;
}

.row-actions-body {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 92vw);
  z-index: 20;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(16, 16, 18, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invoices-table .table-head,
.invoices-table .table-row {
  grid-template-columns:
    minmax(130px, 0.9fr)
    minmax(180px, 1.2fr)
    minmax(120px, 0.8fr)
    minmax(130px, 0.8fr)
    minmax(100px, 0.7fr)
    minmax(110px, 0.7fr);
}

.invoices-table {
  min-width: 980px;
}

.conversions-table .table-head,
.conversions-table .table-row {
  grid-template-columns:
    minmax(130px, 0.9fr)
    minmax(160px, 1.2fr)
    minmax(160px, 1.2fr)
    minmax(200px, 1.4fr)
    minmax(80px, 0.6fr);
}

.conversions-table {
  min-width: 980px;
}

.logins-table .table-head,
.logins-table .table-row {
  grid-template-columns:
    minmax(130px, 0.9fr)
    minmax(240px, 1.5fr)
    minmax(150px, 1fr)
    minmax(90px, 0.7fr)
    minmax(180px, 1.1fr)
    minmax(140px, 0.9fr);
}

.logins-table {
  min-width: 1060px;
}

.plan-row {
  margin: 0;
}

.plans-table input,
.plans-table select,
.users-table input,
.users-table select,
.admin-table input,
.admin-table select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-stack form {
  margin: 0;
}

.paragraph-form {
  gap: 10px;
  align-items: flex-start;
}

.paragraph-form textarea {
  width: min(640px, 100%);
}

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

.inline-actions-nowrap {
  flex-wrap: nowrap;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-subnav-link {
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}

.admin-subnav-link.active {
  border-color: rgba(31, 111, 235, 0.35);
  background: rgba(31, 111, 235, 0.1);
  color: var(--primary-dark);
}

.preview-card {
  position: sticky;
  top: 90px;
  align-self: flex-start;
}

.preview-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  align-items: start;
}

.preview-frame {
  width: 100%;
  height: 640px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.placeholder-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  max-height: 640px;
  overflow: auto;
}

.placeholder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.placeholder-help {
  font-size: 12px;
  margin: 8px 0 12px;
}

.placeholder-subtitle {
  margin-top: 18px;
  margin-bottom: 8px;
}

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

.placeholder-item {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcff;
}

.placeholder-item-detected {
  grid-template-columns: 1.3fr 1fr;
}

.placeholder-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 600;
  color: #0f2b5b;
}

.placeholder-label {
  font-size: 12px;
  color: #4b5563;
  justify-self: end;
}

.toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.toggle-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.map-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  max-height: 640px;
  overflow: auto;
  background: #fff;
}

.page {
  position: relative;
  margin-bottom: 16px;
}

.page img:not(.brand-logo) {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.line-hit {
  position: absolute;
  border: 1px dashed transparent;
  cursor: pointer;
}

.line-hit:hover {
  border-color: var(--primary);
  background: rgba(31, 111, 235, 0.08);
}

.mapping-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}

.chip.active {
  background: #e0ebff;
  border-color: #b3ccff;
}

.chip.dragging {
  opacity: 0.6;
}

.table-head {
  font-weight: 600;
  color: var(--muted);
}

.table-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.table-compact {
  gap: 8px;
}

.table-compact .table-head {
  font-size: 13px;
}

.table-compact .table-row {
  padding: 8px 0;
}

.table-compact input,
.table-compact select,
.table-compact textarea {
  padding: 10px 12px;
  min-height: 40px;
  font-size: 14px;
}

.table-compact .btn.btn-sm,
.table-compact .btn {
  min-height: 38px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active {
  background: #e0f5e6;
  color: #1f7a3f;
}

.badge-muted {
  background: #f3f3f3;
  color: #7a7a7a;
}

.badge-warning {
  background: #fff3d8;
  color: #9a4d00;
}

.badge-standard {
  background: #e7f1ff;
  color: #1d4ed8;
}

.badge-private {
  background: #f4ecff;
  color: #7c3aed;
}

.auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

.auth-card {
  width: min(420px, 90vw);
  background: var(--card);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.loader {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.loader.show {
  display: flex;
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid #e3e3e3;
  border-top: 3px solid var(--primary);
  animation: spin 1s linear infinite;
}

.result {
  margin-top: 18px;
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f9fbff;
}

.result-card-private {
  background: #fbfffd;
  border-color: rgba(34, 197, 94, 0.2);
}

.download-muted {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

.result-copy {
  min-width: 0;
}

.result-copy strong {
  display: block;
  margin-bottom: 6px;
}

.result-copy .muted {
  margin: 0;
}

.quota-card {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fbfcff;
}

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

.quota-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.quota-date {
  font-size: 12px;
  color: #4b5563;
  font-weight: 600;
}

.quota-value {
  margin-top: 8px;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

.quota-meta {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.quota-meta-soft {
  color: #6b7280;
  font-weight: 500;
}

.quota-bar {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ebedf2;
  overflow: hidden;
}

.quota-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.quota-ok .quota-pill {
  background: #e8f7ee;
  color: #166534;
}

.quota-ok .quota-bar span {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.quota-warning .quota-pill {
  background: #fff3d8;
  color: #9a4d00;
}

.quota-warning .quota-bar span {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.quota-expired .quota-pill {
  background: #fde7e7;
  color: #991b1b;
}

.quota-expired .quota-bar span {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.quota-inline {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #fbfcff;
}

.quota-inline-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.quota-inline-main strong {
  font-size: 24px;
  line-height: 1;
}

.quota-inline-main span {
  color: #4b5563;
  font-size: 14px;
}

.quota-inline-date {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.quota-bar-inline {
  margin-top: 8px;
  height: 8px;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  padding: 14px 40px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer a {
  color: #4b5563;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(16, 16, 18, 0.2);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.cookie-banner-text p {
  margin: 6px 0 0;
  color: #4b5563;
  font-size: 13px;
  max-width: 780px;
}

.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 18px;
}

.legal-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-nav a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
}

.legal-nav a.active {
  border-color: rgba(31, 111, 235, 0.35);
  background: rgba(31, 111, 235, 0.1);
  color: var(--primary-dark);
}

.legal-content h2 {
  margin-top: 0;
}

.legal-content h3 {
  margin-bottom: 8px;
}

.legal-content p,
.legal-content li {
  color: #374151;
}

.guide-hero {
  margin-bottom: 18px;
}

.guide-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.guide-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guide-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 13px;
}

.guide-flow {
  display: grid;
  gap: 14px;
}

.guide-progress-card {
  margin-bottom: 18px;
}

.guide-progress {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.guide-progress-step {
  grid-column: span 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.guide-progress-step strong {
  font-size: 13px;
}

.guide-progress-step span:last-child {
  font-size: 12px;
  color: var(--muted);
}

.guide-progress-icon {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e7efff;
  color: #0f4cc9;
  font-weight: 800;
  font-size: 13px;
}

.guide-progress-line {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f6feb, #8bb1ff);
}

.guide-step {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.guide-step-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
}

.guide-step-summary::-webkit-details-marker {
  display: none;
}

.guide-step-number {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0f4cc9;
  background: #e7efff;
  flex: 0 0 auto;
}

.guide-step-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f7ff;
  color: #1f4fb3;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(31, 111, 235, 0.12);
}

.guide-step-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-step-title span {
  color: var(--muted);
  font-size: 14px;
}

.guide-step-body {
  padding: 0 22px 22px;
  display: grid;
  gap: 14px;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-checklist {
  display: grid;
  gap: 10px;
}

.guide-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfcff;
}

.guide-check::before {
  content: "•";
  color: #1f6feb;
  font-weight: 800;
  line-height: 1.2;
}

.guide-tip,
.guide-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 111, 235, 0.14);
  background: #f4f8ff;
  color: #1f355c;
}

.guide-mini-head {
  margin-bottom: 14px;
}

.guide-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.guide-placeholder-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-placeholder-card code {
  font-size: 15px;
  font-weight: 700;
}

.guide-placeholder-card span {
  color: var(--muted);
  font-size: 14px;
}

.guide-alert-grid {
  margin-top: 18px;
}

.guide-alert-card {
  display: grid;
  gap: 10px;
}

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

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nav {
    flex-wrap: wrap;
  }
  .content {
    padding: 24px;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .result-card {
    flex-direction: column;
    align-items: stretch;
  }
  .table-head,
  .table-row {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

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

  .users-table,
  .plans-table,
  .admin-table {
    min-width: 0;
  }

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

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

  .guide-hero-top,
  .guide-step-summary {
    align-items: flex-start;
  }

  .guide-progress {
    grid-template-columns: 1fr;
  }

  .guide-progress-line {
    height: 10px;
  }
}

@media (max-width: 640px) {
  .table-head,
  .table-row {
    grid-template-columns: 1fr;
  }
  .brand-logo {
    height: 44px;
    max-width: 204px;
    max-height: 44px;
  }
  .logout {
    flex-direction: column;
    align-items: flex-start;
  }
  .guide-step-summary {
    padding: 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .guide-step-body {
    padding: 0 16px 16px;
  }
}
