.mk-sw-tab,
.mk-sw-overlay,
.mk-sw-panel,
.mk-sw-panel * {
  box-sizing: border-box;
}

.mk-sw-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-height: 118px;
  padding: 16px 0;
  writing-mode: vertical-rl;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f4f2ec;
  background: #111114;
  border: 1px solid #303038;
  border-left: 2px solid #ffd23f;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  box-shadow: -6px 0 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mk-sw-tab:hover {
  background: #1b1b21;
}

.mk-sw-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  transition: opacity 0.26s ease;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.mk-sw-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483002;
  display: flex;
  flex-direction: column;
  width: min(342px, 100vw);
  background: #0c0c0f;
  color: #f2f0ea;
  border-left: 1px solid #27272e;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.5);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1);
  -webkit-font-smoothing: antialiased;
}

.mk-sw-panel[hidden],
.mk-sw-overlay[hidden] {
  display: none !important;
}

body.mk-sw-open .mk-sw-overlay {
  opacity: 1;
}

body.mk-sw-open .mk-sw-panel {
  transform: translateX(0);
}

body.mk-sw-lock {
  overflow: hidden !important;
}

.mk-sw-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(20px + env(safe-area-inset-top)) 16px 15px 18px;
  border-bottom: 1px solid #232329;
}

.mk-sw-kicker {
  margin: 0 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7b7b85;
}

.mk-sw-title {
  margin: 0;
  font-family: inherit;
  font-size: 20px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #f4f2ec;
  text-transform: none;
}

.mk-sw-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #303038;
  border-radius: 8px;
  background: #15151a;
  color: #d7d7de;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mk-sw-close:hover {
  background: #202029;
}

.mk-sw-close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.mk-sw-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mk-sw-item {
  display: grid;
  grid-template-columns: 20px 34px minmax(0, 1fr) 6px;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.mk-sw-item:hover {
  background: #17171c;
}

.mk-sw-item.is-current {
  background: #191920;
  border-color: #2f2f38;
}

.mk-sw-item::after {
  content: "";
  justify-self: end;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}

.mk-sw-item.is-current::after {
  background: #ffd23f;
  box-shadow: 0 0 8px rgba(255, 210, 63, 0.6);
}

.mk-sw-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #686872;
}

.mk-sw-dots {
  display: flex;
  gap: 2px;
}

.mk-sw-dots i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.mk-sw-body {
  min-width: 0;
}

.mk-sw-name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f0eee9;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mk-sw-item.is-current .mk-sw-name::after {
  content: " · viewing";
  font-size: 9px;
  font-weight: 400;
  color: #a4a4ad;
}

.mk-sw-note {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 9.5px;
  letter-spacing: 0.01em;
  color: #81818b;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mk-sw-foot {
  flex: none;
  display: grid;
  gap: 10px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #232329;
}

.mk-sw-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a0a0a8;
  text-decoration: none;
}

.mk-sw-overview:hover {
  color: #fff;
}

.mk-sw-cycle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mk-sw-cycle button {
  padding: 9px 8px;
  border: 1px solid #2e2e37;
  border-radius: 8px;
  background: #15151a;
  color: #eeece7;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mk-sw-cycle button:hover {
  background: #202028;
}

.mk-sw-tab:focus-visible,
.mk-sw-panel a:focus-visible,
.mk-sw-panel button:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .mk-sw-tab {
    width: 28px;
    min-height: 108px;
    padding: 13px 0;
    font-size: 9px;
  }

  .mk-sw-panel {
    width: 100%;
    max-width: 100%;
    border-left: 0;
  }

  .mk-sw-item {
    padding: 13px 10px;
  }

  .mk-sw-name {
    font-size: 14px;
  }

  .mk-sw-note {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mk-sw-tab,
  .mk-sw-overlay,
  .mk-sw-panel,
  .mk-sw-item,
  .mk-sw-close,
  .mk-sw-cycle button {
    transition: none !important;
  }
}

@media print {
  .mk-sw-tab,
  .mk-sw-overlay,
  .mk-sw-panel {
    display: none !important;
  }
}
