:root {
  color: #040404;
  background: #fff;
  font-family: "Roboto", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #6299ff;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.craft-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 460px;
  background: #fff;
  overflow: hidden;
}

.canvas-mark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #777;
}

.canvas-mark::after {
  content: "";
  position: absolute;
  top: 1.5px;
  left: 3px;
  width: 45px;
  height: 1px;
  transform-origin: left center;
  background: #bababa;
}

.canvas-mark-right {
  top: 30%;
  right: 24px;
}

.canvas-mark-right::after {
  transform: rotate(39deg);
}

.canvas-mark-bottom {
  left: 72.7%;
  bottom: 17px;
}

.canvas-mark-bottom::after {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
  opacity: 1;
  visibility: visible;
  transition: opacity 140ms ease, visibility 140ms ease;
}

.modal-layer.is-closed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.settings-modal {
  position: relative;
  width: 450px;
  min-height: 437px;
  padding: 20px;
  border: 1px solid #d9d9d9;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
  transform: translateY(0);
  transition: transform 140ms ease;
}

.modal-layer.is-closed .settings-modal {
  transform: translateY(6px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 23px;
}

.tab-list {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.tab {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: #888;
  font-size: 19px;
  font-weight: 400;
  line-height: 23px;
  cursor: pointer;
  transition: color 120ms ease;
}

.tab:hover,
.tab.is-active {
  color: #040404;
}

.tab-divider {
  margin: 0 13px;
  color: #d4d4d4;
  font-size: 20px;
  font-weight: 400;
  line-height: 23px;
  transform: skewX(-16deg);
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 3px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #9d9d9d;
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}

.close-button:hover {
  color: #555;
  transform: scale(1.06);
}

.close-button svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.45;
}

.tab-panel {
  margin-top: 10px;
}

.account-row {
  display: flex;
  width: 408px;
  height: 53px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: linear-gradient(0deg, #fafafa 0, #fff 100%);
}

.account-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.account-kicker,
.account-message {
  display: block;
  white-space: nowrap;
}

.account-kicker {
  color: #737373;
  font-size: 13px;
  font-weight: 600;
  line-height: 15px;
}

.account-message {
  color: #3e3e3e;
  font-size: 13px;
  font-weight: 500;
  line-height: 15px;
}

.login-button {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  background: #6299ff;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 15px;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.login-button:hover {
  background: #4f8bfb;
}

.login-button:active {
  transform: translateY(1px);
}

.save-list {
  margin-top: 10px;
}

.save-card {
  position: relative;
  display: flex;
  width: 408px;
  height: 95px;
  margin: 0 0 5px;
  padding: 0 14px 0 25px;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color 120ms ease, background 160ms ease;
}

.save-card:last-child {
  margin-bottom: 0;
}

.save-card:hover {
  border-color: #c8c8c8;
}

.save-card.is-selected {
  background: linear-gradient(0deg, #d6fcff 50%, #fff 90%);
}

.save-copy {
  min-width: 0;
  transform: translateY(-1px);
}

.save-name-row {
  display: flex;
  height: 24px;
  align-items: center;
}

.save-name-input {
  position: relative;
  width: 64px;
  height: 23.5px;
  margin: 0 0 -1px;
  padding: 2px 3px 0 1px;
  border: 0;
  background: transparent;
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 19px;
  font-weight: 400;
  line-height: normal;
  cursor: inherit;
}

.save-name-input.is-editing {
  width: 142px;
  border-bottom: 1px solid #6299ff;
  cursor: text;
}

.edit-button {
  display: grid;
  width: 22px;
  height: 24px;
  margin-left: 0;
  padding: 4px;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.edit-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #000;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.save-status {
  margin-top: 3px;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
}

.save-card.is-selected .save-status {
  color: #596c70;
}

.actions-button {
  position: absolute;
  right: 11px;
  bottom: 18px;
  display: grid;
  width: 35px;
  height: 26px;
  padding: 7px 9px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.actions-button:hover,
.actions-button[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.045);
}

.actions-button svg {
  width: 19px;
  height: 5px;
  overflow: visible;
  fill: #5f5f5f;
}

.actions-menu {
  position: absolute;
  right: 12px;
  bottom: 43px;
  z-index: 3;
  width: 112px;
  padding: 5px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.13);
}

.actions-menu[hidden] {
  display: none;
}

.menu-action {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #333;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.menu-action:hover {
  background: #f2f2f2;
}

.menu-action.is-danger {
  color: #bd3131;
}

.controls-panel,
.about-panel {
  min-height: 354px;
  padding-top: 1px;
}

.controls-list {
  margin: 0;
}

.controls-list > div {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  min-height: 52px;
  padding: 0 14px;
  align-items: center;
  border-bottom: 1px solid #ededed;
}

.controls-list > div:last-child {
  border-bottom: 0;
}

.controls-list dt,
.controls-list dd {
  margin: 0;
  font-size: 14px;
}

.controls-list dt {
  color: #666;
}

.controls-list dd {
  color: #151515;
  font-weight: 500;
  text-align: right;
}

.about-panel {
  padding: 22px 15px;
  color: #4a4a4a;
  font-size: 15px;
  line-height: 1.55;
}

.about-panel p {
  margin: 0 0 18px;
}

.about-panel a {
  color: #397cec;
  font-weight: 500;
}

.open-settings {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 9px 14px;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 9px 13px;
  border-radius: 8px;
  background: rgba(24, 24, 24, 0.92);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 500px), (max-height: 470px) {
  .craft-canvas {
    min-height: 100%;
  }

  .modal-layer {
    padding: 12px;
    overflow: auto;
  }

  .settings-modal {
    width: min(450px, 100%);
    min-height: 0;
    margin: auto;
    padding: 17px;
  }

  .account-row,
  .save-card {
    width: 100%;
  }

  .tab {
    font-size: clamp(16px, 4.7vw, 19px);
  }

  .tab-divider {
    margin-inline: clamp(7px, 2.6vw, 13px);
  }

  .account-message {
    overflow: hidden;
    max-width: calc(100vw - 155px);
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
