:root {
  --black: #111111;
  --red: #c81010;
  --red-dark: #9f0d0d;
  --cardboard: #c7a36a;
  --paper: #f2ede3;
  --gray: #555555;
  --green: #2e7d32;
  --rust: var(--red);
  --bone: var(--paper);
  --green-light: #3f9444;
  --steel: #343434;
  --dust: var(--gray);
  --orange: #a3472a;
  --ink: var(--paper);
  --paper-ink: #111111;
  --muted: #d8cfbf;
  --paper-muted: #555555;
  --line: rgba(242, 237, 227, 0.16);
  --paper-line: rgba(17, 17, 17, 0.14);
  --panel: rgba(17, 17, 17, 0.9);
  --panel-soft: rgba(242, 237, 227, 0.94);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 16px 38px rgba(0, 0, 0, 0.34);
  --button-height: 44px;
  --button-padding-x: 16px;
  --compact-button-height: 34px;
  --compact-button-padding-x: 13px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(11, 11, 13, 0.9), rgba(11, 11, 13, 0.94)),
    url("assets/background.png"),
    radial-gradient(circle at 8% 0%, rgba(200, 16, 16, 0.14), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(199, 163, 106, 0.14), transparent 28rem),
    var(--black);
  background-size: auto, 720px auto, auto, auto, auto;
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.alpha-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--red);
  color: var(--aged-paper);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 800;
}

.alpha-banner a {
  color: var(--aged-paper);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body:not(.is-authenticated) .alpha-banner {
  display: none;
}

body::before {
  content: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button,
.import-button,
.button-link,
.form-actions a {
  position: relative;
  min-height: var(--button-height);
  border: 0;
  border-radius: 9px;
  background: var(--red);
  color: var(--bone);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--button-padding-x);
  text-decoration: none;
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 12px 24px rgba(200, 16, 16, 0.22);
}

button.is-loading,
.button-link.is-loading {
  pointer-events: none;
  opacity: 0.86;
}

button.is-loading::before,
.button-link.is-loading::before {
  content: "";
  width: 0.95em;
  height: 0.95em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

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

button:hover,
.import-button:hover,
.button-link:hover,
.form-actions a:hover {
  transform: translateY(-1px);
  background: var(--red-dark);
  box-shadow: 0 16px 32px rgba(200, 16, 16, 0.28);
}

.button-link.secondary,
button.ghost {
  background: rgba(242, 237, 227, 0.12);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(242, 237, 227, 0.42);
}

.panel .button-link.secondary,
.panel button.ghost,
.metric .button-link.secondary,
.metric button.ghost {
  background: rgba(242, 237, 227, 0.84);
  color: var(--paper-ink);
  box-shadow: inset 0 0 0 1px rgba(199, 163, 106, 0.34), 0 8px 18px rgba(17, 17, 17, 0.08);
}

.panel .button-link.secondary:hover,
.panel button.ghost:hover,
.metric .button-link.secondary:hover,
.metric button.ghost:hover {
  background: #fff8ea;
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.26), 0 12px 24px rgba(17, 17, 17, 0.12);
}

button.danger {
  background: rgba(200, 16, 16, 0.16);
  color: var(--bone);
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.38);
}

button.compact {
  min-height: var(--compact-button-height);
  padding: 0 var(--compact-button-padding-x);
  font-size: 0.68rem;
  background: #f2ede3;
  color: #111111;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.12), 0 8px 16px rgba(17, 17, 17, 0.1);
}

button.danger-soft {
  color: #111111;
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.36), 0 8px 18px rgba(17, 17, 17, 0.08);
}

button.compact.action-accent {
  background: #f2ede3;
  color: #111111;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.22), 0 8px 16px rgba(17, 17, 17, 0.1);
}

button.compact.action-light {
  background: #f2ede3;
  color: #111111;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.22), 0 8px 16px rgba(17, 17, 17, 0.1);
}

button[data-collapse-form] {
  width: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 999px;
  background: rgba(242, 237, 227, 0.84);
  color: var(--paper-ink);
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.chevron-icon {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(2px) rotate(-135deg);
  transition: transform 0.18s ease;
}

button[data-collapse-form].is-collapsed .chevron-icon {
  transform: translateY(-2px) rotate(45deg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 82px;
  background: rgba(11, 11, 13, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(14px, 4vw, 42px);
}

.brand {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 210px;
}

.brand-text {
  color: var(--ink);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 1.46rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  text-shadow: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--black);
  box-shadow: inset 0 0 0 1px rgba(242, 237, 227, 0.24), 0 12px 24px rgba(0, 0, 0, 0.36);
}

.brand-mark img {
  display: block;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-toggle {
  display: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  background: rgba(242, 237, 227, 0.08);
  box-shadow: inset 0 0 0 1px var(--line);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: var(--paper);
}

.menu-toggle:hover {
  background: rgba(242, 237, 227, 0.12);
  box-shadow: inset 0 0 0 1px var(--line);
}

h1,
h2 {
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.018em;

}

.page-nav,
.top-actions,
.form-actions,
.filter-row,
.quick-actions,
.module-links,
.backup-actions,
.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions {
  margin-top: 18px;
  padding-top: 4px;
  align-items: center;
  justify-content: flex-end;
}

.page-nav {
  justify-content: center;
}

.tool-nav {
  position: sticky;
  top: 82px;
  z-index: 9;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px clamp(14px, 4vw, 42px);
  background: rgba(17, 17, 17, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  scrollbar-width: none;
}

.tool-nav::-webkit-scrollbar {
  display: none;
}

.tool-nav a {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  padding: 0 14px;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 0 1px var(--line);
}

.tool-nav a:hover,
.tool-nav a.active {
  color: var(--paper);
  background: rgba(200, 16, 16, 0.18);
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.44);
}

body.is-authenticated .tool-nav,
body.is-anonymous .tool-nav {
  display: none;
}

.app-footer {
  width: min(1180px, calc(100% - 28px));
  margin: 26px auto 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.82);
  color: rgba(242, 237, 227, 0.76);
  padding: 16px 18px;
  box-shadow: inset 0 0 0 1px rgba(242, 237, 227, 0.1), 0 18px 34px rgba(0, 0, 0, 0.22);
}

.app-footer div {
  display: grid;
  gap: 2px;
}

.app-footer strong {
  color: var(--bone);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 1.12rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-footer span {
  font-size: 0.78rem;
  font-weight: 700;
}

.app-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.app-footer a {
  color: var(--bone);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.login-footer {
  margin-top: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.page-nav a,
.module-links a {
  color: var(--muted);
  border-radius: 999px;
  min-height: var(--button-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--button-padding-x);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.page-nav a:hover,
.page-nav a.active,
.module-links a:hover {
  color: var(--ink);
  background: rgba(200, 16, 16, 0.16);
  box-shadow: inset 0 0 0 1px var(--line);
}

.import-button input {
  display: none;
}

main {
  width: min(1480px, calc(100% - 32px));
  max-width: calc(100vw - 32px);
  margin: 24px auto 48px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero {
  width: 100%;
  min-width: 0;
  min-height: auto;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.96), rgba(17, 17, 17, 0.82));
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(22px, 4vw, 56px);
  padding: clamp(22px, 5vw, 64px);
  overflow: hidden;
}

.hero > * {
  min-width: 0;
}

.hero-copy-block {
  width: 100%;
  max-width: 620px;
  min-width: 0;
  display: block;
  padding-top: 0;
}

.hero h1,
.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.65rem, 6.4vw, 4.35rem);
  line-height: 1.02;
  text-transform: uppercase;
  text-shadow: none;
  overflow-wrap: break-word;
}

.hero h1 span {
  color: var(--red);
}

.hero-art {
  min-width: 0;
  display: grid;
  place-items: center;
}

.hero-art img {
  width: min(100%, 720px);
  min-width: 0;
  max-height: 430px;
  object-fit: contain;
  display: block;
}

.hero-copy {
  max-width: 100%;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
  margin: 16px 0 20px;
}

.workflow-line {
  color: var(--paper);
  margin: 16px 0 0;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stamp-badge {
  width: fit-content;
  margin: 0 0 14px;
  border: 1px solid rgba(200, 16, 16, 0.7);
  border-radius: 6px;
  color: var(--red);
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.page-heading {
  margin: 34px 0 18px;
}

.inventory-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rust);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.landing-section .eyebrow,
#problem .eyebrow,
#faq .eyebrow {
  color: var(--rust);
}

.panel,
.metric {
  background:
    linear-gradient(180deg, rgba(242, 237, 227, 0.96), rgba(229, 218, 200, 0.92)),
    var(--panel-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  color: var(--paper-ink);
}

.panel {
  padding: 24px;
}

.dashboard-grid,
.dashboard-charts,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(440px, 1.2fr);
  gap: 22px;
  margin-top: 18px;
}

.home-command {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.4fr);
  gap: 22px;
  margin-top: 22px;
}

.landing-section {
  margin-top: clamp(30px, 6vw, 72px);
}

.landing-heading h2,
.section-copy h2,
.final-cta h2 {
  margin: 0;
  color: var(--bone);
  font-size: clamp(2.25rem, 5vw, 4.3rem);
  line-height: 1;
  text-transform: uppercase;
}

.section-copy {
  max-width: 820px;
}

.section-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.problem-section {
  display: grid;
  gap: 24px;
}

.problem-grid,
.feature-grid,
.step-grid,
.pricing-grid {
  display: grid;
  gap: 14px;
}

.problem-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.problem-grid article,
.feature-card,
.step-card,
.pricing-card,
.faq-section details {
  border-radius: 14px;
  background: rgba(242, 237, 227, 0.94);
  color: var(--rust);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.problem-grid strong,
.feature-card h3,
.pricing-card h3,
.step-card strong {
  display: block;
  color: var(--paper-ink);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 1.65rem;
  line-height: 1;
  text-transform: uppercase;
}

.problem-grid span,
.feature-card p,
.pricing-card p,
.step-card p,
.faq-section p {
  color: var(--paper-muted);
  line-height: 1.55;
}

.step-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step-card span {
  display: inline-flex;
  margin-bottom: 18px;
  border: 1px solid rgba(200, 16, 16, 0.35);
  border-radius: 999px;
  color: var(--red);
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.proof-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-card.featured {
  outline: 2px solid var(--red);
}

.pricing-card .button-link {
  margin-top: 14px;
}

.recovery-plan {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.recovery-step {
  display: grid;
  gap: 8px;
  border-radius: 16px;
  background: rgba(242, 237, 227, 0.92);
  color: var(--paper-ink);
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.16), 0 14px 28px rgba(0, 0, 0, 0.16);
}

.recovery-step span {
  width: fit-content;
  border-radius: 999px;
  background: rgba(200, 16, 16, 0.12);
  color: var(--red-dark);
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recovery-step strong {
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recovery-step p {
  margin: 0;
  color: var(--paper-muted);
  font-size: 0.92rem;
}

.recovery-step.is-done {
  background: rgba(46, 125, 50, 0.14);
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.4), 0 14px 28px rgba(0, 0, 0, 0.12);
}

.recovery-step.is-done span {
  background: var(--cash-green);
  color: var(--aged-paper);
}

.pricing-card .button-link.secondary {
  background: var(--black);
  color: var(--bone);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.32), 0 10px 22px rgba(17, 17, 17, 0.14);
}

.pricing-card .button-link.secondary:hover {
  background: var(--red-dark);
  color: var(--bone);
}

.faq-section {
  display: grid;
  gap: 12px;
}

.faq-section summary {
  cursor: pointer;
  color: var(--paper-ink);
  font-weight: 900;
}

.faq-section summary,
.filter-panel summary {
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.faq-section summary::-webkit-details-marker,
.filter-panel summary::-webkit-details-marker {
  display: none;
}

.faq-section summary::after,
.filter-panel summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.18s ease;
}

.filter-menu summary::after {
  display: none;
}

.faq-section details[open] summary::after,
.filter-panel[open] summary::after {
  transform: translateY(-35%) rotate(-135deg);
}

.final-cta {
  display: grid;
  justify-items: center;
  text-align: center;
  border-radius: 18px;
  background:
    linear-gradient(rgba(17, 17, 17, 0.86), rgba(17, 17, 17, 0.9)),
    url("assets/background.png");
  background-size: auto, 620px auto;
  padding: clamp(34px, 7vw, 74px);
  box-shadow: var(--shadow);
}

.recovery-card {
  position: relative;
  overflow: hidden;
}

.recovery-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -58px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(200, 16, 16, 0.15), transparent 68%);
  pointer-events: none;
}

.recovery-card h2 {
  max-width: 520px;
  margin: 0;
  color: var(--paper-ink);
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.02;
  text-transform: uppercase;
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workflow-card {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 22px;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.78), rgba(17, 17, 17, 0.92)),
    url("assets/background.png");
  background-size: auto, 520px auto;
  box-shadow: var(--shadow-soft), inset 0 0 0 1px rgba(242, 237, 227, 0.14);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.workflow-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(242, 237, 227, 0.22);
}

.workflow-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--rust);
  color: var(--bone);
  font-size: 0.78rem;
  font-weight: 900;
}

.workflow-card strong {
  color: var(--bone);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 0.95;
  text-transform: uppercase;
}

.workflow-card small {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.dashboard-charts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack-layout {
  display: grid;
  gap: 22px;
}

.three-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: var(--paper);
  margin-bottom: 20px;
}

.compact-heading {
  align-items: center;
  margin-top: 18px;
}

.compact-heading input {
  max-width: 320px;
}

.section-heading h2 {
  margin: 0;
  color: var(--paper-ink);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-heading.landing-heading h2 {
  color: var(--bone);
}

.panel .section-heading h2 {
  color: var(--paper-ink);
}

.panel .section-heading .eyebrow {
  color: var(--red);
  font-weight: 900;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-tabs {
  margin-bottom: 18px;
  padding: 5px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  box-shadow: inset 0 0 0 1px var(--paper-line);
  gap: 0;
}

.form-tab {
  min-height: var(--button-height);
  padding: 0 var(--button-padding-x);
  border-radius: 999px;
  background: transparent;
  color: var(--paper-muted);
  box-shadow: none;
}

.form-tab.active {
  background: linear-gradient(135deg, var(--rust), #b8211d);
  color: var(--bone);
  box-shadow: 0 10px 22px rgba(229, 57, 53, 0.2);
}

.capture-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.capture-mode-tab {
  min-height: 118px;
  border-radius: 14px;
  background: rgba(242, 237, 227, 0.72);
  color: var(--paper-muted);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  white-space: normal;
  box-shadow: inset 0 0 0 1px var(--paper-line), 0 12px 24px rgba(17, 17, 17, 0.08);
}

.mode-icon {
  width: 32px;
  height: 32px;
  color: var(--red);
}

.capture-mode-tab strong {
  color: var(--paper-ink);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  text-transform: uppercase;
}

.capture-mode-tab span {
  color: var(--paper-muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

.capture-mode-tab.active {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--bone);
  box-shadow: 0 10px 22px rgba(200, 16, 16, 0.22);
}

.capture-mode-tab.active strong,
.capture-mode-tab.active span,
.capture-mode-tab.active .mode-icon {
  color: var(--bone);
}

.capture-panel {
  display: none;
}

.capture-panel.active {
  display: block;
}

.card-tab-panel {
  display: none;
}

.card-tab-panel.active,
.money-tab-panel.active,
.planning-tab-panel.active {
  display: block;
}

.card-tab-panel.active[data-card-tab-panel="details"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 16px;
  align-items: start;
}

.card-tab-panel[data-card-tab-panel="details"] .capture-panel {
  grid-column: 1;
}

.editor-image-preview {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  gap: 10px;
  justify-self: end;
  width: min(220px, 100%);
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.08);
  padding: 10px;
  box-shadow: inset 0 0 0 1px var(--paper-line), 0 14px 28px rgba(17, 17, 17, 0.12);
}

.editor-image-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-image-heading strong {
  color: var(--paper-ink);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.editor-image-preview[hidden] {
  display: none;
}

.editor-image-preview figure {
  margin: 0;
  display: grid;
  gap: 6px;
}

.editor-image-preview img {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(242, 237, 227, 0.86);
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.editor-image-preview figcaption {
  color: var(--paper-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.editor-image-preview figure.is-empty {
  border-radius: 14px;
}

.empty-image-slot {
  aspect-ratio: 2.5 / 3.5;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px dashed rgba(37, 48, 44, 0.28);
  background: rgba(242, 237, 227, 0.54);
  color: var(--paper-muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.editor-image-preview .compact {
  width: 100%;
}

.money-tab-panel,
.planning-tab-panel {
  display: none;
}

.money-tab-panel > .panel + .panel,
.planning-tab-panel > .panel + .panel {
  margin-top: 22px;
}

.manual-field-group {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-radius: 16px;
  background: rgba(242, 237, 227, 0.58);
  padding: 14px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.manual-field-group:first-child {
  margin-top: 0;
}

.manual-field-group.is-hidden {
  display: none;
}

.group-heading h3 {
  margin: 0;
  color: var(--paper-ink);
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group-heading p {
  display: none;
}

.subsection-heading {
  margin-top: 6px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.value-tabs {
  display: flex;
  flex-wrap: wrap;
  margin-top: 8px;
  width: fit-content;
  padding: 4px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.value-tab {
  min-height: 36px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  color: var(--paper-ink);
  padding: 0 13px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
  font-size: 0.68rem;
}

.value-tab.active {
  background: var(--red);
  color: var(--bone);
  box-shadow: 0 8px 16px rgba(200, 16, 16, 0.18);
}

.value-tab-panel {
  display: none;
}

.value-tab-panel.active {
  display: block;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: var(--paper-ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--paper-ink);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  min-height: 46px;
  padding: 11px 12px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

select {
  appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--paper-ink) 50%),
    linear-gradient(135deg, var(--paper-ink) 50%, transparent 50%);
  background-position:
    calc(100% - 25px) 52%,
    calc(100% - 17px) 52%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

select option {
  color: var(--black);
  background: var(--bone);
}

textarea {
  margin-top: 14px;
  padding-block: 14px;
  resize: vertical;
}

#packNotes {
  margin-top: 8px;
  min-height: 104px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(37, 48, 44, 0.38);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(200, 16, 16, 0.24);
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.55);
}

.panel-copy {
  color: var(--paper-muted);
  line-height: 1.55;
  max-width: 760px;
  margin: 14px 0 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric {
  padding: 17px 18px;
  display: grid;
  gap: 8px;
}

.metric span,
.mini-metrics span {
  color: var(--paper-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong,
.mini-metrics strong {
  color: var(--paper-ink);
  font-family: "Arial Narrow", "Bebas Neue", Arial, sans-serif;
  font-size: 1.58rem;
  font-weight: 700;
  letter-spacing: 0.018em;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-metrics div {
  border-radius: 18px;
  background: rgba(247, 241, 230, 0.78);
  padding: 14px;
}

.chart-panel h2 {
  margin-top: 0;
  font-size: 1.42rem;
  text-transform: uppercase;
}

.bar-chart {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 1.1fr) minmax(120px, 2fr) auto;
  align-items: center;
  gap: 10px;
}

.bar-label {
  min-width: 0;
  overflow: hidden;
  color: var(--paper-ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 77, 66, 0.08);
  box-shadow: inset 0 0 0 1px rgba(47, 77, 66, 0.08);
}

.bar-track span {
  display: block;
  height: 100%;
  min-width: 7px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--cardboard));
}

.bar-row strong {
  color: var(--paper-ink);
  font-size: 0.78rem;
}

.compact-empty {
  margin-top: 0;
}

.module-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-links a {
  background: rgba(255, 255, 255, 0.58);
  color: var(--paper-ink);
}

.table-heading {
  align-items: center;
}

.selection-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--paper-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.selection-toolbar .filter-menu {
  margin-left: auto;
}

.bulk-toolbar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(247, 241, 230, 0.78);
}

.bulk-toolbar[hidden] {
  display: none;
}

.bulk-toolbar button {
  min-width: max-content;
}

#lotForm,
#lotForm * {
  min-width: 0;
}

.toggle-row,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-row {
  margin-top: 16px;
}

.toggle-field {
  width: fit-content;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.toggle-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green-light);
  box-shadow: none;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #f8fff8;
  background: rgba(47, 111, 85, 0.82);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.select-card-control {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.select-card-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.select-card-control span {
  width: 18px;
  height: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(47, 77, 66, 0.18), 0 8px 18px rgba(57, 68, 62, 0.12);
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.select-card-control input:checked + span {
  background: var(--green-light);
  box-shadow: inset 0 0 0 4px #f5fff4, 0 10px 20px rgba(47, 111, 85, 0.18);
}

.select-card-control:hover span {
  transform: scale(1.08);
}

.lot-tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(47, 111, 85, 0.14);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.lot-picker {
  margin: 18px 0;
  border-radius: 20px;
  background: rgba(242, 237, 227, 0.82);
  padding: 16px;
  box-shadow: inset 0 0 0 1px var(--paper-line), 0 12px 26px rgba(17, 17, 17, 0.1);
}

.lot-picker .eyebrow,
.lot-picker h2 {
  color: var(--paper-ink);
}

.lot-picker input {
  background: rgba(255, 255, 255, 0.88);
}

.selected-lot-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.selected-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.selected-card-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  box-shadow: inset 0 0 0 1px var(--paper-line), 0 10px 20px rgba(17, 17, 17, 0.08);
}

.selected-card-chip strong,
.selected-card-chip span {
  display: block;
}

.selected-card-chip strong {
  color: var(--paper-ink);
}

.selected-card-chip span {
  margin-top: 3px;
  color: var(--paper-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: rgba(200, 16, 16, 0.1);
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.22);
}

.x-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
}

.x-icon::before,
.x-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 7px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.x-icon::before {
  transform: rotate(45deg);
}

.x-icon::after {
  transform: rotate(-45deg);
}

.ai-scout-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ai-lot-card {
  display: grid;
  gap: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  padding: 16px;
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 24px rgba(57, 68, 62, 0.08);
}

.ai-lot-card h3 {
  margin: 0;
  color: var(--paper-ink);
  font-size: 1rem;
}

.ai-lot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-lot-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(47, 111, 85, 0.12);
  color: var(--green);
  padding: 0 9px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-lot-card p {
  margin: 0;
  color: var(--paper-muted);
  line-height: 1.45;
  font-size: 0.84rem;
}

.scan-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  border-radius: 20px;
  background: rgba(201, 163, 106, 0.18);
  padding: 18px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.scan-panel h3 {
  margin: 0;
  color: var(--paper-ink);
  font-size: 1.05rem;
}

.scan-controls,
.scan-results {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scan-confidence {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--aged-paper);
  background: var(--paper-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scan-confidence.high {
  background: var(--cash-green);
}

.scan-confidence.medium {
  background: var(--cardboard);
  color: var(--near-black);
}

.scan-confidence.low {
  background: var(--red);
}

.scan-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scan-side-card {
  min-height: 150px;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  display: grid;
  gap: 8px;
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  background: rgba(242, 237, 227, 0.78);
  color: var(--paper-ink);
  padding: 14px;
  box-shadow: 0 12px 24px rgba(17, 17, 17, 0.08);
}

.scan-side-card strong {
  color: var(--near-black);
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scan-side-card span {
  font-size: 0.84rem;
  line-height: 1.35;
}

.scan-side-card.active {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(200, 16, 16, 0.16), 0 16px 28px rgba(17, 17, 17, 0.14);
}

.scan-side-card.has-image::after {
  content: "Captured";
  width: fit-content;
  border-radius: 999px;
  background: rgba(46, 125, 50, 0.13);
  color: #1f6a25;
  padding: 4px 9px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scan-upload {
  min-height: var(--button-height);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rust), #b8211d);
  color: var(--bone);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--button-padding-x);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 12px 24px rgba(229, 57, 53, 0.22);
  gap: 8px;
}

.scan-upload.secondary-upload {
  background: rgba(17, 17, 17, 0.08);
  color: var(--paper-ink);
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.scan-upload input {
  display: none;
}

.scan-preview {
  display: block;
  width: min(180px, 100%);
  aspect-ratio: 2.5 / 3.5;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(242, 237, 227, 0.86);
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 24px rgba(57, 68, 62, 0.1);
}

.scan-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scan-side-preview {
  width: 96px;
  pointer-events: none;
}

.scan-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(47, 111, 85, 0.12);
  color: var(--green);
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 900;
}

.scan-video-panel {
  position: relative;
  display: grid;
  gap: 12px;
  border: 1px solid transparent;
  border-top-color: var(--line);
  border-radius: 18px;
  padding: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.scan-video-panel::after {
  content: attr(data-capture-side);
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  color: var(--paper-muted);
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.scan-video-panel.has-front-capture {
  border-color: rgba(46, 125, 50, 0.52);
  background: rgba(46, 125, 50, 0.05);
}

.scan-video-panel.is-capture-ready {
  border-color: rgba(46, 125, 50, 0.75);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.14), inset 0 0 0 1px rgba(46, 125, 50, 0.22);
}

.scan-video-panel.is-capture-ready::after {
  background: var(--cash-green);
  color: var(--aged-paper);
}

.video-scan-results {
  display: grid;
  gap: 10px;
}

.video-capture-preview {
  width: min(360px, 100%);
  aspect-ratio: 9 / 16;
  max-height: 420px;
  object-fit: cover;
  border-radius: 18px;
  background: var(--near-black);
  box-shadow: inset 0 0 0 1px var(--paper-line), 0 18px 30px rgba(17, 17, 17, 0.16);
}

.video-card-result {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  background: rgba(242, 237, 227, 0.7);
  padding: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.video-result-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.result-remove-button {
  background: rgba(17, 17, 17, 0.05);
  color: var(--paper-ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.result-remove-button:hover,
.result-remove-button:focus-visible {
  background: rgba(200, 16, 16, 0.11);
  color: var(--red-dark);
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.38);
}

.video-capture-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  background: rgba(242, 237, 227, 0.66);
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.video-capture-card strong {
  color: var(--paper-ink);
  font-weight: 900;
}

.video-capture-card span {
  color: var(--paper-muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.video-capture-card.is-captured {
  background: rgba(46, 125, 50, 0.13);
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.4);
}

.import-preview {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.usage-panel {
  margin-top: 16px;
}

.usage-grid,
.addon-packs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.addon-packs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.usage-card,
.addon-pack {
  display: grid;
  gap: 6px;
  border-radius: 16px;
  background: rgba(242, 237, 227, 0.72);
  padding: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.usage-card span,
.addon-pack span {
  color: var(--paper-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.usage-card strong,
.addon-pack strong {
  color: var(--paper-ink);
  font-weight: 900;
}

.usage-card small {
  color: var(--paper-muted);
  font-weight: 800;
}

.addon-packs.is-disabled {
  opacity: 0.62;
}

body:not(.is-admin) [data-page="admin"] {
  display: none;
}

.danger-light {
  background: rgba(200, 16, 16, 0.12);
  color: var(--red-dark);
  box-shadow: inset 0 0 0 1px rgba(200, 16, 16, 0.32);
}

.import-preview-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  background: rgba(242, 237, 227, 0.7);
  padding: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.picker-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 11px;
  cursor: pointer;
}

.picker-card:hover {
  background: rgba(255, 255, 255, 0.94);
}

.picker-card strong,
.picker-card small {
  display: block;
}

.picker-card small {
  color: var(--paper-muted);
  margin-top: 3px;
}

.filter-row {
  flex: 1;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.filter-row input {
  min-width: min(360px, 100%);
  max-width: 420px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
}

.filter-row select {
  width: 170px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
}

.filter-panel {
  margin: 14px 0 16px;
  border-radius: 16px;
  background: rgba(242, 237, 227, 0.7);
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.filter-menu {
  position: relative;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.filter-panel summary {
  cursor: pointer;
  color: var(--paper-ink);
  font-weight: 900;
  text-transform: uppercase;
}

.filter-menu summary {
  min-height: var(--button-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(242, 237, 227, 0.84);
  color: var(--paper-ink);
  padding: 0 38px 0 var(--button-padding-x);
  box-shadow: inset 0 0 0 1px rgba(199, 163, 106, 0.34), 0 8px 18px rgba(17, 17, 17, 0.08);
}

.filter-menu summary.filter-icon-button {
  width: var(--button-height);
  padding: 0;
  font-size: 1rem;
  font-weight: 900;
}

.filter-menu[open] {
  z-index: 8;
}

.filter-menu .filter-grid,
.filter-menu .form-actions {
  min-width: min(920px, calc(100vw - 36px));
  background: rgba(242, 237, 227, 0.98);
  box-shadow: 0 24px 52px rgba(17, 17, 17, 0.18);
}

.filter-menu .filter-grid {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  border-radius: 16px 16px 0 0;
  padding: 14px;
}

.filter-menu .form-actions {
  position: absolute;
  top: calc(100% + 10px + 162px);
  left: 0;
  border-radius: 0 0 16px 16px;
  padding: 0 14px 14px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.compact-table table {
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid rgba(47, 77, 66, 0.09);
  padding: 15px 14px;
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--paper-ink);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 26px;
}

th.sortable::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(110, 139, 103, 0.62);
  transform: translateY(-50%);
  opacity: 0.55;
}

th.sort-asc::after {
  content: "";
  border-top: 0;
  border-bottom: 5px solid var(--red);
  opacity: 0.9;
}

th.sort-desc::after {
  content: "";
  border-top: 5px solid var(--red);
  border-bottom: 0;
  opacity: 0.9;
}

td {
  color: var(--paper-ink);
  font-size: 0.87rem;
}

tbody tr[data-card-row] {
  cursor: pointer;
}

tbody tr[data-card-row]:hover {
  background: rgba(200, 16, 16, 0.05);
}

td a {
  color: #b9562f;
}

.table-pill-link {
  min-height: var(--compact-button-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--red);
  color: var(--bone);
  padding: 0 12px;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(200, 16, 16, 0.18);
}

.table-pill-link:hover {
  background: var(--red-dark);
  color: var(--bone);
  box-shadow: 0 10px 20px rgba(200, 16, 16, 0.24);
}

.card-title {
  font-weight: 900;
}

.value-cell {
  color: var(--paper-ink);
  font-size: 1rem;
  font-weight: 900;
  white-space: nowrap;
}

.text-link {
  display: inline-flex;
  margin-top: 4px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-meta,
.small-note {
  color: var(--paper-muted);
  font-size: 0.77rem;
  margin-top: 4px;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(47, 77, 66, 0.08);
  color: var(--paper-ink);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status.sold,
.status.high {
  background: rgba(47, 111, 85, 0.16);
  color: var(--green);
}

.status.listed,
.status.for-sale,
.status.medium {
  background: rgba(212, 108, 61, 0.14);
  color: #9d4324;
}

.row-actions,
.thumb-strip {
  display: flex;
  gap: 8px;
}

.thumb-strip img {
  width: 46px;
  height: 62px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(57, 68, 62, 0.18);
}

.image-saved-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  background: rgba(199, 163, 106, 0.22);
  color: var(--paper-ink);
  padding: 0 10px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-state {
  margin: 18px 0 0;
  color: var(--paper-muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 39, 36, 0.28);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(242, 237, 227, 0.98), rgba(229, 218, 200, 0.94)), var(--panel-soft);
  box-shadow: var(--shadow);
  padding: 24px;
}

.modal-panel label + label {
  margin-top: 16px;
}

.scan-result-dialog {
  width: min(620px, 100%);
}

.video-card-dialog {
  width: min(920px, 100%);
}

.video-card-review-layout {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.video-card-frame-preview {
  display: grid;
  gap: 10px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.08);
  padding: 8px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.video-card-frame-preview figure {
  margin: 0;
}

.video-card-frame-preview img {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.video-card-frame-preview figcaption {
  margin-top: 6px;
  color: var(--paper-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.scan-result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scan-result-item {
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.06);
  padding: 12px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.scan-result-item span {
  display: block;
  color: var(--paper-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scan-result-item strong {
  display: block;
  margin-top: 4px;
  color: var(--paper-ink);
}

.form-collapsed form {
  display: none;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  border-radius: 16px;
  padding: 13px 16px;
  color: var(--paper-ink);
  background: rgba(242, 237, 227, 0.96);
  border-left: 5px solid var(--red);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px rgba(17, 17, 17, 0.12);
  transform: translateY(10px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.login-panel {
  border-radius: 30px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.88), rgba(17, 17, 17, 0.46)),
    url("assets/hero.png"),
    linear-gradient(135deg, rgba(17, 17, 17, 0.9), rgba(200, 16, 16, 0.2));
  background-size: cover, min(700px, 92%) auto, cover;
  background-position: center, right bottom, center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
  padding: clamp(26px, 6vw, 56px);
}

.login-brand {
  margin-bottom: 26px;
}

.login-panel h1 {
  max-width: 580px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.1rem, 7vw, 4rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.login-legal {
  max-width: 520px;
  margin: 18px 0 0;
  color: rgba(242, 237, 227, 0.78);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
}

.login-legal a {
  color: var(--bone);
  font-weight: 900;
}

.legal-page .page-heading {
  max-width: 900px;
}

.legal-panel {
  display: grid;
  gap: 14px;
  max-width: 960px;
}

.legal-panel h2 {
  margin: 10px 0 0;
  color: var(--paper-ink);
  font-size: 1.25rem;
  text-transform: uppercase;
}

.legal-panel p {
  margin: 0;
  color: var(--paper-muted);
  line-height: 1.65;
}

.legal-panel a {
  color: var(--red-dark);
  font-weight: 900;
}

@media (max-width: 680px) {
  :root {
    --button-height: 48px;
    --button-padding-x: 14px;
    --compact-button-height: 42px;
  }

  body {
    font-size: 16px;
    line-height: 1.5;
  }

  .app-header {
    position: sticky;
    grid-template-columns: 1fr auto;
    gap: 10px;
    min-height: auto;
    padding: 10px;
  }

  .tool-nav {
    position: fixed;
    top: 70px;
    right: 10px;
    left: 10px;
    z-index: 20;
    display: none;
    flex-direction: column;
    padding: 10px;
    border-radius: 16px;
    background: rgba(17, 17, 17, 0.96);
  }

  body.nav-open .tool-nav {
    display: flex;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .brand-text {
    font-size: 1.1rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .page-nav,
  .top-actions {
    grid-column: 1 / -1;
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: 8px;
  }

  body.nav-open .page-nav,
  body.nav-open .top-actions {
    display: flex;
  }

  .page-nav a,
  .top-actions button,
  .top-actions a {
    width: 100%;
    justify-content: center;
  }

  .tool-nav a {
    width: 100%;
  }

  .scan-result-summary {
    grid-template-columns: 1fr;
  }

  main {
    width: calc(100% - 18px);
    max-width: 100%;
    margin: 12px auto 36px;
  }

  .hero {
    grid-template-columns: 1fr;
    border-radius: 18px;
    padding: 22px;
  }

  .hero-art {
    order: -1;
  }

  .hero-art img {
    max-height: 270px;
  }

  .hero .quick-actions {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero h1,
  .page-heading h1 {
    font-size: clamp(2.35rem, 15vw, 3.65rem);
  }

  .problem-grid,
  .feature-grid,
  .step-grid,
  .proof-section,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    border-radius: 18px;
    padding: 18px;
  }

  .field-grid,
  .compact-grid,
  .metrics,
  .mini-metrics,
  .bulk-toolbar,
  .home-command,
  .workflow-board,
  .ai-results {
    grid-template-columns: 1fr;
  }

  .workflow-card {
    min-height: 170px;
  }

  .form-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .form-tab {
    flex: 1 0 auto;
  }

  .card-tab-panel.active[data-card-tab-panel="details"] {
    grid-template-columns: 1fr;
  }

  .card-tab-panel[data-card-tab-panel="details"] .capture-panel,
  .editor-image-preview {
    grid-column: 1;
  }

  .editor-image-preview {
    grid-row: auto;
    order: -1;
    justify-self: stretch;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capture-mode-tabs {
    grid-template-columns: 1fr;
  }

  .scan-side-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .scan-controls,
  .backup-actions,
  .quick-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions > *,
  .scan-controls > *,
  .backup-actions > *,
  .quick-actions > * {
    width: 100%;
  }

  .scan-panel {
    margin-inline: 0;
    padding: 16px;
  }

  .video-card-result {
    grid-template-columns: 1fr;
  }

  .video-result-actions {
    width: 100%;
    justify-content: space-between;
  }

  .video-card-review-layout {
    grid-template-columns: 1fr;
  }

  .video-card-frame-preview {
    max-width: 220px;
    justify-self: center;
  }

  .import-preview-card {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin-inline: 0;
    border-radius: 14px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 720px;
  }

  .compact-table table {
    min-width: 560px;
  }

  th,
  td {
    padding: 12px 10px;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px;
  }

  textarea {
    min-height: 112px;
  }

  button,
  .import-button,
  .button-link,
  .form-actions a {
    font-size: 0.82rem;
  }

  label,
  th,
  .eyebrow,
  .form-tab,
  .capture-mode-tab .mode-kicker {
    font-size: 0.78rem;
  }

  .small-note,
  .card-meta,
  .panel-copy,
  td {
    font-size: 0.92rem;
  }
}

@media (max-width: 1280px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .page-nav {
    justify-content: flex-start;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-grid,
  .home-command,
  .dashboard-charts,
  .split-layout,
  .three-layout {
    display: block;
  }

  .dashboard-grid .panel + .panel,
  .home-command .workflow-board,
  .dashboard-charts .panel + .panel,
  .split-layout .panel + .panel,
  .three-layout .panel + .panel {
    margin-top: 18px;
  }

  .hero,
  .problem-section,
  .problem-grid,
  .feature-grid,
  .step-grid,
  .proof-section,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .hero-art img {
    max-height: 360px;
  }

  .hero-copy-block {
    max-width: none;
  }
}

@media (max-width: 680px) {
  main {
    width: calc(100% - 20px);
    max-width: calc(100vw - 20px);
    margin-top: 10px;
  }

  .app-header {
    padding: 12px;
  }

  .filter-row,
  .quick-actions,
  .module-links,
  .backup-actions,
  .app-footer {
    display: grid;
  }

  .app-footer {
    justify-items: center;
    text-align: center;
  }

  .field-grid,
  .metrics,
  .mini-metrics,
  .usage-grid,
  .addon-packs,
  .bulk-toolbar,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .table-heading {
    display: grid;
  }

  .compact-heading input {
    max-width: none;
  }

  .picker-list {
    grid-template-columns: 1fr;
  }

  .selected-card-grid {
    grid-template-columns: 1fr;
  }

  .scan-mobile-hide {
    display: none;
  }

  .scan-inventory-panel .compact-table table {
    width: 100%;
    min-width: 0;
  }

  #lotForm .compact-heading {
    grid-template-columns: 1fr;
  }

  #lotForm .lot-picker,
  #lotForm .selected-lot-block {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #lotForm .picker-card,
  #lotForm .selected-card-chip {
    max-width: 100%;
  }

  .ai-results {
    grid-template-columns: 1fr;
  }

  .filter-row select {
    width: 100%;
  }

  .recovery-plan {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 20px;
  }

  .hero h1,
  .page-heading h1 {
    font-size: clamp(2.15rem, 12.5vw, 3.35rem);
  }

  .hero .button-link {
    min-width: 0;
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .inventory-search-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .inventory-search-row input,
  .filter-row input {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .app-header {
    grid-template-columns: 1fr auto;
    max-width: calc(100vw - 16px);
  }

  main,
  .page,
  .panel,
  .table-panel,
  .scan-panel,
  .manual-field-group,
  .modal-panel,
  .hero,
  .stack-layout,
  .split-layout,
  .three-layout,
  .dashboard-grid,
  .home-command,
  .workflow-board,
  .field-grid > *,
  .compact-grid > *,
  .metrics > *,
  .mini-metrics > * {
    min-width: 0;
    max-width: 100%;
  }

  .hero,
  .hero-copy-block,
  .hero-art,
  .hero-art img,
  .landing-section,
  .problem-section,
  .problem-grid,
  .feature-grid,
  .step-grid,
  .proof-section,
  .pricing-grid,
  .faq-section {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .section-heading,
  .table-heading,
  .compact-heading {
    gap: 12px;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .form-tabs {
    max-width: 100%;
    padding-bottom: 4px;
  }

  .form-tabs,
  .value-tabs {
    width: 100%;
  }

  .form-tab,
  .value-tab {
    flex: 1 1 0;
  }

  body.is-authenticated.nav-open .tool-nav,
  body.is-anonymous.nav-open .tool-nav {
    display: none;
  }

  .capture-mode-tab {
    min-height: auto;
    padding: 16px;
  }

  .hero-copy,
  .problem-card p,
  .feature-card p,
  .step-card p,
  .pricing-card li,
  .faq-body {
    font-size: 1rem;
  }
}
