@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");
:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #171b1f;
  --inner: #121619;
  --line: #2b3239;
  --muted: #85919b;
  --text: #e9eef2;
  --accent: #22b0e5;
  --green: #30d896;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.5 Barlow,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
.filebutton {
  cursor: pointer;
  border: 1px solid #35444e;
  border-radius: 6px;
  background: #1b252d;
  color: #b8cbd7;
  padding: 9px 14px;
  transition: 0.15s;
  text-align: center;
}
button:hover,
.filebutton:hover {
  border-color: var(--accent);
  background: #203845;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  background: #101619;
  border: 1px solid #35414b;
  border-radius: 6px;
  color: var(--text);
}
select {
  cursor: pointer;
}
label {
  display: block;
  color: #a8bac6;
  font-size: 14px;
}
label input,
label select {
  margin-top: 7px;
}
input:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a {
  color: #75d1f2;
}
small,
.helper {
  font-size: 14px;
  color: var(--muted);
}
small {
  display: block;
}
.helper {
  line-height: 1.6;
  margin: 12px 0 0;
}
.sidebar {
  width: 218px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  background: #0e1113;
  padding: 32px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  padding: 0 16px 35px;
}
.brand b {
  font: 700 42px/1 Barlow;
  letter-spacing: -2px;
  color: #e5f3fa;
}
.brand > span {
  display: block;
  letter-spacing: 3px;
  font-weight: 600;
  font-size: 20px;
  margin-top: 10px;
}
.brand small {
  font-size: 11px;
  letter-spacing: 1.8px;
  color: #687680;
  margin-top: 5px;
}
nav {
  display: grid;
  gap: 7px;
}
nav button {
  display: flex;
  gap: 12px;
  align-items: center;
  background: transparent;
  border: 0;
  color: #8a98a3;
  text-align: left;
  padding: 13px 11px;
}
nav button.active {
  background: #132832;
  color: #60c9ee;
  box-shadow: inset 2px 0 var(--accent);
}
.sidefoot {
  margin-top: auto;
  padding-top: 45px;
  display: grid;
  gap: 12px;
}
.sidefoot strong {
  font-size: 14px;
  font-weight: 500;
}
.sidefoot small {
  font-size: 12px;
}
.sidefoot button,
.sidefoot .filebutton {
  font-size: 13px;
}
main {
  margin-left: 218px;
  padding: 35px;
  max-width: 1800px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}
.eyebrow {
  color: #6dccee;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 600;
}
h1 {
  font-size: 29px;
  line-height: 1.2;
  font-weight: 500;
  margin: 9px 0;
}
header p {
  color: var(--muted);
  margin: 0;
}
h2 {
  font-size: 19px;
  font-weight: 500;
  margin: 0 0 20px;
}
.actions,
.row,
.heading {
  display: flex;
  gap: 14px;
  align-items: center;
}
.heading {
  justify-content: space-between;
  margin-bottom: 18px;
}
.heading h2 {
  margin: 0;
}
.heading button {
  font-size: 14px;
}
.primary {
  background: #163e50;
  border-color: #2c8cad;
  color: #a3e7ff;
}
.primary:hover {
  background: #1b536a;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
}
.editor {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.grid > label span {
  display: block;
  color: #687e8b;
  font-size: 12px;
  margin-top: 5px;
}
.row > label {
  flex: 1;
}
.grow {
  flex: 1;
}
.upload {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 17px;
  border: 1px dashed #365362;
  border-radius: 7px;
  background: #121e25;
  margin-top: 22px;
}
.upload strong {
  font-weight: 500;
}
.upload small {
  margin-top: 5px;
}
.filebutton {
  display: block;
  white-space: nowrap;
  font-size: 14px;
}
details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
summary {
  cursor: pointer;
  color: #87cbe5;
}
details button {
  margin-top: 16px;
}
.material-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 15px;
}
.material-row button {
  padding: 10px 0;
}
.result {
  align-self: start;
  position: sticky;
  top: 24px;
  display: grid;
  gap: 20px;
}
.price-card {
  border: 1px solid #305365;
  background:
    radial-gradient(ellipse at 70% 0, #20374699, transparent 70%), #111b22;
  padding: 27px;
  border-radius: 10px;
}
.price {
  font:
    500 36px/1.3 "IBM Plex Mono",
    monospace;
  margin: 16px 0 0;
  color: #a4e7ff;
  letter-spacing: -1px;
}
.price-card > p {
  margin: 7px 0 24px;
  color: #899eac;
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  border-top: 1px solid #2c3c48;
  padding-top: 20px;
}
.stats strong {
  display: block;
  font:
    500 18px "IBM Plex Mono",
    monospace;
  margin-top: 8px;
}
.stats div:last-child strong {
  color: var(--green);
}
.bar {
  height: 7px;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 25px;
  background: #293742;
}
.bar i:nth-child(1) {
  background: #4d839c;
}
.bar i:nth-child(2) {
  background: #8d9bb5;
}
.bar i:nth-child(3) {
  background: #30d896;
}
.legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8a9da8;
  margin: 8px 0 25px;
}
.full {
  width: 100%;
}
.costline,
.total {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 7px 0;
  font-size: 14px;
}
.costline span {
  color: #92a6b3;
}
.costline strong {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 400;
}
.total {
  border-top: 1px solid #30414d;
  margin-top: 10px;
  padding-top: 14px;
}
.anatomy > small {
  margin-top: 18px;
}
.printer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 25px;
}
.printer-card {
  border: 1px solid #30414d;
  padding: 21px;
  border-radius: 8px;
  background: #12191e;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 10px;
}
.printer-card h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}
.printer-card p {
  font-size: 14px;
  margin: 0;
  color: #94aaba;
}
.printer-card button {
  margin-top: auto;
}
.printer-card a {
  font-size: 13px;
}
.hidden {
  display: none !important;
}
.prose {
  max-width: 1000px;
}
.prose h2 {
  margin-top: 28px;
}
.prose li {
  margin-bottom: 12px;
}
.prose p {
  color: #a7bac6;
}
dialog {
  background: #171f26;
  color: var(--text);
  border: 1px solid #385466;
  border-radius: 10px;
  max-width: 570px;
  width: calc(100% - 35px);
  padding: 25px;
}
dialog::backdrop {
  background: #000a;
}
dialog label {
  margin-bottom: 18px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #183e50;
  color: #c4efff;
  border: 1px solid #3284a5;
  border-radius: 8px;
  padding: 12px 20px;
  max-width: 90%;
  z-index: 20;
  display: none;
}
.error {
  color: #ffba8c !important;
}
.saved {
  margin-bottom: 16px;
}
.saved .heading {
  flex-wrap: wrap;
}
.saved p {
  color: #859ba9;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1150px) {
  main {
    padding: 25px;
  }
  .sidebar {
    width: 180px;
    padding: 25px 12px;
  }
  main {
    margin-left: 180px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
  }
  .panel {
    padding: 19px;
  }
  .price-card {
    padding: 20px;
  }
  .price {
    font-size: 30px;
  }
  .printer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .actions {
    flex-direction: column;
    gap: 7px;
  }
  .upload {
    flex-direction: column;
    align-items: start;
  }
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .result {
    position: static;
  }
  .printer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 650px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 0 0 15px;
    display: flex;
    gap: 12px;
    align-items: center;
  }
  .brand b {
    font-size: 27px;
  }
  .brand > span {
    margin: 0;
    font-size: 18px;
  }
  .brand small {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 3px;
  }
  nav button {
    font-size: 13px;
    padding: 9px;
    white-space: nowrap;
  }
  .sidefoot {
    display: none;
  }
  main {
    margin: 0;
    padding: 20px 14px;
  }
  header {
    align-items: start;
  }
  h1 {
    font-size: 24px;
  }
  .actions button {
    font-size: 13px;
  }
  .grid {
    gap: 14px;
  }
  .row {
    flex-wrap: wrap;
  }
  .row > label {
    min-width: 140px;
  }
  .panel {
    padding: 18px;
  }
  .material-row {
    grid-template-columns: 1fr 1fr;
  }
  .material-row > label:first-child {
    grid-column: 1/-1;
  }
  .material-row button {
    grid-column: 1/-1;
  }
  .printer-grid {
    grid-template-columns: 1fr;
  }
}
@media print {
  .sidebar,
  .actions,
  .upload,
  .filebutton,
  button,
  #toast,
  details,
  #actualPrice,
  #importStatus {
    display: none !important;
  }
  main {
    margin: 0;
    padding: 0;
  }
  .workspace {
    display: block;
  }
  .result {
    position: static;
  }
  .editor .panel {
    break-inside: avoid;
  }
  .panel,
  .price-card {
    background: white;
    color: black;
    border-color: #aaa;
    margin-bottom: 12px;
  }
  .hidden {
    display: none !important;
  }
  body,
  input,
  select {
    background: white;
    color: black;
  }
  small,
  .helper,
  label,
  p {
    color: #444 !important;
  }
  .price,
  .stats strong {
    color: black !important;
  }
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  header {
    margin-bottom: 15px;
  }
}

.brand img {
  display: block;
  width: 132px;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
@media (max-width: 650px) {
  .brand img {
    width: 90px;
  }
}
@media (max-width: 650px) {
  .sidefoot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    align-items: center;
  }
  .sidefoot > strong,
  .sidefoot > small {
    display: none;
  }
  .sidefoot button,
  .sidefoot .filebutton {
    padding: 6px 9px;
    font-size: 12px;
  }
}

.material-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.material-row button {
  grid-column: 1 / -1;
  justify-self: end;
  padding: 6px 12px;
}
@media (max-width: 650px) {
  .material-row > label:first-child {
    grid-column: auto;
  }
}

.printer-brand {
  margin-top: 30px;
}
.printer-brand > h3 {
  margin: 0 0 14px;
  color: #87cbe5;
  font-size: 20px;
  font-weight: 500;
}
.printer-brand .printer-grid {
  margin-top: 0;
}
