body {
  font-family: var(--font-sans);
  margin: 0;
  color: var(--c-text);
  background: var(--c-bg);
}

header {
  background: var(--c-header-bg);
  color: white;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.header-inner form {
  margin-left: auto;
}

.header-logo {
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.button-ghost {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}

.button-ghost:active {
  background: rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 24%);
  transform: translateY(1px);
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

a {
  color: var(--c-primary-mid);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.schedule-table {
  width: 100%;
  min-width: 480px;
}

th,
td {
  border-bottom: 1px solid var(--c-border);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 12px;
  max-width: 200px;
  text-transform: uppercase;
  background: var(--c-surface-raised);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input {
  box-sizing: border-box;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  padding: 8px;
  border: 1px solid #aaa;
}

label {
  display: block;
  margin: 12px 0;
  font-weight: 700;
}

button,
.button {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--c-primary-mid);
  background: var(--c-primary-light);
  color: var(--c-primary-text);
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s, color 0.12s, transform 0.05s;
}

button:hover,
.button:hover {
  background: #9ee8b1;
  border-color: var(--c-primary-dark);
}

button:active,
.button:active {
  background: #83d99b;
  border-color: var(--c-primary-dark);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 22%);
  transform: translateY(1px);
}

.actions {
  margin: 16px 0;
}

.muted {
  color: #666;
}

.page-subtitle {
  color: var(--c-text-dim);
  font-size: 14px;
  margin: 4px 0 0;
}

/* Info-style hints: narrow, neutral, with a circled serif "i" badge. Use
 * for empty-state blocks and modal hints — anything that's guidance about
 * the UI, not project data. */
.empty-state,
.modal-hint {
  align-items: flex-start;
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-left: 3px solid var(--c-primary-mid);
  border-radius: 6px;
  color: var(--c-text-muted);
  display: flex;
  font-size: 13px;
  gap: 10px;
  line-height: 1.5;
  margin: 16px auto;
  max-width: 480px;
  padding: 12px 14px;
}

.empty-state::before,
.modal-hint::before {
  align-items: center;
  background: var(--c-primary-mid);
  border-radius: 50%;
  color: #fff;
  content: "i";
  display: flex;
  flex-shrink: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 700;
  height: 18px;
  justify-content: center;
  line-height: 1;
  margin-top: 1px;
  width: 18px;
}

.empty-state-content {
  flex: 1;
  min-width: 0;
}

.empty-state-headline {
  color: var(--c-text);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.empty-state-body {
  color: var(--c-text-muted);
  margin: 0;
}

.empty-state--centered {
  margin-left: auto;
  margin-right: auto;
}

.button-danger {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--c-danger-border);
  background: var(--c-danger-bg);
  color: var(--c-danger-text);
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
}

.button-danger:hover {
  background: #fbd2d2;
  border-color: #7f1d1d;
}

.button-danger:active {
  background: #f8bcbc;
  border-color: #7f1d1d;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 18%);
  transform: translateY(1px);
}

.button-danger-subtle {
  border-color: var(--c-border);
  background: transparent;
  color: var(--c-text-muted);
}

.button-danger-subtle:hover {
  border-color: var(--c-danger-border);
  background: var(--c-danger-bg);
  color: var(--c-danger-text);
}

.about-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: #1a1a1a;
}

.about-hero {
  text-align: center;
  padding: 16px 0 24px;
}

.about-hero h1 {
  font-size: 2.4rem;
  margin: 0 0 6px;
  color: #1a1a1a;
}

.about-tagline {
  color: #4a4a4a;
  font-size: 1.1rem;
  margin: 0 0 16px;
}

.about-blurb {
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.55;
  color: #1a1a1a;
}

.about-carousel {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  margin: 32px 0 24px;
  padding: 28px 28px 16px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 4%);
  color: #1a1a1a;
}

/* Fixed slide height so the carousel stops jumping as users click through
 * screenshots of varying natural dimensions. The figure column is letter-
 * boxed via object-fit: contain. */
.about-slide {
  display: none;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: center;
  min-height: 360px;
}

@media (min-width: 720px) {
  .about-slide {
    grid-template-columns: 5fr 6fr;
    gap: 32px;
  }
}

.about-slide.is-active {
  display: grid;
}

.about-slide-text h2 {
  font-size: 1.4rem;
  margin: 4px 0 10px;
  color: #1a1a1a;
}

.about-slide-text p {
  line-height: 1.55;
  margin: 0 0 8px;
  color: #1a1a1a;
}

.about-step-kicker {
  color: #5a5a5a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.about-slide-figure {
  margin: 0;
  background: #f4f4f1;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.about-slide-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.about-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
}

.about-nav-btn {
  background: #ffffff;
  border: 1px solid #c8c8c8;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.about-nav-btn:hover:not(:disabled) {
  background: #f4f4f4;
}

.about-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.about-dots {
  display: inline-flex;
  gap: 8px;
}

.about-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #cccccc;
  padding: 0;
  cursor: pointer;
  transition: background 120ms;
}

.about-dot:hover {
  background: #888888;
}

.about-dot.is-active {
  background: #1a1a1a;
}

.about-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  font-size: 1.05rem;
  color: #1a1a1a;
}

.about-cta .button {
  padding: 12px 24px;
  font-size: 1rem;
}


.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.project-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s;
}

.project-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.project-thumb-wrap {
  aspect-ratio: 4 / 3;
  background: var(--c-surface-raised);
  overflow: hidden;
}

.project-thumb-wrap>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
}

.project-thumb-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb-cell {
  background: var(--c-surface-raised);
}

.project-thumb-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
}

.project-card-body {
  padding: 14px 16px;
}

.project-card h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--c-primary-mid);
}

.project-card-meta {
  font-size: 12px;
  color: #666;
  margin: 4px 0 0;
}

.project-card-description {
  font-size: 13px;
  color: #333;
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card hover actions menu (⋮) */
.project-card-wrap {
  position: relative;
}

.card-menu-host {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

/* The ⋮ trigger is a <summary>; strip the native disclosure marker. */
.card-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.card-menu-btn::-webkit-details-marker {
  display: none;
}

/* Reveal on hover, keyboard focus, or while the menu is open. */
.project-card-wrap:hover .card-menu-btn,
.card-menu-host:focus-within .card-menu-btn,
.card-menu-host[open] .card-menu-btn {
  opacity: 1;
}

.card-menu-btn:hover {
  background: #fff;
}

/* Shown natively when the <details> menu is open. */
.card-menu {
  position: absolute;
  top: 34px;
  right: 0;
  min-width: 196px;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  padding: 4px;
  display: flex;
  flex-direction: column;
}

.card-menu form {
  margin: 0;
}

.card-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  color: #222;
  cursor: pointer;
}

.card-menu-icon {
  flex: none;
  opacity: 0.75;
}

.card-menu-item:hover {
  background: var(--c-surface-raised);
}

.card-menu-item--danger {
  color: #b3261e;
}

.card-menu-item--danger:hover {
  background: #fce8e6;
}

/* Archived projects (collapsed section) */
.archived-section {
  margin-top: 2rem;
}

.archived-summary {
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: revert;
  width: fit-content;
}

.archived-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: #888;
}

.archived-intro {
  color: var(--c-text-dim);
  font-size: 14px;
  max-width: 60ch;
  margin: 8px 0 4px;
}

/* Name + "Archived" badge sit on one line; badge hugs its text. */
.project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* "Archived" marker shown after the project name on its detail page. */
.archived-badge {
  align-self: center;
  padding: 2px 8px;
  border: 1px solid #d6a72e;
  border-radius: 999px;
  background: #fdf3d8;
  color: #8a6d1f;
  font-size: 11px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.project-card--archived {
  opacity: 0.7;
}

.project-card--archived:hover {
  opacity: 1;
}

/* Duplicate-name modal */
.duplicate-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.duplicate-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  font-size: 14px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
}

.duplicate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.item-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Schedule table scrolling */
.schedule-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--c-border);
}

/* Narrow columns: shrink-wrap to content */
.schedule-table th:first-child,
.schedule-table td:first-child,
.schedule-table .col-code,
.schedule-table .col-room,
.schedule-table .col-model_number,
.schedule-table .col-manufacturer,
.schedule-table .col-finish {
  width: 1%;
  white-space: nowrap;
}

.schedule-table .col-room {
  min-width: 80px;
}

.schedule-table .col-model_number {
  min-width: 120px;
}

.schedule-table .col-manufacturer {
  min-width: 120px;
}

.cell-empty {
  color: var(--c-text-label);
}


.cell-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Notes can carry critical contractor guidance ("verify rough-in",
 * "trade pricing only", etc.). Give the column extra width and let the
 * text wrap to its full length instead of clamping. */
th.col-notes,
td.col-notes {
  max-width: 360px;
  min-width: 220px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

td.col-notes .cell-clamp,
td.col-notes .cell-placeholder,
td.col-notes .cell-empty {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8em;
}

.item-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--c-border);
  display: block;
}

.upload-target {
  cursor: pointer;
  position: relative;
}

.upload-overlay {
  align-items: center;
  background: rgba(0, 0, 0, 0.48);
  border-radius: inherit;
  bottom: 0;
  color: #fff;
  display: flex;
  font-size: 11px;
  font-weight: 600;
  justify-content: center;
  left: 0;
  letter-spacing: 0.05em;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 0.15s;
}

.upload-target:hover .upload-overlay {
  opacity: 1;
}

.code-link {
  color: inherit;
  text-decoration: none;
}

.code-link:hover {
  text-decoration: underline;
}

.item-thumb-placeholder {
  align-items: center;
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  display: flex;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.item-thumb-cell {
  position: relative;
}

.row-actions {
  padding: 0 4px;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}

.move-form {
  display: none;
  margin: 0;
}

.move-btn {
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--c-text-label);
  cursor: pointer;
  font-size: 13px;
  height: 22px;
  line-height: 1;
  padding: 0 3px;
}

.move-btn:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
}

/* Row-action buttons keep their space reserved (visibility, not display)
 * so hovering a row doesn't shift the layout of neighboring cells —
 * particularly the wide Notes column, which used to re-wrap its text
 * when the row-actions cell grew on hover. */
.delete-row-btn {
  align-items: center;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--c-text-label);
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  margin-left: 28px;
  padding: 0;
  vertical-align: middle;
  visibility: hidden;
  width: 28px;
}

.delete-row-btn:hover {
  background: var(--c-danger-subtle, #fee2e2);
  color: var(--c-danger, #dc2626);
}

.item-row:hover .delete-row-btn {
  visibility: visible;
}

.detail-row-btn {
  align-items: center;
  background: none;
  border: none;
  border-radius: 4px;
  /* Always visible, but muted so it doesn't compete with cell content.
   * Non-technical users benefit from the persistent affordance. */
  color: var(--c-text-dim);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0 2px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: color 0.1s, text-decoration-color 0.1s;
  vertical-align: middle;
  visibility: visible;
}

.detail-row-btn:hover {
  color: var(--c-text-link);
  text-decoration-color: currentColor;
}

/* Item detail modal */
.item-detail-modal {
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  padding: 0;
  width: min(860px, 94vw);
  max-height: 82vh;
}

.item-detail-modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.item-detail-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  overflow: hidden;
}

.item-detail-slot {
  display: contents;
}

.item-detail-modal-header {
  align-items: center;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  padding: 18px 32px;
  flex-shrink: 0;
}

/* Product-page button: prominent CTA in the item-detail sidebar. */
.product-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--c-primary-mid);
  background: var(--c-primary-light);
  color: var(--c-primary-text);
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.12s, box-shadow 0.12s;
}

.product-link-btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-link-btn .product-link-icon {
  flex: none;
  opacity: 0.9;
}

.item-detail-close {
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--c-muted);
  cursor: pointer;
  font-size: 16px;
  height: 28px;
  line-height: 1;
  padding: 0 6px;
}

.item-detail-close:hover { background: var(--c-surface-hover); color: var(--c-text); }

/* Scroll container AND a two-column flex row: aligned field grid on the left,
   meta sidebar (image, product button, hint) stacked on the right. */
.item-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 24px 24px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.item-detail-main {
  flex: 1;
  min-width: 0;
}

.item-detail-side {
  flex: none;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Image cropped to a fixed size so the sidebar stays tidy regardless of source. */
.item-detail-img {
  width: 220px;
  height: 165px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.item-detail-side .product-link-btn {
  justify-content: center;
}

.modal-hint--side {
  margin: 0;
  max-width: none;
  font-size: 12px;
}

/* Aligned label | value columns. */
.item-detail-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  align-items: baseline;
  font-size: 14px;
  margin: 0;
}

.item-detail-dl dt {
  color: var(--c-muted);
  font-weight: 600;
  white-space: nowrap;
}

.item-detail-dl dd {
  margin: 0;
  word-break: break-word;
}

.product-link-icon {
  flex: none;
  opacity: 0.85;
}

.item-detail-footer {
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: flex-end;
  padding: 14px 32px;
  flex-shrink: 0;
}

/* Inline editing */
.editable-cell {
  cursor: pointer;
  max-width: 260px;
  transition: background 0.1s;
}

.editable-cell:hover {
  background: var(--c-surface-hover);
}

.editing-cell {
  padding: 0 !important;
}

/* min-width is set as an inline style by the htmx:afterSwap handler
 * in page.html, so no CSS rule is needed here. */

.cell-input {
  background: #fff;
  border: 2px solid var(--c-primary);
  border-radius: 0;
  box-sizing: border-box;
  font: inherit;
  outline: none;
  padding: 8px 10px;
  width: 100%;
}

.cell-textarea {
  min-height: 80px;
  resize: vertical;
  white-space: pre-wrap;
}

.cell-select {
  appearance: auto;
  cursor: pointer;
}

/* The dropdown shows "No room" / "New room…" italicized so they read
 * as meta-actions rather than as named rooms. Italic option styling is
 * honored by Chromium, Firefox, and Safari — older browsers fall back
 * to the regular weight, which is harmless. */
.cell-select-meta {
  font-style: italic;
  color: var(--c-text-muted);
}

.cell-select-divider {
  color: var(--c-border-mid);
}

.editable-h1 {
  cursor: pointer;
}

.editable-h1:hover {
  opacity: 0.75;
}

.editing-h1 {
  margin: 0 0 6px;
}

.h1-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--c-primary);
  font: inherit;
  outline: none;
  padding: 0 0 2px;
  width: 100%;
}

.editable-meta {
  border-radius: 4px;
  cursor: pointer;
  margin-left: -6px;
  padding: 2px 6px;
}

.editable-meta:hover {
  background: var(--c-surface-hover);
}

.editing-meta {
  margin-left: -6px;
  padding: 2px 6px;
}

.meta-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--c-border-strong);
  color: var(--c-text-muted);
  font: inherit;
  font-size: 13px;
  margin-top: 3px;
  outline: none;
  padding: 1px 0;
  width: 100%;
}

.meta-textarea {
  min-height: 72px;
  resize: vertical;
  white-space: pre-wrap;
}

.meta-value {
  white-space: pre-wrap;
}

/* Project page: sidebar nav + schedule content */
.project-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.schedule-nav {
  flex-shrink: 0;
  width: 160px;
  position: sticky;
  top: 16px;
}

.schedule-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  border-right: 2px solid var(--c-border);
}

.schedule-nav li a {
  display: block;
  padding: 6px 12px 6px 0;
  font-size: 14px;
  text-decoration: none;
  color: var(--c-primary-mid);
}

.schedule-nav li a:hover {
  text-decoration: underline;
}

.schedule-content {
  flex: 1;
  min-width: 0;
}

/* Collapsible schedule sections */
details.schedule-section {
  margin-bottom: 20px;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  background: white;
}

details.schedule-section>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--c-surface-raised);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

details.schedule-section>summary::-webkit-details-marker {
  display: none;
}

.editing-schedule-name {
  margin: 0;
}

.schedule-name-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--c-primary);
  font: inherit;
  outline: none;
  padding: 12px 14px;
  width: 18em;
}

.schedule-name {
  cursor: pointer;
  font-size: 18px;
  margin: 8px 0 4px;
  padding: 12px 0px 0px 14px;
}

.schedule-name:hover {
  color: var(--c-primary);
}

.summary-toggle {
  font-size: 11px;
  color: #888;
}

details.schedule-section[open]>summary .summary-toggle::before {
  content: "▲";
}

details.schedule-section:not([open])>summary .summary-toggle::before {
  content: "▼";
}

.schedule-summary-label {
  color: var(--c-text-muted);
  flex: 1;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
  white-space: nowrap;
}

details.schedule-section[open]>summary .schedule-summary-label {
  opacity: 0;
}

.schedule-summary-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
  margin-right: 8px;
  opacity: 0;
  transition: opacity 0.1s;
}

details.schedule-section>summary:hover .schedule-summary-actions {
  opacity: 1;
}

.schedule-delete-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--c-danger-text, #dc2626);
  cursor: pointer;
  font-size: 13px;
  opacity: 0;
  padding: 2px 8px;
  transition: opacity 0.15s;
}

.schedule-page:hover .schedule-delete-btn {
  opacity: 1;
}

.schedule-delete-btn:hover {
  background: var(--c-danger-bg, #fee2e2);
  border-color: var(--c-danger-text, #dc2626);
}

.col-actions-header {
  width: 1%;
  white-space: nowrap;
}

.export-dxf-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--c-text-muted);
  font-size: 12px;
  opacity: 0;
  padding: 2px 6px;
  text-decoration: none;
  transition: opacity 0.1s;
  white-space: nowrap;
}

thead:hover .export-dxf-btn {
  opacity: 1;
}

.export-dxf-btn:hover {
  background: var(--c-bg-subtle, #f3f4f6);
  border-color: var(--c-border);
  color: var(--c-text);
  opacity: 1;
}

.edit-columns-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  padding: 2px 6px;
  transition: opacity 0.1s;
  white-space: nowrap;
}

thead:hover .edit-columns-btn {
  opacity: 1;
}

.edit-columns-btn:hover {
  background: var(--c-bg-subtle, #f3f4f6);
  border-color: var(--c-border);
  color: var(--c-text);
  opacity: 1;
}

/* Columns modal */
.columns-modal {
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 0;
  width: min(420px, 90vw);
}

.columns-modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.columns-modal-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.columns-modal-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.col-modal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.col-modal-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.col-modal-move-btns {
  display: flex;
  flex-direction: row;
  gap: 2px;
  flex-shrink: 0;
}

.col-modal-move {
  background: none;
  border: none;
  border-radius: 3px;
  color: var(--c-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 3px 5px;
}

.col-modal-move:hover:not(:disabled) {
  background: var(--c-hover, #f0f0f0);
  color: var(--c-text);
}

.col-modal-move:disabled {
  opacity: 0.2;
  cursor: default;
}

.col-modal-label {
  border: 1px solid var(--c-border);
  border-radius: 4px;
  flex: 1;
  font-size: 14px;
  padding: 5px 8px;
}

.col-modal-label:focus {
  border-color: var(--c-green-mid, #2f7c57);
  outline: none;
}

.col-modal-delete {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--c-danger-text, #dc2626);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
  opacity: 0;
  padding: 4px 8px;
  transition: opacity 0.1s;
}

.col-modal-row:hover .col-modal-delete,
.col-modal-delete:focus-visible {
  opacity: 1;
}

.col-modal-delete:hover {
  background: var(--c-danger-bg, #fee2e2);
  border-color: var(--c-danger-text, #dc2626);
}

.col-modal-add-form {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.col-modal-new-input {
  border: 1px solid var(--c-border);
  border-radius: 4px;
  flex: 1;
  font-size: 14px;
  padding: 5px 8px;
}

.col-modal-new-input:focus {
  border-color: var(--c-green-mid, #2f7c57);
  outline: none;
}

.col-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.add-item-row {
  margin: 6px 0 8px;
  justify-content: center;
  display: flex;
  padding: 8px;
}

/* Hide the empty-state row once real item rows exist */
.schedule-table tbody:has(.item-row) .item-row-empty {
  display: none;
}

.cell-placeholder {
  color: var(--c-text-muted);
  font-size: 12px;
  font-style: italic;
}

.add-schedule-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 20px 0 8px;
}

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

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

.button-secondary:active {
  background: var(--c-surface-raised);
  border-color: var(--c-border-strong);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 16%);
  color: var(--c-text);
  transform: translateY(1px);
}

footer {
  border-top: 1px solid var(--c-border);
  margin-top: 48px;
  padding: 24px 0;
}

.footer-inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
  max-width: 960px;
  padding: 0 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--c-text-muted);
  font-size: 13px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--c-text);
  text-decoration: underline;
}

.footer-copy {
  color: var(--c-text-label);
  font-size: 12px;
  margin: 0;
}


.schedule-notes {
  border-bottom: 1px solid var(--c-surface-raised);
  color: var(--c-text-muted);
  font-size: 13px;
  margin: 0;
  padding: 8px 14px;
  white-space: pre-wrap;
}

.editable-notes {
  cursor: pointer;
}

.editable-notes:hover {
  background: var(--c-surface);
}

.notes-placeholder {
  color: var(--c-text-label);
  font-style: italic;
}

.schedule-notes-text {
  white-space: pre-wrap;
}

.editing-notes {
  border-bottom: 1px solid var(--c-surface-raised);
  padding: 0;
}

.schedule-notes-input {
  background: transparent;
  border: 1px solid var(--c-accent);
  border-radius: 4px;
  box-sizing: border-box;
  color: inherit;
  display: block;
  field-sizing: content;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  padding: 8px 14px;
  resize: vertical;
  white-space: pre-wrap;
  width: 100%;
}

details.schedule-section table {
  border-top: 1px solid var(--c-border);
}

.schedule-empty {
  padding: 12px 14px;
  display: block;
}

.login-page {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
}

.not-found-page {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
}

.not-found-eyebrow {
  color: var(--c-text-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.not-found-message {
  color: var(--c-text-muted);
  margin: 0 0 24px;
}

.static-page {
  margin: 64px auto;
  max-width: 720px;
  padding: 0 24px;
}

.static-page h1 {
  margin-bottom: 16px;
}

.static-page h2 {
  font-size: 18px;
  margin: 28px 0 8px;
}

.static-page p,
.static-page li {
  color: var(--c-text-muted);
  line-height: 1.6;
}

.static-page ul {
  padding-left: 20px;
}

/* Page header (projects list) */
.page-header {
  align-items: baseline;
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  justify-content: space-between;
}

.page-header h1 {
  margin: 0;
}

/* Breadcrumb */
.breadcrumb {
  color: var(--c-text-muted);
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--c-text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 7px;
  opacity: 0.5;
}

/* Home crumb: house icon + "My Projects". line-height:1 removes the line-box
   padding so align-items:center centers the icon on the text, not on the
   taller inherited line box (which left the icon sitting high). */
.breadcrumb-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.breadcrumb-home-icon {
  flex: none;
  width: 1.05em;
  height: 1.05em;
}

/* Project header */
.project-header {
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 28px;
  padding-bottom: 20px;
}

.project-header-main {
  align-items: flex-start;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.project-header-left {
  align-items: flex-start;
  display: flex;
  flex: 1 1 360px;
  gap: 16px;
  min-width: 0;
}

.project-header-text {
  flex: 1;
  min-width: 0;
}

.project-header-text h1 {
  margin: 0 0 6px;
}

.project-header-right {
  align-items: flex-start;
  display: flex;
  flex: 0 1 340px;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.share-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-left: 3px solid var(--c-primary-mid);
  border-radius: 6px;
  padding: 12px 14px;
  width: 100%;
  box-sizing: border-box;
}

.share-box-label {
  color: var(--c-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.share-box-explainer {
  color: var(--c-text-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 10px;
}

.share-box-url-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.share-box-url-input {
  background: #fff;
  border: 1px solid var(--c-border-mid);
  border-radius: 4px;
  color: var(--c-text);
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 0;
  padding: 6px 8px;
  text-overflow: ellipsis;
}

.share-box-copy-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 13px;
}

.share-box-copy-btn:active {
  background: var(--c-primary-dark);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 24%);
  color: white;
  transform: translateY(1px);
}

.project-actions-menu {
  align-self: flex-end;
}

.project-actions-row {
  display: flex;
  justify-content: space-between;
  margin: -12px 0 12px;
}

/* ── Project actions modal ────────────────────────────────────────
   A single "Share & Export" button in the project header opens this
   modal. It restores the verbose, visually-communicative distribution
   cards (DXF / PDF / read-only link), groups schedule + collaborator
   management, and walls deletion off in a danger zone — keeping the
   page itself clean while giving non-technical users room to read. */
.project-share-btn {
  align-items: center;
  display: inline-flex;
  font-size: 15px;
  gap: 7px;
  padding: 10px 16px;
}

.actions-modal {
  position: relative;
  width: min(640px, 92vw);
}

.actions-modal .columns-modal-inner {
  max-height: 88vh;
  overflow-y: auto;
}

.actions-modal-sub {
  color: var(--c-text-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: -4px 0 4px;
}

.actions-modal-close {
  background: none;
  border: none;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  right: 10px;
  top: 10px;
}

.actions-modal-close:hover {
  color: var(--c-text);
}

.distribute-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Distribution cards — verbose and visually communicative. */
.distribute-card {
  align-items: flex-start;
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--c-text);
  display: flex;
  gap: 12px;
  padding: 14px;
  text-decoration: none;
  transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.05s;
  width: 100%;
}

.distribute-card--primary {
  border-color: var(--c-primary-mid);
  border-left: 4px solid var(--c-primary-mid);
}

.distribute-card--primary:hover {
  background: var(--c-surface-hover);
  box-shadow: 0 2px 10px rgb(20 95 67 / 14%);
}

.distribute-card--primary:active {
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 12%);
  transform: translateY(1px);
}

.distribute-card--secondary:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border-strong);
  box-shadow: 0 2px 10px rgb(0 0 0 / 8%);
}

.distribute-card-icon {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1.1;
}

.distribute-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.distribute-card-title {
  align-items: center;
  color: var(--c-text);
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 700;
  gap: 8px;
}

.distribute-card-tag {
  background: var(--c-surface-raised);
  border-radius: 999px;
  color: var(--c-text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  text-transform: uppercase;
}

.distribute-card-desc {
  color: var(--c-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.distribute-card-cta {
  color: var(--c-primary-mid);
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.distribute-card .share-box-url-row {
  margin-top: 8px;
}

/* Management + danger sections below the cards. */
.actions-modal-section {
  border-top: 1px solid var(--c-border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
}

.actions-modal-section-label {
  color: var(--c-text-label);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.actions-modal-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions-modal-danger {
  align-items: center;
  border-top: 1px solid var(--c-danger-border, #fca5a5);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 14px;
}

.actions-modal-danger-text {
  color: var(--c-text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.actions-modal-danger form {
  flex-shrink: 0;
  margin: 0;
}

.button-danger,
.button-danger:hover,
.button-danger:active {
  background: var(--c-danger-bg, #fde8e8);
  border-color: var(--c-danger-border, #9b2b2b);
  color: var(--c-danger-text, #5c1a1a);
}

.button-danger:hover {
  background: #f8d4d4;
}


/* ── User account menu (header) ───────────────────────────────── */
.user-menu {
  position: relative;
}

.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }

.user-menu-trigger {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  color: white;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 14px;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  transition: background 0.15s;
}

.user-menu-trigger:hover {
  background: rgba(255,255,255,0.12);
}

.user-avatar {
  align-items: center;
  background: var(--c-primary-mid);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  letter-spacing: 0.02em;
  width: 28px;
  flex-shrink: 0;
}

.user-avatar--lg {
  font-size: 18px;
  height: 44px;
  width: 44px;
}

.user-display-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-chevron {
  font-size: 11px;
  opacity: 0.7;
}

.user-menu-dropdown {
  background: white;
  border: 1px solid var(--c-border-mid);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
  min-width: 260px;
  padding: 8px 0;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1000;
}

.user-menu-identity {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
}

.user-menu-name {
  color: var(--c-text);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
}

.user-menu-email {
  color: var(--c-text-muted);
  font-size: 12px;
  margin: 0;
  word-break: break-all;
}

.user-menu-divider {
  border-top: 1px solid var(--c-border-light);
  margin: 4px 0;
}

.user-menu-item {
  align-items: center;
  background: none;
  border: none;
  color: var(--c-text);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 14px;
  gap: 8px;
  padding: 9px 16px;
  text-decoration: none;
  width: 100%;
}

.user-menu-item:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
}

.user-menu-item--signout {
  color: var(--c-text-muted);
}

/* ── Settings page ────────────────────────────────────────────── */
.settings-page {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.settings-section {
  background: white;
  border: 1px solid var(--c-border-light);
  border-radius: 8px;
  padding: 20px 24px;
}

.settings-section--danger {
  border-color: var(--c-danger-border, #fca5a5);
}

.settings-section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
}

.settings-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  font-size: 14px;
  margin: 0;
}

.settings-dl dt {
  color: var(--c-text-muted);
  font-weight: 600;
}

.settings-dl dd {
  margin: 0;
  color: var(--c-text);
}

.actions-menu {
  position: relative;
}

.actions-menu>summary {
  list-style: none;
}

.actions-menu>summary::-webkit-details-marker {
  display: none;
}

.actions-menu-btn {
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-text);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
  padding: 6px 12px;
  user-select: none;
  white-space: nowrap;
}

.actions-menu-btn:hover {
  background: var(--c-surface-hover);
}

.actions-menu-list {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 100;
}

.actions-menu-item {
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--c-text);
  cursor: pointer;
  display: block;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.actions-menu-item:hover {
  background: var(--c-surface-hover);
}

.actions-menu-item--danger {
  color: var(--c-danger-text, #dc2626);
}

.actions-menu-item--danger:hover {
  background: var(--c-danger-bg, #fee2e2);
}

.actions-menu-divider {
  border-top: 1px solid var(--c-border);
  margin: 4px 0;
}

.meta-field {
  display: grid;
  gap: 3px;
  margin-top: 10px;
}

.meta-label {
  color: var(--c-text-label);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-value {
  color: var(--c-text-muted);
  font-size: 13px;
}

.meta-placeholder {
  color: var(--c-text-label);
  font-size: 13px;
  font-style: italic;
}

.project-hero-wrap {
  border-radius: 6px;
  flex-shrink: 0;
  height: 90px;
  width: 120px;
}

.project-hero-img {
  border: 1px solid var(--c-border);
  border-radius: 6px;
  display: block;
  height: 90px;
  object-fit: cover;
  width: 120px;
}

.project-hero-initial {
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: inherit;
  color: var(--c-text-muted);
  display: flex;
  font-size: 32px;
  font-weight: 700;
  height: 90px;
  justify-content: center;
  width: 120px;
}

.copy-toast {
  background: #1a1a1a;
  border-radius: 6px;
  bottom: 24px;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  padding: 8px 16px;
  pointer-events: none;
  position: fixed;
  right: 24px;
  transition: opacity 0.18s;
  z-index: 9999;
}

.copy-toast--visible {
  opacity: 1;
}

/* New-user idle hint toast — larger, friendlier, with a close button */
.hint-toast {
  background: #fff;
  border: 1px solid var(--c-border-mid);
  border-left: 4px solid var(--c-primary-mid);
  border-radius: 8px;
  bottom: 28px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 14%);
  max-width: 320px;
  padding: 14px 16px 14px 14px;
  position: fixed;
  right: 28px;
  z-index: 9998;
}

.hint-toast[hidden] {
  display: none;
}

.hint-toast-close {
  background: none;
  border: none;
  color: var(--c-text-dim);
  cursor: pointer;
  float: right;
  font-size: 14px;
  line-height: 1;
  margin: -2px -4px 0 8px;
  padding: 2px 4px;
}

.hint-toast-close:hover {
  color: var(--c-text);
}

.hint-toast-body {
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* Button size variant */
.button-sm {
  font-size: 13px;
  padding: 5px 10px;
}

/* Empty-state schedule prompt */
.schedule-empty-state {
  padding: 24px 0;
}


/* Form pages (new/edit views) */
.form-page {
  max-width: 560px;
}

.form-page h1 {
  margin: 0 0 16px;
}

.form-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 24px;
}

.form-fields {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.form-fields label {
  margin: 0;
}

/* Danger zone */
.danger-zone {
  background: var(--c-danger-bg);
  border: 1px solid var(--c-danger-border);
  border-radius: 8px;
  padding: 16px;
}

.danger-zone h3 {
  color: var(--c-danger-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.danger-zone p {
  color: var(--c-danger-text);
  font-size: 13px;
  margin: 0;
}

@media print {
  body {
    background: white;
    color: black;
    font-size: 10pt;
  }

  header,
  form,
  .actions,
  .button,
  button {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
  }

  a {
    color: black;
    text-decoration: none;
  }

  table {
    page-break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
  }

  th,
  td {
    border: 1px solid #222;
    padding: 6px;
  }

  th {
    background: white;
    font-size: 9pt;
  }
}

/* Public share view */
.share-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

.share-header {
  margin-bottom: 28px;
}

.share-hero-img {
  border-radius: 8px;
  display: block;
  height: 180px;
  margin-bottom: 16px;
  object-fit: cover;
  width: 100%;
}

.share-project-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.share-project-address {
  color: var(--c-text-muted);
  font-size: 14px;
  margin: 0 0 4px;
}

.share-project-description {
  color: var(--c-text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.share-search {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 16px;
  outline: none;
  padding: 12px 16px;
  width: 100%;
}

.share-search:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 15%, transparent);
}

.share-schedule {
  margin-bottom: 36px;
}

.share-schedule-name {
  border-bottom: 2px solid var(--c-border);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
  padding-bottom: 8px;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.share-room-name {
  color: var(--c-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 20px 0 8px;
  text-transform: uppercase;
}

.share-note {
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.6;
}

.share-schedule-notes {
  color: var(--c-text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.spec-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.spec-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.spec-card-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.spec-code {
  background: var(--c-primary);
  border-radius: 4px;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
}

.spec-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.spec-thumb {
  border-radius: 6px;
  height: 80px;
  object-fit: cover;
  width: 100%;
}

.spec-fields {
  display: grid;
  gap: 6px;
  margin: 0;
}

.spec-field {
  display: grid;
  gap: 2px;
  grid-template-columns: 110px 1fr;
}

.spec-field dt {
  color: var(--c-text-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding-top: 1px;
  text-transform: uppercase;
}

.spec-field dd {
  color: var(--c-text);
  font-size: 14px;
  margin: 0;
}

.spec-source-link {
  color: var(--c-primary);
  font-size: 13px;
  margin-top: auto;
  text-decoration: none;
}

.spec-source-link:hover {
  text-decoration: underline;
}
/* ── Admin dashboard ─────────────────────────────────────────────── */
.admin-section {
  margin: 28px 0;
}

.admin-pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0 0 12px;
}

.admin-pagination--bottom {
  margin: 12px 0 0;
}

.admin-pagination-count,
.admin-pagination-page {
  color: var(--c-text-muted);
  font-size: 13px;
}

.admin-pagination-count {
  margin: 0;
}

.admin-pagination-controls {
  align-items: center;
  display: flex;
  gap: 8px;
}

.admin-section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-label);
  margin: 0 0 12px;
}
.admin-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  min-width: 130px;
  padding: 14px 18px;
}
.admin-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-text);
}
.admin-stat-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--c-text-muted);
  margin-left: 2px;
}
.admin-stat-label {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 4px;
}
.admin-stat-sub {
  font-size: 11px;
  color: var(--c-primary-mid);
  margin-top: 3px;
}
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}
.admin-table th,
.admin-table td {
  border: 1px solid var(--c-border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  background: var(--c-surface-raised);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}
.admin-row-error td {
  background: #fff8f8;
}
.admin-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.admin-url {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-url a {
  color: var(--c-text-muted);
  font-size: 12px;
  text-decoration: none;
}
.admin-url a:hover {
  text-decoration: underline;
}
.admin-badge {
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
}
.admin-badge-ok   { background: #e6f4ea; color: #1e6b3a; }
.admin-badge-err  { background: #fdecea; color: #a33; cursor: help; }
.admin-badge-warn { background: #fff7e6; color: #a05800; }

.admin-reqid {
  font-size: 11px;
  color: var(--c-muted);
  text-decoration: none;
  white-space: nowrap;
}
.admin-reqid:hover { color: var(--c-green); text-decoration: underline; }

.admin-detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  align-items: baseline;
  font-size: 14px;
  max-width: 900px;
}
.admin-detail dt {
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
}
.admin-detail dd { margin: 0; word-break: break-all; }

.admin-json {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: 0;
}
.jk { color: #005cc5; }
.js { color: #22863a; }
.jb { color: #d73a49; }
.jn { color: #e36209; }

.admin-payload summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 4px 0;
  user-select: none;
}
.admin-payload[open] summary { margin-bottom: 10px; }
.admin-payload .admin-json { max-height: 500px; overflow-y: auto; }

.admin-prompt-block { margin: 0 0 12px; }
.admin-prompt-block h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
  margin: 0 0 4px;
}
.admin-prompt-text {
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 10px 12px;
  margin: 0;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}

.admin-stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.admin-stat-card-link:hover {
  border-color: var(--c-green);
  background: color-mix(in srgb, var(--c-green) 6%, var(--c-surface));
}

.admin-chart-row {
  margin-top: 20px;
}
.admin-chart-wrap {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 16px 20px 12px;
}
.admin-chart-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.admin-chart-title {
  color: var(--c-text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-range-btns {
  display: flex;
  gap: 2px;
}
.admin-range-btn {
  background: none;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.admin-range-btn:hover {
  border-color: var(--c-green);
  color: var(--c-green);
}
.admin-range-btn.active {
  background: var(--c-green);
  border-color: var(--c-green);
  color: #fff;
}

/* ── Collaborators / shared projects ─────────────────────────────────── */
.badge-shared {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e8f0fe;
  color: #1a56c4;
}

.collaborators-section {
  padding: 0 1.5rem 0.75rem;
}

.collaborators-section--member {
  padding-top: 0.25rem;
}

.collaborators-details summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-muted);
  user-select: none;
  padding: 0.25rem 0;
}

.collaborators-details summary::-webkit-details-marker { display: none; }

.collaborators-details[open] summary { color: var(--c-text); }

.collaborators-body {
  padding: 0.75rem 0 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.collaborators-add-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.collaborators-email-input {
  flex: 1;
  font-size: 0.85rem;
  padding: 4px 8px;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  background: var(--c-surface);
  color: var(--c-text);
  min-width: 0;
}

.collaborators-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.collaborators-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.collaborators-name { font-weight: 500; }

.collaborators-email { font-size: 0.78rem; flex: 1; }

.collaborators-empty { font-size: 0.85rem; margin: 0; }

.collaborators-remove-btn {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 4px;
  border-radius: 3px;
}

.collaborators-remove-btn:hover { background: #fdecea; }

.collaborators-error {
  font-size: 0.85rem;
  color: #c0392b;
  margin: 0;
  padding: 6px 10px;
  background: #fdecea;
  border-radius: 5px;
}

.button--small {
  font-size: 0.82rem;
  padding: 4px 10px;
}

.button-disabled {
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

.button--danger {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}
.button--danger:hover {
  background: #b91c1c;
}
.admin-token-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #555;
}
.admin-token-hint code {
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.06);
  padding: 1px 4px;
  border-radius: 3px;
}
.admin-dim {
  color: var(--c-text-dim, #999);
}

.admin-login-link-banner {
  background: #edf6ff;
  border: 1px solid #90c8f8;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}
.admin-login-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.admin-login-link-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 5px 8px;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  background: white;
  color: var(--c-text);
  min-width: 0;
}
.admin-create-user-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sched-reorder-name {
  flex: 1;
  font-size: 0.9rem;
  padding: 4px 6px;
}

/* Image picker dialog (opened from item row thumbnail) */
.image-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
}
.image-picker-dialog-inner {
  background: var(--c-surface, #fff);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
  width: min(680px, 92vw);
}
.image-picker-dialog-header {
  align-items: center;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  padding: 14px 18px 10px;
}
.image-picker-dialog-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.image-picker-dialog-inner .image-picker-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
}
.image-picker-dialog-inner .image-upload-form {
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
  padding: 10px 16px 16px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--c-text-dim, #888);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 2px 6px;
}
.modal-close:hover {
  color: var(--c-text, #111);
}

/* Item row thumbnail button */
.item-thumb-btn {
  display: block;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}

/* Image picker — server-side item detail */
.item-image-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.image-picker-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.picker-thumb {
  width: 56px;
  height: 56px;
  padding: 2px;
  border: 2px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-bg-alt);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}
.picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}
.picker-thumb.active {
  border-color: var(--c-accent);
}
.image-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--c-text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border: 1px dashed var(--c-border);
  border-radius: 5px;
  width: fit-content;
}
.image-upload-label:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* Image picker — Sally panel (React) */
.image-preview-btn {
  display: block;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  width: 100%;
}
.image-preview-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  pointer-events: none;
}
.image-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding: 4px 2px;
  width: 100%;
  box-sizing: border-box;
}
.image-picker-thumb {
  display: block;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--c-bg-alt, #f5f5f5);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}
.image-picker-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}
.image-picker-thumb.selected {
  border-color: var(--c-accent, #4f7eff);
  box-shadow: 0 0 0 2px var(--c-accent, #4f7eff);
}

/* Schedule tile grid (project page) */
.schedule-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.schedule-tile {
  background: white;
  border: 1px solid var(--c-border-light);
  border-radius: 10px;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.1s;
}

.schedule-tile:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* Thumbnail grid inside the tile: up to 6 images in a 2×3 arrangement.
 * Fewer images just fill from top-left; empty slots stay as surface. */
.schedule-tile-thumbs {
  aspect-ratio: 4 / 3;
  background: var(--c-surface-image);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  overflow: hidden;
  position: relative;
}

.schedule-tile-thumb {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* When there's only one image, let it fill the whole card header. */
.schedule-tile-thumbs:has(.schedule-tile-thumb:only-child) .schedule-tile-thumb {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.schedule-tile-placeholder {
  align-items: center;
  color: var(--c-text-dim);
  display: flex;
  font-size: 2rem;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  justify-content: center;
}

.schedule-tile-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
}

.schedule-tile-name {
  color: var(--c-text);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-tile-meta {
  color: var(--c-text-muted);
  font-size: 13px;
  margin: 0;
}

.schedule-tile-updated {
  color: var(--c-text-dim);
  font-size: 12px;
  margin: 0;
}

/* Keep the old list rule around for any remaining references */
/* Schedule list (project page) */
.schedule-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: white;
  overflow: hidden;
}
.schedule-list-row + .schedule-list-row {
  border-top: 1px solid var(--c-border);
}
.schedule-list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  color: inherit;
  text-decoration: none;
  transition: background 0.1s;
}

.schedule-list-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.schedule-list-hint {
  color: var(--c-text-link);
  font-size: 12px;
  font-style: italic;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.schedule-list-row:hover .schedule-list-hint {
  opacity: 1;
}

.schedule-list-thumbs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.schedule-list-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--c-border-light);
}
.schedule-list-link:hover {
  background: var(--c-surface-raised);
}
.schedule-list-name {
  font-size: 16px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-list-kind {
  color: var(--c-text-muted);
  font-weight: 400;
  font-size: 13px;
}
.schedule-list-meta {
  color: var(--c-text-muted);
  font-size: 13px;
  white-space: nowrap;
}
.schedule-list-count {
  margin-right: 4px;
}

/* Single-schedule page */
.schedule-page {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 18px 22px 22px;
}
.schedule-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.schedule-page-header h1 {
  margin: 0;
  font-size: 22px;
}
.schedule-page-actions {
  display: flex;
  gap: 8px;
}

/* === Contractor view === */

.item-thumb-btn--lightbox {
  background: none;
  border: none;
  cursor: zoom-in;
  padding: 0;
}

.item-thumb-btn--lightbox:hover .item-thumb {
  opacity: 0.85;
}

.lightbox-dialog {
  background: transparent;
  border: none;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
}

.lightbox-dialog::backdrop {
  background: rgb(0 0 0 / 80%);
  cursor: zoom-out;
}

.lightbox-img {
  display: block;
  max-width: min(90vw, 960px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-stage {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.lightbox-close {
  align-items: center;
  background: rgb(0 0 0 / 55%);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 17px;
  height: 36px;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 36px;
  z-index: 2;
}

.lightbox-close:hover {
  background: rgb(0 0 0 / 78%);
}

.lightbox-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: min(90vw, 960px);
}

.lightbox-thumb {
  background: rgb(255 255 255 / 10%);
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  flex: 0 0 auto;
  height: 56px;
  overflow: hidden;
  padding: 0;
  width: 56px;
}

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

.lightbox-thumb:hover {
  border-color: rgb(255 255 255 / 55%);
}

.lightbox-thumb.is-active {
  border-color: #fff;
}

.contractor-grand-total {
  align-items: baseline;
  border-top: 2px solid var(--c-border);
  display: flex;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 18px;
  justify-content: flex-end;
}

.contractor-grand-total-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--c-text);
  flex-shrink: 0;
}

.contractor-grand-total-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  flex-shrink: 0;
}

.contractor-grand-total-note {
  color: var(--c-text-muted);
  font-size: 12px;
  display: flex;
  justify-content: flex-end;
}

.readonly-badge {
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-left: 3px solid var(--c-text-muted);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  padding: 12px 14px;
}

.readonly-badge-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.readonly-badge-title {
  color: var(--c-text);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
}

.readonly-badge-sub {
  color: var(--c-text-muted);
  font-size: 12px;
  margin: 0;
}

.contractor-banner {
  background: rgb(0 100 0 / 5%);
  border: 1px solid rgb(0 100 0 / 25%);
  border-radius: 4px;
  color: #2a5d2a;
  font-size: 14px;
  line-height: 1.4;
  margin: 14px auto;
  padding: 10px 14px;
  max-width: 480px;
}
.contractor-banner p { margin: 0; }

.schedule-list-subtotal {
  color: var(--c-text);
  font-weight: 600;
}
.schedule-list-warn {
  color: var(--c-warning);
  margin-left: 2px;
  cursor: help;
}

.price-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.lead-value {
  color: var(--c-text);
  font-size: 13px;
}
.stock-chip {
  border-radius: 10px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.stock-chip.stock-in_stock     { background: #def2db; color: #1f5e1f; }
.stock-chip.stock-low_stock    { background: #fff1d6; color: #8a5a00; }
.stock-chip.stock-backordered  { background: #ffe1d6; color: #8a3a00; }
.stock-chip.stock-out_of_stock { background: #ffd6d6; color: #8a1f1f; }
.stock-chip.stock-unknown      { background: #eee; color: #555; }
.stock-count {
  color: var(--c-text-muted);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
}
.shop-link {
  color: var(--c-primary-mid);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.shop-link:hover { text-decoration: underline; }

.freshness {
  border-radius: 8px;
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  margin-top: 2px;
  padding: 1px 6px;
  white-space: nowrap;
}
.freshness--fresh   { background: #def2db; color: #1f5e1f; }
.freshness--amber   { background: #fff1d6; color: #8a5a00; }
.freshness--red     { background: #ffd6d6; color: #8a1f1f; }
.freshness--unknown { background: #eee; color: #666; }

.contractor-totals-row {
  background: var(--c-surface-raised);
  border-top: 2px solid var(--c-border-mid, #aaa);
  font-weight: 600;
}
.contractor-totals-label {
  padding: 12px;
  text-align: right;
}
.contractor-totals-coverage {
  color: var(--c-text-muted);
  display: block;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
}
.contractor-totals-value {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  padding: 12px;
  text-align: right;
}

.contractor-totals-warnings {
  background: rgb(179 92 0 / 6%);
  border-left: 4px solid var(--c-warning);
  border-radius: 0 4px 4px 0;
  color: #5b3a00;
  margin: 16px 0 0;
  padding: 12px 16px;
}
.contractor-totals-headline {
  color: var(--c-warning);
  font-weight: 700;
  margin: 0 0 8px;
}
.contractor-totals-warnings ul { margin: 0; padding-left: 20px; }
.contractor-totals-warnings li { font-size: 13px; line-height: 1.5; margin: 4px 0; }

/* Print-friendly — contractors will print this. */
@media print {
  header, footer, .breadcrumb, .add-schedule-row, .contractor-banner { display: none !important; }
  .schedule-page { break-inside: avoid; page-break-inside: avoid; }
  .contractor-totals-row { background: #fff !important; }
  .shop-link::after { content: " (" attr(href) ")"; font-weight: 400; font-size: 10px; }
}
