.sidebar-header,
.brand,
.brand-copy,
.nav-section,
.community-note,
.dialog-surface {
  min-width: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 11px;
  border-radius: var(--radius-nav);
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 20px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-section h2 {
  padding: 0 12px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
}

.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--body);
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.72);
}

.nav-item.is-active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--blue-hover);
  font-weight: 600;
  transform: translateX(2px);
}

.nav-item.is-active .icon {
  color: var(--blue);
}

.community-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.72);
}

.community-note-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
}

.community-note-title .icon {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.community-note p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.account-button,
.button,
.filter-button,
.clear-button,
.icon-button {
  min-height: 44px;
  border-radius: var(--radius-control);
  font-weight: 600;
}

.account-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--body);
  font-size: 13px;
}

.account-button .icon {
  width: 17px;
  height: 17px;
}

.button {
  display: inline-flex;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.button .icon {
  width: 17px;
  height: 17px;
}

.button-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--surface);
}

.button-primary:hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
}

.button-secondary {
  background: var(--surface);
  color: var(--body);
}

.button-danger {
  border-color: var(--red-border);
  background: var(--red-soft);
  color: var(--red);
}

.button-danger:hover {
  border-color: var(--red);
}

.icon-button {
  display: inline-flex;
  min-width: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--body);
}

.icon-button .icon {
  width: 18px;
  height: 18px;
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--sidebar);
}

.icon-button.sidebar-close,
.icon-button.menu-button {
  display: none;
}

.filter-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.filter-control {
  position: relative;
  min-width: 122px;
  flex: 0 1 auto;
}

.search-field {
  display: flex;
  min-width: 240px;
  min-height: 44px;
  flex: 1 1 320px;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.search-field:focus-within {
  border-color: var(--blue);
}

.search-field .icon {
  width: 17px;
  height: 17px;
  color: var(--subtle);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search-field input::placeholder {
  color: var(--subtle);
  opacity: 1;
}

.filter-button {
  display: inline-flex;
  min-width: 122px;
  flex: 0 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--body);
  font-size: 13px;
}

.filter-control .filter-button {
  width: 100%;
}

.filter-button .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.clear-button {
  flex: 0 0 auto;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.filter-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  width: min(300px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.filter-popover-align-end {
  right: 0;
  left: auto;
}

.facet-search {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-nav);
  background: var(--canvas);
}

.facet-search:focus-within {
  border-color: var(--blue);
}

.facet-search .icon {
  width: 15px;
  height: 15px;
  color: var(--subtle);
}

.facet-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.facet-listbox {
  max-height: 280px;
  padding: 2px;
  overflow-y: auto;
  border-radius: var(--radius-nav);
}

.facet-listbox:focus-visible {
  outline-offset: 1px;
}

.facet-option {
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--body);
  font-size: 12px;
  text-align: left;
}

.facet-option:hover,
.facet-option.is-active {
  border-color: var(--border);
  background: var(--sidebar);
}

.facet-option.is-selected {
  color: var(--blue-hover);
  font-weight: 600;
}

.facet-option-check {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
}

.facet-option.is-selected .facet-option-check {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--surface);
}

.facet-option-check .icon {
  width: 13px;
  height: 13px;
}

.facet-option-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facet-option-count {
  min-width: 24px;
  color: var(--subtle);
  font-size: 10px;
  text-align: right;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

.badge .icon {
  width: 13px;
  height: 13px;
}

.badge-review {
  border-color: var(--blue-border);
  background: var(--blue-soft);
  color: var(--blue-hover);
}

.badge-channel {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: var(--green);
}

.badge-channel-official {
  border-color: var(--amber-border);
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-channel-team {
  border-color: var(--blue-border);
  background: var(--blue-soft);
  color: var(--blue-hover);
}

.badge-unknown {
  border-style: dashed;
}

.official-marker {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--amber-border);
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
}

.official-marker .icon {
  width: 11px;
  height: 11px;
}

.backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.42);
}

.dialog {
  width: min(92vw, 480px);
  margin: auto;
}

@keyframes drawer-enter {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dialog[open] .dialog-surface {
  animation: drawer-enter 180ms ease-out both;
}

.dialog.drawer {
  width: clamp(640px, 56vw, 880px);
  max-width: 100vw;
  height: 100dvh;
  margin: 0 0 0 auto;
}

.dialog-surface {
  display: flex;
  width: 100%;
  max-height: min(88vh, 720px);
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.22);
}

.drawer .dialog-surface {
  min-height: 100%;
  max-height: 100%;
  border-radius: var(--radius-panel) 0 0 var(--radius-panel);
}

.dialog-header,
.dialog-title-with-icon,
.dialog-actions {
  display: flex;
  align-items: center;
}

.dialog-header {
  justify-content: space-between;
  gap: 16px;
}

.dialog-header h2 {
  color: var(--text);
  font-size: 20px;
  line-height: 28px;
}

.dialog-title-with-icon {
  gap: 8px;
}

.dialog-title-with-icon .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.dialog-content {
  min-height: 180px;
  flex: 1;
  overflow: auto;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
}

.login-dialog-surface > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.inline-error {
  padding: 10px 12px;
  border: 1px solid var(--red-border);
  border-radius: var(--radius-nav);
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 18px;
}

.material-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-row {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-nav);
  background: var(--canvas);
}

.detail-row-wide {
  grid-column: 1 / -1;
}

.detail-row dt {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
}

.detail-row dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--body);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.account-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}

.account-copy strong,
.account-copy span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy span {
  color: var(--muted);
  font-size: 10px;
}

.sidebar-logout {
  width: 100%;
}

.auth-tabs {
  display: grid;
  padding: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-nav);
  background: var(--canvas);
}

.auth-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.auth-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--blue-hover);
  box-shadow: var(--shadow-soft);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label,
.form-grid label,
.form-stack label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.auth-form input,
.form-grid input,
.form-stack input,
.form-stack select,
.form-stack textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-nav);
  background: var(--surface);
  color: var(--text);
}

.form-stack textarea {
  min-height: 76px;
  resize: vertical;
}

.select-control {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.select-trigger {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-nav);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.select-trigger:hover {
  border-color: var(--blue-border);
}

.select-trigger:focus-visible,
.select-control.is-open .select-trigger {
  border-color: var(--blue);
  outline: 3px solid var(--blue-soft);
  outline-offset: 1px;
}

.select-trigger .icon {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 140ms ease;
}

.select-control.is-open .select-trigger .icon {
  transform: rotate(180deg);
}

.select-listbox {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 280px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-nav);
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.select-listbox[hidden] {
  display: none;
}

.select-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.select-option.is-active {
  background: var(--canvas);
}

.select-option.is-selected {
  background: var(--blue-soft);
  color: var(--blue-hover);
  font-weight: 700;
}

.check-row {
  display: inline-flex !important;
  min-height: 44px;
  align-items: center;
  gap: 10px !important;
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: var(--blue);
}

[aria-invalid="true"] {
  border-color: var(--red) !important;
}

@media (prefers-reduced-motion: reduce) {
  .select-trigger .icon {
    transition: none;
  }
}

.badge-blue {
  border-color: var(--blue-border);
  background: var(--blue-soft);
  color: var(--blue-hover);
}

.lut-contribution {
  margin: 16px 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.lut-contribution summary { cursor: pointer; font-weight: 600; }
.lut-contribution p { color: var(--muted); margin: 12px 0; }
.lut-contribution form { max-width: 640px; }
.lut-contribution ul { padding-left: 20px; overflow-wrap: anywhere; }
[data-github-form] { max-width: 640px; margin: 20px auto; text-align: left; }
[data-github-choices] label { display: flex; align-items: center; gap: 12px; overflow-wrap: anywhere; }
[data-github-choices] input { width: 18px; min-height: 18px; flex: 0 0 18px; }
[data-github-account-error] { overflow-wrap: anywhere; font-size: 12px; }
