/* Palette mirrors the Android app's ui/theme/Color.kt so the two read as one
   product: near-white ground, mint wash, deep green as the single accent.
   Light-only, as the app is: color-scheme keeps the browser from rendering
   form controls and scrollbars dark for a viewer whose OS is set to dark. */
:root {
  color-scheme: light;
  --bg: #fbfdfb;          /* AppBackground */
  --surface: #ffffff;
  --border: #d3e6db;
  --text: #10221a;
  --muted: #4a6a5a;
  --accent: #2a7256;      /* DeepGreen */
  --accent-soft: #e3f1e9; /* MintWash */
  --result: #eff7f2;        /* MintWash, lightened toward the page */
  --result-border: #d5ebdf;
  --highlight: #c7e9d6;     /* DeepGreenContainer */
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1rem 3rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

header, main {
  max-width: 46rem;
  margin: 0 auto;
}

h1 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mark {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
}

.tagline {
  margin: 0.25rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- loading status --- */

.status {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.status.hidden { display: none; }

.bar {
  margin-top: 0.5rem;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

#bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease-out;
}

/* --- direction picker --- */

/* Centred rather than full-width: the two sides are a fixed label and a short
   picker, not a pair of equal controls. */
.direction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

#english {
  padding: 0.5rem 0.2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

#creole {
  font-weight: 500;
}

select {
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#swap {
  flex: none;
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

#swap:hover { background: var(--accent-soft); }

/* --- panes --- */

.panes {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 40rem) {
  .panes { grid-template-columns: 1fr; }
}

textarea, .output {
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

textarea {
  resize: vertical;
  min-height: 8rem;
}

textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.output {
  min-height: 8rem;
  white-space: pre-wrap;
  background: var(--result);
  border-color: var(--result-border);
}

.output:empty::before {
  content: "Translation appears here";
  color: var(--muted);
}

.output.working { color: var(--muted); }

.timing {
  min-height: 1.2em;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

::selection {
  background: var(--highlight);
  color: var(--text);
}

textarea {
  caret-color: var(--accent);
}
