/* Misty-Land - Calculator feature styles extracted from style.css */

/* HOME BUTTON */

.home-btn {
  position: fixed;
  top: calc(var(--space-30) * 2);
  left: var(--space-30);
  width: var(--size-home-btn);
  height: var(--size-home-btn);

  border-radius: 50%;
  border: none;
  cursor: pointer;
  /* hidden initially */
  align-items: center;
  justify-content: center;

  background: linear-gradient(145deg, #e5cfa6, #d5b885);

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);

  font-size: var(--font-size-xl);
}

.home-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 25px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ================= ADMIN BUTTON ================= */

.admin-btn {
  position: fixed;
  top: calc(var(--space-30) * 2);
  right: var(--space-30);

  height: var(--size-home-btn);
  padding: 0 var(--space-lg);

  border-radius: var(--radius-large);
  border: none;
  cursor: pointer;

  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  letter-spacing: var(--letter-spacing-sm);

  background: linear-gradient(145deg, #e5cfa6, #d5b885);

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);

  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast);
}

.admin-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 25px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Left Panel */
.left-panel {
  flex: 0 0 210px;
  padding: var(--space-xxl) var(--space-lg) var(--space-xl);
  text-align: center;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #efe2cd, #e6d5bc);
}
.left-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../assets/white pattern vertical.png") center/280px auto repeat;
  opacity: 0.1;
  z-index: 0;
}
.left-panel > * { position: relative; z-index: 1; }

/* Reset button — uses refresh.png as the button; image provides the circle shape */
.calc-reset-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(111, 85, 52, 0.28);
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}
.calc-reset-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(111, 85, 52, 0.5);
}
.calc-reset-btn:active { transform: scale(0.90); }
.calc-reset-btn svg {
  width: 14px; height: 14px;
  color: var(--text-brown);
  opacity: 0.72;
  transition: opacity var(--motion-fast);
}
.calc-reset-btn:hover svg { opacity: 1; }

.left-panel img {
  max-width: 6rem;
  margin-bottom: 0;        /* moved to .left-panel-logo-wrap so it's outside the hover zone */
  align-self: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
  display: block;
}
.left-panel img:hover { opacity: 0.75; }

.left-panel h2 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xs);
}

.left-panel p {
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

/* ── Landing page: project selector in left panel ── */
.left-panel-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  margin: auto 0;
}
.calc-left-panel-card {
  position: relative;
  overflow: visible;
}
.calc-left-panel-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  min-height: 100%;
  transition: transform 260ms ease, opacity 260ms ease;
}
.calc-left-panel-card--rates-visible .calc-left-panel-main {
  transform: translateY(-10px);
  opacity: 0.92;
}
.calc-left-rates-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: -2px;
  margin-bottom: 10px;
}
.calc-left-rates-toggle {
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #8f6f2d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 0;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), transform var(--motion-fast);
}
.calc-left-rates-toggle:hover {
  background: transparent;
  color: #5f4427;
  transform: none;
}
.calc-left-rates-toggle svg {
  width: 22px;
  height: 22px;
}
.calc-left-rates-toggle svg path,
.calc-left-rates-toggle svg circle {
  fill: none;
  transition: fill var(--motion-fast), stroke var(--motion-fast), opacity var(--motion-fast);
}
.calc-left-rates-toggle:hover svg circle {
  fill: currentColor;
  stroke: currentColor;
  opacity: 0.78;
}
.calc-left-rates-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: grid-template-rows 300ms ease, opacity 240ms ease, transform 300ms ease, margin-top 300ms ease;
  margin-top: -12px;
}
.calc-left-panel-card--rates-visible .calc-left-rates-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin-top: -8px;
}
.calc-left-rates-panel > * {
  overflow: hidden;
}
.calc-left-rate-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.calc-left-rate-field + .calc-left-rate-field {
  margin-top: 18px;
}
.calc-left-rate-field label {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: #2a1f0e;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
}
.calc-left-rate-field label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.calc-left-rate-field input {
  width: 100%;
  height: 34px;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(196, 169, 106, 0.6);
  background: var(--gold-light);
  padding: 0 12px;
  box-sizing: border-box;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #2a1f0e;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.calc-left-rate-field input[readonly] {
  cursor: default;
}
.left-panel-divider {
  width: 75%;
  height: 1px;
  background: rgba(111, 85, 52, 0.22);
  align-self: center;
}
.landing-project-selector {
  width: 100%;
  border: 1px solid rgba(111, 85, 52, 0.30);
  border-radius: 14px;
  padding: 13px 7px;
  box-sizing: border-box;
}
.landing-project-selector .calc-select-wrap::before {
  display: none;
}
.landing-project-label {
  display: block;
  font-family: var(--font-primary);
  font-size: clamp(9px, 0.9vw + 4.2px, 11px);
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: clamp(0.04em, 0.14vw, 0.14em);
  margin-bottom: 12px;
  text-align: center;
  white-space: nowrap;
}
.landing-project-selector .calc-select-wrap {
  display: block;
  width: 100%;
  position: relative;
}
.landing-project-selector .calc-select-wrap select {
  width: 100%; height: var(--button-height);
  background: var(--gold-light); color: #2a1f0e;
  border: 1px solid #e0c98a; border-radius: var(--radius-medium);
  font-family: var(--font-primary); font-size: var(--font-size-sm);
  font-weight: 400; cursor: pointer; padding: 0 28px 0 10px;
  appearance: none; -webkit-appearance: none;
  transition: background var(--motion-fast), transform var(--motion-fast);
}
.landing-project-selector .calc-select-wrap select:hover {
  background: var(--gold-hover); transform: translateY(-1px);
}
.landing-project-selector .calc-select-wrap select:focus {
  outline: none; background: var(--gold-hover);
}
.landing-project-selector .calc-select-wrap::after { right: 10px; }
.landing-project-selector .calc-select-wrap select option {
  background: #fff; color: #2a1f0e;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-weight: 400;
}
.landing-project-selector .calc-select-wrap select optgroup {
  color: #fff;
  background: #4a3520;
  font-weight: 700;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
}

/* Right Panel */
.right-panel {
  flex: 1;
  padding: 10px;
  min-width: 0;
  overflow-y: auto;
  max-height: calc(100vh - 112px);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.right-panel::-webkit-scrollbar { width: 4px; }
.right-panel::-webkit-scrollbar-track { background: transparent; }
.right-panel::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; transition: background 0.2s; }
.right-panel.is-scrolling { scrollbar-color: rgba(0,0,0,0.18) transparent; }
.right-panel.is-scrolling::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); }

/* Form Row Layout */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
  gap: 0;
}

.form-row label {
  width: var(--panel-label-width);
  font-size: 14px;
}

.form-row select,
.form-row input {
  height: var(--input-height);
  border-radius: var(--radius-medium);
  border: var(--border-thin) solid #ddd;
  background: #faf8f3;
  padding: 0 var(--space-sm);
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  max-width: 100%;
}
/* Remove number input spinners in calculator */
.right-panel input[type=number]::-webkit-inner-spin-button,
.right-panel input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.right-panel input[type=number] { -moz-appearance: textfield; }

/* Calculator layout wrappers — invisible on desktop, active in phone media query */
.calc-rr-total-row { display: contents; }
.calc-adv-cols     { display: contents; }

/* Basic mode rate mismatch */
input.rate-mismatch {
  border-color: #c0392b !important;
}
@keyframes missing-pulse {
  0%   { border-color: #ddd; box-shadow: none; }
  50%  { border-color: rgba(192,57,43,0.55); box-shadow: 0 0 0 2.5px rgba(192,57,43,0.15); }
  100% { border-color: #ddd; box-shadow: none; }
}
input.name-missing {
  animation: missing-pulse 0.85s ease-in-out 3;
}
select.unit-missing {
  animation: missing-pulse 0.85s ease-in-out infinite;
}
.rate-mismatch-hint {
  grid-column: 1 / -1;
  margin: -8px 0 4px;
  font-size: 12px;
  color: #c0392b;
  font-family: 'Source Sans 3', sans-serif;
}

/* Parking row: Advanced always on its own line */
.right-panel .form-row { flex-wrap: nowrap; margin-bottom: calc(var(--space-sm) - 2px); }
.right-panel .calc-parking-row { flex-wrap: wrap; align-items: center; }

/* Parking row content wrapper — constrains circles + Advanced to 18rem like other fields */
.calc-parking-row .circle-group {
  flex-shrink: 0;
}
.calc-parking-row > .auto-margin-left {
  flex-basis: 100%;
  margin-left: 0;
  padding-left: 0;
  display: flex;
  justify-content: flex-end;
  padding-right: 0;
  /* always on its own line below the circles */
  flex-shrink: 0;
}

/* Luxury Divider Line */
.lux-divider {
  margin: 8px 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(
    to right,
    rgba(217, 193, 154, 0.15),
    rgba(217, 193, 154, 0.7),
    rgba(217, 193, 154, 0.15)
  );
}

/* Select Flat bigger */
#flatSelect {
  width: 100%;
  max-width: 24rem;
}

/* RR + Total half width */
#rrRate,
#totalRate {
  width: 12rem;
}

#customerName {
  width: 18rem;
}

/* Circle Groups */
.circle-group {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}

.pill-group {
  display: flex;
  gap: var(--space-sm);
  width: 18rem;
}

.circle-btn {
  width: var(--circle-size);
  height: var(--circle-size);
  border-radius: 50%;
  border: 1px solid var(--primary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: white;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 400;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast);
}
.circle-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../assets/white pattern.png") center/380px auto repeat;
  opacity: 0.08;
  pointer-events: none;
}

.circle-btn.active {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
}

/* Wrapper: circle-btn handles size/border/radius. Override display to allow absolute child. */
.parking-custom-wrap {
  width: var(--circle-size);
  height: var(--circle-size);
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--primary-gold);
  background: white;
  display: block;
  line-height: var(--circle-size);
  cursor: text;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--text-brown);
  caret-color: var(--text-brown);
  text-align: center;
  outline: none;
  transition: background var(--motion-fast), border-color var(--motion-fast);
  white-space: nowrap;
  overflow: hidden;
  user-select: text;
}
.parking-custom-wrap:empty::before {
  content: "";
  display: inline-block;
}
.parking-custom-wrap.active {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
  color: #2a1f0e;
  caret-color: #2a1f0e;
  font-weight: 600;
}

/* Pill Options */
.option-pill {
  flex: 1;
  /* take equal space */
  height: var(--input-height);
  /* match input height */
  border-radius: var(--radius-medium);
  border: var(--border-thin) solid #ddd;
  cursor: pointer;
  background: #faf8f3;
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 400;
  /* same visual balance as input */
  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast);
}
.option-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../assets/white pattern.png") center/380px auto repeat;
  opacity: 0.08;
  pointer-events: none;
}
.option-pill > * { position: relative; z-index: 1; }

.option-pill.active {
  background: var(--gold-light);
  border-color: var(--primary-gold);
}

.option-pill:hover {
  background: var(--gold-hover);
}

/* Generate Button */
.generate-btn {
  margin-top: var(--space-25);

  width: 100%;
  height: var(--button-height);
  border-radius: var(--radius-medium);
  border: none;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #1a1a1a;
  cursor: pointer;
  position: relative;
  overflow: hidden;

  background: var(--gold-light);
  border: 1px solid var(--primary-gold);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    var(--shadow-button);

  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast);
}
.generate-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../assets/white pattern.png") center/360px auto repeat;
  opacity: 0.1;
  pointer-events: none;
}
.generate-btn > * { position: relative; z-index: 1; }

.generate-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 25px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.view-btn {
  width: 100%;
  height: var(--button-height);
  border-radius: var(--radius-medium);
  border: 1px solid rgba(196, 169, 106, 0.6);
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: var(--font-size-sm);
  cursor: pointer;
  background: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background var(--motion-fast);
}

/* Icon SVGs: outline by default, fill with icon colour on hover */
.view-btn svg path,
.view-btn svg rect { fill: none; transition: fill var(--motion-fast); }

.view-btn:hover { background: var(--gold-hover); }
.view-btn:hover svg path,
.view-btn:hover svg rect { fill: currentColor; opacity: 0.70; }

.hidden-input {
  display: none;
}

/* Custom styled select wrapper (calculator unit dropdown) */
.calc-select-wrap {
  position: relative;
  width: 18rem;
  max-width: 100%;
  display: inline-block;
}
.calc-select-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../assets/white pattern.png") center/360px auto repeat;
  opacity: 0.08;
  pointer-events: none;
  border-radius: var(--radius-medium);
  z-index: 2;
}
.calc-select-wrap select {
  width: 100%;
  height: var(--input-height);
  border-radius: var(--radius-medium);
  border: 1.5px solid var(--primary-gold);
  background: #faf8f3;
  padding: 0 44px 0 8px;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-brown);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.calc-select-wrap select:focus {
  border-color: #b89a60;
  box-shadow: 0 0 0 3px rgba(200,180,138,0.2);
}
.calc-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--text-brown);
  pointer-events: none;
  opacity: 0.65;
}
.calc-select-wrap select option {
  color: var(--text-brown);
  background: #faf8f3;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-weight: 400;
}
.calc-select-wrap select optgroup {
  color: #fff;
  background: #4a3520;
  font-weight: 700;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
}

/* Advanced Toggle */
.advanced-toggle {
  margin: var(--space-sm) 0 4px 0;
  font-size: var(--font-size-md);
  cursor: pointer;
  border: none;
  border-radius: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-brown);
  user-select: none;
  transition: color var(--motion-fast);
  white-space: nowrap;
  flex-shrink: 0;
  width: fit-content;
}

.advanced-toggle:hover {
  color: var(--text-brown);
}

/* Advanced Toggle Arrow */
#advancedArrow {
  transition: transform var(--motion-medium);
}

#advancedArrow.rotated {
  transform: rotate(180deg);
}

/* SECOND BOX */

/* ═══════════════════════════════════════
   PRICE SHEET — SCREEN
   ═══════════════════════════════════════ */

/* Outer card */
.output-card {
  max-width: 860px;
  margin: var(--space-xl) auto 0 auto;
  background:
    linear-gradient(rgba(253,248,240,0.85), rgba(253,248,240,0.85)),
    url("../../assets/background2.jpg") center/220px auto repeat;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-elevated), var(--shadow-soft);
  padding: 40px clamp(16px, 4vw, 48px);
}

/* Inner body — grows wider as viewport shrinks so numbers never squish */
.ps-body {
  width: clamp(88%, 90%, 100%);
  margin: 0 auto;
}

/* Header: title left, logo right */
.ps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.ps-header-center { flex: 1; }
.ps-title {
  font-family: var(--font-primary);
  font-size: 19px;
  font-weight: 350;
  letter-spacing: 0.01em;
  margin: 0 0 2px;
  color: #1a1208;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-title svg {
  flex-shrink: 0;
  opacity: 0.65;
}
.ps-subtitle {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-brown);
  opacity: 0.75;
  margin: 0 0 4px;
}
.ps-meta {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.02em;
}
.ps-logo {
  height: 51px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: 16px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.ps-logo:hover { opacity: 0.75; }

/* Divider — full width of ps-body (65%) */
.ps-rule {
  height: 1.5px;
  background: linear-gradient(to right, transparent, #d9c19a, transparent);
  margin: 14px 0 0;
}

/* Section labels — black, wider spacing above */
.ps-section {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1a1a;
  padding-bottom: 5px;
  border-bottom: 1px solid #e8dcc8;
  margin: 28px 0 8px;
}

/* Tables — full width of ps-body (which is already 65% of card) */
.ps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.ps-th-label { text-align: left; }
.ps-th-num   { width: 28%; text-align: right; }

.ps-table thead tr { background: #f0e8d8; }
.ps-table thead th {
  padding: 8px 12px;
  font-weight: 600;
  font-size: 12px;
  color: #5a4025;
  border: 1px solid #e0d2ba;
}
.ps-table tbody td {
  padding: 8px 12px;
  border: 1px solid #ede4d4;
  color: #1a1a1a;
  text-align: left;
}
.ps-table tbody tr:nth-child(even) { background: #faf6ef; }

.ps-num {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: right !important;
  color: #1a1a1a;
}
.ps-tax-meta {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
}
.ps-subtotal td {
  background: #f5edd8 !important;
  font-weight: 600;
  color: #1a1a1a !important;
  border-top: 1px solid #ede4d4 !important;
}
.ps-subtotal-toggle-row td {
  vertical-align: middle;
}
.ps-subtotal-label-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ps-subtotal-amount-cell {
  text-align: right !important;
}
.ps-subtotal-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(90, 64, 37, 0.08);
  color: #5a4025;
  cursor: pointer;
  transition: background var(--motion-fast), transform var(--motion-fast);
}
.ps-subtotal-toggle:hover {
  background: rgba(90, 64, 37, 0.14);
}
.ps-subtotal-toggle[aria-expanded="true"] .ps-subtotal-toggle-icon {
  transform: rotate(90deg);
}
.ps-subtotal-toggle-icon {
  transition: transform var(--motion-fast);
}
.ps-subdetail-row[hidden] {
  display: none;
}
.ps-subdetail-row td {
  background: #f5edd8 !important;
  font-weight: 600;
  color: #1a1a1a !important;
}
.ps-subdetail-total {
  text-align: center !important;
}

/* Details table */
.ps-table--2col .ps-key { width: 45%; color: #1a1a1a; font-size: 13px; }
.ps-table--2col .ps-val {
  text-align: right;
  font-weight: 400;
  color: #1a1a1a;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
}

/* Gap row + grand total */
.ps-gap-row {
  height: 10px;
  border-left: 1px solid #ede4d4;
  border-right: 1px solid #ede4d4;
  background: transparent;
}
.ps-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5edd8;
  border: 1px solid #ede4d4;
}
.ps-grand-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}
.ps-grand-value {
  font-size: 13px;
  font-weight: 600;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
}

.print-btn {
  display: block;
  width: 65%;
  margin: var(--space-xl) auto 0 auto;
  height: var(--button-height);
  border-radius: var(--radius-medium);
  border: 1px solid var(--primary-gold);
  position: relative;
  overflow: hidden;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  background: var(--gold-light);
  transition: transform var(--motion-fast), box-shadow var(--motion-fast);
}
.print-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../assets/white pattern.png") center/380px auto repeat;
  opacity: 0.08;
  pointer-events: none;
}
.print-btn > * { position: relative; z-index: 1; }
.print-btn:active { background: var(--gold-hover); }
.print-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ── Print: centred on A4 with equal margins all sides ── */
/* Price sheet printing is handled via popup window in printPriceSheet() — no @media print rules needed here */

/* ================= INVENTORY TOWER ================= */

.inventory-card {
  max-width: var(--container-max);
  margin: var(--space-xl) auto;
  background: var(--bg-card);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-elevated), var(--shadow-soft);
  padding: var(--space-xxl) var(--space-xl);
  width: 60%;
  max-height: 90vh;
  overflow-y: auto;
  padding-right: var(--space-md);
}

.inventory-title {
  text-align: center;
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-xl);
  letter-spacing: var(--letter-spacing-sm);
}

.floor-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.floor-label {
  width: 7.5rem;
  font-weight: 600;
  font-size: var(--font-14);
  text-align: right;
  padding-right: var(--space-25);
  color: var(--text-brown);
  padding-top: var(--space-8);
  flex-shrink: 0;
  /* 👈 prevents collapsing */
}

/* Commercial Layout (Simple Row) */
.floor-units.commercial {
  display: grid;
  grid-template-columns: repeat(5, var(--unit-box-width));
  gap: var(--space-xs);
}

/* Residential Layout (Exact PDF Shape) */
.floor-units.residential {
  display: grid;
  grid-template-columns: repeat(4, var(--unit-box-width));
  grid-template-rows: var(--unit-box-height) var(--unit-box-height);
  gap: var(--space-xs);
}

/* Exact Positions */

.unit-6 {
  grid-column: 1;
  grid-row: 1;
}

.unit-1 {
  grid-column: 4;
  grid-row: 1;
}

.unit-5 {
  grid-column: 1;
  grid-row: 2;
}

.unit-4 {
  grid-column: 2;
  grid-row: 2;
}

.unit-3 {
  grid-column: 3;
  grid-row: 2;
}

.unit-2 {
  grid-column: 4;
  grid-row: 2;
}

/* Unit Box Styling */
.unit-box {
  width: var(--unit-box-width);
  height: var(--unit-box-height);
  border-radius: var(--radius-small);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0d6c2;
}

/* Status Colors */
.status-sold {
  background: #d97f7f;
}

/* darker soft red */
.status-allotted {
  background: #e7bcbc;
}

/* richer red */
.status-available {
  background: #cfe8cf;
}

.status-blocked {
  background: #f4a261; /* orange */
}

/* light red (instead of yellow) */
.status-common {
  background: #d8c6f2;
}

/* Legend */
.inventory-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  font-size: var(--font-13);
}

.inventory-legend-top {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: var(--font-13);
}

.legend-box {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.legend-color {
  width: var(--legend-size);
  height: var(--legend-size);
  border-radius: var(--radius-small);
}

/* ===== INVENTORY MODAL ===== */
.inventory-modal,
.floorplan-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.hidden {
  display: none !important;
}

.inventory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}

.inventory-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ===== FLOOR PLAN MODAL ===== */

.floor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 3000;
}

.floor-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3001;
}

.floor-inner {
  width: 80%;
  height: 85vh;
  background: white;
  border-radius: var(--radius-20);
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
}

/* ================= UTILITY CLASSES ================= */

.flex-spacer {
  flex-grow: 1;
}

.auto-margin-left {
  margin-left: auto;
  padding-right: 4px;
  padding-left: 32px;
}

/* Floor Plan PDF Embed */
.floor-embed {
  flex: 1;
  width: 100%;
  height: 100%;
}

/* ================= ADMIN SPREADSHEET ================= */

#spreadsheet-page {
  width: 100%;
  display: flex;
  justify-content: center;   /* center the card */
  margin-top: var(--space-xl);
}

#spreadsheet-page .project-card {
  width: 100%;
  padding: var(--space-xl);
  overflow-x: auto;
}

/* Spreadsheet table */
#spreadsheetTable {
  width: max-content;             /* allows natural expansion */
  min-width: 1600px;              /* ensures horizontal scroll */
  border-collapse: collapse;
  table-layout: auto;
  font-size: var(--font-size-sm);
}

#spreadsheetTable th,
#spreadsheetTable td {
  border: 1px solid #e0d6c2;
  padding: var(--space-10);
  text-align: left;
  white-space: nowrap;
}

/* Header row */
#spreadsheetTable th {
  background: #f4eee3;
  font-weight: var(--font-weight-semibold);
}

/* Make columns wider */
#spreadsheetTable th:nth-child(1),
#spreadsheetTable td:nth-child(1) {
  width: 120px;   /* Type */
}

#spreadsheetTable th:nth-child(2),
#spreadsheetTable td:nth-child(2) {
  width: 140px;   /* Number */
}

#spreadsheetTable th:nth-child(3),
#spreadsheetTable td:nth-child(3) {
  width: 140px;   /* Area */
}

#spreadsheetTable th:nth-child(4),
#spreadsheetTable td:nth-child(4) {
  width: 180px;   /* Status */
}

#spreadsheetTable th:nth-child(5),
#spreadsheetTable td:nth-child(5) {
  width: 200px;   /* Extra column (future use) */
}

/* ================= RESPONSIVE DESIGN ================= */

/* Tablet */

/* Desktop-only: fields shrink gracefully, labels stay fixed */
@media (min-width: 1px) {
  .form-row label { flex-shrink: 0; }
  .form-row select,
  .form-row input {
    flex: 1;
    min-width: 0;
    max-width: 18rem;
  }
  .form-row .calc-select-wrap {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
  }
  .form-row .calc-select-wrap select {
    flex: 1;
    min-width: 0;
  }
  .pill-group {
    flex: 1;
    min-width: 0;
    max-width: 18rem;
  }
}

/* Mobile — DISABLED, will implement later */
@media (max-width: 1px) {
  body {
    padding: 0;
  }

  .project-options {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }

  .project-options-button {
    width: 100%;
    max-width: 300px;
  }

  .main-card {
    flex-direction: column;
    margin-left: 16px;
    margin-right: 16px;
  }

  .calc-page .main-card {
    margin-left: 20px;
    margin-right: 20px;
  }          /* ← after this closing brace, add: */

  .project-card {
    margin-left: 20px;
    margin-right: 20px;
  }

  /* ── LEFT PANEL ── */
  .left-panel::before {
    background: url("../../assets/white pattern.png") center/cover no-repeat;
  }

  .left-panel {
    flex: 0 0 auto;
    padding: 20px 20px 24px;
    align-items: center;
  }

  .left-panel img {
    max-width: 4.2rem;
    margin-bottom: 0;
  }
  .left-panel-logo-wrap {
    margin-bottom: 5px;
  }

  .left-panel h2 {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .left-panel p { display: none; }

  .view-btn {
    width: 100%;
    margin-top: 12px;
  }

  .calc-left-btns {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
  }

  .calc-left-btns .view-btn {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0;
    margin-top: 0;
  }

  /* ── RIGHT PANEL: generous side padding to crunch content to center ── */
  .right-panel {
    padding: 18px 20px 24px;
    overflow: visible;
  }

  /* ── ALL FORM ROWS: label stacked above input, full width ── */
  .form-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 16px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .form-row label {
    width: 100% !important;
    font-size: 14.5px;
    font-weight: 500;
  }

  /* All inputs and selects fill the row */
  .form-row input,
  .form-row select,
  .right-panel .form-row input,
  .right-panel .form-row select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* ── DROPDOWN: wrap fills width, arrow stays inside ── */
  .calc-select-wrap {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    position: relative;
  }

  .calc-select-wrap select {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* ── RR + TOTAL RATE: side by side ── */
  .calc-rr-total-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
  }

  .calc-rr-total-row .form-row {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
  }

  .calc-rr-total-row .form-row input {
    width: 100% !important;
  }

  /* ── CUSTOMER NAME: full width ── */
  #calcCustomer { width: 100% !important; box-sizing: border-box; }

  /* ── PRICING MODE pills: full width, horizontal (same line) ── */
  .pill-group {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
  }

  /* ── CAR PARKING ROW: circles + Advanced on same line ── */
  /* Parking row: label full-width on top, circles + Advanced on same row below */
  .calc-parking-row {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    margin-bottom: 12px;
    justify-content: flex-start !important;
  }

  /* Label takes full width — forces circles to next line */
  .calc-parking-row > label {
    display: block !important;
    width: 100%;
    flex-shrink: 0;
    margin-bottom: 4px;
  }

  /* Circles: spaced out with bigger gap */
  .calc-parking-row > .circle-group {
    flex-shrink: 0;
    gap: 12px;
  }

  /* Advanced: gap from last circle */
  .calc-parking-row .auto-margin-left {
    margin-left: 16px;
    padding-left: 0;
    flex-shrink: 0;
  }

  .circle-group { width: auto; flex-shrink: 0; }

  /* ── ADVANCED: Floor Rise stacked above Stamp Duty (each full width),
       pills within each row are HORIZONTAL like Pricing Mode ── */
  .calc-adv-cols {
    display: block !important;
    width: 100%;
  }

  .calc-adv-cols .form-row {
    width: 100%;
    margin-bottom: 12px;
  }

  /* Pills inside advanced stay horizontal, full height */
  .calc-adv-cols .pill-group {
    flex-direction: row !important;
    width: 100% !important;
  }

  .calc-adv-cols .option-pill {
    flex: 1;
    font-size: 12px;
    height: var(--input-height);
  }

  #calcInclusive { width: 100% !important; box-sizing: border-box; }

  .generate-btn { width: 100%; margin-top: 6px; }

  /* ── OTHER PAGES ── */
  #flatSelect, #rrRate, #totalRate, #customerName {
    width: 100%;
    max-width: 100%;
  }

  .lux-table, .section-title, .print-btn { width: 95%; }
  .inventory-card { width: 95%; padding: var(--space-lg); }
  .floor-inner { width: 95%; height: 90vh; }
  .inventory-legend, .inventory-legend-top { flex-wrap: wrap; gap: var(--space-sm); }

  /* ── OUTPUT CARD ── */
  .output-card { padding: 24px 20px; margin-left: 20px; margin-right: 20px; }
  .right-panel .output-card { padding: 14px 6px; margin-left: 0; margin-right: 0; }
  .ps-body { width: 100%; }

  /* Section headers — FLAT DETAILS, PRICE DETAILS etc */
  .ps-section { font-size: 12px; }

  /* Table header row */
  .ps-table thead th { font-size: 12px; padding: 7px 8px; }

  /* Table body */
  .ps-table { font-size: 13px; }
  .ps-table tbody td { padding: 7px 8px; }

  /* Numbers column width */
  .ps-th-num { width: 28%; }

  /* Number cells */
  .ps-num { font-size: 13px; }

  /* Flat details left column */
  .ps-table--2col .ps-key { font-size: 13px; }

  /* Subtotal rows */
  .ps-subtotal td { font-size: 13px; }
  .calc-left-rate-field input {
    font-size: 13px;
  }

  /* Grand total — keep label + value on SAME LINE, allow wrapping if needed */
  .ps-grand-total {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 8px;
  }
  .ps-grand-label { font-size: 13px; }
  .ps-grand-value { font-size: 13px; }
}
