* {
  box-sizing: border-box;
}

:root {
  --body-bg: #f3f5f7;
  --card-bg: #ffffff;
  --text-main: #1f2933;
  --text-strong: #111827;
  --text-muted: #64748b;
  --text-soft: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --header-bg: #111827;
  --header-text: #ffffff;
  --header-muted: #cbd5e1;
  --input-bg: #ffffff;
  --input-text: #111827;
  --button-sub-bg: #e2e8f0;
  --button-sub-text: #1f2933;
  --blue: #2563eb;
  --ad-bg: #f8fafc;
  --box-bg: #f8fafc;
  --formula-bg: #eef2ff;
  --formula-text: #1e3a8a;
  --shadow: rgba(15, 23, 42, 0.05);
  --menu-shadow: rgba(15, 23, 42, 0.16);
  --warning-bg: #fff1f2;
  --warning-border: #fecaca;
  --warning-text: #be123c;
  --safe-bg: #f0fdf4;
  --safe-border: #bbf7d0;
  --safe-text: #15803d;
  --recommend-bg: #eff6ff;
  --recommend-border: #bfdbfe;
  --recommend-text: #1d4ed8;
}

body.dark-mode {
  --body-bg: #0f172a;
  --card-bg: #111827;
  --text-main: #e5e7eb;
  --text-strong: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --border: #334155;
  --border-strong: #475569;
  --header-bg: #020617;
  --header-text: #f8fafc;
  --header-muted: #94a3b8;
  --input-bg: #020617;
  --input-text: #f8fafc;
  --button-sub-bg: #334155;
  --button-sub-text: #f8fafc;
  --ad-bg: #0f172a;
  --box-bg: #1e293b;
  --formula-bg: #172554;
  --formula-text: #dbeafe;
  --shadow: rgba(0, 0, 0, 0.22);
  --menu-shadow: rgba(0, 0, 0, 0.45);
  --warning-bg: #3f121a;
  --warning-border: #7f1d1d;
  --warning-text: #fecaca;
  --safe-bg: #052e16;
  --safe-border: #166534;
  --safe-text: #bbf7d0;
  --recommend-bg: #172554;
  --recommend-border: #1d4ed8;
  --recommend-text: #dbeafe;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}
html.steel-force-instant-scroll {
  scroll-behavior: auto !important;
}


html.modal-locked {
  overflow: hidden;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--body-bg);
  color: var(--text-main);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
  user-select: none;
  -webkit-user-select: none;
}

body.modal-locked {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  right: 0;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

a {
  color: inherit;
}

.container {
  width: min(100%, 1080px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 14px;
  padding-right: 14px;
}

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 28px 0 24px;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.site-label {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--header-muted);
}

h1 {
  margin: 0;
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.04em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.lead {
  margin: 12px 0 0;
  font-size: 16px;
  color: var(--header-muted);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.theme-toggle {
  display: flex;
  justify-content: flex-start;
}

.theme-toggle button {
  width: 42px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--header-text);
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
}

.theme-toggle button.active {
  background: #ffffff;
  color: #111827;
}

.theme-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sun-icon {
  display: none;
}

body.dark-mode .moon-icon {
  display: none;
}

body.dark-mode .sun-icon {
  display: block;
}

.page-layout {
  padding-top: 18px;
  padding-bottom: 40px;
}

.main-content {
  width: min(100%, 860px);
  margin-left: auto;
  margin-right: auto;
}

.notice-box,
.calculator-card,
.result-section,
.history-section,
.content-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px var(--shadow);
}

.notice-box {
  margin-bottom: 16px;
}

.notice-box p {
  margin: 6px 0 0;
  color: var(--text-soft);
}

.disclaimer-section {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.disclaimer-section h2 {
  color: var(--warning-text);
}

.ad-placeholder {
  margin: 18px 0;
  min-height: 90px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--ad-bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  font-size: 14px;
}

.calculator-card h2,
.result-section h2,
.history-section h2,
.content-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.material-section h3,
.extra-material-section h3 {
  margin: 0;
  font-size: 18px;
}

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

label {
  display: block;
}

label > span:not(.label-line) {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-soft);
}

.label-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 6px;
}

.label-main {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-soft);
}

.inline-help {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  background: var(--input-bg);
  color: var(--input-text);
  word-break: normal;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

.combo-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
}

.combo-field input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.combo-toggle {
  min-height: 50px;
  border-radius: 0 12px 12px 0;
  border: 1px solid var(--border-strong);
  border-left: 0;
  background: var(--box-bg);
  color: var(--text-soft);
  font-size: 14px;
  padding: 0;
}

.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 14px 32px var(--menu-shadow);
  padding: 6px;
}

.combo-field.open .combo-menu {
  display: grid;
  gap: 4px;
}

.combo-menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
}

.combo-menu-item.no-favorite {
  grid-template-columns: 1fr;
}

.combo-option-button {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-main);
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  padding: 0 10px;
}

.combo-option-button:hover,
.combo-option-button:focus {
  background: var(--recommend-bg);
  color: var(--recommend-text);
}

.favorite-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--border-strong);
  font-size: 21px;
  line-height: 1;
}

.favorite-button.active {
  color: #f59e0b;
}

.favorite-button:hover,
.favorite-button:focus {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.material-section,
.extra-material-section {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.material-items,
.extra-rows,
.material-length-rows {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.material-item,
.extra-row,
.material-length-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--box-bg);
}

.material-item-header,
.extra-row-header,
.material-length-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.material-item-actions,
.material-length-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.material-item-title,
.extra-row-title,
.material-length-row-title {
  font-weight: 900;
  color: var(--text-soft);
}

.material-grid,
.extra-row-grid,
.material-length-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.remove-row-button,
.remove-extra-button,
.remove-material-button {
  min-height: 36px;
  padding: 0 10px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 13px;
}

.reset-material-button,
.reset-length-inputs-button,
.clear-length-rows-button,
.small-action-button {
  min-height: 36px;
  padding: 0 10px;
  background: var(--button-sub-bg);
  color: var(--button-sub-text);
  font-size: 13px;
}

.dark-mode .remove-row-button,
.dark-mode .remove-extra-button,
.dark-mode .remove-material-button {
  background: #7f1d1d;
  color: #fee2e2;
}

.extra-summary {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--recommend-border);
  background: var(--recommend-bg);
  color: var(--recommend-text);
  font-weight: 800;
}

.extra-summary p {
  margin: 4px 0;
}

.section-button-row,
.result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 12px;
  min-height: 52px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: normal;
  line-height: 1.25;
}

.primary-button {
  background: var(--blue);
  color: #ffffff;
}

.secondary-button {
  background: var(--button-sub-bg);
  color: var(--button-sub-text);
}

.hidden {
  display: none !important;
}

/* 면책 동의가 이미 끝난 세션에서는 페이지 이동 시 팝업이 순간적으로 보이지 않도록 선차단합니다. */
html.agreement-preaccepted .agreement-modal {
  display: none !important;
}

html.agreement-preaccepted.modal-locked {
  overflow: auto;
}

html.agreement-preaccepted body.modal-locked {
  position: static;
  overflow: auto;
  width: auto;
  height: auto;
}

.result-section {
  margin-top: 18px;
}

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

.result-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--box-bg);
  padding: 16px;
}

.result-card strong {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
}

.result-card span {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  white-space: pre-line;
}

.result-card.warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.result-card.safe {
  border-color: var(--safe-border);
  background: var(--safe-bg);
}

.result-card.recommend {
  border-color: var(--recommend-border);
  background: var(--recommend-bg);
}

.result-card.warning span {
  color: var(--warning-text);
}

.result-card.safe span {
  color: var(--safe-text);
}

.result-card.recommend span {
  color: var(--recommend-text);
}

.table-summary {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.table-summary table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-summary th,
.table-summary td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.table-summary th:first-child,
.table-summary td:first-child {
  text-align: left;
}

.table-summary tr:last-child td,
.table-summary tr:last-child th {
  border-bottom: 0;
}

.table-summary tfoot th {
  background: var(--recommend-bg);
  color: var(--recommend-text);
  font-weight: 900;
  text-align: right;
}

.table-summary tfoot th:first-child {
  text-align: left;
}

.message {
  margin: 12px 0 0;
  color: var(--blue);
  font-weight: 700;
}

.history-section {
  margin-top: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.history-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.history-item {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--box-bg);
  border-radius: 12px;
  padding: 12px;
}

.history-item strong {
  display: block;
  font-size: 15px;
}

.history-item p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

.history-item.pinned {
  border-color: var(--recommend-border);
  background: var(--recommend-bg);
}

.history-item.protected {
  box-shadow: inset 0 0 0 1px var(--safe-border);
}

.history-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.history-item-title {
  min-width: 0;
}

.history-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.history-action-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  background: var(--button-sub-bg);
  color: var(--button-sub-text);
  font-size: 15px;
  line-height: 1;
}

.history-action-button.active {
  background: var(--blue);
  color: #ffffff;
}

.history-pin-icon,
.history-shield-icon {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-action-button.protect-action {
  border: 1px solid #03c75a;
  background: var(--button-sub-bg);
  color: #03c75a;
}

.history-action-button.protect-action.active {
  border-color: #03c75a;
  background: #03c75a;
  color: #ffffff;
}

.dark-mode .history-action-button.protect-action {
  border-color: #03c75a;
  background: var(--button-sub-bg);
  color: #03c75a;
}

.dark-mode .history-action-button.protect-action.active {
  border-color: #03c75a;
  background: #03c75a;
  color: #ffffff;
}


.history-pin-icon {
  stroke-width: 2;
}

.history-action-button.protect-action.active .history-shield-icon {
  stroke: #ffffff;
}

.history-action-button.danger {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 22px;
}

.history-action-button.danger.delete-locked {
  cursor: not-allowed;
  opacity: 0.55;
}

.dark-mode .history-action-button.danger {
  background: #7f1d1d;
  color: #fee2e2;
}

.history-weight-line {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.history-weight-recommendation {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
}

.history-weight-recommendation .history-recommendation-value {
  text-align: left;
}

.history-summary-table {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  overflow-x: visible;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.history-summary-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.history-summary-table th,
.history-summary-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.history-summary-table th:nth-child(1),
.history-summary-table td:nth-child(1) {
  width: 12%;
}

.history-summary-table th:nth-child(2),
.history-summary-table td:nth-child(2) {
  width: 17%;
}

.history-summary-table th:nth-child(3),
.history-summary-table td:nth-child(3),
.history-summary-table th:nth-child(4),
.history-summary-table td:nth-child(4) {
  width: 9%;
}

.history-summary-table th:nth-child(5),
.history-summary-table td:nth-child(5),
.history-summary-table th:nth-child(6),
.history-summary-table td:nth-child(6),
.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  width: 12%;
}

.history-summary-table th:nth-child(8),
.history-summary-table td:nth-child(8) {
  width: 17%;
}

.history-summary-table .history-recommendation-cell {
  vertical-align: middle;
  font-weight: 800;
}

.history-recommendation-value {
  display: inline-grid;
  gap: 2px;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  text-align: center;
}

.history-recommendation-value span {
  display: block;
}

.history-summary-table th {
  background: var(--card-bg);
  color: var(--text-soft);
  font-weight: 900;
}

.history-summary-table th:first-child,
.history-summary-table td:first-child,
.history-summary-table th:nth-child(2),
.history-summary-table td:nth-child(2) {
  text-align: left;
}

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

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.history-page-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--button-sub-bg);
  color: var(--button-sub-text);
  font-size: 18px;
}

.history-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.history-page-status {
  min-width: 70px;
  text-align: center;
  font-weight: 900;
  color: var(--text-soft);
}

.empty-text {
  color: var(--text-muted);
}

.content-section {
  margin-top: 18px;
}

.content-section p {
  margin: 0 0 10px;
}

.content-section ul {
  margin: 0;
  padding-left: 20px;
}

.formula-box {
  margin: 12px 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--formula-bg);
  color: var(--formula-text);
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  padding: 22px 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.footer-links a {
  text-decoration: none;
}

.scroll-control {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 180;
  display: grid;
  gap: 8px;
  pointer-events: auto;
}

.scroll-control button {
  min-height: 42px;
  min-width: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: 0 8px 20px var(--shadow);
  padding: 0;
  font-size: 18px;
  line-height: 1;
  pointer-events: auto;
}

.agreement-modal,
.notice-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.72);
  overscroll-behavior: contain;
}

.agreement-modal {
  z-index: 500;
}

.notice-modal {
  z-index: 400;
  touch-action: none;
}

.agreement-modal-box {
  width: min(100%, 840px);
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}

.notice-modal-box {
  width: min(100%, 420px);
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}

.agreement-modal-box h2,
.notice-modal-box h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.agreement-modal-content {
  margin-bottom: 20px;
  display: grid;
  gap: 10px;
}

.agreement-modal-content p,
.notice-modal-box p {
  margin: 0;
  color: var(--text-soft);
}

.agreement-modal-box button,
.notice-modal-box button {
  width: 100%;
}

.agreement-modal-action {
  background: var(--card-bg);
}

/* 결과 복사 버튼 순서 강제 고정 */
#copyExcelBtn {
  order: 1;
}

#copyTextBtn {
  order: 2;
}

#resetAllResultBtn {
  order: 3;
}


.section-button-row .primary-button:first-child:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .history-section,
  .history-list,
  .history-item {
    min-width: 0;
    max-width: 100%;
  }

  .history-summary-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .history-summary-table table {
    width: max-content;
    min-width: 820px;
    table-layout: auto;
    font-size: 12px;
  }

  .history-summary-table th,
  .history-summary-table td {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }

  .history-summary-table .history-recommendation-cell,
  .history-summary-table .history-recommendation-value {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
  }
}

@media (max-width: 480px) {
  .combo-menu {
    max-height: 230px;
  }

  .combo-option-button,
  .favorite-button {
    min-height: 46px;
  }

  .material-item-header,
  .section-title-row {
    align-items: flex-start;
  }

  .section-title-row {
    flex-wrap: wrap;
  }

  .material-length-actions,
  .material-item-actions {
    justify-content: flex-start;
  }

  .table-summary {
    overflow-x: auto;
  }

  .table-summary table {
    min-width: 920px;
  }

  .scroll-control {
    right: 10px;
    bottom: 10px;
    z-index: 180;
  }

  .scroll-control button {
    min-width: 40px;
    min-height: 40px;
    font-size: 16px;
  }

  .agreement-modal {
    padding: 12px;
    align-items: center;
    overflow: hidden;
    touch-action: none;
  }

  .agreement-modal-box {
    width: min(100%, 390px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: auto;
  }

  .agreement-modal-box h2 {
    flex: 0 0 auto;
    font-size: 20px;
    margin-bottom: 10px;
  }

  .agreement-modal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    padding-right: 6px;
    margin-bottom: 0;
    padding-bottom: 14px;
    font-size: 14px;
    gap: 8px;
  }

  .agreement-modal-action {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
  }

  .agreement-modal-action button {
    width: 100%;
    min-height: 52px;
  }

  .notice-modal-box {
    width: min(100%, 380px);
    padding: 18px;
  }
}

@media (min-width: 768px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .theme-toggle {
    justify-content: flex-end;
  }

  .form-grid,
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .material-length-row-grid {
    grid-template-columns: 1fr 1fr;
  }

  .extra-row-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .section-button-row {
    grid-template-columns: 2fr 1fr;
  }

  .result-actions {
    grid-template-columns: 1.5fr 1.5fr 1fr;
  }
}

/* ===== 확장형 현장 도구 사이트 공통 스타일 ===== */
.site-brand-link {
  color: inherit;
  text-decoration: none;
}

.site-nav {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: visible;
  padding-bottom: 4px;
}

.site-nav a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: var(--header-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
}

.site-nav a.active,
.site-nav a:hover,
.site-nav a:focus {
  background: #ffffff;
  color: #111827;
}

.page-kicker {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 14px;
}

.page-title-section {
  margin-bottom: 16px;
}

.page-title-section h2 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.24;
  letter-spacing: -0.04em;
}

.page-title-section p {
  margin: 0;
  color: var(--text-soft);
}

.guide-card-grid,
.tool-card-grid,
.article-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.link-card,
.tool-card,
.article-card,
.check-card,
.contact-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  background: var(--box-bg);
  color: var(--text-main);
  text-decoration: none;
}

.link-card:hover,
.link-card:focus,
.tool-card:hover,
.tool-card:focus,
.article-card:hover,
.article-card:focus {
  border-color: var(--recommend-border);
  background: var(--recommend-bg);
  color: var(--recommend-text);
}

.link-card strong,
.tool-card strong,
.article-card strong,
.check-card strong,
.contact-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-strong);
  font-size: 16px;
}

.link-card span,
.tool-card span,
.article-card span,
.check-card span,
.contact-card span {
  display: block;
  color: var(--text-soft);
  font-size: 14px;
}

.link-card:hover strong,
.link-card:hover span,
.link-card:focus strong,
.link-card:focus span,
.tool-card:hover strong,
.tool-card:hover span,
.tool-card:focus strong,
.tool-card:focus span,
.article-card:hover strong,
.article-card:hover span,
.article-card:focus strong,
.article-card:focus span {
  color: inherit;
}

.content-section h3 {
  margin: 18px 0 8px;
  font-size: 18px;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.content-section h3:first-child {
  margin-top: 0;
}

.content-section ol {
  margin: 0;
  padding-left: 22px;
}

.content-section li + li {
  margin-top: 6px;
}


.anchor-offset > .page-kicker {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 5px solid var(--blue);
  color: var(--text-strong);
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.25;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.anchor-offset > h2 {
  margin-top: 0;
  font-size: clamp(16px, 3.4vw, 19px);
  line-height: 1.45;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-soft);
}

.guide-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.guide-nav a {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #ffffff;
  text-decoration: none;
  font-weight: 900;
  text-align: center;
}

.guide-nav a.primary-link {
  background: var(--blue);
  color: #ffffff;
}

.guide-nav a:hover,
.guide-nav a:focus {
  filter: brightness(0.96);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

.info-table th,
.info-table td {
  border: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
}

.info-table th {
  background: var(--box-bg);
  color: var(--text-strong);
  text-align: left;
  white-space: nowrap;
}

.callout-box {
  margin: 12px 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--recommend-border);
  background: var(--recommend-bg);
  color: var(--recommend-text);
}

.callout-box strong {
  display: block;
  margin-bottom: 4px;
}

.warning-callout {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.check-card ul,
.contact-card ul {
  margin-top: 8px;
}

.anchor-offset {
  scroll-margin-top: 16px;
}

.policy-date {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px !important;
}

@media (max-width: 480px) {
  .site-header {
    padding: 22px 0 18px;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-left: 0;
    margin-right: 0;
    overflow: visible;
  }

  .site-nav a {
    width: 100%;
    min-height: 38px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }

  .notice-box,
  .calculator-card,
  .result-section,
  .history-section,
  .content-section {
    padding: 16px;
  }

  .history-item-header {
    flex-direction: column;
  }

  .history-item-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 768px) {
  .guide-card-grid,
  .tool-card-grid,
  .article-card-grid,
  .checklist-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .guide-nav {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== 현장 안내 허브 페이지 보강 ===== */
.hub-section {
  position: relative;
}

.hub-section::before,
.planned-guide-section::before {
  content: "";
  display: block;
  height: 1px;
  margin-top: -1px;
}

.guide-nav-wide a {
  min-height: 50px;
}

.planned-tool-grid .tool-card {
  min-height: 132px;
}

.planned-guide-section {
  border-style: dashed;
}

.planned-guide-section > .page-kicker {
  color: var(--text-muted);
  border-left-color: var(--border-strong);
}

.planned-guide-section > h2 {
  color: var(--text-strong);
}

.hub-section .info-table,
.planned-guide-section p {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .planned-tool-grid .tool-card {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .history-summary-table {
    touch-action: pan-x;
    overscroll-behavior-x: contain;
  }

  .history-summary-table .history-recommendation-cell {
    min-width: 96px;
    white-space: normal;
  }

  .history-recommendation-value {
    width: max-content;
    min-width: 72px;
  }
}

/* v20: 계산 결과/최근 계산 표의 초과율 헤더 줄바꿈 방지 */
.table-summary th:nth-child(7),
.history-summary-table th:nth-child(7) {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

/* v20: 최근 계산 요약 문구 크기 조정 */
.history-weight-line {
  font-size: 13px;
  line-height: 1.35;
}

/* v21: 최근 계산 표에서 중량과 초과율 반영 값을 더 명확히 구분 */
.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  padding-left: 14px;
}

/* v21: 계산 결과 하단 표도 최근 계산 표와 동일한 내용값을 담되 기존 표 스타일 유지 */
.table-summary th:nth-child(7),
.table-summary td:nth-child(7) {
  padding-left: 14px;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8) {
  min-width: 130px;
  vertical-align: middle;
}

.table-summary .result-recommendation-cell {
  font-weight: 900;
  color: var(--recommend-text);
  vertical-align: middle;
  text-align: center;
}

.table-summary .history-recommendation-value {
  display: inline-grid;
  gap: 2px;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  text-align: center;
}

@media (max-width: 768px) {
  .history-summary-table th:nth-child(7),
  .history-summary-table td:nth-child(7),
  .table-summary th:nth-child(7),
  .table-summary td:nth-child(7) {
    padding-left: 12px;
  }

  .table-summary th:nth-child(8),
  .table-summary td:nth-child(8) {
    min-width: 120px;
  }
}

/* v22: 계산 결과 표와 최근 계산 표 정렬 보정 */
.table-summary table {
  table-layout: fixed;
}

.table-summary th,
.table-summary td {
  vertical-align: middle;
  line-height: 1.45;
}

.table-summary th:nth-child(1),
.table-summary td:nth-child(1) {
  width: 9%;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  text-align: left;
}

.table-summary th:nth-child(2),
.table-summary td:nth-child(2) {
  width: 17%;
}

.table-summary th:nth-child(3),
.table-summary td:nth-child(3),
.table-summary th:nth-child(4),
.table-summary td:nth-child(4) {
  width: 8%;
  text-align: center;
}

.table-summary th:nth-child(5),
.table-summary td:nth-child(5) {
  width: 10%;
  text-align: center;
}

.table-summary th:nth-child(6),
.table-summary td:nth-child(6) {
  width: 12%;
  text-align: center;
  padding-right: 14px;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7) {
  width: 15%;
  text-align: center;
  padding-left: 20px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8) {
  width: 21%;
  text-align: center;
  padding-left: 12px;
}

.table-summary .result-recommendation-cell,
.table-summary tfoot th:nth-child(8) {
  text-align: center;
  vertical-align: middle;
}

.history-summary-table th:nth-child(6),
.history-summary-table td:nth-child(6) {
  padding-right: 12px;
}

.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.history-summary-table th:nth-child(8),
.history-summary-table td:nth-child(8),
.history-summary-table .history-recommendation-cell {
  text-align: center;
  vertical-align: middle;
}

.history-summary-table th:nth-child(1),
.history-summary-table td:nth-child(1) {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

@media (max-width: 768px) {
  .table-summary table {
    min-width: 820px;
    table-layout: fixed;
  }

  .table-summary {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* v23: 계산 결과 표 추천 톤수 칸 확장 및 구분선 위치 조정 */
.table-summary th:nth-child(1),
.table-summary td:nth-child(1) {
  width: 8%;
}

.table-summary th:nth-child(2),
.table-summary td:nth-child(2) {
  width: 14%;
}

.table-summary th:nth-child(3),
.table-summary td:nth-child(3),
.table-summary th:nth-child(4),
.table-summary td:nth-child(4) {
  width: 7%;
}

.table-summary th:nth-child(5),
.table-summary td:nth-child(5) {
  width: 9%;
}

.table-summary th:nth-child(6),
.table-summary td:nth-child(6) {
  width: 10%;
  padding-right: 10px;
  border-left: 0 !important;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7) {
  width: 13%;
  padding-left: 10px;
  border-left: 0 !important;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8) {
  width: 32%;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.table-summary .result-recommendation-cell,
.table-summary tfoot th:last-child {
  text-align: center;
  vertical-align: middle;
}

.result-recommendation-one-line {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  font-size: 13px;
  line-height: 1.25;
}

/* v23: 모든 표에서 중량/초과율 반영 사이의 세로선 제거, 초과율/추천 톤수 사이에만 세로선 표시 */
.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  border-left: 0 !important;
  padding-left: 10px;
}

.history-summary-table th:nth-child(8),
.history-summary-table td:nth-child(8),
.history-summary-table .history-recommendation-cell {
  border-left: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .table-summary th:nth-child(8),
  .table-summary td:nth-child(8) {
    min-width: 260px;
  }

  .result-recommendation-one-line {
    font-size: 12px;
  }
}

/* v24: 표 정렬/폭 재조정 */
.table-summary table,
.history-summary-table table {
  table-layout: fixed;
}

/* 계산 결과 표: 최근 계산 표와 동일한 정렬 기준 적용 */
.table-summary th:nth-child(1),
.table-summary td:nth-child(1),
.history-summary-table th:nth-child(1),
.history-summary-table td:nth-child(1) {
  width: 9% !important;
  text-align: left !important;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.table-summary th:nth-child(2),
.table-summary td:nth-child(2),
.history-summary-table th:nth-child(2),
.history-summary-table td:nth-child(2) {
  width: 13% !important;
  text-align: left !important;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.table-summary th:nth-child(3),
.table-summary td:nth-child(3),
.table-summary th:nth-child(4),
.table-summary td:nth-child(4),
.table-summary th:nth-child(5),
.table-summary td:nth-child(5),
.table-summary th:nth-child(6),
.table-summary td:nth-child(6),
.table-summary th:nth-child(7),
.table-summary td:nth-child(7),
.history-summary-table th:nth-child(3),
.history-summary-table td:nth-child(3),
.history-summary-table th:nth-child(4),
.history-summary-table td:nth-child(4),
.history-summary-table th:nth-child(5),
.history-summary-table td:nth-child(5),
.history-summary-table th:nth-child(6),
.history-summary-table td:nth-child(6),
.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  width: 11% !important;
  text-align: center !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  border-left: 0 !important;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8),
.history-summary-table th:nth-child(8),
.history-summary-table td:nth-child(8),
.table-summary .result-recommendation-cell,
.history-summary-table .history-recommendation-cell {
  width: 23% !important;
  text-align: center !important;
  vertical-align: middle !important;
  border-left: 1px solid var(--border) !important;
  padding-left: 12px !important;
  padding-right: 10px !important;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7),
.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  padding-right: 14px !important;
}

.table-summary th:nth-child(8),
.history-summary-table th:nth-child(8) {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.result-recommendation-one-line {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  font-size: 11px;
  line-height: 1.25;
}

.history-summary-table .history-recommendation-cell,
.history-summary-table .history-recommendation-cell .history-recommendation-value {
  text-align: center !important;
  justify-content: center;
  justify-items: center;
}

@media (max-width: 768px) {
  .table-summary,
  .history-summary-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-summary table,
  .history-summary-table table {
    min-width: 860px;
  }

  .result-recommendation-one-line {
    font-size: 11px;
  }
}

/* 계산 결과 상단 추천 차량 톤수 카드는 2칸 폭으로 표시 */
.recommendation-result-card {
  grid-column: 1 / -1;
}

.recommendation-result-card span {
  white-space: nowrap;
  font-size: clamp(18px, 2.6vw, 24px);
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: keep-all;
}

@media (max-width: 480px) {
  .recommendation-result-card span {
    white-space: normal;
    font-size: 22px;
  }
}


/* v26: 계산 결과/최근 계산 표 추천 톤수 줄바꿈 및 폭 재조정 */
.table-summary th,
.table-summary td,
.history-summary-table th,
.history-summary-table td {
  vertical-align: middle !important;
}

.table-summary th:nth-child(1),
.table-summary td:nth-child(1),
.history-summary-table th:nth-child(1),
.history-summary-table td:nth-child(1) {
  width: 10% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.table-summary th:nth-child(2),
.table-summary td:nth-child(2),
.history-summary-table th:nth-child(2),
.history-summary-table td:nth-child(2) {
  width: 20% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: left !important;
}

.table-summary th:nth-child(3),
.table-summary td:nth-child(3),
.history-summary-table th:nth-child(3),
.history-summary-table td:nth-child(3),
.table-summary th:nth-child(4),
.table-summary td:nth-child(4),
.history-summary-table th:nth-child(4),
.history-summary-table td:nth-child(4) {
  width: 8% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: center !important;
}

.table-summary th:nth-child(5),
.table-summary td:nth-child(5),
.history-summary-table th:nth-child(5),
.history-summary-table td:nth-child(5) {
  width: 10% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: center !important;
}

.table-summary th:nth-child(6),
.table-summary td:nth-child(6),
.history-summary-table th:nth-child(6),
.history-summary-table td:nth-child(6) {
  width: 11% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: center !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  border-left: 0 !important;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7),
.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  width: 13% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: center !important;
  padding-left: 8px !important;
  padding-right: 14px !important;
  border-left: 0 !important;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8),
.history-summary-table th:nth-child(8),
.history-summary-table td:nth-child(8),
.table-summary .result-recommendation-cell,
.history-summary-table .history-recommendation-cell {
  width: 20% !important;
  text-align: center !important;
  vertical-align: middle !important;
  border-left: 1px solid var(--border) !important;
  padding-left: 10px !important;
  padding-right: 8px !important;
}

.result-recommendation-value,
.history-recommendation-value {
  display: inline-grid !important;
  gap: 2px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: center !important;
  justify-content: center !important;
  justify-items: center !important;
}

.result-recommendation-value span,
.history-recommendation-value span {
  display: block !important;
  white-space: nowrap !important;
}

.result-recommendation-one-line {
  white-space: nowrap !important;
}

@media (max-width: 768px) {
  .table-summary table,
  .history-summary-table table {
    min-width: 900px !important;
  }
}

/* v27: 계산 결과/최근 계산 표 폭 재조정 및 합계 수량 줄바꿈 */
.summary-total-quantity {
  display: inline-grid;
  gap: 2px;
  line-height: 1.25;
  white-space: nowrap;
  word-break: keep-all;
  justify-content: center;
  justify-items: center;
}

.summary-total-quantity span {
  display: block;
  white-space: nowrap;
}

.table-summary th:nth-child(1),
.table-summary td:nth-child(1),
.history-summary-table th:nth-child(1),
.history-summary-table td:nth-child(1) {
  width: 9% !important;
}

.table-summary th:nth-child(2),
.table-summary td:nth-child(2),
.history-summary-table th:nth-child(2),
.history-summary-table td:nth-child(2) {
  width: 18% !important;
}

.table-summary th:nth-child(3),
.table-summary td:nth-child(3),
.history-summary-table th:nth-child(3),
.history-summary-table td:nth-child(3),
.table-summary th:nth-child(4),
.table-summary td:nth-child(4),
.history-summary-table th:nth-child(4),
.history-summary-table td:nth-child(4) {
  width: 8% !important;
}

.table-summary th:nth-child(5),
.table-summary td:nth-child(5),
.history-summary-table th:nth-child(5),
.history-summary-table td:nth-child(5) {
  width: 10% !important;
}

.table-summary th:nth-child(6),
.table-summary td:nth-child(6),
.history-summary-table th:nth-child(6),
.history-summary-table td:nth-child(6) {
  width: 13% !important;
  padding-left: 8px !important;
  padding-right: 10px !important;
  border-left: 0 !important;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7),
.history-summary-table th:nth-child(7),
.history-summary-table td:nth-child(7) {
  width: 18% !important;
  padding-left: 8px !important;
  padding-right: 20px !important;
  border-left: 0 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8),
.history-summary-table th:nth-child(8),
.history-summary-table td:nth-child(8),
.table-summary .result-recommendation-cell,
.history-summary-table .history-recommendation-cell {
  width: 16% !important;
  min-width: 0 !important;
  border-left: 1px solid var(--border) !important;
  padding-left: 12px !important;
  padding-right: 8px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.table-summary .result-recommendation-cell,
.history-summary-table .history-recommendation-cell {
  overflow: visible;
}

@media (max-width: 768px) {
  .table-summary table,
  .history-summary-table table {
    min-width: 900px !important;
  }
}

/* v28: 추천 카드의 '혹은' 색상 구분 및 합계 행 상세 표시 */
.recommendation-result-card .recommendation-card-separator {
  color: var(--text-strong);
  font-style: normal;
  font-weight: 900;
}

.summary-total-breakdown {
  display: inline-grid;
  gap: 2px;
  line-height: 1.25;
  white-space: nowrap;
  word-break: keep-all;
  justify-content: center;
  justify-items: center;
  align-items: center;
}

.summary-total-breakdown span {
  display: block;
  min-height: 1.25em;
  white-space: nowrap;
}

.table-summary tfoot th:nth-child(2) {
  text-align: center !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

/* v29: 모바일 추천 조합 줄바꿈 및 요약 카드 표시 정리 */
.result-card .recommendation-card-value,
.result-card .recommendation-card-plan {
  display: inline;
  margin-top: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.recommendation-result-card .recommendation-card-separator {
  display: inline;
  margin: 0 6px;
  color: var(--text-strong);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.extra-summary {
  display: grid;
  gap: 8px;
}

.final-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.final-summary-item strong {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 900;
}

.final-summary-item > span {
  display: block;
  min-width: 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--recommend-text);
}

.recommendation-summary-value,
.recommendation-summary-plan {
  display: inline;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.recommendation-summary-separator {
  display: inline;
  margin: 0 6px;
  color: var(--text-strong);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.history-weight-line {
  display: block;
}

.history-final-line {
  display: block;
  margin-bottom: 2px;
}

.history-simple-recommendation-line {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 3px 6px;
}

.history-simple-recommendation-label {
  flex: 0 0 auto;
  white-space: nowrap;
}

.history-simple-recommendation-value {
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

@media (max-width: 480px) {
  .recommendation-result-card > span {
    white-space: normal;
    font-size: 20px;
    line-height: 1.3;
  }

  .recommendation-result-card .recommendation-card-value.has-alternate {
    display: grid;
    gap: 3px;
  }

  .recommendation-result-card .recommendation-card-value.has-alternate .recommendation-card-plan,
  .recommendation-result-card .recommendation-card-value.has-alternate .recommendation-card-separator {
    display: block;
    margin: 0;
  }

  .final-summary-item {
    display: block;
  }

  .final-summary-item strong,
  .final-summary-item > span {
    display: block;
  }

  .final-summary-item strong {
    margin-bottom: 2px;
  }

  .final-summary-recommendation .recommendation-summary-value.has-alternate {
    display: grid;
    gap: 3px;
  }

  .final-summary-recommendation .recommendation-summary-value.has-alternate .recommendation-summary-plan,
  .final-summary-recommendation .recommendation-summary-value.has-alternate .recommendation-summary-separator {
    display: block;
    margin: 0;
  }

  .history-simple-recommendation-line.complex .history-simple-recommendation-label,
  .history-simple-recommendation-line.complex .history-simple-recommendation-value {
    flex: 0 0 100%;
  }
}

/* v30: 추천 카드 '혹은' 크기 축소 및 최근 계산 페이지 번호 버튼 */
.recommendation-result-card .recommendation-card-separator {
  font-size: 60% !important;
  line-height: 1 !important;
  vertical-align: middle;
}

.history-pagination {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.history-page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.history-page-button {
  flex: 0 0 auto;
}

.history-number-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 9px;
  font-size: 14px;
  font-weight: 900;
}

.history-number-button.active {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  cursor: default;
}

@media (max-width: 480px) {
  .history-pagination {
    gap: 5px;
  }

  .history-page-button {
    min-width: 34px;
    min-height: 34px;
    padding: 0 8px;
    font-size: 15px;
  }

  .history-number-button {
    min-width: 30px;
    min-height: 30px;
    padding: 0 7px;
    font-size: 13px;
  }
}

/* v31: 계산 결과 상단 카드 '혹은' 크기 재보강 및 하단 요약 카드 글자 확대 */
.result-card.recommend.recommendation-result-card > span .recommendation-card-separator,
.result-card.recommend.recommendation-result-card .recommendation-card-value.has-alternate .recommendation-card-separator {
  font-size: 0.6em !important;
  line-height: 1 !important;
  vertical-align: middle;
  color: var(--text-strong) !important;
  font-style: normal;
}

.extra-summary .final-summary-item {
  line-height: 1.42;
}

.extra-summary .final-summary-item strong {
  font-size: 17px !important;
}

.extra-summary .final-summary-item > span {
  font-size: 20px !important;
}

@media (max-width: 480px) {
  .extra-summary .final-summary-item strong {
    font-size: 17px !important;
  }

  .extra-summary .final-summary-item > span {
    font-size: 20px !important;
  }
}

/* v33: 최근 계산 페이지 제한, 요약 문구 확대, 모바일 추천 요약 정렬, 상단 카드 '혹은' 크기 재조정 */
.result-card.recommend.recommendation-result-card > span .recommendation-card-separator,
.result-card.recommend.recommendation-result-card .recommendation-card-value.has-alternate .recommendation-card-separator {
  font-size: 0.86em !important;
  line-height: 1 !important;
  vertical-align: middle;
}

.history-weight-line {
  font-size: 16px !important;
  line-height: 1.38 !important;
}

.history-simple-recommendation-line {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 3px 6px;
}

.history-simple-recommendation-label {
  flex: 0 0 auto;
  white-space: nowrap;
}

.history-simple-recommendation-value {
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.history-simple-recommendation-value.has-alternate {
  display: inline;
}

.history-simple-recommendation-plan,
.history-simple-recommendation-separator {
  display: inline;
  white-space: nowrap;
  word-break: keep-all;
}

.history-simple-recommendation-separator {
  margin: 0 5px;
  font-weight: 900;
}

@media (max-width: 480px) {
  .history-weight-line {
    font-size: 16px !important;
    line-height: 1.42 !important;
  }

  .history-simple-recommendation-line.complex {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 6px;
    row-gap: 2px;
    align-items: start;
  }

  .history-simple-recommendation-line.complex .history-simple-recommendation-label {
    grid-column: 1;
    grid-row: 1;
  }

  .history-simple-recommendation-line.complex .history-simple-recommendation-value.has-alternate {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .history-simple-recommendation-line.complex .history-simple-recommendation-plan {
    display: block;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .history-simple-recommendation-line.complex .history-simple-recommendation-separator {
    display: none;
  }
}

/* v34: 상단 추천 카드 조합 글자 크기 동일화 및 모바일 페이지 번호 배치 */
.result-card.recommend.recommendation-result-card .recommendation-card-value.has-alternate,
.result-card.recommend.recommendation-result-card .recommendation-card-value.has-alternate .recommendation-card-plan {
  font-size: 1em !important;
  line-height: 1.25 !important;
}

.result-card.recommend.recommendation-result-card .recommendation-card-value.has-alternate .recommendation-card-plan {
  font-weight: inherit !important;
}

.result-card.recommend.recommendation-result-card .recommendation-card-value.has-alternate .recommendation-card-separator {
  font-size: 0.86em !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  font-weight: 900 !important;
}

@media (max-width: 480px) {
  .history-pagination {
    justify-content: center;
    row-gap: 7px;
  }

  .history-page-numbers {
    order: 1;
    flex: 0 0 100%;
    width: 100%;
    justify-content: center;
  }

  .history-pagination > .history-page-button {
    order: 2;
  }
}

/* v35: 계산 결과 표에서 추천 톤수 본문값과 합계값 사이의 가로선만 제거 */
.table-summary tbody .result-recommendation-cell {
  border-bottom: 0 !important;
}

/* v38: 계산 결과 표 합계 행의 자재명+규격/중량 상세 표시 */
.table-summary tfoot th:nth-child(2) {
  text-align: center !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.summary-total-breakdown.summary-total-materials {
  width: 100%;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  justify-content: center;
  justify-items: center;
}

.summary-total-breakdown.summary-total-materials > span {
  display: block;
  width: 100%;
  min-width: 0;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  text-align: center;
}

.summary-total-material-label {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1px;
  max-width: 100%;
  line-height: 1.18;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.summary-total-material-main {
  display: inline-block;
  font-size: 1em;
  white-space: nowrap;
}

.summary-total-material-detail {
  display: inline-block;
  max-width: 100%;
  font-size: 0.72em;
  line-height: 1.1;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}


/* v39: 계산 결과 표 합계 행 자재명과 규격을 한 줄로 표시 */
.table-summary tfoot th:nth-child(2) {
  width: 24% !important;
  min-width: 170px !important;
}

.table-summary tfoot .summary-total-breakdown.summary-total-materials {
  white-space: nowrap !important;
  overflow: hidden !important;
}

.table-summary tfoot .summary-total-breakdown.summary-total-materials > span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

.table-summary tfoot .summary-total-material-label {
  display: inline-flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow: hidden !important;
}

.table-summary tfoot .summary-total-material-main {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

.table-summary tfoot .summary-total-material-detail {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  font-size: 0.68em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

.table-summary th:nth-child(2),
.table-summary td:nth-child(2) {
  width: 24% !important;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7) {
  width: 14% !important;
  padding-right: 14px !important;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8),
.table-summary .result-recommendation-cell {
  width: 12% !important;
}

@media (max-width: 768px) {
  .table-summary table {
    min-width: 980px !important;
  }
}

/* v40: 계산 결과 표 합계 행 자재+규격 칸 정렬/폭/글자 크기 조정 */
.table-summary tfoot th:nth-child(2),
.table-summary tfoot td:nth-child(2) {
  width: 20% !important;
  min-width: 150px !important;
  text-align: left !important;
}

.table-summary tfoot .summary-total-breakdown.summary-total-materials {
  justify-content: flex-start !important;
  justify-items: start !important;
  text-align: left !important;
}

.table-summary tfoot .summary-total-breakdown.summary-total-materials > span {
  text-align: left !important;
}

.table-summary tfoot .summary-total-material-label {
  justify-content: flex-start !important;
  text-align: left !important;
}

.table-summary tfoot .summary-total-material-detail {
  font-size: 0.78em !important;
}

.table-summary th:nth-child(2),
.table-summary td:nth-child(2) {
  width: 20% !important;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7) {
  width: 13% !important;
}

/* v41: 계산 결과 표에서 초과율 반영(%) 글자와 추천 톤수 구분선 간격 보정 */
.table-summary th:nth-child(2),
.table-summary td:nth-child(2) {
  width: 18% !important;
}

.table-summary th:nth-child(6),
.table-summary td:nth-child(6) {
  width: 11% !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.table-summary th:nth-child(7),
.table-summary td:nth-child(7) {
  width: 17% !important;
  padding-left: 8px !important;
  padding-right: 28px !important;
  border-left: 0 !important;
  text-align: center !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.table-summary th:nth-child(8),
.table-summary td:nth-child(8),
.table-summary .result-recommendation-cell {
  width: 12% !important;
  padding-left: 12px !important;
  padding-right: 8px !important;
  border-left: 1px solid var(--border) !important;
}

.table-summary th:nth-child(7) {
  letter-spacing: -0.02em;
}

.table-summary tfoot th:nth-child(2),
.table-summary tfoot td:nth-child(2) {
  width: 18% !important;
  min-width: 140px !important;
}

@media (max-width: 768px) {
  .table-summary table {
    min-width: 1000px !important;
  }
}

/* ===== v43 송장 생성 버튼 ===== */
.invoice-button {
  background: #03c75a;
  color: #ffffff;
}

.invoice-button:hover,
.history-invoice-button:hover {
  filter: brightness(0.96);
}

.history-item-actions {
  flex-wrap: wrap;
  max-width: 128px;
}

.history-invoice-button {
  flex: 1 0 100%;
  min-width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  background: #03c75a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.dark-mode .invoice-button,
.dark-mode .history-invoice-button {
  background: #03c75a;
  color: #ffffff;
}

@media (min-width: 720px) {
  .result-actions {
    grid-template-columns: 1.3fr 1.3fr 0.9fr 1fr;
  }
}

@media (max-width: 719px) {
  .history-item-actions {
    max-width: 116px;
  }
}

/* ===== v44 버튼 크기 정렬 보정 ===== */
.result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.result-actions button {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  height: 52px;
  padding: 0 12px;
  box-sizing: border-box;
  text-align: center;
}

#copyExcelBtn {
  order: 1;
}

#copyTextBtn {
  order: 2;
}

#invoiceBtn {
  order: 3;
}

#resetAllResultBtn {
  order: 4;
}

.history-item-actions {
  width: 114px;
  max-width: 114px;
  flex: 0 0 114px;
  justify-content: flex-end;
  gap: 6px;
}

.history-action-button {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  flex: 0 0 34px;
}

.history-invoice-button {
  width: 114px;
  min-width: 114px;
  max-width: 114px;
  flex: 0 0 114px;
  box-sizing: border-box;
}

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

  .result-actions button {
    height: 50px;
    min-height: 50px;
  }

  .history-item-actions {
    width: 114px;
    max-width: 114px;
    flex-basis: 114px;
  }
}

/* ===== v47 송장 항목 선택 모달 ===== */
.invoice-option-modal-box {
  max-width: 540px;
  width: min(92vw, 540px);
}

.invoice-option-desc {
  margin: 0 0 14px 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.invoice-column-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin: 12px 0 16px 0;
}

.invoice-column-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.invoice-column-options input {
  width: 16px;
  height: 16px;
  accent-color: #03c75a;
}

.invoice-option-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.invoice-option-actions button {
  min-height: 40px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .invoice-column-options {
    grid-template-columns: 1fr;
  }

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

/* 페이지 이동 시 이전 스크롤 위치가 순간적으로 보이는 현상을 막기 위한 선차단 상태 */
html.theme-dark-initial {
  background-color: #0f172a;
}

html.theme-light-initial {
  background-color: #f3f5f7;
}

html.theme-dark-initial:not(.theme-body-ready) body {
  background-color: #0f172a;
}

html.theme-light-initial:not(.theme-body-ready) body {
  background-color: #f3f5f7;
}


/* ===== v66 정적 멀티페이지 구조 보강 ===== */
.site-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.site-hero-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 900;
}
.site-hero-actions .primary-link {
  background: var(--blue);
  color: #ffffff;
}
.site-hero-actions .secondary-link {
  background: var(--button-sub-bg);
  color: var(--button-sub-text);
}
.tool-card-meta {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--recommend-bg);
  color: var(--recommend-text);
  font-size: 12px;
  font-weight: 900;
}
.simple-warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-text);
}
.simple-warning p:last-child,
.content-section p:last-child {
  margin-bottom: 0;
}
.page-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.page-link-row a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--button-sub-bg);
  color: var(--button-sub-text);
  font-weight: 900;
  text-decoration: none;
}
.page-link-row a.primary-link {
  background: var(--blue);
  color: #ffffff;
}
.disclaimer-list li + li {
  margin-top: 8px;
}
@media (max-width: 480px) {
  .site-hero-actions,
  .page-link-row { display: grid; grid-template-columns: 1fr; }
  .site-hero-actions a,
  .page-link-row a { width: 100%; }
}


/* ===== v71 콘크리트 물량·레미콘 대수 계산기 ===== */
.concrete-common-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.concrete-unit-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.concrete-unit-fieldset legend {
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-soft);
}

.concrete-unit-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.concrete-unit-switch label {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--input-text);
  font-weight: 900;
  cursor: pointer;
}

.concrete-unit-switch input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--blue);
}

.quick-value-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.quick-value-buttons button {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--button-sub-bg);
  color: var(--button-sub-text);
  border-radius: 10px;
  font-size: 13px;
}

.section-helper {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.concrete-rows {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.concrete-row {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--box-bg);
}

.concrete-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.concrete-row-title {
  font-weight: 900;
  color: var(--text-soft);
}

.concrete-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.concrete-row-grid label {
  min-width: 0;
}

.concrete-row-grid .label-main {
  display: inline-flex;
  align-items: center;
}

.concrete-row-preview {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.concrete-row-preview strong {
  color: var(--text-strong);
}

.concrete-result-grid .result-card span {
  font-size: clamp(21px, 5vw, 26px);
}

.concrete-result-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.concrete-summary-note {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.concrete-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.concrete-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.concrete-history-actions button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 13px;
}

@media (min-width: 720px) {
  .concrete-common-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .concrete-row-grid {
    grid-template-columns: minmax(150px, 1.45fr) repeat(4, minmax(95px, 1fr));
  }
}

@media (max-width: 719px) {
  .concrete-result-actions {
    grid-template-columns: 1fr;
  }

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


/* ===== v72 콘크리트 구간별 공제 / 공차금액 ===== */
.concrete-field-help {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}

.concrete-deduction-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--card-bg);
}

.concrete-deduction-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-bottom: 10px;
}

.concrete-deduction-heading strong {
  color: var(--text-strong);
  font-size: 14px;
}

.concrete-deduction-heading span {
  color: var(--text-muted);
  font-size: 12px;
}

.concrete-deduction-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.concrete-deduction-preview {
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.concrete-deduction-preview strong {
  color: var(--text-strong);
}

.concrete-row-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.concrete-row-preview span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
}

@media (min-width: 720px) {
  .concrete-deduction-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

#concreteSummary {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#concreteSummary table {
  min-width: 980px;
}

/* ===== v73 콘크리트 결과표: 가로 스크롤 제거 / 반응형 요약 ===== */
#concreteSummary {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#concreteSummary table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

#concreteSummary th,
#concreteSummary td {
  min-width: 0;
  padding: 9px 5px;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

#concreteSummary th:nth-child(1),
#concreteSummary td:nth-child(1) { width: 14%; }
#concreteSummary th:nth-child(2),
#concreteSummary td:nth-child(2) { width: 11%; }
#concreteSummary th:nth-child(3),
#concreteSummary td:nth-child(3) { width: 11%; }
#concreteSummary th:nth-child(4),
#concreteSummary td:nth-child(4) { width: 14%; }
#concreteSummary th:nth-child(5),
#concreteSummary td:nth-child(5) { width: 8%; }
#concreteSummary th:nth-child(6),
#concreteSummary td:nth-child(6) { width: 14%; }
#concreteSummary th:nth-child(7),
#concreteSummary td:nth-child(7) { width: 14%; }
#concreteSummary th:nth-child(8),
#concreteSummary td:nth-child(8) { width: 14%; }

#concreteSummary .concrete-summary-label {
  text-align: left;
}

#concreteSummary .concrete-summary-value {
  text-align: right;
  white-space: normal;
}

@media (max-width: 719px) {
  #concreteSummary {
    overflow: visible;
  }

  #concreteSummary table,
  #concreteSummary tbody,
  #concreteSummary tfoot {
    display: block;
    width: 100%;
  }

  #concreteSummary thead {
    display: none;
  }

  #concreteSummary tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
    width: 100%;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
  }

  #concreteSummary tbody td,
  #concreteSummary tbody td:nth-child(n) {
    width: auto;
    min-width: 0;
    padding: 7px 0;
    border-bottom: 0;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
  }

  #concreteSummary tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--text-soft);
    font-weight: 900;
    text-align: left;
  }

  #concreteSummary tfoot tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
    align-items: center;
    width: 100%;
  }

  #concreteSummary tfoot th,
  #concreteSummary tfoot th:nth-child(n),
  #concreteSummary .concrete-summary-label,
  #concreteSummary .concrete-summary-value {
    display: block;
    width: auto;
    min-width: 0;
    padding: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #concreteSummary .concrete-summary-label {
    text-align: left;
  }

  #concreteSummary .concrete-summary-value {
    text-align: right;
  }
}

@media (max-width: 480px) {
  #concreteSummary tbody tr {
    grid-template-columns: 1fr;
  }

  #concreteSummary tfoot tr {
    grid-template-columns: minmax(0, 1fr) minmax(96px, auto);
  }

  #concreteSummary th,
  #concreteSummary td {
    font-size: 12px;
  }
}

/* ===== v74 콘크리트 형상 선택 / CAD 물량 합산 ===== */
.concrete-row-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.concrete-shape-select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0 38px 0 14px;
  font-size: 16px;
  font-weight: 700;
  background: var(--input-bg);
  color: var(--input-text);
  cursor: pointer;
}

.concrete-shape-select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

.shape-helper {
  margin: 7px 0 9px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.concrete-shape-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.concrete-shape-fields label {
  min-width: 0;
}

.concrete-shape-full {
  grid-column: 1 / -1;
}

.shape-field-help {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.deduction-shape-label {
  display: block;
  margin-bottom: 8px;
}

.cad-volume-list {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
}

.cad-volume-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.cad-volume-row .remove-cad-volume {
  min-width: 70px;
  min-height: 50px;
}

.add-cad-volume {
  justify-self: start;
  grid-column: 1 / -1;
}

.concrete-shape-guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.concrete-shape-guide-grid > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--box-bg);
}

.concrete-shape-guide-grid strong {
  color: var(--text-strong);
}

.concrete-shape-guide-grid span {
  color: var(--text-soft);
  font-size: 13px;
}

@media (min-width: 720px) {
  .concrete-row-meta-grid {
    grid-template-columns: minmax(160px, 1.2fr) minmax(180px, 1fr);
  }

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

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

@media (max-width: 480px) {
  .cad-volume-row {
    grid-template-columns: 1fr;
  }

  .cad-volume-row .remove-cad-volume {
    width: 100%;
    min-height: 38px;
  }

  .add-cad-volume {
    width: 100%;
  }
}

/* v74 결과표는 형상별 입력값을 한 열에 요약합니다. */
#concreteSummary th:nth-child(1),
#concreteSummary td:nth-child(1) { width: 14%; }
#concreteSummary th:nth-child(2),
#concreteSummary td:nth-child(2) { width: 14%; }
#concreteSummary th:nth-child(3),
#concreteSummary td:nth-child(3) { width: 26%; }
#concreteSummary th:nth-child(4),
#concreteSummary td:nth-child(4) { width: 10%; }
#concreteSummary th:nth-child(5),
#concreteSummary td:nth-child(5),
#concreteSummary th:nth-child(6),
#concreteSummary td:nth-child(6),
#concreteSummary th:nth-child(7),
#concreteSummary td:nth-child(7) { width: 12%; }

/* ===== v75 XY / XYZ coordinate entry and local polygon preview ===== */
.coordinate-text-label { display:block; min-width:0; }
.concrete-shape-fields .coordinate-input {
  box-sizing:border-box;
  display:block;
  width:100%;
  min-height:146px;
  border:1px solid var(--border-strong);
  border-radius:12px;
  padding:12px 14px;
  font:500 15px/1.55 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
  color:var(--input-text);
  background:var(--input-bg);
  resize:vertical;
  overflow-wrap:normal;
  white-space:pre;
  overflow-x:auto;
}
.concrete-shape-fields .coordinate-input:focus {
  outline:3px solid rgba(37,99,235,.18);
  border-color:var(--blue);
}
.coordinate-visual {
  min-width:0;
  width:100%;
  padding:12px;
  box-sizing:border-box;
  background:var(--box-bg);
  border:1px solid var(--border);
  border-radius:12px;
}
.coordinate-feedback {
  margin:0 0 7px;
  font-size:13px;
  color:var(--text-soft);
  line-height:1.6;
  overflow-wrap:anywhere;
}
.coordinate-feedback.coordinate-error {color:#dc2626; font-weight:700;}
.coordinate-plot { width:100%; max-width:360px; margin:auto; }
.coordinate-plot svg {width:100%; height:auto; display:block; overflow:visible;}
@media (max-width:480px) {
  .concrete-shape-fields .coordinate-input {font-size:14px; min-height:160px;}
}

/* v75: isolate concrete summary from legacy steel table's 1000px !important rule. */
#concreteSummary table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
}
@media (max-width: 719px) {
  #concreteSummary tbody td,
  #concreteSummary tbody td:nth-child(n),
  #concreteSummary tfoot th,
  #concreteSummary tfoot th:nth-child(n) {
    box-sizing: border-box;
    min-width: 0 !important;
    width: auto !important;
  }
  #concreteSummary tbody tr,
  #concreteSummary tfoot tr {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }
}


/* ===== v76: 상단 계산기 드롭다운 (PC·모바일 공통) ===== */
.site-nav .nav-calculator-dropdown {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}

.site-nav .nav-calculator-dropdown > summary {
  box-sizing: border-box;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--header-text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}

.site-nav .nav-calculator-dropdown > summary::-webkit-details-marker {
  display: none;
}

.site-nav .nav-calculator-dropdown > summary::after {
  content: "▾";
  font-size: 12px;
  transition: transform 150ms ease;
}

.site-nav .nav-calculator-dropdown[open] > summary::after {
  transform: rotate(180deg);
}

.site-nav .nav-calculator-dropdown > summary:hover,
.site-nav .nav-calculator-dropdown > summary:focus-visible,
.site-nav .nav-calculator-dropdown[open] > summary,
.site-nav .nav-calculator-dropdown.is-current > summary {
  background: #ffffff;
  color: #111827;
}

.site-nav .nav-calculator-dropdown > summary:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.site-nav .nav-calculator-menu {
  box-sizing: border-box;
  position: absolute;
  z-index: 100;
  top: calc(100% + 7px);
  left: 0;
  width: min(290px, calc(100vw - 28px));
  padding: 7px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  background: var(--header-bg);
  box-shadow: 0 12px 28px var(--menu-shadow);
}

.site-nav .nav-calculator-menu a {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--header-text);
  text-decoration: none;
  text-align: left;
  font-size: 14px;
  font-weight: 750;
  white-space: normal;
  line-height: 1.35;
}

.site-nav .nav-calculator-menu a:hover,
.site-nav .nav-calculator-menu a:focus-visible,
.site-nav .nav-calculator-menu a.active {
  background: #ffffff;
  color: #111827;
}

@media (max-width: 480px) {
  .site-nav .nav-calculator-dropdown {
    width: 100%;
  }
  .site-nav .nav-calculator-dropdown > summary {
    width: 100%;
    min-height: 38px;
    padding: 0 8px;
    font-size: 12px;
  }
  .site-nav .nav-calculator-menu {
    left: auto;
    right: 0;
  }
}
