@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500&family=Jost:wght@400;500&display=swap");

:root {
  --ink: #3a2e22;
  --muted: #667066;
  --paper: #f4f0e5;
  --panel: rgba(255, 253, 247, 0.9);
  --green: #4a5b3e;
  --deep: #2e3a26;
  --clay: #b08154;
  --line: rgba(58, 46, 34, 0.15);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, #e1ead8 0 18%, transparent 42%),
    var(--paper);
  font:
    16px/1.65 "Jost",
    sans-serif;
  font-weight: 300;
}
.admin-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}
.admin-header {
  padding: 18px 0 42px;
}
.back {
  color: var(--green);
  text-decoration: none;
  font-size: 14px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--clay);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1,
h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 400;
  color: var(--ink);
}
h1 {
  max-width: 700px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 28px;
}
.intro,
.hint {
  color: var(--muted);
}
.intro {
  max-width: 480px;
  font-size: 18px;
}
.panel {
  margin-bottom: 22px;
  padding: 32px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 12px 35px rgba(38, 49, 40, 0.06);
}
.login-panel {
  max-width: 460px;
}
form {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}
label {
  color: var(--muted);
  font-size: 14px;
}
input[type="password"],
.caption {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}
input[type="email"],
.setting-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}
button,
.upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 11px 16px;
  cursor: pointer;
  font:
    500 14px "Jost",
    sans-serif;
}
.primary {
  color: white;
  background: var(--green);
}
.secondary {
  color: var(--green);
  border-color: var(--green);
  background: transparent;
}
button:hover,
.upload:hover {
  filter: brightness(1.08);
}
.toolbar {
  position: sticky;
  top: 12px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(244, 240, 229, 0.92);
  backdrop-filter: blur(10px);
}
.toolbar .status {
  margin-right: auto;
}
.status {
  min-height: 22px;
  color: var(--green);
}
.error {
  color: #a24838;
}
.editor-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.editor-tab {
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 400;
}
.editor-tab.active {
  color: var(--deep);
  border-color: var(--line);
  background: var(--panel);
}
.preview-tab {
  margin-left: auto;
  color: var(--green);
  text-decoration: none;
}
.editor-panel[hidden] {
  display: none;
}
.hero-panel,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.hero-panel .hint {
  max-width: 560px;
  margin-bottom: 0;
}
.hint {
  margin: 7px 0 20px;
  font-size: 14px;
}
.repeat-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 26px 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
#repeatTools {
  display: none !important;
}
.repeat-tools-title {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.design-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin: 26px 0 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.design-tools .repeat-tools-title,
.design-tools .hint {
  grid-column: 1 / -1;
}
.design-tools label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.design-tools output {
  font-weight: 600;
  color: var(--ink, inherit);
}
.design-tools input[type="range"] {
  width: 100%;
  accent-color: #b08154;
}
@media (max-width: 620px) {
  .design-tools {
    grid-template-columns: 1fr;
  }
}

.repeat-tool-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}
.repeat-tool-group[hidden] {
  display: none;
}
.repeat-tool-group span {
  grid-column: 1 / -1;
  color: var(--ink);
  font:
    18px "Fraunces",
    serif;
}
.repeat-tool-group button {
  padding: 9px 8px;
}
.settings-grid,
.password-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.password-row {
  align-items: end;
}
.translation-status {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.translation-status li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.translation-status .ok {
  color: #3a6b3a;
}
.translation-status .fehler {
  color: var(--fehler, #9c4b36);
}
.text-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  margin-top: 22px;
}
.preview-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #eae3d2;
}
.preview-label {
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.75);
  font-size: 12px;
  letter-spacing: 0.04em;
}
#pagePreview {
  display: block;
  width: 1080px;
  min-width: 1080px;
  height: 720px;
  border: 0;
  background: var(--paper);
}
.text-inspector {
  align-self: start;
  position: sticky;
  top: 80px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.75);
}
.text-inspector h3 {
  margin: 0 0 8px;
  font:
    22px "Fraunces",
    serif;
}
.text-inspector label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.text-inspector textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 11px;
  color: var(--ink);
  background: white;
  font: inherit;
}
.upload input {
  display: none;
}
.gallery-list {
  display: grid;
  gap: 12px;
}
.gallery-item {
  display: grid;
  grid-template-columns: auto 110px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}
.gallery-item.drag-over {
  border-color: var(--accent, #b08154);
  box-shadow: 0 0 0 2px var(--accent, #b08154) inset;
}
.gallery-item.dragging {
  opacity: 0.5;
}
.gallery-drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 18px;
  padding: 0 4px;
  user-select: none;
}
.gallery-item img {
  width: 110px;
  height: 82px;
  object-fit: cover;
  background: var(--paper);
}
.file-name {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}
.remove {
  color: #a24838;
  background: none;
  border-color: #d7aaa0;
}
.gallery-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.empty {
  color: var(--muted);
}
@media (max-width: 620px) {
  .admin-shell {
    padding: 24px 14px 50px;
  }
  .panel {
    padding: 20px 16px;
  }
  .hero-panel,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .settings-grid,
  .password-row {
    grid-template-columns: 1fr;
  }
  .repeat-tools {
    grid-template-columns: 1fr;
  }
  .text-workspace {
    grid-template-columns: 1fr;
  }
  .text-inspector {
    position: static;
  }
  #pagePreview {
    height: 580px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .status {
    flex-basis: 100%;
  }
  .gallery-item {
    grid-template-columns: auto 76px 1fr;
  }
  .gallery-item img {
    width: 76px;
    height: 64px;
  }
  .gallery-item .gallery-actions {
    grid-column: 3;
    flex-direction: row;
    justify-self: start;
  }
  .preview-tab {
    margin-left: 0;
  }
}
