/* ============================================================
   KnitAdvisor — Global Design System
   Mobile-first · Light theme · Vanilla CSS
   ============================================================ */

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

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Background layers - Clean White/Light Theme */
  --bg:  #FFFFFF;
  --bg2: #F8F8F6;
  --bg3: #F2F2EF;
  --bg4: #EBEBE8;
  --bg5: #E4E4E0;

  /* Borders */
  --line:  #E0E0DC;
  --line2: #D4D4CF;
  --line3: #C8C8C2;

  /* Accents */
  --a1: #1A1A1A;   /* Primary text / accent */
  --a2: #444444;   /* Secondary accent */
  --a3: #D92B2B;   /* Error/Warning */
  --a4: #C87800;   /* Warning/Production */
  --a5: #888888;   /* Muted accent */

  /* Text */
  --t1: #1A1A1A;
  --t2: #555555;
  --t3: #999999;

  /* Pattern colors (standardized, flat) */
  --knit-bg:  #1A1A1A;
  --tuck-bg:  #555555;
  --miss-bg:  #E8E8E4;
  --knit-fg:  #FFFFFF;
  --tuck-fg:  #FFFFFF;
  --miss-fg:  #999999;

  /* Typography */
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --head: 'Inter', system-ui, sans-serif;

  /* Spacing */
  --pad: 16px;
  --pad-lg: 24px;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-xs: 2px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-mid:  200ms ease;
  --t-slow: 350ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--head);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle 2% paper texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--a1); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--t-fast); }
a:hover { border-bottom-color: var(--a1); }

button { cursor: pointer; font-family: var(--mono); }
input, select, textarea { font-family: var(--mono); }

img { max-width: 100%; }

/* ============================================================
   LAYOUT
   ============================================================ */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ============================================================
   HEADER
   ============================================================ */
.hdr {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-family: var(--head);
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -.5px;
  text-decoration: none;
  border-bottom: none;
}
.logo span { color: var(--t3); }

.hdr-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--bg3);
  border: 1px solid var(--line2);
  color: var(--t2);
}

.hdr-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   NAVIGATION TABS
   ============================================================ */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--t3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab-btn:hover { color: var(--t2); }
.tab-btn.active {
  color: var(--a1);
  border-bottom-color: var(--a1);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
}

.card-sm {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.card.accent-green { border-color: var(--line2); background: var(--bg3); }
.card.accent-blue { border-color: var(--line2); background: var(--bg3); }
.card.accent-amber { border-color: var(--line2); background: var(--bg3); }
.card.accent-red { border-color: var(--line2); background: var(--bg3); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.h1 {
  font-family: var(--head);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: -.5px;
}
.h2 {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.2px;
}
.h3 {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 600;
}

.label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
  color: var(--t3);
}
.label.green { color: var(--a1); }
.label.blue  { color: var(--a2); }
.label.amber { color: var(--a4); }

.value-lg {
  font-size: 22px;
  font-weight: 600;
  color: var(--a1);
}
.value-md {
  font-size: 15px;
  font-weight: 600;
  color: var(--a1);
}
.value-sm {
  font-size: 12px;
  font-weight: 500;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
  color: var(--t3);
}

.form-input {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--t1);
  font-family: var(--mono);
  font-size: 14px;
  width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.form-input::placeholder { color: var(--t3); }
.form-input:focus {
  border-color: rgba(26,26,26,.5);
  box-shadow: 0 0 0 3px rgba(26,26,26,.06);
}
.form-input::-webkit-inner-spin-button,
.form-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.form-input[type=number] { -moz-appearance: textfield; }

.form-select {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 10px 32px 10px 12px;
  color: var(--t1);
  font-family: var(--mono);
  font-size: 13px;
  width: 100%;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--t-fast);
}
.form-select:focus { border-color: rgba(26,26,26,.4); outline: none; }
.form-select option { background: var(--bg3); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--head);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--a1);
  color: #FFFFFF;
  border-color: var(--a1);
}
.btn-primary:hover {
  background: #333333;
  border-color: #333333;
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--bg3);
  color: var(--t1);
  border: 1px solid var(--line2);
}
.btn-secondary:hover { border-color: var(--a2); color: var(--a2); }

.btn-ghost {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 12px;
}
.btn-ghost:hover { border-color: var(--t2); color: var(--t1); }

.btn-lg {
  padding: 14px 28px;
  font-size: 14px;
  width: 100%;
  border-radius: var(--radius-sm);
}

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

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}
.badge-green { background: var(--bg3); color: var(--t1); border: 1px solid var(--line2); }
.badge-blue  { background: var(--bg3); color: var(--t1); border: 1px solid var(--line2); }
.badge-amber { background: var(--bg3); color: var(--t1); border: 1px solid var(--line2); }
.badge-red   { background: var(--bg3); color: var(--t1); border: 1px solid var(--line2); }
.badge-gray  { background: var(--bg3); color: var(--t2); border: 1px solid var(--line2); }

/* ============================================================
   RESULT ROWS (key: value pairs)
   ============================================================ */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.result-row:last-child { border: none; padding-bottom: 0; }

.result-key {
  font-size: 13px;
  color: var(--t2);
  flex-shrink: 0;
}
.result-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  text-align: right;
}
.result-val.blue  { color: var(--t1); }
.result-val.amber { color: var(--t1); }
.result-val.white { color: var(--t1); }
.result-val.green { color: var(--t1); }
.result-val.red { color: var(--a3); }

.result-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--t3);
  font-weight: 600;
  padding: 10px 0 4px;
  margin-top: 4px;
}

/* ============================================================
   PATTERN GRID (K/T/M)
   ============================================================ */
.pattern-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.pattern-grid {
  display: grid;
  gap: 3px;
  width: fit-content;
}

.pattern-cell {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  font-size: 12px;
  font-family: var(--mono);
  cursor: default;
  transition: transform var(--t-fast);
  border: 1px solid var(--line2);
}
.pattern-cell:hover { transform: scale(1.05); }
.pattern-cell.K { background: var(--bg4); color: var(--t1); }
.pattern-cell.T { background: var(--bg3); color: var(--t1); border-color: var(--line3); }
.pattern-cell.M { background: var(--bg2); color: var(--t3); }
.pattern-cell.empty { background: var(--bg); color: var(--t3); }

.pattern-axis-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
}

.pattern-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--t2);
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pattern-beds-wrap {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.pattern-bed-label {
  font-size: 9px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

/* ============================================================
   COLLAPSIBLE PANEL
   ============================================================ */
.collapsible-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--t2);
  cursor: pointer;
  transition: color var(--t-fast);
  border-top: 1px solid var(--line);
}
.collapsible-trigger:hover { color: var(--t1); }
.collapsible-trigger .arrow {
  font-size: 10px;
  transition: transform var(--t-mid);
}
.collapsible-trigger.open .arrow { transform: rotate(180deg); }

.collapsible-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--t-slow);
}
.collapsible-body.open { max-height: 1200px; }
.collapsible-inner { padding-bottom: 12px; }

/* ============================================================
   FORMULA TRACE
   ============================================================ */
.trace-step {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.trace-step:last-child { border: none; }
.trace-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg4);
  color: var(--t3);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.trace-content { flex: 1; }
.trace-action { color: var(--t2); font-weight: 600; margin-bottom: 2px; }
.trace-formula { color: var(--t3); font-family: var(--mono); word-break: break-all; }
.trace-result { color: var(--t1); font-weight: 600; margin-top: 2px; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  animation: toast-in var(--t-mid) ease forwards;
  pointer-events: all;
  text-align: center;
}
.toast.success { background: #F0FAF6; border: 1px solid #B6DEC9; color: #1A6640; }
.toast.error   { background: #FDF2F2; border: 1px solid #F0BBBB; color: var(--a3); }
.toast.info    { background: #F0F4FF; border: 1px solid #B8C8F0; color: #2A46A8; }
.toast.out     { animation: toast-out var(--t-mid) ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26,26,26,.15);
  border-top-color: var(--a1);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.loading-overlay.hidden { display: none; }
.loading-text { font-size: 12px; color: var(--t2); }

/* ============================================================
   STAT CARDS (for converter / stats page)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.stat-value {
  font-family: var(--head);
  font-size: 24px;
  font-weight: 800;
  color: var(--a1);
  line-height: 1.1;
}
.stat-label {
  font-size: 9px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* ============================================================
   CONVERTER SPECIFIC
   ============================================================ */
.conv-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.conv-arrow {
  font-size: 18px;
  color: var(--t3);
  text-align: center;
}
.conv-result-box {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.conv-result-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--a1);
}
.conv-formula-note {
  font-size: 10px;
  color: var(--t3);
  margin-top: 6px;
  font-family: var(--mono);
}

/* ============================================================
   WARNING / INFO BOXES
   ============================================================ */
.warning-box {
  background: #FFFBF0;
  border: 1px solid #F0DFA0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.7;
}
.warning-box strong { color: var(--a4); }

.info-box {
  background: #F2F5FF;
  border: 1px solid #C8D4F0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.7;
}
.info-box strong { color: #2A46A8; }

.success-box {
  background: #F0FAF6;
  border: 1px solid #B6DEC9;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.7;
}
.success-box strong { color: #1A6640; }

/* ============================================================
   PRODUCTION CARDS (big number display)
   ============================================================ */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 480px) { .prod-grid { grid-template-columns: 1fr 1fr; } }

.prod-card {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}
.prod-val {
  font-family: var(--head);
  font-size: 20px;
  font-weight: 800;
  color: var(--a1);
}
.prod-unit {
  font-size: 10px;
  color: var(--t3);
  margin-top: 2px;
}

/* ============================================================
   RECENT CALCULATIONS LIST
   ============================================================ */
.recent-list { display: flex; flex-direction: column; gap: 4px; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  text-decoration: none;
}
.recent-item:hover {
  border-color: var(--line3);
  background: var(--bg3);
  text-decoration: none;
}
.recent-fabric { font-size: 12px; color: var(--t1); flex: 1; }
.recent-gsm { font-size: 11px; color: var(--a1); font-weight: 600; }
.recent-time { font-size: 10px; color: var(--t3); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* Top row: nav links */
.footer-nav {
  padding: 18px var(--pad) 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-brand-name {
  font-family: var(--head);
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -.3px;
}
.footer-brand-sub {
  font-size: 10px;
  color: var(--t3);
  font-family: var(--mono);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 11px;
  color: var(--t3);
  transition: color var(--t-fast);
  border-bottom: none;
}
.footer-links a:hover {
  color: var(--t1);
  border-bottom: none;
}

/* Bottom row: platform + sponsor */
.footer-bottom {
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--t3);
}
.footer-platform-label { font-size: 10px; color: var(--t3); }
.footer-platform-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  border-bottom: 1px solid var(--line2);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.footer-platform-link:hover {
  color: var(--t1);
  border-bottom-color: var(--t1);
}

.footer-sponsor {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-sponsor-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
}
.footer-sponsor-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--t1);
  border: 1px solid var(--line2);
  border-radius: 3px;
  padding: 3px 10px;
  letter-spacing: .2px;
  transition: all var(--t-fast);
  background: var(--bg2);
  text-decoration: none;
}
.footer-sponsor-link:hover {
  border-color: var(--line3);
  background: var(--bg3);
  color: var(--t1);
  border-bottom-color: var(--line3);
}
.footer-sponsor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a1);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .footer-nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden  { display: none !important; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.text-green { color: var(--a1); }
.text-blue  { color: var(--a2); }
.text-amber { color: var(--a4); }
.text-muted { color: var(--t2); }
.text-dim   { color: var(--t3); }
.text-sm  { font-size: 11px; }
.text-xs  { font-size: 10px; }
.text-head { font-family: var(--head); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .hide-mobile { display: none !important; }
  .conv-pair {
    grid-template-columns: 1fr;
  }
  .conv-arrow { transform: rotate(90deg); text-align: center; }
}

@media (min-width: 600px) {
  :root { --pad: 22px; }
  .hide-desktop { display: none !important; }
}

/* ============================================================
   MICRO-ANIMATIONS
   ============================================================ */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-in { animation: fade-in .25s ease forwards; }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,178,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(0,255,178,0); }
}
.pulse { animation: pulse-green 2s ease infinite; }

/* Skeleton loading */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
