:root {
  --ink: #18231f;
  --muted: #66716d;
  --green: #173d34;
  --green-bright: #256657;
  --blue: #245f8b;
  --paper: #f4f6f5;
  --white: #ffffff;
  --line: #d8dfdc;
  --line-dark: #bdc9c4;
  --amber-bg: #fff4d8;
  --amber-ink: #684b0d;
  --red: #9b302d;
  --red-bg: #fff0ef;
  --green-bg: #eaf5f0;
  --shadow: 0 14px 35px rgb(18 39 32 / 10%);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.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;
}

.admin-header {
  min-height: 72px;
  padding: 10px max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--white);
  background: var(--green);
  border-bottom: 3px solid #c58b4f;
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--white);
  text-decoration: none;
}

.admin-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green);
  background: #e6b274;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 800;
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.admin-brand small {
  margin-top: 2px;
  color: #c7d6d1;
  font-size: 10px;
  text-transform: uppercase;
}

.admin-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.admin-header nav > a,
.quiet-link,
.quiet-button {
  color: inherit;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.admin-header nav > a:hover,
.admin-header nav > a:focus-visible,
.quiet-link:hover,
.quiet-link:focus-visible,
.quiet-button:hover,
.quiet-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.admin-footer {
  min-height: 66px;
  padding: 18px max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #c7d2ce;
  background: var(--ink);
  font-size: 11px;
}

.admin-main {
  width: min(1240px, calc(100% - 48px));
  min-height: calc(100vh - 138px);
  margin: 0 auto;
  padding: 54px 0 72px;
}

.narrow-main {
  width: min(1020px, calc(100% - 48px));
}

.page-heading {
  margin-bottom: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.compact-heading {
  align-items: center;
}

.page-heading h1 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1.08;
  font-weight: 700;
}

.page-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0;
  color: var(--green-bright);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  gap: 20px;
  color: var(--green);
}

.primary-button,
.secondary-button,
.danger-button,
.primary-link,
.row-action {
  min-height: 40px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button,
.primary-link {
  color: var(--white);
  background: var(--green);
}

.primary-button:hover,
.primary-link:hover {
  background: var(--green-bright);
}

.secondary-button,
.row-action {
  color: var(--green);
  background: var(--white);
  border-color: var(--line-dark);
}

.secondary-button:hover,
.row-action:hover {
  border-color: var(--green);
}

.danger-button {
  color: var(--white);
  background: var(--red);
}

.danger-link {
  padding: 6px 0;
  color: var(--red);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.notice {
  margin: 0 0 22px;
  padding: 13px 15px;
  border-left: 4px solid;
  font-size: 13px;
  line-height: 1.5;
}

.notice ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.notice.success {
  color: #18513f;
  background: var(--green-bg);
  border-color: #2b7c62;
}

.notice.error {
  color: #712320;
  background: var(--red-bg);
  border-color: var(--red);
}

.notice.warning {
  color: var(--amber-ink);
  background: var(--amber-bg);
  border-color: #c88a21;
}

.workspace-section,
.workspace-form.account-form {
  margin-bottom: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 4px 18px rgb(18 39 32 / 4%);
}

.section-bar {
  min-height: 60px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.section-bar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.section-bar > span:not(.status-label) {
  color: var(--muted);
  font-size: 12px;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 150px auto;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  outline: none;
}

textarea {
  min-height: 94px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(36 95 139 / 14%);
}

input[type="file"] {
  min-height: 45px;
  padding: 7px;
  background: var(--paper);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--green-bright);
}

.record-table-wrap {
  overflow-x: auto;
}

.record-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.record-table th,
.record-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #e6ebe9;
  vertical-align: middle;
}

.record-table th {
  color: var(--muted);
  background: #f8faf9;
  font-size: 10px;
  text-transform: uppercase;
}

.record-table tbody tr:last-child td {
  border-bottom: 0;
}

.record-table td:first-child {
  width: 43%;
}

.record-table td strong,
.record-table td small {
  display: block;
}

.record-table td strong {
  line-height: 1.35;
}

.record-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.status-label {
  min-width: 72px;
  padding: 4px 7px;
  display: inline-flex;
  justify-content: center;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-label.published {
  color: #18513f;
  background: var(--green-bg);
}

.status-label.draft {
  color: #5d6470;
  background: #edf0f2;
}

.row-action {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.empty-cell {
  padding: 30px 18px !important;
  color: var(--muted);
  text-align: center !important;
}

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

.activity-list li {
  min-height: 54px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: 190px minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #e6ebe9;
  font-size: 12px;
}

.activity-list li:last-child {
  border-bottom: 0;
}

.activity-list li > span {
  color: var(--green-bright);
  font-weight: 800;
  text-transform: capitalize;
}

.activity-list li > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-list li > small {
  color: var(--muted);
}

.workspace-form {
  padding: 24px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

label > span {
  margin-bottom: 6px;
  display: block;
  color: #3f4b46;
  font-size: 11px;
  font-weight: 800;
}

label > small,
[data-file-summary] {
  margin-top: 5px;
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.toggle-field {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.toggle-field > span {
  margin: 0;
}

.compact-toggle {
  margin-top: 0;
}

.form-actions {
  margin-top: 24px;
  padding-top: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.upload-fields {
  margin-top: 24px;
  padding-top: 22px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.upload-meter {
  min-width: 260px;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.upload-meter progress {
  width: 100%;
  height: 8px;
  accent-color: var(--blue);
}

.cover-editor {
  padding: 20px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
}

.cover-editor img {
  width: 260px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--paper);
  border: 1px solid var(--line);
}

.cover-editor form {
  display: grid;
  gap: 13px;
  justify-items: start;
}

.asset-list {
  padding: 0 20px;
}

.asset-row {
  padding: 18px 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(360px, 1.5fr) auto;
  align-items: end;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.asset-file {
  min-width: 0;
}

.asset-file strong,
.asset-file small,
.asset-file a {
  display: block;
}

.asset-file strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}

.asset-file small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.asset-file a {
  margin-top: 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.translation-summary {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.translation-summary a {
  margin: 0;
}

.translation-status {
  width: fit-content;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  color: #3f4a46;
  background: #eef1f0;
  border: 1px solid #d3d9d6;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.asset-file > .translation-status {
  margin-top: 10px;
}

.status-published {
  color: #18513f;
  background: var(--green-bg);
  border-color: #8fc4b2;
}

.status-needs-review,
.status-queued,
.status-processing {
  color: var(--amber-ink);
  background: var(--amber-bg);
  border-color: #e2bf75;
}

.status-failed {
  color: #712320;
  background: var(--red-bg);
  border-color: #e3aaa7;
}

.status-not-applicable,
.status-unsupported {
  color: var(--muted);
  background: #f3f5f4;
}

.translation-overview .section-bar .translation-status {
  font-size: 10px;
}

.translation-facts {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

.translation-facts div {
  min-width: 0;
}

.translation-facts span,
.translation-facts strong {
  display: block;
}

.translation-facts span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.translation-facts strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.processing-note,
.translation-command,
.translation-error {
  margin: 0 20px 20px;
}

.processing-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.translation-error {
  overflow-wrap: anywhere;
}

.translation-review-form {
  overflow: hidden;
}

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

.translation-editor-grid label > span {
  margin-bottom: 7px;
  display: block;
  font-size: 11px;
  font-weight: 800;
}

.translation-editor-grid textarea {
  min-height: 360px;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 12px;
}

.caption-editor {
  border-top: 1px solid var(--line);
}

.caption-editor summary {
  padding: 16px 20px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.caption-editor[open] summary {
  border-bottom: 1px solid var(--line);
}

.caption-editor .translation-editor-grid textarea {
  min-height: 310px;
}

.translation-publish-bar {
  min-height: 70px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: #f4f7f6;
  border-top: 1px solid var(--line);
}

.translation-secondary-actions {
  margin-top: -10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.asset-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  align-items: end;
  gap: 9px;
}

.asset-form input[type="text"] {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
}

.asset-form .secondary-button {
  min-height: 36px;
  padding: 7px 10px;
  white-space: nowrap;
}

.add-assets-form {
  margin: 20px;
  padding: 17px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 14px;
  background: #f4f7f6;
  border: 1px solid var(--line);
}

.add-assets-form .upload-meter {
  grid-column: 1 / -1;
}

.danger-section {
  border-color: #e3c4c2;
  box-shadow: none;
}

.danger-section .section-bar {
  color: var(--red);
  background: var(--red-bg);
  border-color: #e3c4c2;
}

.danger-section form {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.account-main {
  max-width: 720px;
}

.account-form {
  display: grid;
  gap: 18px;
}

.auth-page {
  background: #edf2f0;
}

.auth-main {
  min-height: calc(100vh - 138px);
  padding: 70px 24px;
  display: grid;
  place-items: start center;
}

.auth-panel {
  width: min(440px, 100%);
  padding: 36px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid #c58b4f;
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 5px 0 25px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.auth-panel > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.stack-form .primary-button {
  width: 100%;
  margin-top: 2px;
}

.auth-secondary {
  margin-top: 22px;
  display: inline-block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .admin-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .admin-header nav {
    gap: 14px;
  }

  .admin-header nav > a:nth-of-type(3) {
    display: none;
  }

  .filter-form {
    grid-template-columns: minmax(180px, 1fr) 140px auto;
  }

  .asset-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .asset-form {
    grid-template-columns: 1fr 1fr auto;
  }

  .translation-editor-grid {
    grid-template-columns: 1fr;
  }

  .asset-form .compact-toggle {
    grid-column: 1 / 2;
  }

  .translation-facts {
    grid-template-columns: 1fr;
  }

  .translation-publish-bar,
  .translation-secondary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .activity-list li {
    grid-template-columns: 150px minmax(150px, 1fr);
  }

  .activity-list li > small {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .admin-header {
    min-height: 64px;
  }

  .admin-brand small,
  .admin-header nav > a,
  .admin-header .quiet-button {
    display: none;
  }

  .admin-header nav > a:first-child,
  .admin-header nav > a:nth-child(2) {
    display: block;
  }

  .admin-main,
  .narrow-main {
    width: min(100% - 28px, 1240px);
    padding: 34px 0 52px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .page-heading h1 {
    font-size: 31px;
    overflow-wrap: anywhere;
  }

  .section-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-form {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .record-table {
    min-width: 760px;
  }

  .field-grid,
  .upload-fields {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .workspace-form {
    padding: 18px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-meter {
    min-width: 0;
  }

  .cover-editor {
    grid-template-columns: 1fr;
  }

  .cover-editor img {
    width: 100%;
  }

  .asset-list {
    padding: 0 16px;
  }

  .asset-form {
    grid-template-columns: 1fr;
  }

  .asset-form .compact-toggle {
    grid-column: auto;
  }

  .add-assets-form,
  .danger-section form {
    grid-template-columns: 1fr;
  }

  .activity-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .activity-list li > small {
    grid-column: auto;
  }

  .auth-main {
    padding: 30px 14px;
  }

  .auth-panel {
    padding: 28px 22px;
  }

  .admin-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
