/* Shared component styles (extracted from the editor) */
.ic {
  flex: 0 0 auto;
  display: block;
}
kbd {
  font: 600 10.5px/1 var(--font);
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--tx2);
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  white-space: nowrap;
}
[data-tip] {
  position: relative;
}
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  font: 500 11.5px/1.3 var(--font);
  padding: 6px 9px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: tipIn 0.14s ease 0.35s both;
}
[data-tip-pos='right']:hover::after {
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}
@keyframes tipIn {
  from {
    opacity: 0;
    translate: 0 -3px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--tx2);
  cursor: pointer;
  font-weight: 550;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.btn:hover {
  background: var(--bg3);
  color: var(--tx);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.btn.is-icon {
  width: 32px;
  padding: 0;
}
.btn.s-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}
.btn.s-sm.is-icon {
  width: 28px;
  padding: 0;
}
.btn.is-on {
  background: var(--acbg);
  color: var(--ac2);
}
.b-primary {
  background: var(--acb, #0e7490);
  color: var(--ink, #ffffff);
  border-color: transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 6px 16px -6px var(--acln);
}
.b-primary:hover {
  background: var(--acb2, #155e75);
  color: var(--ink, #ffffff);
}
.b-outline {
  border-color: var(--line2);
  color: var(--tx);
}
.b-outline:hover {
  border-color: var(--tx3);
  background: var(--bg2);
}
.b-soft {
  background: var(--acbg);
  color: var(--ac2);
}
.b-soft:hover {
  background: var(--acb, #0e7490);
  color: var(--ink, #ffffff);
}
.b-danger {
  background: rgba(255, 92, 122, 0.12);
  color: var(--err);
}
.b-danger:hover {
  background: var(--err);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}
.spin {
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rot 0.7s linear infinite;
  opacity: 0.8;
}
@keyframes rot {
  to {
    transform: rotate(360deg);
  }
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
  padding: 0 10px;
  height: 36px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx3);
  transition: border-color 0.15s;
}
.search:focus-within {
  border-color: var(--ac);
  color: var(--tx2);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  height: 100%;
}
.search button {
  border: 0;
  background: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 0;
  display: flex;
}
.search.sm {
  margin: 0 0 8px;
  height: 32px;
}
body.is-scrubbing,
body.is-scrubbing * {
  cursor: ew-resize !important;
  user-select: none;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b91a3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  padding-right: 26px !important;
  cursor: pointer;
}
textarea.code {
  font: 12px/1.55 var(--mono);
  tab-size: 2;
  min-height: 110px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg0);
  color: var(--tx);
  outline: none;
  resize: vertical;
}
textarea.code:focus {
  border-color: var(--ac);
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--tx2);
}
.empty b {
  font-size: 13px;
  color: var(--tx);
}
.empty p {
  margin: 0;
  font-size: 12px;
  color: var(--tx3);
  line-height: 1.5;
  max-width: 240px;
}
.empty-ic {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--bg2);
  color: var(--tx3);
}
.seg {
  display: inline-flex;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
  max-width: 100%;
  flex-wrap: wrap;
}
.seg.is-full {
  display: flex;
  width: 100%;
}
.seg.is-full button {
  flex: 1;
}
.seg button {
  border: 0;
  background: none;
  color: var(--tx3);
  border-radius: 4px;
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.12s;
  flex: 1 1 auto;
  min-width: 28px;
}
.seg.s-sm button {
  height: 24px;
  padding: 0 7px;
}
.seg button.has-ic {
  padding: 0;
  width: 30px;
  flex: 0 0 30px;
}
.seg button:hover {
  color: var(--tx);
}
.seg button.is-on {
  background: var(--bg4);
  color: var(--tx);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
[data-theme='light'] .seg button.is-on {
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 24, 40, 0.15);
}
.sw {
  width: 34px;
  height: 20px;
  border-radius: 99px;
  border: 0;
  background: var(--bg4);
  position: relative;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: background 0.2s;
}
.sw i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.6, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.sw.is-on {
  background: var(--ac);
}
.sw.is-on i {
  transform: translateX(14px);
}
.unit {
  display: flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  overflow: hidden;
  transition: border-color 0.15s;
  min-width: 0;
}
.unit:focus-within {
  border-color: var(--ac);
  background: var(--bg1);
}
.unit input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0 !important;
  background: none !important;
  padding: 0 8px !important;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.unit-u {
  flex: 0 0 auto;
  height: 100%;
  border: 0 !important;
  border-left: 1px solid var(--line) !important;
  background: none !important;
  color: var(--tx3);
  font-size: 11px;
  font-weight: 600;
  padding: 0 18px 0 6px !important;
  background-position: right 4px center !important;
  width: auto !important;
  border-radius: 0 !important;
}
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 40px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ac) var(--p, 0%), var(--bg4) var(--p, 0%));
  outline: none;
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow:
    0 0 0 3px var(--ac),
    0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: grab;
}
input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 3px var(--ac);
}
.pop {
  position: fixed;
  z-index: 1500;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  padding: 10px;
  animation: popIn 0.14s ease;
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.menu {
  position: fixed;
  z-index: 1600;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  padding: 5px;
  animation: popIn 0.12s ease;
}
.menu-h {
  padding: 7px 10px 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-i {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--tx);
  cursor: pointer;
  text-align: left;
  font-size: 12.5px;
}
.menu-i span {
  flex: 1;
}
.menu-i .ic {
  color: var(--tx3);
}
.menu-i kbd {
  font-size: 10px;
  padding: 2px 5px;
}
.menu-i:hover,
.menu-i.is-hi {
  background: var(--bg3);
}
.menu-i.is-danger {
  color: var(--err);
}
.menu-i.is-danger .ic {
  color: var(--err);
}
.menu-i:disabled {
  opacity: 0.4;
}
.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 2px;
}
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(5, 6, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-wrap.is-top {
  align-items: flex-start;
  padding-top: 12vh;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.modal {
  max-width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--bg1);
  border-radius: 4px;
  box-shadow: var(--sh-pop);
  animation: modalIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
.modal-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-h h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}
.modal-ic {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--acbg);
  color: var(--ac2);
}
.modal-b {
  padding: 18px;
  overflow-y: auto;
  line-height: 1.6;
  color: var(--tx2);
}
.modal-b p {
  margin: 0 0 12px;
}
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.lbl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 14px;
}
.hint {
  font-size: 12px;
  color: var(--tx3);
}
.err {
  color: var(--err);
  font-size: 12px;
}
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  border: 1.5px dashed var(--line2);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  color: var(--tx2);
}
.drop:hover {
  border-color: var(--ac);
  background: var(--acbg);
}
.drop .ic {
  color: var(--ac2);
}
.drop span {
  font-size: 12px;
  color: var(--tx3);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
}
