/**
 * CraftBelt premium phone shell — field home / entry chrome (410×840).
 * Replaces classic V2 metro chrome on CraftBelt Home. Keeps pc-* kit +
 * Saddle Toolbelt atmosphere (dark leather + amber brand). Do not load on
 * dashboard.html V3 kit. v2-classic-chrome.css remains on disk for legacy pages.
 */
html[data-cb-phone='1'] {
  --cb-phone-bg0: #0a0e16;
  --cb-phone-bg1: #14100e;
  --cb-phone-ink: var(--pc-text, #f8fafc);
  --cb-phone-muted: var(--pc-slate, #94a3b8);
  --cb-phone-brand: var(--pc-primary, #f97316);
  --cb-phone-brand-soft: var(--pc-primary-soft, rgba(249, 115, 22, 0.12));
  --cb-phone-surface: rgba(20, 27, 43, 0.55);
  --cb-phone-line: rgba(255, 255, 255, 0.08);
  --cb-phone-font: var(--pc-font, 'Outfit', sans-serif);
  --cb-phone-tap: var(--pc-tap, 44px);
  --cb-phone-radius: var(--pc-radius-lg, 16px);
}

html[data-cb-phone='1'] body.cb-phone-host {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(249, 115, 22, 0.14), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(30, 22, 18, 0.9), transparent 45%),
    linear-gradient(165deg, #121822 0%, var(--cb-phone-bg0) 45%, var(--cb-phone-bg1) 100%);
}

html[data-cb-phone='1'] .smartphone-container {
  box-shadow:
    0 25px 60px -15px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(249, 115, 22, 0.1);
}

html[data-cb-phone='1'] .smartphone-container > .screen-content {
  background:
    radial-gradient(ellipse 120% 70% at 50% -20%, rgba(249, 115, 22, 0.16), transparent 50%),
    linear-gradient(180deg, #1a1520 0%, var(--pc-bg, #080c15) 48%, #0c1018 100%);
  color: var(--cb-phone-ink);
  font-family: var(--cb-phone-font);
}

/* ---- Home composition -------------------------------------------------- */

html[data-cb-phone='1'] .cb-home {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px 72px;
  min-height: 100%;
  box-sizing: border-box;
}

html[data-cb-phone='1'] .cb-home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 8px 4px 4px;
  animation: cbBrandIn 0.55s ease both;
}

html[data-cb-phone='1'] .cb-home-brand__mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

html[data-cb-phone='1'] .cb-home-brand__logo {
  height: 44px;
  max-width: 72%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
}

html[data-cb-phone='1'] .cb-home-brand__product {
  margin: 0;
  font-family: var(--cb-phone-font);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--cb-phone-ink);
}

html[data-cb-phone='1'] .cb-home-brand__product span {
  color: var(--cb-phone-brand);
}

html[data-cb-phone='1'] .cb-home-brand__tenant {
  margin: 0;
  font-family: var(--cb-phone-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cb-phone-muted);
}

html[data-cb-phone='1'] .cb-home-brand__role {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-phone-muted);
}

html[data-cb-phone='1'] .cb-home-err {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--pc-radius, 10px);
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  font-size: 12px;
  font-weight: 600;
}

html[data-cb-phone='1'] .cb-home-err[hidden] {
  display: none !important;
}

/* Primary stacked actions — not metro tiles */
html[data-cb-phone='1'] .cb-home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

html[data-cb-phone='1'] .cb-home-action {
  --cb-stagger: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: var(--cb-phone-radius);
  border: 1px solid var(--cb-phone-line);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.14), transparent 55%),
    var(--cb-phone-surface);
  color: var(--cb-phone-ink);
  text-decoration: none;
  font-family: var(--cb-phone-font);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.12s ease, background 0.18s ease;
  animation: cbActionIn 0.45s ease both;
  animation-delay: calc(0.08s + var(--cb-stagger) * 0.06s);
}

html[data-cb-phone='1'] .cb-home-action:focus-visible {
  outline: none;
  box-shadow: var(--pc-focus-ring, 0 0 0 2px rgba(249, 115, 22, 0.55));
}

html[data-cb-phone='1'] .cb-home-action:active {
  transform: scale(0.985);
}

html[data-cb-phone='1'] .cb-home-action--primary {
  border-color: rgba(249, 115, 22, 0.45);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.28), rgba(249, 115, 22, 0.06) 60%),
    rgba(20, 27, 43, 0.7);
}

html[data-cb-phone='1'] .cb-home-action--warn {
  border-color: rgba(245, 158, 11, 0.45);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.18), transparent 60%),
    var(--cb-phone-surface);
}

html[data-cb-phone='1'] .cb-home-action__ico {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: var(--cb-phone-brand);
  background-image: var(--tile-icon, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% 70%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

html[data-cb-phone='1'] .cb-home-action__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

html[data-cb-phone='1'] .cb-home-action__label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

html[data-cb-phone='1'] .cb-home-action__hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--cb-phone-muted);
  line-height: 1.3;
}

html[data-cb-phone='1'] .cb-home-action__chev {
  margin-left: auto;
  color: var(--cb-phone-brand);
  font-size: 18px;
  font-weight: 700;
  opacity: 0.85;
}

html[data-cb-phone='1'] .cb-home-empty {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--pc-radius, 10px);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.06);
  color: var(--cb-phone-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  animation: cbActionIn 0.45s ease both;
  animation-delay: 0.2s;
}

/* Demoted secondary tools (not a tile grid) */
html[data-cb-phone='1'] .cb-home-more {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

html[data-cb-phone='1'] .cb-home-more__title {
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

html[data-cb-phone='1'] .cb-home-more__link {
  display: flex;
  align-items: center;
  min-height: var(--cb-phone-tap);
  padding: 8px 4px;
  color: var(--cb-phone-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  -webkit-tap-highlight-color: transparent;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--cb-phone-font);
}

html[data-cb-phone='1'] .cb-home-more__link:last-child {
  border-bottom: none;
}

html[data-cb-phone='1'] .cb-home-more__link:focus-visible {
  outline: none;
  box-shadow: var(--pc-focus-ring);
  border-radius: 6px;
}

html[data-cb-phone='1'] .cb-home-meta {
  margin: 8px 0 0;
  font-size: 10px;
  color: #64748b;
  text-align: center;
  line-height: 1.4;
}

html[data-cb-phone='1'] .cb-home-weekly {
  text-align: center;
}

html[data-cb-phone='1'] #qaPinMount {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html[data-cb-phone='1'] #qaPinMount[hidden] {
  display: none !important;
}

/* Gate banner as stacked action, not metro tile */
html[data-cb-phone='1'] .cb-home-gate {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--cb-phone-radius);
  border: 1px solid rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

/* ---- Field shell polish (shared phone tokens) -------------------------- */

html[data-cb-phone='1'] .v2-header h1,
html[data-cb-phone='1'] .cb-field-title {
  font-family: var(--cb-phone-font);
  color: var(--cb-phone-brand);
}

html[data-cb-phone='1'] .v2-mode-pill {
  font-family: var(--cb-phone-font);
}

@keyframes cbBrandIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cbActionIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-cb-phone='1'] .cb-home-brand,
  html[data-cb-phone='1'] .cb-home-action,
  html[data-cb-phone='1'] .cb-home-empty {
    animation: none;
  }
}
