:root {
  --surface: #f8f9ff;
  --surface-muted: #F8FAFC;
  --on-surface: #0b1c30;
  --primary: #bb0005;
  --primary-container: #e2231a;
  --on-primary: #ffffff;
  --secondary: #072329;
  --secondary-mid: #496269;
  --tertiary: #005da3;
  --border: #E2E8F0;
  --success: #15803D;
  --warning: #B45309;
  --error: #B91C1C;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --font-head: "Public Sans", system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, .font-head { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; }

a { color: var(--tertiary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 260px;
  background: var(--secondary);
  color: #eaf1ff;
  padding: 24px 16px;
  flex-shrink: 0;
}
.app-sidebar .brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 2rem;
  padding: 0 8px;
}
.app-sidebar a {
  display: block;
  color: #cce7ef;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  text-decoration: none;
}
.app-sidebar a:hover, .app-sidebar a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
}
.app-main { flex: 1; padding: 32px 40px; max-width: 1440px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card:hover { box-shadow: var(--shadow); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-primary { background: var(--primary-container); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary); }
.btn-secondary {
  background: transparent;
  border-color: var(--secondary-mid);
  color: var(--secondary);
}
.btn-block { width: 100%; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--secondary-mid);
}
.field input, .field select, .field textarea {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  font: inherit;
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--secondary-mid);
  border-width: 2px;
}

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  color: var(--secondary-mid);
}
.table td { padding: 12px 8px; border-bottom: 1px solid var(--border); }

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}
.chip-success { background: rgba(21,128,61,0.12); color: var(--success); }
.chip-warning { background: rgba(180,83,9,0.12); color: var(--warning); }
.chip-info { background: rgba(3,105,161,0.12); color: var(--tertiary); }
.chip-error { background: rgba(185,28,28,0.12); color: var(--error); }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.alert-error { background: #ffdad6; color: #93000a; }
.alert-ok { background: #dcfce7; color: #166534; }

.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.product-card h3 { margin: 0 0 8px; font-size: 1rem; }
.product-card .stock { font-size: 13px; color: var(--secondary-mid); }
.product-card .actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.product-card input[type=number] { width: 64px; height: 36px; }

.public-top {
  background: var(--secondary);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.public-top a { color: #cce7ef; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

/* ── Guide: 2 designs (mobile vs desktop) ── */

/* Hide/show at breakpoint */
.guide-d { display: none; }
.guide-m { display: block; padding-bottom: 5.5rem; }

@media (min-width: 768px) {
  .guide-m { display: none !important; }
  .guide-d { display: block; }
}

/* ===== MOBILE DESIGN ===== */
.guide-m__intro {
  padding: 1.25rem 0 1.5rem;
}
.guide-m__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-mid);
}
.guide-m__brand {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.guide-m__lead {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5d3f3b;
}

.guide-m__block { margin: 0 0 1.75rem; }

.guide-m__shot {
  margin-inline: -1rem; /* bleed to layout padding */
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #eff4ff;
  overflow: hidden;
}
.guide-m__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: cover;
  object-position: top center;
}
.guide-m__pending {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--secondary-mid);
}
.guide-m__text {
  padding: 0.85rem 0 0;
  position: relative;
}
.guide-m__step {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.guide-m__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--on-surface);
}
.guide-m__body {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--secondary-mid);
}

.guide-m__finish {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 1.25rem 1rem 1.5rem;
  margin-bottom: 1rem;
}
.guide-m__finish-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--on-surface);
}
.guide-m__finish-sub {
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--secondary-mid);
}
.guide-m__btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 2px solid var(--secondary);
  border-radius: 4px;
  color: var(--secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.guide-m__link {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  color: var(--tertiary);
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1rem;
}
.guide-m__roles {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: rgba(73, 98, 105, 0.85);
}
.guide-m__roles li {
  padding: 0.15rem 0 0.15rem 0.75rem;
  position: relative;
}
.guide-m__roles li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: rgba(73, 98, 105, 0.5);
}

.guide-m__dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(248, 249, 255, 0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.guide-m__dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  background: var(--primary-container);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
}
.guide-m__dock-btn:hover { background: var(--primary); text-decoration: none; }

/* ===== DESKTOP DESIGN ===== */
.guide-d__hero {
  background: var(--secondary);
  color: #eaf1ff;
  margin: 0 -1rem 2.5rem;
  padding: 2.5rem 1rem 2.75rem;
}
.guide-d__hero-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1rem;
}
.guide-d__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c9e4ec;
  opacity: 0.9;
}
.guide-d__brand {
  margin: 0;
  font-family: var(--font-head);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.guide-d__lead {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #cce7ef;
}

.guide-d__stage {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 0.5rem 3rem;
}

.guide-d__row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3.5rem;
}
.guide-d__row--alt {
  grid-template-columns: 1fr 280px;
}
.guide-d__row--alt .guide-d__device { order: 2; }
.guide-d__row--alt .guide-d__copy { order: 1; }

.guide-d__bezel {
  position: relative;
  background: #072329;
  border-radius: 1.75rem;
  padding: 0.65rem 0.55rem 0.75rem;
  box-shadow: 0 12px 40px rgba(7, 35, 41, 0.22);
}
.guide-d__notch {
  display: block;
  width: 4.5rem;
  height: 0.35rem;
  margin: 0 auto 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.guide-d__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.85rem;
  background: #eff4ff;
}
.guide-d__pending {
  min-height: 380px;
  border-radius: 0.85rem;
  background: #eff4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--secondary-mid);
}

.guide-d__num {
  display: block;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 0.65rem;
}
.guide-d__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--on-surface);
}
.guide-d__body {
  margin: 0.85rem 0 0;
  max-width: 26rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--secondary-mid);
}

.guide-d__finish {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2.25rem;
  margin-top: 1rem;
}
.guide-d__finish-brand {
  margin: 0;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}
.guide-d__finish-title {
  margin: 0.5rem 0 0;
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--on-surface);
}
.guide-d__finish-sub {
  margin: 0.65rem 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--secondary-mid);
}
.guide-d__roles {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: rgba(73, 98, 105, 0.9);
}
.guide-d__roles li {
  padding: 0.2rem 0 0.2rem 0.85rem;
  position: relative;
}
.guide-d__roles li::before {
  content: "·";
  position: absolute;
  left: 0;
}

.guide-d__finish-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.guide-d__btn-primary,
.guide-d__btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.guide-d__btn-primary {
  background: var(--primary-container);
  color: #fff;
}
.guide-d__btn-primary:hover { background: var(--primary); text-decoration: none; }
.guide-d__btn-secondary {
  border: 2px solid var(--secondary);
  color: var(--secondary);
  background: transparent;
}
.guide-d__btn-secondary:hover {
  background: var(--secondary);
  color: #fff;
  text-decoration: none;
}
.guide-d__link {
  text-align: center;
  font-size: 0.875rem;
  color: var(--tertiary);
  font-weight: 500;
  text-decoration: none;
}

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; }
  .app-main { padding: 16px; }
}
