:root {
  --bg: #f5f5f2;
  --panel: #ffffff;
  --ink: #20201d;
  --muted: #64655f;
  --line: #d9d8d0;
  --accent: #0f766e;
  --accent-dark: #0a5d57;
  --danger: #b42318;
  --danger-bg: #fff0ed;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  max-width: 1340px;
  margin: 0 auto;
  padding: 24px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; }
p, .meta, .eyebrow { color: var(--muted); }

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

.input-panel,
.output-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 74vh;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
}

input, select { margin-bottom: 14px; }

textarea {
  min-height: 48vh;
  line-height: 1.5;
  resize: vertical;
}

.actions,
.copy-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.progress {
  margin-top: 12px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border: 1px solid #b9d8d4;
  border-radius: 999px;
  background: #eef7f5;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .35s ease;
}

.progress-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 10px 13px;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { background: #fff; color: var(--accent); }

.output-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 10px;
  color: var(--muted);
}
.status.ok { color: var(--accent); border-color: #a8d8d1; }
.status.bad { color: var(--danger); border-color: #ffc7bd; }

.meta {
  min-height: 24px;
  margin: 14px 0 8px;
  font-size: 14px;
}

.notice {
  border: 1px solid #ffc7bd;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 10px 0;
}

.excerpt,
.translation {
  white-space: pre-wrap;
  line-height: 1.55;
}

#translatedTitle[contenteditable="true"],
.excerpt[contenteditable="true"],
.translation[contenteditable="true"] {
  outline: none;
}

#translatedTitle[contenteditable="true"]:focus,
.excerpt[contenteditable="true"]:focus,
.translation[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px #b9d8d4;
  border-radius: 4px;
}

.translation {
  min-height: 36vh;
  font-size: 17px;
}

.feedback {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#correctionBox {
  flex: 1 0 100%;
}

#correctionBox textarea {
  min-height: 110px;
}

.checkbox {
  font-weight: 400;
  display: flex;
  gap: 8px;
  align-items: center;
}

.checkbox input {
  width: auto;
  margin: 0;
}

@media (max-width: 900px) {
  .app-shell { padding: 14px; }
  .masthead, .workspace, .output-header { display: block; }
  .status { display: inline-block; margin-top: 12px; }
  .input-panel, .output-panel { min-height: auto; margin-bottom: 14px; }
  .copy-buttons { margin-top: 12px; }
}
