:root {
  --red: #e10600;
  --red-dark: #b70500;
  --ink: #0e0e0f;
  --iron: #3b3d42;
  --slate: #6b6f78;
  --line: #e3e4e7;
  --line-soft: #eef0f2;
  --paper: #f6f7f8;
  --white: #fff;
  --ok: #1d8a4e;
  --warn: #b26b00;
  --radius: 6px;
  --shadow: 0 1px 2px rgb(14 14 15 / 0.06), 0 8px 24px rgb(14 14 15 / 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

[hidden] {
  display: none !important;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
  padding: 0 24px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.top::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0 180px, transparent 180px);
}

.top__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.top__brand img {
  display: block;
  height: 34px;
  width: auto;
}

.top__brand span {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.top__nav {
  display: flex;
  gap: 4px;
}

.top__nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  color: var(--iron);
}

.top__nav a:hover {
  background: var(--paper);
}

.top__nav a.is-active {
  background: var(--ink);
  color: var(--white);
}

.top__user {
  margin-left: auto;
  font-size: 13px;
  color: var(--slate);
}

.badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 120px;
  outline: none;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: 26px;
  letter-spacing: -0.01em;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--slate);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  border-color: var(--iron);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.btn--primary:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.btn--dark {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.btn--dark:hover {
  background: var(--iron);
}

.btn--danger {
  color: var(--red-dark);
}

.btn--small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn--link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red-dark);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.card__head h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card__body {
  padding: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.filters input[type='search'] {
  flex: 1 1 260px;
}

.input,
.filters input,
.filters select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.filters select {
  width: auto;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.field textarea.is-mono {
  font-family: var(--mono);
  font-size: 13px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  color: var(--slate);
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tbody tr {
  cursor: pointer;
}

.table tbody tr:hover {
  background: #fafafa;
}

.table .num {
  text-align: right;
  white-space: nowrap;
}

.thumb {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.name {
  font-weight: 650;
}

.sub {
  font-size: 13px;
  color: var(--slate);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pill--live {
  background: #e7f5ed;
  color: var(--ok);
}

.pill--hidden {
  background: #f0f0f2;
  color: var(--slate);
}

.pill--draft {
  background: #fff4e0;
  color: var(--warn);
}

.pill--changed {
  background: #fdeceb;
  color: var(--red-dark);
}

.pill--added {
  background: #e7f5ed;
  color: var(--ok);
}

.pill--updated {
  background: #eaf1fb;
  color: #1f5fae;
}

.pill--restored {
  background: #e7f5ed;
  color: var(--ok);
}

.count {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--slate);
}

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.editor__main {
  display: grid;
  gap: 20px;
}

.editor__side {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 20px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
}

.back:hover {
  color: var(--ink);
}

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

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.span-all {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.field > span {
  font-size: 13px;
  font-weight: 650;
  color: var(--iron);
}

.field small {
  font-size: 12.5px;
  color: var(--slate);
}

.field.is-error input,
.field.is-error textarea,
.field.is-error select {
  border-color: var(--red);
  background: #fff8f8;
}

.field .error {
  font-size: 13px;
  font-weight: 600;
  color: var(--red-dark);
}

.locked {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
}

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

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.check:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.check input,
.field .check input {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--red);
}

.spec-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
}

.spec-preview__row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.spec-preview__row dt {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spec-preview__row dt small {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--slate);
}

.spec-preview__row dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.spec-preview__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-dark);
}

.chip {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
}

.chip--bad {
  border-color: var(--red);
  color: var(--red-dark);
  background: #fff4f3;
}

.media {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.media.is-over {
  border-color: var(--red);
  background: #fff6f5;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media__empty {
  display: grid;
  gap: 6px;
  padding: 20px;
  text-align: center;
  color: var(--slate);
  font-size: 14px;
}

.media__empty strong {
  color: var(--ink);
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row a {
  font-size: 13px;
  font-weight: 600;
  color: var(--red-dark);
}

.note {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--ink);
  background: var(--paper);
  font-size: 13.5px;
  color: var(--iron);
}

.note--warn {
  border-color: var(--warn);
  background: #fff8ec;
}

.note--ok {
  border-color: var(--ok);
  background: #eef8f2;
}

.stack {
  display: grid;
  gap: 12px;
}

.savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 24px;
  background: rgb(255 255 255 / 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.savebar__state {
  margin-right: auto;
  font-size: 14px;
  color: var(--slate);
}

.savebar__state.is-dirty {
  font-weight: 650;
  color: var(--warn);
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 420px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in 0.25s ease;
}

.toast--error {
  background: var(--red-dark);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgb(14 14 15 / 0.3);
}

dialog::backdrop {
  background: rgb(14 14 15 / 0.45);
}

dialog form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

dialog h2 {
  font-size: 20px;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.empty {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 40px;
}

.empty h2 {
  font-size: 22px;
}

.empty p {
  margin: 0;
  max-width: 60ch;
  color: var(--iron);
}

.changes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.changes li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.loading {
  padding: 60px;
  text-align: center;
  color: var(--slate);
}

@media (max-width: 1024px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor__side {
    position: static;
  }
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
    gap: 8px 12px;
    height: auto;
    padding: 10px 12px 8px;
  }

  .top__brand img {
    height: 28px;
  }

  .top__nav {
    width: 100%;
  }

  .top__nav a {
    flex: 1;
    justify-content: center;
    padding: 8px 6px;
  }

  .page-head h1 {
    font-size: 22px;
  }

  .top__brand span,
  .top__user {
    display: none;
  }

  .app {
    padding: 20px 12px 120px;
  }

  .grid,
  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: auto;
  }

  .table .hide-sm {
    display: none;
  }

  .spec-preview__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .changes li {
    grid-template-columns: minmax(0, 1fr);
  }
}

.german-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 13px;
}
.german-mode > span {
  font-weight: 600;
  margin-right: 4px;
}
.german-mode label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.german-mode input {
  width: auto;
  margin: 0;
  accent-color: var(--red);
}
.field.is-auto textarea,
.field input[readonly] {
  background: var(--paper);
  color: var(--iron);
}
.chip--muted {
  opacity: 0.65;
}
#read-specs,
#translate-now {
  align-self: flex-start;
}

.is-signed-out .top__nav,
.is-signed-out .top__user,
.is-signed-out .top__signout {
  display: none;
}
.top__signout {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  opacity: 0.75;
  cursor: pointer;
  padding: 4px 0;
}
.top__signout:hover {
  opacity: 1;
  text-decoration: underline;
}
.login {
  max-width: 400px;
  margin: 8vh auto 0;
  padding: 32px;
  display: grid;
  gap: 18px;
}
.login img {
  height: auto;
}
.login h1 {
  margin: 0;
  font-size: 20px;
}
#login-step {
  display: grid;
  gap: 14px;
}
.login .btn {
  justify-content: center;
}
.login__error {
  margin: 0;
  color: var(--red-dark);
  font-size: 14px;
}
.enroll {
  display: grid;
  gap: 10px;
  font-size: 14px;
}
.enroll p {
  margin: 0;
}
.enroll__qr {
  width: 200px;
  justify-self: center;
  background: var(--white);
}
.enroll__key {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  background: var(--paper);
  border-radius: var(--radius);
  word-break: break-all;
}
