:root {
  --bg: #f4f5f1;
  --panel: #ffffff;
  --ink: #202423;
  --muted: #66706b;
  --line: #d9ded7;
  --accent: #0c7469;
  --accent-dark: #07584f;
  --amber: #a86405;
  --red: #b83232;
  --green: #168251;
  --shadow: 0 18px 45px rgba(32, 36, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

button,
input,
select {
  font: inherit;
}

button {
  line-height: 1.2;
}

.app {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  max-width: 1400px;
  margin: 0 auto;
}

.hero-panel,
.settings,
.preview,
.results {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 17px;
}

.hero-panel {
  position: relative;
  display: grid;
  align-items: center;
  gap: 18px 24px;
  padding: 26px 30px 20px;
}

.hero-copy {
  min-width: 0;
}

.hero-copy p:last-child {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hero-notes p {
  margin: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: #4c5b56;
  background: #f3f8f5;
  line-height: 1.55;
}

.hero-notes p:first-child {
  color: #5f4a0a;
  background: #fff7dc;
}

.hero-notes strong {
  color: var(--accent-dark);
}

#fileInput {
  display: none;
}

.side-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.side-upload.dragging {
  border-color: var(--accent);
  background: #edf8f5;
}

.side-upload div:first-of-type {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-upload span {
  color: var(--muted);
  line-height: 1.45;
}

.side-upload-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.metric span,
.advice li,
label {
  color: var(--muted);
}

.primary-button,
.ghost-button {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  color: var(--accent);
  background: #fff;
}

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

.content-grid {
  display: grid;
  grid-template-columns: 300px minmax(360px, 1fr) 360px;
  gap: 16px;
  margin-top: 16px;
}

.settings,
.preview,
.results {
  padding: 18px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-row label {
  display: block;
}

.inline-help-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfe2de;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--accent-dark);
  background: #f7fbf9;
  cursor: pointer;
  text-align: left;
}

.inline-help-button::after {
  content: "?";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.inline-help-button:hover,
.inline-help-button:focus-visible {
  border-color: #9ec8c0;
  background: #edf8f5;
  outline: none;
}

.inline-help-button span,
.inline-help-button small {
  grid-column: 1;
}

.inline-help-button span {
  font-weight: 700;
}

.inline-help-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.inline-help-button.secondary-help {
  border-color: #d8d2bd;
  background: #fffaf0;
  color: #6e4b00;
}

.inline-help-button.secondary-help::after {
  content: "SVG";
  width: 34px;
  border-radius: 999px;
  background: #a36500;
  font-size: 11px;
}

.inline-help-button.secondary-help:hover,
.inline-help-button.secondary-help:focus-visible {
  border-color: #c8a96b;
  background: #fff4d8;
}

.full {
  width: 100%;
}

.preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef0ed 25%, transparent 25%),
    linear-gradient(-45deg, #eef0ed 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef0ed 75%),
    linear-gradient(-45deg, transparent 75%, #eef0ed 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.info-card,
.workflow-card,
.delivery-card,
.fix-overview-card,
.print-size-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.info-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.info-grid span,
.small-note {
  color: var(--muted);
}

.info-grid strong {
  overflow-wrap: anywhere;
}

.side-info {
  background: #fbfcfa;
}

.side-info .info-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.side-info .info-grid div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid #edf0ec;
  padding: 9px 0 0;
}

.side-info .info-grid div:first-child {
  border-top: 0;
  padding-top: 0;
}

.side-info .info-grid strong {
  font-size: 14px;
  line-height: 1.4;
}

.compact-details {
  padding: 0;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.compact-details summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border: 1px solid transparent;
  padding: 14px 14px 14px 18px;
  cursor: pointer;
  list-style: none;
  background:
    linear-gradient(90deg, rgba(12, 116, 105, 0.16) 0 4px, transparent 4px),
    #fbfdfb;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.compact-details:hover {
  border-color: #b8d7d1;
  box-shadow: 0 10px 28px rgba(32, 36, 35, 0.08);
}

.compact-details summary:hover,
.compact-details summary:focus-visible {
  background:
    linear-gradient(90deg, var(--accent) 0 4px, transparent 4px),
    #f1faf7;
  outline: none;
}

.compact-details summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  justify-self: center;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

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

.compact-details summary::marker {
  content: "";
}

.compact-details summary span {
  min-width: 0;
}

.compact-details summary strong {
  display: block;
}

.compact-details summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.compact-details summary em {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border: 1px solid #b8d7d1;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--accent);
  background: #edf8f5;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.compact-details[open] summary em {
  color: #fff;
  background: var(--accent);
  font-size: 0;
}

.compact-details[open] summary em::before {
  content: attr(data-open);
  font-size: 13px;
}

.compact-details[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.compact-details[open] summary {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--accent) 0 4px, transparent 4px),
    #f7fbf9;
}

.details-body {
  padding: 16px 18px 18px;
}

.workflow-card {
  background: #fffdfa;
}

.workflow-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.workflow-card ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.workflow-card li {
  line-height: 1.55;
}

.delivery-card {
  background: #f8fbfb;
}

.delivery-card .details-body > p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.delivery-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.delivery-grid h3 {
  margin: 0;
  font-size: 15px;
}

.delivery-grid ul {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.delivery-grid li {
  line-height: 1.5;
}

.print-sim {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  touch-action: none;
  background: #fff;
}

.sim-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

#previewImage {
  z-index: 2;
}

.sim-actual {
  z-index: 1;
}

.sim-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 3;
}

.sim-slider {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: ew-resize;
  z-index: 4;
}

.sim-slider::-webkit-slider-runnable-track {
  background: transparent;
  height: 44px;
}

.sim-slider::-moz-range-track {
  background: transparent;
  height: 44px;
}

.sim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: ew-resize;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.sim-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: ew-resize;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.sim-tag {
  position: absolute;
  top: 10px;
  max-width: 46%;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.12s ease;
}

.sim-tag-left {
  left: 8px;
}

.sim-tag-right {
  right: 8px;
}

.sim-caption {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.empty-state {
  max-width: 250px;
  color: var(--muted);
  text-align: center;
}

#analysisCanvas {
  display: none;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.score-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 82px;
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  background: #707a75;
}

.score-band strong {
  font-size: 42px;
}

.score-band.green {
  background: var(--green);
}

.score-band.yellow {
  background: var(--amber);
}

.score-band.red {
  background: var(--red);
}

.report-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f7fbf9;
}

.report-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.metric-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.jump-fix {
  grid-column: 1 / -1;
}

.size-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.small-note {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.size-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.size-list strong {
  color: var(--ink);
  white-space: nowrap;
}

.metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.metric div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.metric span small {
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.75;
}

.metric strong {
  font-size: 18px;
}

.metric em {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: #f1f3f0;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.metric em.green {
  color: var(--green);
  background: #e6f4ed;
}

.metric em.yellow {
  color: var(--amber);
  background: #fff3dc;
}

.metric em.red {
  color: var(--red);
  background: #fdeaea;
}

.advice {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.advice ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.fix-card {
  scroll-margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfa;
}

.fix-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.fix-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.trust-note {
  border-left: 3px solid var(--accent);
  padding: 9px 11px;
  color: var(--muted);
  background: #edf8f5;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

.custom-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 22, 0.48);
}

.custom-modal-overlay[hidden] {
  display: none;
}

.custom-modal {
  position: relative;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid #cddbd7;
  border-radius: 8px;
  padding: 24px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(17, 24, 22, 0.24);
}

.modal-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  color: var(--accent-dark);
  border-color: #9ec8c0;
  background: #edf8f5;
  outline: none;
}

.modal-lead {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.vector-decision-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.vector-decision-grid h3 {
  margin: 0;
  font-size: 16px;
}

.vector-decision-grid ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.vector-modal-note {
  margin-top: 16px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 13px 14px;
  background: #edf8f5;
}

.vector-modal-note p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.guide-modal-content {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.guide-version-note {
  margin: 0;
  border-left: 3px solid #d7b45a;
  border-radius: 8px;
  padding: 10px 12px;
  color: #665224;
  background: #fff7dc;
  line-height: 1.55;
}

.guide-modal-content section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.guide-modal-content h3 {
  margin: 0;
  font-size: 16px;
}

.guide-modal-content ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.tool-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tool-dialog::backdrop {
  background: rgba(17, 24, 22, 0.5);
}

.tool-dialog form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

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

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.fix-detail ol,
.fix-overview {
  columns: 2;
  column-gap: 34px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.workflow-card ol {
  columns: 1;
}

.fix-overview-card {
  background: #fffdfa;
}

.fix-overview {
  columns: 1;
}

.fix-card li {
  break-inside: avoid;
  margin: 0 0 8px;
  line-height: 1.55;
}

.fix-actions {
  display: flex;
  justify-content: flex-end;
}

.fix-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.fix-tab {
  flex: 0 0 auto;
  max-width: min(72vw, 290px);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  color: var(--muted);
  background: #fff;
  font: inherit;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.fix-tab[aria-selected="true"] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.fix-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.fix-detail-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.fix-detail h3 {
  margin: 0;
  font-size: 20px;
}

.fix-detail ol {
  columns: 2;
}

.fix-extra-guides {
  border: 1px solid #dce8e5;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfb;
}

.fix-extra-guides[hidden] {
  display: none;
}

.fix-extra-guides p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.guide-chip {
  min-height: 34px;
  border: 1px solid #b8d7d1;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--accent-dark);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.guide-chip:hover,
.guide-chip:focus-visible {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}

.step-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-link {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.primary-link:hover {
  background: var(--accent-dark);
}

.primary-link.disabled {
  pointer-events: none;
  opacity: 0.45;
}

@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    min-height: 420px;
  }

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

  .fix-overview {
    columns: 1;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 14px;
  }

  .content-grid {
    gap: 12px;
  }

  .settings {
    order: 1;
  }

  .results {
    order: 2;
  }

  .preview {
    order: 3;
  }

  .settings,
  .preview,
  .results {
    padding: 14px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    padding: 22px 16px 16px;
  }

  .hero-notes {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .hero-copy p:last-child,
  .hero-notes {
    font-size: 14px;
  }

  .side-upload-actions button,
  .report-actions button,
  .fix-actions button,
  .fix-detail-heading button,
  .step-nav button {
    width: 100%;
    min-height: 44px;
  }

  .preview-frame {
    min-height: 280px;
  }

  .score-band {
    min-height: 72px;
  }

  .score-band strong {
    font-size: 38px;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }

  .fix-actions {
    justify-content: stretch;
  }

  .report-actions,
  .info-grid,
  .delivery-grid {
    grid-template-columns: 1fr;
  }

  .custom-modal-overlay {
    padding: 14px;
  }

  .custom-modal {
    max-height: calc(100vh - 28px);
    padding: 20px 16px 16px;
  }

  .vector-decision-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-actions button {
    width: 100%;
  }

  .guide-chip-list {
    flex-direction: column;
  }

  .guide-chip {
    width: 100%;
  }

  .compact-details summary {
    grid-template-columns: minmax(0, 1fr) auto 22px;
    gap: 9px;
  }

  .compact-details summary em {
    padding: 0 8px;
  }

  .fix-detail ol,
  .fix-overview {
    columns: 1;
  }

  .fix-heading {
    grid-template-columns: 1fr;
  }

  .fix-detail-heading,
  .step-nav {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }
}

.lang-switch {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch:hover {
  background: var(--accent);
  color: #fff;
}

.support-btn {
  display: inline-block;
  margin-top: 6px;
  margin-left: 8px;
  padding: 4px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.support-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
