/* Actions */
button,
.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem var(--space-4);
  border: 1px solid var(--action);
  border-radius: var(--radius-md);
  background: var(--action);
  color: #ffffff;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

button:hover,
.button:hover {
  border-color: var(--action-hover);
  background: var(--action-hover);
  color: #ffffff;
}

button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.button--secondary,
button.button--secondary {
  border-color: var(--color-border);
  background: var(--surface);
  color: var(--text);
}

.button--secondary:hover,
button.button--secondary:hover {
  border-color: var(--text);
  background: var(--surface-soft);
  color: var(--text);
}

.button--danger,
button.button--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.button--danger:hover,
button.button--danger:hover {
  border-color: #b81922;
  background: #b81922;
}

.button--text,
button.button--text {
  min-height: 2.75rem;
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: transparent;
  color: var(--action);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.button--text:hover,
button.button--text:hover {
  background: color-mix(in srgb, var(--action) 8%, transparent);
  color: var(--action-hover);
}

/* Shared panels */
.placeholder,
.form-panel,
.state-panel,
.settings-section,
.warning-panel,
.future-placeholder,
.card,
.booking-request-panel,
.booking-list-panel,
.booking-summary,
.booking-status-hero,
.booking-action-panel,
.booking-timeline,
.booking-quote-panel,
.protected-location-panel,
.public-detail-section,
.search-panel,
.discovery-intro,
.listing-preview {
  margin-block: var(--space-4);
  padding: clamp(var(--space-4), 3vw, var(--space-6));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.form-panel,
.state-panel,
.settings-section,
.warning-panel,
.future-placeholder,
.placeholder {
  max-width: 52rem;
}

.form-panel > :first-child,
.state-panel > :first-child,
.settings-section > :first-child,
.warning-panel > :first-child,
.future-placeholder > :first-child,
.placeholder > :first-child,
.public-detail-section > :first-child,
.booking-summary > :first-child,
.booking-list-panel > :first-child,
.booking-action-panel > :first-child,
.booking-timeline > :first-child {
  margin-top: 0;
}

.form-panel > :last-child,
.state-panel > :last-child,
.settings-section > :last-child,
.warning-panel > :last-child,
.future-placeholder > :last-child,
.placeholder > :last-child,
.public-detail-section > :last-child {
  margin-bottom: 0;
}

.operational-surface .form-panel,
.operational-surface .state-panel,
.operational-surface .settings-section,
.operational-surface .card,
.operational-surface .booking-list-panel,
.operational-surface .booking-summary,
.operational-surface .booking-action-panel,
.operational-surface .booking-timeline,
.operational-surface .booking-quote-panel,
.operational-surface .listing-preview {
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.stack {
  display: grid;
  gap: var(--space-4);
}

.warning-panel,
.alert--warning,
.protected-location-panel {
  border-color: #d6b656;
  border-left: 4px solid var(--warning);
  background: var(--warning-soft);
}

.danger-zone {
  border-color: #ff8389;
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
}

.alert {
  width: min(100%, 52rem);
  margin-block: var(--space-4);
  padding: var(--space-4);
  border-left: 4px solid var(--action);
  background: var(--surface-soft);
  color: var(--text);
}

.demo-banner.alert {
  width: 100%;
  max-width: none;
  margin: 0;
}

.operational-surface .demo-banner.alert {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
}

.account-surface .demo-banner.alert {
  width: 50%;
  margin-left: 50%;
}

.alert--error,
.state-panel--error,
.error-summary {
  border-color: var(--danger);
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
  color: #750e13;
}

.error-summary {
  margin-block: var(--space-4);
  padding: var(--space-4);
}

.error-summary h2 {
  margin-top: 0;
  color: #750e13;
  font-size: 1.125rem;
}

.error-summary a,
.field-error {
  color: #a2191f;
}

.eyebrow,
.pilot-note,
.result-count,
.help-text,
.environment-label,
.message-state,
.message-tombstone {
  color: var(--muted-text);
}

.eyebrow {
  margin-bottom: var(--space-1);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.help-text {
  margin-top: var(--space-1);
  font-size: 0.8rem;
}

.empty-state {
  display: grid;
  min-height: 9rem;
  place-content: center;
  padding: var(--space-6);
  border: 1px dashed var(--color-border);
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
  text-align: center;
}

.empty-state > * {
  margin-inline: auto;
}

/* Forms */
.form-panel form,
.report-panel form,
.review-panel form,
.deletion-form,
.quick-block-panel form {
  display: grid;
  gap: var(--space-4);
}

.form-field {
  display: grid;
  gap: var(--space-2);
  margin-block: var(--space-4);
}

.form-field label,
.form-field legend,
.filter-bar label,
.deletion-form label,
.card form > label {
  display: block;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-field fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-field fieldset ul {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.form-field fieldset li,
.checkbox-field {
  display: flex;
  min-height: 2.75rem;
  align-items: flex-start;
  gap: var(--space-2);
}

.checkbox-field label,
.form-field fieldset label {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem var(--space-4);
  border: 1px solid var(--color-border);
  border-bottom: 2px solid #8d8d8d;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  margin-top: 0.1rem;
  accent-color: var(--action);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #8d8d8d;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.form-field--error input,
.form-field--error select,
.form-field--error textarea {
  border-color: var(--danger);
}

.form-panel button[type="submit"] {
  justify-self: start;
}

.account-surface .form-panel {
  max-width: none;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.account-surface .form-panel button[type="submit"] {
  width: 100%;
  min-height: 3.5rem;
  border-radius: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.account-surface .form-field input,
.account-surface .form-field select,
.account-surface .form-field textarea {
  border: 0;
  border-bottom: 1px solid #8d8d8d;
  border-radius: 0;
  background: var(--surface-soft);
}

/* Navigation within a workflow */
.section-nav,
.vehicle-nav,
.vehicle-actions,
.availability-actions,
.booking-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-block: var(--space-4) var(--space-6);
}

.section-nav a,
.vehicle-nav a,
.booking-context-actions a,
.availability-actions a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
}

.section-nav a:hover,
.vehicle-nav a:hover,
.booking-context-actions a:hover {
  border-color: var(--action);
  background: color-mix(in srgb, var(--action) 7%, var(--surface));
}

/* Definition and operational data */
.detail-list,
.settings-section dl {
  display: grid;
  grid-template-columns: minmax(9rem, 0.45fr) minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.detail-list dt,
.detail-list dd,
.settings-section dt,
.settings-section dd {
  min-width: 0;
  margin: 0;
  padding: 0.7rem var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
  overflow-wrap: anywhere;
}

.detail-list dt,
.settings-section dt {
  color: var(--muted-text);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-block: var(--space-4);
  overflow-x: auto;
  border-collapse: collapse;
  background: var(--surface);
  scrollbar-color: var(--action) var(--surface-strong);
  scrollbar-width: thin;
}

.data-table thead,
.data-table tbody {
  display: table;
  width: 100%;
  min-width: 42rem;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 0.85rem var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--action) 7%, var(--surface));
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-4);
  align-items: end;
  margin-block: var(--space-4) var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  background: var(--surface-soft);
}

.filter-bar p,
.filter-bar label {
  min-width: 0;
  margin: 0;
}

.filter-bar button {
  width: 100%;
}

/* Lists and status */
.booking-list,
.vehicle-list,
.document-list,
.dashboard-list,
.readiness-list {
  display: grid;
  gap: var(--space-2);
  max-width: none;
  margin: var(--space-4) 0;
  padding: 0;
  list-style: none;
}

.booking-list > li,
.vehicle-list > li,
.document-list > li,
.dashboard-list > li,
.readiness-list > li {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.booking-list > li:nth-child(even),
.vehicle-list > li:nth-child(even),
.dashboard-list > li:nth-child(even) {
  background: var(--surface-soft);
}

.vehicle-list > li,
.dashboard-list > li {
  display: grid;
  gap: var(--space-1);
}

.dashboard-list > li {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  min-height: 1.5rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-inline-start: var(--space-2);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.operational-surface .status-badge {
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.status-badge--confirmed,
.status-badge--return_confirmed,
.status-badge--closed,
.status-badge--quote-accepted,
.status-badge--quote-sent {
  border-color: #42be65;
  background: var(--success-soft);
  color: #0e6027;
}

.status-badge--declined,
.status-badge--cancelled,
.status-badge--disputed,
.status-badge--quote-declined,
.status-badge--quote-expired,
.status-badge--quote-withdrawn {
  border-color: #ff8389;
  background: var(--danger-soft);
  color: #a2191f;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-block: var(--space-6);
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
  text-decoration: none;
}

.pagination [aria-current="page"] {
  border-color: var(--action);
  background: var(--action);
  color: #ffffff;
}

/* Homepage and public discovery */
.home-surface .discovery-intro {
  max-width: 44rem;
  margin: 0 0 var(--space-6);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--consumer-muted);
  font-size: 1.05rem;
}

.home-surface .search-panel {
  width: min(100%, 56rem);
  padding: var(--space-4);
  border: 1px solid var(--consumer-border);
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.home-surface .search-panel > h2,
.home-surface .search-panel > p {
  display: none;
}

.home-surface .public-search-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-surface .warning-panel {
  max-width: 44rem;
  background: rgb(255 248 225 / 93%);
}

.search-panel {
  max-width: none;
}

.public-search-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(12rem, 1fr));
  gap: 0 var(--space-4);
}

.public-search-form .form-field {
  min-width: 0;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: var(--space-4);
  align-items: center;
}

.search-results {
  margin-top: var(--space-10);
}

.vehicle-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: var(--space-4);
}

.vehicle-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--consumer-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.vehicle-card:hover {
  border-color: var(--consumer-ink);
  box-shadow: var(--shadow-md);
}

.vehicle-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--space-6);
}

.vehicle-card__body h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.35rem;
}

.vehicle-card__body p {
  margin-block: 0 0.55rem;
}

.pricing-summary {
  display: grid;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--consumer-border);
}

.public-photo-placeholder {
  position: relative;
  display: grid;
  min-height: 12rem;
  place-content: end center;
  gap: var(--space-1);
  overflow: hidden;
  padding: var(--space-4);
  background:
    linear-gradient(rgb(220 232 236 / 20%), rgb(4 25 32 / 12%)),
    url("../img/flexivan-hero.svg") center / cover no-repeat;
  color: var(--consumer-ink);
  text-align: center;
}

.public-photo-placeholder::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 60%, rgb(255 255 255 / 80%));
  content: "";
}

.public-photo-placeholder > * {
  position: relative;
  z-index: 1;
}

.public-photo-placeholder span[aria-hidden="true"] {
  display: none;
}

.public-photo-placeholder--detail {
  min-height: clamp(18rem, 42vw, 32rem);
  border: 1px solid var(--consumer-border);
  border-radius: var(--radius-lg);
}

.public-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 0.9fr);
  gap: var(--space-6);
  align-items: start;
}

.public-detail-layout > * {
  min-width: 0;
}

.public-detail-layout > aside {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

.vehicle-detail-surface .public-detail-section {
  max-width: none;
}

.availability-state {
  padding: var(--space-4);
  border-left: 4px solid var(--muted-text);
  background: var(--surface-soft);
  font-weight: 700;
}

.availability-state--available {
  border-left-color: var(--success);
  background: var(--success-soft);
  color: #0e6027;
}

.availability-state--unavailable {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #a2191f;
}

.search-surface .vehicle-card-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .search-surface .vehicle-card {
    min-height: 18rem;
    flex-direction: row;
  }

  .search-surface .vehicle-card .public-photo-placeholder {
    width: clamp(15rem, 28vw, 22rem);
    flex: 0 0 auto;
  }
}

/* Dashboards */
.dashboard-hero-panel {
  max-width: none;
  padding: clamp(var(--space-6), 5vw, var(--space-10));
  border-radius: var(--radius-lg);
}

.dashboard-hero-panel h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.dashboard-hero-panel .booking-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.dashboard-hero-panel .booking-list > li {
  border-radius: var(--radius-md);
  background: var(--consumer-soft);
}

.owner-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  gap: var(--space-6);
}

.owner-dashboard-grid .state-panel {
  max-width: none;
  margin: 0;
}

.dashboard-queue-panel {
  border-top: 4px solid var(--blue);
}

.dashboard-fleet-panel {
  background: var(--surface-soft);
}

.staff-surface .dashboard-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.staff-surface .dashboard-list > li {
  min-height: 7rem;
  align-content: space-between;
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 4px solid var(--blue);
  background: var(--surface-soft);
}

.staff-surface .dashboard-list .dashboard-count {
  color: var(--blue);
  font-size: 1.6rem;
  font-weight: 300;
}

.staff-surface .dashboard-list .dashboard-unavailable {
  grid-column: 1 / -1;
  color: var(--muted-text);
  font-size: 0.8rem;
}

.staff-detail-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.8fr) minmax(0, 1.4fr);
  gap: var(--space-6);
  align-items: start;
}

.staff-detail-grid__summary,
.staff-detail-grid__workspace {
  min-width: 0;
}

.staff-detail-grid .state-panel,
.staff-detail-grid .form-panel {
  max-width: none;
}

.staff-detail-grid__summary .state-panel {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  background: var(--surface-soft);
}

/* Bookings, quotes, lifecycle */
.booking-status-region,
.booking-quote-panel,
.handover-panel,
.review-panel,
.report-panel,
.report-list,
.notification-list,
.conversation-panel {
  display: grid;
  gap: var(--space-4);
}

.booking-status-hero {
  max-width: none;
  border-top: 4px solid var(--action);
}

.booking-status-hero h2 {
  max-width: 30ch;
}

.protected-location-panel {
  max-width: none;
  border-style: solid;
}

.protected-location-panel--revealed {
  border-color: #42be65;
  border-left-color: var(--success);
  background: var(--success-soft);
}

.protected-location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.protected-location-grid address {
  font-style: normal;
}

.booking-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.booking-timeline ol {
  display: grid;
  gap: 0;
  padding: 0;
  list-style: none;
}

.booking-timeline li {
  position: relative;
  display: grid;
  gap: var(--space-1);
  padding: 0 0 var(--space-6) var(--space-10);
}

.booking-timeline li::before {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 0.85rem;
  height: 0.85rem;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--action);
  box-shadow: 0 0 0 1px var(--action);
  content: "";
}

.booking-timeline li:not(:last-child)::after {
  position: absolute;
  top: 1.1rem;
  bottom: 0;
  left: 0.65rem;
  width: 1px;
  background: var(--color-border);
  content: "";
}

.booking-timeline li span {
  color: var(--muted-text);
  font-size: 0.82rem;
}

.booking-quote-heading,
.quote-version > header,
.handover-header,
.conversation-context,
.notification-list__header,
.notification-item,
.message-item header,
.message-actions,
.notification-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.quote-history {
  display: grid;
  gap: var(--space-4);
}

.quote-version,
.quote-preview,
.handover-context,
.handover-readiness,
.participant-checklists,
.pending-panel,
.problem-panel,
.checklist-card,
.conversation-context,
.message-thread,
.message-composer,
.notification-item {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.quote-version--current {
  border-left: 4px solid var(--action);
}

.inline-form {
  display: inline;
  margin-left: var(--space-2);
}

.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-2);
  max-width: none;
}

.calendar-rule {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--action);
  background: var(--surface);
}

.calendar-rule--blocked {
  border-left-color: var(--danger);
}

.quick-block-panel {
  position: sticky;
  bottom: var(--space-2);
  z-index: 10;
}

/* Handover, reports, reviews */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
}

.readiness-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.problem-panel summary {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

.problem-panel[open] summary {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.review-text,
.report-details,
.message-body {
  max-width: 65ch;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.review-card,
.report-detail,
.dispute-detail,
.sensitive-detail {
  overflow-wrap: anywhere;
}

.dummy-only-warning {
  max-width: none;
}

.submit-busy-label,
.message-sending-label {
  display: none;
}

.htmx-request .submit-ready-label,
.htmx-request .message-send-label {
  display: none;
}

.htmx-request .submit-busy-label,
.htmx-request .message-sending-label {
  display: inline;
}

/* Messaging and notifications */
.conversation-panel {
  max-width: 58rem;
  margin-inline: auto;
}

.conversation-context {
  border-radius: 0;
  background: var(--surface-soft);
}

.conversation-toolbar {
  display: flex;
  justify-content: flex-end;
}

.message-thread {
  display: grid;
  min-height: 18rem;
  gap: var(--space-4);
  border-radius: 0;
}

.message-item {
  width: fit-content;
  max-width: min(42rem, 86%);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 0;
  background: var(--surface-soft);
}

.message-item--own {
  justify-self: end;
  border-color: var(--action);
  border-radius: var(--radius-lg) var(--radius-lg) 0 var(--radius-lg);
  background: var(--action);
  color: #ffffff;
}

.message-item--own .message-state,
.message-item--own .message-tombstone,
.message-item--own a,
.message-item--own .button--text {
  color: #ffffff;
}

.message-item time {
  color: inherit;
  font-size: 0.75rem;
  opacity: 0.75;
}

.load-older-messages {
  justify-self: center;
}

.message-composer {
  position: sticky;
  bottom: var(--space-2);
  z-index: 8;
  border-radius: 0;
  box-shadow: 0 -8px 24px rgb(0 0 0 / 8%);
}

.notification-list {
  max-width: 60rem;
}

.notification-item {
  border-radius: 0;
}

.notification-item--unread {
  border-left: 4px solid var(--action);
  background: color-mix(in srgb, var(--action) 6%, var(--surface));
}

.notification-actions {
  flex-direction: column;
  align-items: flex-end;
}

/* Documents and photos */
.document-list > li {
  display: grid;
  gap: var(--space-2);
}

.deletion-form {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-4);
  margin-block: var(--space-4);
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-border);
  object-fit: cover;
}

.listing-preview {
  max-width: 64rem;
}

/* Responsive */
@media (max-width: 64rem) {
  .public-detail-layout,
  .owner-dashboard-grid,
  .staff-detail-grid {
    grid-template-columns: 1fr;
  }

  .public-detail-layout > aside {
    position: static;
  }

  .staff-detail-grid__summary .state-panel {
    position: static;
  }

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

@media (max-width: 48rem) {
  .operational-surface .demo-banner.alert,
  .account-surface .demo-banner.alert {
    width: 100%;
    margin-left: 0;
  }

  .form-panel,
  .state-panel,
  .settings-section,
  .warning-panel,
  .future-placeholder,
  .placeholder,
  .booking-request-panel,
  .booking-list-panel,
  .booking-summary,
  .booking-status-hero,
  .booking-action-panel,
  .booking-timeline,
  .booking-quote-panel,
  .protected-location-panel,
  .public-detail-section,
  .search-panel,
  .discovery-intro,
  .listing-preview {
    padding: var(--space-4);
  }

  .public-search-form,
  .home-surface .public-search-form,
  .protected-location-grid,
  .detail-list,
  .settings-section dl {
    grid-template-columns: 1fr;
  }

  .detail-list dt,
  .settings-section dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .detail-list dd,
  .settings-section dd {
    padding-top: var(--space-1);
  }

  .search-actions,
  .booking-action-buttons,
  .vehicle-actions,
  .availability-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-actions button,
  .booking-action-buttons button,
  .vehicle-actions form,
  .vehicle-actions button,
  .availability-actions a,
  .availability-actions button,
  .handover-panel button,
  .handover-panel input[type="file"],
  .handover-panel select,
  .handover-panel textarea {
    width: 100%;
  }

  .booking-quote-heading,
  .quote-version > header,
  .handover-header,
  .conversation-context,
  .notification-list__header,
  .notification-item,
  .message-item header,
  .readiness-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .notification-actions {
    align-items: flex-start;
  }

  .message-item {
    max-width: 94%;
  }

  .home-surface .search-panel > h2,
  .home-surface .search-panel > p {
    display: block;
  }
}

@media (max-width: 30rem) {
  .section-nav,
  .vehicle-nav,
  .booking-context-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-nav a,
  .vehicle-nav a,
  .booking-context-actions a {
    width: 100%;
  }

  .status-badge {
    margin-inline-start: 0;
  }
}
