/* タブ全体を包む透明の親エリア */
.tab-wrapper {
  --notification-corner-slot: clamp(136px, 15vw, 176px);
  display: flex;
  align-items: stretch;
  gap: 2px;
  position: relative;
  padding: var(--ds-space-2) 0 var(--ds-space-1);
  padding-right: calc(var(--notification-corner-slot) + var(--ds-space-2));
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid var(--ds-color-border);
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
}

/* メインタブ領域 */
.sidebar-panel {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

/* メインタブ内のタブ群 */
.sidebar-panel .tabs {
  display: flex;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

/* 書類タブエリア */
.document-tab-panel {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.document-tab-area {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

/* 共通：タブボタン */
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  padding: 0 18px;
  font-size: var(--ds-font-lg);
  border-radius: var(--ds-radius-md) var(--ds-radius-md) var(--ds-radius-sm) var(--ds-radius-sm);
  height: 38px;
  min-width: 132px;
  max-width: 184px;
  border: 1px solid var(--ds-color-border);
  border-bottom-color: transparent;
  background-color: var(--ds-color-surface-muted);
  color: var(--ds-color-text);
  box-sizing: border-box;
  line-height: var(--ds-line-compact);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.12s ease;
}

/* メインタブ（未処理など） */
.main-tab {
  background-color: var(--ds-color-surface-muted);
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.06);
}
.main-tab:hover:not(.active) {
  background-color: #e8eef6;
  border-color: #b8c7d9;
  box-shadow: inset 0 -2px 0 rgba(0, 123, 255, 0.18);
}
.main-tab.active {
  background-color: var(--ds-color-surface);
  border-color: var(--ds-color-primary);
  border-bottom-color: var(--ds-color-surface);
  color: var(--ds-color-primary);
  box-shadow:
    inset 0 3px 0 var(--ds-color-primary),
    0 1px 0 var(--ds-color-surface);
}

/* 書類タブ */
.document-tab {
  background-color: var(--ds-color-surface-muted);
  justify-content: space-between;
  min-width: 184px;
  max-width: 280px;
}
.document-tab .tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-tab:hover:not(.active) {
  background-color: #e8eef6;
  border-color: #b8c7d9;
  box-shadow: inset 0 -2px 0 rgba(0, 123, 255, 0.18);
}
.document-tab.active {
  background-color: var(--ds-color-surface);
  border-color: var(--ds-color-primary);
  border-bottom-color: var(--ds-color-surface);
  color: var(--ds-color-primary);
  box-shadow:
    inset 0 3px 0 var(--ds-color-primary),
    0 1px 0 var(--ds-color-surface);
}
.document-tab .close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-sm);
  color: currentColor;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.document-tab .close-btn:hover,
.document-tab .close-btn:focus-visible {
  background: rgba(0, 123, 255, 0.1);
  border-color: rgba(0, 123, 255, 0.24);
}
.document-tab.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

/* 新規申請ボタン */
.new-request-btn {
  background-color: var(--ds-cta-primary-solid-bg, var(--ds-color-primary));
  border: 1px solid var(--ds-cta-primary-solid-border, rgba(0, 123, 255, 0.18));
  box-shadow: var(--ds-cta-primary-solid-shadow);
  color: var(--ds-cta-primary-solid-fg, #fff);
  font-weight: 700;
}

.tab-button:active {
  transform: translateY(1px);
}

.tab-button:disabled,
.tab-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.new-request-btn:hover:not(:disabled) {
  background-color: var(--ds-cta-primary-solid-bg-hover, var(--ds-color-primary-hover));
  transform: translateY(-1px);
}

.notification-center-trigger {
  position: absolute;
  top: var(--ds-space-2);
  right: 0;
  z-index: 2;
  margin-left: 0;
  min-width: 112px;
  min-height: 36px;
  padding-inline: 14px 12px;
  border: 1px solid var(--ds-color-border);
  background: var(--ds-color-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  color: var(--ds-color-text);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.notification-center-trigger:hover:not(.is-active) {
  background: var(--ds-cta-neutral-bg);
  border-color: var(--ds-cta-neutral-border);
  box-shadow: var(--ds-cta-neutral-shadow);
  transform: translateY(-1px);
}

.notification-center-trigger.is-active {
  background: var(--ds-cta-primary-soft-bg);
  border-color: var(--ds-cta-primary-soft-border);
  box-shadow: var(--ds-cta-primary-soft-shadow);
  color: var(--ds-color-primary);
}

.notification-center-trigger-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.notification-center-trigger-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.notification-center-trigger-label {
  font-size: var(--ds-font-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.notification-center-trigger-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid #b42318;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: var(--ds-font-xs);
  font-weight: 700;
  line-height: 1;
}

.notification-center-trigger.is-active .notification-center-trigger-badge {
  background: #97180f;
  border-color: #97180f;
  color: #fff;
}

.notification-center-trigger-badge.hidden {
  display: none;
}

@media (max-width: 960px) {
  .tab-wrapper {
    padding-right: var(--ds-space-5);
  }

  .notification-center-trigger {
    position: static;
    margin-left: auto;
  }
}

