:root {
  color-scheme: dark;
  --bg: #06090d;
  --panel: rgba(12, 17, 24, 0.82);
  --panel-strong: rgba(17, 23, 33, 0.94);
  --line: rgba(176, 199, 255, 0.12);
  --line-strong: rgba(192, 208, 255, 0.2);
  --text: #f4f7fb;
  --muted: #9aa4b5;
  --soft: #c7cfdd;
  --purple: #8c42ff;
  --violet: #b35cff;
  --cyan: #43d8c9;
  --lime: #b7ec57;
  --danger: #ff6b8a;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 6%, rgba(85, 57, 178, 0.2), transparent 36rem),
    radial-gradient(circle at 28% 68%, rgba(48, 178, 171, 0.09), transparent 32rem),
    linear-gradient(135deg, #05070a, #0a1017 48%, #080812);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(420px, 480px) minmax(0, 1fr);
  min-height: 100vh;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding: 34px 38px;
  border-right: 1px solid var(--line);
  background: rgba(5, 9, 14, 0.74);
  backdrop-filter: blur(18px);
}

.hero-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(4, 7, 11, 0.96) 0%, rgba(4, 7, 11, 0.68) 32%, rgba(4, 7, 11, 0.2) 58%, rgba(4, 7, 11, 0.78) 100%),
    url("./assets/fylmo-hero-operator-car.png") 48% bottom / cover no-repeat;
}

.hero-sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid rgba(192, 208, 255, 0.11);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  width: max-content;
  letter-spacing: 0.42em;
  font-size: 1.6rem;
  font-weight: 650;
}

.hero-copy {
  margin-top: 30px;
  max-width: 400px;
}

.hero-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.8rem, 3.5vw, 4.15rem);
  line-height: 1.13;
  letter-spacing: 0;
}

.hero-copy span {
  color: var(--violet);
}

.hero-copy p {
  margin: 24px 0 0;
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-foot {
  display: grid;
  gap: 6px;
  margin-top: auto;
  color: var(--soft);
  font-size: 0.98rem;
  line-height: 1.45;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-item {
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
}

.nav-item.is-active,
.nav-item:hover {
  color: var(--text);
  border-color: rgba(140, 66, 255, 0.42);
  background: linear-gradient(135deg, rgba(140, 66, 255, 0.28), rgba(60, 39, 116, 0.18));
}

.sidebar-foot {
  display: grid;
  gap: 6px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.86rem;
}

.sidebar-foot strong {
  color: var(--soft);
}

.workspace {
  min-width: 0;
  padding: 34px 24px 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 auto 28px;
  max-width: 1240px;
}

.topbar h1,
.panel h2,
.cta-band h2,
.quote-form h2,
.thanks-card h1 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 3vw, 3.25rem);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}

.top-actions,
.cta-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
}

#builder,
#settings,
#estimate,
#contact {
  scroll-margin-top: 28px;
}

.builder-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(9, 14, 20, 0.66);
}

.category-tab {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 72px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: center;
}

.tab-icon {
  color: var(--soft);
  font-size: 1.28rem;
  line-height: 1;
}

.category-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--violet);
  background: linear-gradient(180deg, rgba(140, 66, 255, 0.16), rgba(140, 66, 255, 0.04));
}

.panel,
.estimate-card,
.cta-band,
.quote-form,
.thanks-card {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(22px);
}

.panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.service-card {
  display: grid;
  gap: 14px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 21, 30, 0.7);
  color: var(--soft);
}

.service-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
  gap: 9px;
}

.service-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(183, 236, 87, 0.34);
  border-radius: 999px;
  color: #d9ff87;
  background: rgba(183, 236, 87, 0.08);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.service-badge::before {
  content: "◎";
  font-size: 0.75rem;
}

.service-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.service-card.is-active {
  border-color: rgba(179, 92, 255, 0.62);
  background: linear-gradient(145deg, rgba(140, 66, 255, 0.22), rgba(15, 21, 30, 0.82));
}

.price-chip {
  width: max-content;
  max-width: 100%;
  color: #ddc9ff;
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1.25;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(139, 149, 162, 0.22);
  transition: 180ms ease;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: 180ms ease;
}

.toggle input:checked + span {
  background: linear-gradient(90deg, #702ee6, #b75cff);
}

.toggle input:checked + span::after {
  left: 27px;
  background: #fff;
}

.quantity-row {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  max-width: 144px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.quantity-row button {
  min-height: 38px;
  border: 0;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.quantity-row output {
  text-align: center;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.9fr;
  gap: 12px;
}

.setting-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 21, 30, 0.68);
}

.custom-panel {
  display: grid;
  gap: 16px;
}

.custom-field {
  display: grid;
  gap: 9px;
  color: var(--soft);
  font-weight: 750;
}

.custom-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.setting-card span {
  color: var(--muted);
}

.setting-card strong {
  color: var(--text);
  font-size: 1.02rem;
}

.setting-card small {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--violet);
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(7, 11, 17, 0.78);
  outline: none;
}

textarea {
  resize: vertical;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 42px;
}

.selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(18, 24, 34, 0.76);
}

.selected-pill button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
}

.estimate-card {
  position: sticky;
  top: 18px;
  align-self: start;
  overflow: hidden;
}

.estimate-card > * {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.estimate-top span,
.breakdown h3 {
  color: var(--soft);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.estimate-top strong {
  display: block;
  margin: 18px 0 8px;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.08;
}

.estimate-top small,
.complexity p {
  color: var(--muted);
}

.complexity {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.ring {
  display: grid;
  place-items: center;
  width: 140px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(11, 16, 24, 1) 58%, transparent 59%),
    conic-gradient(var(--cyan) calc(var(--score) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.ring span {
  color: var(--lime);
  font-size: 2rem;
  font-weight: 900;
}

.breakdown dl {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.breakdown div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
}

.breakdown dd {
  margin: 0;
  color: var(--soft);
  font-weight: 750;
  text-align: right;
}

.primary-btn,
.ghost-btn,
.text-btn,
.icon-btn {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-height: 48px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-weight: 800;
}

.primary-btn {
  border-color: transparent;
  background: linear-gradient(135deg, #7430e6, #9d43ff);
  box-shadow: 0 18px 45px rgba(112, 46, 230, 0.28);
}

.ghost-btn:hover,
.text-btn:hover,
.icon-btn:hover {
  border-color: rgba(179, 92, 255, 0.46);
  background: rgba(140, 66, 255, 0.12);
}

.text-btn {
  min-height: auto;
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  padding: 0;
}

.wide,
.estimate-card > .primary-btn,
.estimate-card > .ghost-btn {
  display: grid;
  place-items: center;
  width: calc(100% - 40px);
  margin: 14px 20px 0;
}

.estimate-card > .ghost-btn {
  margin-bottom: 16px;
}

.as-link {
  display: inline-grid;
  place-items: center;
}

.calendar-card {
  display: grid;
  gap: 7px;
  margin: 4px 20px 20px;
  padding: 20px;
  border: 1px solid rgba(140, 66, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(140, 66, 255, 0.18), rgba(67, 216, 201, 0.04)),
    rgba(12, 17, 24, 0.78);
}

.calendar-card span {
  color: var(--soft);
  font-weight: 800;
}

.calendar-card strong {
  color: #d7bdff;
}

.section-highlight {
  animation: section-pulse 900ms ease;
}

@keyframes section-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(179, 92, 255, 0);
  }

  35% {
    box-shadow: 0 0 0 3px rgba(179, 92, 255, 0.32), 0 20px 70px rgba(140, 66, 255, 0.16);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(179, 92, 255, 0);
  }
}

.cta-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
  max-width: 1240px;
  margin: 24px auto 0;
  padding: 28px 30px;
}

.cta-band p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.print-sheet {
  display: none;
}

.quote-modal {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.quote-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.quote-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.quote-form label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-weight: 750;
}

.modal-estimate {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(7, 11, 17, 0.68);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.thanks-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.thanks-card {
  width: min(680px, 100%);
  padding: 34px;
}

.thanks-card p {
  color: var(--muted);
  font-size: 1.05rem;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .sidebar {
    position: relative;
    min-height: 680px;
    gap: 24px;
    padding: 28px 28px 36px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-foot {
    display: none;
  }

  .hero-copy h2 {
    max-width: 560px;
    font-size: 3.9rem;
  }

  .hero-copy p {
    max-width: 420px;
  }

  .builder-grid {
    grid-template-columns: 1fr;
  }

  .estimate-card {
    position: static;
  }

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

@media (max-width: 760px) {
  .workspace {
    padding: 22px 14px 14px;
  }

  .topbar,
  .panel-heading,
  .cta-band,
  .modal-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .panel-heading,
  .modal-heading {
    display: flex;
  }

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

  .category-tab {
    min-height: 62px;
    font-size: 0.88rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .service-grid,
  .settings-grid,
  .form-grid,
  .cta-band {
    grid-template-columns: 1fr;
  }

  #builder,
  #settings,
  #estimate,
  #contact {
    scroll-margin-top: 150px;
  }

  .cta-actions,
  .top-actions,
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .ghost-btn,
  .as-link,
  .top-actions .icon-btn,
  .modal-heading .icon-btn {
    width: 100%;
  }

  .brand {
    font-size: 1.18rem;
  }

  .sidebar {
    min-height: 620px;
  }

  .hero-copy {
    margin-top: 12px;
    max-width: 100%;
  }

  .hero-copy h2 {
    font-size: 2.42rem;
    line-height: 1.16;
  }
}

@media (max-width: 460px) {
  .panel,
  .quote-form,
  .thanks-card,
  .cta-band {
    padding: 18px;
  }

  .service-card {
    min-height: 118px;
  }
}

@media print {
  @page {
    margin: 14mm;
  }

  * {
    color-adjust: exact;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #fff;
    color: #111827;
  }

  body.printing-estimate .app-shell,
  body.printing-estimate .quote-modal {
    display: none;
  }

  body.printing-estimate .print-sheet {
    display: grid;
    gap: 24px;
    color: #111827;
    font-family: Inter, Arial, sans-serif;
  }

  .print-sheet header,
  .print-grid,
  .print-sheet footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .print-sheet header {
    align-items: end;
    border-bottom: 2px solid #111827;
    padding-bottom: 18px;
  }

  .print-brand {
    letter-spacing: 0.42em;
    font-size: 28px;
    font-weight: 800;
  }

  .print-sheet p,
  .print-sheet h2 {
    margin: 0 0 8px;
  }

  .print-sheet strong {
    font-size: 34px;
  }

  .print-sheet h2 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .print-sheet dl {
    display: grid;
    gap: 8px;
    margin: 0;
  }

  .print-sheet dl div {
    display: grid;
    grid-template-columns: 1fr max-content;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 7px;
  }

  .print-sheet dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
  }

  .print-sheet ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
  }

  .print-sheet footer {
    margin-top: 10px;
    border-top: 1px solid #d1d5db;
    padding-top: 12px;
    font-size: 12px;
  }
}
