:root {
  --panel: #fffefa;
  --field: #f1f2eb;
  --danger: #943e34;
  --success: #48623c;
  --radius: 12px;
}
body {
  min-height: 100dvh;
}
textarea {
  font: inherit;
  resize: vertical;
}
button,
input,
select,
textarea {
  font: inherit;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d9ded2;
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
}
textarea {
  min-height: 116px;
  line-height: 1.65;
}
textarea:focus-visible {
  outline: 3px solid #a1ac76;
  outline-offset: 3px;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #586350;
}
.field small,
.hint {
  color: var(--muted);
  line-height: 1.7;
  font-size: 12px;
}
.field input[type="file"] {
  font-size: 12px;
  background: #fff;
  padding: 10px;
}
input[type="checkbox"] {
  width: auto;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
p {
  line-height: 1.7;
}
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid #a1ac76;
  outline-offset: 3px;
}
.button {
  min-height: 38px;
  justify-content: center;
}
.button.danger {
  color: var(--danger);
  border: 1px solid #e1c1b9;
  background: #fff8f4;
}
.button:disabled {
  cursor: wait;
}
.auth-page {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.auth-shell {
  width: min(420px, 100%);
}
.auth-brand {
  margin: 0 0 30px;
}
.auth-brand img {
  width: 44px;
  height: 44px;
}
.auth-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: 30px;
}
.auth-card h1 {
  font-size: 25px;
}
.auth-card > p {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 24px;
}
.auth-card form {
  display: grid;
  gap: 18px;
}
.auth-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 12px;
  margin-top: 23px;
  color: var(--muted);
}
.message {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  background: #edf0e3;
  color: #48623c;
  overflow-wrap: anywhere;
}
.message.error {
  background: #fff0e9;
  color: #883d32;
}
.message.info {
  background: #edf0e8;
  color: #57654d;
}
.message:empty {
  display: none;
}
.app-top {
  padding: 22px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.app-top .brand {
  font-size: 21px;
}
.app-top .brand img {
  width: 42px;
  height: 42px;
}
.app-links,
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.app-links {
  font-size: 12px;
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 38px;
  padding: 28px 0 60px;
  align-items: start;
}
.workspace-nav {
  display: grid;
  gap: 5px;
  position: sticky;
  top: 24px;
}
.nav-section {
  margin: 18px 12px 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
}
.workspace-nav button {
  text-align: left;
  font-size: 13px;
  padding: 12px;
  border-radius: 9px;
}
.workspace-nav button[aria-current="page"] {
  background: #e9eddf;
  color: #3e5144;
  font-weight: 650;
}
.workspace-nav button:hover {
  background: #eef0e7;
}
.workspace-main {
  min-width: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}
.page-heading .actions {
  flex-shrink: 0;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 22px;
  margin-top: 18px;
}
.panel:first-child {
  margin-top: 0;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.full {
  grid-column: 1/-1;
}
.field-group {
  display: grid;
  gap: 18px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.list {
  display: grid;
  gap: 10px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .grow {
  flex: 1;
  min-width: 0;
}
.list-row h3 {
  margin-bottom: 5px;
}
.list-row p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.list-row .thumb {
  width: 48px;
  height: 64px;
  border-radius: 7px;
  background: #edf0e3;
  object-fit: contain;
  flex-shrink: 0;
}
.list-row .actions {
  justify-content: flex-end;
}
.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef0e7;
  color: #5d6d53;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}
.pill.conflict,
.pill.failed,
.pill.needs_revalidation {
  background: #f7e9df;
  color: #8b4b34;
}
.pill.published,
.pill.completed,
.pill.succeeded {
  background: #e5edda;
  color: #4a6239;
}
.pill.cancelled {
  background: #eee;
  color: #777;
}
.toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.toolbar-row input {
  flex: 1;
}
.empty-state {
  padding: 45px 22px;
  text-align: center;
  border: 1px dashed #d5dccb;
  border-radius: 13px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state p {
  margin: 8px 0 18px;
}
.form-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px;
  margin-top: 16px;
  background: #fafbf6;
}
.form-card .panel-title {
  margin-bottom: 18px;
}
.image-editor {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}
.image-editor .image-preview {
  width: 112px;
  height: 145px;
  object-fit: contain;
  background: #edf0e3;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.image-placeholder {
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}
.editor-footer {
  position: sticky;
  bottom: 14px;
  border: 1px solid #d9dece;
  border-radius: 12px;
  background: #faf9f5f5;
  padding: 13px 16px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 5px 20px #303b3510;
}
.editor-footer .hint {
  margin: 0;
}
.split-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.diff-side {
  min-width: 0;
  background: #f0f2e9;
  border-radius: 10px;
  padding: 16px;
}
.diff-side.incoming {
  background: #eaf0e2;
}
.diff-side h4 {
  margin: 0 0 10px;
  font-size: 12px;
  color: #58694c;
}
.diff-side p {
  margin: 5px 0;
  font-size: 12px;
}
.diff-side pre {
  max-height: 220px;
  background: #ffffff70;
  font-size: 11px;
  margin: 7px 0;
}
.diff-side img {
  max-height: 150px;
  object-fit: contain;
  margin: 10px auto;
}
.diff-form {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.change-detail {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.change-detail > summary {
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  list-style: none;
}
.change-detail > summary::before {
  content: "+";
  font-size: 18px;
  color: var(--muted);
}
.change-detail[open] > summary::before {
  content: "−";
}
.change-detail .split-preview {
  margin-top: 16px;
}
.confirm-dialog {
  width: min(520px, calc(100% - 30px));
  padding: 26px;
}
.confirm-dialog p {
  font-size: 13px;
  color: var(--muted);
}
.confirm-dialog .actions {
  justify-content: flex-end;
  margin-top: 24px;
}
.preview-dialog {
  width: min(940px, calc(100% - 30px));
  padding: 26px;
}
.preview-dialog .preview-forms {
  display: flex;
  gap: 18px;
  overflow: auto;
  margin-top: 20px;
  padding-bottom: 10px;
}
.preview-form {
  flex: 0 0 245px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px;
  background: #fff;
}
.preview-form img {
  height: 280px;
  width: 100%;
  object-fit: contain;
  background: #edf0e3;
  border-radius: 9px;
}
.preview-form pre {
  margin-top: 12px;
  max-height: 180px;
}
.one-time-secret {
  font:
    600 20px/1.7 ui-monospace,
    monospace;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
  padding: 15px;
  background: #edf0e3;
  border-radius: 9px;
  user-select: all;
}
.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  background: #edf0e3;
  border-radius: 12px;
  margin: 0 0 20px;
  font-size: 12px;
  line-height: 1.7;
}
.section-stack {
  display: grid;
  gap: 20px;
}
.section-stack > .panel {
  margin: 0;
}
.upload-progress {
  display: block;
  width: 100%;
  height: 8px;
  accent-color: var(--green);
  margin: 15px 0 5px;
}
.account-meta {
  font-variant-numeric: tabular-nums;
}
.secret-warning {
  font-size: 12px;
  color: #87603b;
}
.loading {
  color: var(--muted);
  padding: 36px 0;
  font-size: 13px;
}
.inline-error {
  color: var(--danger);
  font-size: 12px;
}
.compare-body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.compare-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.compare-bar select {
  width: auto;
}
.compare-frames {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
}
.compare-frame {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.compare-frame h2 {
  font-size: 12px;
  padding: 9px 16px;
  margin: 0;
  background: #edf0e3;
}
.compare-frame iframe {
  border: 0;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.compare-frame + .compare-frame {
  border-left: 1px solid var(--line);
}
.compare-frames.single {
  display: block;
}
.compare-frames.single .compare-frame {
  height: 100%;
}
.compare-label {
  margin-left: auto;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 24px;
  }
  .page-heading {
    flex-wrap: wrap;
  }
  .list-row {
    gap: 12px;
  }
  .list-row .actions {
    max-width: 220px;
  }
  .panel {
    padding: 18px;
  }
}
@media (max-width: 700px) {
  .app-top {
    padding: 18px 0;
    flex-wrap: wrap;
    gap: 14px;
  }
  .app-top .brand {
    font-size: 19px;
  }
  .app-links {
    width: 100%;
    justify-content: space-between;
  }
  .workspace {
    display: block;
    padding-top: 18px;
  }
  .workspace-nav {
    position: static;
    display: flex;
    overflow: auto;
    gap: 5px;
    margin-bottom: 24px;
    padding-bottom: 8px;
  }
  .workspace-nav button {
    white-space: nowrap;
    padding: 10px 12px;
  }
  .nav-section {
    display: none;
  }
  .workspace-main {
    width: 100%;
  }
  .page-heading {
    gap: 14px;
    margin-bottom: 18px;
  }
  h1 {
    font-size: 25px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 17px;
  }
  .list-row {
    flex-wrap: wrap;
  }
  .list-row .grow {
    min-width: 160px;
  }
  .list-row .actions {
    max-width: none;
  }
  .list-row .thumb {
    width: 42px;
    height: 56px;
  }
  .split-preview {
    grid-template-columns: 1fr;
  }
  .image-editor {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px;
  }
  .image-editor .image-preview {
    width: 80px;
    height: 115px;
  }
  .form-card {
    padding: 15px;
  }
  .editor-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    bottom: 8px;
  }
  .editor-footer .actions {
    justify-content: flex-end;
  }
  .status-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .auth-card {
    padding: 25px;
  }
  .compare-bar {
    flex-wrap: wrap;
  }
  .compare-label {
    width: 100%;
    margin-left: 0;
  }
  .compare-frames {
    grid-template-columns: 1fr;
  }
  .compare-frames:not(.single) .compare-frame {
    min-height: 50%;
  }
  .compare-frames:not(.single) {
    overflow: auto;
    display: flex;
    flex-direction: column;
  }
}
.workspace .drop-zone strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.workspace .field > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.workspace .drop-zone {
  min-height: 126px;
  justify-content: center;
}

.app-links #identity {
  max-width: 100%;
  overflow-wrap: anywhere;
}
