:root {
  --bg: #f5f6fb;
  --ink: #0f172a;
  --muted: #5b6676;
  --accent: #e31d23;
  --accent-dark: #b1161a;
  --accent-soft: #fff4f4;
  --panel: #ffffff;
  --line: #e5e7ee;
  --shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
  --chip: #f1f3f9;
  --radius: 14px;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
  touch-action: manipulation;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--cvct-font-sans, "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif);
  overflow-x: hidden;
}

.pricing-sidebar-controls {
  display: none;
}

.cvct-theme .app-nav-count[hidden] {
  display: none !important;
}

.pricing-shell-legacy-app-shell {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  min-height: 100vh;
}

.pricing-shell-legacy-app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  box-shadow: none;
}

.pricing-shell-legacy-app-main {
  min-width: 0;
  padding: 14px;
  background: #ffffff;
}

.pricing-shell-legacy-app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8edf3;
}

.pricing-shell-legacy-app-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 38px;
  border-radius: 12px;
  background: #fff1f2;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pricing-shell-legacy-app-brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.pricing-shell-legacy-app-nav {
  display: grid;
  gap: 8px;
}

.pricing-shell-legacy-app-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #374151;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: none;
}

.pricing-shell-legacy-app-nav-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pricing-shell-legacy-app-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.pricing-shell-legacy-app-nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pricing-shell-legacy-app-nav-btn:hover {
  border-color: #f5d9dd;
  background: #fffdfd;
  color: var(--ink);
  transform: none;
}

.pricing-shell-legacy-app-nav-btn.is-active {
  border-color: rgba(214, 24, 40, 0.14);
  background: #fff4f5;
  color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.pricing-shell-legacy-app-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.pricing-shell-legacy-app-sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #e8edf3;
}

.pricing-shell-legacy-app-sidebar-footer .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
}

.pricing-shell-legacy-app-sidebar-footer .secondary:hover {
  background: #f8fafc;
  border-color: #d1d5db;
  color: var(--ink);
}

.topbar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #d9e1ea;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.topbar-action-btn:hover {
  border-color: #f5d9dd;
  box-shadow: 0 10px 24px rgba(214, 24, 40, 0.06);
  transform: translateY(-1px);
}

.topbar-action-btn.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.topbar-action-btn.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.topbar-action-btn.btn-primary.save-state-saved,
.topbar-action-btn.save-state-saved {
  border-color: #bbf7d0 !important;
  background: #ecfdf5 !important;
  color: #166534 !important;
  box-shadow: none !important;
}

.topbar-action-btn.btn-primary.save-state-saved:hover,
.topbar-action-btn.save-state-saved:hover {
  border-color: #86efac !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: none !important;
}

.topbar-action-btn.btn-primary.save-state-idle,
.topbar-action-btn.save-state-idle {
  border-color: #d1d5db !important;
  background: #edf2f7 !important;
  color: #475569 !important;
  box-shadow: none !important;
}

.topbar-action-btn.btn-primary.save-state-idle:hover,
.topbar-action-btn.save-state-idle:hover {
  border-color: #cbd5e1 !important;
  background: #e2e8f0 !important;
  color: #334155 !important;
  box-shadow: none !important;
}

.topbar-action-btn.btn-primary.save-state-dirty,
.topbar-action-btn.save-state-dirty {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #ffffff !important;
}

.topbar-action-btn.btn-primary.save-state-dirty:hover,
.topbar-action-btn.save-state-dirty:hover {
  border-color: var(--accent-dark) !important;
  background: var(--accent-dark) !important;
  color: #ffffff !important;
}

.topbar-action-btn.btn-primary.save-state-saving,
.topbar-action-btn.save-state-saving {
  border-color: #cbd5e1 !important;
  background: #e2e8f0 !important;
  color: #334155 !important;
  box-shadow: none !important;
}

.pricing-toolbar-shell {
  position: sticky;
  top: 0;
  z-index: 45;
  padding-top: 6px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 82%, rgba(255, 255, 255, 0) 100%);
  backdrop-filter: blur(8px);
}

.pricing-toolbar-shell .modern-topbar-actions {
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px 12px !important;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.pricing-toolbar-shell .modern-topbar-actions > * {
  flex: 0 0 auto;
}

.pricing-toolbar-shell__nav,
.pricing-toolbar-shell__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pricing-toolbar-shell .sheet-actions-menu {
  display: inline-flex;
  align-items: stretch;
}

.pricing-toolbar-shell .sheet-actions-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .pricing-sidebar-controls {
    display: flex;
    min-height: 58px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--crm-line, var(--cvct-color-border));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  }

  .pricing-shell-legacy-app-shell {
    grid-template-columns: 1fr;
  }

  .pricing-shell-legacy-app-sidebar {
    position: relative;
    height: auto;
  }

  .pricing-toolbar-shell .modern-topbar-actions {
    flex-wrap: wrap;
  }

  .pricing-toolbar-shell__nav,
  .pricing-toolbar-shell__actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .pricing-toolbar-shell .topbar-action-btn,
  .pricing-toolbar-shell .sheet-actions-menu > summary {
    width: auto;
    min-width: 150px;
    flex: 1 1 150px;
  }

  .room-cards-shell__header,
  .room-details-modal__title-row,
  .room-card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .room-cards-shell {
    grid-template-columns: 1fr;
  }

  .room-cards-shell__details {
    position: static;
  }

  .room-cards-shell__actions {
    width: 100%;
  }

  .room-cards-shell__actions > * {
    width: 100%;
  }

  .room-card__grid,
  .room-card__totals,
  .room-details-modal__grid {
    grid-template-columns: 1fr;
  }
}

.cv-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 10px;
  background: #ffffff;
  border-bottom: 3px solid var(--accent);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 40;
}

.cv-logo { height: 42px; }

.cv-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.cv-title h1 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  color: var(--ink);
}

.cv-title span {
  display: block;
  font-size: 0.92rem;
  color: var(--muted);
}

.cv-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  z-index: 2;
}

.cv-header .cv-header-actions > .btn-primary,
.cv-header .cv-header-actions > .cv-header-link,
.cv-header .cv-header-actions .sheet-actions-menu > summary {
  min-height: 30px;
  padding: 0.24rem 0.58rem;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 600;
  border-radius: 8px;
}

.cv-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(227, 29, 35, 0.22);
  background: rgba(227, 29, 35, 0.08);
  color: #8d1318;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cv-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(17,24,39,0.05);
}

.cv-header-link:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(17,24,39,0.08);
}

.app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.55rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.card h3 {
  margin: 0 0 0.4rem;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(227, 29, 35, 0.03) 12%, transparent 24%);
  opacity: 0.8;
}

/* Main Navigation Tabs */
.main-tabs {
  margin-top: 0.05rem;
  display: flex;
  gap: 0.5rem;
  padding: 0.16rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.main-tabs .tab {
  border: none;
  background: transparent;
  padding: 0.42rem 0.82rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.main-tabs .tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(227, 29, 35, 0.22);
}

/* Sub-tabs within Estimate panel */
.sub-tabs {
  margin: 0.55rem 0 0.35rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sub-tabs .tab {
  border: 1px solid var(--line);
  background: var(--chip);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.sub-tabs .tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(227, 29, 35, 0.18);
}

/* Estimate tool tabs (Cabinets / Countertops) as full-width split tabs */
.pricing-sheet-main > .sub-tabs {
  margin: 0.35rem 0 0 !important;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-bottom: none;
  position: relative;
  z-index: 3;
}

.pricing-sheet-main > .sub-tabs + .panel,
.pricing-sheet-main > .sub-tabs + .panel.active {
  margin-top: 0 !important;
  position: relative;
  top: -1px;
}

.pricing-sheet-main > .sub-tabs .tab {
  flex: 1 1 50%;
  min-width: 0;
  text-align: center;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: #eef2f7;
  color: #4b5563;
  padding: 0.45rem 0.65rem;
  font-weight: 700;
}

.pricing-sheet-main > .sub-tabs .tab:hover {
  background: #fff7f8;
  color: var(--ink);
}

.pricing-sheet-main > .sub-tabs .tab.active {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
  border-bottom: 1px solid #ffffff;
  box-shadow: inset 0 -3px 0 var(--accent);
  margin-bottom: -1px;
}

.pricing-sheet-main > .panel {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.pricing-sheet-main > .card {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.pricing-sheet-main > .card::after {
  display: none;
}

.pricing-sheet-main > .card + .card {
  margin-top: 1rem;
}

.pricing-sheet-main > .card.dashboard-header,
.pricing-sheet-main > .card.worksheet-dashboard {
  padding: 0.85rem 0 0.3rem;
}

.pricing-sheet-main > .card.dashboard-header {
  display: none;
}

.pricing-sheet-main > .card.dashboard-header + .card.worksheet-dashboard {
  margin-top: 0;
}

.pricing-sheet-main .panel > .card {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.pricing-sheet-main .panel > .card::after {
  display: none;
}

.pricing-sheet-main > .panel.active > .card:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding-top: 0.15rem;
  position: relative;
  z-index: 2;
}

#panel-countertopsheet .room-sort { gap: 0.5rem; }

.pricing-sheet-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  min-height: calc(100vh - 74px);
}

.pricing-sheet-main {
  min-width: 0;
  display: grid;
  gap: 0;
  padding: 0 1rem 1rem;
}

.pricing-sheet-sidebar {
  align-self: start;
  position: sticky;
  top: 72px;
  height: calc(100vh - 84px);
  display: grid;
  gap: 1rem;
  padding: 1rem 0.9rem;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  box-shadow: 10px 0 26px rgba(17, 24, 39, 0.04);
  overflow: auto;
}

.pricing-sheet-sidebar__brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #edf2f7;
}

.pricing-sheet-sidebar__brand strong,
.pricing-sheet-sidebar__brand span {
  display: block;
}

.pricing-sheet-sidebar__brand span {
  color: var(--muted);
  font-size: 0.86rem;
}

.pricing-sheet-sidebar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe5e5 0%, #fff3f3 100%);
  border: 1px solid rgba(227, 29, 35, 0.18);
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.pricing-sheet-sidebar__nav {
  display: grid;
  gap: 0.35rem;
}

.pricing-sheet-sidebar__item,
.pricing-sheet-sidebar__footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 46px;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-weight: 700;
  text-align: left;
}

.pricing-sheet-sidebar__item:hover,
.pricing-sheet-sidebar__footer:hover {
  background: #fffafb;
  border-color: #f3d0d4;
}

.pricing-sheet-sidebar__item.is-active {
  background: linear-gradient(135deg, #fff0f0 0%, #fff7f7 100%);
  border-color: rgba(227, 29, 35, 0.18);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.pricing-sheet-sidebar__footer {
  margin-top: auto;
  border-color: #e2e8f0;
  background: #fff;
}

/* Panels */
.panel { display: none; margin-top: 0.8rem; }
.panel.active { display: grid; gap: 0.9rem; }

#panel-quickprice.panel.active {
  display: block;
}

#panel-estimate .panel { display: none; margin-top: 0; padding: 0; }
#panel-estimate .panel.active { display: block; }

.section-title-center {
  text-align: center;
}

.pricing-rules {
  display: grid;
  gap: 0.8rem;
  max-width: 1100px;
}

.pricing-rules__heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.pricing-rules__heading h2,
.pricing-rules__heading p {
  margin: 0;
}

.pricing-rules__heading > div > p:last-child {
  margin-top: 0.3rem;
  color: var(--muted);
  line-height: 1.45;
}

.pricing-rules__eyebrow {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pricing-rules__status {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
}

.pricing-rules__section {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fbfdff;
  overflow: hidden;
}

.pricing-rules__section summary {
  cursor: pointer;
  padding: 0.8rem 0.9rem;
  color: #334155;
  font-weight: 800;
}

.pricing-rules__content {
  padding: 0 0.9rem 0.9rem;
  color: #475569;
  line-height: 1.5;
}

.pricing-rules__content p,
.pricing-rules__content ul {
  margin: 0;
}

.pricing-rules__content ul {
  display: grid;
  gap: 0.35rem;
  padding-left: 1.2rem;
}

.pricing-rules__table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.65rem;
  background: #ffffff;
}

.pricing-rules__table th,
.pricing-rules__table td {
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.pricing-rules__table th {
  color: #334155;
  background: #f1f5f9;
}

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

.quick-price-tabs {
  display: flex;
  gap: 0.45rem;
  padding: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quick-price-tabs button {
  flex: 1 1 0;
  border: 0;
  border-radius: 9px;
  padding: 0.56rem 0.8rem;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.quick-price-tabs button.is-active {
  background: var(--accent);
  color: #fff;
}

.quick-pricing-mode .pricing-toolbar-shell {
  display: none !important;
}

.quick-pricing-library .pricing-toolbar-shell {
  display: none !important;
}

.quick-price-sidebar,
.quick-price-main {
  min-width: 0;
}

.quick-price-main {
  display: grid;
  gap: 0.9rem;
}

.quick-price-sidebar {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  max-height: none;
  overflow: visible;
}

.quick-price-sidebar__actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-price-sidebar__head,
.quick-price-toolbar,
.quick-price-attach-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.quick-price-sidebar__head h2,
.quick-price-toolbar h2,
.quick-price-attach-card__head h3 {
  margin: 0 0 0.25rem;
}

.quick-price-sidebar__head p,
.quick-price-toolbar p,
.quick-price-attach-card__head p {
  margin: 0;
  color: var(--muted);
}

.quick-price-draft-list {
  display: grid;
  gap: 0.7rem;
}

.quick-price-draft-search {
  display: block;
  margin: 0.8rem 0;
}

.quick-price-draft-search input {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.quick-price-draft-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: #fbfcff;
  display: grid;
  gap: 0.55rem;
}

.quick-price-draft-item h4,
.quick-price-room-card h4 {
  margin: 0;
}

.quick-price-draft-meta {
  color: var(--muted);
  font-size: 0.86rem;
  display: grid;
  gap: 0.2rem;
}

.quick-price-draft-actions,
.quick-price-toolbar__actions,
.quick-price-step-actions,
.quick-price-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-price-empty {
  margin: 0;
  padding: 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fbfcff;
}

.quick-price-selected-customer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #d7deea;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.quick-price-attach-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.quick-price-attach-grid input,
.quick-price-step input,
.quick-price-step select,
.quick-price-step textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.72rem 0.85rem;
  border: 1px solid #cfd7e5;
  border-radius: 12px;
  font: inherit;
}

.quick-price-customer-results {
  margin-top: 0.75rem;
}

.quick-price-page-host {
  display: grid;
  gap: 1rem;
}

.quick-price-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.quick-price-progress span {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
}

.quick-price-progress span.active {
  background: var(--accent);
}

.quick-price-step {
  display: grid;
  gap: 0.95rem;
}

.quick-price-step__eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 800;
}

.quick-price-step__title {
  margin: 0.15rem 0 0.25rem;
  font-size: 1.3rem;
}

.quick-price-step__copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quick-price-scope-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.quick-price-scope-btn {
  text-align: left;
  border: 1px solid #d7deea;
  border-radius: 16px;
  background: #fff;
  padding: 1rem 0.9rem;
  min-height: 120px;
  display: grid;
  gap: 0.35rem;
}

.quick-price-scope-btn.active {
  border-color: var(--accent);
  background: #fff4f4;
  box-shadow: 0 10px 20px rgba(227, 29, 35, 0.10);
}

.quick-price-scope-btn span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.quick-price-room-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.quick-price-room-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-price-room-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #d7deea;
  font-weight: 700;
}

.quick-price-room-pill button {
  border: none;
  background: transparent;
  padding: 0;
  min-height: auto;
  font-size: 1rem;
  color: #64748b;
}

.quick-price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.quick-price-jobtype-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.quick-price-jobtype-card {
  display: grid;
  gap: 0.35rem;
  border: 1px solid #e5e7ee;
  border-radius: 16px;
  background: #fbfcff;
  padding: 0.8rem;
}

.quick-price-jobtype-card span {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.quick-price-summary-card {
  border: 1px solid #ffd8da;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff7f7 0%, #fff 100%);
  padding: 0.85rem 0.9rem;
  display: grid;
  gap: 0.25rem;
}

.quick-price-summary-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.quick-price-summary-card strong {
  font-size: 1.08rem;
}

.quick-price-room-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem;
  background: #fff;
  display: grid;
  gap: 0.85rem;
}

.quick-price-room-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.quick-price-room-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.quick-price-room-total {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.quick-price-room-buttons {
  display: grid;
  gap: 0.65rem;
}

.quick-price-room-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  padding: 0.85rem 0.95rem;
}

.quick-price-room-button span {
  font-weight: 700;
}

.quick-price-room-button strong {
  font-size: 0.96rem;
  white-space: nowrap;
}

.quick-price-room-sections {
  display: grid;
  gap: 0.8rem;
}

.quick-price-room-section {
  border: 1px solid #e5e7ee;
  border-radius: 14px;
  padding: 0.8rem;
  background: #fbfcff;
  display: grid;
  gap: 0.7rem;
}

.quick-price-room-section h5 {
  margin: 0;
  font-size: 0.95rem;
}

.quick-price-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.quick-price-room-grid--cabinet {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-price-field {
  display: grid;
  gap: 0.3rem;
}

.quick-price-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

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

/* Summary Section */
.summary { display: none; }

.summary-legacy-totals { display: none; }

.estimate-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.45rem;
}

.estimate-totals div {
  background: linear-gradient(160deg, #ffffff 0%, #f7f9ff 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.36rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.estimate-totals span { font-size: 0.82rem; color: var(--muted); }
.estimate-totals strong { font-size: 1.02rem; }
.estimate-totals .grand { border-color: var(--accent); background: linear-gradient(150deg, #fff6f6 0%, #ffe9e9 100%); }

.dashboard-header {
  display: grid;
  gap: 0.35rem;
  padding: 0.2rem 0 0.85rem;
  border-bottom: 1px solid #e5e7ee;
  margin-bottom: 0.85rem;
}

.dashboard-header-top {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.3rem;
}

.estimate-header-copy {
  display: grid;
  gap: 0.14rem;
}

.estimate-header-inline {
  display: grid;
  gap: 0.15rem;
}

.dashboard-controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(240px, 1.05fr) minmax(320px, 1.3fr);
  gap: 0.32rem;
  align-items: end;
}

.dashboard-controls--header {
  align-items: stretch;
}

.dashboard-customer,
.dashboard-job {
  display: grid;
  gap: 0.35rem;
}

.active-meta-value {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 16px;
  background: #f4f6fa;
  color: #213040;
  font-weight: 700;
}

.dashboard-job input {
  min-height: 36px;
}

.dashboard-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dashboard-actions button {
  min-width: 98px;
  min-height: 32px;
  padding: 0.28rem 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.dashboard-actions--header {
  align-items: center;
}

#estimateCustomerName {
  display: block;
  font-size: 0.92rem;
  line-height: 1.25;
}

#estimateTitleDisplay {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #5f6c7b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#estimateTitleDisplay:hover,
#estimateTitleDisplay:focus-visible {
  color: #111827;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.worksheet-dashboard {
  display: grid;
  gap: 1rem;
  padding: 0.25rem 0 0.9rem;
  background: transparent;
  border-bottom: 1px solid #e5e7ee;
  margin-bottom: 0.9rem;
}

.worksheet-dashboard__top {
  display: grid;
  gap: 0.65rem;
}

.worksheet-dashboard__breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  color: #6b7280;
  font-size: 0.86rem;
  font-weight: 600;
}

.worksheet-dashboard__breadcrumbs button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.worksheet-dashboard__breadcrumbs button:hover,
.worksheet-dashboard__breadcrumbs button:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
}

.worksheet-dashboard__breadcrumbs button[disabled] {
  cursor: default;
  color: inherit;
  text-decoration: none;
  opacity: 0.82;
}

.worksheet-dashboard__breadcrumbs-separator {
  color: #94a3b8;
}

.worksheet-dashboard__title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.worksheet-dashboard__title-row h2,
.worksheet-dashboard__title-button {
  margin: 0.15rem 0 0;
  font-size: clamp(2.1rem, 3.25vw, 2.9rem);
  letter-spacing: -0.03em;
}

.worksheet-dashboard__title-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}

.worksheet-dashboard__title-button:hover,
.worksheet-dashboard__title-button:focus-visible {
  color: #111827;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.worksheet-dashboard__title-button::after {
  content: "";
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  opacity: 0.75;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.worksheet-dashboard__eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.worksheet-dashboard__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(35, 197, 94, 0.24);
  background: rgba(35, 197, 94, 0.1);
  color: #15803d;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.worksheet-dashboard__status.is-saving {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.worksheet-dashboard__status.is-dirty {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.worksheet-dashboard__status.is-idle {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.1);
  color: #475569;
}

.worksheet-dashboard__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  color: #475569;
  font-size: 0.92rem;
}

.worksheet-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.worksheet-stat-tile {
  min-width: 0;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(216, 222, 234, 0.9);
  background: #ffffff;
  box-shadow: none;
  display: grid;
  gap: 0.35rem;
}

.worksheet-stat-tile span {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 700;
}

.worksheet-stat-tile strong {
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.worksheet-stat-tile--grand {
  border-color: rgba(227, 29, 35, 0.18);
  background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.worksheet-stat-tile--grand strong {
  color: var(--accent);
}

.worksheet-dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid #e5e7ee;
  padding-bottom: 0.2rem;
}

.worksheet-dashboard-tabs button {
  border: none;
  background: transparent;
  padding: 0.45rem 0.1rem 0.75rem;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 800;
  border-bottom: 2px solid transparent;
}

.worksheet-dashboard-tabs button.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

.worksheet-extra-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: stretch;
}

.worksheet-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.55fr);
  gap: 1rem;
  align-items: stretch;
}

.worksheet-summary-card {
  border: 1px solid #e5e7ee;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
  padding: 1rem 1.05rem;
  display: grid;
  gap: 0.8rem;
}

.worksheet-summary-card--compact {
  align-content: start;
}

.worksheet-summary-card--notes {
  min-height: 170px;
}

.worksheet-summary-card--total {
  min-height: 170px;
  align-content: start;
}

.worksheet-summary-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.worksheet-summary-card__header h3 {
  margin: 0;
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.worksheet-summary-card__header button {
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-weight: 700;
  box-shadow: none;
}

.worksheet-summary-card__table {
  width: 100%;
  border-collapse: collapse;
}

.worksheet-summary-card__table th,
.worksheet-summary-card__table td {
  padding: 0.8rem 0.2rem;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 0.88rem;
}

.worksheet-summary-card__table th {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.worksheet-summary-card__table td.is-numeric,
.worksheet-summary-card__table th.is-numeric {
  text-align: right;
  white-space: nowrap;
}

.worksheet-summary-card__table tr:last-child td {
  border-bottom: none;
}

.worksheet-summary-card__table tr.is-total td {
  border-top: 1px solid #f2d4d6;
  background: #fff7f7;
  color: var(--accent);
  font-weight: 800;
}

.worksheet-room-link {
  border: none;
  background: transparent;
  padding: 0;
  color: #0f172a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.worksheet-room-link:hover,
.worksheet-room-link:focus {
  color: var(--accent);
}

.worksheet-summary-card__empty,
.worksheet-summary-note {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.worksheet-trip-fee-banner {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid #f1c27d;
  background: linear-gradient(180deg, #fff8ec 0%, #fff4de 100%);
  color: #7c4a08;
  display: grid;
  gap: 0.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.worksheet-trip-fee-banner[hidden] {
  display: none !important;
}

.worksheet-trip-fee-banner strong {
  font-size: 0.92rem;
}

.worksheet-trip-fee-banner span {
  font-size: 0.88rem;
  line-height: 1.45;
}

.worksheet-trip-fee-banner a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.worksheet-trip-fee-banner.is-complete {
  border-color: #b7e4c7;
  background: linear-gradient(180deg, #effaf3 0%, #e7f7ed 100%);
  color: #15603a;
}

.worksheet-install-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.worksheet-install-summary__item {
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.8rem 0.9rem;
}

.worksheet-install-summary__item span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.worksheet-install-summary__item strong {
  display: block;
  margin-top: 0.25rem;
  color: #172033;
  font-size: 1.2rem;
}

.worksheet-install-summary__item small {
  display: block;
  margin-top: 0.2rem;
  color: #64748b;
}

.worksheet-install-time-breakdown {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.worksheet-install-time-breakdown > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.worksheet-install-time-breakdown > div.is-total {
  margin-top: 0.15rem;
  padding-top: 0.4rem;
  border-top: 1px solid #cbd5e1;
}

.worksheet-install-time-breakdown small,
.worksheet-install-time-breakdown strong {
  margin: 0;
}

.worksheet-install-time-breakdown strong {
  font-size: 1rem;
}

@media (max-width: 700px) {
  .worksheet-install-summary {
    grid-template-columns: 1fr;
  }
}

.worksheet-finish-list {
  display: grid;
  gap: 0.65rem;
}

.worksheet-summary-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.worksheet-summary-card__actions button {
  padding: 0.28rem 0.5rem;
  font-size: 0.72rem;
}

.worksheet-finish-list__group {
  display: grid;
  gap: 0.35rem;
}

.worksheet-finish-list__group h4 {
  margin: 0;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
}

.worksheet-finish-list__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.worksheet-finish-list__chip {
  min-width: 150px;
  flex: 0 1 250px;
  border: 1px solid #e3e9f2;
  border-radius: 14px;
  background: #f8fafc;
  padding: 0.45rem 0.55rem;
  display: grid;
  gap: 0.15rem;
}

.worksheet-finish-list__chip.is-editable {
  gap: 0.3rem;
}

.worksheet-finish-list__edit {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.worksheet-finish-list__edit span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.worksheet-finish-list__edit input,
.worksheet-finish-list__edit select {
  width: 145px;
  border: 1px solid #cfd7e5;
  border-radius: 10px;
  padding: 0.25rem 0.35rem;
  font-size: 0.8rem;
  background: #ffffff;
  color: #0f172a;
}

.worksheet-finish-list__chip-actions {
  display: flex;
  gap: 0.3rem;
}

.worksheet-finish-list__chip-actions button {
  padding: 0.22rem 0.42rem;
  font-size: 0.68rem;
}

.worksheet-finish-list__chip strong {
  font-size: 0.92rem;
  color: #0f172a;
}

.worksheet-finish-list__chip span {
  font-size: 0.83rem;
  color: #64748b;
}

.worksheet-finish-list__chip small {
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.35;
}

.worksheet-room-editor__room-name {
  display: grid;
  gap: 0.2rem;
  max-width: 320px;
}

.worksheet-room-editor__room-name span {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.worksheet-room-editor__room-name input {
  border: 0;
  border-bottom: 2px solid #d7e6ff;
  background: transparent;
  color: #172033;
  font-size: 1.45rem;
  font-weight: 750;
  padding: 0.1rem 0;
}

.worksheet-room-editor__finish-actions {
  display: flex;
  gap: 0.35rem;
}

.worksheet-room-editor__finish-manager {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid #e3e9f2;
  min-width: 0;
}

.worksheet-room-editor__finish-manager--collapsible summary {
  cursor: pointer;
  color: #334155;
  font-weight: 800;
}

.worksheet-room-editor__finish-manager--collapsible[open] summary {
  margin-bottom: 0.7rem;
}

.worksheet-room-editor__finish-manager .worksheet-finish-list__chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.worksheet-room-editor__finish-manager .worksheet-finish-list__chip {
  flex: 0 0 225px;
}

.room-finish-quick-select {
  position: fixed;
  z-index: 10000;
  min-width: 230px;
  max-width: min(360px, calc(100vw - 1rem));
  padding: 0.45rem;
  border: 1px solid #9cbde9;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
  color: #172033;
}

.worksheet-finish-list__chip.is-used {
  border-color: #d7e6ff;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.worksheet-finish-list__chip.is-empty {
  opacity: 0.72;
}

.worksheet-inline-total {
  color: var(--accent);
  font-weight: 800;
}

.worksheet-extra-list,
.worksheet-note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.worksheet-extra-list li,
.worksheet-note-list li {
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  color: #334155;
  font-size: 0.9rem;
}

.worksheet-note-list strong {
  color: #0f172a;
}

.worksheet-payment-terms {
  display: grid;
  gap: 0.35rem;
  color: #475569;
  line-height: 1.5;
}

.worksheet-total-amount {
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
  font-weight: 900;
}

.worksheet-total-breakdown {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e5e7ee;
  color: #475569;
}

.worksheet-total-breakdown strong {
  color: #0f172a;
}

.room-cards-shell {
  display: grid;
  gap: 1rem;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.room-cards-shell__main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.room-cards-shell__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.room-cards-shell__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.room-cards-shell__select-group {
  display: grid;
  gap: 0.28rem;
  min-width: 210px;
}

.room-cards-shell__select-group span {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-cards-shell__select-group select {
  min-height: 46px;
}

.room-cards-shell__header h2 {
  margin: 0;
}

.room-cards-shell__header p {
  margin: 0.35rem 0 0;
  color: #64748b;
  max-width: 640px;
  line-height: 1.55;
}

.room-cards-shell__header .btn-primary {
  min-height: 46px;
  padding-inline: 1rem;
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.room-cards-shell__header .importBtn {
  min-height: 46px;
  padding-inline: 1rem;
  border-color: #cfd7e5;
  color: #0f172a;
}

.room-cards-shell__header .btn-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.room-cards-shell__legacy {
  display: none;
}

.room-cards-shell__notes {
  margin-top: 0.25rem;
}

.room-details-pane {
  display: grid;
  gap: 1rem;
}

.room-details-pane__title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.room-details-pane__title-row h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.room-details-pane__close {
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 1.8rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  color: #0f172a;
}

.room-details-pane__section {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e5e7ee;
}

.room-details-pane__section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #2563eb;
  font-weight: 800;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.room-details-pane__section-title--countertop {
  color: #0f766e;
}

.room-details-pane__fields {
  display: grid;
  gap: 0.55rem;
}

.room-details-pane__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #e8edf5;
  color: #475569;
}

.room-details-pane__field:last-child {
  border-bottom: none;
}

.room-details-pane__field span {
  font-size: 0.86rem;
}

.room-details-pane__field strong {
  color: #0f172a;
  font-size: 0.92rem;
  text-align: right;
}

.room-details-pane__pricing {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e5e7ee;
}

.room-details-pane__pricing-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: #475569;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e8edf5;
}

.room-details-pane__pricing-row strong {
  color: #0f172a;
}

.room-details-pane__pricing-row--cabinet strong {
  color: #1d4ed8;
}

.room-details-pane__pricing-row--countertop strong {
  color: #0f766e;
}

.room-details-pane__total {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.room-details-pane__total span {
  font-weight: 700;
  color: #1d4ed8;
}

.room-details-pane__total strong {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: #1d4ed8;
}

.room-details-pane__actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.room-details-pane__actions .btn-primary {
  min-height: 44px;
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.room-details-pane__actions .btn-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.room-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  align-items: start;
}

.room-card {
  position: relative;
  display: grid;
  gap: 0.95rem;
  padding: 1.02rem 1rem 0.95rem;
  border: 1px solid #dde5f0;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  min-width: 0;
}

.room-card--group {
  cursor: grab;
}

.room-card--group.is-dragging {
  cursor: grabbing;
  opacity: 0.62;
}

.room-card--group.is-drop-before {
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: inset 0 4px 0 rgba(37, 99, 235, 0.95), 0 18px 36px rgba(37, 99, 235, 0.12);
}

.room-card--group.is-drop-after {
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: inset 0 -4px 0 rgba(37, 99, 235, 0.95), 0 18px 36px rgba(37, 99, 235, 0.12);
}

.room-card.is-selected {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 22px 44px rgba(37, 99, 235, 0.12);
}

.room-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 44px;
}

.room-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2563eb;
}

.room-card__title {
  margin: 0.2rem 0 0;
  font-size: 1.28rem;
  letter-spacing: -0.03em;
}

.room-card__finish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #d6e4ff;
  color: #1d4ed8;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.room-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.room-card--group {
  display: grid;
  gap: 0.95rem;
}

.room-card__option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 0.85rem;
}

.room-card__option-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.92rem;
  border-radius: 18px;
  border: 1px solid #dbe4f0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  min-width: 0;
}

.room-card__option-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #d6e4ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.room-card__option-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid #e5edf7;
}

.room-card__option-total span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.room-card__option-total strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: #1d4ed8;
  text-align: right;
}

.room-card__option-card--countertop {
  grid-template-columns: 1fr;
}

.room-card__option-total--countertop {
  grid-column: auto;
}

.room-card__section--cabinet .room-card__option-total span,
.room-card__section--cabinet .room-card__option-total strong {
  color: #1d4ed8;
}

.room-card__section--countertop .room-card__option-total span,
.room-card__section--countertop .room-card__option-total strong {
  color: #0f766e;
}

.room-card__section--countertop .room-card__option-pill {
  background: #e7f7f3;
  border-color: #b8e4d7;
  color: #0f766e;
}

.room-card__detail-list--countertop {
  gap: 0.38rem;
  grid-template-columns: 1fr;
}

.room-card__detail-list--countertop .room-card__detail {
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.room-card__detail-list--countertop .room-card__detail strong {
  text-align: right;
}

.room-card__section {
  display: grid;
  gap: 0.5rem;
  padding: 0;
}

.room-card__section-head {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.room-card__section-head > div {
  min-width: 0;
}

.room-card__section-head h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
}

.room-card__section-head p {
  margin: 0.15rem 0 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.room-card__section-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid currentColor;
  position: relative;
  opacity: 0.9;
}

.room-card__section-icon--cabinet {
  color: #2563eb;
}

.room-card__section-icon--countertop {
  color: #0f766e;
}

.room-card__section-icon::before,
.room-card__section-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.35;
}

.room-card__section-icon::after {
  inset: 8px 4px 4px 8px;
}

.room-card__section h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.room-card__section--cabinet h3 {
  color: #1d4ed8;
}

.room-card__section--countertop h3 {
  color: #0f766e;
}

.room-card__detail-list {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.room-card__detail {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  min-width: 0;
}

.room-card__detail span {
  font-size: 0.8rem;
  color: #64748b;
  min-width: 0;
}

.room-card__detail strong {
  text-align: right;
  font-size: 0.86rem;
  color: #0f172a;
  min-width: 0;
  overflow-wrap: anywhere;
}

.room-card__totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 0.15rem;
  border-top: 1px solid #e5edf7;
}

.room-card__total {
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e6edf7;
  min-width: 0;
}

.room-card__total span {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.room-card__total strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.room-card__total--cabinet strong {
  color: #1d4ed8;
}

.room-card__total--cabinet span {
  color: #1d4ed8;
}

.room-card__total--countertop strong {
  color: #0f766e;
}

.room-card__total--countertop span {
  color: #0f766e;
}

.room-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.room-card__actions button {
  min-height: 40px;
  padding-inline: 0.95rem;
}

.room-card__actions .btn-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.room-card__actions .btn-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.room-card__actions .btn-danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff5f5;
}

.room-card__actions .btn-danger:hover {
  border-color: #fca5a5;
  background: #fef2f2;
}

.room-card--add {
  place-items: center;
  align-content: center;
  min-height: 100%;
  border-style: dashed;
  border-color: #cbd5e1;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.75) 0%, #ffffff 100%);
  text-align: center;
}

.room-card--add button {
  width: 100%;
  min-height: 240px;
  border: none;
  border-radius: 18px;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  box-shadow: none;
}

.room-card--add button:hover,
.room-card--add button:focus {
  box-shadow: none;
}

.room-card__add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 2px solid #94a3b8;
  color: #475569;
  font-size: 2.4rem;
  line-height: 1;
}

.room-card__add-copy strong {
  display: block;
  font-size: 1.4rem;
  color: #0f172a;
}

.room-card__add-copy span {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
}

.room-card__empty {
  grid-column: 1 / -1;
  padding: 1.25rem;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  text-align: center;
}

.room-details-modal {
  width: min(900px, calc(100vw - 1.5rem));
}

.room-details-modal--group {
  width: min(1120px, calc(100vw - 1.5rem));
}

.room-details-modal__title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.room-details-modal__heading {
  min-width: 0;
}

.room-details-modal__room-navigation {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.room-details-modal__room-arrow {
  display: inline-grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: none;
}

.room-details-modal__room-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  background: #f0f7ff;
  color: var(--accent);
}

.room-details-modal__room-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.room-details-modal__title-row h3 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}

.room-details-modal__subtitle {
  margin: 0.15rem 0 0;
  color: #64748b;
  line-height: 1.5;
}

.room-details-modal__close {
  display: inline-flex;
  width: auto;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.8rem;
  border: 1px solid #d6deea;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  line-height: 1;
  box-shadow: none;
}

.room-details-modal__close > span[aria-hidden="true"] {
  font-size: 1.35rem;
}

.room-details-modal__close-label {
  font-size: 0.82rem;
  font-weight: 800;
}

.room-details-modal__close:hover {
  border-color: #b9c7da;
  background: #f8fbff;
  color: #0f172a;
}

.room-details-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.room-details-modal__section {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fbfdff;
}

.room-details-modal__section h4 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.room-details-modal__section--cabinet h4 {
  color: #1d4ed8;
}

.room-details-modal__section--countertop h4 {
  color: #0f766e;
}

.room-details-modal__section .worksheet-mobile-modal-form {
  gap: 0.7rem;
}

.room-details-modal__factor {
  padding: 0.7rem 0.8rem;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #eff6ff;
}

.room-details-modal__factor strong {
  display: block;
  margin-top: 0.22rem;
  font-size: 1.15rem;
  color: #1d4ed8;
}

.room-details-modal__tabs {
  display: grid;
  gap: 0.85rem;
}

.room-details-modal__tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.25rem 0 0;
}

.room-details-modal__tab {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border: 1px solid #d8e2f0;
  border-radius: 999px;
  background: #f8fbff;
  color: #334155;
  font-weight: 700;
  box-shadow: none;
}

.room-details-modal__tab.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.room-details-modal__tab-panels {
  display: grid;
}

.room-details-modal__tab-panel {
  display: none;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fbfdff;
}

.room-details-modal__tab-panel.is-active {
  display: block;
}

.room-details-modal__tab-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-details-modal__tab-form--countertop {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.room-details-modal__section--room,
.room-details-modal__section--countertop {
  padding: 1rem;
}

.room-details-modal__section--room .worksheet-mobile-modal-form,
.room-details-modal__countertop-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.room-details-modal__empty-note {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.45;
}

.room-details-modal__countertop-materials {
  display: grid;
  gap: 0.75rem;
}

.room-details-modal__countertop-material-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem;
  border: 1px solid #d9e7e3;
  border-radius: 16px;
  background: #ffffff;
}

.room-details-modal__countertop-material-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.room-details-modal__countertop-material-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: #edf9f7;
  border: 1px solid #cfeae5;
  color: #0f766e;
  font-weight: 700;
  font-size: 0.84rem;
}

.room-details-modal__countertop-material-source {
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.room-details-modal__countertop-material-delete {
  min-height: 38px;
}

.room-details-modal__countertop-material-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.9rem;
}

.room-details-modal__countertop-material-row {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
}

.room-details-modal__countertop-material-row span {
  color: #64748b;
  font-size: 0.8rem;
}

.room-details-modal__countertop-material-row strong {
  text-align: right;
  font-size: 0.88rem;
  color: #0f172a;
}

.room-details-modal__countertop-material-total {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: end;
  padding-top: 0.55rem;
  border-top: 1px solid #e5edf7;
}

.room-details-modal__countertop-material-total span {
  display: block;
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.room-details-modal__countertop-material-total strong {
  display: block;
  color: #0f766e;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.room-details-modal__group-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.15rem;
}

.room-details-modal__group-toolbar span {
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 700;
}

.room-details-modal__group-toolbar--countertop {
  align-items: flex-start;
}

.room-details-modal__group-toolbar-note {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.room-details-modal__panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}

.room-details-modal__panel-actions--countertop {
  grid-column: 1 / -1;
}

.room-details-modal__panel-actions .btn-danger {
  min-height: 38px;
}

.room-details-modal__factor--countertop {
  border-color: #d9e7e3;
  background: #f8fbff;
}

.room-details-modal__factor--countertop strong {
  color: #0f766e;
}

.room-details-modal__actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .worksheet-room-editor-backdrop {
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
  }

  .worksheet-room-editor {
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: 0.75rem;
  }

  .worksheet-room-editor__head,
  .worksheet-room-editor__summary-head,
  .worksheet-room-editor__panel-actions--split {
    flex-direction: column;
    align-items: stretch;
  }

  .worksheet-room-editor__actions,
  .worksheet-room-editor__tabs,
  .worksheet-room-editor__material-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .worksheet-room-editor__summary-grid,
  .worksheet-room-editor__field-grid {
    grid-template-columns: 1fr;
  }

  .worksheet-room-editor__table-wrap {
    max-height: none;
    overflow: visible;
  }

  .worksheet-room-editor__table,
  .worksheet-room-editor__table tbody,
  .worksheet-room-editor__table tr,
  .worksheet-room-editor__table td {
    display: block;
    width: 100%;
  }

  .worksheet-room-editor__table thead {
    display: none;
  }

  .worksheet-room-editor__table tr[data-room-editor-row] {
    position: relative;
    margin-bottom: 0.65rem;
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
  }

  .worksheet-room-editor__table tr[data-room-editor-row]::before {
    content: attr(data-mobile-title);
    display: block;
    min-height: 44px;
    padding: 0.75rem 5.5rem 0.75rem 0.85rem;
    color: #111827;
    font-weight: 800;
  }

  .worksheet-room-editor__table tr[data-room-editor-row]::after {
    content: attr(data-mobile-total);
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    max-width: 5rem;
    color: #2563eb;
    font-weight: 800;
    text-align: right;
  }

  .worksheet-room-editor__table tr[data-room-editor-row] td {
    display: none;
    padding: 0.58rem 0.75rem;
    border-top: 1px solid #eef2f7;
    white-space: normal;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td {
    display: grid;
    gap: 0.28rem;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td::before {
    content: attr(data-mobile-label);
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .worksheet-room-editor__table input,
  .worksheet-room-editor__table select,
  .worksheet-room-editor__table button {
    min-height: 42px;
    font-size: 16px;
  }

  .room-details-modal__group-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .room-details-modal__tab-form,
  .room-details-modal__tab-form--countertop,
  .room-details-modal__section--room .worksheet-mobile-modal-form,
  .room-details-modal__countertop-form {
    grid-template-columns: 1fr;
  }

  .room-details-modal__countertop-material-head {
    flex-direction: column;
    align-items: stretch;
  }

  .room-details-modal__countertop-material-list {
    grid-template-columns: 1fr;
  }

  .room-details-modal__actions {
    grid-template-columns: 1fr;
  }
}

.worksheet-room-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.46);
}

.worksheet-room-editor {
  width: min(1720px, calc(100vw - 2rem));
  max-height: min(1000px, calc(100dvh - 2rem));
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 24px;
  border: 1px solid #d8e0ea;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.24);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

@media (max-width: 760px) {
  /* These duplicate desktop controls are not needed in the mobile room workflow. */
  #worksheetDashboardUploadCabinetVisionBtn,
  #panel-cabinet .import-row,
  #worksheetFinishListCard {
    display: none !important;
  }

  .worksheet-room-editor-backdrop {
    align-items: start;
    justify-items: center;
    padding: 0.5rem;
  }

  .worksheet-room-editor {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    min-height: 0;
    max-height: calc(100dvh - 1rem);
    border: 1px solid #d8e0ea;
    border-radius: 16px;
    padding: 0.75rem;
  }
}

/* Keep touch scroll inside an open pricing dialog instead of passing it to the worksheet below. */
body:has(.worksheet-room-editor-backdrop),
body:has(.worksheet-mobile-modal-backdrop),
body:has(.import-modal-backdrop),
body:has(.notes-modal-backdrop),
body:has(.pricing-upload-modal:not([hidden])),
body:has(.legacy-pricing-modal-backdrop) {
  overflow: hidden;
  overscroll-behavior: none;
}

.worksheet-room-editor-backdrop,
.worksheet-mobile-modal-backdrop,
.import-modal-backdrop,
.notes-modal-backdrop,
.pricing-upload-modal,
.legacy-pricing-modal-backdrop {
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.worksheet-mobile-modal,
.import-modal,
.notes-modal,
.pricing-upload-modal__dialog,
.legacy-pricing-modal {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.worksheet-room-editor__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
}

.worksheet-room-editor__eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.worksheet-room-editor__room-navigation {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.55rem 0 0.7rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.worksheet-room-editor__room-navigation button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: none;
}

.worksheet-room-editor__room-navigation button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #f0f7ff;
  color: var(--accent);
}

.worksheet-room-editor__room-navigation button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.worksheet-room-editor__head h3 {
  margin: 0.15rem 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.worksheet-room-editor__subtitle {
  margin: 0.35rem 0 0;
  color: #64748b;
  line-height: 1.5;
}

.worksheet-room-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.worksheet-room-editor__actions button {
  min-height: 40px;
  padding: 0.55rem 0.95rem;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-weight: 700;
  box-shadow: none;
}

.worksheet-room-editor__actions button:hover {
  border-color: #c6d3e3;
  background: #f8fbff;
}

.worksheet-room-editor__tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  width: fit-content;
  max-width: 100%;
}

.worksheet-room-editor__tabs button {
  min-height: 42px;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-weight: 800;
  box-shadow: none;
}

.worksheet-room-editor__tabs button.is-active {
  background: #ffffff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.worksheet-room-editor__material-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.1rem;
}

.worksheet-room-editor__material-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #d9e2ef;
  background: #f8fbff;
  color: #334155;
  font-weight: 700;
  box-shadow: none;
}

.worksheet-room-editor__material-tab strong {
  min-width: 1.4rem;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.08);
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.worksheet-room-editor__material-tab.is-active {
  border-color: rgba(37, 99, 235, 0.36);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.worksheet-room-editor__material-tab.is-active strong {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.worksheet-room-editor__panel {
  display: grid;
  gap: 0.8rem;
}

.worksheet-room-editor__panel.is-hidden,
.worksheet-room-editor__panel[hidden] {
  display: none !important;
}

.worksheet-room-editor__summary-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
  gap: 0.9rem;
  align-items: stretch;
}

.worksheet-room-editor__summary-stack {
  display: grid;
  gap: 0.8rem;
}

.worksheet-room-editor__summary-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fbfdff;
  min-height: 0;
  height: auto;
}

.worksheet-room-editor__summary-card--scroll {
  overflow: hidden;
}

.worksheet-room-editor__summary-card--defaults .worksheet-room-editor__field-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.worksheet-room-editor__summary-card--custom {
  min-height: 10.5rem;
}

.worksheet-room-editor__summary-card--custom:has(.worksheet-room-editor__section-disclosure:not([open])) {
  min-height: 0;
}

.worksheet-room-editor__section-disclosure {
  width: 100%;
}

.worksheet-room-editor__section-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.worksheet-room-editor__section-disclosure > summary::marker {
  color: #64748b;
}

.worksheet-room-editor__section-content {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.worksheet-room-editor__summary-card--custom .worksheet-room-editor__summary-head {
  justify-content: flex-end;
}

.worksheet-room-editor__summary-card--wide {
  grid-column: 1 / -1;
}

.worksheet-room-editor__summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.worksheet-room-editor__summary-card h4 {
  margin: 0;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #334155;
}

.worksheet-room-editor__field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.worksheet-room-editor__field-grid label {
  display: grid;
  gap: 0.3rem;
}

.worksheet-room-editor__field-grid label span,
.worksheet-room-editor__pill span {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
}

.worksheet-room-editor__pill {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #eff6ff;
}

.worksheet-room-editor__pill strong {
  font-size: 1.15rem;
  color: #1d4ed8;
}

#panel-estimate .sub-tabs {
  display: flex !important;
}

#panel-estimate .sub-tabs .tab:not([data-tab="import-rules"]),
#panel-cabinet,
#panel-countertopsheet {
  display: none !important;
}

.worksheet-room-editor__custom-list {
  display: grid;
  gap: 0.45rem;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.worksheet-room-editor__custom-item {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.worksheet-room-editor__custom-item strong,
.worksheet-room-editor__custom-meta strong {
  display: block;
}

.worksheet-room-editor__custom-item span {
  display: block;
  margin-top: 0.12rem;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.15;
}

.worksheet-room-editor__custom-meta {
  min-width: 132px;
  text-align: right;
}

.worksheet-room-editor__custom-meta > span {
  font-size: 0.8rem;
}

.worksheet-room-editor__custom-meta strong {
  font-size: 0.92rem;
}

.worksheet-room-editor__custom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.worksheet-room-editor__custom-actions button,
.worksheet-room-editor__summary-head .btn-primary {
  min-height: 30px;
  padding: 0.3rem 0.6rem;
}

.worksheet-room-editor__custom-item strong {
  font-size: 0.86rem;
  line-height: 1.1;
}

.worksheet-room-editor__empty-note {
  margin: 0;
  color: #64748b;
}

.worksheet-room-editor__custom-empty-state {
  display: grid;
  flex: 1 1 auto;
  min-height: 5.75rem;
  border-radius: 12px;
  padding: 0.75rem;
}

.worksheet-room-editor__custom-empty-state:has(.worksheet-room-editor__empty-note) {
  place-items: center;
  border: 1px dashed #cbd5e1;
  text-align: center;
}

.worksheet-room-editor__panel-actions {
  display: flex;
  justify-content: flex-start;
}

.worksheet-room-editor__panel-actions--split {
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.worksheet-room-editor__panel-actions--split .worksheet-room-editor__material-tabs {
  flex: 1 1 420px;
}

.worksheet-room-editor__panel-actions .btn-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.worksheet-room-editor__panel-actions .btn-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.worksheet-room-editor__table-wrap {
  max-height: calc(100vh - 11rem);
}

.worksheet-room-editor__table {
  width: 100%;
  min-width: 1660px;
  table-layout: auto;
  font-size: 0.74rem;
}

.worksheet-room-editor__table input,
.worksheet-room-editor__table select {
  width: 100%;
  min-width: 0;
  padding: 0.28rem 0.34rem;
  font-size: 0.72rem;
}

.worksheet-room-editor__table th,
.worksheet-room-editor__table td {
  white-space: nowrap;
  padding-inline: 0.22rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.worksheet-room-editor__table th:nth-child(1),
.worksheet-room-editor__table th:nth-child(2),
.worksheet-room-editor__table th:nth-child(3),
.worksheet-room-editor__table th:nth-child(6),
.worksheet-room-editor__table th:nth-child(18),
.worksheet-room-editor__table th:nth-child(19),
.worksheet-room-editor__table th:nth-child(20),
.worksheet-room-editor__table td:nth-child(1),
.worksheet-room-editor__table td:nth-child(2),
.worksheet-room-editor__table td:nth-child(3),
.worksheet-room-editor__table td:nth-child(6),
.worksheet-room-editor__table td:nth-child(18),
.worksheet-room-editor__table td:nth-child(19),
.worksheet-room-editor__table td:nth-child(20) {
  width: 6.25rem;
}

.worksheet-room-editor__table th.is-numeric,
.worksheet-room-editor__table td.is-numeric {
  text-align: right;
}

.worksheet-room-editor__custom-table-row td {
  background: #f8fafc;
  border-top-color: #cbd5e1;
}

@media (max-width: 780px) {
  .worksheet-room-editor__table tr.worksheet-room-editor__custom-table-row {
    margin-bottom: 0.65rem;
    padding: 0.35rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
  }

  .worksheet-room-editor__table tr.worksheet-room-editor__custom-table-row td {
    display: block;
    padding: 0.5rem 0.65rem;
    white-space: normal;
  }
}

.sheet-actions-menu {
  position: relative;
}

.sheet-actions-menu summary {
  list-style: none;
  min-width: 120px;
  min-height: 32px;
  padding: 0.3rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

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

.sheet-actions-menu[open] summary {
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(227, 29, 35, 0.12);
}

.sheet-actions-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 220px;
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.dashboard-header,
.dashboard-header-top,
.dashboard-actions--header,
.sheet-actions-menu {
  overflow: visible;
}

.sheet-actions-popover button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.header-estimate-totals {
  align-self: stretch;
}

/* Form Elements */
label { font-size: 0.85rem; color: var(--muted); }

input, select, button, .importBtn {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.3rem 0.5rem;
  background: #fdfdff;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  outline: 2px solid rgba(227, 29, 35, 0.25);
  border-color: var(--accent);
  background: #ffffff;
}

button, .importBtn {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  background: #ffffff;
}

button:hover, .importBtn:hover { border-color: var(--accent); box-shadow: 0 8px 16px rgba(17,24,39,0.08); }
button:active, .importBtn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #f14245 100%);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(227, 29, 35, 0.25);
}

.btn-primary:hover { background: linear-gradient(135deg, #f14245 0%, var(--accent) 100%); }

.btn-danger {
  background: #c75a4a;
  color: #fff;
  border-color: #c75a4a;
  box-shadow: 0 8px 16px rgba(199, 90, 74, 0.22);
}

.importBtn { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--chip); }

#importFile, #ordFile, #pricingSheetsFile, #pricingDataFile { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Utility Controls */
.room-sort, .import-row {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.42rem 0.5rem;
}

.checkline { display: flex; gap: 0.4rem; align-items: center; }

.worksheet-table { table-layout: auto; width: 100%; font-size: 0.85rem; }

.worksheet-table input, .worksheet-table select {
  width: 100%;
  min-width: 0;
  padding: 0.18rem 0.25rem;
  font-size: 0.7rem;
}

.worksheet-table th, .worksheet-table td {
  white-space: normal;
  word-break: break-word;
}
.worksheet-table th:nth-child(1), .worksheet-table td:nth-child(1) { min-width: 7.5rem; }
.worksheet-table th:nth-child(2), .worksheet-table td:nth-child(2) { min-width: 8rem; }
.worksheet-table th:nth-child(15), .worksheet-table td:nth-child(15) { min-width: 6rem; white-space: nowrap; }

.worksheet-finishes {
  display: contents;
}
.worksheet-finishes-summary {
  width: 100%;
  text-align: left;
  padding: 0.26rem 0.3rem;
  font-size: 0.72rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
  color: #111827;
  cursor: pointer;
}
.worksheet-finishes-summary:hover,
.worksheet-finishes-summary:focus {
  background: #f8fafc;
}
.worksheet-finishes-details {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.2rem;
  margin-top: 0.35rem;
}
.worksheet-finishes-details.open {
  display: grid;
}
.worksheet-finishes-details select {
  width: 100%;
  font-size: 0.7rem;
  padding: 0.18rem 0.22rem;
}
.worksheet-finishes-cell {
  min-width: 8rem;
  max-width: 10rem;
}
.worksheet-table th:nth-child(n+3):nth-child(-n+12), .worksheet-table td:nth-child(n+3):nth-child(-n+12),
.worksheet-table th:nth-child(17), .worksheet-table td:nth-child(17) { min-width: 3.5rem; }
.worksheet-table th:nth-child(13), .worksheet-table td:nth-child(13),
.worksheet-table th:nth-child(14), .worksheet-table td:nth-child(14),
.worksheet-table th:nth-child(15), .worksheet-table td:nth-child(15) { min-width: 6rem; }
.worksheet-table th:nth-child(15), .worksheet-table td:nth-child(15) { min-width: 8rem; }
.worksheet-table th:nth-child(16), .worksheet-table td:nth-child(16) { min-width: 9rem; white-space: nowrap; }

.ws-actions { white-space: nowrap; }
.ws-notes { width: 100%; min-width: 3.5rem; }
.ws-actions {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  min-width: 150px;
}
.ws-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.16rem 0.32rem;
  font-size: 0.7rem;
  line-height: 1;
  flex: 1 1 0;
}

.room-note { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.84rem; }
.room-name-input { width: 100%; min-width: 140px; }

.room-note-cards { display: grid; gap: 0.75rem; }

.room-note-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.7rem 0.8rem;
}

.room-note-title { margin: 0 0 0.4rem; font-size: 0.92rem; }

.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }

.note-item {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 0.55rem;
  align-items: baseline;
  border-top: 1px dashed var(--line);
  padding-top: 0.3rem;
}

.note-item:first-child { border-top: 0; padding-top: 0; }
.note-cab { font-weight: 600; }
.note-price { font-weight: 700; white-space: nowrap; }

/* Tables */
.table-wrap {
  margin-top: 0.2rem;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.custom-items {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

.custom-items__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.custom-items__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  align-items: center;
}

.custom-items__form input,
.custom-items__form select {
  width: 100%;
}

.custom-total strong {
  color: var(--accent);
}

.room-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.room-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 0.28rem 0.35rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f3f9 100%);
}

.room-table tbody td {
  padding: 0.28rem 0.35rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.room-table tbody tr:nth-child(odd) { background: #fbfdff; }
.room-table tbody tr:hover { background: #fff7f7; }
.room-table tr:last-child td { border-bottom: none; }

/* Countertop worksheet column sizing */
.stone-rate-col,
.stone-total-col {
  min-width: 110px;
  white-space: nowrap;
  text-align: right;
}
.stone-sink-col {
  width: 70px;
}

/* Settings Sections */
.settings-section {
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.settings-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.settings-section h3 { margin: 0 0 0.5rem; font-size: 0.96rem; color: var(--ink); }
.settings-section > select, .settings-section > button { margin-top: 0.5rem; display: inline-block; min-width: 200px; }

.stoneMaterialsList { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: 1rem; }
.material-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem; }
.material-name { font-weight: 600; margin-bottom: 0.3rem; }
.material-price { font-size: 0.85rem; color: var(--muted); display: grid; gap: 0.2rem; }

/* Pricing Sheets */
.pricing-sheets-header { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.sheets-list { display: grid; gap: 0.8rem; margin-bottom: 1rem; }
.sheet-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; box-shadow: var(--shadow); }
.sheet-name { font-weight: 600; font-size: 0.95rem; }
.sheet-meta { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }

/* Print Area */
.print-area { display: none; }
.print-area.active { display: block; margin: 0 auto 1.5rem; }
.print-area.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 0.5in;
}
.print-area.preview-grid-2col {
  display: flex;
  flex-direction: column;
  gap: 0.5in;
}
.preview-row-group {
  display: flex;
  flex-direction: column;
  gap: 0.25in;
}
.preview-group-title {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.2in 0;
  border-bottom: 2px solid #cfd6e0;
}
.preview-group-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25in;
  align-items: start;
}
.preview-cabinets {
  display: flex;
  flex-direction: column;
  gap: 0.25in;
}
.preview-stone {
  display: flex;
  flex-direction: column;
}
.preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25in;
  align-items: start;
}
.preview-title {
  grid-column: 1 / span 2;
  font-weight: 700;
  margin-bottom: 0.08in;
}
.preview-cell .print-sheet {
  width: 100%;
  margin: 0;
  page-break-after: auto;
}
.print-sheet.empty-sheet {
  min-height: 2in;
  display: grid;
  place-items: center;
  color: #777;
  border: 1px dashed #cbd3e1;
}

.print-sheet {
  background: #ffffff;
  color: #1f1a17;
  width: 8.0in;
  min-height: 11in;
  margin: 0.25in auto 1rem;
  padding: 0.6in 0.6in;
  border: 1px solid #cfd6e0;
  box-shadow: none;
}

.print-page-header { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; border-bottom:2px solid #1f2933; padding-bottom:10px; margin-bottom:14px; }
.print-page-brand img { display:block; max-width:220px; max-height:72px; width:auto; height:auto; }
.print-page-company { max-width:320px; font-size:13px; line-height:1.35; text-align:right; }
.print-page-title { margin: 12px 0 10px; text-align:center; font-size:28px; font-style:italic; font-weight:800; }
.print-page-meta { margin-bottom: 12px; color: #52606d; font-size: 13px; display:flex; justify-content:space-between; gap:18px; flex-wrap:wrap; }

.print-head { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; align-items: start; margin-bottom: 0.25in; }

.print-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem 0.7rem; font-size: 0.94rem; }
.print-meta strong { font-weight: 700; }
.print-meta--summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0.25in; }

.print-room-title { font-size: 1.15rem; font-weight: 700; margin: 0.15rem 0 0.35rem; letter-spacing: 0.01em; }
.print-room-summary { min-height: 100%; display: flex; align-items: flex-start; }

.print-table { width: 100%; border-collapse: collapse; margin-top: 0.12in; font-size: 0.94rem; }
.print-table th, .print-table td { border: 1px solid #cfd6e0; padding: 0.32rem 0.36rem; text-align: right; }
.print-table th { background: #dbeef3; text-align: right; font-weight: 700; letter-spacing: 0.01em; }
.print-table th:first-child, .print-table td:first-child { text-align: left; }
.print-table.compact th, .print-table.compact td { padding: 0.26rem 0.3rem; font-size: 0.86rem; }

.estimate-detail-card { border: 1px solid #d9e2ec; border-radius: 12px; padding: 16px; background: #fff; margin-bottom: 0.75rem; }
.estimate-detail-card strong { display: block; margin-bottom: 0.75rem; font-size: 1rem; }
.estimate-detail-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.estimate-detail-total { background: #f8fafc; padding: 0.75rem; border-radius: 10px; }
.estimate-detail-total-label { display: block; font-size: 0.85rem; color: #52606d; margin-bottom: 0.35rem; }
.estimate-detail-total-value { display: block; font-size: 1.25rem; font-weight: 700; }
.estimate-room-table-wrap { overflow: hidden; }
.estimate-room-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.estimate-room-table th, .estimate-room-table td { border: 1px solid #d9e2ec; padding: 8px; text-align: left; vertical-align: top; }
.estimate-room-table th { background: #f5f7fa; }
.estimate-accessories { margin-top: 1rem; }
.estimate-accessories-title { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.estimate-accessories-note { margin-bottom: 0.5rem; color: #52606d; font-size: 0.95rem; }

.print-total-row td { font-weight: 700; background: #e8f2ff; }

.print-notes { margin-top: 0.35in; padding: 0.5rem; border: 1px dashed #c3b7ac; min-height: 1.25in; font-size: 0.95rem; line-height: 1.4; }

.print-pill { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 999px; background: #f0e5d6; border: 1px solid #d8cfc7; font-size: 0.85rem; margin-left: 0.35rem; }

.print-sheet.mimic-worksheet {
  width: 100%;
  max-width: 100%;
  padding: 0.35in 0.4in;
  box-shadow: none;
  border: none;
}
.print-sheet.mimic-worksheet table {
  width: 100%;
  border-collapse: collapse;
}
.print-sheet.mimic-worksheet th,
.print-sheet.mimic-worksheet td {
  border: 1px solid #dcdfe6;
  font-size: 0.95rem;
}


@media print {
  @page { margin: 0.5in; }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  body > :not(.print-area) {
    display: none !important;
  }
  .print-area {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .print-sheet {
    box-shadow: none;
    border: none;
    margin: 0;
    width: 100%;
    min-height: auto;
    padding: 0.6in 0.55in;
    page-break-after: always;
  }
  .print-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

/* Print typography closer to on-screen */
.print-room-title { font-size: 1.15rem; }
.print-meta { font-size: 1.0rem; }
.print-table { font-size: 1.02rem; }
.print-table th, .print-table td { padding: 0.5rem 0.52rem; }

@media (max-width: 900px) {
  .print-meta--summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stone-metrics { width: 100%; margin-top: 0.2in; }
.stone-metrics th { text-align: left; background: #eef3ff; }
.stone-metrics td { text-align: left; }

.stone-custom-items { margin-top: 0.25in; border: 1px solid #cfd6e0; padding: 0.3in; background: #fafbfc; }
.custom-header { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.3in; padding-bottom: 0.15in; border-bottom: 2px solid #cfd6e0; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.15in; }
.custom-header-item { text-align: left; }
.custom-header-qty { text-align: center; }
.custom-header-subtotal { text-align: right; }

.custom-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.3in; padding: 0.1in 0; font-size: 0.94rem; align-items: center; }
.custom-item { text-align: left; }
.custom-qty { text-align: center; }
.custom-subtotal { text-align: right; }

.custom-total-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.3in; padding: 0.15in 0; margin-top: 0.15in; border-top: 2px solid #cfd6e0; font-weight: 700; font-size: 0.96rem; background: #e8f2ff; padding: 0.2in; }
.custom-total-label { text-align: left; }
.custom-total-amount { text-align: right; grid-column: 3; }

.stone-detail { margin-top: 0.25in; }

@media (max-width: 1100px) {
  .estimate-totals { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .dashboard-controls { grid-template-columns: 1fr; }
  
  

}

@media (max-width: 760px) {
  .app { width: calc(100vw - 1.2rem); }
  .cv-header {
    padding: 4px 8px;
    gap: 8px;
    justify-content: space-between;
  }
  .cv-title {
    position: static;
    left: auto;
    transform: none;
    pointer-events: auto;
  }
  .cv-title h1 {
    font-size: 0.85rem;
    line-height: 1.1;
  }
  .cv-header-actions {
    gap: 0.22rem;
  }
  .cv-header-link,
  .cv-header .btn-primary,
  .cv-header .sheet-actions-menu summary {
    min-height: 28px !important;
    padding: 0.22rem 0.45rem !important;
    font-size: 0.74rem !important;
    border-radius: 8px;
  }
  .sheet-actions-popover {
    min-width: 180px;
    padding: 0.3rem;
  }
  .card {
    padding: 0.42rem 0.45rem;
  }
  .card h2 {
    font-size: 0.92rem;
    margin-bottom: 0.22rem;
  }
  .dashboard-controls {
    gap: 0.25rem;
  }
  .estimate-totals div {
    padding: 0.28rem 0.34rem;
  }
  .active-meta-value,
  .dashboard-job input {
    min-height: 32px;
    padding: 0.42rem 0.52rem;
  }
  .room-sort, .import-row {
    padding: 0.32rem 0.38rem;
    gap: 0.25rem;
  }
  .summary-grid { grid-template-columns: 1fr; }
  .estimate-totals { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .worksheet-stat-grid,
  .worksheet-summary-grid,
  .worksheet-extra-grid,
  .worksheet-lower-grid {
    grid-template-columns: 1fr;
  }
  .worksheet-dashboard__title-row,
  .worksheet-dashboard__meta,
  .worksheet-summary-card__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .worksheet-dashboard-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .worksheet-room-editor {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    padding: 0.85rem;
  }
  .worksheet-room-editor__head {
    flex-direction: column;
    align-items: flex-start;
  }
  .worksheet-room-editor__tabs {
    width: 100%;
  }
  .worksheet-room-editor__material-tabs {
    width: 100%;
  }
  .worksheet-room-editor__summary-grid,
  .worksheet-room-editor__field-grid {
    grid-template-columns: 1fr;
  }
  .worksheet-stat-tile strong,
  .worksheet-total-amount {
    font-size: 1.8rem;
  }
  .room-sort, .import-row { flex-direction: column; align-items: flex-start; }
  .main-tabs { overflow-x: auto; }
  .sub-tabs { overflow-x: auto; }
  .room-table thead th { position: static; }
  .card { padding: 0.75rem; }
  .main-tabs .tab { flex: 1 1 48%; text-align: center; }
  .sub-tabs .tab { flex: 1 1 48%; }
  .pricing-sheet-shell {
    grid-template-columns: 1fr;
  }
  .pricing-sheet-sidebar {
    position: static;
    padding: 0.8rem;
  }
  .pricing-sheet-sidebar__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pricing-sheet-main > .sub-tabs {
    overflow: hidden;
    flex-wrap: nowrap;
  }
  .pricing-sheet-main > .sub-tabs .tab {
    flex: 1 1 50%;
  }
  .pricing-sheet-main > .dashboard-header,
  .pricing-sheet-main > .summary {
    position: static;
  }
  .table-wrap { margin-inline: -0.35rem; padding-inline: 0.35rem; }
  .worksheet-table { table-layout: auto; width: 100%; }
  .worksheet-table th, .worksheet-table td { white-space: normal; }
  .worksheet-table thead { display: none; }
  .worksheet-mobile-row td {
    padding: 0;
    border-bottom: none;
    background: transparent;
  }
  .worksheet-mobile-card {
    display: grid;
    gap: 0.8rem;
    padding: 0.85rem;
    margin: 0.5rem 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
  .worksheet-mobile-card__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
  }
.worksheet-mobile-card__title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}
.worksheet-mobile-card__title-btn {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  text-align: left;
}
.worksheet-mobile-card__title-btn:hover,
.worksheet-mobile-card__title-btn:focus {
  color: var(--accent);
  text-decoration: underline;
  box-shadow: none;
}
.worksheet-mobile-card__total {
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
}
  .worksheet-mobile-card__total strong {
    display: block;
    margin-top: 0.14rem;
    font-size: 1rem;
    color: var(--accent);
  }
  .worksheet-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
  }
  .worksheet-mobile-grid--top {
    grid-template-columns: 1fr;
  }
  .worksheet-mobile-stack {
    display: grid;
    gap: 0.6rem;
  }
  .worksheet-mobile-inline,
  .worksheet-mobile-field {
    display: grid;
    gap: 0.35rem;
  }
  .worksheet-mobile-inline {
    grid-template-columns: minmax(88px, 1fr) minmax(112px, 1fr);
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #eef1f6;
  }
  .worksheet-mobile-inline:last-child {
    border-bottom: none;
  }
  .worksheet-mobile-inline span,
  .worksheet-mobile-field span {
    font-size: 0.75rem;
    color: var(--muted);
  }

/* Drag and drop styles for room materials reordering */
#roomMaterialRows tr[draggable="true"] {
  cursor: grab;
  transition: background-color 0.15s ease;
}

#roomMaterialRows tr[draggable="true"]:active {
  cursor: grabbing;
  opacity: 0.7;
}

#roomMaterialRows tr[draggable="true"]:hover {
  background-color: rgba(227, 29, 35, 0.06);
}

#roomMaterialRows tr.drag-over {
  background-color: rgba(227, 29, 35, 0.12);
  border-top: 2px solid var(--accent);
}

  .worksheet-mobile-card__title-btn:hover,
  .worksheet-mobile-card__title-btn:focus {
    color: var(--accent);
    text-decoration: underline;
    box-shadow: none;
  }
  .worksheet-mobile-card__total {
    text-align: right;
    font-size: 0.82rem;
    color: var(--muted);
  }
  .worksheet-mobile-card__total strong {
    display: block;
    margin-top: 0.14rem;
  }
  .worksheet-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
  }
  .worksheet-mobile-grid--top {
    grid-template-columns: 1fr;
  }
  .worksheet-mobile-stack {
    display: grid;
    gap: 0.6rem;
  }
  .worksheet-mobile-field--wide {
    grid-column: 1 / -1;
  }
  .worksheet-mobile-field--readonly {
    align-content: end;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff7f7;
  }
  .worksheet-mobile-field--readonly strong {
    font-size: 1rem;
    color: var(--accent);
  }
  .worksheet-mobile-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }
  #worksheetRows .worksheet-mobile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .worksheet-mobile-actions button {
    min-height: 42px;
  }
  #panel-countertopsheet .worksheet-mobile-actions {
    grid-template-columns: 1fr;
  }
  #worksheetRows .worksheet-mobile-row + .worksheet-mobile-row td,
  #stoneWorksheetRows .worksheet-mobile-row + .worksheet-mobile-row td {
    padding-top: 0.15rem;
  }
  #panel-cabinet .import-row {
    display: none;
  }
  #panel-cabinet label[for="defaultUpgradeMaterial"],
  #panel-cabinet #defaultUpgradeMaterial,
  #panel-cabinet label[for="defaultDoorStyle"],
  #panel-cabinet #defaultDoorStyle,
  #panel-cabinet label[for="defaultDrawerStyle"],
  #panel-cabinet #defaultDrawerStyle {
    display: none !important;
  }
  #panel-countertopsheet label[for="stoneDefaultMaterial"],
  #panel-countertopsheet #stoneDefaultMaterial,
  #panel-countertopsheet label[for="stoneDefaultDeck"],
  #panel-countertopsheet #stoneDefaultDeck,
  #panel-countertopsheet label[for="stoneDefaultSplash"],
  #panel-countertopsheet #stoneDefaultSplash {
    display: none !important;
  }
  #roomMaterialsSection .room-table thead th:not(:first-child) {
    display: none;
  }
  #roomMaterialsSection .fields {
    align-items: stretch !important;
  }
  #roomMaterialsSection .fields input,
  #roomMaterialsSection .fields select {
    display: none !important;
  }
  #roomMaterialsSection .fields #addRoomMaterialBtn {
    width: 100%;
    min-height: 42px;
  }
  .custom-items__form {
    grid-template-columns: 1fr;
  }
  .custom-items__form input,
  .custom-items__form select,
  .custom-items__form label {
    display: none !important;
  }
  .custom-items__form #addCustomItem,
  .custom-items__form #addStoneCustomItem {
    display: inline-flex !important;
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }
  .mobile-room-material-row {
    width: 100%;
    text-align: left;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 700;
  }
}

@media (max-width: 540px) {
  .app { width: 100%; padding: 0 0.25rem; }
  .cv-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .main-tabs { flex-direction: column; }
  .main-tabs .tab { flex: 1 1 100%; width: 100%; }
  .pricing-sheet-sidebar__nav {
    grid-template-columns: 1fr;
  }
  .quick-price-page,
  .quick-price-summary,
  .quick-price-jobtype-grid,
  .quick-price-room-grid,
  .quick-price-room-grid--cabinet,
  .quick-price-attach-grid,
  .quick-price-room-add {
    grid-template-columns: 1fr;
  }
  .quick-price-sidebar {
    max-height: none;
  }
  .quick-price-sidebar__head,
  .quick-price-toolbar,
  .quick-price-attach-card__head,
  .quick-price-room-head {
    flex-direction: column;
  }
  .quick-price-selected-customer {
    justify-content: flex-start;
  }
  .quick-price-draft-actions,
  .quick-price-toolbar__actions,
  .quick-price-step-actions,
  .quick-price-room-actions {
    flex-direction: column;
  }
  .estimate-totals { grid-template-columns: 1fr; }
  .worksheet-dashboard {
    padding: 0.9rem;
  }
  .worksheet-room-editor__actions {
    width: 100%;
    flex-direction: column;
  }
  .worksheet-room-editor__actions button {
    width: 100%;
  }
  .worksheet-room-editor__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .worksheet-room-editor__tabs button,
  .worksheet-room-editor__panel-actions button {
    width: 100%;
  }

  .worksheet-room-editor__material-tabs {
    gap: 0.35rem;
    padding: 0.1rem 0 0.3rem;
    scroll-snap-type: x proximity;
  }

  .worksheet-room-editor__material-tab {
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .worksheet-room-editor__material-tab strong {
    min-width: 1.15rem;
    padding: 0.06rem 0.3rem;
    font-size: 0.72rem;
  }
  .worksheet-room-editor__summary-head,
  .worksheet-room-editor__custom-item,
  .worksheet-room-editor__custom-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .worksheet-room-editor__custom-meta {
    min-width: 0;
    text-align: left;
  }
  .worksheet-stat-grid {
    grid-template-columns: 1fr;
  }
  .worksheet-dashboard-tabs {
    gap: 0.65rem;
  }
  .worksheet-summary-card__table th,
  .worksheet-summary-card__table td {
    font-size: 0.8rem;
    padding: 0.65rem 0.18rem;
  }
  .room-cards-grid {
    grid-template-columns: 1fr;
  }
  .room-card__option-grid,
  .room-card__option-card--countertop {
    grid-template-columns: 1fr;
  }
  .room-card__option-total--countertop {
    grid-column: 1;
  }
  .room-card__actions {
    flex-direction: column;
  }
  .room-card__actions button,
  .room-card--add button {
    width: 100%;
  }
  .room-card--add button {
    min-height: 220px;
  }
  .room-table { font-size: 0.85rem; }
  .room-table tbody td { font-size: 0.82rem; }
  button, input, select { font-size: 0.95rem; }
  .table-wrap { margin-inline: -0.4rem; padding-inline: 0.4rem; }
  .worksheet-mobile-grid {
    grid-template-columns: 1fr;
  }
  .worksheet-mobile-inline {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .worksheet-mobile-card__header {
    flex-direction: column;
  }
  .worksheet-mobile-card__total {
    text-align: left;
  }
  .worksheet-mobile-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pricing-toolbar-shell {
    padding-bottom: 4px;
  }

  .pricing-toolbar-shell .modern-topbar-actions {
    gap: 8px;
  }

  .pricing-toolbar-shell .topbar-action-btn,
  .pricing-toolbar-shell .sheet-actions-menu > summary {
    flex: 1 1 calc(50% - 8px);
    min-height: 42px;
    border-radius: 14px;
  }

  .pricing-toolbar-shell .sheet-actions-menu {
    width: 100%;
  }

  .pricing-toolbar-shell .sheet-actions-menu > summary {
    width: 100%;
  }

  .pricing-sheet-main > .card.dashboard-header,
  .pricing-sheet-main > .card.worksheet-dashboard,
  .pricing-sheet-main > .card.room-cards-shell {
    padding: 0.95rem;
    border-radius: 22px;
    border-color: #dce4ef;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  }

  .dashboard-header {
    gap: 0.7rem;
  }

  .dashboard-controls {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .dashboard-controls--header {
    align-items: stretch;
  }

  .dashboard-customer,
  .dashboard-job {
    gap: 0.28rem;
  }

  .worksheet-dashboard {
    gap: 0.85rem;
  }

  .worksheet-dashboard__top {
    gap: 0.55rem;
  }

  .worksheet-dashboard__breadcrumbs {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .worksheet-dashboard__title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .worksheet-dashboard__title-button {
    font-size: clamp(1.45rem, 7.2vw, 2.05rem);
    line-height: 1.08;
  }

  .worksheet-dashboard__status {
    align-self: flex-start;
    min-height: 32px;
  }

  .worksheet-stat-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(138px, 1fr);
    grid-template-columns: unset;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-inline: -0.1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .worksheet-stat-grid::-webkit-scrollbar {
    display: none;
  }

  .worksheet-stat-tile {
    min-height: 108px;
    padding: 0.9rem 0.85rem;
    scroll-snap-align: start;
  }

  .worksheet-stat-tile span {
    font-size: 0.75rem;
  }

  .worksheet-stat-tile strong {
    font-size: 1.42rem;
    letter-spacing: -0.04em;
  }

  .room-cards-shell {
    gap: 0.85rem;
  }

  .room-cards-shell__header {
    flex-direction: column;
    gap: 0.8rem;
  }

  .room-cards-shell__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .room-cards-shell__select-group {
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
  }

  .room-cards-shell__select-group select {
    min-height: 44px;
  }

  .room-cards-shell__header .importBtn,
  .room-cards-shell__header .btn-primary {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
  }

  .room-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .room-card {
    padding: 0.92rem;
    border-radius: 18px;
  }

  .room-card__header {
    min-height: 0;
    align-items: center;
  }

  .room-card__eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.09em;
  }

  .room-card__title {
    font-size: 1.06rem;
    line-height: 1.1;
  }

  .room-card__finish {
    min-height: 30px;
  }

  .room-card__grid {
    grid-template-columns: 1fr;
  }

  .room-card__option-grid,
  .room-card__option-card--countertop {
    grid-template-columns: 1fr;
  }

  .room-card__option-card {
    padding: 0.8rem;
    border-radius: 16px;
  }

  .room-card__option-total strong {
    font-size: 1.1rem;
  }

  .room-card__detail span {
    font-size: 0.75rem;
  }

  .room-card__detail strong {
    font-size: 0.84rem;
  }

  .room-card__totals {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .room-card__total {
    padding: 0.68rem 0.8rem;
    border-radius: 14px;
  }

  .room-card__total strong {
    font-size: 1.16rem;
  }

  .room-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .room-card__actions button {
    width: 100%;
    min-height: 42px;
  }

  .room-card--add {
    min-height: auto;
  }

  .room-card--add button {
    min-height: 88px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    text-align: left;
    justify-items: start;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
  }

  .room-card--add .room-card__add-icon {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .room-card--add .room-card__add-copy strong {
    font-size: 1rem;
  }

  .room-card--add .room-card__add-copy span {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .main-tabs,
  .sub-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-tabs .tab,
  .sub-tabs .tab {
    flex: 0 0 auto;
    min-width: 136px;
  }
}

@media (max-width: 760px) {
  .pricing-rules__heading {
    flex-direction: column;
  }

  .pricing-rules__status {
    align-self: flex-start;
  }

  .pricing-rules__table {
    font-size: 0.84rem;
  }
}

/* Final mobile constraints for the Room Pricing dialog. Keep all overflow inside it. */
@media (max-width: 760px) {
  .worksheet-room-editor-backdrop {
    align-items: start !important;
    justify-items: center !important;
    padding: 8px !important;
  }

  .worksheet-room-editor {
    width: calc(100dvw - 16px) !important;
    max-width: calc(100dvw - 16px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 0.65rem !important;
    border-radius: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .worksheet-room-editor > *,
  .worksheet-room-editor__panel,
  .worksheet-room-editor__summary-grid,
  .worksheet-room-editor__summary-card,
  .worksheet-room-editor__table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .worksheet-room-editor__summary-card {
    height: auto;
    min-height: 0;
    padding: 0.7rem;
    border-radius: 14px;
  }

  .worksheet-room-editor__summary-card--scroll {
    max-height: 15rem;
  }

  /* Keep defaults readable by wrapping their desktop four-column layout. */
  .worksheet-room-editor__summary-card--defaults .worksheet-room-editor__field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .worksheet-room-editor__head h3 {
    font-size: 1.2rem;
  }

  .worksheet-room-editor__table-wrap,
  .worksheet-room-editor__table,
  .worksheet-room-editor__table tbody,
  .worksheet-room-editor__table tr[data-room-editor-row] {
    max-height: none !important;
    overflow: visible !important;
    cursor: pointer;
  }

  .worksheet-room-editor__table {
    min-width: 0;
    table-layout: auto;
  }

  .worksheet-room-editor__table tr[data-room-editor-row]::after {
    content: attr(data-mobile-total) "  ▾";
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded::after {
    content: attr(data-mobile-total) "  ▴";
  }

  .worksheet-room-editor__panel-actions--split .worksheet-room-editor__material-tabs {
    flex: 0 0 38px !important;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    align-items: center;
    overflow-y: hidden;
  }

  .worksheet-room-editor__panel-actions .worksheet-room-editor__material-tab {
    flex: 0 0 auto;
    width: auto !important;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 0.25rem 0.5rem;
    line-height: 1;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td {
    grid-template-columns: minmax(0, 1fr) minmax(84px, 104px);
    align-items: center;
    column-gap: 0.55rem;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td::before {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td > input,
  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td > select,
  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td > .worksheet-room-editor__cell-value {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    margin: 0;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td > input[type="number"] {
    width: 5.5rem;
    justify-self: end;
  }

  /* Room, finish, and material need their own full-width line on compact screens. */
  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td:nth-child(-n + 3) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.42rem;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td:nth-child(-n + 3)::before,
  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td:nth-child(-n + 3) > input,
  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td:nth-child(-n + 3) > select,
  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td:nth-child(-n + 3) > .worksheet-room-editor__cell-value {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .worksheet-room-editor__table tr[data-room-editor-row].is-mobile-expanded td:nth-child(-n + 3) > .worksheet-room-editor__cell-value {
    display: block;
    overflow-wrap: anywhere;
  }

  .worksheet-room-editor__tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.25rem;
    overflow: visible;
  }

  .worksheet-room-editor__tabs button {
    min-width: 0;
    min-height: 38px;
    padding: 0.45rem 0.25rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }
}
