/* ===== GLOBAL ===== */

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 40px 0px;
  background-image: url('images/cleaning-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

h1 {
  color: #002b8f;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  text-align: center;
  text-transform: capitalize;
}

h2 {
  color: #002b8f;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.25px;
  text-transform: uppercase;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.0); /* adjust transparency here */
  z-index: -1;
}

/* ===== CONTAINER ===== */

.container {
  max-width: 600px;
  margin: auto;
  background: rgba(255, 255, 255, 0.40); /* white with transparency */
  backdrop-filter: blur(6px);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}


/* ===== CARD SECTIONS ===== */

.section {
  background: white;
  padding: 22px;
  margin-bottom: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transition: 0.2s ease;
}

.section:hover {
  transform: translateY(-2px);
}

h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

/* ===== GRID LAYOUT ===== */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  max-width: 540px;
  margin: 0 auto;
}

.recurring-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.recurring-input-grid > div {
  min-width: 0;
}

.recurring-input-grid label {
  margin-bottom: 8px;
}

.recurring-input-grid input[type="number"] {
  box-sizing: border-box;
  max-width: none;
  padding: 11px 12px;
  border-radius: 6px;
  background: #f8fbfc;
}

.level-field {
  max-width: 540px;
  margin: 0 auto 22px;
}

.level-select {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8fbfc;
  color: #172b4d;
  font: inherit;
}

.level-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.field-hint {
  margin: 6px 0 0;
  color: #526174;
  font-size: 12px;
}

label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

input[type="number"] {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  transition: 0.2s;
  max-width: 540px;
}

input[type="number"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

input[type="checkbox"] {
  margin-right: 6px;
}

/* ===== RESULTS BOX ===== */

.results {
  background: #007bff;
  color: white;
  padding: 18px 18px;
  border-radius: 16px;
  margin-bottom: 20px;
  max-width: 520px;
  min-width: 520px;
}

.results p {
  margin: 6px;
  font-size: 15px;
  font-weight: 500;
}

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

button {
  width: 100%;
  background: #007bff;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

/* ===== TEXTAREA ===== */

textarea {
  width: 100%;
  max-width: 540px;
  min-width: 540px;
  border-radius: 10px;
  border: 1px solid #ddd;
  padding: 10px 10px;
  font-family: monospace;
  resize:both;
}

.hidden {
  display: none;
}

/* subtle text links used for footers, terms, etc. */
.subtle-link {
  color: rgba(0,0,0,0.45);
  text-decoration: none;
  font-size: 13px;
}
.subtle-link:hover {
  color: rgba(0,0,0,0.75);
  text-decoration: underline;
}

/* ===== SIDEBAR ===== */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 320px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #002b8f;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-close {
  background: rgba(0, 43, 143, 0.1);
  border: 1px solid rgba(0, 43, 143, 0.2);
  color: #002b8f;
  font-size: 24px;
  cursor: pointer;
  padding: 6px 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: 0.2s;
}

.sidebar-close:hover {
  background: rgba(0, 43, 143, 0.15);
  border-color: rgba(0, 43, 143, 0.35);
}

.sidebar-tabs {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 10px;
}

.sidebar-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-profile .sidebar-tab {
  width: 100%;
}

.language-menu {
  position: relative;
  width: 42px;
  height: 42px;
}

.language-toggle {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  background: var(--brand-dark);
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.language-toggle::-webkit-details-marker {
  display: none;
}

.language-toggle::marker {
  content: "";
}

.language-toggle:hover {
  background: var(--brand);
  transform: none;
}

.language-options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 1101;
  display: grid;
  gap: 3px;
  width: 196px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 55, 58, 0.18);
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.language-option:hover,
.language-option[aria-pressed="true"] {
  background: #eef5f3;
  color: var(--brand-dark);
}

.language-option kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
}

.sidebar-tab {
  background: rgba(0, 43, 143, 0.15);
  border: 1px solid rgba(0, 43, 143, 0.25);
  color: #002b8f;
  padding: 14px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: left;
  display: block;
}

.sidebar-tab:hover {
  background: rgba(0, 43, 143, 0.2);
  border-color: rgba(0, 43, 143, 0.35);
  transform: translateX(3px);
}

.sidebar-tab.active {
  background: rgba(0, 43, 143, 0.25);
  border-color: rgba(0, 43, 143, 0.45);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 43, 143, 0.2);
}

.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 999;
  background: rgba(0, 43, 143, 0.85);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s ease;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 43, 143, 0.25);
  width: auto;
}

.sidebar-toggle:hover {
  background: rgba(0, 43, 143, 0.95);
  box-shadow: 0 6px 16px rgba(0, 43, 143, 0.35);
  transform: translateY(-1px);
}

/* ===== TAB CONTENT ===== */

.rec-option {
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  padding: 12px 16px;
  flex: 1 1 180px;
  margin: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  color: #002b8f;
  font-size: 13px;
  line-height: 1.3;
}

.rec-option h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #002b8f;
}

.rec-option p {
  margin: 3px 0;
}

.rec-option p:last-child {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 43, 143, 0.14);
  font-size: 15px;
  font-weight: 700;
}

#recResults {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 16px;
}


.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 768px) {
  .container {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 20px;
    margin-top: 60px;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: 100vh;
    box-shadow: none;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

.app-footer {
  text-align: center;
  margin-top: 40px;
  padding: 15px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.484);
}

/* ===== SPLASH / LOGO STYLES ===== */
.splash {
  position: fixed;
  inset: 0;
  left: calc(50% + (100vw - 100%) / 2);
  right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(7, 16, 45, 0.85), rgba(3, 10, 26, 0.85));
  z-index: 2000;
  backdrop-filter: blur(4px) saturate(1.02);
  -webkit-backdrop-filter: blur(4px) saturate(1.02);
  transition: opacity 240ms cubic-bezier(.2,.9,.3,1), transform 240ms cubic-bezier(.2,.9,.3,1);
}
.splash-hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.98);
  pointer-events: none;
}
.splash-content {
  text-align: center;
  color: rgba(255,255,255,0.95);
}
.splash-logo {
  width: 140px;
  height: 140px;
  margin: 0 auto 14px auto;
  filter: drop-shadow(0 6px 12px rgba(6,9,20,0.35));
  transform-origin: center center;
  animation: logoPop 480ms cubic-bezier(.22,.9,.3,1) both;
}
.splash-logo { position: relative; }
.splash-title {
  margin: 0;
  text-align: center;
  font-family: 'Segoe UI', sans-serif;
  font-size: 30px;
  letter-spacing: 0.8px;
  font-weight: 800;
  background: linear-gradient(90deg, #ffffff, #dffafd 40%, #b8fff7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 18px rgba(2,12,30,0.45);
}
.splash-sub {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 15px;
  opacity: 0.98;
  color: rgba(255,255,255,0.95);
  font-style: italic;
  letter-spacing: 0.2px;
  text-shadow: 0 3px 10px rgba(2,12,30,0.28);
}

.splash-divider {
  height: 2px;
  width: 64px;
  margin: 12px auto 10px auto;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.7), rgba(255,255,255,0.12));
}

@keyframes logoPop {
  from { transform: translateY(6px) scale(0.94); opacity: 0; }
  60% { transform: translateY(-4px) scale(1.02); opacity: 1; }
  to { transform: translateY(0) scale(1); }
}

/* subtle sheen for svg circle using background animation on parent */
.splash-logo svg circle {
  transform-origin: center center;
}
.splash-logo::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(120deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.0) 40%, rgba(255,255,255,0.05) 70%, rgba(255,255,255,0.0) 100%);
  mix-blend-mode: overlay;
  animation: sheen 1.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sheen {
  0% { transform: translate(-70%, -50%) rotate(10deg); opacity: 0; }
  25% { opacity: 0.45; }
  60% { transform: translate(70%, -50%) rotate(10deg); opacity: 0.45; }
  100% { transform: translate(140%, -50%) rotate(10deg); opacity: 0; }
}

/* blinking state when app is still loading */
.splash-blink {
  animation: blinkPulse 1200ms ease-in-out infinite;
}

@keyframes blinkPulse {
  0% { opacity: 1; }
  50% { opacity: 0.92; }
  100% { opacity: 1; }
}

/* swoosh draw animation */
.shoot-tail {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: drawTail 900ms cubic-bezier(.22,.9,.33,1) forwards;
}
.shoot-tail-hi {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: drawTail 1100ms cubic-bezier(.22,.9,.33,1) forwards 60ms;
}

@keyframes drawTail {
  to { stroke-dashoffset: 0; }
}
.light-sweep {
  transform-origin: center;
  mix-blend-mode: screen;
  filter: blur(6px);
  opacity: 0.95;
  animation: sweepMove 1600ms cubic-bezier(.2,.8,.25,1) forwards;
}

.sweep-trace {
  stroke-dasharray: 8 260;
  stroke-dashoffset: 0;
  opacity: 0.9;
  stroke-width: 3;
  animation: traceMove 1600ms cubic-bezier(.22,.9,.3,1) forwards 120ms;
}

@keyframes traceMove {
  0% { stroke-dashoffset: 0; opacity: 0.9; }
  80% { stroke-dashoffset: 220; opacity: 0.6; }
  100% { stroke-dashoffset: 260; opacity: 0; }
}

/* moving star head along the path */
.star-head {
  offset-path: path('M18 44 C48 62, 78 76, 106 96');
  offset-distance: 0%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.25));
}

@keyframes starMove {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}
.star-head {
  transform-origin: center;
  animation: starMove 1600ms linear forwards 80ms, popStar 640ms cubic-bezier(.22,.9,.3,1) 780ms both;
}

@keyframes popStar {
  from { transform: scale(0.72) translateY(6px); opacity: 0; }
  60% { transform: scale(1.06) translateY(-2px); opacity: 1; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Reduced / lite splash for slow connections or data-saver */
.splash.splash-lite {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.splash.splash-lite .splash-logo {
  filter: none;
}
.splash.splash-lite .splash-logo::after {
  display: none;
  animation: none;
}
.splash.splash-lite .shoot-tail,
.splash.splash-lite .shoot-tail-hi {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}
.splash.splash-lite .star-head {
  animation: none;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .splash-logo,
  .splash-logo::after,
  .shoot-tail,
  .shoot-tail-hi,
  .star-head {
    animation: none !important;
    transition: none !important;
  }
  .splash-blink { animation: none !important; }
}

@media (max-width: 480px) {
  .recurring-input-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ===== CALCULATOR LAYOUT ===== */

:root {
  --ink: #17373a;
  --muted: #617675;
  --brand: #137b76;
  --brand-dark: #0d5b58;
  --line: #d9e5e2;
  --surface: #ffffff;
  --focus: rgba(19, 123, 118, 0.18);
}

.auth-pending #sidebar,
.auth-pending #sidebarToggle,
.auth-pending .container,
.auth-pending .app-footer {
  visibility: hidden;
}

.local-preview-notice {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid #e9d6aa;
  border-radius: 7px;
  background: #fff9eb;
  color: #684f1c;
  font-size: 13px;
  line-height: 1.5;
}

body {
  padding: 30px 16px;
  background-color: #eaf1ef;
}

body::before {
  z-index: 0;
  background: rgba(235, 244, 242, 0.68);
  pointer-events: none;
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  background: rgba(250, 253, 252, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 48px rgba(25, 57, 55, 0.16);
}

h1 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 1.9rem;
  text-align: left;
}

h2 {
  color: var(--ink);
}

.section {
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(23, 55, 58, 0.045);
  transition: box-shadow 0.18s ease;
}

.section:hover {
  transform: none;
  box-shadow: 0 5px 16px rgba(23, 55, 58, 0.08);
}

.section h2 {
  padding-bottom: 10px;
  border-bottom-color: var(--line);
  color: var(--ink);
  font-size: 1.05rem;
}

.grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: none;
  margin: 0;
}

.property-grid .level-field {
  max-width: none;
  margin: 0;
}

.deep-clean-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.deep-clean-field {
  min-width: 0;
}

.deep-clean-field label {
  display: flex;
  align-items: flex-end;
  min-height: 2.4em;
  line-height: 1.2;
}

.deep-clean-columns > .check-card {
  width: 100%;
}

.level-field {
  max-width: none;
  margin-bottom: 18px;
}

.field-hint {
  color: var(--muted);
}

label {
  margin-bottom: 7px;
  color: #385354;
  font-weight: 600;
}

input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf9;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.cleaning-mode-grid,
.deep-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 46px;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf9;
  color: #385354;
  cursor: pointer;
  font-weight: 550;
}

.check-card:has(input:checked) {
  border-color: #91bdb7;
  background: #eaf4f2;
  color: var(--brand-dark);
}

#deepOptions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

#deepOptions h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 0.98rem;
}

.hidden {
  display: none !important;
}

.results {
  width: 100%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  border-radius: 9px;
  background: var(--brand-dark);
}

button {
  min-height: 44px;
  border-radius: 7px;
  background: var(--brand);
  transition: background 0.16s ease;
}

button:hover {
  background: var(--brand-dark);
  transform: none;
}

button:focus-visible {
  outline: 3px solid #d39a36;
  outline-offset: 2px;
}

textarea {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 180px;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf9;
  color: var(--ink);
  line-height: 1.5;
  resize: vertical;
}

.sidebar {
  border-right-color: var(--line);
  background: rgba(248, 252, 251, 0.97);
  box-shadow: 0 12px 36px rgba(23, 55, 58, 0.18);
}

.sidebar-header,
.sidebar-header h3 {
  color: var(--ink);
}

.sidebar-tab {
  border-color: var(--line);
  border-radius: 7px;
  background: #f2f7f5;
  color: #355452;
}

.sidebar-tab:hover {
  border-color: #bfd6d2;
  background: #e7f1ef;
  transform: none;
}

.sidebar-tab.active {
  border-color: #8fbab3;
  background: #dcece9;
  color: var(--brand-dark);
  box-shadow: inset 3px 0 var(--brand);
}

.sidebar-toggle {
  background: var(--brand-dark);
}

.sidebar-toggle:hover {
  background: var(--brand);
  transform: none;
}

.rec-option {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(23, 55, 58, 0.05);
}

.rec-option h3 {
  color: var(--brand-dark);
}

.rec-option p:last-child {
  border-top-color: var(--line);
}

#recResults {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.app-footer {
  position: relative;
  z-index: 1;
  color: #f6fbfa;
  text-shadow: 0 1px 4px rgba(17, 44, 43, 0.5);
}

@media (max-width: 768px) {
  body {
    padding: 16px 12px;
  }

  .container {
    max-width: 680px;
    margin-top: 48px;
    padding: 20px;
  }

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

@media (max-width: 480px) {
  .container {
    padding: 14px;
  }

  .section {
    padding: 16px;
  }

  .grid,
  .cleaning-mode-grid,
  .deep-check-grid,
  #recResults {
    grid-template-columns: minmax(0, 1fr);
  }

  .property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .deep-clean-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .recurring-input-grid,
  #recResults {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .profile-grid,
  .profile-rate-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .profile-grid.profile-level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 1.6rem;
  }
}

.summary-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 650;
  list-style: none;
}

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

.summary-disclosure > summary::marker {
  content: "";
}

.summary-disclosure > summary:focus-visible {
  outline: 3px solid #d39a36;
  outline-offset: 3px;
  border-radius: 4px;
}

.summary-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-right: 4px;
  border-right: 2px solid var(--brand-dark);
  border-bottom: 2px solid var(--brand-dark);
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.summary-disclosure[open] .summary-chevron {
  transform: rotate(45deg);
}

.summary-content {
  padding-top: 14px;
}

.summary-content textarea {
  display: block;
  margin-bottom: 14px;
}

.summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-actions button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cleaning-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deep-check-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.deep-check-grid .check-card {
  padding: 9px;
  font-size: 12px;
}

.check-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-card:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.level-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.level-label {
  display: block;
  margin-bottom: 7px;
  color: #385354;
  font-size: 13px;
  font-weight: 600;
}

.level-picker {
  position: relative;
}

.level-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf9;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.level-picker > summary::-webkit-details-marker {
  display: none;
}

.level-picker > summary::marker {
  content: "";
}

.level-picker > summary:focus-visible {
  outline: 3px solid var(--focus);
  border-color: var(--brand);
}

.level-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-right: 3px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.14s ease;
}

.level-picker[open] .level-chevron {
  transform: rotate(225deg) translateY(-2px);
}

.level-picker-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  gap: 2px;
  max-height: 202px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  box-shadow: 0 5px 14px rgba(23, 55, 58, 0.12);
}

.level-option {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.level-option:hover,
.level-option[aria-pressed="true"] {
  background: #eef5f3;
  color: var(--brand-dark);
}

.level-option:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.level-error {
  margin: 6px 0 0;
  color: #a63d39;
  font-size: 12px;
}

.level-error:empty {
  display: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-grid > div {
  min-width: 0;
}

.profile-grid input[type="text"],
.profile-grid input[type="tel"],
.profile-grid input[type="email"],
.profile-grid select {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf9;
  color: var(--ink);
  font: inherit;
}

.profile-grid input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

.profile-grid .profile-full-width {
  grid-column: 1 / -1;
}

.profile-rate-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-grid.profile-level-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.profile-settings-section {
  display: grid;
  gap: 8px;
}

.profile-settings-section > h2 {
  margin-bottom: 2px;
}

.profile-settings-section > details {
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.profile-settings-section .summary-content {
  display: grid;
  gap: 18px;
  padding: 8px 0 14px;
}

.profile-settings-section .summary-content > .profile-subheading {
  margin: 0;
}

#instructionsSection .section {
  padding: 30px 32px;
}

#instructionsSection .section h2 {
  margin-top: 30px;
  margin-bottom: 14px;
  padding-bottom: 11px;
}

#instructionsSection .section h2:first-child {
  margin-top: 0;
}

#instructionsSection .section p,
#instructionsSection .section ul {
  margin-top: 0;
  margin-bottom: 24px;
  line-height: 1.7;
}

#instructionsSection .section li + li {
  margin-top: 9px;
}

#instructionsSection .section > :last-child {
  margin-bottom: 0;
}

.profile-subheading {
  margin: 2px 0 -4px;
  color: var(--ink);
  font-size: 0.9rem;
}

.profile-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.archive-list {
  display: grid;
  gap: 12px;
}

.archive-entry {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.archive-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.archive-entry-identity {
  min-width: 0;
}

.archive-entry-header h2 {
  margin: 0 0 5px;
  border: 0;
  padding: 0;
  font-size: 1rem;
}

.archive-entry-address,
.archive-entry-date {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.archive-estimate-type {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 5px;
  background: #eaf4f2;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 650;
}

.archive-entry-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.archive-entry-details > summary {
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
}

.archive-entry-summary {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.archive-entry-actions,
.archive-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.archive-entry-actions button,
.archive-dialog-actions button {
  width: auto;
  min-width: 100px;
}

.archive-delete-button,
.archive-cancel {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.archive-delete-button:hover,
.archive-cancel:hover {
  background: #f1f6f4;
}

.archive-status,
.archive-empty {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.archive-error {
  color: #9b3633;
}

.archive-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  box-sizing: border-box;
  padding: 26px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(23, 55, 58, 0.22);
}

.archive-dialog::backdrop {
  background: rgba(17, 44, 43, 0.48);
  backdrop-filter: blur(3px);
}

.archive-dialog form {
  display: grid;
  gap: 12px;
}

.archive-dialog h2 {
  margin: 0 0 2px;
}

.archive-dialog p {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.55;
}

.archive-dialog label {
  margin: 4px 0 -6px;
}

.archive-dialog input,
.archive-dialog textarea {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf9;
  color: var(--ink);
  font: inherit;
}

.archive-dialog textarea {
  resize: vertical;
}

.profile-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 7px;
  background: var(--brand);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.profile-action:hover {
  background: var(--brand-dark);
}

.profile-logout {
  width: auto;
  min-width: 112px;
  border: 1px solid #d9a5a0;
  background: #fff;
  color: #8b3d38;
}

.profile-logout:hover {
  border-color: #b86b64;
  background: #fbefee;
  color: #75312d;
}

@media (max-width: 480px) {
  .cleaning-mode-grid {
    gap: 6px;
  }

  .cleaning-mode-grid .check-card {
    gap: 6px;
    padding: 8px;
    font-size: 11px;
  }

  .deep-check-grid {
    gap: 6px;
  }
}