:root {
  color-scheme: light;
  --color-midnight-graphite: #111111;
  --color-ash-black: #000000;
  --color-cloud-white: #fafafa;
  --color-steel-gray: #414141;
  --color-smoke-gray: #737373;
  --color-stone-gray: #c1c1c1;
  --color-electric-blue: #0b6ec5;
  --color-flame-orange: #f35815;
  --color-marigold-yellow: #f2b600;
  --color-verdant-green: #22a652;
  --font-ui-monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --text-body: 16px;
  --leading-body: 1.5;
  --tracking-body: 0;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-24: 24px;
  --spacing-40: 40px;
  --spacing-48: 48px;
  --spacing-56: 56px;
  --spacing-96: 96px;
  --page-max-width: 1280px;
  --radius-full: 9999px;
  --radius-inputs: 0;
  --radius-buttons: 0;
  --app-viewport-height: 100svh;
  font-family: var(--font-ui-monospace);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--color-cloud-white);
}

body {
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  color: var(--color-ash-black);
  background:
    linear-gradient(var(--color-stone-gray) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-stone-gray) 1px, transparent 1px),
    var(--color-cloud-white);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(250, 250, 250, 0.82);
}

@supports (overflow-x: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
}

input:disabled,
select:disabled {
  opacity: 0.48;
}

button,
a[href],
select,
.source-mode-card,
.drop-zone {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button.is-haptic-pressing:not(:disabled),
a.is-haptic-pressing,
select.is-haptic-pressing:not(:disabled),
.source-mode-card.is-haptic-pressing,
.drop-zone.is-haptic-pressing {
  transform: translateY(1px) scale(0.99);
  transform-origin: center;
  filter: saturate(1.08);
  box-shadow: var(--haptic-press-shadow, 0 0 0 3px rgba(243, 88, 21, 0.16));
  transition: transform 90ms ease, filter 90ms ease, box-shadow 90ms ease;
}

body.is-haptic-pulse {
  --haptic-press-shadow: 0 0 0 3px rgba(243, 88, 21, 0.18);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.05;
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  font-weight: var(--font-weight-bold);
}

.app-shell {
  width: min(var(--page-max-width), 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--spacing-24);
}

.app-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--spacing-24);
  margin-bottom: var(--spacing-24);
  border: 1px solid var(--color-midnight-graphite);
  background: var(--color-cloud-white);
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-block > div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: var(--spacing-16) var(--spacing-24);
}

.brand-mark {
  display: grid;
  flex: 0 0 64px;
  align-self: center;
  place-items: center;
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: stretch;
  gap: var(--spacing-8);
}

.page-nav-link[hidden] {
  display: none;
}

.header-actions .icon-button[aria-current="page"] {
  border-color: var(--color-midnight-graphite);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--color-steel-gray);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.picker-panel,
.upload-panel,
.album-section,
.login-card {
  border: 1px solid var(--color-midnight-graphite);
  border-radius: 0;
  background: var(--color-cloud-white);
  box-shadow: none;
}

.picker-panel,
.album-section {
  padding: var(--spacing-16);
}

html.is-upload-route .album-section,
.app-shell.is-upload-page .album-section,
html.is-gallery-route .picker-panel,
html.is-gallery-route .upload-panel,
.app-shell.is-gallery-page .picker-panel,
.app-shell.is-gallery-page .upload-panel,
html.is-chat-route .picker-panel,
html.is-chat-route .upload-panel,
html.is-chat-route .album-section,
.app-shell.is-chat-page .picker-panel,
.app-shell.is-chat-page .upload-panel,
.app-shell.is-chat-page .album-section {
  display: none;
}

.app-shell.is-chat-page {
  min-height: 0;
  padding: 0;
}

html.is-chat-route .app-shell,
html.is-chat-route .app-header {
  display: none;
}

.picker-panel {
  border-top-width: 4px;
}

.upload-panel,
.album-section {
  min-width: 0;
  margin-top: var(--spacing-16);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-24);
}

.section-heading {
  margin-bottom: var(--spacing-16);
  border-bottom: 1px solid var(--color-stone-gray);
  padding-bottom: var(--spacing-16);
}

.album-section .section-heading > div {
  margin-right: auto;
}

.section-heading p {
  margin-top: 4px;
  color: var(--color-smoke-gray);
  font-size: 14px;
}

.inventory-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--spacing-8);
}

.source-link {
  flex: 0 0 auto;
  color: var(--color-electric-blue);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.source-link:hover {
  color: var(--color-ash-black);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--spacing-16);
}

.picker-panel.is-manual-mode .picker-grid,
.picker-panel.is-manual-mode .inventory-actions {
  display: none;
}

.source-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-8);
  margin-bottom: var(--spacing-16);
}

.source-mode-card {
  display: grid;
  gap: 4px;
  min-height: 104px;
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-16);
  color: var(--color-midnight-graphite);
  background: #ffffff;
  text-align: left;
}

.source-mode-card:hover {
  border-color: var(--color-midnight-graphite);
}

.source-mode-card.is-active {
  border-color: var(--color-midnight-graphite);
  border-top-width: 4px;
  background: #eef6ff;
}

.source-mode-card:last-child.is-active {
  background: #fff4ef;
}

.source-mode-card strong,
.source-mode-card span {
  display: block;
}

.source-mode-card strong {
  font-size: 16px;
  line-height: 1.2;
}

.source-mode-card span:not(.source-mode-kicker) {
  color: var(--color-steel-gray);
  font-size: 13px;
  line-height: 1.35;
}

.source-mode-kicker {
  color: var(--color-smoke-gray);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: var(--spacing-8);
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

#carSearchInput {
  min-height: 44px;
}

.inventory-filter-toggle {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: var(--spacing-8);
  color: var(--color-midnight-graphite);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
}

.inventory-filter-toggle input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--color-electric-blue);
}

.field-hint {
  color: var(--color-smoke-gray);
  font-size: 12px;
  line-height: 1.35;
}

.inventory-search-results {
  display: grid;
  gap: var(--spacing-8);
}

.inventory-search-result {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--color-stone-gray);
  border-left: 4px solid var(--color-electric-blue);
  padding: var(--spacing-12);
  color: var(--color-midnight-graphite);
  background: #ffffff;
  text-align: left;
}

.inventory-search-result:hover,
.inventory-search-result.is-selected {
  border-color: var(--color-midnight-graphite);
  background: #eef6ff;
}

.inventory-search-result:disabled {
  border-left-color: var(--color-smoke-gray);
  color: var(--color-smoke-gray);
  background: #f5f5f5;
  cursor: not-allowed;
}

.inventory-search-result strong,
.inventory-search-result span,
.inventory-search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field .inventory-search-result strong {
  display: block;
  flex: initial;
  place-items: initial;
  width: auto;
  height: auto;
  min-width: 0;
  border-radius: 0;
  color: var(--color-midnight-graphite);
  background: transparent;
  font-size: 14px;
  line-height: 1.25;
}

.inventory-search-result span,
.inventory-search-result small {
  color: var(--color-steel-gray);
  font-size: 12px;
  line-height: 1.3;
}

.inventory-search-empty {
  margin: 0;
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-12);
  color: var(--color-smoke-gray);
  background: #ffffff;
  font-size: 13px;
  line-height: 1.35;
}

.manual-car-form {
  margin-top: var(--spacing-16);
  border: 1px solid var(--color-flame-orange);
  border-top-width: 4px;
  padding: var(--spacing-16);
  background: #fffaf7;
}

.manual-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-16);
  margin-bottom: var(--spacing-16);
}

.manual-form-heading h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-16);
}

.manual-wide {
  grid-column: 1 / -1;
}

.manual-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--spacing-16);
}

.field span {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  min-width: 0;
  color: var(--color-steel-gray);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.field strong {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-size: 12px;
  line-height: 1;
}

.field em,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  border: 1px solid var(--color-stone-gray);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  color: var(--color-steel-gray);
  background: var(--color-cloud-white);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

select,
input,
textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--spacing-56);
  border: 1px solid var(--color-midnight-graphite);
  border-radius: var(--radius-inputs);
  padding: 0 var(--spacing-16);
  color: var(--color-ash-black);
  background: var(--color-cloud-white);
  outline: none;
  text-overflow: ellipsis;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--color-electric-blue);
  box-shadow: inset 0 0 0 2px var(--color-electric-blue);
}

.album-section {
  border-left: 4px solid var(--color-marigold-yellow);
}

.app-shell.is-gallery-page .album-section {
  border-left-width: 1px;
  padding: var(--spacing-12);
}

.app-shell.is-gallery-page .section-heading {
  margin-bottom: var(--spacing-12);
  padding-bottom: var(--spacing-8);
}

.app-shell.is-gallery-page .section-heading p {
  font-size: 12px;
}

.album-list {
  display: grid;
  min-width: 0;
  gap: var(--spacing-8);
}

.album-list.is-folder-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-12);
}

.album-list.is-folder-open {
  gap: var(--spacing-8);
}

.app-shell.is-gallery-page .album-list {
  gap: 6px;
}

.app-shell.is-gallery-page .album-list.is-folder-grid {
  gap: var(--spacing-12);
}

.gallery-cleanup-actions {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  justify-content: flex-end;
}

.gallery-cleanup-button {
  min-height: 40px;
  white-space: normal;
}

.gallery-folder-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--spacing-12);
  min-height: 196px;
  border: 1px solid var(--color-stone-gray);
  border-top: 4px solid var(--color-midnight-graphite);
  padding: var(--spacing-12);
  color: var(--color-midnight-graphite);
  background: #ffffff;
  text-align: left;
}

.gallery-folder-card:hover {
  border-color: var(--color-midnight-graphite);
}

.gallery-folder-card.has-unread {
  border-color: var(--color-midnight-graphite);
  background: linear-gradient(180deg, #fff 0%, #fff7f8 100%);
  box-shadow: inset 4px 0 0 #e11937, 0 10px 24px rgba(17, 17, 17, 0.08);
}

.gallery-folder-cover {
  position: relative;
  display: grid;
  min-height: 96px;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--color-stone-gray);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-size: 20px;
  font-weight: var(--font-weight-bold);
}

.gallery-folder-cover::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 40%;
  height: 14px;
  border: 1px solid var(--color-stone-gray);
  border-bottom: 0;
  background: var(--color-marigold-yellow);
  content: "";
}

.gallery-folder-cover.has-logo {
  background: #ffffff;
  color: var(--color-midnight-graphite);
}

.gallery-folder-cover.has-logo::before {
  display: none;
}

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

.gallery-folder-cover.has-logo img.gallery-folder-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-folder-cover img + * {
  display: none;
}

.gallery-folder-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.gallery-folder-copy strong,
.gallery-folder-copy span,
.gallery-folder-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-folder-copy strong {
  font-size: 16px;
  line-height: 1.25;
}

.gallery-folder-copy span {
  color: var(--color-steel-gray);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
}

.gallery-folder-copy small {
  color: var(--color-smoke-gray);
  font-size: 12px;
  line-height: 1.3;
}

.gallery-folder-open {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-midnight-graphite);
  padding: 0 var(--spacing-12);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.gallery-unread-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid #ffffff;
  border-radius: 999px;
  padding: 0 6px;
  color: #ffffff;
  background: #e11937;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  box-shadow: 0 0 0 1px var(--color-midnight-graphite);
}

.gallery-folder-bar {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-12);
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-8);
  background: #ffffff;
}

.gallery-folder-crumb {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--color-steel-gray);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-folder-bar .gallery-cleanup-button {
  margin-left: auto;
}

.gallery-status-filters {
  display: flex;
  flex: 0 1 auto;
  min-width: min(100%, 300px);
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.gallery-status-filter-button {
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-stone-gray);
  padding: 0 10px;
  color: var(--color-midnight-graphite);
  background: #ffffff;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  white-space: nowrap;
}

.gallery-status-filter-button.is-available {
  border-color: var(--color-verdant-green);
}

.gallery-status-filter-button.is-sold {
  border-color: #c1121f;
  color: #9d1720;
}

.gallery-status-filter-button.is-all {
  border-color: var(--color-midnight-graphite);
}

.gallery-status-filter-button.is-active {
  color: #ffffff;
  background: var(--color-midnight-graphite);
}

.gallery-status-filter-button.is-active.is-available {
  border-color: var(--color-verdant-green);
  background: var(--color-verdant-green);
}

.gallery-status-filter-button.is-active.is-sold {
  border-color: #c1121f;
  background: #c1121f;
}

.album-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--color-stone-gray);
  background: var(--color-cloud-white);
}

.app-shell.is-gallery-page .album-card.is-unread {
  border-color: var(--color-midnight-graphite);
  background: linear-gradient(90deg, #fff5f7 0%, #ffffff 64%);
  box-shadow: inset 4px 0 0 #e11937, 0 8px 18px rgba(17, 17, 17, 0.06);
}

.app-shell.is-gallery-page .album-card.is-collapsed {
  border-color: #d8d8d8;
  background: rgba(255, 255, 255, 0.84);
}

.app-shell.is-gallery-page .album-card.is-collapsed.is-unread {
  border-color: var(--color-midnight-graphite);
  background: #fff7f8;
}

.album-unread-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 24px;
  border: 1px solid #ffffff;
  border-radius: 999px;
  padding: 0 9px;
  color: #ffffff;
  background: #e11937;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px var(--color-midnight-graphite);
}

.app-shell.is-gallery-page .album-card.is-unread .album-summary-button {
  padding-right: 92px;
}

.album-card.is-open {
  border-color: var(--color-midnight-graphite);
}

.album-card.is-selected {
  border-color: var(--color-electric-blue);
  border-left-width: 4px;
}

.app-shell.is-gallery-page .album-card.is-route-target {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 2px;
}

.album-card.is-source-removed {
  border-color: #b7bcc2;
  background: #f0f2f3;
}

.album-card.is-source-removed .album-cover,
.album-card.is-source-removed .album-summary-copy {
  filter: grayscale(1);
  opacity: 0.62;
}

.album-card.is-source-removed .album-status-line {
  color: var(--color-midnight-graphite);
  font-weight: var(--font-weight-semibold);
}

.album-summary-button {
  display: grid;
  width: 100%;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--spacing-16);
  border: 0;
  padding: var(--spacing-8);
  color: var(--color-midnight-graphite);
  background: transparent;
  text-align: left;
}

.album-summary-button:hover {
  background: #f6f6f6;
}

.app-shell.is-gallery-page .album-card.is-collapsed .album-summary-button {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--spacing-12);
  padding: 6px var(--spacing-8);
}

.album-card.is-selected .album-summary-button {
  background: #eef6ff;
}

.album-cover {
  display: grid;
  width: 72px;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--color-stone-gray);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
}

.app-shell.is-gallery-page .album-card.is-collapsed .album-cover {
  width: 56px;
}

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

.album-summary-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.album-summary-copy strong,
.album-summary-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-summary-copy strong {
  font-size: 15px;
  line-height: 1.25;
}

.app-shell.is-gallery-page .album-card.is-collapsed .album-summary-copy strong {
  font-size: 14px;
}

.app-shell.is-gallery-page .album-card.is-collapsed .album-summary-copy span {
  font-size: 12px;
}

.album-summary-copy .album-summary-description {
  display: -webkit-box;
  color: var(--color-steel-gray);
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.album-summary-copy .album-summary-meta {
  color: var(--color-smoke-gray);
}

.album-summary-copy span,
.album-status-line {
  color: var(--color-smoke-gray);
  font-size: 13px;
  line-height: 1.35;
}

.inventory-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--color-stone-gray);
  padding: 0 10px;
  color: var(--color-midnight-graphite);
  background: #ffffff;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.inventory-status-badge.is-active {
  border-color: var(--color-verdant-green);
  background: #eefaf2;
}

.inventory-status-badge.is-available {
  border-color: var(--color-verdant-green);
  color: #0f6f35;
  background: #eefaf2;
}

.inventory-status-badge.is-missing {
  border-color: #c1121f;
  color: #9d1720;
  background: #fff4ef;
}

.inventory-status-badge.is-source-removed {
  border-color: #c1121f;
  color: #9d1720;
  background: #fff4ef;
}

.inventory-status-badge.is-sold {
  border-color: #c1121f;
  color: #9d1720;
  background: #fff4ef;
}

.inventory-status-badge.is-manual {
  border-color: var(--color-electric-blue);
  background: #eef6ff;
}

.app-shell.is-gallery-page .album-card.is-collapsed .inventory-status-badge {
  grid-column: 2;
  justify-self: start;
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.album-detail {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--color-stone-gray);
  padding: var(--spacing-16);
}

.album-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-8);
}

.album-detail-actions .icon-text-button {
  min-height: 40px;
  padding: 0 12px;
  text-decoration: none;
}

.album-detail-actions .icon-text-button.danger {
  border-color: var(--color-flame-orange);
  color: var(--color-flame-orange);
}

.album-detail-actions .icon-text-button.danger:hover {
  color: var(--color-cloud-white);
  background: var(--color-flame-orange);
}

.album-status-line {
  color: var(--color-steel-gray);
}

.album-save-hint {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  margin: 0;
  color: var(--color-steel-gray);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
}

.album-save-hint::before {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border: 1px solid var(--color-midnight-graphite);
  background: var(--color-electric-blue);
  content: "";
}

.album-posting-kit {
  display: grid;
  gap: var(--spacing-10);
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-12);
  background: #ffffff;
}

.album-posting-kit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-8);
}

.album-posting-kit-heading > strong {
  color: var(--color-steel-gray);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.album-posting-kit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.album-copy-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-midnight-graphite);
  padding: 0 var(--spacing-8);
  color: var(--color-midnight-graphite);
  background: #ffffff;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.album-copy-button:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-midnight-graphite);
}

.album-copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.album-copy-button.subtle {
  min-height: 28px;
  border-color: var(--color-stone-gray);
  color: var(--color-steel-gray);
}

.album-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
}

.album-field-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-8);
  border: 1px solid #e2e2e2;
  padding: 7px;
  background: #fafafa;
}

.album-field-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.album-field-text small {
  color: var(--color-smoke-gray);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.album-field-text strong,
.album-field-text a {
  overflow: hidden;
  color: var(--color-midnight-graphite);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-field-text a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.album-description {
  display: grid;
  gap: 6px;
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-12);
  background: #ffffff;
}

.album-description strong {
  color: var(--color-steel-gray);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.album-description p {
  margin: 0;
  color: var(--color-midnight-graphite);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.album-description.is-muted p {
  color: var(--color-smoke-gray);
}

.album-media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: var(--spacing-8);
  min-height: 56px;
  align-items: stretch;
  color: var(--color-smoke-gray);
  font-size: 13px;
}

.album-media-item {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.album-media-thumb {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--color-stone-gray);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  text-decoration: none;
}

.album-media-thumb.is-image {
  background: #ffffff;
}

.album-media-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-touch-callout: default;
}

.album-media-save-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: 6px;
  display: block;
  min-height: 22px;
  padding: 6px 6px 5px;
  color: #ffffff;
  background: rgba(17, 17, 17, 0.84);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  overflow: hidden;
  pointer-events: none;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.album-media-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--color-smoke-gray);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-media-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
}

.album-media-action {
  display: inline-flex;
  min-width: 0;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-stone-gray);
  border-radius: var(--radius-buttons);
  padding: 0 4px;
  color: var(--color-midnight-graphite);
  background: var(--color-cloud-white);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.album-media-action:hover:not(:disabled) {
  border-color: var(--color-midnight-graphite);
}

.album-media-action.danger {
  color: var(--color-flame-orange);
  border-color: rgba(236, 91, 42, 0.45);
}

.album-media-action.danger:hover:not(:disabled) {
  border-color: var(--color-flame-orange);
}

.album-media-action:disabled {
  color: var(--color-smoke-gray);
  cursor: not-allowed;
  opacity: 0.55;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px 128px;
  gap: var(--spacing-16);
  padding: var(--spacing-16);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
}

.upload-primary,
.upload-secondary,
.icon-button,
.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-buttons);
  font-weight: var(--font-weight-bold);
}

.upload-primary {
  min-height: 88px;
  gap: var(--spacing-16);
  border: 1px solid var(--color-flame-orange);
  padding: var(--spacing-16);
  color: var(--color-cloud-white);
  background: var(--color-flame-orange);
  text-align: left;
}

.upload-primary:hover:not(:disabled),
.upload-primary.is-dragging {
  border-color: var(--color-cloud-white);
  color: var(--color-ash-black);
  background: var(--color-cloud-white);
}

.upload-primary svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.upload-primary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.upload-primary strong {
  font-size: 18px;
  line-height: 1.2;
}

.upload-primary small {
  overflow: hidden;
  color: currentColor;
  font-size: 13px;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: normal;
}

.upload-primary:disabled,
.upload-secondary:disabled {
  border-color: var(--color-smoke-gray);
  color: var(--color-smoke-gray);
  background: var(--color-midnight-graphite);
}

.upload-secondary {
  min-height: 88px;
  flex-direction: column;
  gap: var(--spacing-8);
  border: 1px solid var(--color-cloud-white);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-size: 13px;
}

.upload-secondary:hover:not(:disabled) {
  color: var(--color-midnight-graphite);
  background: var(--color-cloud-white);
}

.upload-footer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--spacing-16);
}

.upload-recovery {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-12);
  border: 1px solid rgba(255, 255, 255, 0.42);
  padding: var(--spacing-12);
  background: rgba(255, 255, 255, 0.08);
}

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

.upload-recovery > span {
  min-width: 0;
  color: var(--color-cloud-white);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
}

.upload-recovery > div {
  display: flex;
  flex: 0 0 auto;
  gap: var(--spacing-8);
}

.upload-recovery .icon-text-button {
  min-height: 40px;
  border-color: var(--color-cloud-white);
  padding: 0 var(--spacing-12);
  color: var(--color-midnight-graphite);
  background: var(--color-cloud-white);
}

.upload-recovery .icon-text-button.subtle {
  color: var(--color-cloud-white);
  background: transparent;
}

.progress-shell {
  --upload-progress: 0%;
  --upload-marker-size: 42px;
  position: relative;
  height: 10px;
  margin-top: 24px;
  overflow: visible;
  border: 1px solid var(--color-cloud-white);
  border-radius: 0;
  background: var(--color-midnight-graphite);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-flame-orange);
  transition: width 160ms ease;
}

.upload-progress-marker {
  position: absolute;
  top: 50%;
  left: clamp(
    calc(var(--upload-marker-size) / 2),
    var(--upload-progress),
    calc(100% - (var(--upload-marker-size) / 2))
  );
  z-index: 1;
  display: grid;
  width: var(--upload-marker-size);
  height: var(--upload-marker-size);
  place-items: center;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 5px 8px rgba(16, 23, 31, 0.2));
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -98%);
  transition: left 160ms ease, opacity 120ms ease;
}

.upload-progress-marker .upload-monkey {
  display: block;
  width: var(--upload-marker-size);
  height: var(--upload-marker-size);
  object-fit: contain;
  transform-origin: 50% 70%;
  user-select: none;
}

.progress-shell.is-uploading .upload-progress-marker {
  opacity: 1;
  animation: uploadMarkerPulse 520ms ease-in-out infinite;
}

.progress-shell.is-uploading .upload-monkey {
  animation: uploadMascotDance 520ms ease-in-out infinite;
}

.progress-shell.is-celebrating .upload-progress-marker {
  opacity: 1;
}

.progress-confetti {
  position: absolute;
  inset: -42px 0 -18px;
  overflow: visible;
  pointer-events: none;
}

.progress-confetti span {
  --confetti-x: 0px;
  --confetti-y: 0px;
  --confetti-rotate: 0deg;
  position: absolute;
  top: 50%;
  left: clamp(
    calc(var(--upload-marker-size) / 2),
    calc(100% - 64px),
    calc(100% - (var(--upload-marker-size) / 2))
  );
  width: 6px;
  height: 10px;
  background: var(--color-marigold-yellow);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}

.progress-confetti span:nth-child(1) {
  --confetti-x: -76px;
  --confetti-y: -34px;
  --confetti-rotate: -190deg;
  background: var(--color-flame-orange);
}

.progress-confetti span:nth-child(2) {
  --confetti-x: -48px;
  --confetti-y: -54px;
  --confetti-rotate: 160deg;
  background: var(--color-electric-blue);
}

.progress-confetti span:nth-child(3) {
  --confetti-x: -18px;
  --confetti-y: -44px;
  --confetti-rotate: 220deg;
  background: var(--color-verdant-green);
}

.progress-confetti span:nth-child(4) {
  --confetti-x: 18px;
  --confetti-y: -38px;
  --confetti-rotate: -140deg;
  background: var(--color-marigold-yellow);
}

.progress-confetti span:nth-child(5) {
  --confetti-x: 42px;
  --confetti-y: -18px;
  --confetti-rotate: 260deg;
  background: var(--color-cloud-white);
}

.progress-confetti span:nth-child(6) {
  --confetti-x: -62px;
  --confetti-y: 20px;
  --confetti-rotate: 120deg;
  background: var(--color-marigold-yellow);
}

.progress-confetti span:nth-child(7) {
  --confetti-x: -30px;
  --confetti-y: 34px;
  --confetti-rotate: -240deg;
  background: var(--color-verdant-green);
}

.progress-confetti span:nth-child(8) {
  --confetti-x: 8px;
  --confetti-y: 28px;
  --confetti-rotate: 180deg;
  background: var(--color-flame-orange);
}

.progress-confetti span:nth-child(9) {
  --confetti-x: 36px;
  --confetti-y: 18px;
  --confetti-rotate: -180deg;
  background: var(--color-electric-blue);
}

.progress-confetti span:nth-child(10) {
  --confetti-x: -88px;
  --confetti-y: -4px;
  --confetti-rotate: 280deg;
  background: var(--color-cloud-white);
}

.progress-confetti span:nth-child(11) {
  --confetti-x: -8px;
  --confetti-y: -66px;
  --confetti-rotate: -300deg;
  background: var(--color-flame-orange);
}

.progress-confetti span:nth-child(12) {
  --confetti-x: 54px;
  --confetti-y: -2px;
  --confetti-rotate: 240deg;
  background: var(--color-verdant-green);
}

.progress-shell.is-celebrating .progress-confetti span {
  animation: confettiPop 900ms ease-out both;
}

.progress-shell.is-celebrating .progress-confetti span:nth-child(2n) {
  animation-delay: 35ms;
}

.progress-shell.is-celebrating .progress-confetti span:nth-child(3n) {
  animation-delay: 70ms;
}

@keyframes uploadMarkerPulse {
  0%,
  100% {
    transform: translate(-50%, -98%) rotate(-8deg);
  }

  50% {
    transform: translate(-50%, -112%) rotate(8deg);
  }
}

@keyframes uploadMascotDance {
  0%,
  100% {
    transform: translateY(1px) rotate(-6deg) scale(0.98);
  }

  50% {
    transform: translateY(-3px) rotate(6deg) scale(1.04);
  }
}

@keyframes confettiPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25) rotate(0deg);
  }

  14% {
    opacity: 1;
  }

  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(
      calc(-50% + var(--confetti-x)),
      calc(-50% + var(--confetti-y))
    ) scale(1) rotate(var(--confetti-rotate));
  }
}

.upload-state {
  color: var(--color-cloud-white);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-midnight-graphite);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  text-decoration: none;
}

.icon-button.subtle,
.icon-text-button.subtle {
  border-color: var(--color-midnight-graphite);
  color: var(--color-midnight-graphite);
  background: var(--color-cloud-white);
}

.icon-button.subtle:hover,
.icon-text-button.subtle:hover {
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
}

.icon-text-button.danger {
  border-color: var(--color-flame-orange);
  color: var(--color-flame-orange);
}

.icon-text-button.danger:hover:not(:disabled) {
  color: var(--color-cloud-white);
  background: var(--color-flame-orange);
}

.icon-text-button {
  min-height: 48px;
  gap: var(--spacing-8);
  border: 1px solid var(--color-midnight-graphite);
  padding: 0 var(--spacing-16);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
}

.icon-button.danger {
  border-color: var(--color-midnight-graphite);
  color: var(--color-midnight-graphite);
  background: var(--color-cloud-white);
}

.icon-button.danger:hover {
  border-color: var(--color-flame-orange);
  color: var(--color-cloud-white);
  background: var(--color-flame-orange);
}

.icon-button:disabled,
.icon-button.is-disabled,
.icon-text-button:disabled,
.icon-text-button.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.chat-toggle {
  position: relative;
}

.gallery-page-link {
  position: relative;
}

.notification-toggle {
  position: relative;
}

/* Push-enabled indicator; keep it opposite the unread count badge. */
.notification-toggle.is-on::after {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  width: 9px;
  height: 9px;
  border: 1px solid var(--color-cloud-white);
  background: var(--color-verdant-green);
  content: "";
  pointer-events: none;
}

/* Header unread badges. These stay on the expected right edge. */
.notification-unread,
.chat-unread,
.gallery-nav-unread {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 18px;
  max-width: 28px;
  height: 18px;
  border: 1px solid var(--color-midnight-graphite);
  padding: 0 4px;
  color: var(--color-cloud-white);
  background: var(--color-flame-orange);
  font-size: 10px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-16);
  border: 1px solid var(--color-midnight-graphite);
  border-left-width: 4px;
  margin-bottom: var(--spacing-16);
  padding: var(--spacing-12) var(--spacing-16);
  color: var(--color-midnight-graphite);
  background: #eef6ff;
}

.notification-prompt > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-prompt strong,
.notification-prompt span {
  display: block;
}

.notification-prompt span {
  color: var(--color-steel-gray);
  font-size: 13px;
}

.notification-prompt-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--spacing-8);
}

.notification-prompt-actions .icon-button {
  width: 48px;
  height: 48px;
}

.notification-panel {
  position: fixed;
  top: max(var(--spacing-24), env(safe-area-inset-top));
  right: max(var(--spacing-24), env(safe-area-inset-right));
  z-index: 70;
  display: none;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(430px, calc(100vw - 32px));
  max-height: min(620px, calc(100svh - 48px));
  border: 1px solid var(--color-midnight-graphite);
  color: var(--color-ash-black);
  background: var(--color-cloud-white);
  box-shadow: 8px 8px 0 rgba(17, 17, 17, 0.16);
}

.notification-panel.is-open {
  display: grid;
}

.notification-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-16);
  border-bottom: 1px solid var(--color-midnight-graphite);
  padding: var(--spacing-16);
}

.notification-panel-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notification-panel-header p,
.notification-panel-opt-in p {
  margin: 0;
  color: var(--color-steel-gray);
  font-size: 13px;
}

.notification-panel-header .icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.notification-panel-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--spacing-8);
}

.notification-panel-opt-in {
  display: grid;
  gap: var(--spacing-8);
  border-bottom: 1px solid var(--color-stone-gray);
  padding: var(--spacing-12) var(--spacing-16);
  background: #fff4ef;
}

.notification-panel-opt-in .icon-text-button {
  justify-self: start;
}

.notification-list {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--color-stone-gray);
  padding: var(--spacing-12) var(--spacing-16);
  color: var(--color-midnight-graphite);
  background: var(--color-cloud-white);
  text-decoration: none;
}

.notification-item:hover {
  background: #eef6ff;
}

.notification-item.is-unread {
  border-left: 4px solid var(--color-flame-orange);
  padding-left: 12px;
}

.notification-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-12);
  min-width: 0;
}

.notification-item-header strong,
.notification-item-body,
.notification-item-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notification-item-header time,
.notification-item-meta {
  color: var(--color-smoke-gray);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.notification-item-header time {
  flex: 0 0 auto;
}

.notification-item-body {
  color: var(--color-steel-gray);
  font-size: 14px;
  line-height: 1.35;
}

.notification-empty {
  padding: var(--spacing-24);
  color: var(--color-smoke-gray);
  text-align: center;
}

.chat-panel {
  position: fixed;
  right: max(var(--spacing-24), env(safe-area-inset-right));
  bottom: max(var(--spacing-24), env(safe-area-inset-bottom));
  z-index: 50;
  display: none;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(380px, calc(100vw - 32px));
  height: min(500px, calc(100svh - 96px));
  min-height: min(360px, calc(100svh - 96px));
  border: 1px solid var(--color-midnight-graphite);
  color: var(--color-ash-black);
  background: var(--color-cloud-white);
  box-shadow: 8px 8px 0 rgba(17, 17, 17, 0.16);
  overflow: hidden;
}

.chat-panel.is-open {
  display: grid;
}

.chat-header {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-16);
  border-bottom: 1px solid var(--color-midnight-graphite);
  padding: 10px var(--spacing-16);
}

.chat-title-block {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.chat-title-block p {
  color: var(--color-smoke-gray);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  text-transform: uppercase;
}

.chat-header .icon-button {
  width: 40px;
  height: 40px;
}

.chat-back-button {
  min-height: 40px;
  gap: var(--spacing-8);
  padding: 0 12px;
}

.chat-back-button span {
  display: none;
}

.chat-screen-body {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  min-height: 0;
}

.chat-context {
  display: none;
}

.chat-thread {
  position: relative;
  display: grid;
  min-height: 0;
  background: #f7fbff;
}

.chat-messages {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: var(--spacing-16);
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.chat-empty {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  max-width: calc(100% - 32px);
  text-align: center;
  color: var(--color-smoke-gray);
  font-size: 14px;
}

html.is-chat-route .chat-panel {
  position: relative;
  inset: auto;
  z-index: 1;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(var(--page-max-width), calc(100% - 48px));
  height: clamp(520px, calc(var(--app-viewport-height, 100svh) - 48px), 900px);
  max-height: none;
  min-height: 0;
  margin: var(--spacing-24) auto;
  border-top-width: 4px;
  box-shadow: none;
}

html.is-chat-route .chat-header {
  min-height: 72px;
  padding: var(--spacing-16) var(--spacing-24);
}

html.is-chat-route .chat-back-button span {
  display: inline;
}

html.is-chat-route .chat-screen-body {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

html.is-chat-route .chat-context {
  display: grid;
  align-content: start;
  gap: var(--spacing-12);
  min-height: 0;
  border-right: 1px solid var(--color-midnight-graphite);
  padding: var(--spacing-16);
  background: var(--color-cloud-white);
}

.chat-context-block,
.chat-context-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-12);
  background: #ffffff;
}

.chat-context-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-12);
}

.chat-context span {
  color: var(--color-smoke-gray);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  text-transform: uppercase;
}

.chat-context strong {
  min-width: 0;
  color: var(--color-midnight-graphite);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

html.is-chat-route .chat-thread {
  background:
    linear-gradient(var(--color-stone-gray) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-stone-gray) 1px, transparent 1px),
    #f7fbff;
  background-size: 48px 48px;
  background-position: -1px -1px;
}

html.is-chat-route .chat-thread::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(247, 251, 255, 0.9);
  pointer-events: none;
}

html.is-chat-route .chat-messages,
html.is-chat-route .chat-empty {
  position: relative;
  z-index: 1;
}

html.is-chat-route .chat-messages {
  gap: var(--spacing-16);
  padding: var(--spacing-24);
}

html.is-chat-route .chat-message {
  max-width: min(68%, 640px);
}

html.is-chat-route .chat-message p {
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.42;
}

html.is-chat-route .chat-form {
  padding: var(--spacing-16) var(--spacing-24);
  background: var(--color-cloud-white);
}

html.is-chat-route .chat-composer-row {
  grid-template-columns: auto minmax(0, 1fr) 52px;
  grid-template-areas: "tools input send";
  align-items: center;
  gap: var(--spacing-12);
}

html.is-chat-route .chat-tools {
  flex-wrap: nowrap;
}

html.is-chat-route .chat-form textarea {
  min-height: 52px;
  max-height: 132px;
  font-size: 15px;
}

html.is-chat-route .chat-form .icon-button {
  width: 52px;
  height: 52px;
}

.chat-message {
  --chat-user-color: var(--color-electric-blue);
  display: grid;
  justify-self: start;
  gap: 4px;
  max-width: min(84%, 420px);
}

.chat-message.is-own {
  justify-self: end;
}

.chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-16);
  color: var(--color-steel-gray);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.chat-message.is-own .chat-message-meta {
  flex-direction: row-reverse;
}

.chat-message-meta time {
  flex: 0 0 auto;
  color: var(--color-smoke-gray);
}

.chat-message-meta strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--chat-user-color);
}

.chat-message-meta strong::before {
  width: 9px;
  height: 9px;
  border: 1px solid var(--color-midnight-graphite);
  background: var(--chat-user-color);
  content: "";
}

.chat-message.is-own .chat-message-meta strong {
  flex-direction: row-reverse;
}

.chat-message p {
  overflow-wrap: anywhere;
  border: 1px solid var(--color-stone-gray);
  border-left: 6px solid var(--chat-user-color);
  padding: 10px 12px;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.chat-message.is-own p {
  border-right: 6px solid var(--chat-user-color);
  border-left-width: 1px;
  background: #f7fbff;
}

.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}

.chat-message.is-own .chat-reactions {
  justify-content: flex-end;
}

.chat-reaction-button {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  height: 30px;
  border: 1px solid var(--color-stone-gray);
  border-radius: 0;
  padding: 0 6px;
  color: var(--color-steel-gray);
  background: #ffffff;
}

.chat-reaction-button:hover:not(:disabled),
.chat-reaction-button:focus-visible {
  border-color: var(--color-midnight-graphite);
  color: var(--color-ash-black);
}

.chat-reaction-button.is-selected {
  border-color: var(--color-electric-blue);
  color: var(--color-electric-blue);
  background: #eef6ff;
}

.chat-reaction-button:disabled {
  opacity: 0.58;
}

.chat-reaction-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.chat-reaction-count {
  min-width: 8px;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.chat-reaction-count:empty {
  display: none;
}

.chat-form {
  grid-row: 3;
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--spacing-8);
  border-top: 1px solid var(--color-midnight-graphite);
  padding: var(--spacing-16);
}

.chat-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  grid-template-areas:
    "tools tools"
    "input send";
  align-items: end;
  gap: var(--spacing-8);
  min-width: 0;
}

.chat-tools {
  grid-area: tools;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chat-form textarea,
.chat-gif-panel input {
  min-height: 48px;
  min-width: 0;
  max-height: 112px;
  padding: 12px;
  resize: none;
}

.chat-form textarea {
  grid-area: input;
}

.chat-form .icon-button {
  width: 48px;
  height: 48px;
}

#chatSend {
  grid-area: send;
}

.chat-tools .chat-tool-button {
  width: auto;
  min-width: 68px;
  height: 40px;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.chat-tools .chat-tool-button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.chat-tool-button span {
  color: currentColor;
  letter-spacing: 0;
  white-space: nowrap;
}

.chat-audio-button {
  border-color: var(--color-electric-blue);
  color: var(--color-cloud-white);
  background: var(--color-electric-blue);
}

.chat-gif-button span {
  color: currentColor;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0;
}

.chat-gif-button.is-active {
  background: #f7fbff;
}

.chat-draft-preview {
  display: flex;
  gap: var(--spacing-8);
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chat-draft-preview[hidden],
.chat-gif-panel[hidden] {
  display: none;
}

.chat-draft-item {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--color-midnight-graphite);
  background: #ffffff;
}

.chat-draft-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-draft-label {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--color-steel-gray);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
}

.chat-draft-item.is-audio .chat-draft-label {
  color: var(--color-ash-black);
  background: #f7fbff;
}

.chat-draft-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  min-height: 0;
  border: 1px solid var(--color-midnight-graphite);
  padding: 0;
  color: var(--color-ash-black);
  background: rgba(255, 255, 255, 0.92);
}

.chat-draft-remove svg {
  width: 14px;
  height: 14px;
}

.chat-gif-panel {
  display: grid;
  gap: var(--spacing-8);
  min-width: 0;
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-8);
  background: #f7fbff;
}

.chat-gif-panel input {
  min-height: 40px;
  max-height: none;
  padding: 9px 10px;
}

.chat-gif-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 156px;
  min-height: 0;
  overflow-y: auto;
}

.chat-gif-status {
  grid-column: 1 / -1;
  padding: var(--spacing-8);
  color: var(--color-smoke-gray);
  font-size: 13px;
  text-align: center;
}

.chat-gif-result {
  display: block;
  aspect-ratio: 1.25 / 1;
  overflow: hidden;
  border: 1px solid var(--color-midnight-graphite);
  padding: 0;
  background: #ffffff;
  cursor: pointer;
}

.chat-gif-result img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-gif-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: var(--spacing-8);
}

.chat-gif-url-row .icon-button {
  width: 40px;
  height: 40px;
}

.chat-message.has-attachments {
  max-width: min(88%, 420px);
}

.chat-attachments {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.chat-attachment {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--color-midnight-graphite);
  background: #ffffff;
}

.chat-attachment img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.chat-attachment.is-audio {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  overflow: visible;
}

.chat-attachment.is-audio audio {
  display: block;
  width: 100%;
  max-width: 100%;
}

.chat-attachment-title {
  color: var(--color-ash-black);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.chat-attachment-title:hover,
.chat-attachment-title:focus-visible {
  text-decoration: underline;
}

.chat-attachment-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border: 1px solid var(--color-midnight-graphite);
  padding: 2px 5px;
  color: var(--color-ash-black);
  background: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
}

.status-bar {
  margin-bottom: var(--spacing-16);
  border: 1px solid var(--color-verdant-green);
  border-radius: 0;
  padding: var(--spacing-8) var(--spacing-16);
  color: var(--color-ash-black);
  background: var(--color-cloud-white);
}

.status-bar.is-error,
.form-error {
  border-color: var(--color-flame-orange);
  color: var(--color-ash-black);
  background: #fff4ef;
}

.form-success {
  border: 1px solid var(--color-verdant-green);
  padding: var(--spacing-8) var(--spacing-16);
  color: var(--color-ash-black);
  background: #eefaf2;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 144px;
  border: 1px dashed var(--color-stone-gray);
  border-radius: 0;
  color: var(--color-smoke-gray);
  background: var(--color-cloud-white);
  text-align: center;
}

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

.login-body {
  display: grid;
  place-items: center;
  padding: var(--spacing-24);
}

.login-card {
  width: min(440px, 100%);
  padding: var(--spacing-24);
}

.login-card.is-wide {
  width: min(720px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-16);
}

.auth-brand .brand-mark {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

.auth-brand > div {
  min-width: 0;
}

.auth-brand .eyebrow {
  margin-bottom: 2px;
}

.offline-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--spacing-24);
}

.offline-panel {
  display: grid;
  width: min(460px, 100%);
  gap: var(--spacing-16);
  border: 1px solid var(--color-midnight-graphite);
  padding: var(--spacing-24);
  background: var(--color-cloud-white);
}

.offline-panel .brand-mark {
  width: 56px;
  height: 56px;
}

.offline-panel p:not(.eyebrow) {
  color: var(--color-steel-gray);
}

.offline-panel .icon-text-button {
  justify-self: start;
  text-decoration: none;
}

.login-form {
  display: grid;
  gap: var(--spacing-16);
  margin-top: var(--spacing-24);
}

.login-form label {
  display: grid;
  gap: var(--spacing-8);
}

.login-form label span {
  color: var(--color-steel-gray);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.login-form button {
  min-height: 48px;
  border: 1px solid var(--color-midnight-graphite);
  border-radius: 0;
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-weight: var(--font-weight-bold);
}

.login-form button:hover {
  border-color: var(--color-flame-orange);
  background: var(--color-flame-orange);
}

.login-form input:disabled,
.login-form button:disabled {
  border-color: var(--color-stone-gray);
  color: var(--color-smoke-gray);
  background: #f2f2f2;
}

.login-form button:disabled {
  opacity: 0.62;
}

.auth-note,
.auth-actions {
  margin-top: var(--spacing-16);
  color: var(--color-smoke-gray);
  font-size: 14px;
}

.auth-actions a {
  color: var(--color-electric-blue);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.auth-actions a:hover {
  color: var(--color-ash-black);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.admin-user-list {
  display: grid;
  gap: var(--spacing-8);
  margin-top: var(--spacing-16);
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--spacing-16);
  border: 1px solid var(--color-stone-gray);
  padding: var(--spacing-16);
  background: var(--color-cloud-white);
}

.admin-dealership-form,
.admin-password-form {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--spacing-8);
  border-top: 1px solid var(--color-stone-gray);
  padding-top: var(--spacing-16);
}

.admin-dealership-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-password-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.admin-dealership-form label,
.admin-password-form label {
  display: grid;
  gap: 4px;
}

.admin-dealership-form span,
.admin-password-form span {
  color: var(--color-steel-gray);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.admin-user-card.is-bootstrap {
  margin-top: var(--spacing-16);
  border-color: var(--color-midnight-graphite);
}

.admin-user-card strong,
.admin-user-card span,
.admin-user-card small {
  display: block;
}

.admin-user-card span,
.admin-user-card small,
.admin-user-card em {
  color: var(--color-smoke-gray);
  font-size: 13px;
  font-style: normal;
}

.admin-user-actions {
  display: flex;
  gap: var(--spacing-8);
}

.admin-user-actions button,
.admin-dealership-form button,
.admin-password-form button,
.admin-user-card > form button {
  min-height: 40px;
  border: 1px solid var(--color-midnight-graphite);
  padding: 0 var(--spacing-16);
  color: var(--color-cloud-white);
  background: var(--color-midnight-graphite);
  font-weight: var(--font-weight-bold);
}

.admin-user-actions button.danger {
  border-color: var(--color-flame-orange);
  background: var(--color-flame-orange);
}

.admin-invite-link {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--spacing-8);
  border-top: 1px solid var(--color-stone-gray);
  padding-top: var(--spacing-16);
}

.admin-invite-link label {
  display: grid;
  gap: var(--spacing-8);
}

.admin-invite-link label > span {
  color: var(--color-steel-gray);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.admin-invite-link input {
  font-family: var(--font-ui-monospace);
}

.admin-invite-link button {
  justify-self: start;
}

.admin-invite-copy-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--color-steel-gray);
  font-size: 13px;
}

.admin-invite-copy-status[data-copy-status="success"] {
  color: var(--color-verdant-green);
}

.admin-invite-copy-status[data-copy-status="error"] {
  color: var(--color-flame-orange);
}

.admin-user-actions button:disabled {
  border-color: var(--color-stone-gray);
  color: var(--color-smoke-gray);
  background: #eeeeee;
}

.form-error {
  border: 1px solid;
  border-radius: 0;
  padding: var(--spacing-8) var(--spacing-16);
}

@media (min-width: 920px) {
  .picker-grid {
    grid-template-columns:
      minmax(160px, 0.65fr)
      minmax(260px, 1fr)
      minmax(220px, 0.85fr)
      minmax(220px, 0.85fr);
  }

  .field-wide {
    grid-column: 1 / -1;
  }

}

@media (max-width: 680px) {
  body {
    background-size: 40px 40px;
  }

  .app-shell {
    padding: var(--spacing-16);
  }

  .app-header {
    gap: 0;
    margin-bottom: var(--spacing-16);
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 144px;
    gap: 0;
  }

  .header-actions .icon-button {
    width: 48px;
    height: 48px;
  }

  .app-shell.is-gallery-page {
    padding: 10px;
  }

  .app-shell.is-gallery-page .app-header {
    margin-bottom: 10px;
  }

  .app-shell.is-gallery-page .header-actions {
    max-width: 168px;
  }

  .app-shell.is-gallery-page .header-actions .icon-button {
    width: 42px;
    height: 42px;
  }

  .app-shell.is-gallery-page .brand-mark {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  .app-shell.is-gallery-page .brand-block > div {
    padding: var(--spacing-8) 10px;
  }

  .app-shell.is-gallery-page .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .app-shell.is-gallery-page h1 {
    font-size: 20px;
  }

  .app-shell.is-gallery-page .album-section {
    margin-top: 0;
    padding: var(--spacing-8);
  }

  .app-shell.is-gallery-page .section-heading {
    align-items: center;
    gap: var(--spacing-8);
    margin-bottom: var(--spacing-8);
    padding-bottom: var(--spacing-8);
  }

  .app-shell.is-gallery-page .section-heading h2 {
    font-size: 16px;
  }

  .app-shell.is-gallery-page .section-heading p {
    margin-top: 2px;
    font-size: 11px;
  }

  .app-shell.is-gallery-page .section-heading .icon-button {
    width: 42px;
    height: 42px;
  }

  .app-shell.is-gallery-page .album-list.is-folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-8);
  }

  .app-shell.is-gallery-page .gallery-folder-card {
    min-height: 0;
    gap: 6px;
    border-top-width: 3px;
    padding: var(--spacing-8);
  }

  .app-shell.is-gallery-page .gallery-folder-cover {
    min-height: 58px;
    aspect-ratio: 16 / 10;
  }

  .app-shell.is-gallery-page .gallery-folder-cover.has-logo img.gallery-folder-logo {
    box-sizing: border-box;
    object-fit: contain;
    padding: 6px;
  }

  .app-shell.is-gallery-page .gallery-folder-copy {
    gap: 1px;
  }

  .app-shell.is-gallery-page .gallery-folder-copy strong {
    font-size: 12px;
    line-height: 1.2;
  }

  .app-shell.is-gallery-page .gallery-folder-copy span,
  .app-shell.is-gallery-page .gallery-folder-copy small {
    font-size: 10px;
    line-height: 1.15;
  }

  .app-shell.is-gallery-page .gallery-folder-open {
    min-height: 28px;
    padding: 0 var(--spacing-8);
    font-size: 10px;
  }

  .app-shell.is-gallery-page .gallery-status-filters {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }

  .app-shell.is-gallery-page .gallery-status-filter-button {
    flex: 1 1 0;
    min-height: 34px;
    padding: 0 6px;
    font-size: 10px;
  }

  .app-shell.is-gallery-page .album-card.is-unread .album-summary-button {
    padding-right: 78px;
  }

  .album-unread-badge {
    min-height: 21px;
    padding: 0 7px;
    font-size: 9px;
  }

  .brand-mark {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .brand-block > div {
    padding: var(--spacing-8) var(--spacing-16);
  }

  h1 {
    font-size: 22px;
  }

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

  .source-mode-switch {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: var(--spacing-16);
  }

  .album-summary-button {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: var(--spacing-8);
  }

  .app-shell.is-gallery-page .album-card.is-collapsed .album-summary-button {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .album-cover {
    width: 64px;
  }

  .app-shell.is-gallery-page .album-card.is-collapsed .album-cover {
    width: 52px;
  }

  .inventory-status-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .album-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .album-detail-actions .icon-text-button {
    width: 100%;
  }

  .album-posting-kit-heading,
  .album-posting-kit-actions {
    grid-column: 1 / -1;
  }

  .album-posting-kit-heading {
    display: grid;
  }

  .album-posting-kit-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .album-field-grid {
    grid-template-columns: 1fr;
  }

  .album-media-strip {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }

  .source-link {
    max-width: 168px;
    text-align: right;
  }

  .upload-panel {
    grid-template-columns: minmax(0, 1fr) 76px 76px;
    gap: var(--spacing-8);
    padding: var(--spacing-8);
  }

  .upload-primary,
  .upload-secondary {
    min-height: 76px;
  }

  .upload-primary {
    gap: var(--spacing-8);
    padding: var(--spacing-8);
  }

  .upload-primary strong {
    font-size: 16px;
  }

  .upload-primary small {
    font-size: 12px;
  }

  .upload-recovery {
    display: grid;
  }

  .upload-recovery > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .admin-user-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-user-card > form button {
    width: 100%;
  }

  .admin-password-form {
    grid-template-columns: 1fr;
  }

  .admin-dealership-form {
    grid-template-columns: 1fr;
  }

  .notification-prompt {
    display: grid;
  }

  .notification-prompt-actions {
    display: grid;
    grid-template-columns: 1fr 48px;
  }

  .notification-panel {
    inset: 0;
    z-index: 100;
    width: 100vw;
    max-height: none;
    height: 100svh;
    border: 0;
    box-shadow: none;
  }

  .notification-panel-header {
    min-height: 64px;
    padding: max(12px, env(safe-area-inset-top)) var(--spacing-16) 12px;
  }

  .notification-list {
    padding-top: var(--spacing-8);
  }

  body.notification-panel-active {
    overflow: hidden;
  }

  .chat-panel {
    inset: 0;
    z-index: 100;
    width: 100vw;
    height: var(--app-viewport-height, 100svh);
    min-height: var(--app-viewport-height, 100svh);
    max-height: var(--app-viewport-height, 100svh);
    border: 0;
    box-shadow: none;
  }

  html.is-chat-route,
  body.chat-screen-active {
    height: var(--app-viewport-height, 100svh);
    min-height: var(--app-viewport-height, 100svh);
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.chat-screen-active {
    position: fixed;
    inset: 0;
    width: 100%;
  }

  html.is-chat-route .app-shell {
    padding: var(--spacing-8);
  }

  html.is-chat-route .app-header {
    margin-bottom: var(--spacing-8);
  }

  html.is-chat-route .brand-mark {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  html.is-chat-route .brand-block > div {
    padding: var(--spacing-8) 10px;
  }

  html.is-chat-route .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  html.is-chat-route h1 {
    font-size: 20px;
  }

  html.is-chat-route .header-actions {
    max-width: 168px;
  }

  html.is-chat-route .header-actions .icon-button {
    width: 42px;
    height: 42px;
  }

  html.is-chat-route .chat-panel {
    position: relative;
    inset: auto;
    z-index: 1;
    width: calc(100vw - 16px);
    height: calc(var(--app-viewport-height, 100svh) - 16px);
    min-height: 0;
    max-height: none;
    margin: var(--spacing-8);
    border: 1px solid var(--color-midnight-graphite);
    border-top-width: 4px;
  }

  html.is-chat-route .chat-screen-body {
    grid-template-columns: minmax(0, 1fr);
  }

  html.is-chat-route .chat-context {
    display: none;
  }

  body.chat-view-active {
    overflow: hidden;
  }

  .chat-header {
    min-height: 64px;
    padding: max(12px, env(safe-area-inset-top)) var(--spacing-16) 12px;
  }

  .chat-back-button span {
    display: inline;
  }

  .chat-messages {
    gap: 10px;
    padding: 12px;
    scroll-padding-block: 12px;
  }

  .chat-message {
    max-width: min(92%, 420px);
  }

  .chat-message-meta {
    gap: var(--spacing-8);
  }

  .chat-message p {
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.32;
  }

  .chat-reactions {
    gap: 3px;
  }

  .chat-reaction-button {
    min-width: 36px;
    height: 32px;
    padding: 0 7px;
  }

  .chat-form {
    gap: 6px;
    background: var(--color-cloud-white);
    box-shadow: 0 -6px 0 rgba(250, 250, 250, 0.92);
    padding: var(--spacing-8) var(--spacing-8) max(var(--spacing-8), env(safe-area-inset-bottom));
  }

  .chat-composer-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 6px;
  }

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

  .chat-tools .chat-tool-button {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 6px;
  }

  .chat-tools .chat-tool-button svg {
    width: 16px;
    height: 16px;
  }

  .chat-form textarea {
    min-height: 56px;
    max-height: 96px;
    padding: 10px;
    font-size: 16px;
  }

  .chat-form .icon-button {
    width: 44px;
    height: 44px;
  }

  html.is-chat-route .chat-header {
    min-height: 56px;
    padding: 10px var(--spacing-12);
  }

  html.is-chat-route .chat-title-block p {
    font-size: 10px;
  }

  html.is-chat-route .chat-messages {
    padding: var(--spacing-12);
  }

  html.is-chat-route .chat-message {
    max-width: min(92%, 440px);
  }

  html.is-chat-route .chat-message p {
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.32;
  }

  html.is-chat-route .chat-form {
    padding: var(--spacing-8) var(--spacing-8) max(var(--spacing-8), env(safe-area-inset-bottom));
  }

  html.is-chat-route .chat-composer-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-areas:
      "tools tools"
      "input send";
    gap: 6px;
  }

  html.is-chat-route .chat-tools {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
  }

  html.is-chat-route .chat-tools .chat-tool-button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
  }

  html.is-chat-route .chat-tools .chat-tool-button svg {
    width: 18px;
    height: 18px;
  }

  html.is-chat-route .chat-form .icon-button {
    width: 44px;
    height: 44px;
  }

  html.is-chat-route #chatPhotoButton span,
  html.is-chat-route #chatAudioButton span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  html.is-chat-route #chatGifButton span {
    font-size: 12px;
    line-height: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-shell.is-uploading .upload-progress-marker {
    animation: none;
  }

  .progress-shell.is-uploading .upload-monkey {
    animation: none;
  }

  .progress-shell.is-celebrating .progress-confetti span {
    animation: none;
  }

  .is-haptic-pressing {
    transform: none;
    filter: none;
    box-shadow: none;
    transition: none;
  }
}
