/* Keen On Cozy Living - Main Stylesheet
 * Mobile-first (>= 360px), strict CSP compliant (no inline styles).
 */

/* Self-hosted Prompt font (400, 500, 600 - thai & latin subsets) */
@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/prompt-thai-400-normal.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/prompt-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/prompt-thai-500-normal.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/prompt-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/prompt-thai-600-normal.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "Prompt";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/prompt-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #E6E7DD;
  --bg-soft: #EEF0E8;
  --surface: #FFFFFF;
  --ink: #414142;
  --ink-muted: #59595B;
  --border: #D4D5CB;
  --border-subtle: #E2E3DA;
  --btn-primary-bg: #414142;
  --btn-primary-hover: #2E2E2F;
  --btn-primary-text: #E6E7DD;
  --line-bg: #06C755;
  --line-hover: #05B34C;
  --line-text: #FFFFFF;
  --measure: #C0392B;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 10px rgba(65, 65, 66, 0.05);
  --shadow-lg: 0 12px 32px rgba(65, 65, 66, 0.12);
  --container-max: 1120px;
  --header-height: 68px;
  --font-sans: "Prompt", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--bg);
}

body.no-scroll {
  overflow: hidden;
}

body.has-mobile-bar {
  padding-bottom: 76px;
}

main {
  flex: 1 0 auto;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
}

h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  letter-spacing: 0.025em;
}

h2 {
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

.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;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 48px 0;
}

.section-header {
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
}

.btn-line {
  background-color: var(--line-bg);
  color: var(--line-text);
  font-weight: 600;
}

.btn-line:hover {
  background-color: var(--line-hover);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-soft);
  border-color: var(--ink);
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(230, 231, 221, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  padding: 6px 0;
}

.brand-logo {
  width: auto;
  height: 36px;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background-color: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.site-nav.is-open {
  display: block;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

.nav-link:hover {
  background-color: var(--bg-soft);
}

.nav-cta {
  margin-top: 10px;
  width: 100%;
}

/* Hero Section */
.hero {
  padding: 28px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-lead {
  font-size: 1rem;
  color: var(--ink-muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.hero-note {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.hero-media {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-card);
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}

.hero-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Portfolio Gallery */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease,
    border-color 0.16s ease;
}

.filter-btn:hover {
  border-color: var(--ink);
}

.filter-btn[aria-pressed="true"] {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}

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

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-footer {
  margin-top: 24px;
  text-align: center;
}

.gallery-fb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-decoration: underline;
  padding: 6px 10px;
}

.gallery-fb-link:hover {
  color: var(--btn-primary-hover);
}

/* Materials Section */
.materials-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.material-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
}

.material-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background-color: var(--bg);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.material-text {
  font-size: 0.9375rem;
}

/* Process Section */
.process-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.process-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.process-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.process-step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: 0.875rem;
  font-weight: 600;
}

.process-desc {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.section-footnote {
  margin-top: 18px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Good-to-Know Section */
.notes-card {
  padding: 8px 20px;
}

.notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notes-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border-subtle);
}

.notes-list li:last-child {
  border-bottom: 0;
}

.notes-bullet {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 9px;
  border-radius: var(--radius-pill);
  background-color: var(--ink);
}

/* FAQ Section */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  overflow: hidden;
}

.faq-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

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

.faq-summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink-muted);
}

.faq-item[open] .faq-summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 20px 18px;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

/* Contact Section */
.contact-card {
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9375rem;
}

.contact-list a {
  font-weight: 500;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.contact-area {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background-color: var(--bg-soft);
  padding: 24px 0;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.8;
}

.footer-text a {
  color: var(--ink);
  font-weight: 500;
}

/* Mobile Sticky Bottom Bar */
.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(65, 65, 66, 0.08);
}

.mobile-bar .btn {
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.9375rem;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(24, 24, 25, 0.92);
  padding: 16px;
}

.lightbox-dialog {
  position: relative;
  width: 100%;
  max-width: 960px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFFFFF;
  font-size: 0.875rem;
}

.lightbox-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox-stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lightbox-img {
  max-width: calc(100% - 96px);
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background-color: #1C1C1D;
}

.lightbox-nav {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-caption {
  color: #F2F2EE;
  font-size: 0.875rem;
  text-align: center;
  max-width: 68ch;
  line-height: 1.6;
}

/* Privacy Policy Page */
.prose-wrap {
  max-width: 780px;
  margin: 0 auto;
}

.prose-card {
  padding: 28px 20px;
}

.prose-updated {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.prose-intro {
  margin-top: 20px;
}

.prose-section {
  margin-top: 28px;
}

.prose-section h2 {
  font-size: 1.1875rem;
  margin-bottom: 10px;
}

.prose-section p + p {
  margin-top: 10px;
}

.prose-section ul {
  margin: 10px 0;
  padding-left: 22px;
}

.prose-section li {
  margin-bottom: 8px;
}

.prose-back {
  margin-top: 28px;
}

/* 404 Page */
.notfound-wrap {
  padding: 64px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notfound-card {
  width: 100%;
  max-width: 480px;
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

/* Responsive Breakpoints */
@media (min-width: 540px) {
  .container {
    padding: 0 24px;
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .prose-card {
    padding: 36px 32px;
  }
}

@media (min-width: 768px) {
  body.has-mobile-bar {
    padding-bottom: 0;
  }

  .mobile-bar {
    display: none;
  }

  .section {
    padding: 64px 0;
  }

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

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

  .contact-card {
    padding: 32px;
    grid-template-columns: 1.35fr 0.65fr;
    align-items: center;
  }

  .lightbox-img {
    max-height: 76vh;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 52px 0 64px;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 44px;
  }

  .hero-media {
    max-width: 480px;
    margin: 0 0 0 auto;
  }
}

@media (min-width: 960px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    position: static;
    align-items: center;
    gap: 16px;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .nav-cta {
    margin-top: 0;
    width: auto;
    white-space: nowrap;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

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

/* Quick Estimator Page (estimate.html) */
.est-main {
  padding-top: 28px;
  padding-bottom: 56px;
}

.est-wrap {
  max-width: 760px;
}

.est-header {
  margin-bottom: 24px;
}

.est-intro {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--ink-muted);
}

.est-app {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.est-card {
  padding: 22px 18px;
}

/* Skeleton Loader */
.est-skeleton {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.est-skel-line,
.est-skel-box {
  background: linear-gradient(90deg, var(--bg-soft) 25%, #F6F7F2 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: est-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.est-skel-title {
  width: 48%;
  height: 28px;
}

.est-skel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.est-skel-box {
  height: 84px;
}

@keyframes est-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .est-skel-line,
  .est-skel-box {
    animation: none;
  }
}

/* Load Error Card */
.est-load-error {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 20px;
}

.est-load-error-text {
  font-size: 1rem;
  max-width: 44ch;
}

.est-load-error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Form Steps */
.est-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.est-step {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.est-step + .est-step {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.est-subgroup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.est-step-title {
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--ink);
}

/* Step 1: Job Type Cards */
.est-jobtype-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.est-jobtype-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.est-jobtype-card:hover {
  border-color: var(--ink);
}

.est-jobtype-card[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.est-icon {
  flex-shrink: 0;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.est-jobtype-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.est-jobtype-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.est-jobtype-sub {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.est-jobtype-other {
  border-style: dashed;
  background: var(--bg-soft);
}

/* Unavailable job types and options: faded button with its label */
.est-jobtype-card.is-unavailable,
.est-option-card.is-unavailable {
  border-style: dashed;
  background: var(--bg-soft);
  box-shadow: none;
}

.est-jobtype-card.is-unavailable:hover,
.est-option-card.is-unavailable:hover {
  border-color: var(--ink-muted);
}

/* Text stays at >= 4.5:1 contrast on --bg-soft; only the decorative icon is see-through. */
.is-unavailable .est-icon {
  opacity: 0.4;
}

.is-unavailable .est-jobtype-name,
.is-unavailable .est-option-label,
.is-unavailable .est-option-note {
  color: #6B6B6D;
  font-weight: 500;
}

.est-unavailable-badge {
  display: inline-block;
  width: fit-content;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
}

/* Step 2: Config Pills & Shape Cards */
.est-pill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.est-choice-pill {
  min-height: 46px;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.est-choice-pill:hover {
  border-color: var(--ink);
}

.est-choice-pill[aria-checked="true"] {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

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

.est-shape-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.est-shape-card:hover {
  border-color: var(--ink);
}

.est-shape-card[aria-checked="true"] {
  border-color: var(--ink);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.est-shape-icon {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.est-shape-card[aria-checked="true"] .est-shape-icon {
  fill: var(--ink);
}

/* Kitchen Plan Drawing (SVG built by estimator.js) */
.est-svg-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.est-kitchen-svg {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

.est-svg-wall {
  stroke: var(--ink-muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.est-svg-cab {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 1.8;
}

.est-svg-cab.is-upper {
  fill: #F6F7F2;
  stroke-dasharray: 4 3;
}

.est-svg-guide {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.1;
  stroke-dasharray: 3 3;
}

/* Dimension arrows: each side measured from the wall corner */
.est-svg-dim {
  stroke: var(--measure);
  stroke-width: 1.5;
}

.est-svg-dim-ext {
  stroke: var(--measure);
  stroke-width: 1;
}

.est-svg-dim-head {
  fill: var(--measure);
}

.est-svg-label {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
}

.est-svg-value {
  font-weight: 600;
}

/* Size Inputs */
.est-dim-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.est-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.est-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

.est-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 500;
}

.est-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.est-input {
  width: 100%;
  min-height: 46px;
  padding: 9px 44px 9px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.4;
}

.est-input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-color: var(--ink);
}

.est-input[aria-invalid="true"] {
  border-color: #B42318;
  background: #FFF9F8;
}

.est-input-unit {
  position: absolute;
  right: 14px;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  pointer-events: none;
}

.est-field-error,
.est-alert {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #F5C2C0;
  background: #FEF3F2;
  color: #9A1B12;
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Upper-equals-lower Switch */
.est-toggle-row {
  padding: 2px 0;
}

.est-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.est-switch-track {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--border);
  transition: background-color 0.18s ease;
}

.est-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.est-switch[aria-checked="true"] .est-switch-track {
  background: var(--btn-primary-bg);
}

.est-switch[aria-checked="true"] .est-switch-track::after {
  transform: translateX(20px);
}

.est-hint {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* TV set (ชุดวางทีวี): part checkboxes with their size fields */
.est-tv-parts {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.est-tv-legend {
  padding: 0;
}

.est-tv-part {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
}

.est-tv-part.is-on {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.est-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.est-check-input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.est-check-input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.est-check-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.est-check-name {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
}

.est-check-desc {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

.est-check-sub .est-check-name {
  font-weight: 500;
}

.est-tv-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.est-pill-grid.est-tv-side-count {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* TV set drawing (SVG built by estimator.js) */
.est-tv-svg {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
}

.est-svg-tv-panel {
  fill: #F4F5EF;
  stroke: var(--ink-muted);
  stroke-width: 1.2;
}


.est-svg-tv-screen {
  fill: #DADBD3;
  stroke: #B4B5AC;
  stroke-width: 1.2;
}

.est-svg-dim-guide {
  stroke: var(--measure);
  stroke-width: 0.8;
  stroke-dasharray: 3 3;
}

.est-svg-tv-name {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
}

/* Halo in the box colour: guides that pass behind a caption do not cross its text. */
.est-svg-tv-caption {
  font-size: 15px;
  paint-order: stroke;
  stroke: var(--bg-soft);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.est-svg-tv-capname {
  font-size: 14px;
  font-weight: 500;
}

/* Wardrobe drawing (SVG built by estimator.js): door lines and handles in the cabinet colours, never the arrow red */
.est-wardrobe-svg {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
}

.est-svg-wd-door {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.1;
}

.est-svg-wd-front {
  fill: var(--surface);
  stroke-width: 1.5;
}

.est-svg-wd-handle {
  fill: var(--ink-muted);
  stroke: var(--ink-muted);
  stroke-width: 2;
  stroke-linecap: round;
}

/* Island drawing (SVG built by estimator.js): oblique view; the counter top and the right side in two light tones, doors as the wardrobe */
.est-island-svg {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
}

.est-svg-is-top {
  fill: #F3F3EE;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.est-svg-is-side {
  fill: #E4E6DC;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

/* Material and Wardrobe Door Options */
.est-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.est-option-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.est-option-card:hover {
  border-color: var(--ink);
}

.est-option-card[aria-checked="true"] {
  border-color: var(--ink);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.est-option-card .est-option-label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.est-option-note {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* Submit Row */
.est-submit-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.est-submit-row .btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.est-notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.875rem;
  color: var(--ink);
}

/* Result Card */
.est-result-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-color: var(--ink);
}

.est-result-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.est-result-label {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
}

.est-result-price {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.25;
}

.est-result-promo {
  width: fit-content;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #C6DFD0;
  background: #EDF5F0;
  color: #2B593F;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Spec round 3: what the price does not include yet (items[i].pending). */
.est-result-pending {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.6;
}

.est-disclaimer {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.est-included {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  overflow: hidden;
}

.est-included-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

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

.est-included-summary::after {
  content: "+";
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink-muted);
}

.est-included[open] .est-included-summary::after {
  content: "\2212";
}

.est-included-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.est-included-p {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.est-included-excl {
  color: var(--ink);
}

.est-result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Estimate List */
.est-list-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.est-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.est-list-title {
  font-size: 1.1875rem;
}

.est-list-status {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.est-list-items {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.est-list-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.est-list-row:first-child {
  padding-top: 4px;
}

.est-list-row-label {
  font-size: 0.9375rem;
  line-height: 1.55;
}

.est-list-row-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.est-list-row-price {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.est-delete-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.est-list-total {
  padding-top: 4px;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: right;
}

/* Hand-off Section (content added by T10) */
.est-handoff-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.est-handoff-title {
  font-size: 1.25rem;
}

.est-handoff-mount {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.est-handoff-mount:empty {
  display: none;
}

@media (min-width: 540px) {
  .est-card {
    padding: 28px 26px;
  }

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

  .est-jobtype-other {
    grid-column: 1 / -1;
  }

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

  .est-submit-row {
    align-items: flex-end;
  }

  .est-submit-row .est-alert {
    align-self: stretch;
  }

  .est-submit-row .btn {
    min-width: 240px;
  }

  .est-result-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .est-list-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .est-list-row-right {
    flex-shrink: 0;
  }
}

/* Hand-off section content (T10: LINE card, QR, callback form) */
.ho-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.ho-panel-title {
  font-size: 1.0625rem;
  font-weight: 600;
}

.ho-intro,
.ho-line-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ho-text {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.ho-line-open {
  width: 100%;
}

.ho-qr-box {
  display: flex;
  justify-content: center;
}

.ho-qr {
  width: auto;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
}

.ho-line-actions,
.ho-success-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.ho-copy {
  width: 100%;
}

.ho-link {
  font-size: 0.9375rem;
  font-weight: 500;
}

.ho-copy-buffer {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ho-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ho-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ho-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

.ho-req {
  color: #B42318;
}

.ho-input {
  width: 100%;
  min-height: 46px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.4;
}

.ho-textarea {
  min-height: 112px;
  resize: vertical;
}

.ho-input::placeholder {
  color: #6B6B6D;
}

.ho-input:focus-visible,
.ho-choice input:focus-visible,
.ho-check input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.ho-input:focus-visible {
  border-color: var(--ink);
}

.ho-input[aria-invalid="true"] {
  border-color: #B42318;
  background: #FFF9F8;
}

.ho-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ho-group legend {
  padding: 0;
  margin-bottom: 8px;
}

.ho-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ho-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.9375rem;
  cursor: pointer;
}

.ho-choice:hover {
  border-color: var(--ink);
}

.ho-choice:has(input:checked) {
  border-color: var(--ink);
  background: var(--bg-soft);
  font-weight: 500;
}

.ho-choice input[aria-invalid="true"] {
  outline: 2px solid #B42318;
  outline-offset: 1px;
}

.ho-choice input,
.ho-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--ink);
}

.ho-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.ho-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.ho-error {
  color: #9A1B12;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Live region: stays rendered (zero height) when empty so the note is announced. */
.ho-note {
  font-size: 0.875rem;
  color: var(--ink);
}

.ho-note:not(:empty) {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.ho-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ho-turnstile {
  min-height: 65px;
}

.ho-submit {
  width: 100%;
}

.ho-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.ho-success {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ho-ref {
  font-size: 1.125rem;
  font-weight: 600;
}

@media (min-width: 540px) {
  .ho-panel {
    padding: 22px 22px;
  }

  .ho-line-open,
  .ho-copy,
  .ho-submit {
    width: auto;
    min-width: 240px;
  }

  .ho-success-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 20px;
  }
}
