/* KalkPlace — стекло и зеркала (niche components) */
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 860px) 380px;
  gap: 2rem;
  align-items: start;
  justify-content: center;
  margin-top: 1rem;
}
.calc-form, .calc-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}
.calc-result {
  position: sticky;
  top: 10px;
  max-height: calc(100dvh - 20px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  background: #110e00;
  border-color: var(--surface2);
  color: var(--bg);
}
.calc-result .section-title {
  color: var(--accent-dim);
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--brand);
}
.form-section {
  margin-bottom: 1.6rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.form-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-soft);
  padding: 0.6rem 0.9rem;
  border-left: 2px solid var(--brand);
  border-radius: var(--radius-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.fields-grid > .field {
  min-width: 0;
}
.fields-grid .counter-wrap {
  min-width: 0;
  max-width: min(230px, 100%);
}
.fields-grid .field > select,
.fields-grid .field > input:not([type="checkbox"]):not([type="radio"]) {
  min-width: 0;
  max-width: min(230px, 100%);
}
.fields-grid-split {
  grid-column: 1 / -1;
  height: 1px;
  margin: 0.45rem 0 0.55rem;
  padding: 0;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--brand) 22%, transparent) 18%,
    color-mix(in srgb, var(--border) 85%, var(--brand)) 50%,
    color-mix(in srgb, var(--brand) 22%, transparent) 82%,
    transparent 100%
  );
}
.tempered-lock-zone {
  position: relative;
  border-radius: 14px;
}
.tempered-lock-zone .tempered-lock-grid {
  transition: filter .22s ease, opacity .22s ease, transform .22s ease;
}
.tempered-lock-zone.is-locked .tempered-lock-grid {
  filter: grayscale(0.08) saturate(0.88);
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
}
.tempered-lock-zone.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.78), rgba(250, 244, 231, 0.84));
  backdrop-filter: blur(1.6px);
  -webkit-backdrop-filter: blur(1.6px);
  pointer-events: none;
  z-index: 1;
}
.tempered-lock-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  right: auto;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: min(560px, calc(100% - 24px));
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--brand) 45%, #dbc08b);
  background: linear-gradient(180deg, var(--surface) 0%, #fff3de 100%);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(66, 47, 16, 0.12);
  font-size: 0.74rem;
  line-height: 1.35;
  font-weight: 600;
  transform: translate(-50%, -46%) scale(0.965);
  opacity: 0;
}
.tempered-lock-zone.is-locked .tempered-lock-banner {
  animation: temperedLockBannerIn .18s ease-out forwards;
}
@keyframes temperedLockBannerIn {
  from { transform: translate(-50%, -44%) scale(0.965); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.tempered-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d2b16a;
  background: var(--accent-dim);
  color: #8c6420;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 22px;
  margin-top: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.58);
}
.tempered-lock-badge svg {
  width: 13px;
  height: 13px;
  display: block;
}
.tempered-lock-text strong {
  display: block;
  margin-bottom: 1px;
  letter-spacing: 0.1px;
  color: #50370e;
  font-size: 0.76rem;
}
.field-shipment .mkad-nested {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0.4rem;
  padding-top: 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}
.field-shipment .mkad-nested input {
  min-width: 0;
  max-width: min(230px, 100%);
}
.shape-size-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.shape-size-grid #shapeField { grid-column: 1; }
.shape-size-grid #qtyField { grid-column: 2; }
.shape-size-grid #widthField { grid-column: 1; }
.shape-size-grid #heightField { grid-column: 2; }
.shape-size-grid .field.full {
  grid-column: 1 / -1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .1px;
  line-height: 1.35;
}
.field label.label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}
.field-info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}
.field-info-tip .info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid #cdb57a;
  background: var(--accent-dim);
  color: #7a5a16;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  user-select: none;
}
.field-info-tip .info-bubble {
  position: absolute;
  display: block;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(300px, calc(100vw - 28px));
  max-width: min(300px, calc(100vw - 28px));
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d8c598;
  background: var(--surface);
  color: var(--text);
  font-size: 0.73rem;
  line-height: 1.35;
  box-shadow: 0 8px 28px rgba(25, 21, 16, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 24;
  transition: opacity .15s ease;
  text-align: left;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.field-info-tip .info-bubble.align-right,
.check-inline .info-bubble.align-right {
  left: auto;
  right: 0;
}
.check-inline .info-bubble.align-left {
  right: auto;
  left: 0;
}
.field-info-tip:hover .info-bubble,
.field-info-tip:focus-within .info-bubble {
  opacity: 1;
  visibility: visible;
}
.field input:not([type="checkbox"]):not([type="radio"]), .field select {
  min-height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 5px 13px;
  font-size: 0.8rem;
  width: auto;
  min-width: 148px;
  max-width: 230px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .12s ease;
}
.field select {
  width: auto;
  min-width: 148px;
  max-width: 230px;
}
.choice-select {
  display: none;
}
.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border2);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease, transform .1s ease;
}
.choice-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}
.choice-chip.is-active {
  background: var(--accent-dim);
  border-color: var(--brand);
  color: #8a6418;
  font-weight: 600;
}
.choice-chip:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}
.field.full select {
  width: auto;
  min-width: 180px;
  max-width: 280px;
}
#backlightField select {
  min-width: 148px;
  max-width: 230px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(168, 135, 76, 0.18);
  background: var(--surface);
  transform: translateY(-1px);
}
.full { grid-column: 1 / -1; }
.note {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.file-note {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
  word-break: break-word;
  line-height: 1.52;
}
.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 32px;
}
.file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.file-btn:hover {
  border-color: var(--brand);
  background: var(--surface);
}
.file-selected {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-height: 34px;
  border: 1.5px solid var(--border2);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 0 14px;
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  width: auto;
  min-width: 148px;
  max-width: 230px;
  transition: border-color .18s ease, background-color .18s ease, transform .12s ease;
}
.check-inline:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  color: var(--brand);
  background: var(--surface-soft);
}
.check-inline.is-checked {
  background: var(--accent-dim);
  border-color: var(--brand);
  color: #8a6418;
  font-weight: 600;
}
.check-inline .info-tip {
  margin-left: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.check-inline .info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #cdb57a;
  background: var(--accent-dim);
  color: #7a5a16;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  user-select: none;
}
.check-inline .info-bubble {
  position: absolute;
  display: block;
  left: auto;
  bottom: calc(100% + 8px);
  right: 0;
  transform: none;
  width: min(260px, calc(100vw - 28px));
  max-width: min(260px, calc(100vw - 28px));
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d8c598;
  background: var(--surface);
  color: var(--text);
  font-size: 0.73rem;
  line-height: 1.35;
  box-shadow: 0 8px 28px rgba(25, 21, 16, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 25;
  transition: opacity .15s ease;
  text-align: left;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.check-inline .info-tip:hover .info-bubble,
.check-inline .info-tip:focus-within .info-bubble {
  opacity: 1;
  visibility: visible;
}
.check-inline input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.check-inline > span {
  position: relative;
  padding-left: 0;
  white-space: nowrap;
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.option-grid .check-inline {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
}
.option-grid .check-inline > span {
  white-space: normal;
  overflow-wrap: anywhere;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.counter-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-start;
  width: 100%;
  min-width: 148px;
  max-width: 230px;
}
.counter-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease, transform .12s ease;
}
.counter-btn:hover {
  border-color: var(--brand);
  color: var(--brand-hover);
  background: var(--surface);
  transform: translateY(-1px);
}
.counter-wrap input[type="number"] {
  text-align: center;
  min-height: 28px;
  padding: 2px 10px;
  font-size: 0.76rem;
  width: calc(100% - 62px);
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
}
.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.dim-unit-panel {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dim-unit-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dim-unit-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dim-unit-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #cfc7ba;
  background: var(--surface-soft);
  color: #6f665b;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.dim-unit-btn.is-active {
  border-color: var(--brand);
  background: var(--accent-dim);
  color: #7a5a16;
}
.unit-guard {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.unit-guard input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}
.unit-warn {
  margin-top: 5px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #8b3a3a;
  display: none;
}
.unit-warn.show {
  display: block;
}
.summary-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  font-size: 0.84rem;
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
}
.summary-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  min-width: 0;
}
.summary-table tr:last-child td {
  border-bottom: 0;
}
.summary-table td:last-child {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  min-width: 9.75rem;
  width: 9.75rem;
  padding-left: 0.65rem;
}
.summary-table td.extras-cell {
  white-space: normal;
  text-align: left;
  font-weight: 600;
  padding-top: 8px;
  padding-bottom: 8px;
}
.extras-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  width: 100%;
}
.extras-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 100%;
}
.extras-list li span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}
.extras-list li .val {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  text-align: right;
  min-width: 8.25rem;
  font-variant-numeric: tabular-nums;
}
.summary-table tr.total td {
  background: var(--surface-soft);
  font-size: 0.95rem;
  font-weight: 800;
  border-top: 1px solid rgba(168, 135, 76, 0.24);
  font-family: var(--font-mono);
  letter-spacing: 0.012em;
}
.calc-result .summary-table {
  background: var(--surface2);
  border-color: var(--border);
  box-shadow: none;
}
.calc-result .summary-table td {
  color: var(--text-muted);
  border-bottom-color: var(--border);
}
.calc-result .summary-table td:last-child {
  color: var(--bg);
}
.calc-result .summary-table td.extras-cell,
.calc-result .extras-list li {
  color: var(--text-muted);
}
.calc-result .extras-list li .val {
  color: var(--bg);
}
.calc-result .summary-table tr.total td {
  background: var(--accent-dim);
  color: #110e00;
  border-top-color: rgba(184, 137, 42, 0.34);
}
.status {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(240, 160, 80, 0.45);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text);
  display: none;
}
.status.ok {
  display: block;
  border-color: rgba(45, 212, 163, 0.45);
  background: var(--green-dim);
  color: var(--green);
}
.status.warn {
  display: block;
}
.ai-insight {
  margin-top: 8px;
  border: 1px solid var(--ai-neutral-border);
  background: var(--ai-neutral-bg);
  border-radius: 10px;
  padding: 10px 12px;
}
.ai-insight.good {
  border-color: rgba(45, 212, 163, 0.45);
  background: var(--green-dim);
}
.ai-insight.neutral {
  border-color: var(--ai-neutral-border);
  background: var(--ai-neutral-bg);
}
.ai-insight.warn {
  border-color: rgba(240, 160, 80, 0.45);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}
.ai-insight.good .ai-insight-head,
.ai-insight.warn .ai-insight-head {
  color: #5a451e;
}
.ai-insight.good .ai-insight-title,
.ai-insight.warn .ai-insight-title {
  color: #2f2613;
}
.ai-insight.good .ai-insight-subtitle,
.ai-insight.warn .ai-insight-subtitle {
  color: #7a5e2a;
}
.ai-insight.good .ai-insight-text,
.ai-insight.warn .ai-insight-text {
  color: #4e3d1b;
}
.ai-insight.good .ai-insight-text strong,
.ai-insight.warn .ai-insight-text strong {
  color: #2c210f;
}
.ai-insight.good .ai-insight-note,
.ai-insight.warn .ai-insight-note {
  color: #7d6a41;
}
.ai-insight.good .ai-insight-cta,
.ai-insight.warn .ai-insight-cta {
  color: #8a6418;
}
.ai-insight-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.77rem;
  font-weight: 800;
  color: var(--ai-neutral-head);
  margin-bottom: 4px;
}
.ai-mascot {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(184, 137, 42, 0.32);
  background: var(--surface2);
  flex: 0 0 34px;
  object-fit: cover;
}
.ai-insight-head-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.ai-insight-title {
  font-size: 0.77rem;
  font-weight: 800;
  color: var(--ai-neutral-title);
}
.ai-insight-subtitle {
  font-size: 0.68rem;
  color: var(--ai-neutral-subtitle);
  font-weight: 700;
}
.ai-insight-text {
  font-size: 0.78rem;
  color: var(--ai-neutral-text);
  line-height: 1.48;
}
.ai-insight-text strong {
  color: var(--ai-neutral-strong);
}
.ai-insight-cta {
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ai-neutral-cta);
}
.ai-insight-note {
  margin-top: 5px;
  font-size: 0.7rem;
  color: var(--ai-neutral-note);
  line-height: 1.45;
}
.ai-discount-btn {
  margin-top: 7px;
  min-height: 30px;
  border-radius: 7px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--surface-soft);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}
.ai-discount-btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.cta-grid {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.export-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.export-block .section-title {
  margin-bottom: 8px;
}
.export-contacts {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.export-contacts label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #c9bfb0;
  margin-bottom: 3px;
}
.export-contacts input,
.export-contacts textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #4a433a;
  background: #26221d;
  color: var(--bg);
  font-size: 0.82rem;
  padding: 8px 10px;
  font-family: inherit;
}
.export-contacts textarea {
  min-height: 52px;
  resize: vertical;
}
.btn-group-glass {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.btn-submit-glass,
.btn-pdf-glass {
  flex: 1;
  min-height: 44px;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  font-family: inherit;
  line-height: 1.15;
  text-align: center;
}
.btn-submit-glass {
  background: var(--brand);
  color: #110e00;
}
.btn-submit-glass:hover {
  background: #c99a35;
}
.btn-pdf-glass {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: #2a3039;
  border: 1px solid #d8c9a5;
}
.btn-pdf-glass:hover {
  background: color-mix(in srgb, var(--brand) 18%, var(--surface));
}
.btn-submit-glass.loading,
.btn-pdf-glass.loading {
  opacity: 0.7;
  cursor: wait;
}
.request-status {
  margin-top: 0.55rem;
  min-height: 1.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
}
.request-status.is-error { color: #8b3a3a; }
.request-status.is-success { color: #3a6b4a; }
.success-modal-glass {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.82);
  align-items: center;
  justify-content: center;
}
.success-card-glass {
  background: var(--surface);
  max-width: 400px;
  width: 90%;
  padding: 1.5rem;
  text-align: center;
  border: 2px solid var(--brand);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.success-card-glass .emoji-big {
  font-size: 2.5rem;
  margin-bottom: 0.35rem;
}
.success-card-glass h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.success-card-glass p {
  color: var(--text-muted);
  margin: 0.25rem 0;
  font-size: 0.9rem;
}
.close-success-btn-glass {
  background: var(--brand);
  border: none;
  padding: 0.55rem 1.35rem;
  font-weight: 700;
  font-size: 0.88rem;
  margin-top: 0.85rem;
  cursor: pointer;
  color: #1f2937;
  border-radius: 10px;
}
.related-calculators {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
}
.related-calculators-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #a79d90;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.related-calculators-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.related-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #5e564b;
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease, transform .1s ease;
}
.related-link:hover {
  border-color: var(--brand);
  color: var(--accent-dim);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}
.btn {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--surface-soft);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 10px;
  width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(42, 39, 36, 0.16);
}
.btn.ghost {
  background: transparent;
  color: var(--accent-dim);
  border-color: #6f665b;
}
.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--brand);
  color: var(--accent-dim);
}
.btn.sm {
  min-height: 34px;
  font-size: 0.78rem;
  padding: 0 8px;
}
.order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  margin-top: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.order-table th, .order-table td {
  border-bottom: 1px solid var(--border);
  padding: 6px 7px;
  text-align: left;
  vertical-align: top;
}
.order-table th {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface-soft);
}
.order-table td:last-child, .order-table th:last-child {
  text-align: right;
  white-space: nowrap;
}
.order-table tr:last-child td {
  border-bottom: 0;
}
.order-empty {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.order-total-line {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid rgba(168, 135, 76, 0.24);
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 8px 9px;
  font-size: 0.86rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.order-total-line span:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.order-total-line span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 9.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.calc-result .order-empty,
.calc-result .order-breakdown {
  color: var(--text-muted);
}
.calc-result .order-table {
  background: var(--surface2);
  border-color: var(--border);
}
.calc-result .order-table th {
  background: #24211d;
  color: var(--text-muted);
  border-bottom-color: var(--border);
}
.calc-result .order-table td {
  color: var(--text-muted);
  border-bottom-color: var(--border);
}
.calc-result .order-total-line {
  background: var(--accent-dim);
  color: #110e00;
  border-color: rgba(184, 137, 42, 0.28);
}
.calc-result .order-breakdown {
  background: #24211d;
  border-color: var(--border);
}
.calc-result .order-breakdown-row span:last-child {
  color: var(--bg);
}
.order-breakdown {
  margin-top: 6px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 7px 9px;
  display: grid;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.order-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.order-breakdown-row span:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.order-breakdown-row span:last-child {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  min-width: max-content;
  flex: 0 0 auto;
}
@media (max-width: 460px) {
  .order-total-line {
    font-size: 0.8rem;
  }
  .order-breakdown {
    font-size: 0.74rem;
  }
}
@media (max-height: 860px) and (min-width: 981px) {
  .calc-result {
    top: 6px;
    max-height: calc(100dvh - 12px);
    padding: 1.1rem;
  }
  .calc-result .section-title {
    margin-bottom: 0.7rem;
  }
  .summary-table,
  .order-table {
    margin-bottom: 8px;
  }
}
@media (max-height: 720px) and (min-width: 981px) {
  .calc-result {
    top: 4px;
    max-height: calc(100dvh - 8px);
    padding: 0.95rem;
  }
  .order-total-line {
    font-size: 0.8rem;
  }
  .order-breakdown {
    font-size: 0.74rem;
  }
}
@media (max-width: 1240px) {
  .fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shape-size-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shape-size-grid #shapeField { grid-column: 1; }
  .shape-size-grid #qtyField { grid-column: 2; }
  .shape-size-grid #widthField { grid-column: 1; }
  .shape-size-grid #heightField { grid-column: 2; }
  .option-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-result { position: static; }
  .fields-grid { grid-template-columns: 1fr; }
  .shape-size-grid {
    grid-template-columns: 1fr;
  }
  .shape-size-grid #shapeField,
  .shape-size-grid #qtyField,
  .shape-size-grid #widthField,
  .shape-size-grid #heightField {
    grid-column: 1 / -1;
  }
  #msmGlassCalc .calc-form .fields-grid .field input:not([type="checkbox"]):not([type="radio"]),
  #msmGlassCalc .calc-form .fields-grid .field select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  #msmGlassCalc .calc-form .fields-grid .counter-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  #msmGlassCalc .calc-form .fields-grid .check-inline {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .calc-container { padding: 0.9rem 0.8rem 1.5rem; }
  .calc-header { margin-bottom: 1.2rem; padding: 1rem; }
  .calc-header h1 {
    font-size: 1.78rem;
    line-height: 1.12;
  }
  .calc-header p {
    font-size: 0.9rem;
    line-height: 1.56;
  }
  .calc-form, .calc-result { padding: 1rem; }
  .btn {
    min-height: 44px;
    font-size: 0.86rem;
    letter-spacing: 0.01em;
  }
  .summary-table tr.total td {
    font-size: 1rem;
  }
}
@media (max-width: 640px) {
  .shape-size-grid { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
}

#msmGlassCalc,
#msmGlassCalc #msmGlassCalc {
  font-family: var(--font-body) !important;
  color: var(--text) !important;
}
#msmGlassCalc .calc-grid { display: grid !important; }
#msmGlassCalc .calc-form,
#msmGlassCalc .calc-result,
#msmGlassCalc .form-section {
  position: relative;
}
#msmGlassCalc .field { display: flex !important; flex-direction: column !important; }
#msmGlassCalc .fields-grid,
#msmGlassCalc .shape-size-grid,
#msmGlassCalc .option-grid { display: grid !important; }
#msmGlassCalc .fields-grid {
  grid-auto-flow: row !important;
  align-items: start !important;
  align-content: start !important;
}
#msmGlassCalc .fields-grid > .field {
  min-width: 0 !important;
  min-height: 0 !important;
  position: relative !important;
  transform: none !important;
  float: none !important;
  clear: none !important;
}
#msmGlassCalc .fields-grid-split {
  grid-column: 1 / -1 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
#msmGlassCalc .field.full { grid-column: 1 / -1 !important; }
#msmGlassCalc .counter-wrap,
#msmGlassCalc .chips { display: flex !important; }
#msmGlassCalc .check-inline,
#msmGlassCalc .btn,
#msmGlassCalc .file-btn,
#msmGlassCalc .btn-submit-glass,
#msmGlassCalc .btn-pdf-glass { display: inline-flex !important; }
#msmGlassCalc [hidden],
#msmGlassCalc .is-hidden { display: none !important; }
#msmGlassCalc table { border-collapse: collapse; width: 100%; }
#msmGlassCalc .summary-table,
#msmGlassCalc .order-table { border-collapse: separate !important; }
#msmGlassCalc .btn { position: static !important; top: auto !important; left: auto !important; right: auto !important; }
#msmGlassCalc #addPositionBtn {
  position: static !important;
  transform: none !important;
  z-index: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  float: none !important;
  clear: both !important;
}
#msmGlassCalc #addPositionField {
  order: 999 !important;
  margin-top: 4px !important;
}
#msmGlassCalc .field.full .btn { max-width: 100%; }
#msmGlassCalc .file-picker,
#msmGlassCalc .option-grid,
#msmGlassCalc .counter-wrap {
  position: static !important;
  transform: none !important;
}
#msmGlassCalc input,
#msmGlassCalc select,
#msmGlassCalc button {
  font: inherit;
}
