section[show-admin="hide"],
section[show-admin="default"][show-user="hide"] {
  display: none !important;
}

.admin-palette {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.admin-palette[hidden] {
  display: none !important;
}

.admin-palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.admin-palette__panel {
  position: relative;
  width: min(26rem, 100%);
  height: auto;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.admin-palette__panel--tall {
  height: 90vh;
  max-height: 90vh;
}

.admin-palette__header {
  position: relative;
  padding: 1rem 8.5rem 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.admin-palette__header-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.admin-palette__clear-storage {
  padding: 0.35rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

.admin-palette__clear-storage:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.admin-palette__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.admin-palette__hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.admin-palette__hint kbd {
  padding: 0.1em 0.35em;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  font-size: 0.85em;
}

.admin-palette__close {
  position: static;
  width: 2rem;
  flex-shrink: 0;
  height: 2rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.admin-palette__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.admin-palette__actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.admin-palette__btn {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.admin-palette__btn:hover {
  background: #f1f5f9;
}

.admin-palette__list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 1rem 0.25rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.admin-palette__list-head-now {
  flex: 1;
  padding-left: 1.6rem;
}

.admin-palette__list-head-default {
  flex-shrink: 0;
  min-width: 2.75rem;
  text-align: center;
}

.admin-palette__list {
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
}

.admin-palette__panel--tall .admin-palette__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.admin-palette__item {
  margin: 0;
}

.admin-palette__item--overridden .admin-palette__row {
  background: #fffbeb;
}

.admin-palette__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
}

.admin-palette__row:hover {
  background: #f8fafc;
}

.admin-palette__item--overridden .admin-palette__row:hover {
  background: #fef3c7;
}

.admin-palette__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.admin-palette__main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.admin-palette__checkbox {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: #0f172a;
}

.admin-palette__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
}

.admin-palette__meta {
  font-size: 0.7rem;
  color: #94a3b8;
}

.admin-palette__default {
  flex-shrink: 0;
  min-width: 2.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.admin-palette__default--show {
  color: #166534;
  background: #dcfce7;
}

.admin-palette__default--hide {
  color: #991b1b;
  background: #fee2e2;
}
