/* ============ RESET & BASE ============ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #0f1a14;
  background: #f6f7f4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; cursor: pointer; }

:root {
  --green-900: #0a2247;
  --green-800: #0f3270;
  --green-700: #1a4d99;
  --green-600: #2563b8;
  --green-500: #3a82d4;
  --green-100: #dde8f7;
  --green-50: #eef3fb;
  --gray-900: #0f1a14;
  --gray-800: #1f2a23;
  --gray-700: #3b4640;
  --gray-600: #5a655e;
  --gray-500: #7a857e;
  --gray-400: #a3aca6;
  --gray-300: #d1d6d2;
  --gray-200: #e6e9e7;
  --gray-100: #f1f3f0;
  --gray-50: #f8f9f7;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --orange: #ea580c;
  --black: #1a1a1a;
  --shadow-sm: 0 1px 2px rgba(15, 26, 20, 0.04), 0 1px 3px rgba(15, 26, 20, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 26, 20, 0.06), 0 2px 4px rgba(15, 26, 20, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 26, 20, 0.08), 0 4px 12px rgba(15, 26, 20, 0.04);
}

/* ============ TOP NAV ============ */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 36px; height: 36px;
  background: var(--green-50);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--green-100);
}
.brand-logo svg { width: 24px; height: 24px; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--gray-900); letter-spacing: -0.01em; }
.brand-tag { font-size: 11px; color: var(--gray-500); font-weight: 500; }

.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.15s;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-link.active { background: var(--green-50); color: var(--green-800); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 12px;
}
.user-name { font-weight: 600; font-size: 13px; color: var(--gray-900); line-height: 1.2; }
.user-role { font-size: 11px; color: var(--gray-500); line-height: 1.2; }

/* ============ VIEW SWITCHING ============ */
.view { display: none; }
.view.view-active { display: block; }

/* ============ HERO ============ */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px 32px;
}
.hero-left { padding-top: 24px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--green-50);
  color: var(--green-800);
  border: 1px solid var(--green-100);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}
.pill::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--green-600);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--gray-900);
  margin-bottom: 18px;
}
.hero-accent {
  background: linear-gradient(120deg, var(--green-700), var(--green-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 16px;
  color: var(--gray-600);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.6;
}
.hero-stats { display: flex; gap: 40px; }
.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
.stat-lbl { font-size: 12px; color: var(--gray-500); font-weight: 500; }

.hero-right { display: flex; flex-direction: column; gap: 16px; }

/* ============ DROPZONE ============ */
.dropzone {
  background: #fff;
  border: 2px dashed var(--gray-300);
  border-radius: 16px;
  padding: 40px;
  transition: all 0.2s;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--green-500); background: var(--green-50); }
.dropzone.is-drag { border-color: var(--green-600); background: var(--green-50); transform: scale(1.005); }
.dz-inner { text-align: center; }
.dz-icon {
  width: 64px; height: 64px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-700);
}
.dz-icon svg { width: 32px; height: 32px; }
.dz-title { font-size: 17px; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.dz-sub { font-size: 13px; color: var(--gray-500); margin-bottom: 20px; }
.dz-hint { font-size: 11.5px; color: var(--gray-400); margin-top: 14px; }

/* ============ BUTTONS ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--green-700);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--green-800); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--gray-300); background: var(--gray-50); }
.btn-ghost svg { width: 14px; height: 14px; }

/* ============ RECENT UPLOADS ============ */
.recent-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 16px 18px;
}
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.recent-head span { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.recent-all { font-size: 12px; color: var(--green-700); font-weight: 500; }
.recent-list { display: flex; flex-direction: column; gap: 4px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.15s;
}
.recent-item:hover { background: var(--gray-50); cursor: pointer; }
.ri-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.ri-green { background: var(--green-50); color: var(--green-800); }
.ri-amber { background: var(--amber-bg); color: var(--amber); }
.ri-meta { flex: 1; min-width: 0; }
.ri-name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.ri-sub { font-size: 11.5px; color: var(--gray-500); }
.ri-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}
.ri-ok { background: var(--green-50); color: var(--green-800); }
.ri-pending { background: var(--amber-bg); color: var(--amber); }

/* ============ FEATURES ============ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 56px;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 22px;
}
.feat-icon {
  width: 40px; height: 40px;
  background: var(--green-50);
  color: var(--green-700);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feat-icon svg { width: 20px; height: 20px; }
.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.feature-card p {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.55;
}

/* ============ PROCESSING ============ */
.proc-shell {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.proc-card {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.proc-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.proc-spinner {
  width: 48px; height: 48px;
  position: relative;
}
.ring {
  position: absolute;
  inset: 0;
  border: 2.5px solid transparent;
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
}
.ring.delay-1 { inset: 5px; border-top-color: var(--green-500); animation-duration: 1.6s; animation-direction: reverse; }
.ring.delay-2 { inset: 10px; border-top-color: var(--green-400, #6ca0d4); animation-duration: 1.2s; }
@keyframes spin { to { transform: rotate(360deg); } }
.proc-title { font-size: 17px; font-weight: 600; color: var(--gray-900); }
.proc-file { font-size: 13px; color: var(--gray-500); font-family: 'JetBrains Mono', monospace; }

.proc-progress {
  height: 6px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}
.proc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-600), var(--green-500));
  width: 0%;
  transition: width 0.6s ease;
  border-radius: 999px;
}
.proc-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.proc-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--gray-500);
  transition: all 0.2s;
}
.proc-steps li.active { color: var(--gray-900); background: var(--green-50); }
.proc-steps li.done { color: var(--gray-700); }
.step-dot {
  width: 16px; height: 16px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}
.proc-steps li.active .step-dot {
  border-color: var(--green-600);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.proc-steps li.done .step-dot {
  background: var(--green-600);
  border-color: var(--green-600);
}
.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 { flex: 1; font-weight: 500; }
.step-meta { font-size: 11.5px; color: var(--gray-400); font-family: 'JetBrains Mono', monospace; }
.proc-steps li.done .step-meta { color: var(--green-700); }

.proc-log {
  background: #0a1410;
  color: #7fcfa3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  border-radius: 10px;
  padding: 14px 16px;
  height: 110px;
  overflow: hidden;
  position: relative;
  line-height: 1.7;
}
.proc-log::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  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: 8px; }
.proc-log .log-tag-info { color: #7fcfa3; }
.proc-log .log-tag-warn { color: #e8b85c; }
.proc-log .log-tag-ok { color: #5cd88a; }

/* ============ RESULT ============ */
.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 65px;
  z-index: 40;
}
.rb-left { display: flex; align-items: center; gap: 16px; }
.rb-right { display: flex; gap: 8px; }
.rb-title { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.rb-sub { font-size: 12px; color: var(--gray-500); }

.ios-stage {
  background: #e8eae5;
  min-height: calc(100vh - 130px);
  padding: 32px 16px;
  display: flex;
  justify-content: center;
}
.ios-document {
  background: #fff;
  width: 100%;
  max-width: 1100px;
  box-shadow: var(--shadow-lg);
  border-radius: 4px;
  overflow: hidden;
}

/* ============ IOS RENDERING ============ */
.ios-page {
  padding: 28px 32px 36px;
  font-size: 9px;
  color: #1a1a1a;
  page-break-after: always;
  border-bottom: 12px solid #e8eae5;
}
.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: var(--green-50);
  border: 1px solid var(--green-100);
  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;
}

/* Assortment table */
.ios-assort {
  margin-top: 10px;
}
.assort-title {
  text-align: center;
  font-weight: 700;
  font-size: 9.5px;
  background: #1a1a1a;
  color: #fff200;
  padding: 5px;
  border: 1px solid #1a1a1a;
}

.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;
}
.spec-table .row-h th {
  background: #f5f5f5;
  font-weight: 600;
}
.spec-table .center-bar {
  background: #1a1a1a;
  color: #fff;
}

.ios-table-wrap {
  margin-top: 0;
  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-table .assort-row td {
  background: #1a1a1a;
  color: #fff200;
  font-weight: 700;
  text-align: center;
  padding: 5px;
  font-size: 9px;
  letter-spacing: 0.02em;
}

/* Bottom section: swatches + brand + previews */
.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-logo-bar {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  font-style: italic;
  letter-spacing: 0.02em;
}
.brand-logo-bar::before, .brand-logo-bar::after {
  content: '~ American Textile Industries ~';
  display: block;
  font-size: 7px;
  font-style: italic;
  font-weight: 500;
  color: #666;
  letter-spacing: 0.05em;
  margin: 1px 0;
}
.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;
}

/* preview tile graphics */
.tile {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.05;
  padding: 4px;
}
.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: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 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: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 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: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 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: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}

.stripe-orange {
  background: repeating-linear-gradient(0deg, #ed6f1c 0 4px, #1a1a1a 4px 6px);
}
.stripe-mint {
  background: repeating-linear-gradient(90deg, #c8e3d4 0 6px, #f5b8c8 6px 8px);
}

.tile-icon { font-size: 22px; }

.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; }

/* ============ MISC ============ */
.hidden { display: none !important; }
@media print {
  .topnav, .result-bar { display: none; }
  .ios-stage { background: #fff; padding: 0; }
  .ios-document { box-shadow: none; }
}

/* ============ RESPONSIVE — phone & landscape iPhone ============ */
@media (max-width: 1024px) {
  .topnav {
    padding: 12px max(14px, env(safe-area-inset-left)) 12px max(14px, env(safe-area-inset-right));
    gap: 12px;
  }
  .brand-tag { display: none; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px max(16px, env(safe-area-inset-left)) 24px max(16px, env(safe-area-inset-right));
  }
  .hero-left { padding-top: 0; }
  h1 { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .features {
    grid-template-columns: 1fr;
    padding: 16px max(16px, env(safe-area-inset-left)) 32px max(16px, env(safe-area-inset-right));
  }
  .result-bar {
    padding: 12px max(14px, env(safe-area-inset-left)) 12px max(14px, env(safe-area-inset-right));
    flex-wrap: wrap;
    gap: 10px;
  }
  .rb-left { gap: 10px; flex: 1; min-width: 0; }
  .rb-meta { min-width: 0; flex: 1; }
  .rb-title, .rb-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ios-stage {
    padding: 12px 0;
    background: #e8eae5;
  }
  .ios-document {
    border-radius: 0;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .user-meta { display: none; }
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 22px; }
  h1 { font-size: 26px; }
  .dropzone { padding: 28px 18px; }
  .result-bar { padding: 10px 12px; }
  .rb-right { gap: 6px; }
  .rb-right .btn-ghost { padding: 7px 10px; }
  .btn-ghost svg, .btn-primary svg { width: 13px; height: 13px; }
}
