[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #17202a;
  --muted: #606b79;
  --line: #dfe5ef;
  --accent: #1b67e8;
  --accent-dark: #0f50bc;
  --accent-soft: #eef4ff;
  --warm: #f79b07;
  --warm-dark: #d97706;
  --warm-soft: #fff4df;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --success: #137333;
  --shadow: 0 20px 48px rgba(22, 34, 56, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(247, 155, 7, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(27, 103, 232, 0.14), transparent 26%),
    linear-gradient(180deg, #f8f6f1 0%, #f4f7fb 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 42px auto 70px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--warm-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  color: #142746;
}

.hero p {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.card,
.result-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(208, 219, 234, 0.95);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.card {
  padding: 30px;
}

section + section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid rgba(216, 225, 235, 0.9);
}

.section-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.section-title h2 {
  margin-bottom: 3px;
  font-size: 1.22rem;
  color: #17315a;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.step {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff5df 0%, #ffe8bb 100%);
  color: var(--warm-dark);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(247, 155, 7, 0.15);
}

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

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

.grid.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
}

.field {
  display: block;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid #cfd8e5;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(27, 103, 232, 0.12);
}

.input-prefix,
.input-suffix {
  display: flex;
  align-items: center;
  border: 1px solid #cfd8e5;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-prefix:focus-within,
.input-suffix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(27, 103, 232, 0.12);
}

.input-prefix > span,
.input-suffix > span {
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.input-prefix input,
.input-suffix input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.input-prefix input:focus,
.input-suffix input:focus {
  box-shadow: none;
}

.nested {
  flex: 1;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  padding: 0 22px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: none;
  filter: none;
  backdrop-filter: none;
  transition: transform 0.14s ease, background-color 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:hover,
button:focus,
button:focus-visible,
button:active {
  box-shadow: none;
  filter: none;
  backdrop-filter: none;
}

.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #2d72ef 100%);
  color: #fff;
}

.primary:hover {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
}

.secondary {
  background: var(--warm-soft);
  color: #8a4b00;
  border: 1px solid #ffd79a;
}

.error {
  margin-top: 24px;
  border: 1px solid #f4b4ae;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 14px;
  font-weight: 650;
}

.result-card {
  margin-top: 24px;
  padding: 30px;
}
.note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.build-date {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}
body.login-open {
  overflow: hidden;
}

.app-locked {
  visibility: hidden;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(247, 155, 7, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(27, 103, 232, 0.16), transparent 32%),
    linear-gradient(180deg, #f8f6f1 0%, #f1f5fb 100%);
}

.login-gate[hidden] {
  display: none;
}

.login-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 440px);
  padding: 32px;
  border: 1px solid rgba(208, 219, 234, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(22, 34, 56, 0.15);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--warm) 0%, #ffcb3b 28%, var(--accent) 70%, #5891ff 100%);
}

.login-logo {
  display: block;
  width: calc(100% + 64px);
  max-width: none;
  height: auto;
  margin: -32px -32px 30px;
  padding: 34px 88px 30px;
  object-fit: contain;
  border-radius: 0;
  background:
    radial-gradient(circle at 28% 20%, rgba(27, 103, 232, 0.20), transparent 38%),
    linear-gradient(180deg, #082650 0%, #061f43 100%);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--warm) 0%, #ffb800 35%, var(--accent) 100%) 1;
  box-shadow: none;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 7vw, 2.5rem);
}

.login-card p {
  margin-bottom: 22px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

.password-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid #cfd8e5;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.password-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(27, 103, 232, 0.12);
}

.password-wrap input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
}

.password-wrap input:focus {
  box-shadow: none;
}

.password-toggle {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 0;
  background: var(--warm-soft);
  color: var(--warm-dark);
  font-size: 0.84rem;
  border-left: 1px solid #ffd79a;
}

.login-button {
  width: 100%;
}

.login-error {
  margin-top: -4px;
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-with-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.lock-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #ffd79a;
  background: var(--warm-soft);
  color: #8a4b00;
  font-size: 0.85rem;
}

.lock-button:hover {
  background: #ffedca;
  color: #6d3900;
}

/* Conversor */

select {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid #cfd8e5;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(27, 103, 232, 0.12);
}

.subhead {
  margin: 22px 0 10px;
  font-size: 0.95rem;
  color: #17315a;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.drop-zone {
  display: grid;
  gap: 4px;
  place-items: center;
  padding: 34px 20px;
  border: 2px dashed #cfd8e5;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.drop-zone strong {
  color: #17315a;
  font-size: 1.05rem;
  word-break: break-all;
}

.drop-zone span {
  color: var(--muted);
  font-size: 0.9rem;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.drop-zone.loaded {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  place-items: center stretch;
  padding: 12px 16px;
  border-style: solid;
  border-width: 1px;
  text-align: left;
}

.drop-file {
  display: grid;
  min-width: 0;
}

.drop-zone .drop-file span {
  font-size: 0.82rem;
}

.drop-zone .drop-change {
  padding: 6px 12px;
  border: 1px solid rgba(210, 222, 236, 0.95);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.status {
  margin-top: 12px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.92rem;
}

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

.info-box,
.selected-printer {
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9ff 100%);
  border: 1px solid rgba(216, 225, 235, 0.9);
  padding: 14px 16px;
}

.info-box > span,
.selected-printer > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.info-box > strong,
.selected-printer > strong {
  display: block;
  color: #17315a;
  font-size: 1rem;
  word-break: break-word;
}

.info-box > small,
.selected-printer > small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.selected-printer {
  margin-bottom: 18px;
  background: linear-gradient(90deg, rgba(238, 244, 255, 0.95) 0%, rgba(255, 244, 223, 0.92) 100%);
}

.swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(23, 32, 42, 0.18);
  vertical-align: middle;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.filament-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filament-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.filament-chip {
  padding: 8px 12px;
  border: 1px solid rgba(210, 222, 236, 0.95);
  border-radius: 12px;
  background: #fff;
}

.filament-list.compact {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.filament-list.compact .filament-chip {
  padding: 0;
  border: 0;
  background: none;
}

.plates-box {
  margin-top: 12px;
}

.plates-box .plates {
  margin-top: 8px;
}

.filament-chip.unused {
  opacity: 0.55;
}

.filament-chip strong {
  display: block;
  font-size: 0.9rem;
}

.filament-chip small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-word;
}

.plates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.plate {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(210, 222, 236, 0.95);
  border-radius: 14px;
  background: #fff;
}

.plate img,
.plate-empty {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f4f9;
}

.plate-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.plate strong {
  display: block;
  color: #17315a;
  font-size: 0.92rem;
}

.plate small {
  color: var(--muted);
  font-size: 0.8rem;
}

.printer-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  max-height: 380px;
  margin-top: 16px;
  padding: 2px;
  overflow-y: auto;
}

.printer-item {
  display: block;
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid rgba(210, 222, 236, 0.95);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 400;
}

.printer-item strong {
  display: block;
  color: #17315a;
  font-size: 0.94rem;
}

.printer-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.printer-item:hover {
  border-color: #9fbdf3;
  background: var(--accent-soft);
}

.printer-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.diff-table {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.diff-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(210, 222, 236, 0.95);
  border-radius: 12px;
  background: #fff;
}

.diff-head {
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.diff-option {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(210, 222, 236, 0.95);
  border-radius: 10px;
  cursor: pointer;
}

.diff-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.diff-option input {
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}

.diff-option > span {
  min-width: 0;
}

.diff-option small {
  display: none;
  color: var(--muted);
  font-size: 0.75rem;
}

.diff-option b {
  display: block;
  font-size: 0.9rem;
  word-break: break-word;
}

.change-name strong {
  display: block;
  font-size: 0.92rem;
}

.change-name code {
  color: var(--muted);
  font-size: 0.78rem;
}

.change-name small {
  display: block;
  margin-top: 2px;
  color: var(--warm-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.diff-row.incompatible {
  border-color: #ffd79a;
  background: var(--warm-soft);
}

.diff-problem {
  display: block;
  margin-top: 4px;
  color: #8a4b00;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 700;
}

.warning {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #ffd79a;
  border-radius: 10px;
  background: var(--warm-soft);
  color: #8a4b00;
  font-weight: 650;
  font-size: 0.92rem;
}

.result-card h2 {
  margin-bottom: 4px;
  color: #17315a;
}

.result-card #resultText {
  color: var(--muted);
  word-break: break-all;
}

.result-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
}

.result-list li {
  margin: 6px 0;
}

.result-list .swatch {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 5px;
}

.summary-hint {
  margin: -4px 0 12px;
}

.summary-grid {
  border: 1px solid rgba(216, 225, 235, 0.95);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.summary-group > strong {
  display: block;
  padding: 10px 14px 6px;
  border-top: 1px solid rgba(216, 225, 235, 0.95);
  background: #f8fafd;
  color: #17315a;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid rgba(232, 237, 244, 0.95);
  font-size: 0.9rem;
}

.cols-2 .summary-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
}

.summary-row > span:not(:first-child) {
  font-weight: 750;
  text-align: right;
  word-break: break-word;
}

.summary-head {
  border-top: 0;
  background: #eef4ff;
  color: #17315a;
  font-weight: 800;
}

.summary-head > span:not(:first-child) {
  font-weight: 800;
}

.summary-row.diff > span:last-child {
  color: var(--muted);
}

.summary-row.author-diff {
  background: var(--warm-soft);
}

.summary-row.author-diff > span:last-child {
  color: var(--warm-dark);
}

.summary-row .tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

@media (max-width: 820px) {
  .grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

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

  .diff-row .change-name {
    grid-column: 1 / -1;
  }

  .diff-head {
    display: none;
  }

  .diff-option small {
    display: block;
  }
}

@media (max-width: 700px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(247, 155, 7, 0.12), transparent 28%),
      radial-gradient(circle at top right, rgba(27, 103, 232, 0.12), transparent 28%),
      #f8f6f1;
  }

  .container {
    width: 100%;
    margin: 0 auto;
    padding: 16px 12px 36px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 0.94rem;
  }

  .card,
  .result-card {
    padding: 18px 14px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(22, 34, 56, 0.08);
  }

  section + section {
    margin-top: 24px;
    padding-top: 24px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
    min-height: 50px;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .login-logo {
    width: calc(100% + 40px);
    margin: -24px -20px 26px;
    padding: 30px 66px 26px;
  }
}

@media (max-width: 430px) {
  .hero-with-actions {
    flex-direction: column;
  }

  .printer-list {
    grid-template-columns: 1fr;
  }

  .login-logo {
    padding-left: 48px;
    padding-right: 48px;
  }
}
