:root {
  --ink: #172033;
  --muted: #637286;
  --line: rgba(20, 63, 94, 0.15);
  --surface: #f6fbfd;
  --panel: #ffffff;
  --teal: #155da8;
  --teal-dark: #073763;
  --green: #2f8f5b;
  --gold: #edb93a;
  --coral: #c95543;
  --blue: #2257ed;
  --cyan: #27c1df;
  --yellow: #ffd64a;
  --shadow: 0 18px 42px rgba(5, 35, 65, 0.16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 48px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

.dealer-page {
  background:
    linear-gradient(180deg, rgba(246, 251, 253, 0.88), rgba(255, 255, 255, 0.96) 58%),
    url("/images/pool-img-3.jpg") center top / cover fixed no-repeat;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  touch-action: manipulation;
}

.site-header,
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(var(--header-height) + var(--safe-top));
  padding: calc(12px + var(--safe-top)) clamp(18px, 5vw, 64px) 12px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(4, 35, 70, 0.74), rgba(10, 94, 139, 0.44)),
    rgba(8, 54, 93, 0.66);
  border-bottom: 1px solid rgba(255, 214, 74, 0.38);
  box-shadow: 0 14px 34px rgba(5, 35, 65, 0.18);
  backdrop-filter: blur(22px) saturate(1.35);
}

.app-header {
  min-height: calc(48px + var(--safe-top));
  padding: calc(7px + var(--safe-top)) clamp(12px, 4vw, 28px) 7px;
}

.app-title {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  min-width: 0;
}

.site-header .brand-mark small,
.site-header .top-nav a,
.app-header .top-nav a {
  color: rgba(255, 255, 255, 0.86);
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark strong {
  font-size: 18px;
}

.brand-mark small {
  color: var(--muted);
  line-height: 1.2;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.app-header .top-nav {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.top-nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 800;
  color: var(--teal-dark);
}

.top-nav a:hover,
.top-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: inline-flex;
  align-items: center;
  max-width: min(52vw, 260px);
  min-height: 34px;
  padding: 8px 28px 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  list-style: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu summary::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}

.account-menu[open] summary {
  border-color: rgba(255, 214, 74, 0.64);
  background: rgba(255, 255, 255, 0.2);
}

.account-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 5px;
  width: min(290px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.account-panel strong,
.account-panel span,
.account-panel small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel strong {
  color: var(--ink);
  font-size: 14px;
}

.account-panel span,
.account-panel small {
  color: var(--muted);
  font-size: 13px;
}

.account-panel a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  text-decoration: none;
  font-weight: 900;
}

.public-hero {
  min-height: calc(100vh - var(--header-height) - var(--safe-top));
  min-height: calc(100svh - var(--header-height) - var(--safe-top));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 28px;
  padding: clamp(44px, 8vw, 96px) clamp(18px, 6vw, 76px) clamp(38px, 7vw, 72px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 37, 47, 0.82), rgba(8, 84, 108, 0.46), rgba(10, 97, 92, 0.24)),
    url("/images/pool-img-1.jpg") center / cover no-repeat;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
}

.hero-copy h1,
.dashboard-hero h1,
.login-visual h1 {
  margin: 0;
  font-size: clamp(46px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p,
.dashboard-hero p,
.login-visual p {
  max-width: 680px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 19px;
  line-height: 1.45;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto;
  max-width: 840px;
  margin-top: 26px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  overflow: hidden;
}

.hero-search input,
.hero-search select {
  min-width: 0;
  border: 0;
  padding: 16px 18px;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.hero-search select {
  border-left: 1px solid rgba(5, 45, 62, 0.12);
  border-radius: 0;
}

.hero-search button,
.login-form button,
.form-actions button {
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  font-weight: 900;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
}

.hero-search button {
  border-radius: 0;
}

.hero-search button:hover,
.login-form button:hover,
.form-actions button:hover {
  background: var(--teal-dark);
}

.hero-stats,
.dashboard-stats {
  display: grid;
  gap: 10px;
}

.hero-stats span,
.dashboard-stats span {
  display: block;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
}

.hero-stats strong,
.dashboard-stats strong {
  display: block;
  font-size: 26px;
}

.filter-band {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.filter-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px clamp(18px, 5vw, 64px);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.filter-inner a {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 800;
  background: #fff;
}

.filter-inner a.active,
.filter-inner a:hover {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.gallery-section,
.job-gallery {
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px clamp(18px, 5vw, 64px) 58px;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2,
.panel-heading h2,
.login-form h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.secondary-link {
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.photo-card,
.dealer-photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 42, 58, 0.08);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe8ed;
}

.photo-card-body {
  padding: 13px;
}

.photo-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.25;
}

.photo-card p {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.quality-pill,
.sync-state {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #e7f4ed;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.app-main {
  min-height: calc(100vh - var(--header-height) - var(--safe-top));
  min-height: calc(100svh - var(--header-height) - var(--safe-top));
}

.dashboard-hero.upload-summary {
  min-height: auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 24px clamp(18px, 5vw, 64px);
  background:
    linear-gradient(110deg, rgba(13, 62, 76, 0.95), rgba(14, 116, 144, 0.86), rgba(47, 143, 91, 0.72));
}

.dashboard-hero.upload-summary h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
}

.dashboard-hero.upload-summary p {
  max-width: 620px;
  margin-top: 8px;
  font-size: 16px;
}

.dashboard-hero.upload-summary .dashboard-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-hero.upload-summary .dashboard-stats span {
  padding: 10px 12px;
}

.dashboard-hero.upload-summary .dashboard-stats strong {
  font-size: 20px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 28px;
  align-items: end;
  padding: 42px clamp(18px, 5vw, 64px);
  background:
    linear-gradient(90deg, rgba(13, 62, 76, 0.88), rgba(22, 112, 104, 0.58)),
    url("/images/pool-img-3.jpg") center / cover no-repeat;
  color: #fff;
}

.dashboard-hero h1 {
  font-size: clamp(36px, 5vw, 68px);
}

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

.workbench {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 24px clamp(18px, 5vw, 64px);
}

.media-workbench {
  max-width: 940px;
  grid-template-columns: minmax(0, 1fr);
  padding-top: clamp(18px, 5vh, 42px);
  padding-bottom: 30px;
}

.upload-panel,
.job-panel,
.login-form,
.setup-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(5, 35, 65, 0.13);
}

.upload-panel,
.job-panel,
.setup-panel {
  padding: 18px;
}

.media-upload-panel {
  padding: clamp(12px, 2.4vw, 20px);
  border-color: rgba(39, 193, 223, 0.28);
  backdrop-filter: blur(18px);
}

.media-upload-panel .panel-heading {
  align-items: center;
  margin-bottom: 10px;
}

.media-upload-panel .eyebrow {
  color: var(--teal-dark);
}

.description-step label {
  color: var(--ink);
  font-size: 15px;
}

.description-step textarea {
  min-height: 152px;
  border-color: rgba(21, 93, 168, 0.24);
  background: #fff;
  font-size: 17px;
  line-height: 1.45;
}

.upload-form {
  display: grid;
}

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

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.visually-quiet {
  font-size: 0;
}

.visually-quiet input,
.visually-quiet select,
.visually-quiet textarea {
  font-size: 16px;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-form > label {
  margin-top: 12px;
}

.upload-step {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.upload-step:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.upload-step-primary {
  padding-bottom: 16px;
}

.upload-step h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.1;
}

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

.upload-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 0;
}

.upload-check-row input {
  width: auto;
  flex: 0 0 auto;
}

.color-select-step {
  gap: 10px;
}

.color-palette-strip {
  display: grid;
  gap: 6px;
}

.color-palette-strip img {
  display: block;
  width: 100%;
  max-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.color-palette-strip img + img {
  max-height: 44px;
}

.gel-graphic-select {
  position: relative;
  display: grid;
  gap: 8px;
}

.gel-graphic-select > select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.gel-graphic-trigger,
.agreement-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f9fcfd;
}

.gel-graphic-trigger {
  width: 100%;
  min-height: 64px;
  cursor: pointer;
  text-align: left;
}

.gel-graphic-trigger:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(24, 127, 145, 0.16);
}

.gel-trigger-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gel-trigger-copy strong,
.gel-trigger-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gel-select-arrow {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 999px;
  background: #eef8fb;
}

.gel-select-arrow::before {
  content: "";
  position: absolute;
  inset: 6px 5px 8px;
  border-right: 2px solid var(--teal-dark);
  border-bottom: 2px solid var(--teal-dark);
  transform: rotate(45deg);
}

.gel-graphic-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 70;
  display: grid;
  gap: 7px;
  max-height: min(430px, 68vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.gel-graphic-menu[hidden] {
  display: none;
}

.gel-graphic-menu button {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.gel-graphic-menu button:hover,
.gel-graphic-menu button:focus,
.gel-graphic-menu button[aria-selected="true"] {
  border-color: var(--teal);
  outline: 0;
  background: #eef8fb;
}

.gel-graphic-menu img {
  display: block;
  width: 126px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.gel-graphic-menu button > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.gel-coat-swatch {
  flex: 0 0 auto;
  width: 52px;
  height: 36px;
  border: 1px solid rgba(5, 45, 62, 0.18);
  border-radius: 6px;
  background:
    var(--gel-swatch-image, linear-gradient(135deg, var(--gel-primary, #9ec7d2), var(--gel-secondary, #eef5f8)));
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.agreement-callout span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gel-trigger-copy strong,
.agreement-callout strong {
  color: var(--ink);
  font-size: 14px;
}

.gel-trigger-copy small,
.agreement-callout small,
.agreement-details {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.agreement-callout button {
  flex: 0 0 auto;
  border: 1px solid rgba(21, 93, 168, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--teal-dark);
  background: #dff8ff;
  font-weight: 900;
  cursor: pointer;
}

.upload-agreement.is-accepted .agreement-callout {
  border-color: #b7dfc8;
  background: #f0fbf4;
}

.upload-agreement.is-accepted .agreement-callout small::after {
  content: " Permission accepted for this upload.";
  color: #1f7a43;
  font-weight: 900;
}

.upload-agreement-dialog[hidden] {
  display: none;
}

.upload-agreement-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
}

.agreement-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 29, 39, 0.62);
}

.agreement-dialog-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(620px, 100%);
  max-height: min(720px, 88vh);
  overflow: auto;
  border-radius: 8px;
  padding: clamp(18px, 4vw, 26px);
  background: #fff;
  box-shadow: 0 24px 80px rgba(4, 29, 39, 0.34);
}

.agreement-dialog-panel h3 {
  margin: 0;
  font-size: 24px;
}

.agreement-dialog-lead {
  margin: 0;
  color: var(--teal-dark);
  font-size: 15px;
  line-height: 1.45;
}

.agreement-dialog-text {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #f9fcfd;
  font-size: 13px;
  line-height: 1.5;
}

.agreement-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.agreement-dialog-actions button {
  border: 0;
  border-radius: 8px;
  padding: 12px 15px;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
  cursor: pointer;
}

.agreement-dialog-actions button.secondary {
  border: 1px solid var(--line);
  color: var(--teal-dark);
  background: #fff;
}

.modal-open {
  overflow: hidden;
}

.upload-form-status {
  margin: 0;
  border: 1px solid #d6992a;
  border-radius: 8px;
  padding: 9px 10px;
  color: #6a4210;
  background: #fff8e6;
  font-size: 13px;
  font-weight: 900;
}

.needs-attention {
  outline: 3px solid rgba(214, 153, 42, 0.28);
  outline-offset: 3px;
}

.upload-drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  margin-top: 0;
  border: 2px dashed rgba(39, 193, 223, 0.72);
  border-radius: 8px;
  color: var(--teal-dark);
  background:
    linear-gradient(180deg, rgba(223, 248, 255, 0.96), rgba(255, 255, 255, 0.95));
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.upload-drop strong,
.upload-drop span {
  position: relative;
  z-index: 1;
}

.model-picker {
  position: relative;
  display: grid;
  gap: 6px;
  grid-column: span 2;
  min-width: 0;
}

.model-picker[data-model-multiple] {
  grid-column: auto;
}

.model-picker-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  gap: 6px;
  max-height: min(430px, 70vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.model-option {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.model-option:hover,
.model-option:focus {
  border-color: var(--teal);
  outline: 0;
  background: #eef8fb;
}

.model-option.empty {
  display: block;
  padding: 12px;
  color: var(--muted);
}

.model-option-visual {
  display: grid;
  place-items: center;
  width: 92px;
  height: 62px;
  border-radius: 6px;
  background: #edf4f7;
  overflow: hidden;
}

.model-option-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.model-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.model-option-copy strong,
.model-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-option-copy small,
.model-picked small {
  color: var(--muted);
  font-size: 13px;
}

.model-picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #b7dfc8;
  border-radius: 8px;
  color: var(--green);
  background: #f0faf4;
  font-size: 13px;
  font-weight: 900;
}

.model-picked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 8px 7px 10px;
  border: 1px solid #b7dfc8;
  border-radius: 8px;
  color: var(--green);
  background: #f0faf4;
  font-size: 14px;
  font-weight: 900;
}

.model-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-chip button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  color: var(--green);
  background: #dff3e8;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.model-chip button:hover,
.model-chip button:focus {
  color: #fff;
  outline: 0;
  background: var(--green);
}

.upload-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-drop.is-dragging {
  border-color: var(--yellow);
  background: #fff8d7;
  transform: translateY(-1px);
}

.upload-drop span {
  color: var(--muted);
  font-size: 13px;
}

.upload-drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
}

.upload-drop-icon::before,
.retry-icon::before {
  content: "";
  display: block;
}

.upload-drop-icon::before {
  width: 13px;
  height: 13px;
  border-top: 3px solid #fff;
  border-left: 3px solid #fff;
  transform: translateY(4px) rotate(45deg);
  box-shadow: -5px 5px 0 -2px #fff, 5px -5px 0 -2px #fff;
}

.upload-queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fcfd;
}

.upload-queue-toolbar span {
  color: var(--teal-dark);
  font-weight: 900;
}

.upload-queue-toolbar button,
.native-photo-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid rgba(21, 93, 168, 0.35);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--teal-dark);
  background: #dff8ff;
  font-weight: 900;
  cursor: pointer;
}

.upload-queue-toolbar button:hover,
.upload-queue-toolbar button:focus,
.native-photo-actions button:hover,
.native-photo-actions button:focus {
  color: #fff;
  outline: 0;
  background: var(--teal);
}

.retry-icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
}

.retry-icon::before {
  position: absolute;
  right: -2px;
  top: 0;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(18deg);
}

.source-icon {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.scan-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.scan-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.scan-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 3px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.upload-queue {
  display: grid;
  gap: 9px;
}

.save-post-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(110deg, #073763 0%, #155da8 52%, #27c1df 100%);
  box-shadow:
    0 0 0 1px rgba(67, 195, 211, 0.28),
    0 14px 34px rgba(34, 87, 237, 0.28),
    0 0 34px rgba(67, 195, 211, 0.44);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  animation: save-post-glow 1.6s ease-in-out infinite;
}

.save-post-button:hover,
.save-post-button:focus {
  outline: 0;
  box-shadow:
    0 0 0 2px rgba(67, 195, 211, 0.42),
    0 18px 42px rgba(34, 87, 237, 0.34),
    0 0 44px rgba(40, 182, 163, 0.58);
  transform: translateY(-1px);
}

.upload-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(18, 42, 58, 0.07);
  animation: upload-card-in 220ms ease both;
}

.upload-thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 7px;
  overflow: hidden;
  background: #e8f1f5;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-thumb-icon {
  width: 28px;
  height: 22px;
  border: 2px solid #9ec7d2;
  border-radius: 4px;
  position: relative;
}

.upload-thumb-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 4px;
  width: 18px;
  height: 12px;
  background: linear-gradient(135deg, transparent 46%, #9ec7d2 47% 58%, transparent 59%);
}

.upload-card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.upload-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.upload-card-top strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--teal-dark);
  background: #e6f4f7;
  font-size: 12px;
  font-weight: 900;
}

.upload-card[data-status="uploading"] .upload-status,
.upload-card[data-status="saving"] .upload-status {
  color: #fff;
  background: var(--teal);
}

.upload-card[data-status="complete"] .upload-status {
  color: #fff;
  background: var(--green);
}

.upload-card[data-status="waiting"] .upload-status,
.upload-card[data-status="queued"] .upload-status {
  color: #735119;
  background: #fff1ca;
}

.upload-card[data-status="failed"] .upload-status {
  color: #fff;
  background: var(--coral);
}

.upload-card-body p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceaf0;
}

.upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green), var(--cyan));
  transition: width 220ms ease;
}

.upload-card[data-status="uploading"] .upload-progress span,
.upload-card[data-status="saving"] .upload-progress span {
  animation: upload-progress-pulse 1.1s linear infinite;
}

.native-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.native-photo-actions[hidden] {
  display: none;
}

.tag-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tag-field legend {
  color: var(--teal-dark);
  font-weight: 900;
}

.tag-field label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  width: auto;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.tag-field input {
  width: 16px;
  height: 16px;
}

.preview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.preview-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.form-actions .ghost-button {
  color: var(--teal-dark);
  border: 1px solid var(--line);
  background: #fff;
}

.form-actions .ghost-button:hover {
  color: #fff;
  border-color: var(--teal-dark);
}

.job-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}

.job-list a {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: #fff;
}

.job-list a.active,
.job-list a:hover {
  border-color: var(--teal);
  background: #eef8fb;
}

.job-list span,
.job-list small,
.dealer-photo-card span,
.dealer-photo-card small {
  color: var(--muted);
}

.dealer-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.dealer-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe8ed;
}

.dealer-photo-card div {
  display: grid;
  gap: 3px;
  padding: 11px;
}

.login-layout {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 430px);
  justify-content: center;
  gap: 0;
  align-items: center;
  padding: calc(28px + var(--safe-top)) clamp(18px, 5vw, 48px) calc(28px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 28%),
    linear-gradient(135deg, var(--blue) 0%, #2f87ea 31%, var(--cyan) 56%, #2462ee 100%);
}

.login-form {
  display: grid;
  gap: 16px;
  width: min(100%, 430px);
  padding: 28px;
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: 0 22px 60px rgba(12, 41, 92, 0.24);
}

.login-logo {
  width: min(210px, 58vw);
  margin: 0 auto 4px;
}

.login-form h1 {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 25px;
  line-height: 1.12;
  text-align: center;
}

.login-visual {
  color: #fff;
}

.login-visual h1 {
  font-size: clamp(36px, 5vw, 70px);
}

.flash {
  max-width: 1440px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash.success {
  border-color: #b7dfc8;
  color: var(--green);
}

.flash.warn {
  border-color: #efc7bf;
  color: var(--coral);
}

@keyframes upload-card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes upload-progress-pulse {
  0% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.25) brightness(1.08);
  }
  100% {
    filter: saturate(1);
  }
}

@keyframes save-post-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(67, 195, 211, 0.28),
      0 14px 34px rgba(34, 87, 237, 0.28),
      0 0 34px rgba(67, 195, 211, 0.44);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(67, 195, 211, 0.38),
      0 18px 42px rgba(34, 87, 237, 0.34),
      0 0 48px rgba(40, 182, 163, 0.58);
  }
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.setup-panel {
  max-width: 720px;
  margin: 40px auto;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 5vw, 64px) calc(22px + var(--safe-bottom));
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 980px) {
  .public-hero,
  .dashboard-hero,
  .workbench,
  .login-layout {
    grid-template-columns: 1fr;
  }

  .public-hero {
    min-height: auto;
    padding-top: 72px;
  }

  .form-grid,
  .form-grid.compact,
  .upload-meta-grid {
    grid-template-columns: 1fr;
  }

  .model-picker {
    grid-column: auto;
  }

  .dashboard-hero.upload-summary .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-panel {
    order: -1;
  }
}

@media (max-width: 680px) {
  .site-header,
  .app-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dealer-page .app-header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

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

  .dealer-page .top-nav {
    justify-content: flex-end;
  }

  .app-title {
    font-size: 16px;
  }

  .account-menu summary {
    max-width: 58vw;
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .hero-search button {
    border-radius: 0;
  }

  .hero-stats,
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-hero.upload-summary .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .section-heading,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .upload-thumb {
    width: 62px;
    height: 62px;
  }

  .upload-card-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}
