/* Camo CPQ — hand-written CSS (no build step, no framework). */
/* Brand tokens + reset live in global.css (static.californiamobility.com), linked from index.html. */

/* --- page shell --- */

.page {
  background: var(--color-gray-50);
  color: var(--color-gray-900);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
}

.app-shell {
  width: 100%;
  max-width: 80rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell__header-pad {
  padding: 0 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(249 250 251 / 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-gray-200);
}

.site-header__inner {
  margin-inline: auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo {
  height: 2rem;
  width: auto;
}

@media (min-width: 640px) {
  .site-header__logo {
    height: 2.5rem;
  }
}

.site-header__user {
  flex-shrink: 0;
}

.user-menu {
  position: relative;
}

.user-menu__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: none;
  background: var(--color-brand);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-default);
}

.user-menu__avatar:hover {
  background: var(--color-brand-hover);
}

.user-menu__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 30;
  min-width: 14rem;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-menu__email {
  font-size: 0.8125rem;
  color: var(--color-gray-700);
  word-break: break-word;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.app-main {
  margin-inline: auto;
  width: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- generic layout helpers --- */

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .layout-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stack-2 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stack-3 {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.confidential-notice {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--color-gray-500);
  margin-bottom: 1rem;
}

.panel__loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-gray-500);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-brand);
  border-radius: 9999px;
  animation: spin 0.6s linear infinite;
}

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

/* --- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease-default), color 0.15s var(--ease-default);
}

@media (min-width: 640px) {
  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
}

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

.btn--block {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn--primary {
  background: var(--color-brand);
  color: var(--color-white);
}

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

.btn--gold {
  background: var(--color-gold);
  color: var(--color-white);
}

.btn--gold:hover {
  background: var(--color-gold-hover);
}

.btn--muted {
  background: var(--color-gray-100);
  color: var(--color-gray-800);
}

.btn--muted:hover {
  background: var(--color-gray-200);
}

.btn--floating {
  pointer-events: auto;
}

.btn--margin-toggle {
  min-width: 6.5rem;
}

@media (min-width: 640px) {
  .btn--margin-toggle {
    min-width: 7.5rem;
  }
}

/* --- info tooltip --- */

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-tooltip__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: var(--color-gray-200);
  color: var(--color-gray-700);
  font-size: 0.75rem;
  font-weight: 600;
  font-style: italic;
  cursor: help;
  transition: background-color 0.15s var(--ease-default);
}

.info-tooltip__trigger:hover,
.info-tooltip__trigger:focus-visible {
  background: var(--color-gray-300);
  outline: none;
}

.info-tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  width: 16rem;
  max-width: 60vw;
  background: var(--color-gray-900);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s var(--ease-default);
  pointer-events: none;
  z-index: 30;
}

.info-tooltip__trigger:hover + .info-tooltip__bubble,
.info-tooltip__trigger:focus-visible + .info-tooltip__bubble {
  opacity: 1;
  visibility: visible;
}

/* --- inputs --- */

.input {
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  /* 16px, not the desktop 0.875rem: below 16px, iOS Safari zooms the
     viewport in on focus and doesn't reliably zoom back out on blur once
     this app's re-render replaces the focused node. Restored to 0.875rem
     at the 640px+ breakpoint below, where that zoom behavior doesn't apply. */
  font-size: 1rem;
  background: var(--color-white);
}

.input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-brand);
}

.input--block {
  width: 100%;
}

.input--discount {
  width: 4rem;
  text-align: right;
  padding: 0.375rem 0.5rem;
}

@media (min-width: 640px) {
  .input,
  .qty-stepper__input,
  .ship-to__field-input,
  .chip-input__field {
    font-size: 0.875rem;
  }

  .input--discount {
    width: 6rem;
  }
}

.form-error {
  font-size: 0.875rem;
  color: var(--color-red-600);
}

.form-error a {
  color: inherit;
  text-decoration: none;
}

/* --- login card --- */

.login-card {
  max-width: 24rem;
  margin-inline: auto;
  margin-top: 4rem;
  background: var(--color-white);
  border-radius: 1rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.login-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-card__subtitle {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-bottom: 1rem;
}

.login-card--wide {
  max-width: 32rem;
}

.deal-select-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deal-results {
  margin-top: 0.75rem;
  max-height: 20rem;
  overflow-y: auto;
}

.deal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-gray-700);
  background: var(--color-gray-100);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.deal-banner__text {
  flex: 1;
  min-width: 0;
}

.deal-banner__change {
  flex-shrink: 0;
}

.deal-banner a {
  color: var(--color-brand);
}

.deal-banner a:hover {
  text-decoration: underline;
}

/* --- option cards (product / add-on selection) --- */

.option-card {
  display: block;
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--color-gray-200);
  padding: 1rem;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s var(--ease-default);
}

.option-card:hover {
  box-shadow: var(--shadow-md);
}

.option-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-brand);
}

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

.option-card--selected {
  box-shadow: 0 0 0 2px var(--color-brand);
}

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

.option-card__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.option-card__indicator {
  margin-top: 0.25rem;
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
  border: 1px solid var(--color-gray-300);
  background: var(--color-white);
}

.option-card__indicator--radio {
  border-radius: 9999px;
}

.option-card__indicator--checkbox {
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-card__indicator--checked {
  background: var(--color-brand);
  border-color: var(--color-brand);
}

.option-card__check-icon {
  height: 0.75rem;
  width: 0.75rem;
  color: var(--color-white);
}

.option-card__body {
  flex: 1;
  min-width: 0;
}

.option-card__title {
  font-weight: 500;
  color: var(--color-gray-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.option-card__description {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-top: 0.125rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.option-card__price-wrap {
  text-align: right;
}

.option-card__price {
  font-weight: 600;
}

/* --- add-on configuration / quantity extras --- */

.addon-extra {
  margin-top: 0.5rem;
  margin-left: 1.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.75rem;
  background: var(--color-gray-50);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.addon-extra__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.addon-extra__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-gray-700);
}

.addon-extra__select {
  flex: 1;
  max-width: 12rem;
}

.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  background: var(--color-white);
  overflow: hidden;
}

.qty-stepper button {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  color: var(--color-gray-600);
  font-weight: 600;
  flex-shrink: 0;
}

.qty-stepper button:hover:not(:disabled) {
  background: var(--color-gray-50);
}

.qty-stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-stepper__input {
  width: 2.5rem;
  border: none;
  border-left: 1px solid var(--color-gray-200);
  border-right: 1px solid var(--color-gray-200);
  text-align: center;
  font-size: 1rem;
  padding: 0.375rem 0;
  background: transparent;
}

.qty-stepper__input:focus {
  outline: none;
  background: var(--color-gray-50);
}

/* --- accordion --- */

.accordion-toggle {
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--color-gray-50);
  transition: background-color 0.15s var(--ease-default), box-shadow 0.15s var(--ease-default);
}

.accordion-toggle:hover {
  background: var(--color-gray-100);
  box-shadow: var(--shadow-md);
}

.accordion-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-brand);
}

.accordion-toggle__title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-900);
}

.accordion-toggle__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accordion-toggle__chevron {
  height: 1rem;
  width: 1rem;
  color: var(--color-gray-500);
  transition: transform 0.3s var(--ease-default);
}

.accordion-toggle__chevron--open {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  color: var(--color-gray-600);
}

/* --- product / add-on panels --- */

.panel {
  background: var(--color-white);
  border-radius: 1rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  padding-bottom: 0.5rem;
}

.panel__header {
  padding: 1rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.panel__search {
  margin-top: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-gray-100);
}

.panel__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 60vh;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

.panel__sticky-actions {
  position: sticky;
  bottom: 0;
  padding-top: 0.5rem;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  pointer-events: none;
}

/* --- quote summary --- */

.summary {
  background: var(--color-white);
  border-radius: 1rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

@media (min-width: 640px) {
  .summary {
    padding: 1.25rem;
  }
}

.summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.summary__margin {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray-700);
}

.line-items {
  margin-bottom: 1rem;
}

.line-items__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-gray-100);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.line-items__col {
  flex: 1;
}

.line-items__col--amount {
  width: 5rem;
  text-align: right;
}

.line-items__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.line-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.line-item--addon {
  padding-left: 1rem;
  border-left: 2px solid var(--color-gray-100);
}

.line-item__body {
  flex: 1;
  min-width: 0;
}

.line-item__name {
  font-weight: 500;
  color: var(--color-gray-900);
}

.line-item__desc {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-top: 0.125rem;
}

.line-item__qty {
  font-weight: 400;
  color: var(--color-gray-500);
  font-size: 0.875rem;
}

.line-item__cost {
  width: 5rem;
  text-align: right;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.line-item__price-wrap {
  width: 5rem;
  text-align: right;
  white-space: nowrap;
}

.line-item__price {
  font-weight: 600;
  color: var(--color-gray-900);
}

@media (min-width: 640px) {
  .line-items__col--amount,
  .line-item__cost,
  .line-item__price-wrap {
    width: 7rem;
  }
}

.totals {
  border-top: 1px solid var(--color-gray-100);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.totals__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.totals__row--discount {
  padding: 0.25rem 0;
}

.totals__row--applied {
  color: var(--color-green-600);
}

.totals__row--total {
  font-weight: 600;
  font-size: 1rem;
  border-top: 1px solid var(--color-gray-100);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.totals__label {
  flex: 1;
  color: var(--color-gray-600);
}

.totals__amount {
  width: 5rem;
  text-align: right;
}

.totals__amount--strong {
  font-weight: 500;
}

.totals__spacer {
  width: 5rem;
}

@media (min-width: 640px) {
  .totals__amount,
  .totals__spacer {
    width: 7rem;
  }
}

.discount-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.segmented {
  display: flex;
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 500;
}

.segmented__btn {
  padding: 0.375rem 0.625rem;
  background: var(--color-white);
  color: var(--color-gray-600);
  transition: background-color 0.15s var(--ease-default), color 0.15s var(--ease-default);
}

.segmented__btn:hover {
  background: var(--color-gray-50);
}

.segmented__btn--active {
  background: var(--color-brand);
  color: var(--color-white);
}

.segmented__btn--active:hover {
  background: var(--color-brand);
}

/* --- quote details (comment / expiration / ship-to) --- */

.subsection-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.quote-details {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-gray-100);
}

.quote-details__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .quote-details__columns {
    grid-template-columns: 1fr 1fr;
  }
}

.quote-details__col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ship-to {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Just the title-to-first-field gap, to match .quote-details__col's 0.75rem
   there, without loosening the (intentionally tighter) gaps between the
   address fields themselves. */
.ship-to > .subsection-title {
  margin-bottom: 0.375rem;
}

.ship-to__hubspot-note {
  margin-top: 0.375rem;
}

.ship-to__contact-display {
  font-size: 0.875rem;
  color: var(--color-gray-900);
}

.ship-to__field {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.ship-to__field-label {
  flex-shrink: 0;
  width: 3.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-gray-600);
  white-space: nowrap;
}

.ship-to__field-input {
  flex: 1;
  min-width: 0;
  padding: 0.375rem 0.5rem;
  font-size: 1rem;
}

.ship-to__error {
  /* aligns under the input: label's fixed width (3.25rem) + the
     .ship-to__field row's own label-input gap (0.375rem) */
  margin-left: calc(3.25rem + 0.375rem);
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--color-red-600);
}

.summary__actions {
  display: flex;
  flex-direction: column;
  margin-top: 1.5rem;
  gap: 0.5rem;
}

.summary__actions-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.summary__actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- send quote modal --- */

.quote-email-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(17 24 39 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

@media (min-width: 640px) {
  .quote-email-modal {
    padding: 2.5rem;
  }
}

.quote-email-modal__panel {
  width: 100%;
  height: 100%;
  background: var(--color-white);
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quote-email-modal__header {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.5rem 0;
}

.quote-email-modal__close {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  font-size: 1.25rem;
  line-height: 1;
  padding-bottom: 0.15em;
}

.quote-email-modal__close:hover {
  background: var(--color-gray-200);
}

.send-quote {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  overflow: auto;
}

@media (min-width: 900px) {
  .send-quote {
    grid-template-columns: minmax(0, 24rem) 1fr;
    overflow: hidden;
  }
}

.send-quote__form {
  padding: 1rem 1.5rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-bottom: 1px solid var(--color-gray-200);
}

@media (min-width: 900px) {
  .send-quote__form {
    border-bottom: none;
    border-right: 1px solid var(--color-gray-200);
  }
}

.send-quote__preview {
  display: none;
  min-height: 20rem;
  background: var(--color-gray-100);
}

@media (min-width: 900px) {
  .send-quote__preview {
    display: block;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

.send-quote__iframe {
  border: none;
  display: block;
  transform-origin: top left;
}

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 0.375rem;
}

.textarea {
  resize: vertical;
  font-family: inherit;
}

/* Height is driven entirely by autoGrowCommentTextarea() in app.js, so the
   manual resize handle (confusing alongside auto-grow) and the internal
   scrollbar (would otherwise flash briefly before each height update) are
   both turned off here. */
.textarea--autogrow {
  resize: none;
  overflow: hidden;
}

.chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: var(--color-white);
  cursor: text;
}

.chip-input:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-brand);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--color-gray-100);
  color: var(--color-gray-800);
  border-radius: 9999px;
  padding: 0.25rem 0.375rem 0.25rem 0.625rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.chip__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  color: var(--color-gray-500);
  font-size: 0.875rem;
  line-height: 1;
}

.chip__remove:hover {
  background: var(--color-gray-200);
  color: var(--color-gray-800);
}

.chip-input__field {
  flex: 1;
  min-width: 8rem;
  border: none;
  background: none;
  padding: 0.25rem 0;
  font-size: 1rem;
}

.chip-input__field:focus {
  outline: none;
}

.email-preview {
  border: 1px solid var(--color-gray-200);
  border-radius: 0.75rem;
  overflow: hidden;
}

.email-preview__row {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
}

.email-preview__label {
  color: var(--color-gray-500);
  min-width: 3rem;
  flex-shrink: 0;
}

.email-preview__value {
  color: var(--color-gray-900);
  word-break: break-word;
}

.email-preview__body {
  padding: 1rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-gray-800);
  background: var(--color-white);
}

.email-preview__body p {
  margin-bottom: 0.5rem;
}

.email-preview__body p:last-child {
  margin-bottom: 0;
}

.email-preview__body a {
  color: var(--color-brand);
  text-decoration: underline;
}

.email-sent-notice {
  font-size: 0.875rem;
  color: var(--color-green-600);
}

/* --- flatpickr (expiration date calendar) on-brand overrides ---
   Loaded after vendor/flatpickr.min.css in index.html, so equal-specificity
   rules here win the cascade over its defaults. Native <input type="date">
   popups are unstyleable browser/OS chrome, which is why this field uses
   flatpickr (see renderExpirationDatePicker() in app.js) instead. */

.flatpickr-calendar {
  font-family: var(--font-sans);
  border-radius: 0.75rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 0;
}

/* .dayContainer/.flatpickr-days have a hard-coded pixel width, and flatpickr
   sizes the whole outer .flatpickr-calendar off of that width — widening
   .dayContainer to make room for padding (an earlier attempt) grew that
   outer width too, which pushed the calendar wide enough to run past the
   visible viewport and look clipped. Adding padding while leaving width/
   min-width/max-width untouched instead keeps the calendar's total
   footprint exactly what flatpickr already computes natively; box-sizing:
   border-box (global reset) makes the padding eat into the day cells'
   available space rather than growing the box, shrinking them by a few
   px instead — a much safer trade than resizing the whole calendar. */
.flatpickr-months {
  padding: 0 0.75rem;
  box-sizing: border-box;
}

.flatpickr-weekdays {
  padding: 0 0.75rem;
  box-sizing: border-box;
}

.dayContainer {
  padding: 0 0.75rem;
  box-sizing: border-box;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
input.cur-year {
  color: var(--color-gray-900);
  font-weight: 600;
}

.flatpickr-monthDropdown-months:hover {
  background: var(--color-gray-100);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: var(--color-gray-500);
  fill: var(--color-gray-500);
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: var(--color-brand);
  fill: var(--color-brand);
}

.flatpickr-weekday {
  color: var(--color-gray-500);
  font-weight: 600;
}

.flatpickr-day {
  color: var(--color-gray-900);
  border-radius: 9999px;
}

.flatpickr-day.nextMonthDay,
.flatpickr-day.prevMonthDay {
  color: var(--color-gray-300);
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: var(--color-gray-100);
  border-color: var(--color-gray-100);
}

.flatpickr-day.today {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-white);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.selected.nextMonthDay {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-white);
  box-shadow: none;
}

.numInputWrapper:hover {
  background: var(--color-gray-100);
}

.numInputWrapper span.arrowUp:after {
  border-bottom-color: var(--color-brand);
}

.numInputWrapper span.arrowDown:after {
  border-top-color: var(--color-brand);
}
