/* Pular Translator — dark slate + gold.
   Plain CSS, owned by us. No framework can strip or re-inject it. */

:root {
  --bg: #15171E;
  --panel: #1C1F28;
  --raised: #252936;
  --line: #2C313F;
  --line-strong: #3A4050;
  --text: #E8E6E1;
  --muted: #8E94A6;
  --accent: #E2B04A;
  --ink: #1B1405;
  --ok: #9FD3A5;
  --warn: #E8A15A;
}

* { box-sizing: border-box; }

/* An author display rule beats the UA rule for [hidden]; force it. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 1400px; margin: 0 auto; padding: 40px 28px 56px; }

/* ---------- header ---------- */
.app-head h1 {
  font-size: 2.35rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin: 0 0 10px;
}
.app-head .sub { color: var(--muted); font-size: 1rem; margin: 0 0 34px; }

/* ---------- language row ---------- */
.lang-row {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.lang-label {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding-top: 8px;
  min-width: 90px;
}
.lang-select {
  appearance: none;
  background: var(--panel) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%238E94A6' stroke-width='1.6' stroke-linecap='round'/></svg>") no-repeat right 14px center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 9px 38px 9px 14px;
  min-width: 240px;
  cursor: pointer;
}
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lang-hint { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.55; }
.hint-gold { color: var(--accent); }

/* ---------- translator row ---------- */
.lang-row2 {
  display: grid;
  grid-template-columns: 1fr 112px 1fr;
  gap: 14px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s ease;
  min-width: 0;
}
.card:focus-within { border-color: var(--line-strong); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.lang-name { font-size: 0.9rem; font-weight: 600; letter-spacing: -0.01em; }

.editor {
  flex: 1;
  width: 100%;
  min-height: 190px;
  resize: none;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 1.02rem;
  line-height: 1.65;
  padding: 14px 18px 18px;
}
.editor:focus { outline: none; }
.editor::placeholder { color: #70768B; }
.editor[readonly] { cursor: text; }

/* ---------- Pular letters ---------- */
.char-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}
.char-bar-label { color: var(--muted); font-size: 0.78rem; }
.char-keys { display: flex; gap: 7px; }
.char-key {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
  padding: 7px 11px;
  cursor: pointer;
}
.char-key:hover { border-color: var(--line-strong); }
.char-bar-hint { color: #70768B; font-size: 0.78rem; margin-left: auto; }

.adlam-note {
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}
.adlam-tag {
  display: inline-block;
  background: var(--accent);
  color: var(--ink);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-right: 6px;
}

/* ---------- footer of each card ---------- */
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}
.stats { display: flex; gap: 14px; color: var(--muted); font-size: 0.8rem; }
.stats b { color: var(--text); font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.primary {
  background: var(--accent);
  color: var(--ink);
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  padding: 12px 20px;
  cursor: pointer;
  min-width: 112px;
}
.primary:hover:not(:disabled) { filter: brightness(1.06); }
.primary:disabled { opacity: .65; cursor: progress; }
.primary.small { font-size: 0.86rem; padding: 9px 16px; min-width: 0; }

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  padding: 6px 14px;
  cursor: pointer;
}
.ghost:hover { border-color: var(--line-strong); background: var(--raised); }
.ghost.small { font-size: 0.82rem; padding: 9px 14px; }

/* ---------- center rail ---------- */
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 6px;
}
.swap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.swap:hover { border-color: var(--line-strong); }
.rail-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-hint { color: #70768B; font-size: 0.76rem; }

/* ---------- status ---------- */
.status { min-height: 0; color: var(--muted); font-size: 0.84rem; margin: 10px 2px 0; text-align: right; }
.status:empty { display: none; }
.status.active { color: var(--text); }

/* ---------- rating strip ---------- */
.rate-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 2px 8px;
}
.rate-question { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.rate-note { color: #70768B; font-size: 0.76rem; white-space: nowrap; margin-left: auto; }
.rate-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  padding: 4px 11px;
  cursor: pointer;
  white-space: nowrap;
}
.rate-btn:hover { border-color: var(--line-strong); background: var(--raised); }
.rate-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- feedback drawer ---------- */
.feedback-drawer {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 13px 15px 15px;
  margin-bottom: 8px;
}
.field-label { display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 6px; }
.field {
  width: 100%;
  background: #14161C;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 10px 12px;
}
.field:focus { outline: none; border-color: var(--line-strong); }
.field::placeholder { color: #70768B; }
.drawer-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.consent { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 7px; }
.feedback-status { color: var(--muted); font-size: 0.8rem; margin: 2px 2px 8px; }
.feedback-status.ok { color: var(--ok); }
.feedback-status.warn { color: var(--warn); }

/* ---------- accordion ---------- */
.accordion {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 14px;
}
.accordion > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::after { content: "▾"; float: right; color: var(--muted); }
.accordion[open] > summary::after { content: "▴"; }
.accordion-body { padding: 0 18px 16px; }
.accordion-body .muted { color: var(--muted); font-size: 0.88rem; margin: 0 0 12px; }
.accordion-body ul { margin: 0; padding-left: 0; list-style: none; }
.accordion-body li {
  position: relative;
  padding-left: 1.15rem;
  margin: 8px 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #C7C9D1;
}
.accordion-body li::before { content: "•"; position: absolute; left: 0; color: var(--muted); }
.accordion-body b { color: var(--text); }

.app-foot { color: #70768B; font-size: 0.8rem; margin-top: 26px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { padding: 28px 16px 44px; }
  .app-head h1 { font-size: 1.9rem; }
  .lang-row2 { grid-template-columns: 1fr; }
  .rail { flex-direction: row; align-items: center; justify-content: center; padding: 4px 0 10px; }
  .rail-actions { flex-direction: row; align-items: center; }
  .editor { min-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
