:root {
  --bg: #0c1222;
  --bg-elevated: #111827;
  --surface: #151d32;
  --surface-hover: #1a2540;
  --border: #273552;
  --border-strong: #33466a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-dim: #14b8a6;
  --accent-muted: rgba(45, 212, 191, 0.14);
  --danger: #f87171;
  --ok: #4ade80;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  /* Dense UI: 1rem = 14px */
  --control-py: 0.3rem;
  --control-px: 0.5rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 0% -20%, rgba(45, 212, 191, 0.12), transparent 50%),
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(59, 130, 246, 0.08), transparent 45%);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #5eead4;
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ——— App shell ——— */
header.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 1.15rem;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
  color: var(--text);
}
.brand__mark {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 2px 12px rgba(45, 212, 191, 0.2);
}
.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.2;
}
.brand__name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.brand__tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  align-items: center;
  font-size: 0.8125rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover {
  background: var(--accent-muted);
  color: var(--text);
  text-decoration: none;
}
.nav-link__icon {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.nav-logout {
  display: inline;
  margin: 0;
  padding: 0;
}
.nav-link--btn {
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  font-size: inherit;
}
.nav-link--btn:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.15rem 1.15rem 2.25rem;
}

/* ——— Auth (login / invite) ——— */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(45, 212, 191, 0.15), transparent 42%),
    radial-gradient(circle at 85% 20%, rgba(99, 102, 241, 0.12), transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(14, 165, 233, 0.08), transparent 45%);
  z-index: 0;
}

.auth-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  max-width: none;
  margin: 0;
}

.auth-main--narrow .card {
  max-width: 440px;
  width: 100%;
}

.login-panel {
  width: 100%;
  max-width: 380px;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
}
.login-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.25);
}
.login-brand__title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.login-brand__subtitle {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.login-form {
  margin-top: 0.25rem;
}

.auth-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 1rem 1.25rem;
  margin: 0;
}

h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.page-back {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.page-back:hover {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.project-hero {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.project-hero h1 {
  margin: 0;
  line-height: 1.25;
}
.project-hero__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.35rem;
}
.project-hero__title-row > div:first-child {
  min-width: 0;
  flex: 1;
}
.project-hero--dict .project-hero__title-row {
  align-items: flex-start;
}
.project-hero__lede {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 40rem;
  font-weight: 400;
}
.btn-admin {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-color: rgba(45, 212, 191, 0.4);
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: var(--radius-sm);
}
.btn-admin:hover {
  background: rgba(45, 212, 191, 0.22);
  text-decoration: none;
}
.project-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.project-hero__slug {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.45);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-muted);
}

.section {
  margin-bottom: 1.75rem;
}
.section-head {
  margin-bottom: 0.75rem;
}
.section-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
}
.export-actions__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-right: 0.15rem;
}
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.28rem 0.55rem;
  color: var(--text);
  border-color: var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-weight: 500;
}
.export-btn__icon {
  flex-shrink: 0;
  opacity: 0.65;
}
.export-btn:hover {
  color: var(--accent);
  border-color: rgba(45, 212, 191, 0.45);
  background: var(--accent-muted);
  text-decoration: none;
}
.export-btn:hover .export-btn__icon {
  opacity: 1;
}

/* ——— Dictionary page ——— */
.dict-toolbar {
  padding: 0.85rem 1rem 0.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(165deg, rgba(26, 37, 64, 0.55) 0%, rgba(21, 29, 50, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.dict-toolbar__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.dict-toolbar__heading-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.dict-toolbar__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dict-count-pill {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.dict-toolbar__desc {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 46rem;
}

.dict-add-card {
  margin-bottom: 0.65rem;
  border-color: rgba(45, 212, 191, 0.2);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.05);
}
.dict-add-card__head {
  margin-bottom: 0.85rem;
}
.dict-add-card__title {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.dict-add-card__subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  opacity: 0.95;
}
.dict-add-form__field--lang {
  max-width: 7rem;
}
.dict-add-form__field--lang input {
  max-width: 100%;
}
.dict-add-form__value textarea {
  max-width: 100%;
}
.dict-add-form__submit {
  margin-top: 0.15rem;
}

.dict-import-details {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.14);
}
.dict-import-details__summary {
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  user-select: none;
  transition: color 0.12s ease, background 0.12s ease;
}
.dict-import-details__summary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.dict-import-details__summary::-webkit-details-marker {
  display: none;
}
.dict-import-details[open] > .dict-import-details__summary {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.dict-import-details__body {
  padding: 0.85rem 1rem 1rem;
}
.dict-import-details__body .import-hint {
  margin-top: 0;
}

.dict-notice {
  margin-bottom: 0.85rem;
}

.dict-empty {
  margin-top: 1.15rem;
  padding: 1.75rem 1.25rem;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.1);
}
.dict-empty__icon {
  color: var(--muted);
  opacity: 0.45;
  margin-bottom: 0.65rem;
}
.dict-empty__icon svg {
  display: block;
  margin: 0 auto;
}
.dict-empty__title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dict-empty__text {
  margin: 0 auto;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 22rem;
}

.dict-lang-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  margin: 0.85rem 0 0.45rem;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dict-lang-filter__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  flex-shrink: 0;
}
.dict-lang-filter__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}
.dict-lang-filter__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text);
}
.dict-lang-filter__item input {
  margin: 0;
  accent-color: var(--accent);
}
.dict-lang-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
}

.dict-matrix-scroll-hint {
  display: none;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
}
@media (max-width: 800px) {
  .dict-matrix-scroll-hint {
    display: block;
  }
}

.dict-matrix-wrap {
  margin-top: 0.25rem;
  overflow: auto;
  max-height: min(72vh, 34rem);
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.dict-matrix-wrap .dict-matrix {
  width: max(100%, 36rem);
  min-width: 100%;
  table-layout: auto;
}
.dict-key {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
  word-break: break-word;
  white-space: normal;
}
.pill--lang {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.dict-readonly-value {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.8125rem;
}
.dict-matrix__readonly {
  max-height: 8rem;
  overflow: auto;
}
.dict-cell-empty {
  color: var(--muted);
  opacity: 0.45;
  font-size: 0.75rem;
}
.dict-inline-form {
  margin: 0;
}
.dict-inline-textarea {
  width: 100%;
  max-width: none;
}
.data-table td .cell-actions--row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-icon-text__icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.import-card {
  margin-top: 0.75rem;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
}
.import-hint {
  margin: 0 0 0.75rem;
  max-width: 40rem;
}
.import-replace-label {
  font-size: 0.8125rem;
  color: var(--muted);
  cursor: pointer;
}
.import-replace-label input {
  margin-right: 0.35rem;
  vertical-align: middle;
}
.import-form input[type="file"] {
  max-width: 100%;
  padding: 0.35rem 0;
  border: none;
  background: transparent;
  font-size: 0.875rem;
}
.section-head .hint {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36rem;
}

.card--elevated {
  border-color: rgba(45, 212, 191, 0.22);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.card--tight {
  padding: 1rem 1.1rem;
}
.card-title {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.form-add-entry {
  display: grid;
  grid-template-columns: 1fr 5.5rem;
  gap: 0.65rem 0.85rem;
  align-items: end;
}
@media (max-width: 520px) {
  .form-add-entry {
    grid-template-columns: 1fr;
  }
}
.form-add-entry .field-span-2 {
  grid-column: 1 / -1;
}
.form-add-entry .field-actions {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}
.form-add-entry input[type="text"] {
  max-width: 100%;
}
.form-add-entry textarea {
  max-width: 100%;
}

.notice {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.45;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.15);
}
.notice strong {
  color: var(--text);
}

.table-wrap {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.data-table th,
.data-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.12);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table th {
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.data-table .col-key {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}
.data-table .col-lang {
  width: 4.5rem;
}
.data-table td .cell-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}
.data-table textarea {
  min-height: 2.25rem;
  font-size: 0.8125rem;
  padding: var(--control-py) var(--control-px);
}
button.btn-sm {
  padding: 0.22rem 0.45rem;
  font-size: 0.6875rem;
}

/* Dictionary matrix: keys = rows, languages = columns (i18n grid) */
table.data-table.dict-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}
table.data-table.dict-matrix thead th.dict-matrix__corner {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 8rem;
  max-width: 11rem;
  width: 9.5rem;
  text-align: left;
  text-transform: uppercase;
  box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border);
}
table.data-table.dict-matrix thead th.dict-matrix__lang {
  min-width: 9.5rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
  font-weight: 600;
}
table.data-table.dict-matrix thead th.dict-matrix__row-actions {
  position: sticky;
  right: 0;
  z-index: 5;
  min-width: 4.75rem;
  width: 4.75rem;
  max-width: 5.25rem;
  text-align: center;
  box-shadow: -1px 0 0 var(--border), 0 1px 0 var(--border);
}

table.data-table.dict-matrix tbody tr {
  transition: background 0.12s ease;
}
table.data-table.dict-matrix tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.06);
}
table.data-table.dict-matrix tbody tr:hover {
  background: rgba(45, 212, 191, 0.07);
}

table.data-table.dict-matrix .dict-matrix__key {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 8rem;
  max-width: 11rem;
  width: 9.5rem;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font-size: inherit;
  font-weight: 600;
  vertical-align: top;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.14);
}
table.data-table.dict-matrix tbody tr:nth-child(odd) .dict-matrix__key {
  background: var(--surface);
}
table.data-table.dict-matrix tbody tr:nth-child(even) .dict-matrix__key {
  background: #141c2e;
}
table.data-table.dict-matrix tbody tr:hover .dict-matrix__key {
  background: #1a263d;
}

table.data-table.dict-matrix .dict-matrix__cell {
  min-width: 9.5rem;
  max-width: 20rem;
  vertical-align: top;
}

.dict-matrix__cell-btn {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
  min-height: 2.4rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.dict-matrix__cell-btn:hover {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.09);
}
.dict-matrix__cell-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dict-cell-body {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}
.dict-cell-body:empty {
  display: none;
}
.dict-matrix__cell-btn .dict-cell-dash {
  display: block;
  text-align: center;
  color: var(--muted);
  opacity: 0.45;
  font-size: 0.85rem;
}

.dict-matrix__actions-icons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.dict-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.dict-icon-action:hover {
  color: var(--accent);
  border-color: rgba(45, 212, 191, 0.45);
  background: var(--accent-muted);
}
.dict-icon-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dict-icon-action--danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.06);
}
.dict-icon-action--danger:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.14);
}
.dict-icon-action--sm {
  width: 1.75rem;
  height: 1.75rem;
}
.dict-icon-action--sm svg {
  width: 15px;
  height: 15px;
}
.dict-matrix__delete-key-form {
  margin: 0;
  display: inline-flex;
}

table.data-table.dict-matrix .dict-matrix__row-actions {
  position: sticky;
  right: 0;
  z-index: 3;
  white-space: nowrap;
  width: 4.75rem;
  min-width: 4.75rem;
  max-width: 5.25rem;
  vertical-align: middle;
  text-align: center;
  border-left: 1px solid var(--border);
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.12);
}
table.data-table.dict-matrix tbody tr:nth-child(odd) .dict-matrix__row-actions {
  background: var(--surface);
}
table.data-table.dict-matrix tbody tr:nth-child(even) .dict-matrix__row-actions {
  background: #141c2e;
}
table.data-table.dict-matrix tbody tr:hover .dict-matrix__row-actions {
  background: #1a263d;
}

details.drawer {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
details.drawer > summary {
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
  list-style: none;
  user-select: none;
  transition: background 0.12s ease;
}
details.drawer > summary:hover {
  background: var(--surface-hover);
}
details.drawer > summary::-webkit-details-marker {
  display: none;
}
details.drawer[open] > summary {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.drawer-body {
  padding: 1rem 1.1rem 1.15rem;
}
/* ——— Project administration ——— */
.admin-page {
  padding-bottom: 0.5rem;
}
.project-hero--admin .project-hero__title-row {
  align-items: flex-start;
}
.admin-section {
  margin-bottom: 1.85rem;
}
.admin-section:last-child {
  margin-bottom: 0;
}
.admin-section__head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.admin-section__icon {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.28);
}
.admin-section__icon svg {
  display: block;
}
.admin-section__hgroup {
  min-width: 0;
}
.admin-section__title {
  margin: 0 0 0.3rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.admin-section__lead {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 42rem;
}
.admin-panel {
  border-color: rgba(45, 212, 191, 0.16);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.05);
}
.admin-panel__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.admin-panel__divider {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}
.admin-panel__divider .admin-panel__eyebrow {
  margin-bottom: 0.9rem;
}
.admin-inline-fields input.admin-input-email {
  min-width: 14rem;
  max-width: 100%;
}
.admin-input-wide {
  max-width: 24rem;
}
.admin-empty-hint {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}
.admin-table-wrap {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
}
.admin-table-wrap .data-table {
  margin: 0;
}
.admin-table tbody tr {
  transition: background 0.1s ease;
}
.admin-table tbody tr:hover {
  background: rgba(45, 212, 191, 0.05);
}
.admin-table .admin-th-actions {
  width: 1%;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
.admin-table--members .admin-col-user {
  width: 16%;
  min-width: 6.5rem;
  max-width: 13rem;
}
.admin-table--members .admin-col-email {
  min-width: 10rem;
  word-break: break-word;
}
.admin-table--members .admin-col-role {
  width: 1%;
  white-space: nowrap;
  min-width: 8.5rem;
}
.admin-table--members .admin-th-actions,
.admin-table--members .admin-actions-cell {
  min-width: 2.75rem;
  max-width: 3.5rem;
}
.admin-table--invites .admin-col-email {
  min-width: 11rem;
  word-break: break-word;
}
.admin-table--invites .admin-col-role {
  width: 1%;
  white-space: nowrap;
}
.admin-table--invites .admin-col-date {
  width: 1%;
  white-space: nowrap;
  min-width: 6.5rem;
}
.admin-table--invites .admin-th-actions,
.admin-table--invites .admin-actions-cell {
  min-width: 4.5rem;
  max-width: 6rem;
}
.admin-td-user {
  font-weight: 600;
}
.admin-cell-muted {
  color: var(--muted);
  font-size: 0.8125rem;
}
.admin-cell-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.admin-actions-cell {
  text-align: center;
  vertical-align: middle;
}
.admin-invite-actions {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.admin-stack-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.admin-stack-form select {
  max-width: 7rem;
}
.pill--role {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: lowercase;
}
.admin-check-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text);
  cursor: pointer;
}
.admin-check-label input {
  margin-right: 0.4rem;
  vertical-align: middle;
  accent-color: var(--accent);
}
.admin-label-compact {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.admin-textarea-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.api-key-card {
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.api-key-card:last-child {
  margin-bottom: 0;
}
.api-key-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}
.api-key-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  min-width: 0;
}
.api-key-card__name {
  font-weight: 600;
  font-size: 0.875rem;
}
.api-key-card__prefix {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}
.api-key-card__cidr-form {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
}
.api-key-card__cidr-form .btn-sm {
  margin-top: 0.35rem;
}

/* Legacy admin-block (if used elsewhere) */
.admin-block {
  margin-bottom: 1.35rem;
}
.admin-block:last-child {
  margin-bottom: 0;
}
.admin-block h3 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.admin-block .card {
  margin-bottom: 0;
}
.inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-end;
}
.inline-fields .row {
  margin-bottom: 0;
}
.inline-fields input[type="text"],
.inline-fields input[type="email"],
.inline-fields select {
  min-width: 10rem;
}
.api-key-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.api-key-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.api-key-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.api-key-item__name {
  font-weight: 600;
}
.lead {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 38rem;
  margin: 0 0 1.1rem;
}
.card.project-list {
  padding: 0;
  overflow: hidden;
}
.project-list a.project-row {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.project-list a.project-row:last-child {
  border-bottom: none;
}
.project-list a.project-row:hover {
  background: var(--accent-muted);
}
.project-list a.project-row .slug {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.project-list a.project-row .slug::before {
  content: "·";
  margin: 0 0.4rem;
  opacity: 0.45;
}
.project-list a.project-row .chev {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.flash {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
}
.flash.msg {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.flash.err {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.22rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  padding: var(--control-py) var(--control-px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  caret-color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.65);
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

/* Chrome / Edge / Safari: autofill ignores background-color unless overridden */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1000px var(--bg) inset;
  transition: background-color 99999s ease-out 0s;
}
input:-webkit-autofill:focus,
textarea:-webkit-autofill:focus,
select:-webkit-autofill:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 1000px var(--bg) inset, 0 0 0 2px var(--accent-muted);
}

textarea {
  max-width: 100%;
  min-height: 3rem;
  resize: vertical;
}

.row {
  margin-bottom: 0.65rem;
}

button,
.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  cursor: pointer;
  padding: var(--control-py) 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
button:hover,
.btn:hover {
  background: var(--border);
  text-decoration: none;
}
button:active,
.btn:active {
  transform: translateY(1px);
}

button.primary,
.btn.primary,
.btn-primary {
  background: linear-gradient(165deg, #2dd4bf 0%, #14b8a6 100%);
  border-color: transparent;
  color: #042f2e;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.32rem 0.75rem;
  box-shadow: 0 1px 8px rgba(45, 212, 191, 0.22);
}
button.primary:hover,
.btn.primary:hover,
.btn-primary:hover {
  background: linear-gradient(165deg, #5eead4 0%, #2dd4bf 100%);
  color: #042f2e;
  text-decoration: none;
}

.btn-block {
  width: 100%;
  max-width: none;
  text-align: center;
  margin-top: 0.35rem;
}

button.danger,
.btn.danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
}
button.danger:hover,
.btn.danger:hover {
  background: rgba(248, 113, 113, 0.15);
}

.inline-form {
  display: inline;
}

/* Row of icon buttons in invites table (overrides .inline-form for flex layout) */
.admin-invite-actions > form.inline-form {
  display: block;
  margin: 0;
  flex: 0 0 auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
th,
td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--border);
  font-size: 0.75rem;
  font-weight: 500;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.login-box {
  max-width: 360px;
  margin: 4rem auto;
}

.key-reveal {
  word-break: break-all;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
