*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top left, #0f172a, #020617 55%);
  color: #e5e7eb;
}

/* Until /api/me returns, hide both shells so the dashboard never flashes on refresh */
body.auth-pending .app-container {
  display: none !important;
}
body.auth-pending #auth-screen {
  display: none !important;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.app-header {
  padding: 2rem 1.5rem 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.app-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
}

.app-header p {
  margin: 0;
  color: #9ca3af;
}

.app-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.app-header-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-user-email {
  font-size: 0.9rem;
  color: #94a3b8;
}

.header-toggle {
  margin-right: 0.25rem;
}

.btn-logout {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Auth screen (login/signup) */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at top left, #0f172a, #020617 55%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.auth-subtitle {
  margin: 0 0 1.5rem;
  color: #94a3b8;
  font-size: 0.95rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: #e5e7eb;
}

.toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.toggle-caption {
  font-size: 0.75rem;
  color: #64748b;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
}

.auth-tab {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-bottom-color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.auth-tab:hover {
  color: #e2e8f0;
}

.auth-tab.active {
  color: #e2e8f0;
  border-bottom-color: #3b82f6;
}

.auth-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

.auth-form button {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.auth-form button:hover {
  background: #2563eb;
}

.auth-btn-primary {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.25rem;
}

.auth-btn-primary:hover {
  background: #2563eb;
}

.auth-btn-secondary {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

.auth-btn-secondary:hover {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.3);
}

.auth-form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.auth-form-actions .auth-btn-primary {
  width: auto;
  flex: 1;
}

.auth-step-label {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.auth-error {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #f87171;
}

.app-main {
  flex: 1;
  width: 100%;
  margin: 0 auto 2rem;
  padding: 0 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

/* Centered form content — wide, intentional, balanced on left/right */
.main-form-wrapper,
.contract-form-container {
  width: min(1500px, calc(100vw - 64px));
  margin: 0 auto;
  padding: 24px 32px 48px;
  max-width: 100%;
}

/* Consistent spacing between major sections */
.form-section {
  margin-bottom: 32px;
}

/* Offers / Important Dates */
.offers-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.offers-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.offers-filter-actions {
  display: flex;
  align-items: flex-end;
  margin-left: auto;
}

.offers-filter-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted, #64748b);
}

.offers-filters input {
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  font-size: 0.9rem;
  min-width: 10rem;
}

.offers-filters input:focus {
  outline: none;
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

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

.offers-filter-client-row input {
  min-width: 10rem;
  flex: 1;
}

.offers-filter-client-select {
  min-width: 12rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg, #0f172a);
  color: inherit;
}

.button-danger {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  cursor: pointer;
}

.button-danger:hover {
  background: rgba(239, 68, 68, 0.35);
}
.button-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(100, 116, 139, 0.2);
  border-color: rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}
.button-danger:disabled:hover {
  background: rgba(100, 116, 139, 0.2);
}

.offers-table-wrapper {
  margin-top: 0;
  overflow-x: auto;
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.offers-table th,
.offers-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  text-align: left;
}

.offer-row-client-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.offer-row-client-link:hover {
  text-decoration: underline;
  color: var(--accent, #3b82f6);
}

.offers-key {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.offer-status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.offer-status-open {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
}
.offer-status-pending {
  background: rgba(234, 179, 8, 0.25);
  color: #fde047;
}
.offer-status-lapsed {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.offer-status-archived {
  background: rgba(100, 116, 139, 0.35);
  color: #94a3b8;
}

.offers-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.offer-preview-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  margin-right: 0.5rem;
}

.offer-preview-btn:hover {
  border-color: #38bdf8;
}

.offer-accepted-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.offer-ready-for-review-toggle {
  margin-top: 0.75rem;
}

/* Offer detail panel below offers table */
.offer-detail-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}
.offer-detail-panel-overlay[hidden] {
  display: none;
}
.offer-detail-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}
.offer-detail-panel-inner {
  margin: auto;
  width: 100%;
  max-width: 72rem;
  padding: 1.25rem 1.5rem 1.5rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.offer-detail-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem 1.25rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
}

.offer-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.offer-detail-header h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
  font-weight: 650;
  color: #e5e7eb;
}

.offer-detail-back {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  color: #e5e7eb;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.offer-detail-back:hover {
  background: rgba(30, 64, 175, 0.35);
}

.offer-detail-delete-btn,
.offer-detail-archive-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  cursor: pointer;
  height: 2.1rem;
  white-space: nowrap;
}

.offer-detail-delete-btn:hover,
.offer-detail-archive-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

.offer-detail-body.offer-detail-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  grid-template-areas:
    "notes summary"
    "status clientdocs"
    "tasks offerdocs";
}

.offer-area-notes { grid-area: notes; }
.offer-area-status { grid-area: status; }
.offer-area-tasks { grid-area: tasks; }
.offer-area-summary { grid-area: summary; }
.offer-area-client-docs { grid-area: clientdocs; }
.offer-area-offer-docs { grid-area: offerdocs; }

.offer-detail-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.offer-detail-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.offer-detail-card-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.2px;
  color: #e2e8f0;
}

.offer-detail-card-subtitle {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.9);
}

.offer-detail-card-actions {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
}

.offer-detail-summary {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(2, 6, 23, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
}

.offer-status-rows {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.offer-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.25);
}

.offer-status-help {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.9);
}

.offer-primary-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  font-size: 0.85rem;
  cursor: pointer;
  height: 2.25rem;
  white-space: nowrap;
}

.offer-primary-btn:hover {
  background: rgba(34, 197, 94, 0.28);
}

.offer-docs-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.offer-docs-controls {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.75rem;
  align-items: end;
}

.offer-docs-field-file { grid-column: 1 / 2; }
.offer-docs-field-label { grid-column: 2 / 3; }
.offer-docs-field-type { grid-column: 1 / 2; }
.offer-docs-actions {
  grid-column: 2 / 3;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.offer-docs-download-all-btn {
  margin-left: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  cursor: pointer;
  white-space: nowrap;
  height: 2.25rem;
}

.offer-docs-download-all-btn:hover {
  background: rgba(30, 64, 175, 0.6);
  border-color: rgba(129, 140, 248, 0.9);
}

.offer-docs-upload-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.offer-docs-upload-label input[type="file"] {
  font-size: 0.8rem;
}

.offer-docs-label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.1rem;
}

.offer-docs-upload-row input[type="text"],
.offer-docs-upload-row select {
  min-width: 10rem;
  font-size: 0.85rem;
}

.offer-docs-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.offer-docs-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.82rem;
}

.offer-docs-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.offer-docs-list-label {
  font-weight: 500;
}

.offer-docs-list-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}

.offer-docs-list-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  justify-content: flex-start;
  margin-top: 0.15rem;
}

.offer-docs-download-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: #e5e7eb;
}

.offer-docs-download-btn:hover {
  border-color: #38bdf8;
}

.offer-docs-delete-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.73rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
}

.offer-docs-delete-btn:hover {
  background: rgba(248, 113, 113, 0.3);
}

.offer-tasks-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.offer-task-controls {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0.75rem;
  align-items: end;
}

.offer-task-field-title { grid-column: 1 / 2; }
.offer-task-field-date { grid-column: 2 / 3; }
.offer-task-field-time { grid-column: 1 / 2; }

.offer-task-controls #offerTaskAddBtn {
  grid-column: 2 / 3;
  justify-self: start;
}

.offer-task-field input[type="text"],
.offer-task-field input[type="date"],
.offer-task-field input[type="time"] {
  width: 100%;
  min-width: 0;
}

.offer-tasks-add-row input[type="text"],
.offer-tasks-add-row input[type="date"],
.offer-tasks-add-row input[type="time"] {
  min-width: 9rem;
  font-size: 0.85rem;
}

.offer-tasks-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.offer-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.25);
  font-size: 0.82rem;
}

.offer-task-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.offer-task-title {
  font-weight: 500;
}

.offer-task-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}

.offer-task-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.offer-task-completed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.offer-task-delete-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.73rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
}

.offer-task-delete-btn:hover {
  background: rgba(248, 113, 113, 0.3);
}

@media (max-width: 768px) {
  .offer-detail-panel-inner {
    max-width: 44rem;
    padding: 1rem 1rem 1.25rem;
  }

  .offer-detail-body.offer-detail-dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "summary"
      "notes"
      "status"
      "clientdocs"
      "tasks"
      "offerdocs";
  }

  .offer-docs-controls {
    grid-template-columns: 1fr;
  }

  .offer-docs-field-file,
  .offer-docs-field-label,
  .offer-docs-field-type,
  .offer-docs-actions {
    grid-column: 1 / -1;
  }

  .offer-docs-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .offer-task-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .offer-docs-controls {
    grid-template-columns: 1fr;
  }

  .offer-docs-field-file,
  .offer-docs-field-label,
  .offer-docs-field-type,
  .offer-docs-actions {
    grid-column: 1 / -1;
  }

  .offer-docs-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
}

/* Important Dates calendar — polished dark theme */
.important-dates-calendar-wrap {
  margin-bottom: 2rem;
}
.important-dates-view-switcher {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.important-dates-view-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.important-dates-view-btn:hover {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.3);
}
.important-dates-view-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.55) 0%, rgba(30, 64, 175, 0.5) 100%);
  border-color: rgba(96, 165, 250, 0.9);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}
.important-dates-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}
.important-dates-calendar-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f1f5f9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.important-dates-calendar-nav {
  padding: 0.5rem 0.85rem;
  font-size: 1.25rem;
  line-height: 1;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.9) 0%, rgba(30, 41, 59, 0.95) 100%);
  color: #e2e8f0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.important-dates-calendar-nav:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.35) 0%, rgba(30, 64, 175, 0.4) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.important-dates-calendar-nav:active {
  transform: scale(0.97);
}
.important-dates-calendar {
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 1.25rem;
  overflow-x: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
}
.important-dates-calendar-grid {
  width: 100%;
  max-width: 84rem; /* 7 × 12rem on large screens */
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.9rem;
}
.important-dates-calendar-grid th {
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 14.28%;
}
.important-dates-calendar-grid td {
  vertical-align: top;
  padding: 0.5rem;
  border-radius: 10px;
  width: 14.28%; /* 1/7 – columns scale proportionally */
  min-width: 0;
  height: 7rem;
  max-height: 7rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}
.important-dates-calendar-day:not(.empty) {
  cursor: pointer;
}
.important-dates-calendar-day:hover:not(.empty) {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.15);
}
.important-dates-calendar-day.empty {
  background: rgba(0, 0, 0, 0.2);
  border-color: transparent;
}
.important-dates-calendar-day.weekend:not(.empty) {
  background: rgba(15, 23, 42, 0.55);
}
.important-dates-calendar-day.is-today {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(30, 64, 175, 0.2) 100%);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.important-dates-calendar-day.is-today .important-dates-day-num {
  color: #93c5fd;
  font-weight: 800;
}
.important-dates-calendar-day .important-dates-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.important-dates-calendar-day.has-events .important-dates-day-num {
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.2);
}
.important-dates-calendar-day.is-selected {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(30, 64, 175, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.important-dates-day-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #e2e8f0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.5) 0%, rgba(30, 64, 175, 0.45) 100%);
  border-radius: 8px;
  margin-left: 0.25rem;
  vertical-align: middle;
}
/* In-cell event pills (blue bar + text; text clips in fixed-size cell) */
.important-dates-day-events {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #e2e8f0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.important-dates-day-events li {
  margin-bottom: 0.2rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(30, 64, 175, 0.3) 100%);
  border-left: 3px solid rgba(96, 165, 250, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.important-dates-day-events li:last-child {
  margin-bottom: 0;
}
.important-dates-event-pill[data-offer-id],
.important-dates-day-detail-event[data-offer-id],
.important-dates-list-event[data-offer-id] {
  cursor: pointer;
}
.important-dates-event-pill[data-offer-id]:hover,
.important-dates-day-detail-event[data-offer-id]:hover,
.important-dates-list-event[data-offer-id]:hover {
  filter: brightness(1.1);
}
/* Day detail panel (below calendar when a day is clicked) */
.important-dates-day-detail {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.important-dates-day-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}
.important-dates-day-detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e2e8f0;
}
.important-dates-day-detail-list li {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  background: rgba(30, 41, 59, 0.5);
  border-left: 3px solid rgba(96, 165, 250, 0.8);
}
.important-dates-day-detail-list li:last-child {
  margin-bottom: 0;
}
.important-dates-day-detail-list li.important-dates-day-detail-empty {
  color: #94a3b8;
  font-style: italic;
  border-left-color: transparent;
  background: transparent;
}
/* Weekly view: single row of 7 days */
.important-dates-calendar-weekly tbody tr td {
  width: 14.28%;
}
/* Daily view: single day event list */
.important-dates-daily-view {
  padding: 1rem 0;
}
.important-dates-daily-empty {
  margin: 0;
  color: #94a3b8;
  font-style: italic;
}
.important-dates-daily-events {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #e2e8f0;
}
.important-dates-daily-events li {
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.5);
  border-left: 4px solid rgba(96, 165, 250, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.important-dates-daily-events li:last-child {
  margin-bottom: 0;
}
.important-dates-list-heading {
  margin: 1.5rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}
.important-dates-list-summary {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #94a3b8;
}
.important-date-group {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.6);
}

.important-date-group h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: #e5e7eb;
}
.important-date-group-count {
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.85em;
}

.important-date-group ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}

/* Duplicate provision name (contract form) */
.duplicate-provision-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
}

.duplicate-provision-modal[hidden] {
  display: none;
}

.duplicate-provision-modal:not([hidden]) {
  display: block;
}

.duplicate-provision-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(5px);
}

.duplicate-provision-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(480px, 92vw);
  width: 100%;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.duplicate-provision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.95);
}

.duplicate-provision-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e7eb;
}

.duplicate-provision-body {
  padding: 0.9rem 1rem 1.1rem;
  color: #e5e7eb;
}

.duplicate-provision-message {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.duplicate-provision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.duplicate-provision-name-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.duplicate-provision-name-row[hidden] {
  display: none !important;
}

/* Offer preview modal */
.offer-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.offer-preview-modal[hidden] {
  display: none;
}

.offer-preview-modal:not([hidden]) {
  display: block;
}

.offer-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
}

.offer-preview-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(900px, 90vw);
  max-height: min(650px, 80vh);
  width: 100%;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.offer-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top, rgba(30, 64, 175, 0.4), rgba(15, 23, 42, 0.95));
}

.offer-preview-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.offer-preview-close {
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 1.2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.offer-preview-close:hover {
  background: rgba(148, 163, 184, 0.2);
}

.offer-preview-body {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #e5e7eb;
  white-space: pre-wrap;
  overflow: auto;
}

@media (max-width: 640px) {
  .offer-preview-dialog {
    max-width: 100vw;
    max-height: 85vh;
    border-radius: 0;
  }
}

/* Reusable two-column row for paired cards — large gap */
.two-column-row,
.form-row-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 72px;
  row-gap: 24px;
  align-items: start;
  margin-bottom: 36px;
}

/* Financing Terms + Contingencies: dedicated side-by-side row, even columns, large gap */
.financing-and-contingencies-row.financing-contingencies-row,
.financing-contingencies-row {
  display: grid;
  /* Financing Terms slightly wider, Contingencies still substantial */
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.1fr);
  column-gap: 64px;
  row-gap: 0;
  align-items: start;
  width: 100%;
  grid-column: 1 / -1;
}

.financing-terms-card,
.contingencies-card {
  width: 100%;
  min-width: 0;
}

/* Desktop: WB-11 Contingencies layout — make card itself narrower and bring wheels closer to toggles */
@media (min-width: 1201px) {
  .wb11-contingencies-card {
    width: 55%;          /* shrink card to a bit over half the column */
    max-width: 55%;
    margin-left: 0;
    margin-right: auto;  /* keep aligned with left column content */
  }

  .wb11-contingencies-card .contingencies-table {
    grid-template-columns: minmax(0, 1fr) 4.5rem; /* narrower days column */
    column-gap: 1.5rem;
  }

  .wb11-contingencies-card .contingencies-header {
    grid-template-columns: minmax(0, 1fr) 4.5rem;
    column-gap: 1.5rem;
  }
}

/* Stack two-column layouts so cards are one-after-the-other on tablet and mobile */
@media (max-width: 1200px) {
  /* Items Included + Items Not Included: same stacking as Financing + WB-11 */
  .items-row.inclusions-exclusions-row,
  .items-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px;
    margin-bottom: 24px;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }

  .items-row .items-included-card,
  .items-row .items-not-included-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    flex: 0 0 auto;
  }

  .financing-and-contingencies-row.financing-contingencies-row,
  .financing-contingencies-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 1100px) {
  .two-column-row,
  .form-row-dual {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 24px;
  }

  .items-row.inclusions-exclusions-row,
  .items-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }

  .items-row .items-included-card,
  .items-row .items-not-included-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    flex: 0 0 auto;
  }

  .financing-contingencies-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Stack side-by-side sections on tablet and mobile to prevent overlap/truncation */
@media (max-width: 768px) {
  /* All scroll wheel boxes: exact same size as purchase price thousands/hundreds */
  .price-wheel-group,
  .purchase-price-card .price-wheel-group,
  .buyer-funds-card .price-wheel-group,
  .dates-card .price-wheel-group,
  .loan-basics-card .price-wheel-group,
  .loan-basics-field .price-wheel-group,
  .financing-terms-card .price-wheel-group,
  .contingencies-card .price-wheel-group,
  .earnest-money-wheel .price-wheel-group,
  .earnest-days-wheel .price-wheel-group,
  .closing-credits-wheel-wrap .price-wheel-group,
  .price-wheel-with-tuner .price-wheel-group {
    min-height: 52px;
    height: 52px;
    padding: 16px 12px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  /* Stack Buyer Funds and Dates so each wheel gets full width like Purchase Price */
  .buyer-funds-grid,
  .dates-grid {
    grid-template-columns: 1fr;
  }

  .purchase-price-card .purchase-price-controls {
    grid-template-columns: 1fr;
  }

  .two-column-row,
  .form-row-dual {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 20px;
  }

  .financing-contingencies-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Items Included + Items Not Included: stack one-after-the-other like Financing Terms + WB-11 */
  .items-row.inclusions-exclusions-row,
  .items-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px;
    margin-bottom: 24px;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }

  .items-row .items-included-card,
  .items-row .items-not-included-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    flex: 0 0 auto;
    overflow: visible;
  }

  .items-included-card .section-header,
  .items-not-included-card .section-header {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Prevent horizontal scroll from any remaining wide content */
  .contract-form-container,
  .main-form-wrapper {
    overflow-x: hidden;
  }

  .main-form-wrapper,
  .contract-form-container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: 16px;
    padding-bottom: 32px;
  }

  .form-actions-top {
    margin-bottom: 0.75rem;
  }

  .form-actions-top .btn-reset {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 1rem;
  }

  .contingencies-table {
    grid-template-columns: minmax(0, 1fr) minmax(4rem, 5rem);
    column-gap: 1rem;
    min-width: 0;
  }

  .contingencies-header {
    grid-template-columns: minmax(0, 1fr) minmax(4rem, 5rem);
    column-gap: 1rem;
  }

  .contingencies-col-type {
    min-width: 0;
  }

  .contingencies-col-days {
    min-width: 4rem;
  }

  /* Contingency wheels: fine-grained vertical offsets on mobile for each row */
  #contingencyRadonDaysCell {
    margin-top: 40px; /* down ~1/8\" from current baseline */
  }

  #contingencyWellInspectionDaysCell {
    margin-top: 52px; /* down ~1/4\" more */
  }

  #contingencySepticInspectionDaysCell {
    margin-top: 52px; /* down ~1/4\" more */
  }

  #contingencyWellWaterTestingDaysCell {
    margin-top: 64px; /* down ~3/8\" more */
  }

  #contingencyBuyerPropertyDaysCell {
    margin-top: 76px; /* down ~1/2\" more */
  }

  #secondaryOfferWithdrawalCell {
    margin-top: 52px; /* down ~1/4\" more */
  }

  .items-included-card,
  .items-not-included-card {
    padding: 1.25rem 1rem;
  }

  .items-not-included-card {
    margin-top: 0.5rem;
  }

  .items-not-included-card label.wide {
    min-width: 0;
  }

  .exclusions-note {
    display: block;
    word-break: break-word;
  }

  .appliance-checklist {
    padding: 0.75rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* Two-column header: Items (left), QTY (right) — override base flex so columns stay separate */
  .appliance-checklist-header {
    display: grid !important;
    grid-template-columns: 1fr 5rem;
    align-items: center;
    gap: 0 1rem;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0.25rem;
    min-width: 0;
    width: 100%;
  }

  .appliance-header-items {
    padding-left: 0 !important;
    justify-self: start;
    min-width: 0;
    grid-column: 1;
  }

  .appliance-header-qty {
    justify-self: end;
    text-align: right;
    grid-column: 2;
    min-width: 5rem;
  }

  /* Two-column rows: item + toggle (left), quantity wheel (right); no per-row "Qty" label */
  .appliance-item {
    display: grid;
    grid-template-columns: 1fr 5rem;
    grid-template-rows: auto;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    min-width: 0;
  }

  .appliance-item:last-child {
    border-bottom: none;
  }

  .appliance-item .checkbox-label {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .appliance-item .appliance-qty-wrap {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    width: 5rem;
    max-width: 5rem;
    margin-top: 0.25in; /* slightly shallower drop (~30% less) */
  }

  .appliance-item .appliance-qty-wrap .appliance-qty-label {
    display: none;
  }

  .appliance-item select {
    min-width: 0;
    width: 100%;
    max-width: 5rem;
    min-height: 44px;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  .deal-card {
    padding: 1.25rem 1rem;
  }

  .dates-card .closing-date-type-switch .down-payment-switch-option {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }

  input[type="date"] {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .bump-clause-other-textarea {
    width: 100%;
    max-width: 100%;
  }

  /* Horizontal tuner bar under each wheel (radio-tuner style) */
  .wheel-tuner-bar {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
  }

  .wheel-tuner-track {
    position: relative;
    width: 100%;
    height: 28px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 14px;
    cursor: ew-resize;
    touch-action: none;
  }

  .wheel-tuner-thumb {
    position: absolute;
    top: 2px;
    width: 24px;
    height: 22px;
    left: calc(50% - 12px); /* centered by default */
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
  }

  .financing-grid,
  .adjustable-details-grid {
    grid-template-columns: 1fr;
  }

  .loan-basics-grid {
    gap: 14px;
  }

  /* Down Payment: stack amount and $ Amount / % toggle one after the other */
  .loan-basics-field .down-payment-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .loan-basics-field .down-payment-toggle {
    width: 100%;
    justify-content: stretch;
  }

  .loan-basics-field .down-payment-toggle .down-payment-switch-option {
    flex: 1;
  }

  /* Closing prorations base: allow wrapping text below, input itself is narrower in WB-11 card override */
  .closing-prorations-group select,
  .closing-prorations-group input[type="text"] {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .closing-prorations-display {
    max-width: 100%;
    min-width: 0;
  }

  /* Contingency headers: allow wrap so "DAYS AFTER ACCEPTANCE" etc. don’t truncate */
  .contingencies-header {
    font-size: 0.65rem;
    word-break: break-word;
  }

  .contingencies-col-days {
    white-space: normal;
    min-width: 0;
    text-align: left;
  }

  .contingencies-disclosure {
    min-width: 0;
    word-break: break-word;
  }
}

.card,
.form-card,
.section-card,
.panel-card {
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.12), rgba(15, 23, 42, 0.9));
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(18px);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
}

.help-text {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

.prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: stretch;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background-color: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-family: inherit;
  font-size: 0.95rem;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

button {
  border-radius: 999px;
  border: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.08s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

#startVoice {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}

#startVoice:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.5);
}

#stopVoice {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fef2f2;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

form button[type='submit'] {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.45);
  padding-inline: 1.6rem;
}

form button[type='submit']:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(34, 197, 94, 0.55);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem 1rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.86rem;
  color: #d1d5db;
  gap: 0.25rem;
}

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

.office-setting-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row;
}

.office-setting-toggle-text {
  font-size: 0.9rem;
}

.office-setting-help {
  margin-top: 0.25rem;
}

/* Single row: Agent type, Buyer name, Offer date */
.form-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.9rem 1rem;
  align-items: end;
}

.form-row-two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.form-row label {
  display: flex;
  flex-direction: column;
  font-size: 0.86rem;
  color: #d1d5db;
  gap: 0.25rem;
}

@media (max-width: 640px) {
  .form-row-two {
    grid-template-columns: 1fr;
  }

  /* Items Included / Not Included: force stack on small mobile */
  .items-row.inclusions-exclusions-row,
  .items-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }
  .items-row .items-included-card,
  .items-row .items-not-included-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }
}

.section-header {
  grid-column: 1 / -1;
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
  color: #22c55e;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.5rem;
}

.section-header:first-child {
  margin-top: 0;
}

input,
select {
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  background-color: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

/* Date inputs: keep native calendar picker visible and easy to click */
input[type="date"] {
  min-width: 10rem;
  min-height: 2.5rem;
  cursor: pointer;
  padding-right: 0.5rem;
}

label small {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* Items Included + Items Not Included — side-by-side only on desktop */
@media (min-width: 1201px) {
  .items-row.inclusions-exclusions-row,
  .items-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: 72px;
    align-items: start;
    width: 100%;
    grid-column: 1 / -1;
    margin-bottom: 36px;
  }
}

/* Below desktop: stack vertically (no grid; flex column from max-width rules) */
.items-row.inclusions-exclusions-row,
.items-row {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.items-included-card,
.items-not-included-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 28px 32px;
  border-radius: 18px;
  align-self: start;
  box-sizing: border-box;
}

.items-included-card .appliance-checklist,
.items-included-card .appliance-checklist-header,
.items-included-card .appliance-item {
  max-width: 100%;
}

.inclusions-column,
.exclusions-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.appliance-checklist {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.appliance-checklist-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.appliance-header-items {
  flex: 1;
  padding-left: 8.375rem; /* 8.625rem minus 1 notch (0.25rem) */
}

.appliance-header-qty {
  min-width: 4rem;
  text-align: center;
}

.appliance-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.appliance-toggle-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.appliance-toggle-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.appliance-toggle-label .toggle-track {
  flex-shrink: 0;
}

.appliance-toggle-title {
  font-size: 0.9rem;
  color: #e5e7eb;
}

/* ---------- Purchase Details: three cards (Purchase Price, Buyer Funds, Dates) ---------- */
.purchase-details-section-title {
  grid-column: 1 / -1;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.purchase-details-cards {
  grid-column: 1 / -1;
}


.deal-card {
  padding: 28px 32px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 20, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.deal-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.deal-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  cursor: default;
}

.deal-field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
  opacity: 0.9;
  margin-bottom: 8px;
}

.deal-field-helper {
  font-size: 12px;
  color: #94a3b8;
  opacity: 0.7;
  margin-top: 6px;
}

/* Card 1: Purchase Price — two equal-width controls + summary row */
.purchase-price-card .purchase-price-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.purchase-price-card .price-wheel-group {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 16px 12px;
}

.purchase-price-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.purchase-price-summary-label {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

.purchase-price-summary-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #22c55e;
}

/* Card 2: Buyer Funds — 2-col grid, closing credits full width */
.buyer-funds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.buyer-funds-card .closing-credits-field {
  grid-column: 1 / -1;
}

.buyer-funds-card .earnest-money-wheel,
.buyer-funds-card .earnest-days-wheel {
  width: 100%;
}

.buyer-funds-card .price-wheel-group {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 14px 12px;
}

.buyer-funds-card .closing-credits-wheel-wrap {
  margin-top: 0;
}

/* Card 3: Dates and Deadlines — 2-col grid, consistent heights */
.escalation-toggle-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.escalation-toggle-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.escalation-toggle-text {
  font-weight: 500;
}

.escalation-wheels-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.escalation-increment-field {
  margin-bottom: 1rem;
}

.escalation-max-price-row {
  margin-bottom: 1rem;
}

.escalation-max-price-row:last-child {
  margin-bottom: 0;
}

.escalation-wheel-label {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.escalation-max-controls {
  margin-bottom: 0.5rem;
}

.escalation-max-summary .purchase-price-summary-value {
  font-size: 1rem;
}

.escalation-wording-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.escalation-wording-label-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
}
.escalation-wording-label select {
  max-width: 20rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  background: var(--input-bg, #1e293b);
  color: var(--input-color, #e2e8f0);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
}

.provision-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.provision-type-escalation {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.provision-type-waiver {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.escalation-provision-readout {
  margin-top: 1rem;
  padding: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  white-space: pre-wrap;
  word-break: break-word;
}

.escalation-provision-readout:empty {
  display: none;
}

/* Office documents library (Office Info tab) */
.office-docs-card {
  margin-top: 1.5rem;
}

.office-docs-card .help-text {
  margin: 0 0 1rem;
}

.office-docs-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.office-docs-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.office-docs-preset {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.office-docs-preset-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  cursor: pointer;
}

.office-docs-preset-btn:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

.office-docs-preset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(148, 163, 184, 0.08);
  color: #64748b;
}

.office-docs-preset-btn:disabled:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #64748b;
}

.office-docs-add label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}

.office-docs-label {
  font-size: 0.9rem;
  color: #94a3b8;
}

.office-docs-add input[type="text"] {
  width: 220px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.5);
  color: #e5e7eb;
}

.office-docs-file-label input[type="file"] {
  font-size: 0.9rem;
  color: #94a3b8;
}

.office-docs-add #addOfficeDocBtn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 6px;
  cursor: pointer;
}

.office-docs-add #addOfficeDocBtn:hover {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.6);
}

.office-docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.office-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.office-doc-name {
  font-size: 0.95rem;
  color: #e5e7eb;
  min-width: 0;
  word-break: break-word;
}

.office-doc-every-offer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
}

.office-doc-every-offer input {
  margin: 0;
}

.office-doc-delete {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 4px;
  cursor: pointer;
}

.office-doc-delete:hover {
  background: rgba(248, 113, 113, 0.35);
  border-color: rgba(248, 113, 113, 0.6);
}

.dates-card {
  grid-column: 1 / -1;
  margin-bottom: 32px;
}

.dates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.dates-card .deal-field-label {
  margin-bottom: 8px;
}

.dates-card input[type="date"] {
  height: 44px;
  padding: 0 14px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  min-height: 44px;
  box-sizing: border-box;
}

.dates-card .binding-acceptance-days-wheel,
.dates-card .binding-acceptance-time-wheel {
  display: flex;
}

.dates-card .price-wheel-group {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 0 14px;
}

.dates-card .price-wheel-value {
  font-size: 16px;
}

.closing-date-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.closing-date-type-switch {
  display: flex;
  gap: 0.25rem;
}
.closing-date-days-mode .help-text.closing-date-days-explanation {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: #94a3b8;
  max-width: 480px;
}
.closing-date-days-wheel-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.closing-date-days-wheel-wrap .deal-field-label-inline {
  font-size: 0.9rem;
  color: #e5e7eb;
}
.closing-date-days-wheel-wrap .price-wheel-group {
  min-width: 120px;
}

/* Align Property Condition Date input with Closing Date input (same row, same height) */
.dates-row-date-field {
  align-items: stretch;
}
.dates-field-spacer {
  display: block;
  min-height: 40px;
  flex-shrink: 0;
}
.dates-card .closing-date-type-switch {
  min-height: 40px;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .purchase-details-cards {
    grid-template-columns: 1fr;
  }

  .buyer-funds-grid,
  .dates-grid {
    grid-template-columns: 1fr;
  }
}

.price-wheel-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.9);
  cursor: default;
  outline: none;
  min-width: 4.5rem;
  touch-action: pan-y; /* allow vertical scroll while preventing accidental zoom on wheel */
}

.price-wheel-group:hover {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(51, 65, 85, 0.5);
}

.price-wheel-group:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Wrapper for wheel + optional tuner bar (mobile) */
.price-wheel-with-tuner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.wheel-tuner-bar {
  display: none; /* shown only on mobile */
}

.price-wheel-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.price-wheel-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e5e7eb;
}

.price-wheels-comma,
.price-total-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: #94a3b8;
}

.price-total-display {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e5e7eb;
  margin-left: 0.25rem;
}

.earnest-money-wheel {
  display: inline-flex;
}

.earnest-money-wheel .earnest-wheel .price-wheel-value {
  font-size: 1.1rem;
}

.earnest-days-wheel {
  display: inline-flex;
}

.earnest-days-wheel .earnest-days-wheel-box .price-wheel-value {
  font-size: 1rem;
  min-width: 5rem;
}

.binding-acceptance-days-wheel {
  display: inline-flex;
}

.binding-acceptance-days-wheel .price-wheel-value {
  font-size: 1rem;
  min-width: 3rem;
}

.binding-acceptance-time-wheel {
  display: inline-flex;
}

.binding-acceptance-time-wheel .price-wheel-value {
  font-size: 1rem;
  min-width: 4.5rem;
}

.down-payment-switch {
  display: inline-flex;
  margin-top: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
  padding: 3px;
  gap: 0;
}

.down-payment-switch-option {
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.down-payment-switch-option:hover {
  color: #e2e8f0;
}

.down-payment-switch-option.active {
  background: rgba(99, 102, 241, 0.5);
  color: #e2e8f0;
}

.down-payment-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ---------- Financing Terms + Contingencies row (uses .two-column-row + .financing-contingencies-row above) ---------- */
.financing-and-contingencies-row {
  margin-top: 0;
}

.contingencies-card {
  padding: 28px 32px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.wb11-additional-provisions-card {
  margin-top: 1.5rem;
}

.wb11-popup-field {
  margin-top: 0.35rem;
  width: 100%;
}

.wb11-inline-text {
  margin-top: 0;
  width: 100%;
}

/* Contingencies heading matches Financing Terms: green + two lines (section-header + financing-divider) */
.contingencies-heading {
  margin-bottom: 0.25rem;
}
.contingencies-card .financing-divider {
  margin-bottom: 0.75rem;
}

/* Internal card spacing — labels and fields */
.form-group {
  margin-bottom: 18px;
}

.card-content,
.field-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

/* Contingencies table: Type | Days header, then rows with toggle+label and days wheel */
.contingencies-table {
  display: grid;
  grid-template-columns: 1fr 6rem;
  gap: 0 1.5rem;
  align-items: center;
  column-gap: 2rem;
  min-width: 0;
}

/* In the bump-clause options card, stack rows in a single column (no days column) */
.bump-clause-options-table {
  grid-template-columns: 1fr;
}

/* Bump clause "Other Proof" row: block under toggle; respect [hidden] */
.contingencies-row.bump-clause-other-row {
  display: block;
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 0.5rem;
}
.contingencies-row.bump-clause-other-row[hidden] {
  display: none !important;
}
.bump-clause-other-textarea {
  display: block;
  width: 75%;
  max-width: 75%;
  box-sizing: border-box;
  min-height: 9rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  font-size: 0.9rem;
  resize: vertical;
}
.bump-clause-other-textarea::placeholder {
  color: #94a3b8;
}

.contingencies-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 6rem;
  gap: 0 1.5rem;
  column-gap: 2rem;
  align-items: center;
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.contingencies-col-type { padding-left: 0.15rem; }
.contingencies-col-days { min-width: 4rem; text-align: center; }

/* Subsection: Well / Septic / Well water — all use "Days from closing" */
.contingencies-days-from-closing-section .contingencies-header {
  margin-top: 0;
}

.contingencies-disclosure {
  grid-column: 1 / -1;
  margin: 0 0 0.5rem 0;
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: normal;
}

.wb11-additional-provisions-card .contingencies-table {
  grid-template-columns: 1fr;
}

.wb11-additional-provisions-card .contingencies-header {
  grid-template-columns: 1fr;
}

.wb11-additional-provisions-card .contingencies-col-days {
  display: none;
}

.wb11-addenda-group-header {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #22c55e;
}

.wb11-addenda-group {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wb11-addenda-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wb11-addenda-other {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wb11-addenda-summary {
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  min-height: 1.5em;
}

.wb11-addenda-summary-label {
  color: #94a3b8;
  font-weight: 500;
}

.contingencies-row {
  display: contents;
}

/* Respect [hidden] on individual contingency rows that are conditionally shown */
.contingencies-row[hidden] {
  display: none !important;
}

/* Override for bump-clause other row: render as a full-width block under the toggles */
.contingencies-row.bump-clause-other-row {
  display: block;
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 0.5rem;
}

/* Full-width contingency rows (text inputs / sub-options) so they don't break the Type | Days grid */
.contingencies-row-full {
  display: block;
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 0.35rem;
  margin-bottom: 0.15rem;
}

/* Sub-options under a contingency (well type, well capacity yield, additional substances) — indent slightly */
.contingencies-row-sub .contingency-type-cell,
.contingencies-row-sub.contingencies-row-full {
  padding-left: 1.25rem;
  border-left: 2px solid rgba(148, 163, 184, 0.2);
  margin-left: 0.25rem;
}

/* Request well capacity yield row: slight extra indent (moved back ~65% from full half-inch) */
#wellCapacityYieldRow .contingency-type-cell {
  padding-left: calc(1.25rem + 0.175in);
}

.contingencies-row-full label {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.contingencies-row-full .contingency-fullwidth-input {
  width: 100%;
  max-width: 28rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  background: var(--input-bg, #1e293b);
  color: var(--input-color, #e2e8f0);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 4px;
  box-sizing: border-box;
}

.contingencies-row .contingency-type-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: #d1d5db;
  cursor: default;
  min-width: 0;
}

.contingency-subtext {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
}

.contingency-type-label-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  cursor: pointer;
}

.contingencies-row .contingency-type-cell .toggle-track {
  flex-shrink: 0;
}

.contingencies-row .contingency-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contingencies-row .contingency-days-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.35rem 0;
  margin-top: 22px; /* Fine-tuned downward nudge for better vertical alignment */
  min-width: 0;
}

.contingency-days-from-closing-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-right: 0.5rem;
  white-space: nowrap;
}

.well-inspection-block .contingency-days-cell,
.well-water-testing-block .contingency-days-cell {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  margin-top: 22px;
  min-width: 5rem;
}

.well-inspection-block .contingency-days-from-closing-label,
.well-water-testing-block .contingency-days-from-closing-label {
  margin-right: 0;
}

/* Empty days cell for rows that only have a toggle (e.g. Request well capacity yield) keeps grid aligned */
.contingency-days-cell[aria-hidden="true"]:empty {
  min-width: 0;
}

.closing-prorations-cell {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.closing-prorations-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0.35rem;
  width: 100%;
}

.closing-prorations-group select,
.closing-prorations-group input[type="text"] {
  width: auto;
  min-width: 32rem;
  max-width: 36rem;
}

.closing-prorations-display {
  max-width: 70ch;
  font-size: 0.875rem;
  color: #d1d5db;
  line-height: 1.4;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.lease-type-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.lease-type-option {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}

.lease-type-option.active {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.9);
  color: #a7f3d0;
}

.lease-type-toggle.is-disabled .lease-type-option {
  opacity: 0.4;
  cursor: default;
}

.contingency-days-wheel.price-wheel-group {
  min-width: 3.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.contingency-days-wheel .price-wheel-value {
  font-variant-numeric: tabular-nums;
}

.contingency-static-quantity {
  font-size: 0.9rem;
  color: #cbd5f5;
}

.contingencies-hours-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1.5rem;
  column-gap: 2rem;
  align-items: center;
}

.contingencies-hours-section .contingencies-header {
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
}

.inspection-additional-card {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.inspection-additional-card .wide {
  margin-top: 0.5rem;
}

/* ---------- Financing Terms (Stripe/Notion-style) ---------- */
.financing-terms {
  margin-top: 0;
  min-width: 0;
}

.financing-terms .financing-terms-title {
  margin-bottom: 0.25rem;
}

.financing-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.25), transparent);
  margin: 0 0 1.5rem 0;
}

.financing-subsection {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

/* Card style shared with Adjustable Rate Details */
.financing-card {
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.4);
}

/* Loan Basics — matches Rate Structure / Adjustable Rate Details (no box, no background) */
.loan-basics-card {
  padding: 0;
  margin-bottom: 1.5rem;
  background: transparent;
  border: none;
  border-radius: 0;
}

.loan-basics-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.loan-basics-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.loan-basics-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.loan-basics-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #e5e7eb;
  opacity: 0.85;
  line-height: 1.3;
}

.loan-basics-field input,
.loan-basics-field select {
  width: 100%;
  min-width: 0;
  height: 35px;
  padding: 0 11px;
  box-sizing: border-box;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

.loan-basics-field input::placeholder {
  opacity: 0.5;
}

.loan-basics-helper {
  font-size: 12px;
  color: #9ca3af;
  opacity: 0.6;
  margin-top: 2px;
}

.loan-basics-field .down-payment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.loan-basics-field .down-payment-wheel {
  flex: 1;
  min-width: 0;
  height: 35px;
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  cursor: default;
}

.loan-basics-field .down-payment-wheel .price-wheel-value {
  font-size: 14px;
  font-weight: 600;
}

.loan-basics-field .loan-term-wheel,
.loan-basics-field .amortization-wheel,
.loan-basics-field .interest-rate-wheel {
  width: 100%;
  min-width: 0;
  height: 35px;
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  cursor: default;
}

.loan-basics-field .loan-term-wheel .price-wheel-value,
.loan-basics-field .amortization-wheel .price-wheel-value,
.loan-basics-field .interest-rate-wheel .price-wheel-value {
  font-size: 14px;
  font-weight: 600;
}

.loan-basics-card .down-payment-toggle {
  height: 35px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-sizing: border-box;
}

.loan-basics-card .down-payment-toggle .rate-type-segmented-option {
  height: 100%;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loan-basics-estimated-value {
  font-size: 15px;
  font-weight: 600;
  color: #22c55e;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  min-height: 35px;
  display: inline-flex;
  align-items: center;
}

.financing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.financing-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #d1d5db;
  min-width: 0;
  width: 100%;
}

.financing-label {
  display: block;
  min-height: 1.25rem;
  line-height: 1.25;
  margin-bottom: 0.125rem;
}

.financing-field input,
.financing-field select {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  min-height: 2.5rem;
  box-sizing: border-box;
}

.financing-field-full {
  grid-column: 1 / -1;
}

.rate-structure-row {
  margin-bottom: 1.5rem;
}

.rate-type-segmented {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.5rem;
  padding: 3px;
  gap: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.rate-type-segmented .rate-type-segmented-option {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.rate-type-segmented .rate-type-segmented-option:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.08);
}

.rate-type-segmented .rate-type-segmented-option.active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Adjustable Rate Details — collapsible card with smooth animation */
.adjustable-details-card {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  padding: 0 0 0 0;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.4);
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease, border-color 0.25s ease;
}

.adjustable-details-card.is-open {
  max-height: 520px;
  opacity: 1;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem 1.25rem;
  border-color: rgba(148, 163, 184, 0.2);
}

.adjustable-details-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 0 0 0.75rem 0;
}

.adjustable-details-grid {
  margin-bottom: 0;
}

.adjustable-details-grid .financing-field input {
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  border-radius: 0.5rem;
  width: 100%;
}

.adjustable-details-grid .financing-field .adjustable-wheel {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  cursor: default;
}

.adjustable-details-grid .financing-field .adjustable-wheel .price-wheel-value {
  font-size: 0.875rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .financing-grid {
    grid-template-columns: 1fr;
  }
}

.exclusions-note {
  display: block;
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
}

.municipality-type-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.municipality-type-label {
  font-size: 0.86rem;
  color: #d1d5db;
}

.municipality-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-width: 280px;
}

.municipality-autocomplete {
  position: relative;
}

.municipality-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  margin-top: 2px;
  display: none;
}

.municipality-suggestions[aria-hidden="false"] {
  display: block;
}

.municipality-suggestion-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #e5e7eb;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.municipality-suggestion-item:last-child {
  border-bottom: none;
}

.municipality-suggestion-item:hover,
.municipality-suggestion-item[aria-selected="true"] {
  background: rgba(148, 163, 184, 0.2);
}

.municipality-suggestion-item small {
  color: #9ca3af;
  margin-left: 0.35rem;
}

.street-autocomplete {
  position: relative;
}

.street-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  margin-top: 2px;
  display: none;
}

.street-suggestions[aria-hidden="false"] {
  display: block;
}

.street-suggestion-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #e5e7eb;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.street-suggestion-item:last-child {
  border-bottom: none;
}

.street-suggestion-item:hover,
.street-suggestion-item[aria-selected="true"] {
  background: rgba(148, 163, 184, 0.2);
}

.appliance-item select {
  width: 80px;
  flex-shrink: 0;
}

.appliance-qty-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.appliance-qty-label {
  display: none; /* shown only on mobile */
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-actions-top {
  margin-top: 0;
  margin-bottom: 1rem;
}

.office-disclaimer {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  max-width: 56rem;
}

.btn-reset {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-reset:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.5);
}

.actions-inline {
  margin-top: 0.75rem;
}

.tabs-container {
  grid-column: 1 / -1;
  margin-bottom: 0.5rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid rgba(148, 163, 184, 0.3);
}

.tab-button {
  background: transparent;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-button:hover {
  color: #e5e7eb;
}

.tab-button.active {
  color: #22c55e;
  border-bottom-color: #22c55e;
}

.tab-content {
  display: none;
  grid-column: 1 / -1;
}

.tab-content.active {
  display: block;
  max-width: 100%;
}

.provision-form {
  margin-bottom: 0;
}

#provisionNameRow.provision-name-row-hidden {
  display: none !important;
}

#provisionType option:disabled {
  color: #94a3b8;
  font-style: italic;
}

.provision-variables-help {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.provision-variable-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.provision-var-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.provision-var-btn:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.6);
}

.escalation-provision-helper {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.escalation-provision-helper .help-text {
  margin: 0 0 0.25rem;
}

.escalation-provision-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.provisions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.provision-item {
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.provision-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.provision-item-name {
  font-weight: 600;
  font-size: 1rem;
  color: #22c55e;
  margin: 0;
}

.provision-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.boilerplate-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

/* Toggle track (pill) */
.toggle-track {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 1.35rem;
  flex-shrink: 0;
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.boilerplate-label:hover .toggle-track {
  background: rgba(148, 163, 184, 0.6);
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.toggle-input:focus-visible + .toggle-knob {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5);
}

.toggle-track:has(.toggle-input:checked) {
  background: rgba(34, 197, 94, 0.5);
  border-color: rgba(34, 197, 94, 0.6);
}

.boilerplate-label:hover .toggle-track:has(.toggle-input:checked) {
  background: rgba(34, 197, 94, 0.6);
}

/* Toggle knob (circle) */
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.35rem - 4px);
  height: calc(1.35rem - 4px);
  background: #e5e7eb;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-track:has(.toggle-input:checked) .toggle-knob {
  transform: translateX(calc(2.5rem - 100% - 4px));
  background: #22c55e;
}

.provision-item-text {
  color: #d1d5db;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 0;
}

.btn-edit {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-edit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-delete {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-delete:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.selected-provisions-container {
  grid-column: 1 / -1;
}

.selected-provisions-list {
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.selected-provision-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.5rem;
}

.selected-provision-content {
  flex: 1;
}

.selected-provision-name {
  font-weight: 600;
  color: #22c55e;
  font-size: 0.9rem;
  margin: 0 0 0.25rem;
}

.selected-provision-from-toggle {
  font-weight: normal;
  font-size: 0.8rem;
  color: #94a3b8;
}

.selected-provision-text {
  color: #d1d5db;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  white-space: pre-wrap;
}

.selected-provision-remove {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  border: none;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.selected-provision-remove:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.closing-credits-container {
  display: flex;
  flex-direction: column;
}

.closing-credits-wheel-wrap {
  display: inline-flex;
  margin-top: 0.5rem;
}

.closing-credits-wheel-wrap .closing-credits-wheel .price-wheel-value {
  font-size: 1.1rem;
}

.seller-credits-wheel-wrap .seller-credits-wheel .price-wheel-value {
  font-size: 1.1rem;
}

.price-wheel-group.wheel-disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 768px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 1rem;
  }

  .card {
    padding-inline: 1.1rem;
  }

  .prompt-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .prompt-actions {
    flex-direction: row;
    justify-content: flex-start;
  }

  .tab-button {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

/* Mobile-friendly: small screens and touch targets */
@media (max-width: 640px) {
  .app-header {
    padding: 1.25rem 1rem 0.75rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .app-header h1 {
    font-size: 1.5rem;
  }

  .app-main {
    padding: 0 max(1rem, env(safe-area-inset-left)) 1.5rem max(1rem, env(safe-area-inset-right));
  }

  .card {
    padding: 1rem 1rem 1.25rem;
  }

  /* Purchase details: allow price line to wrap on very small screens */
  .purchase-price-card .purchase-price-controls {
    grid-template-columns: 1fr;
  }

  /* Price wheels: allow wrap so thousands/hundreds/total don’t overflow; keep touch-friendly */

  .price-wheel-group,
  .purchase-price-card .price-wheel-group,
  .buyer-funds-card .price-wheel-group,
  .dates-card .price-wheel-group,
  .earnest-money-wheel .price-wheel-group,
  .earnest-days-wheel .price-wheel-group,
  .price-wheel-with-tuner .price-wheel-group {
    min-height: 52px;
    height: 52px;
    padding: 16px 12px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  .price-total-group {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  /* Earnest money / due wheels: full width, touch-friendly */
  .earnest-money-wheel,
  .earnest-days-wheel {
    width: 100%;
  }

  /* Tabs: horizontal scroll if needed, no wrap */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0.65rem 1rem;
  }

  /* Form inputs: comfortable tap targets */
  input:not([type="checkbox"]):not([type="radio"]),
  select {
    min-height: 44px;
    font-size: 16px; /* avoids zoom on focus on iOS */
  }

  /* Buttons and primary actions */
  button:not(.tab-button) {
    min-height: 44px;
    padding: 0.65rem 1.25rem;
  }

  /* Autocomplete/suggestion dropdowns: full width on small screens */
  .street-autocomplete,
  .municipality-autocomplete {
    width: 100%;
  }

  .street-suggestions,
  .municipality-suggestions {
    max-height: 180px;
  }

  /* Toggles: larger touch target on mobile */
  .toggle-track {
    min-width: 2.75rem;
    min-height: 44px;
    width: 2.75rem;
    height: 1.5rem;
  }

  .toggle-knob {
    width: calc(1.5rem - 4px);
    height: calc(1.5rem - 4px);
  }

  .toggle-track:has(.toggle-input:checked) .toggle-knob {
    transform: translateX(calc(2.75rem - 100% - 4px));
  }

  /* Contingency labels: allow wrap so type names don’t truncate */
  .contingencies-row .contingency-type-cell {
    min-width: 0;
  }
  .contingencies-row .contingency-label {
    white-space: normal;
    line-height: 1.35;
  }

  /* WB-11 / addenda: comfortable tap targets; closing prorations select is intentionally narrower */
  .wb11-additional-provisions-card select {
    min-height: 44px;
  }

  /* Closing prorations dropdown: about half the previous width on mobile */
  .wb11-additional-provisions-card .closing-prorations-group select {
    width: 50%;
    max-width: 8rem;
    min-width: 0;
  }

  .help-text {
    font-size: 0.85rem;
  }
}

/* Client Setting selector at top of contract form */
.contract-disclaimer {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  max-width: 56rem;
}

.client-setting-row {
  margin-bottom: 1rem;
}
.client-setting-row label.wide {
  display: block;
  max-width: 400px;
}
.client-setting-row select {
  width: 100%;
}

/* Section blocks: Listing agent, Offer docs, Client settings, Review offer, Download form */
.section-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.review-offer-section .help-text {
  margin-bottom: 0.75rem;
}

.review-offer-section #reviewOfferBtn {
  margin-right: 0.5rem;
}

.review-offer-results {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.review-offer-results-ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.review-offer-results-ok p {
  margin: 0;
}

.review-success-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.review-success-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.4);
  color: #22c55e;
  font-weight: bold;
  font-size: 1rem;
  flex-shrink: 0;
}

.review-offer-results-issues {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #e5e7eb;
}

.review-offer-results-issues p {
  margin: 0 0 0.5rem;
}

.review-offer-results-issues ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.review-offer-results-issues li {
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-list-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #22c55e 34%, rgba(34, 197, 94, 0.2) 68%, transparent 72%);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
  animation: reviewListPulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

.review-list-text {
  display: inline-block;
}

.review-flagged {
  position: relative;
  outline: 2px solid rgba(34, 197, 94, 0.75);
  outline-offset: 2px;
  border-radius: 8px;
}

.review-flag-indicator {
  position: absolute;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle, #22c55e 32%, rgba(34, 197, 94, 0.2) 68%, transparent 72%);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: reviewFlagPulse 1s ease-in-out infinite;
  z-index: 5;
  display: none;
}

.review-flag-indicator-tl { top: -11px; left: -11px; }
.review-flag-indicator-tr { top: -8px; right: -8px; }
.review-flag-indicator-bl { bottom: -8px; left: -8px; }
.review-flag-indicator-br { bottom: -8px; right: -8px; }

@keyframes reviewFlagPulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22); }
  50% { transform: scale(1.18); opacity: 0.72; box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.08); }
}

@keyframes reviewListPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22); }
  50% { transform: scale(1.25); opacity: 0.68; box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.08); }
}

.download-form-section button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.manage-form-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.manage-form-controls {
  flex: 1;
}

.manage-form-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.manage-form-actions select {
  min-width: 220px;
}

.manage-form-actions button {
  white-space: nowrap;
}

.listing-agent-fields {
  text-align: left;
}

.listing-agent-fields .listing-agent-label {
  display: block;
  margin-bottom: 0.75rem;
}

.listing-agent-fields .listing-agent-label:last-of-type {
  margin-bottom: 0;
}

.download-upload-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.upload-offer-docs-label {
  margin: 0;
  cursor: pointer;
}

.upload-offer-docs-btn {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 6px;
}

.upload-offer-docs-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
}

.offer-docs-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.offer-doc-label-label {
  font-size: 0.85rem;
  color: #94a3b8;
}

.offer-docs-label-row select {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  background: var(--input-bg, #1e293b);
  color: var(--input-color, #e2e8f0);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.offer-doc-custom-name {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  width: 10rem;
  max-width: 100%;
  background: var(--input-bg, #1e293b);
  color: var(--input-color, #e2e8f0);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.offer-docs-list {
  margin-top: 0.5rem;
  width: 100%;
  font-size: 0.85rem;
  color: #94a3b8;
}

.offer-docs-list .doc-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.offer-docs-list .doc-item button {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 4px;
  cursor: pointer;
}

.offer-docs-list .doc-item button:hover {
  background: rgba(248, 113, 113, 0.35);
}

.offer-doc-custom-name-inline {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  width: 10rem;
  max-width: 100%;
  background: var(--input-bg, #1e293b);
  color: var(--input-color, #e2e8f0);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

/* Save Client Settings at bottom of form */
.save-client-settings-row {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  align-items: center;
  gap: 0.75rem;
}
.save-client-settings-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.save-client-settings-label select {
  min-width: 200px;
}

.client-settings-section #saveClientSettingsBtn {
  margin-top: 1.5rem; /* ~quarter inch below Choose client dropdown */
}

/* Clients tab: searchable dropdown */
.client-selector-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.client-selector-label {
  margin: 0;
  font-weight: 500;
  min-width: 4rem;
}
.client-selector-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}
.client-selector-wrap input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.95rem;
}
.client-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.client-dropdown[aria-hidden="true"] {
  display: none;
}
.client-dropdown li {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #e5e7eb;
}
.client-dropdown li:hover,
.client-dropdown li[aria-selected="true"] {
  background: rgba(34, 197, 94, 0.2);
}
.client-dropdown li.client-dropdown-add {
  font-weight: 600;
  color: #22c55e;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}
/* Clients tab table + modal */
.clients-toolbar {
  margin-bottom: 1rem;
}
.clients-add-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 64, 175, 0.35);
  color: #e5e7eb;
  cursor: pointer;
}
.clients-add-btn:hover {
  background: rgba(30, 64, 175, 0.5);
}
.clients-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.clients-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.clients-filters input,
.clients-filters select {
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  font-size: 0.9rem;
  min-width: 10rem;
}
.clients-table-wrapper {
  overflow-x: auto;
}
.clients-table .client-status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.clients-table .client-status-active { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.clients-table .client-status-pending { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.clients-table .client-status-archived { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.client-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.client-detail-modal[hidden] {
  display: none;
}
.client-detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.client-detail-modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  background: var(--bg, #0f172a);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.client-detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.client-detail-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}
.client-detail-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
}
.client-detail-modal-close:hover {
  color: #e5e7eb;
}
.client-detail-modal-body {
  padding: 1rem;
}
.client-detail-form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "buyer1 buyer1"
    "buyer2 buyer2"
    "buyer2Email buyer2Email"
    "agentType agentType"
    "phone email"
    "preapproval preapproval"
    "approval approval"
    "other other"
    "notes notes"
    "clientStatus clientStatus"
    "clientProvisions clientProvisions"
    "clientFinancing clientFinancing"
    "clientBuyerFunds clientBuyerFunds"
    "clientBuyerProperty clientBuyerProperty"
    "clientSellerComp clientSellerComp"
    "clientBuyersAgencyAgreement clientBuyersAgencyAgreement"
    "actions actions";
}

.client-modal-field-buyer1 { grid-area: buyer1; }
.client-modal-field-buyer2 { grid-area: buyer2; }
.client-modal-field-buyer2-email { grid-area: buyer2Email; }
.client-modal-field-agent-type { grid-area: agentType; }
.client-modal-field-phone { grid-area: phone; }
.client-modal-field-email { grid-area: email; }
.client-modal-field-preapproval { grid-area: preapproval; }
.client-modal-field-approval { grid-area: approval; }
.client-modal-field-other { grid-area: other; }
.client-modal-field-notes { grid-area: notes; }

.client-modal-status-section { grid-area: clientStatus; }
.client-modal-provisions-section { grid-area: clientProvisions; }
.client-modal-financing-section { grid-area: clientFinancing; }
.client-modal-buyer-funds-section { grid-area: clientBuyerFunds; }
.client-modal-buyer-property-section { grid-area: clientBuyerProperty; }
.client-modal-seller-comp-section { grid-area: clientSellerComp; }
.client-modal-buyers-agreement-section { grid-area: clientBuyersAgencyAgreement; }

.client-modal-bottom-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.7);
  border-radius: 0.9rem;
  padding: 0.85rem;
}

.client-modal-bottom-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.client-modal-help {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
}

.client-always-provisions-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.35rem;
}

.client-always-provision-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #e5e7eb;
}

.client-always-provision-row input[type="checkbox"] {
  margin-top: 0.25rem;
}

.client-financing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

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

.client-financing-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-financing-field input[type="text"],
.client-financing-field select {
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.65rem;
  background: rgba(2, 6, 23, 0.35);
  color: #e5e7eb;
  font-size: 0.9rem;
}

.client-financing-variable-wrap {
  grid-column: 1 / -1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.22);
  border-radius: 0.85rem;
  padding: 0.75rem;
}

/* Initial visibility; JS will toggle based on selected values */
#clientCashDaysWrap {
  display: none;
}

#clientVariableRateWrap {
  display: none;
}

#clientBuyerPropertyDaysWrap {
  display: none;
}

#clientBuyerPropertyAddressWrap {
  display: none;
}

#clientSellerCompPercentWrap {
  display: none;
}

/* File input row inside buyers agency agreement card */
.client-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.client-modal-financing-section h5 {
  margin: 0 0 0.45rem;
}

.client-financing-subheader {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: rgba(226, 232, 240, 0.95);
}
.client-detail-modal-actions { grid-area: actions; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.client-detail-modal-actions-right { display: flex; gap: 0.5rem; }
.client-detail-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}
.client-detail-form label.wide { grid-column: 1 / -1; }
.client-detail-form input[type="text"],
.client-detail-form input[type="tel"],
.client-detail-form input[type="email"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  font-size: 0.9rem;
}
.agent-notes-input {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.offer-detail-notes-save {
  margin-top: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  font-size: 0.85rem;
  cursor: pointer;
  height: 2.25rem;
  white-space: nowrap;
}
.offer-detail-notes-save:hover {
  background: rgba(34, 197, 94, 0.28);
}

.client-detail-card {
  min-height: 120px;
}
.client-detail-card .client-detail-empty {
  color: #94a3b8;
  font-size: 0.95rem;
  padding: 1.5rem;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.3);
}
.client-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  overflow: hidden;
}
.client-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(0, 0, 0, 0.15);
}
.client-card-header .client-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #e5e7eb;
}

.client-archived-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 0.35rem;
}

.client-show-archived-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.client-show-archived-label input {
  cursor: pointer;
}
.client-card-header .client-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.client-card-body {
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "name name"
    "phone email"
    "preapproval-amount preapproval-amount"
    "approval approval"
    "other other"
    "save save";
}
.client-card-body .client-name { grid-area: name; }
.client-card-body .client-phone { grid-area: phone; }
.client-card-body .client-email { grid-area: email; }
.client-card-body .client-preapproval-amount { grid-area: preapproval-amount; }
.client-card-body .client-approval { grid-area: approval; }
.client-card-body .client-other { grid-area: other; }
.client-card-body .client-save-row { grid-area: save; margin-top: 0.25rem; }
.client-card-summary {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.client-card-summary .client-summary-info {
  color: #94a3b8;
  font-size: 0.9rem;
}
.client-card-summary .client-summary-info strong { color: #e5e7eb; }
.client-card label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.9rem;
}
.client-card label.wide {
  grid-column: 1 / -1;
}
.client-card input[type="text"],
.client-card input[type="tel"],
.client-card input[type="email"] {
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}
.client-card input[type="file"] {
  font-size: 0.85rem;
  color: #94a3b8;
}
.client-upload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.client-upload-row .file-name {
  font-size: 0.85rem;
  color: #22c55e;
}
.client-upload-row .remove-file {
  font-size: 0.8rem;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.client-upload-row .remove-file:hover { color: #e5e7eb; }
.client-save-btn,
.btn-edit-client {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.8);
  color: #e5e7eb;
}
.client-save-btn:hover,
.btn-edit-client:hover {
  background: rgba(51, 65, 85, 0.9);
}
.client-save-btn {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
}
.client-save-btn:hover { background: #16a34a; }
@media (max-width: 640px) {
  .client-card-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "phone"
      "email"
      "preapproval-amount"
      "approval"
      "other"
      "save";
  }
}

/* ========== UI Elements tab (100 widgets) ========== */
.ui-elements-wrapper {
  padding: 1rem;
}
.ui-elements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}
.ui-element-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 120px;
}
.ui-element-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.2;
}
.ui-element-widget-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
}
.ui-element-value {
  font-size: 0.7rem;
  color: #64748b;
  min-height: 1.2em;
}

/* Toggles */
.ui-toggle { width: 44px; height: 24px; accent-color: #22c55e; cursor: pointer; }
.ui-toggle-ios { border-radius: 12px; }
.ui-toggle-material { border-radius: 4px; }
.ui-toggle-pill { border-radius: 999px; }
.ui-toggle-neon { accent-color: #0ea5e9; box-shadow: 0 0 12px rgba(14, 165, 233, 0.5); }
.ui-toggle-minimal { width: 36px; height: 18px; }
.ui-toggle-rounded { border-radius: 8px; }
.ui-toggle-icon { display: inline-flex; align-items: center; cursor: pointer; }
.ui-toggle-icon input { display: none; }
.ui-toggle-icon-symbol { font-size: 1.2rem; opacity: 0.7; }
.ui-toggle-icon input:checked + .ui-toggle-icon-symbol { color: #22c55e; }

.ui-switch { width: 52px; height: 28px; cursor: pointer; accent-color: #22c55e; }
.ui-switch-industrial { border-radius: 4px; }
.ui-switch-retro { border-radius: 6px; }
.ui-switch-rocker { border-radius: 8px; }
.ui-switch-vintage { border-radius: 999px; }
.ui-switch-flat { border-radius: 2px; }
.ui-toggle-flip { appearance: none; width: 48px; height: 26px; background: #475569; border-radius: 4px; cursor: pointer; }
.ui-toggle-flip:checked { background: #22c55e; }

.ui-3way { display: flex; gap: 2px; background: #334155; border-radius: 6px; padding: 2px; }
.ui-3way button { border: none; padding: 0.35rem 0.6rem; font-size: 0.7rem; cursor: pointer; background: transparent; color: #94a3b8; border-radius: 4px; }
.ui-3way button.active { background: #22c55e; color: #fff; }

/* Knobs */
.ui-knob-wrap { position: relative; }
.ui-knob-dial {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(145deg, #334155, #1e293b);
  border: 2px solid #475569;
  position: relative;
  cursor: pointer;
  --angle: 180deg;
}
.ui-knob-dial::before {
  content: ''; position: absolute;
  left: 50%; top: 20%; width: 2px; height: 12px;
  background: #e2e8f0; border-radius: 1px;
  transform: translateX(-50%) rotate(var(--angle));
  transform-origin: center 80%;
}
.ui-knob-radio .ui-knob-dial { width: 56px; height: 56px; border-width: 3px; }
.ui-knob-tv .ui-knob-dial { border-radius: 8px; }
.ui-knob-ticks .ui-knob-dial { box-shadow: inset 0 0 0 2px #475569; }
.ui-knob-value { font-size: 0.65rem; margin-top: 2px; }

/* Sliders */
.ui-slider { width: 100%; max-width: 120px; height: 6px; accent-color: #22c55e; cursor: pointer; }
.ui-slider-v { writing-mode: vertical; width: 6px; height: 60px; }
.ui-slider-fader { height: 8px; }
.ui-slider-neon { accent-color: #0ea5e9; }
.ui-range-wrap { display: flex; gap: 4px; align-items: center; max-width: 120px; }
.ui-range-wrap input { flex: 1; min-width: 0; }

/* Ball in circle */
.ui-ball-circle { position: relative; width: 80px; height: 80px; }
.ui-ball-circle-track {
  width: 100%; height: 100%; border-radius: 50%;
  border: 3px solid #475569;
  background: rgba(30, 41, 59, 0.8);
  cursor: pointer;
  position: relative;
}
.ui-ball-circle-ball {
  position: absolute; width: 14px; height: 14px;
  background: #22c55e; border-radius: 50%;
  left: 50%; top: 0; transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.ui-ball-circle-value { font-size: 0.7rem; }

/* Orbital */
.ui-orbital { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 100px; }
.ui-orbital button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #475569; background: #1e293b; color: #e2e8f0; font-size: 0.75rem; cursor: pointer; }
.ui-orbital button.active { background: #22c55e; border-color: #22c55e; }

/* Progress ring */
.ui-progress-ring { width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(#22c55e calc(var(--pct, 50) * 1%), #334155 0); cursor: pointer; position: relative; }
.ui-progress-ring-fill { position: absolute; inset: 4px; border-radius: 50%; background: #1e293b; }
.ui-progress-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; }

/* Joystick */
.ui-joystick { width: 56px; height: 56px; border-radius: 50%; background: #334155; border: 2px solid #475569; position: relative; cursor: pointer; }
.ui-joystick-stick { position: absolute; width: 20px; height: 20px; background: #22c55e; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }

/* Compass */
.ui-compass-needle { position: relative; width: 56px; height: 56px; }
.ui-compass-dial { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #475569; background: #1e293b; cursor: pointer; }
.ui-compass-needle-n { position: absolute; left: 50%; top: 50%; width: 2px; height: 40%; background: #ef4444; transform: translate(-50%, -100%) rotate(0deg); transform-origin: center 100%; pointer-events: none; }
.ui-compass-deg { font-size: 0.65rem; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); }

/* Buttons */
.ui-btn { padding: 0.4rem 0.8rem; border-radius: 8px; border: 1px solid #475569; background: #334155; color: #e2e8f0; cursor: pointer; font-size: 0.8rem; }
.ui-btn:hover { background: #475569; }
.ui-btn-pill { border-radius: 999px; }
.ui-btn-round { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.ui-fab { width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; padding: 0; background: #22c55e; border: none; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.ui-icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1.1rem; }
.ui-icon-btn.active { background: #22c55e; border-color: #22c55e; }
.ui-btn-outline { background: transparent; }
.ui-btn-glass { background: rgba(255,255,255,0.08); }
.ui-btn-neumorphic { background: #334155; box-shadow: 3px 3px 6px #1e293b, -2px -2px 4px #475569; }

.ui-segmented, .ui-toggle-group { display: flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid #475569; }
.ui-segmented button, .ui-toggle-group button { flex: 1; padding: 0.35rem 0.5rem; border: none; background: #1e293b; color: #94a3b8; font-size: 0.75rem; cursor: pointer; }
.ui-segmented button.active, .ui-toggle-group button.active { background: #22c55e; color: #fff; }

/* Stepper */
.ui-stepper { display: flex; align-items: center; gap: 0.5rem; }
.ui-stepper-minus, .ui-stepper-plus { width: 28px; height: 28px; border-radius: 6px; border: 1px solid #475569; background: #334155; color: #e2e8f0; font-size: 1rem; cursor: pointer; }
.ui-stepper-val { min-width: 1.5rem; text-align: center; font-size: 0.9rem; }

/* Number wheel */
.ui-number-wheel { display: flex; flex-direction: column; align-items: center; cursor: pointer; font-size: 0.8rem; color: #94a3b8; }
.ui-wheel-cur { font-size: 1.2rem; color: #e2e8f0; font-weight: 600; }

/* Star rating */
.ui-star-rating { display: flex; gap: 2px; }
.ui-star-rating button { background: none; border: none; font-size: 1.2rem; color: #475569; cursor: pointer; padding: 0; }
.ui-star-rating button.active { color: #eab308; }

.ui-heart { background: none; border: none; font-size: 1.5rem; color: #475569; cursor: pointer; padding: 0; }
.ui-heart.active { color: #ef4444; }
.ui-thumbs { display: flex; gap: 0.5rem; }
.ui-thumbs button { padding: 0.35rem 0.6rem; border-radius: 8px; border: 1px solid #475569; background: #334155; cursor: pointer; font-size: 1rem; }
.ui-thumbs button.active { background: #22c55e; border-color: #22c55e; }

.ui-emoji-slider { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ui-emoji-label { font-size: 1.5rem; }
.ui-face-scale { display: flex; gap: 4px; }
.ui-face-scale button { border: none; background: none; font-size: 1.2rem; cursor: pointer; padding: 2px; border-radius: 4px; }
.ui-face-scale button.active { background: rgba(34, 197, 94, 0.2); }

.ui-color-swatch { width: 40px; height: 40px; border-radius: 8px; border: 2px solid #475569; cursor: pointer; background: var(--swatch, #e11); }
.ui-like-btn { padding: 0.35rem 0.6rem; border-radius: 8px; border: 1px solid #475569; background: #334155; color: #e2e8f0; font-size: 0.8rem; cursor: pointer; }

/* Gauges */
.ui-gauge-wrap { width: 60px; height: 24px; background: #334155; border-radius: 4px; overflow: hidden; cursor: pointer; position: relative; }
.ui-gauge-fill { height: 100%; width: calc(var(--pct, 50) * 1%); background: linear-gradient(90deg, #22c55e, #0ea5e9); transition: width 0.15s; }
.ui-gauge-val { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 0.6rem; }
.ui-thermometer .ui-gauge-wrap { width: 24px; height: 60px; }
.ui-thermometer .ui-gauge-fill { width: 100%; height: calc(var(--pct, 50) * 1%); bottom: 0; top: auto; }
.ui-liquid-fill .ui-gauge-wrap { width: 40px; height: 56px; border-radius: 8px; }
.ui-syringe .ui-gauge-wrap { width: 28px; height: 56px; border-radius: 4px; }

/* EQ */
.ui-eq { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.ui-eq span { width: 8px; background: #22c55e; border-radius: 2px; height: var(--h, 50%); min-height: 4px; transition: height 0.2s; }
.ui-eq.equalizer-anim span { animation: ui-eq-bounce 0.5s ease-in-out infinite alternate; }
@keyframes ui-eq-bounce { to { height: 80%; } }

.ui-radar, .ui-sonar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #475569; position: relative; overflow: hidden; background: #1e293b; }
.ui-radar-sweep { position: absolute; inset: 0; background: conic-gradient(transparent 0deg, rgba(34, 197, 94, 0.3) 90deg); animation: ui-sweep 2s linear infinite; }
@keyframes ui-sweep { to { transform: rotate(360deg); } }

.ui-spinner { width: 32px; height: 32px; border: 3px solid #334155; border-top-color: #22c55e; border-radius: 50%; animation: ui-spin 0.8s linear infinite; }
.ui-spinner-2 { border-style: dashed; }
.ui-spinner-3 { border: none; background: radial-gradient(circle, #22c55e 30%, transparent 70%); animation: ui-pulse 1s ease-in-out infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-pulse { 50% { transform: scale(1.2); opacity: 0.7; } }

.ui-motion { width: 40px; height: 40px; background: #334155; border-radius: 50%; }
.ui-motion.ui-morph { animation: ui-morph 3s ease-in-out infinite; border-radius: 50%; }
.ui-motion.ui-pendulum { animation: ui-pendulum 1.5s ease-in-out infinite; transform-origin: top center; }
.ui-motion.ui-wave { animation: ui-wave 1s ease-in-out infinite; }
.ui-motion.ui-pulse { animation: ui-pulse 1s ease-in-out infinite; }
.ui-motion.ui-breath { animation: ui-breath 2s ease-in-out infinite; }
@keyframes ui-morph { 0%, 100% { border-radius: 50%; } 50% { border-radius: 20%; } }
@keyframes ui-pendulum { 0%, 100% { transform: rotate(-20deg); } 50% { transform: rotate(20deg); } }
@keyframes ui-wave { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.5); } }
@keyframes ui-breath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

.ui-seesaw { width: 70px; height: 24px; }
.ui-seesaw-bar { width: 100%; height: 4px; background: #475569; border-radius: 2px; transform: rotate(var(--tilt, 0deg)); transition: transform 0.2s; }
.ui-seesaw-pan { position: absolute; width: 16px; height: 16px; background: #22c55e; border-radius: 50%; top: -6px; }
.ui-seesaw-pan.left { left: 0; } .ui-seesaw-pan.right { right: 0; }

.ui-plunger { width: 24px; height: 56px; background: #334155; border-radius: 4px; position: relative; cursor: pointer; }
.ui-plunger-handle { position: absolute; width: 32px; height: 12px; left: 50%; top: 4px; transform: translateX(-50%); background: #64748b; border-radius: 4px; transition: top 0.15s; }
.ui-plunger-handle.pulled { top: 40px; }
.ui-slot-lever { width: 40px; height: 48px; position: relative; cursor: pointer; }
.ui-slot-arm { width: 8px; height: 32px; background: #475569; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%) rotate(-30deg); transform-origin: center bottom; transition: transform 0.3s; }
.ui-slot-arm.pull { animation: ui-slot-pull 0.4s ease-out; }
@keyframes ui-slot-pull { to { transform: translateX(-50%) rotate(20deg); } }

.ui-rolodex { width: 50px; height: 36px; position: relative; perspective: 100px; cursor: pointer; }
.ui-rolodex-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #334155; border: 1px solid #475569; border-radius: 4px; font-size: 0.9rem; opacity: 0.5; transform: rotateX(-30deg); transition: all 0.3s; }
.ui-rolodex-card.front { opacity: 1; transform: none; z-index: 1; }

.ui-tonearm { width: 48px; height: 48px; position: relative; cursor: pointer; }
.ui-tonearm-arm { position: absolute; left: 50%; bottom: 50%; width: 3px; height: 30px; background: #64748b; transform-origin: center 100%; transform: rotate(20deg); transition: transform 0.15s; }

.ui-iris { width: 48px; height: 48px; border-radius: 50%; background: #1e293b; cursor: pointer; position: relative; overflow: hidden; }
.ui-iris-blades { position: absolute; inset: 10%; background: radial-gradient(circle, transparent calc(var(--open, 80) * 0.5%), #334155 0); }

.ui-volume-rocker { display: flex; flex-direction: column; gap: 2px; }
.ui-volume-rocker button { width: 36px; padding: 0.25rem; border: 1px solid #475569; background: #334155; color: #e2e8f0; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }

.ui-dpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 60px; }
.ui-dpad .up { grid-column: 2; }
.ui-dpad .dn { grid-column: 2; grid-row: 3; }
.ui-dpad .lt { grid-column: 1; grid-row: 2; }
.ui-dpad .rt { grid-column: 3; grid-row: 2; }
.ui-dpad button { padding: 0.25rem; border: 1px solid #475569; background: #334155; color: #e2e8f0; border-radius: 4px; cursor: pointer; font-size: 0.7rem; }

.ui-analog { width: 56px; height: 56px; border-radius: 50%; background: #334155; border: 2px solid #475569; position: relative; cursor: pointer; }
.ui-analog-stick { position: absolute; width: 20px; height: 20px; background: #22c55e; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }

.ui-trigger { width: 32px; height: 48px; background: #334155; border-radius: 8px; position: relative; cursor: pointer; }
.ui-trigger-pull { position: absolute; bottom: 0; left: 4px; right: 4px; height: 20px; background: #475569; border-radius: 4px; transition: height 0.15s; }
.ui-trigger-pull.pulled { height: 8px; }

.ui-stamp { padding: 0.35rem 0.6rem; border-radius: 4px; border: 2px solid #475569; background: #334155; color: #e2e8f0; font-size: 0.8rem; cursor: pointer; }
.ui-stamp.stamp { animation: ui-stamp 0.3s ease-out; }
@keyframes ui-stamp { 50% { transform: scale(0.9); } }

.ui-thermostat { width: 56px; height: 56px; border-radius: 50%; background: #334155; border: 2px solid #475569; position: relative; cursor: pointer; }
.ui-thermo-needle { position: absolute; left: 50%; top: 50%; width: 2px; height: 35%; background: #ef4444; transform-origin: center 100%; transform: translate(-50%, -100%) rotate(10deg); }
.ui-thermo-val { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 0.65rem; }

.ui-sun-moon { width: 48px; height: 32px; background: #1e293b; border-radius: 999px; position: relative; cursor: pointer; padding: 4px; }
.ui-sun-moon .sun, .ui-sun-moon .moon { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.2rem; transition: opacity 0.3s; }
.ui-sun-moon .sun { left: 6px; }
.ui-sun-moon .moon { right: 6px; opacity: 0.3; }
.ui-sun-moon.night .sun { opacity: 0.3; } .ui-sun-moon.night .moon { opacity: 1; }

.ui-honeycomb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; max-width: 70px; }
.ui-honeycomb button { width: 20px; height: 22px; background: #334155; border: 1px solid #475569; color: #e2e8f0; font-size: 0.6rem; cursor: pointer; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }
.ui-honeycomb button.active { background: #22c55e; }

.ui-radial { width: 64px; height: 64px; position: relative; }
.ui-radial button { position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 1px solid #475569; background: #334155; color: #e2e8f0; font-size: 0.7rem; cursor: pointer; }
.ui-radial .c { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.ui-radial button:not(.c) { left: 50%; top: 0; transform: translate(-50%, -50%) rotate(calc(var(--i, 0) * 72deg)) translate(0, -22px) rotate(calc(var(--i, 0) * -72deg)); }

.ui-flip-clock { width: 36px; height: 48px; background: #1e293b; border-radius: 4px; position: relative; cursor: pointer; overflow: hidden; }
.ui-flip-top, .ui-flip-bot { position: absolute; left: 0; right: 0; height: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: #334155; }
.ui-flip-top { top: 0; border-radius: 4px 4px 0 0; }
.ui-flip-bot { bottom: 0; border-radius: 0 0 4px 4px; }
.ui-flip-clock.flip .ui-flip-top { animation: ui-flip 0.3s ease-out; }
@keyframes ui-flip { to { transform: rotateX(-90deg); } }

.ui-dice { width: 44px; height: 44px; border: 2px solid #475569; border-radius: 8px; background: #334155; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.ui-card-flip { width: 48px; height: 64px; position: relative; cursor: pointer; perspective: 200px; }
.ui-card-front, .ui-card-back { position: absolute; inset: 0; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; backface-visibility: hidden; transition: transform 0.4s; }
.ui-card-front { background: #334155; border: 1px solid #475569; }
.ui-card-back { background: #475569; transform: rotateY(180deg); }
.ui-card-flip.flipped .ui-card-front { transform: rotateY(-180deg); }
.ui-card-flip.flipped .ui-card-back { transform: rotateY(0); }

.ui-gear { font-size: 2rem; cursor: pointer; transition: transform 0.3s; }

.ui-venetian { display: flex; flex-direction: column; gap: 2px; }
.ui-venetian span { width: 40px; height: 4px; background: #475569; border-radius: 1px; transition: transform 0.3s; }
.ui-venetian.open span { transform: rotate(45deg); }

.ui-curtain { width: 56px; height: 40px; position: relative; cursor: pointer; overflow: hidden; }
.ui-curtain-l, .ui-curtain-r { position: absolute; top: 0; width: 50%; height: 100%; background: #475569; transition: transform 0.4s; }
.ui-curtain-l { left: 0; transform-origin: left; }
.ui-curtain-r { right: 0; transform-origin: right; }
.ui-curtain.open .ui-curtain-l { transform: scaleX(0); }
.ui-curtain.open .ui-curtain-r { transform: scaleX(0); }

.ui-pedal { width: 48px; height: 24px; background: #334155; border-radius: 8px; position: relative; cursor: pointer; }
.ui-pedal-pad { position: absolute; inset: 2px; background: #475569; border-radius: 6px; transition: transform 0.1s; }
.ui-pedal-pad.pressed { transform: scaleY(0.6); }

.ui-constellation { width: 48px; height: 48px; position: relative; }
.ui-constellation span { position: absolute; width: 4px; height: 4px; background: #e2e8f0; border-radius: 50%; }
.ui-constellation span:nth-child(1) { left: 20%; top: 30%; } .ui-constellation span:nth-child(2) { left: 50%; top: 20%; }
.ui-constellation span:nth-child(3) { left: 80%; top: 40%; } .ui-constellation span:nth-child(4) { left: 60%; top: 70%; }
.ui-constellation span:nth-child(5) { left: 30%; top: 60%; }

.ui-moon-phase { display: flex; flex-wrap: wrap; gap: 2px; max-width: 56px; justify-content: center; cursor: pointer; font-size: 0.9rem; }
.ui-moon-phase span.active { filter: brightness(1.3); }

.ui-key-turn, .ui-lever, .ui-faucet, .ui-valve { width: 40px; height: 40px; position: relative; cursor: pointer; }
.ui-key-turn-handle, .ui-lever-handle, .ui-faucet-handle, .ui-valve-handle { position: absolute; inset: 8px; border: 2px solid #475569; border-radius: 50%; transition: transform 0.2s; }
.ui-lever .ui-lever-handle { border-radius: 4px; transform-origin: center 80%; }
.ui-placeholder { font-size: 0.7rem; color: #64748b; }

.must-change-password-banner {
  max-width: 1200px;
  margin: 0 auto 1rem;
  padding: 1rem 1.25rem;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.must-change-password-banner p { margin: 0; flex: 1 1 100%; }
.must-change-password-banner label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.must-change-password-banner input { min-width: 160px; padding: 0.35rem 0.5rem; border-radius: 4px; border: 1px solid #475569; background: #0f172a; color: #e2e8f0; }

.marketplace-list { display: flex; flex-direction: column; gap: 0.75rem; }
.marketplace-card { padding: 1rem; border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.25); background: rgba(15, 23, 42, 0.6); }
.marketplace-card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.marketplace-card p { margin: 0; color: #94a3b8; font-size: 0.9rem; }

