:root {
  --ink: #17211f;
  --muted: #71807b;
  --line: #d7cdbd;
  --surface: #fbf7ee;
  --surface-soft: #f1eadf;
  --teal: #2f8f82;
  --teal-dark: #175f57;
  --blue: #4d6d86;
  --copper: #c68647;
  --navy: #182320;
  --danger: #b42318;
  --panel: #f8f1e6;
  --panel-strong: #fffaf2;
  --dark-panel: #18231f;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #0f1715;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, #0f1715 0%, #17221f 48%, #2a211a 100%);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(255, 250, 242, 0.11);
  background: rgba(15, 23, 21, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 250, 242, 0.28);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #20342f, var(--teal-dark) 62%, var(--copper));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.brand-mark svg {
  width: 31px;
  height: 31px;
}

.brand-mark path,
.brand-mark circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
  letter-spacing: 0;
  color: #fffaf2;
}

.brand small {
  margin-top: 2px;
  color: #a9b8b3;
  font-size: 12px;
}

.admin-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(47, 143, 130, 0.32);
  border-radius: 8px;
  color: var(--teal-dark);
  background: rgba(255, 250, 242, 0.92);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(22, 38, 36, 0.05);
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.76fr) minmax(440px, 1.24fr);
  gap: clamp(24px, 3.2vw, 48px);
  width: min(1520px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 4vw, 58px) 0 58px;
}

.service-pane,
.workspace,
.result-pane,
.estimate-form,
.lead-form,
.admin-shell,
.login-box {
  min-width: 0;
}

.service-pane {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.intro-copy {
  padding-top: 6px;
  color: #fffaf2;
}

.eyebrow {
  margin: 0 0 8px;
  color: #e0a061;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.12;
  word-break: keep-all;
  overflow-wrap: normal;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

h1 span {
  display: inline;
}

.intro-text {
  max-width: 620px;
  margin: 16px 0 0;
  color: #c8d3cf;
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
}

.basis-copy {
  max-width: 100%;
  margin: 12px 0 0;
  padding-left: 12px;
  border-left: 3px solid rgba(224, 160, 97, 0.72);
  color: #d8e1dd;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.system-badge {
  display: inline-flex;
  width: fit-content;
  margin: 14px 0 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 8px;
  color: #f7ead8;
  background: rgba(255, 250, 242, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

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

.service-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  width: 100%;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  color: #f7f1e8;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.08) 0%, rgba(255, 250, 242, 0.04) 100%);
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.service-card:hover,
.service-card.is-active {
  border-color: rgba(224, 160, 97, 0.66);
  background: linear-gradient(180deg, #fffaf2 0%, #f4eadc 100%);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.service-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal-dark), var(--teal));
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(31, 118, 111, 0.22);
}

.service-card:nth-child(2) .service-icon {
  background: linear-gradient(145deg, #344b5b, var(--blue));
}

.service-card:nth-child(3) .service-icon {
  background: linear-gradient(145deg, var(--copper), #d49a66);
}

.service-card:nth-child(4) .service-icon {
  background: linear-gradient(145deg, var(--navy), #52655f);
}

.service-card:nth-child(5) .service-icon {
  background: linear-gradient(145deg, #7a5d2e, #c2a15f);
}

.service-card:nth-child(6) .service-icon {
  background: linear-gradient(145deg, #4f584d, #7e8b70);
}

.service-card:nth-child(7) .service-icon {
  background: linear-gradient(145deg, #2f5f70, #6d8d9a);
}

.service-card strong {
  align-self: end;
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-card span:last-child {
  color: #b9c7c2;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-card:hover span:last-child,
.service-card.is-active span:last-child {
  color: #66716f;
}

.signal-graphic {
  overflow: hidden;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  box-shadow: var(--shadow);
}

.signal-graphic svg {
  display: block;
  width: 100%;
  min-height: 148px;
  padding: 16px;
}

.signal-graphic rect {
  fill: #f5f8f7;
  stroke: #cbd8d4;
  stroke-width: 2;
}

.signal-graphic path {
  fill: none;
  stroke: #84918d;
  stroke-width: 4;
  stroke-linecap: round;
}

.signal-graphic .signal-line {
  stroke: url("#lineGradient");
}

.signal-graphic circle {
  fill: #fff;
  stroke: var(--teal);
  stroke-width: 4;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, 0.94fr);
  gap: 20px;
  align-items: start;
}

.estimate-form,
.result-pane > section,
.login-box,
.admin-panel,
.admin-warning {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 241, 230, 0.98);
  box-shadow: var(--shadow);
}

.estimate-form,
.result-pane > section,
.login-box,
.admin-panel {
  padding: clamp(18px, 3vw, 28px);
}

.result-pane {
  display: grid;
  gap: 16px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.field-group {
  min-width: 0;
  margin: 0 0 18px;
  padding: 15px;
  border: 1px solid rgba(215, 205, 189, 0.92);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf2 0%, #f3ecdf 100%);
}

.field-group legend {
  margin-bottom: 12px;
  color: var(--teal-dark);
  font-weight: 800;
}

.field-group summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--teal-dark);
  font-weight: 900;
}

.field-group summary > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.field-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-size: 18px;
  font-style: normal;
  line-height: 1;
}

.field-toggle::before {
  content: "+";
}

.field-group[open] summary {
  margin-bottom: 14px;
}

.field-group[open] .field-toggle::before {
  content: "-";
}

.field-group summary small {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.field-group[open] .field-grid {
  animation: panelDrop 0.22s ease;
}

@keyframes panelDrop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

label,
.check-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #30403c;
  font-size: 14px;
  font-weight: 700;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.field-note.is-compact {
  font-size: 10.5px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfc4b2;
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
  height: 44px;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #8b9794;
  background: #e8e1d6;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 111, 106, 0.16);
}

.check-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 700;
}

.check-chip input,
.check-line input,
.switch-line input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--teal);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal) 52%, #b77945);
  font-weight: 800;
  white-space: normal;
  box-shadow: 0 14px 26px rgba(23, 95, 87, 0.24);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.admin-actions .primary-button {
  width: auto;
  min-width: 140px;
}

.empty-state {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 10px;
}

.amount-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(215, 205, 189, 0.92);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf2 0%, var(--surface-soft) 100%);
}

.amount-grid .average {
  border-color: rgba(47, 143, 130, 0.46);
  background: #eaf4ef;
}

.amount-grid span,
.breakdown-item span,
.vendor-card span,
.vendor-card small,
.request-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.amount-grid strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.notice {
  margin: 14px 0 0;
  padding: 12px;
  border-left: 4px solid var(--copper);
  border-radius: 6px;
  color: #5e5148;
  background: #fff5e9;
  font-size: 13px;
  line-height: 1.65;
}

.breakdown-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.breakdown-item {
  display: grid;
  gap: 8px;
}

.breakdown-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.breakdown-item strong {
  white-space: nowrap;
}

.breakdown-item i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal), var(--copper));
}

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

.vendor-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 15px;
  border: 1px solid rgba(215, 205, 189, 0.92);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(180deg, #fffaf2 0%, #f5eddf 100%);
  text-align: left;
  box-shadow: 0 8px 18px rgba(22, 38, 36, 0.05);
}

.vendor-select {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.vendor-card-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.vendor-card-head img,
.vendor-card-head i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fffdf8;
  color: var(--teal-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.vendor-card-head b {
  display: inline-flex;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 7px;
  color: #7a461e;
  background: #fff3e7;
  font-size: 11px;
  font-weight: 900;
}

.vendor-pdf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(47, 143, 130, 0.24);
  border-radius: 8px;
  color: var(--teal-dark);
  background: #edf7f3;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.vendor-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 111, 106, 0.14);
}

.vendor-card em {
  color: #4d5b57;
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

.lead-form {
  display: grid;
  gap: 14px;
}

.referral-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff5e9;
}

.referral-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.referral-row .ghost-button {
  min-height: 44px;
  box-shadow: none;
}

.referral-message {
  margin: 0;
  color: #7a461e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.captcha-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.captcha-row label {
  grid-template-columns: auto 88px;
  align-items: center;
}

.captcha-row input {
  min-height: 38px;
}

.check-line,
.switch-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.switch-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  width: min(1520px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 34px;
  color: #b5c1bd;
  font-size: 12px;
  line-height: 1.7;
}

.footer-company,
.footer-meta,
.visit-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.footer-company strong {
  color: #e0a061;
}

.footer-company b {
  color: #fffaf2;
}

.footer-meta {
  justify-content: flex-end;
}

.visit-stats {
  padding: 5px 8px;
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  font-weight: 800;
}

.visit-stats b {
  color: #9fd8cf;
}

.footer-admin-link {
  color: #b5c1bd;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

.footer-legal {
  flex: 0 0 100%;
  margin: -6px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 250, 242, 0.12);
  color: #99a7a2;
  font-size: 11px;
  line-height: 1.65;
}

.submit-message {
  min-height: 22px;
  margin: 0;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.submit-message.error {
  color: var(--danger);
}

.empty-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.admin-body {
  background:
    linear-gradient(135deg, #0f1715 0%, #17221f 52%, #2a211a 100%);
}

.admin-login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  padding: 28px;
}

.login-box {
  width: min(460px, 100%);
  display: grid;
  gap: 18px;
}

.login-box h1,
.admin-topline h1 {
  margin: 0;
  font-size: 28px;
}

.admin-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.admin-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #8a4b23;
  background: #fff8f2;
  font-weight: 800;
  line-height: 1.55;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tabs button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #384743;
  background: #fffaf2;
  font-weight: 800;
}

.admin-tabs button.is-active {
  border-color: var(--teal);
  color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(47, 111, 106, 0.12);
}

.admin-panel {
  display: none;
  margin-bottom: 16px;
}

.admin-panel.is-active {
  display: block;
}

.vendor-editor,
.price-editor,
.request-list,
.referral-editor,
.vendor-billing-panel {
  display: grid;
  gap: 14px;
}

.section-heading.compact {
  gap: 2px;
}

.section-heading.compact h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

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

.stats-panel div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.stats-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stats-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.vendor-edit,
.request-card,
.price-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.vendor-edit {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.vendor-edit-head,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(47, 111, 106, 0.24);
  border-radius: 8px;
  color: var(--teal-dark);
  background: rgba(47, 111, 106, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.specialty-picker {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.specialty-picker > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.specialty-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.specialty-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.specialty-chip.is-selected {
  border-color: var(--teal);
  color: #fffaf2;
  background: var(--teal);
}

.remove-vendor {
  width: fit-content;
}

.price-group {
  margin: 0;
  padding: 16px;
}

.price-group legend {
  padding: 0 6px;
  color: var(--teal-dark);
  font-weight: 900;
}

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

.request-card {
  overflow: hidden;
}

.request-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
}

.request-card summary b {
  display: block;
  text-align: right;
}

.request-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.request-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 16px;
}

.vendor-billing-controls {
  display: flex;
  justify-content: flex-end;
}

.vendor-billing-controls label {
  min-width: 180px;
}

.billing-settings-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

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

.billing-settings-grid fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.billing-settings-grid legend {
  padding: 0 5px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.billing-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.billing-summary div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.billing-summary span,
.billing-table small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.billing-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.billing-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
}

.settlement-attachment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.settlement-attachment-card span,
.settlement-attachment-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settlement-attachment-card strong {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.attachment-upload-button {
  flex: 0 0 auto;
}

.billing-send-button {
  min-height: 34px;
  padding: 0 10px;
  box-shadow: none;
  white-space: normal;
}

.ghost-button:disabled,
.billing-send-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.billing-table th,
.billing-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.billing-table th {
  color: var(--teal-dark);
  background: rgba(47, 111, 106, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.billing-table tr:last-child td {
  border-bottom: 0;
}

.billing-table input {
  width: 130px;
}

.billing-details summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 900;
}

.billing-detail-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.billing-detail-list li {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.request-delete {
  color: var(--danger);
  border-color: #f5c2bd;
}

.request-detail h3 {
  margin: 14px 0 10px;
  font-size: 16px;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: grid;
  gap: 2px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .app-layout,
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
  }

  .app-layout,
  .admin-shell {
    width: calc(100% - 28px);
    max-width: 720px;
  }

  .field-grid,
  .field-grid.two,
  .amount-grid,
  .price-grid,
  .billing-settings-grid,
  .request-detail,
  .stats-panel,
  .billing-summary {
    grid-template-columns: 1fr;
  }

  .amount-grid strong {
    font-size: 18px;
  }

  .admin-topline,
  .vendor-edit-head,
  .settlement-attachment-card,
  .admin-actions,
  .site-footer,
  .request-card summary {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-meta {
    justify-content: flex-start;
  }

  .request-card summary b {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .app-layout,
  .admin-shell {
    width: calc(100vw - 48px);
    max-width: calc(100vw - 48px);
  }

  .estimate-form,
  .result-pane > section,
  .login-box,
  .admin-panel {
    padding: 16px;
  }

  .field-group {
    padding: 12px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.22;
  }

  .intro-copy h1 span {
    display: block;
  }

  .intro-text {
    font-size: 15px;
    line-height: 1.65;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-login {
    padding: 28px 14px;
    place-items: start center;
  }

  .admin-login .login-box {
    width: min(320px, 100%);
    max-width: 100%;
    padding: 18px;
  }

  .login-box h1,
  .admin-topline h1 {
    font-size: 24px;
    line-height: 1.25;
    word-break: keep-all;
  }

  .admin-link,
  .ghost-button {
    width: 100%;
  }

  .vendor-card-head {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .vendor-card-head b {
    grid-column: 2;
  }

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

  .service-card {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 54px;
    padding: 9px;
    gap: 1px 8px;
  }

  .service-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .service-card strong {
    font-size: 13px;
  }

  .service-card span:last-child {
    font-size: 11px;
  }

  .field-group summary {
    gap: 8px;
  }

  .field-group summary small {
    display: none;
  }

  .captcha-row label {
    grid-template-columns: 1fr;
  }
}
