*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: #0c0c0e;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 80px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(99, 102, 241, 0.12), transparent 55%),
    #0c0c0e;
}

.morph-tabs {
  --surface: #f4f4f5;
  --shell: #18181b;
  --ink: #18181b;
  --tab-w: 176px;
  --tab-h: 56px;
  --tab-top: 24px;
  --rail-h: 80px;
  --inset: 16px;
  --gap: 16px;
  position: relative;
  isolation: isolate;
  width: min(100%, 720px);
  overflow: hidden;
  border-radius: 28px;
  background: var(--shell);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  color: #fff;
  user-select: none;
  touch-action: pan-y;
}

.morph-tabs__surface {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 108px;
  z-index: 0;
  pointer-events: none;
  color: var(--surface);
  display: block;
  overflow: visible;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: strict;
}

.morph-tabs__surface path {
  transform: translateZ(0);
}

.morph-tabs__rail {
  position: relative;
  z-index: 30;
  height: var(--rail-h);
  display: block;
}

.morph-tabs__tab {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: stretch;
  cursor: grab;
  will-change: transform;
  transform: translate3d(var(--x, 16px), 0, 0);
}

.morph-tabs__tab.is-active {
  z-index: 20;
}

.morph-tabs__tab.is-dragging {
  z-index: 40;
  cursor: grabbing;
}

.morph-tabs__tab-box {
  position: relative;
  width: var(--tab-w);
  height: var(--tab-h);
  margin-top: var(--tab-top);
  display: flex;
  align-items: stretch;
}

.morph-tabs__hover {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 8px;
  border-radius: 18px;
  background: transparent;
  pointer-events: none;
  transition: background-color 0.2s ease;
}

.morph-tabs__tab:not(.is-active):hover .morph-tabs__hover {
  background: rgba(255, 255, 255, 0.06);
}

.morph-tabs__tab.is-dragging:not(.is-active) .morph-tabs__hover {
  background: #27272a;
}

.morph-tabs__btn {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 36px 8px 16px;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: left;
  cursor: inherit;
  outline: none;
  transition: color 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.morph-tabs__tab:not(.is-active):hover .morph-tabs__btn {
  color: #fff;
}

.morph-tabs__tab.is-active .morph-tabs__btn {
  color: var(--ink);
  padding-bottom: 0;
}

.morph-tabs__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.morph-tabs__close {
  position: absolute;
  right: 8px;
  top: calc(50% - 4px);
  z-index: 20;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background-color 0.2s ease,
    color 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  outline: none;
}

.morph-tabs__tab.is-active .morph-tabs__close {
  top: 50%;
  color: #a1a1aa;
}

.morph-tabs__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.morph-tabs__tab.is-active .morph-tabs__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #52525b;
}

.morph-tabs__close svg {
  width: 12px;
  height: 12px;
  display: block;
}

.morph-tabs__panel {
  position: relative;
  z-index: 20;
  margin: 0 var(--inset) var(--inset);
  min-height: 280px;
  height: 300px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  contain: layout style;
}

.morph-tabs__content {
  position: absolute;
  inset: 0;
  padding: 32px 36px 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.morph-tabs__content.is-active {
  position: absolute;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.mt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.morph-tabs__badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent, #52525b);
  background: color-mix(in srgb, var(--accent, #52525b) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #52525b) 18%, transparent);
}

.mt-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #71717a;
}

.mt-live i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.mt-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: #a1a1aa;
}

.morph-tabs__title {
  margin-top: 12px;
  font-size: clamp(1.65rem, 3.2vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: #09090b;
}

.morph-tabs__detail {
  margin-top: 8px;
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #71717a;
}

.mt-progress {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-progress__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 500;
  color: #71717a;
}

.mt-progress__meta span:last-child {
  font-weight: 600;
  color: #3f3f46;
  font-variant-numeric: tabular-nums;
}

.mt-progress__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.08);
  overflow: hidden;
}

.mt-progress__fill {
  display: block;
  height: 100%;
  width: var(--p, 50%);
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--c, #6366f1),
    color-mix(in srgb, var(--c, #6366f1) 65%, #fff)
  );
}

.mt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.mt-chip {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(24, 24, 27, 0.08);
  color: #52525b;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
}

.mt-avatars {
  display: flex;
  align-items: center;
}

.mt-avatars span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: -8px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  background: var(--bg, #e4e4e7);
  font-size: 0.62rem;
  font-weight: 700;
  color: #27272a;
}

.mt-avatars__more {
  margin-right: 0 !important;
  background: #18181b !important;
  color: #fff !important;
}

.mt-feed {
  list-style: none;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-feed li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(24, 24, 27, 0.06);
  font-size: 0.8rem;
  color: #52525b;
}

.mt-feed strong {
  color: #18181b;
  font-weight: 600;
}

.mt-feed time {
  font-size: 0.7rem;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}

.mt-feed__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--c, #10b981);
  flex-shrink: 0;
}

.mt-list {
  list-style: none;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(24, 24, 27, 0.06);
}

.mt-list__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--c, #8b5cf6);
  background: color-mix(in srgb, var(--c, #8b5cf6) 12%, transparent);
  flex-shrink: 0;
}

.mt-list div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mt-list strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: #18181b;
}

.mt-list span {
  font-size: 0.72rem;
  color: #a1a1aa;
}

.morph-tabs.is-empty .morph-tabs__panel {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: #a1a1aa;
  font-size: 0.875rem;
}

.morph-tabs.is-empty .morph-tabs__panel::after {
  content: "No tabs open";
}

@media (max-width: 640px) {
  .morph-tabs {
    --tab-w: 140px;
    --gap: 12px;
    --inset: 12px;
  }

  .morph-tabs__content {
    padding: 24px 20px 22px;
  }

  .morph-tabs__panel {
    height: 320px;
    min-height: 300px;
  }

  .morph-tabs__btn {
    padding-left: 12px;
    padding-right: 32px;
    font-size: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .morph-tabs__hover,
  .morph-tabs__btn,
  .morph-tabs__close {
    transition: none;
  }
}
