.mobile-action-debug::before {
  content: "<>";
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -1px;
}

.mobile-debug-dialog {
  width: min(520px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: #f8f7f4;
  color: #242623;
  box-shadow: 0 24px 80px rgb(25 28 27 / 22%);
}

.mobile-debug-dialog::backdrop {
  background: rgb(25 28 27 / 38%);
  backdrop-filter: blur(3px);
}

.mobile-debug-page {
  min-height: 520px;
}

.mobile-debug-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.mobile-debug-intro {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid #eadeda;
  border-radius: 16px;
  background: #fffaf8;
}

.mobile-debug-intro > span {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #a43c31;
  color: #fff;
  font-size: 21px;
  font-weight: 650;
}

.mobile-debug-intro strong,
.mobile-debug-intro p {
  display: block;
  margin: 0;
}

.mobile-debug-intro strong {
  font-size: 15px;
  font-weight: 650;
}

.mobile-debug-intro p {
  margin-top: 3px;
  color: #747872;
  font-size: 12px;
}

.mobile-debug-field {
  display: grid;
  gap: 8px;
}

.mobile-debug-field > span,
.mobile-debug-current > span {
  color: #686c67;
  font-size: 12px;
  font-weight: 600;
}

.mobile-debug-field input {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #d9dad6;
  border-radius: 13px;
  outline: 0;
  background: #fff;
  color: #202321;
  font: inherit;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.mobile-debug-field input:focus {
  border-color: #a43c31;
  box-shadow: 0 0 0 3px rgb(164 60 49 / 11%);
}

.mobile-debug-help {
  margin: -10px 1px 0;
  color: #878a85;
  font-size: 11.5px;
  line-height: 1.55;
}

.mobile-debug-help code {
  color: #6d423d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mobile-debug-current {
  display: grid;
  gap: 5px;
  padding: 14px 15px;
  border-radius: 13px;
  background: #efefec;
}

.mobile-debug-current strong {
  overflow: hidden;
  color: #313431;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-debug-tools {
  overflow: hidden;
  border: 1px solid #dededa;
  border-radius: 14px;
  background: #fff;
}

.mobile-debug-switch,
.mobile-debug-trace-link {
  box-sizing: border-box;
  width: 100%;
  min-height: 62px;
  padding: 12px 14px;
}

.mobile-debug-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #ecece8;
}

.mobile-debug-switch > span,
.mobile-debug-trace-link > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-align: left;
}

.mobile-debug-switch strong,
.mobile-debug-trace-link strong {
  color: #292c29;
  font-size: 14px;
  font-weight: 620;
}

.mobile-debug-switch small,
.mobile-debug-trace-link small {
  overflow: hidden;
  color: #7d817b;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-debug-switch input {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #d7d8d4;
  cursor: pointer;
  transition: background 150ms ease;
}

.mobile-debug-switch input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  content: "";
  transition: transform 150ms ease;
}

.mobile-debug-switch input:checked {
  background: #a43c31;
}

.mobile-debug-switch input:checked::after {
  transform: translateX(18px);
}

.mobile-debug-switch input:focus-visible {
  outline: 3px solid rgb(164 60 49 / 18%);
  outline-offset: 2px;
}

.mobile-debug-trace-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.mobile-debug-trace-link b {
  color: #999c96;
  font-size: 22px;
  font-weight: 400;
}

.mobile-debug-trace-link:disabled {
  cursor: default;
  opacity: .5;
}

.mobile-debug-status {
  margin: 0;
  padding: 11px 13px;
  border-radius: 11px;
  background: #eef3ed;
  color: #356143;
  font-size: 12px;
  line-height: 1.5;
}

.mobile-debug-status.is-error {
  background: #f8eae7;
  color: #9a3129;
}

.mobile-debug-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 4px;
}

.mobile-debug-actions button {
  min-height: 46px;
  border: 1px solid #d9d8d3;
  border-radius: 13px;
  background: #fff;
  color: #343734;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.mobile-debug-actions button[type="submit"] {
  border-color: #a43c31;
  background: #a43c31;
  color: #fff;
}

.mobile-debug-actions button:disabled {
  opacity: .55;
}

@media (max-width: 760px) {
  body.tool-debug-enabled .tool-debug-card,
  body.tool-debug-enabled .trace-line {
    display: block !important;
  }

  .mobile-debug-dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .mobile-debug-dialog::backdrop {
    background: #f8f7f4;
  }

  .mobile-debug-page {
    min-height: 100%;
    padding-top: env(safe-area-inset-top);
    background: #f8f7f4;
  }

  .mobile-debug-form {
    gap: 17px;
    width: min(100%, 520px);
    box-sizing: border-box;
    margin: 0 auto;
    padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  }
}
