/* ============================================================
   DevKit — styles.css
   privotools.com/dev-tools/
   Accent: #06b6d4 (cyan)
   ============================================================ */

:root {
  --accent: #06b6d4;
  --accent-dim: rgba(6, 182, 212, 0.10);
  --accent-glow: rgba(6, 182, 212, 0.22);
  --bg: #0f0f13;
  --surface: #1a1a20;
  --surface-2: #141418;
  --border: #2a2a32;
  --text: #e8e8f0;
  --text-dim: #8888a0;
  --radius: 12px;
  --radius-sm: 8px;
  --content-max: 1080px;
  --mono: ui-monospace, 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-width: 320px;
}
a { color: inherit; }

.container {
  width: min(100% - 2rem, var(--content-max));
  margin: 0 auto;
}

/* ---- Nav ---- */
.site-nav {
  background: #121218;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav-inner {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-back {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-back:hover { color: var(--text); }
.wordmark:focus-visible,
.nav-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- Hero ---- */
.hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-dim);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.85rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  margin: 0.9rem auto 0;
  max-width: 600px;
  color: var(--text-dim);
  font-size: clamp(0.93rem, 2.4vw, 1.06rem);
}

/* ---- Tool section ---- */
.tool-section { padding-bottom: 1.5rem; }

/* ---- Privacy strip ---- */
.privacy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.81rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}

/* ---- Ad slot ---- */
.ad-slot {
  width: 100%;
  min-height: 90px;
  margin: 0.5rem 0 1rem;
}

/* ---- Tabs ---- */
.tabs-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  border-bottom: 2px solid var(--border);
}
.tabs-wrapper::-webkit-scrollbar { height: 4px; }
.tabs-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.tab-list {
  display: flex;
  min-width: max-content;
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 1.05rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-dim);
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.14s, border-color 0.14s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab-icon {
  font-family: var(--mono);
  font-size: 0.78rem;
  opacity: 0.75;
  letter-spacing: 0;
}

/* ---- Tab panels ---- */
.tab-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.5rem;
}
.tab-panel[hidden] { display: none; }

.panel-header { margin-bottom: 1.1rem; }
.panel-title { margin: 0 0 0.3rem; font-size: 1.12rem; font-weight: 700; }
.panel-desc { margin: 0; color: var(--text-dim); font-size: 0.88rem; }

/* ---- Toolbar ---- */
.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  align-items: center;
}
.panel-toolbar.centered { justify-content: center; }
.toolbar-spacer { flex: 1; }
.btn-group { display: flex; gap: 0.3rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.42rem 0.82rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.09s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { background: #1e1e28; border-color: #3a3a46; }
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent-dim);
  border-color: rgba(6, 182, 212, 0.38);
  color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: rgba(6, 182, 212, 0.17); border-color: rgba(6, 182, 212, 0.65); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}
.btn-sm.copied { color: #4ade80 !important; border-color: rgba(74,222,128,0.4) !important; }

.file-btn { cursor: pointer; }
.copy-below { margin-top: 0.5rem; align-self: flex-start; }

/* ---- IO elements ---- */
.io-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 680px) { .io-grid { grid-template-columns: 1fr; } }

.io-stack { display: flex; flex-direction: column; gap: 0.9rem; }
.io-col { display: flex; flex-direction: column; gap: 0.35rem; }

/* Consistent header row height for both columns so textareas line up */
.io-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.75rem;
}

.io-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.io-textarea {
  width: 100%;
  min-height: 200px;
  padding: 0.72rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.14s;
}
.io-textarea:focus { outline: none; border-color: var(--accent); }
.io-textarea[readonly] { color: var(--text-dim); cursor: default; }
.io-textarea::placeholder { color: #4a4a62; }

.io-input {
  width: 100%;
  padding: 0.58rem 0.72rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.14s;
}
.io-input:focus { outline: none; border-color: var(--accent); }
.io-input::placeholder { color: #4a4a62; }

.io-pre {
  margin: 0;
  padding: 0.72rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  max-height: 300px;
  overflow-y: auto;
}

.mono { font-family: var(--mono) !important; }

/* ---- Status bar ---- */
.status-bar {
  margin-top: 0.65rem;
  min-height: 1.4rem;
  font-size: 0.84rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.status-bar.success { color: #4ade80; }
.status-bar.error   { color: #f87171; }
.status-bar.info    { color: var(--accent); }

/* ---- Hash results ---- */
.hash-results {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.hash-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  transition: border-color 0.14s;
}
.hash-row.filled { border-color: rgba(6,182,212,0.25); }
.hash-algo {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  width: 4.8rem;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  font-family: var(--mono);
}
.hash-value {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-dim);
  word-break: break-all;
  line-height: 1.4;
  transition: color 0.14s;
}
.hash-value.filled { color: var(--text); }

/* ---- JWT ---- */
.jwt-input { min-height: 90px; resize: vertical; }

.jwt-expiry-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 1rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 1rem;
  font-family: var(--mono);
}
.jwt-expiry-badge.valid   { background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.5); color: #4ade80; }
.jwt-expiry-badge.expired { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.5); color: #f87171; }
.jwt-expiry-badge.no-exp  { background: var(--accent-dim); border: 1px solid rgba(6,182,212,0.3); color: var(--accent); }

.jwt-panels {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 680px) { .jwt-panels { grid-template-columns: 1fr; } }

.jwt-section { display: flex; flex-direction: column; gap: 0.45rem; }
.jwt-section:last-child { grid-column: 1 / -1; }

.jwt-section-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.jwt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.jwt-section-title { margin: 0; font-size: 0.86rem; font-weight: 600; flex: 1; }
.io-pre.sig { color: var(--text-dim); font-size: 0.76rem; word-break: break-all; }
.sig-note { margin: 0.3rem 0 0; font-size: 0.79rem; color: var(--text-dim); }

/* ---- Timestamp ---- */
.ts-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 600px) { .ts-grid { grid-template-columns: 1fr; } }

.ts-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.ts-card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}
.ts-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.ts-unit-toggle {
  display: flex;
  gap: 0.65rem;
  font-size: 0.83rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.ts-unit-toggle label { display: flex; align-items: center; gap: 0.25rem; cursor: pointer; }

.ts-results { display: flex; flex-direction: column; gap: 0.45rem; }
.ts-result-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
}
.ts-label {
  color: var(--text-dim);
  font-size: 0.76rem;
  width: 6rem;
  flex-shrink: 0;
}
.ts-value { flex: 1; font-size: 0.8rem; word-break: break-all; }
.ts-value.filled { color: var(--text); }

/* ---- Regex ---- */
.regex-builder { margin-bottom: 1rem; }
.regex-input-row {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  transition: border-color 0.14s;
}
.regex-input-row:focus-within { border-color: var(--accent); }
.regex-slash {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--accent);
  padding: 0 0.25rem;
  user-select: none;
  line-height: 1;
}
.regex-pattern {
  flex: 1;
  background: none;
  border: none;
  padding: 0.2rem 0.25rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
}
.regex-pattern:focus { outline: none; }
.regex-pattern::placeholder { color: #4a4a62; }
.regex-flags {
  display: flex;
  gap: 0.55rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--border);
  margin-left: 0.25rem;
}
.flag-label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.12s;
  user-select: none;
}
.flag-label:has(input:checked) { color: var(--accent); }

.regex-error {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: #f87171;
  font-family: var(--mono);
}

/* Regex test textarea with highlight overlay */
.regex-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 0.14s;
}
.regex-box:focus-within { border-color: var(--accent); }

.regex-highlight {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 0.72rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  pointer-events: none;
  color: transparent;
  border-radius: var(--radius-sm);
}
.regex-highlight mark {
  background: rgba(6, 182, 212, 0.28);
  border-radius: 2px;
  color: transparent;
  outline: 1px solid rgba(6, 182, 212, 0.45);
}
.regex-test-ta {
  display: block;
  position: relative;
  width: 100%;
  min-height: 160px;
  padding: 0.72rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text);
  caret-color: var(--text);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.65;
  resize: vertical;
  z-index: 1;
}
.regex-test-ta:focus { outline: none; }
.regex-test-ta::placeholder { color: #4a4a62; }

.regex-stats {
  margin-top: 0.55rem;
  font-size: 0.84rem;
  color: var(--text-dim);
  min-height: 1.4rem;
  font-family: var(--mono);
}
.regex-stats strong { color: var(--accent); }

.regex-matches {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.match-item {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.38rem 0.72rem;
  font-size: 0.82rem;
}
.match-num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
  flex-shrink: 0;
  width: 1.6rem;
  opacity: 0.7;
}
.match-val { font-family: var(--mono); word-break: break-all; flex: 1; }
.match-pos { color: var(--text-dim); font-size: 0.76rem; margin-left: auto; flex-shrink: 0; font-family: var(--mono); }

/* ---- SEO / long-form content ---- */
.seo-section {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.seo-section h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  letter-spacing: -0.015em;
}
.seo-section h3 { margin: 1.3rem 0 0.4rem; font-size: 0.98rem; font-weight: 700; }
.seo-section p { margin: 0 0 0.8rem; color: var(--text-dim); font-size: 0.93rem; }
.seo-section p:last-child { margin-bottom: 0; }
.seo-section ul { padding-left: 1.3rem; margin: 0 0 0.8rem; color: var(--text-dim); font-size: 0.93rem; }
.seo-section li { margin-bottom: 0.3rem; }
.seo-section strong { color: var(--text); }
.seo-section code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  color: var(--accent);
}

.tool-explainer-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-top: 0.9rem;
}
.explainer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
}
.explainer-card h3 { margin: 0 0 0.35rem; font-size: 0.9rem; color: var(--accent); }
.explainer-card p  { margin: 0; font-size: 0.85rem; color: var(--text-dim); }

/* ---- FAQ ---- */
.faq-item { border-top: 1px solid var(--border); padding: 0.95rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item h3 { margin: 0 0 0.4rem; font-size: 0.96rem; font-weight: 600; }
.faq-item p  { margin: 0; color: var(--text-dim); font-size: 0.91rem; }

.seo-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.88rem;
  overflow-x: auto;
  display: block;
}
.seo-section table thead th {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.seo-section table tbody td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
  color: var(--text-dim);
}
.seo-section table tbody tr:hover td { background: rgba(255,255,255,0.025); }
.seo-section table tbody td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.seo-section table code { font-family: var(--mono); font-size: 0.82em; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0.1em 0.35em; color: var(--accent); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}
.footer-links { display: inline-flex; align-items: center; gap: 1rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- Responsive misc ---- */
@media (max-width: 420px) {
  .tab-btn { padding: 0.65rem 0.75rem; font-size: 0.82rem; }
  .tab-icon { display: none; }
  .panel-toolbar { gap: 0.35rem; }
  .btn { font-size: 0.82rem; padding: 0.4rem 0.65rem; }
}

/* ── How to Use Guide ──────────────────────────────────────────────────── */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0 1.75rem;
}

.guide-step {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.guide-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--accent-dim);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.15rem;
}

.guide-step strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.guide-step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.guide-step kbd {
  display: inline-block;
  padding: 0.1em 0.4em;
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

p.guide-blog-link {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  line-height: 1.6;
}

p.guide-blog-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

p.guide-blog-link a:hover {
  text-decoration: underline;
}