/* Link styles
   Default <a> inherits color from its parent so component-specific styling
   (e.g. journey CTAs, brand-colored links) is preserved. Only inline links
   inside body copy or with `.text-link` opt-in get the primary color and
   underline treatment. */
a:not(.btn) {
  text-decoration: none;
  transition: text-decoration-color 0.15s ease-in-out;
}

p a:not(.btn),
a:not(.btn).text-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-primary-disabled);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

p a:not(.btn):hover,
a:not(.btn).text-link:hover {
  text-decoration-color: var(--color-primary);
}

html[data-theme="dark"] p a:not(.btn),
html[data-theme="dark"] a:not(.btn).text-link {
  color: var(--text-color);
}

html[data-theme="dark"] p a:not(.btn):hover,
html[data-theme="dark"] a:not(.btn).text-link:hover {
  color: var(--text-color);
}

/* Auth page navigation links (Sign in / Sign up / Forgot password) */
.sign-in-link {
  text-align: center;
}

.sign-in-link a {
  font-size: 100%;
  margin: 0 2px 0 4px;
}

html[data-theme="dark"] .sign-in-link a {
  color: var(--color-primary);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] p a:not(.btn),
  html[data-theme="auto"] a:not(.btn).text-link {
    color: var(--text-color);
  }

  html[data-theme="auto"] p a:not(.btn):hover,
  html[data-theme="auto"] a:not(.btn).text-link:hover {
    color: var(--text-color);
  }
}

/* SVG/Icon styles */
html[data-theme="dark"] svg {
  stroke: currentColor;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] svg {
    stroke: currentColor;
  }
}

/* Make black fallback document PNG white */
/* in dark mode. see function getFileTypeName(filename) */
html[data-theme="dark"] img[alt="Document"] {
  filter: brightness(0) invert(1);
}

svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Leaflet draws vector overlays (polygons, circles) into an SVG it sizes through
   that element's own width/height attributes, matched to the map viewport. The
   icon default above outranks those attributes and collapses the entire layer to
   icon size, leaving shapes present in the DOM but invisible on the map.
   leaflet.css only guards max-width/max-height, so undo the sizing here. Scoped
   to the overlay pane, not the whole map: marker icons live in their own pane and
   should keep the icon sizing. */
.leaflet-container .leaflet-overlay-pane svg {
  width: auto;
  height: auto;
}

/* LEGACY BLANKET RULE - READ BEFORE REUSING ICONS INSIDE LINKS.
   This paints every svg inside an <a> with the body text color, at specificity
   (0,1,2). Any link-styled button (a.btn with an icon) therefore loses its own
   label color on the icon, while the same CTA built as <button> renders fine.
   The usual symptom is an icon that looks correct in one theme and invisible in
   the other, because --text-color flips while the button background does not.
   Do NOT widen this rule. To opt an icon out, beat it with two classes and set
   color only, e.g. `.card .card__cta svg { color: var(--color-primary-on); }`;
   stroke/fill need no override because the icons.svg symbols carry
   stroke="currentColor" as a presentation attribute, which wins over the
   inherited value. Removing this rule outright is the real fix but needs an
   audit of every link icon in the app. */
a svg:not(.icon-button) {
  stroke: var(--text-color);
  fill: var(--text-color);
  color: var(--text-color);
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-color);
}

.icon-button:hover {
  background-color: var(--color-gray-100);
  color: var(--text-color);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .icon-button:hover {
    background: var(--color-primary);
    color: var(--color-white);
  }
}

html[data-theme="dark"] .icon-button:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Button styles */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-on);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: var(--color-primary-on);
  border-color: var(--color-primary-hover);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background-color: var(--color-primary-disabled);
  border-color: var(--color-primary-disabled);
  /* Keep readable text on the gray disabled fill in both themes.
     Without this, color falls back to --color-primary-on (dark on dark). */
  color: var(--color-white);
  cursor: not-allowed;
}

/* Flow-aware accent: btn-primary follows --flow-accent inside [data-accent] scope */
[data-accent] .btn-primary {
  background-color: var(--flow-accent);
  border-color: var(--flow-accent);
  color: var(--flow-accent-on, var(--color-white));
}
[data-accent] .btn-primary:hover {
  background-color: var(--flow-accent-dark);
  border-color: var(--flow-accent-dark);
  color: var(--flow-accent-on, var(--color-white));
}

.btn-dark {
  background-color: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.btn-dark:hover {
  background-color: #000;
  color: var(--bg-color);
  border-color: #000;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .btn-dark:hover {
    background-color: #fff;
    color: var(--bg-color);
    border-color: #fff;
  }
}

html[data-theme="dark"] .btn-dark:hover {
  background-color: #fff;
  color: var(--bg-color);
  border-color: #fff;
}

.btn-dark:disabled,
.btn-dark[disabled] {
  background-color: #9ca3af;
  border-color: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-text-primary);
  border-color: var(--color-secondary);
}

.btn-secondary:hover {
  background-color: var(--color-secondary-dark);
  color: var(--color-text-primary);
  border-color: var(--color-secondary-dark);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .btn-secondary {
    background-color: var(--color-gray-700);
    color: var(--color-gray-100);
    border-color: var(--color-gray-700);
  }
  html[data-theme="auto"] .btn-secondary:hover {
    background-color: var(--color-gray-600);
    color: var(--color-gray-100);
    border-color: var(--color-gray-600);
  }
}

html[data-theme="dark"] .btn-secondary {
  background-color: var(--color-gray-700);
  color: var(--color-gray-100);
  border-color: var(--color-gray-700);
}

html[data-theme="dark"] .btn-secondary:hover {
  background-color: var(--color-gray-600);
  color: var(--color-gray-100);
  border-color: var(--color-gray-600);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-gray-300);
  color: var(--color-gray-700);
}

.btn-outline:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--color-primary);
  padding: 0;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

a.btn {
  text-decoration: none;
}

a.btn:hover {
  text-decoration: none;
}

html[data-theme="dark"] .btn-outline {
  border-color: var(--color-gray-700);
  color: var(--color-gray-300);
}

html[data-theme="dark"] .btn-outline:hover {
  background-color: var(--color-gray-900);
  border-color: var(--color-gray-300);
  color: var(--text-color);
}

html[data-theme="dark"] a.btn {
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .btn-outline {
    border-color: var(--color-gray-700);
    color: var(--color-gray-300);
  }

  html[data-theme="auto"] .btn-outline:hover {
    background-color: var(--color-gray-900);
    color: var(--color-gray-300);
  }
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: "Manrope", sans-serif;
  height: 36px;
}

.btn-md {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Manrope", sans-serif;
  height: 48px;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Manrope", sans-serif;
  height: 56px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-icon-start {
  margin-right: 0.5rem;
}

.btn svg {
  fill: currentColor;
}

/* Divider styles */
.divider-container {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
}

.divider {
  width: 100%;
  height: 2px;
  background-color: var(--border-color);
}

.divider-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

/* Dialog styles */
dialog {
  /* Override some builtins that limit us: */
  max-height: 100vh;
  max-width: 100vw;

  /* Positioning */
  box-sizing: border-box;
  width: fit-content;
  min-width: 400px;
  max-width: 600px;
  height: fit-content;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;

  /* Styling */
  border: 0;
  border-radius: 1.25rem;
  padding: 1.5rem;
  background-color: var(--bg-color);
  box-shadow: var(--shadow);

  /* Fade in: */
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

dialog[open] {
  opacity: 1;
  pointer-events: inherit;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.dialog-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.close-button-container {
  padding: 0;
  margin: 0;
}

.close-button {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  position: relative;
  cursor: pointer;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 1.2rem;
  background-color: var(--color-gray-500);
  top: 50%;
  left: 50%;
}

.close-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-button:hover::before,
.close-button:hover::after {
  background-color: var(--color-gray-700);
}

/* Card styles */
.card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--color-gray-50);
}

/* Table styles */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--table-border);
}

.table th {
  background: var(--table-header-bg);
  font-weight: 600;
  color: var(--table-header-text, var(--color-gray-700));
}

/* File upload styles */
.file-upload-area {
  background-color: #fcfcfc;
  border: 2px dashed #e9e9e9;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-upload-area:hover {
  border-color: var(--color-primary);
}

.choose-files-btn {
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  /* Re-enable pointer events for the button */
}

.valuation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* Badge styles */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-warning {
  background: var(--color-warning);
  color: var(--color-warning-dark);
}

.badge-success {
  background: var(--color-success);
  color: var(--color-success-dark);
}

/* Status pill styles */
.status-pill {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold, 600);
  border-radius: 1rem;
  padding: 0.125rem 0.75rem;
}

.status-pill--pending {
  background-color: var(--color-brand-orange-light);
  color: var(--color-brand-orange-dark);
}

.status-pill--paid {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
}

.status-pill--in_progress {
  background-color: var(--color-brand-blue-light);
  color: var(--color-brand-blue-dark);
}

.status-pill--pending_review {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.status-pill--in_review {
  background-color: var(--color-brand-orange-light);
  color: var(--color-brand-orange-dark);
}

.status-pill--complete {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
}
.status-pill--required {
  background-color: var(--color-brand-orange-light);
  color: var(--color-brand-orange-dark);
}
.status-pill--optional {
  background-color: var(--color-gray-100);
  color: var(--color-gray-600);
}

/* Brand components */
.bridge-gradient-bar {
  height: 4px;
  background: linear-gradient(to right, #6ba0f1, #6a5ace, #fb9f1e);
  transition: background-image 0.5s ease-in-out;
}

.bridge-logo {
  display: block;
  max-width: 100%;
  height: auto;
  transition: all 0.15s ease-in-out;
}

/* Form styles */
.floating-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-gray-600);
  pointer-events: none;
  transition: all 0.2s ease-in-out;
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 0.5rem;
}

.form-label {
  font-weight: 500;
  color: var(--label-text);
  font-size: 0.875rem;
}

.form-group input {
  padding: 1.5rem 1rem 0.5rem 1rem;
  border: 1px solid var(--input-border, var(--color-gray-400));
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: "Manrope", sans-serif;
  transition: all 0.15s ease-in-out;
  background-color: var(--input-bg, var(--bg-color));
  color: var(--input-text, var(--text-color));
}

.form-group input::placeholder {
  color: var(--input-placeholder, var(--color-gray-500));
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-group input:not(:focus) {
  border-color: var(--input-border, var(--color-gray-400));
}

.form-group input:read-only,
.form-group input:disabled {
  color: var(--input-placeholder, var(--color-gray-500));
}

.form-group .floating-label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 10px;
  font-weight: 500;
  color: var(--label-text, var(--color-gray-500));
}

.form-group.has-error input {
  border-color: var(--error-border, var(--color-error));
}

/* Side Panel */
.side-panel-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 998;
}

.side-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  max-width: 500px;
  padding: 48px 40px 40px 40px;
  background-color: var(--bg-color);
  z-index: 999;
}

.side-panel-title {
  font-family: "Sora", sans-serif;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
}

.side-panel-actions {
  position: fixed;
  bottom: 40px;
  display: flex;
  gap: 16px;
  margin-top: auto;
}

/* Django Form Error Lists */
.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0.35rem 0;
  font-size: 0.875rem;
  color: var(--color-error-dark);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.errorlist li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.errorlist li::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  -webkit-mask-image: url("/static/icons/circle-cross.7a7213cd87c7.svg");
  mask-image: url("/static/icons/circle-cross.7a7213cd87c7.svg");
  background-color: var(--color-error);
  background-image: none;
}

/* Form styles */
.form-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 0;
}

.form-group .floating-label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 10px;
  font-weight: 500;
  color: var(--label-text, var(--color-gray-500));
}

.form-group.has-error input {
  border-color: var(--error-border, var(--color-error));
}

.form-error {
  display: flex;
  align-items: center;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--error-text, var(--color-error));
  gap: 4px;
}

.form-error svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* Drawer styles */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  z-index: 999;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 500px;
  height: 100vh;
  background: var(--bg-color);
  box-shadow: var(--shadow);
  transition: right 0.3s ease;
  z-index: 1000;
}

.drawer.active {
  right: 0;
}

.drawer-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.drawer-body {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
}

.drawer-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-container {
  flex: 3;
}

#search-input {
  width: 300px;
}

.filter-container {
  flex: 1;
}

/* Select and Option */

option {
  color: var(--text-color);
  background-color: var(--bg-color);
}

.form-control {
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-select {
  width: fit-content;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-color);
  background-color: var(--bg-color);
  cursor: pointer;

  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M7 10L12 15L17 10'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .form-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M7 10L12 15L17 10'/%3e%3c/svg%3e");
  }
}

html[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M7 10L12 15L17 10'/%3e%3c/svg%3e");
}

/* switch eye icon to white */
html[data-theme="dark"] .form-input__toggle-icon--hidden {
  filter: brightness(1) invert(1);
  filter: brightness(0) invert(1);
}

.form-select:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 0 0 0 1px var(--text-color);
}

.table td.empty-state {
  display: table-cell;
  text-align: center;
  padding: 1rem;
  color: #6c757d;
}

.filter-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  margin-top: 1rem;
}

.date-filter {
  width: 200px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.info-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  font-size: 1rem;
  color: var(--text-color);
  font-weight: 600;
}

.edit-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease-in-out;
}

.edit-link:hover {
  color: var(--color-primary-dark);
}

/* Form text styles (help text) */

.form-text {
  margin: 0.5rem 0 0 1.5rem;
}

.form-text ul {
  display: flex;
  flex-direction: column;
  list-style: disc;
  gap: 0.125rem;
}

.form-text li {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Bottom Sheet - Slides up from bottom of screen */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s 0.3s;
}
.bottom-sheet.open {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s 0s;
}
.bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
}
.bottom-sheet.open .bottom-sheet__backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}
.bottom-sheet__container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background-color: var(--bg-color);
  border-radius: 1.25rem 1.25rem 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.bottom-sheet.open .bottom-sheet__container {
  transform: translateY(0);
}

/* ── Impersonate Banner ── */
.impersonate-banner {
  background-color: var(--color-primary-light, #eeebff);
  border-bottom: 1px solid var(--color-primary, #6a5ace);
  padding: 0.375rem 1rem;
  flex-shrink: 0;
}
/* .portal-layout uses min-height: 100vh as a flex column.
   Adding the banner makes total height > 100vh, causing body-level scroll.
   Fix: cap the layout to exactly 100vh so only .portal-main scrolls. */
.portal-layout:has(.impersonate-banner) {
  max-height: 100vh;
}
.impersonate-banner__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.impersonate-banner__icon {
  flex-shrink: 0;
  color: var(--color-primary-dark, #4135aa);
}
.impersonate-banner__text {
  font-size: 0.8125rem;
  color: var(--color-primary-dark, #4135aa);
}
.impersonate-banner__stop-btn {
  background-color: transparent;
  color: var(--color-primary-dark, #4135aa);
  border: 1px solid var(--color-primary, #6a5ace);
  border-radius: var(--radius-xl, 0.75rem);
  padding: 0.125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  height: auto;
}
.impersonate-banner__stop-btn:hover {
  background-color: var(--color-primary, #6a5ace);
  color: white;
}

/* Verified icon (Admin Portal tables) */
.verified-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.verified-icon--yes {
  stroke: var(--color-green-600);
  fill: var(--color-green-600);
  color: var(--color-green-600);
}
.verified-icon--no {
  stroke: var(--color-gray-400);
  fill: var(--color-gray-400);
  color: var(--color-gray-400);
}

/* AI listing image: shimmer skeleton shown while generation is in progress.
   Sizing comes from the page's own image class; this only adds the animated
   placeholder fill. flex-shrink:0 keeps it full-width inside flex card rows.
   div.* raises specificity above page-level image classes (e.g. detail's
   .sidebar-image-card__img sets display:block in an inline <style> loaded
   after this file), so the placeholder keeps its centered flex layout. */
div.listing-image-skeleton {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Static placeholder fill (token-based, so dark mode adapts automatically).
     The spinner alone conveys progress, so no shimmer animation. */
  background-color: var(--bg-hover-color);
}
/* Centered "generating" indicator on top of the shimmer. */
.listing-image-skeleton__label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
}
.listing-image-skeleton__spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border-color);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: listing-image-spin 0.8s linear infinite;
}
@keyframes listing-image-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Theme switch: while the theme is being toggled (html.theme-switching is added
   by theme.js for one frame), suppress ALL transitions so colors snap to the new
   theme instead of animating from the old one. Hover/focus transitions are
   unaffected the rest of the time. Animations (keyframes) are intentionally left
   running — only transitions are killed. */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}
