/* ============================================================
   Mobile PO → IOS · iOS-native feel
   ============================================================ */

:root {
  --bg: #f3f5f7;
  --bg-2: #e8ebef;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #e3e6ea;
  --border-2: #d1d6dc;
  --text: #0f1729;
  --text-2: #475569;
  --text-3: #94a3b8;

  --brand: #0a2247;
  --brand-2: #1a4d99;
  --brand-3: #3a82d4;
  --brand-bg: #eef3fb;

  --green: #10b981;
  --green-bg: #d1fae5;
  --amber: #f59e0b;
  --amber-bg: #fef3c7;
  --red: #ef4444;

  --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.04), 0 1px 3px rgba(15, 23, 41, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 41, 0.08), 0 2px 6px rgba(15, 23, 41, 0.04);
  --shadow-lg: 0 14px 40px rgba(15, 23, 41, 0.12);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);

  --appbar-h: 56px;
  --actionbar-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
}
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }

/* ============ APP BAR ============ */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  padding: var(--safe-top) max(12px, var(--safe-right)) 0 max(12px, var(--safe-left));
  height: calc(var(--appbar-h) + var(--safe-top));
  background: rgba(243, 245, 247, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.appbar.scrolled {
  border-bottom-color: var(--border);
}
.appbar-back {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand-2);
  transition: background 0.15s var(--ease), opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.appbar-back:active { background: rgba(10, 34, 71, 0.08); transform: scale(0.94); }
.appbar-back svg { width: 22px; height: 22px; }
.appbar-back.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
}
.appbar-meta { text-align: center; min-width: 0; }
.appbar-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1;
}
.appbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  justify-self: end;
}

/* ============ VIEWS ============ */
.view { display: none; }
.view.view-active { display: block; animation: viewFade 0.3s var(--ease); }
@keyframes viewFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ HERO ============ */
.hero {
  padding: 8px max(20px, var(--safe-left)) 24px max(20px, var(--safe-left));
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-bg);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.hero-pill::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--brand-2);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 12px;
}
h1 em {
  font-style: italic;
  background: linear-gradient(120deg, var(--brand), var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ============ STATS ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 max(20px, var(--safe-left)) 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
}
.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-lbl {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  margin-top: 2px;
}

/* ============ DROPZONE ============ */
.dropzone-wrap {
  padding: 0 max(20px, var(--safe-left)) 24px;
}
.dropzone {
  width: 100%;
  background: var(--surface);
  border: 2px dashed var(--border-2);
  border-radius: 18px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.2s var(--ease);
}
.dropzone:active {
  transform: scale(0.99);
  background: var(--brand-bg);
  border-color: var(--brand-3);
}
.dropzone.is-drag {
  border-color: var(--brand-2);
  background: var(--brand-bg);
}
.dz-icon {
  width: 60px; height: 60px;
  background: var(--brand-bg);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--brand-2);
}
.dz-icon svg { width: 30px; height: 30px; }
.dz-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dz-sub {
  font-size: 13px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.dz-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  box-shadow: var(--shadow-sm);
}
.dz-cta svg { width: 14px; height: 14px; }

/* ============ SECTIONS ============ */
.section {
  padding: 0 max(20px, var(--safe-left)) 24px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
}
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.link-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-2);
  padding: 4px 0;
}

/* ============ RECENT LIST ============ */
.recent-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.recent-item {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: background 0.15s var(--ease);
}
.recent-item:last-child { border-bottom: 0; }
.recent-item:active { background: var(--surface-2); }

.ri-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.ri-icon svg { width: 20px; height: 20px; }
.ri-green { background: var(--brand-bg); color: var(--brand-2); }
.ri-amber { background: var(--amber-bg); color: var(--amber); }
.ri-meta { min-width: 0; }
.ri-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ri-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ri-status {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ri-ok { background: var(--green-bg); color: #047857; }
.ri-pending { background: var(--amber-bg); color: var(--amber); }

/* ============ FEATURES ============ */
.section-features { padding-bottom: 32px; }
.features {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}
.features li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.features li:last-child { border-bottom: 0; }
.feat-num {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  background: var(--brand-bg);
  color: var(--brand);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}
.feat-h {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.feat-p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
}

/* ============ PROCESSING ============ */
.proc-shell {
  min-height: calc(100vh - var(--appbar-h) - var(--safe-top));
  min-height: calc(100dvh - var(--appbar-h) - var(--safe-top));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px max(20px, var(--safe-left)) 32px max(20px, var(--safe-left));
  text-align: center;
}
.proc-spinner {
  width: 64px; height: 64px;
  position: relative;
  margin-top: 20px;
}
.ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
}
.ring.delay-1 { inset: 7px; border-top-color: var(--brand-3); animation-duration: 1.6s; animation-direction: reverse; }
.ring.delay-2 { inset: 14px; border-top-color: #6ca0d4; animation-duration: 1.2s; }
@keyframes spin { to { transform: rotate(360deg); } }

.proc-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-top: 22px;
  margin-bottom: 6px;
}
.proc-file {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-2);
  word-break: break-all;
}
.proc-progress {
  width: 100%;
  max-width: 480px;
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 24px 0 24px;
}
.proc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
  width: 0%;
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.proc-steps {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
}
.proc-steps li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.proc-steps li:last-child { border-bottom: 0; }
.proc-steps li.active { color: var(--text); background: var(--brand-bg); }
.proc-steps li.done { color: var(--text-2); }
.step-dot {
  width: 16px; height: 16px;
  border: 2px solid var(--border-2);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s var(--ease);
}
.proc-steps li.active .step-dot {
  border-color: var(--brand-2);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.proc-steps li.done .step-dot {
  background: var(--brand-2);
  border-color: var(--brand-2);
}
.proc-steps li.done .step-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}
.step-label { font-weight: 500; line-height: 1.3; }
.step-meta {
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}
.proc-steps li.done .step-meta { color: #047857; }

.proc-log {
  width: 100%;
  max-width: 480px;
  background: #0a1410;
  color: #7fcfa3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  border-radius: 12px;
  padding: 12px 14px;
  height: 96px;
  overflow: hidden;
  position: relative;
  line-height: 1.7;
  margin-top: 16px;
  text-align: left;
}
.proc-log::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(to bottom, transparent, #0a1410);
}
.proc-log .log-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-log .log-time { color: #4a8268; margin-right: 6px; }
.proc-log .log-tag-info { color: #7fcfa3; }
.proc-log .log-tag-warn { color: #e8b85c; }
.proc-log .log-tag-ok { color: #5cd88a; }

/* ============ RESULT HERO ============ */
.result-hero {
  padding: 8px max(20px, var(--safe-left)) 24px max(20px, var(--safe-left));
}
.rh-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 6px;
}
.rh-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  line-height: 1.1;
  margin-bottom: 6px;
}
.rh-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.rh-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rh-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
}
.rh-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.rh-lbl {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  margin-top: 2px;
}

/* ============ MOBILE IOS LIST ============ */
.ios-mobile {
  padding: 0 max(16px, var(--safe-left)) 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.assort {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.assort-head {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}
.assort-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 4px;
}
.assort-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.35;
}

.assort-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.assort-meta-cell {
  padding: 10px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.assort-meta-cell:last-child { border-right: 0; }
.assort-meta-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.assort-meta-lbl {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
  font-weight: 600;
}

.assort-section {
  border-top: 1px solid var(--border);
}
.assort-section-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  text-align: left;
  transition: background 0.15s var(--ease);
}
.assort-section-head:active { background: var(--surface-2); }
.assort-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.assort-section-title .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  background: var(--bg-2);
  padding: 1px 7px;
  border-radius: 999px;
}
.assort-section-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: transform 0.25s var(--ease);
}
.assort-section.is-open .assort-section-chevron { transform: rotate(180deg); }
.assort-section-body {
  display: none;
  padding: 0 16px 14px;
}
.assort-section.is-open .assort-section-body { display: block; }

/* Designs grid */
.design-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.design-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}
.design-mini-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  line-height: 1.25;
  min-height: 1.25em;
}
.design-mini-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  height: 76px;
}
.dm-img {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

/* Swatches */
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sw-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  font-size: 11px;
}
.sw-color {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}
.sw-name {
  font-weight: 600;
  color: var(--text);
}
.sw-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* Specs */
.spec-pairs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
.spec-pair {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.spec-pair dt {
  color: var(--text-3);
  font-weight: 500;
}
.spec-pair dd {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Line item rows */
.row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.row-design {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.row-design.green { color: #047857; }
.row-style {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.row-note {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.row-textures {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.row-texture {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
.row-texture .t-name { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-texture .t-wt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.row-texture .t-color {
  font-size: 11px;
  color: var(--text-2);
}
.row-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-2);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}
.row-foot b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.row-foot .yellow-hl { background: #fff200; padding: 0 4px; border-radius: 3px; color: var(--text); }

/* Totals */
.assort-totals {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
}
.assort-totals .pair {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.assort-totals .pair span { color: var(--text-3); }
.assort-totals .pair b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ============ TILE GRAPHICS (mobile, smaller) ============ */
.tile {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 9px;
  color: #fff;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.05;
  padding: 3px;
}
.tile-orange { background: #ed6f1c; }
.tile-black { background: #1a1a1a; }
.tile-cream { background: #f4ead0; color: #c41e3a; }
.tile-red { background: #c41e3a; }
.tile-green { background: #4a7c3c; }
.tile-pink { background: #f5b8c8; color: #1a1a1a; }
.tile-mint { background: #c8e3d4; color: #1a1a1a; }
.tile-tan { background: #c9a578; }
.tile-white { background: #fafafa; color: #1a1a1a; border: 1px solid #ddd; }

.checker {
  width: 100%; height: 100%;
  background-image:
    linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ed6f1c 75%),
    linear-gradient(-45deg, transparent 75%, #ed6f1c 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  background-color: #ed6f1c;
}
.checker-pink {
  background-image:
    linear-gradient(45deg, #f5b8c8 25%, transparent 25%),
    linear-gradient(-45deg, #f5b8c8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-color: #fff;
  background-size: 6px 6px;
  background-position: 0 0, 0 3px, 3px -3px, -3px 0;
}
.checker-red {
  background-image:
    linear-gradient(45deg, #c41e3a 25%, transparent 25%),
    linear-gradient(-45deg, #c41e3a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fafafa 75%),
    linear-gradient(-45deg, transparent 75%, #fafafa 75%);
  background-color: #fafafa;
  background-size: 6px 6px;
  background-position: 0 0, 0 3px, 3px -3px, -3px 0;
}
.checker-green {
  background-image:
    linear-gradient(45deg, #4a7c3c 25%, transparent 25%),
    linear-gradient(-45deg, #4a7c3c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c41e3a 75%),
    linear-gradient(-45deg, transparent 75%, #c41e3a 75%);
  background-color: #c41e3a;
  background-size: 6px 6px;
  background-position: 0 0, 0 3px, 3px -3px, -3px 0;
}
.stripe-orange {
  background: repeating-linear-gradient(0deg, #ed6f1c 0 3px, #1a1a1a 3px 5px);
}
.stripe-mint {
  background: repeating-linear-gradient(90deg, #c8e3d4 0 4px, #f5b8c8 4px 6px);
}

/* ============ ACTION BAR ============ */
.actionbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
  padding: 10px max(14px, var(--safe-right)) max(14px, var(--safe-bottom)) max(14px, var(--safe-left));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
}
.actionbar.is-on { display: grid; }

.ab-secondary,
.ab-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.ab-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.ab-secondary:active { transform: scale(0.96); background: var(--bg-2); }
.ab-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.ab-primary:active { transform: scale(0.97); background: var(--brand-2); }
.ab-primary:disabled { opacity: 0.6; pointer-events: none; }
.ab-secondary svg, .ab-primary svg { width: 16px; height: 16px; flex-shrink: 0; }

.bottom-spacer {
  height: calc(var(--actionbar-h) + var(--safe-bottom) + 16px);
}

/* ============ OFFSCREEN PRINT DOCUMENT ============ */
.ios-offscreen {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 1100px;
  pointer-events: none;
}
.ios-document {
  background: #fff;
  width: 1100px;
}

/* IOS document rendering — same as desktop, used only for PDF export */
.ios-page {
  padding: 28px 32px 36px;
  font-size: 9px;
  color: #1a1a1a;
  page-break-after: always;
  border-bottom: 12px solid #e8eae5;
  background: #fff;
}
.ios-page:last-child { border-bottom: 0; }
.ios-header { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid #444; }
.ios-logo { width: 70px; height: 70px; background: #eef3fb; border: 1px solid #dde8f7; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.ios-logo svg { width: 50px; height: 50px; }
.ios-co-name { font-weight: 700; font-size: 15px; color: #0a2247; letter-spacing: 0.02em; }
.ios-co-tag { font-size: 8px; color: #555; font-style: italic; margin-bottom: 6px; }
.ios-co-info { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font-size: 8.5px; color: #333; }
.ios-cert { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.ios-cert-badge { font-size: 7px; padding: 2px 6px; background: #f1f1f1; border-radius: 4px; font-weight: 600; color: #444; border: 1px solid #ddd; }
.ios-title-row { text-align: center; font-weight: 600; font-size: 11px; padding: 6px 0; border-bottom: 1px solid #888; margin-bottom: 8px; }
.ios-meta-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 24px; margin: 8px 0; font-size: 9px; }
.ios-meta-row { display: flex; gap: 6px; align-items: baseline; }
.ios-meta-lbl { font-weight: 600; color: #444; min-width: 110px; text-align: right; }
.ios-meta-lbl::after { content: ':'; }
.ios-meta-val { font-weight: 500; color: #0d4d2a; flex: 1; border-bottom: 1px dotted #aaa; padding-bottom: 1px; min-height: 12px; }
.ios-meta-val.empty { color: transparent; }
.ios-tieIn { text-align: center; background: #fff200; font-weight: 700; font-size: 11px; padding: 5px; margin: 8px 0; border: 1px solid #888; }
.ios-special { display: flex; justify-content: flex-end; gap: 16px; margin: 6px 0; font-size: 9px; }
.ios-special-row { display: flex; gap: 6px; }
.ios-special-row .lbl { font-weight: 600; }
.ios-special-row .val { background: #fff200; font-weight: 700; padding: 1px 8px; min-width: 32px; text-align: center; }
.ios-assort { margin-top: 10px; }
.ios-assort .assort-title { text-align: center; font-weight: 700; font-size: 9.5px; background: #1a1a1a; color: #fff200; padding: 5px; border: 1px solid #1a1a1a; letter-spacing: 0; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 8.5px; }
.spec-table th, .spec-table td { border: 1px solid #555; padding: 3px 4px; vertical-align: middle; text-align: center; }
.spec-table th { background: #f0f0f0; font-weight: 600; font-size: 8px; }
.ios-table-wrap { overflow-x: auto; }
.ios-table { width: 100%; border-collapse: collapse; font-size: 8.5px; }
.ios-table th, .ios-table td { border: 1px solid #555; padding: 4px 5px; vertical-align: middle; text-align: center; }
.ios-table thead th { background: #f0f0f0; font-weight: 600; font-size: 8px; padding: 6px 4px; }
.ios-table .po-cell { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; font-size: 9px; white-space: nowrap; background: #fafafa; }
.ios-table .desc-cell { text-align: left; font-size: 8px; font-weight: 500; background: #fafafa; max-width: 90px; line-height: 1.3; }
.ios-table .design-cell { text-align: left; font-weight: 600; font-size: 8.5px; padding-left: 8px; }
.ios-table .design-cell .design-note { display: block; font-size: 7.5px; font-weight: 600; color: #d97706; margin-top: 2px; }
.ios-table .texture-cell { text-align: left; padding-left: 6px; font-size: 8px; }
.ios-table td.color-cell { text-align: left; font-size: 8px; padding-left: 6px; }
.ios-table .yellow-hl { background: #fff200; font-weight: 600; }
.ios-table .green-hl { background: #c5e7a8; font-weight: 600; }
.ios-table tfoot td { background: #f5f5f5; font-weight: 700; font-size: 9px; }
.ios-bottom { display: grid; grid-template-columns: 110px 1fr; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #aaa; }
.swatch-stack { display: flex; flex-direction: column; gap: 4px; }
.swatch { display: flex; align-items: center; gap: 6px; font-size: 7.5px; color: #444; }
.swatch-chip { width: 28px; height: 22px; border: 1px solid #888; flex-shrink: 0; }
.swatch-lbl { font-weight: 500; line-height: 1.2; }
.brand-section { text-align: center; }
.brand-title-line { font-size: 22px; font-weight: 800; font-family: 'Georgia', serif; color: #c41e3a; font-style: italic; letter-spacing: -0.02em; margin: 2px 0; }
.brand-asst-title { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: #1a1a1a; }
.brand-asst-sub { font-size: 8px; color: #555; margin-bottom: 8px; }
.design-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.design-card { display: flex; flex-direction: column; }
.design-card-title { font-size: 8.5px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 3px; color: #1a1a1a; }
.design-card-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; font-size: 6.5px; color: #666; font-weight: 600; }
.design-card-pair span { text-align: center; }
.design-card-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 2px; height: 90px; }
.dc-img { border: 1px solid #999; display: flex; align-items: center; justify-content: center; background: #fff; position: relative; overflow: hidden; }
.ios-foot { margin-top: 12px; padding-top: 6px; border-top: 1px solid #ddd; font-size: 8px; display: flex; justify-content: space-between; color: #666; }
.ios-foot-prep { font-style: italic; }

/* Constrain to phone width on desktop */
@media (min-width: 720px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    background: var(--bg);
  }
  .actionbar { left: 50%; transform: translateX(-50%); right: auto; width: 480px; }
}
