/* Custom styles layered on top of the design-system tokens.
   Shared by index.html and support.html. */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--color-page-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
[data-lucide] { stroke-width: 1.75; }

.nav-link { transition: color 120ms; }
.nav-link:hover { color: var(--color-accent); }
.nav-link-active { color: var(--color-accent); }

/* Site header (shared across all pages). */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.site-header-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-right: auto; }
.brand-logo { width: 32px; height: 32px; object-fit: contain; display: block; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.site-nav {
  display: flex; align-items: center; gap: 26px;
  font-size: 14px; font-weight: 500; color: var(--color-text-secondary);
}
.lang-switch {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
  background: var(--color-surface-sunken); border: 1px solid var(--color-border);
  border-radius: var(--radius-control); padding: 3px;
}
.lang-btn {
  padding: 5px 11px; font-size: 12px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-sans); line-height: 1.2; white-space: nowrap;
  background: transparent; color: var(--color-text-secondary);
}

/* Mobile: brand + language switch share the first row,
   the nav wraps onto its own full-width second row. */
@media (max-width: 640px) {
  .site-header-inner { flex-wrap: wrap; padding: 10px 16px; gap: 8px 12px; }
  .site-nav { order: 3; width: 100%; gap: 20px; }
  .brand-logo { width: 28px; height: 28px; }
  .brand-name { font-size: 15px; }
  .lang-btn { padding: 4px 9px; font-size: 11px; }
}

/* Tools dropdown (header navigation). */
.dropdown { position: relative; }
.dropdown-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0; padding: 0; border: none; background: none;
  font: inherit; font-weight: 500; color: inherit; cursor: pointer;
}
.dropdown-toggle .dd-chev { transition: transform 150ms var(--ease-standard, ease); }
.dropdown[data-open="true"] .dd-chev { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 30;
  min-width: 210px; display: none; flex-direction: column; gap: 2px;
  padding: 6px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
}
.dropdown[data-open="true"] .dropdown-menu { display: flex; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 9px 11px; border-radius: var(--radius-control);
  font-size: 14px; font-weight: 500; color: var(--color-text-primary);
  transition: background 120ms, color 120ms;
}
.dropdown-item:hover { background: var(--color-surface-sunken); color: var(--color-accent); }
.dropdown-item[aria-current="page"] { background: var(--color-accent-soft); color: var(--color-accent); }
.dropdown-item [data-lucide], .dropdown-item svg { flex-shrink: 0; color: var(--color-accent); }

.badge-accent {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  background: var(--color-accent-soft); color: var(--color-accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}

.btn-primary,
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-control);
  font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background 120ms, transform 80ms, border-color 120ms;
}
.btn-primary {
  padding: 13px 22px; font-size: 15px;
  background: var(--color-accent); color: #fff;
  border: 1px solid var(--color-accent);
}
.btn-primary:hover { background: var(--color-accent-hover, #4338CA); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  padding: 10px 18px; font-size: 14px;
  background: var(--color-surface); color: var(--color-accent);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-accent-soft); border-color: var(--color-accent-soft); }
.btn-secondary:active { transform: scale(0.98); }

.btn-primary[disabled],
.btn-secondary[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Form controls (shared utilities). */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-size: 13px; font-weight: 600; color: var(--color-text-primary);
}
.field-label .req { color: var(--color-accent); margin-left: 2px; }
.field-hint { font-size: 12px; line-height: 1.5; color: var(--color-text-secondary); }

.control {
  width: 100%; font-family: var(--font-sans); font-size: 14px;
  color: var(--color-text-primary); background: var(--color-surface);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-control);
  padding: 11px 13px; line-height: 1.45;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.control::placeholder { color: var(--color-text-disabled); }
.control:focus { outline: none; border-color: var(--color-accent); box-shadow: var(--focus-ring); }
.control[aria-invalid="true"] { border-color: var(--color-caution); }

textarea.control { resize: vertical; min-height: 150px; }

select.control {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}

/* Screenshot slots for the usage guide.
   A real image is shown once an <img data-shot> gains a data-src;
   until then the dashed placeholder stays visible (wired in app.js). */
.shot { margin: 0; }
.shot-frame {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-card);
  background: var(--color-surface-sunken);
}
.shot-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shot-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center;
  border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius-card);
  color: var(--color-text-disabled);
}
.shot-ph-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-control);
  background: var(--color-surface); color: var(--color-text-secondary);
}
.shot-ph-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; }
.shot-ph-hint { font-size: 11px; line-height: 1.4; }

/* Browser-frame hero mock. Holds a real product screenshot
   (img[data-shot] + data-src) and falls back to the CSS popup
   mock (data-shot-ph) until a screenshot is dropped in. */
.bz {
  width: 100%; max-width: 420px; justify-self: center;
  border: 1px solid var(--color-border); border-radius: 14px;
  background: var(--color-surface); box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.bz-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 13px; border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-sunken);
}
.bz-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--color-border-strong); flex-shrink: 0; }
.bz-url {
  margin-left: 6px; flex: 1; min-width: 0;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1px solid var(--color-border);
  font-family: var(--font-mono); font-size: 11px; color: var(--color-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bz-body {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--color-surface-sunken);
}
.bz-body .shot-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bz-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
