/* Original pattern background preserved */
.tag-page {
  min-height: 100vh;
  background: #000000;
}
.tag-bg {
  position: fixed;
  z-index: 0;
  top: 98px;
  left: 50%;
  width: 1440px;
  height: 603px;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: center;
  opacity: 0.3;
  max-width: none;
  pointer-events: none;
}
@media (min-width: 600px) and (max-width: 1024px) {
  .tag-bg {
    top: var(--shumi-bg-top-md, 8px);
    width: var(--shumi-bg-width-md, 200%);
    height: auto;
  }
}
@media (max-width: 599px) {
  .tag-bg {
    top: var(--shumi-bg-top-sm, 56px);
    width: var(--shumi-bg-width-sm, 200%);
    height: auto;
  }
}
.priority-bg {
  position: fixed;
  z-index: 0;
  top: 98px;
  left: 50%;
  width: 1440px;
  height: 603px;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: center;
  opacity: 0.3;
  max-width: none;
  pointer-events: none;
}
@media (min-width: 600px) and (max-width: 1024px) {
  .priority-bg {
    top: var(--shumi-bg-top-md, 8px);
    width: var(--shumi-bg-width-md, 200%);
    height: auto;
  }
}
@media (max-width: 599px) {
  .priority-bg {
    top: var(--shumi-bg-top-sm, 56px);
    width: var(--shumi-bg-width-sm, 200%);
    height: auto;
  }
}

.tag-page {
  min-height: 100vh;
}

.tag-main,
.priority-main {
  position: relative;
  width: 100%;
  min-height: 0;
  margin: 0;
  overflow-x: visible;
}

.tag-stage,
.priority-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  height: auto;
  min-height: 0;
  margin-bottom: 12px;
  overflow: visible;
  pointer-events: none;
}

.tag-back {
  position: relative;
  top: auto;
  left: auto;
  margin-bottom: 18px;
}

.tag-alien,
.priority-alien,
.tag-bubble,
.priority-bubble {
  position: relative;
  top: auto;
  left: auto;
}

.tag-bubble,
.priority-bubble {
  height: auto;
}

.tag-bubble,
.priority-bubble {
  width: fit-content;
  min-width: 0;
  max-width: calc(100% - 8px);
  flex: 0 1 auto;
}

.tag-bubble,
.priority-bubble {
  pointer-events: auto;
}

.tag-content,
.priority-content {
  position: relative;
  z-index: 2;
  padding: 8px 0 8px;
}

.tag-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.tag-panel__lead {
  margin: 0 0 8px;
  color: var(--dust);
  font-size: 16px;
}

.tag-panel__status {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 14px;
}

.tag-panel__note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tag-panel__note[hidden] {
  display: none;
}

.tag-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tag-grid__all {
  display: flex;
  justify-content: flex-start;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.tag-accordion {
  border-top: 1px solid var(--line);
}

.tag-accordion__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-family: var(--font-maruko);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

.tag-accordion__mark {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
  flex-shrink: 0;
}

.tag-accordion.is-open .tag-accordion__mark {
  transform: rotate(45deg);
}

.tag-accordion__body {
  display: none;
  padding: 0 4px 14px 24px;
}

.tag-accordion.is-open .tag-accordion__body {
  display: block;
}

.tag-accordion__empty {
  margin: 0;
  color: var(--muted);
}

.tag-grid__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--cream);
  font-family: var(--font-maruko);
  font-size: 15px;
  cursor: pointer;
}

.tag-chip__hash {
  color: var(--accent);
}

.tag-chip__count {
  color: var(--muted);
  font-size: 0.86em;
}

.tag-chip.is-selected .tag-chip__count {
  color: #6b665c;
}

.tag-chip--all {
  min-width: min(100%, 220px);
  justify-content: center;
  border-bottom-width: 4px;
}

.tag-chip:hover {
  border-color: var(--cream);
}

.tag-chip.is-selected {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.tag-chip.is-selected .tag-chip__hash {
  color: var(--accent);
}

.tag-custom-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-top: 12px;
}

.tag-custom-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tag-custom-form__field + .tag-custom-form__field {
  margin-left: 16px;
}

.tag-custom-form__label {
  color: var(--dust);
  font-size: 13px;
}

.tag-custom-form__input,
.tag-custom-form__select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  background: var(--void-2);
  color: var(--cream);
  font-family: var(--font-maruko);
  font-size: 15px;
}

.tag-custom-form__add {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  background: var(--accent);
  color: var(--cream);
  font-family: var(--font-maruko);
  font-size: 15px;
  cursor: pointer;
}

.tag-custom-form__note {
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tag-actions,
.priority-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.tag-reset,
.priority-reset {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--dust);
  font-family: var(--font-maruko);
  cursor: pointer;
}

.tag-next,
.priority-next {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  background: var(--accent);
  color: var(--cream);
  font-family: var(--font-maruko);
  cursor: pointer;
}

.tag-next:disabled,
.priority-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.priority-card {
  position: relative;
  min-height: 140px;
  padding: 20px 18px 18px;
  border: 1px solid var(--line-strong);
  background: var(--void-2);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-maruko);
  transform: none;
}

.priority-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 36%;
  background: var(--accent);
}

.priority-card.is-selected {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  outline: 0;
}

.priority-card.is-disabled {
  opacity: 0.42;
  cursor: default;
}

.priority-card__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 400;
}

.priority-card__dots {
  width: 28px;
  height: 3px;
  margin-bottom: 10px;
  background: currentColor;
  transform: skewX(-22deg);
}

.priority-card__desc {
  margin: 0;
  color: inherit;
  opacity: 0.72;
  font-size: 14px;
  line-height: 1.5;
}

.priority-card[hidden] {
  display: none;
}

@media (max-width: 599px) {
  .priority-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .priority-card {
    min-height: 0;
    padding: 8px 8px 8px 12px;
  }

  .priority-card::before {
    width: 4px;
    height: 30%;
  }

  .priority-card__title {
    margin: 0 0 4px;
    font-size: 15px;
  }

  .priority-card__dots {
    width: 16px;
    height: 2px;
    margin-bottom: 4px;
  }

  .priority-card__desc {
    font-size: 11px;
    line-height: 1.35;
  }

  .tag-next,
  .priority-next,
  .tag-reset,
  .priority-reset {
    flex: 1 1 140px;
    min-height: 52px;
  }

  .tag-alien,
  .priority-alien {
    width: 64px;
    height: 108px;
  }
}
