/* The translation page, in tribalfs.com's dark One UI glass look (site/index.html). */
:root {
  --bg: #07090e;
  --surface: rgba(22, 27, 38, 0.55);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.1);
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --glow: rgba(59, 130, 246, 0.3);
  --text: #f8fafc;
  --text-2: #94a3b8;
  --muted: #64748b;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-pill: 40px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 20%, rgba(168, 85, 247, 0.12), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--blue-light); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
}
code, .key, .ph { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px 60px; }

header.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.2); }
.brand-title { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav-link, .nav-btn {
  color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 600; padding: 10px 14px;
  border-radius: var(--radius-pill); min-height: 44px; display: inline-flex; align-items: center;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.nav-btn { color: var(--text); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); }
.nav-btn:hover { background: var(--blue); border-color: transparent; box-shadow: 0 4px 20px var(--glow); }

.hero, .panel, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.hero { border-radius: var(--radius-xl); padding: 36px; margin: 8px 0 24px; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -1px; line-height: 1.15; }
.lead { color: var(--text-2); margin: 12px 0 22px; max-width: 760px; font-size: 16px; }
.lang-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lang-row label { font-weight: 600; }
select, input, textarea {
  font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px;
}
select { min-height: 44px; max-width: 100%; }
.stats { color: var(--text-2); margin-top: 14px; font-size: 14px; }
.notice { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: rgba(251, 191, 36, 0.12); color: var(--warn); }
.muted { color: var(--muted); }

.panel { border-radius: var(--radius-lg); padding: 24px; margin: 24px 0; }
.panel h2 { font-size: 20px; margin-bottom: 10px; }
.panel ul { padding-left: 20px; color: var(--text-2); }
.panel li + li { margin-top: 6px; }
.panel p + p { margin-top: 10px; }
.panel p { color: var(--text-2); }

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.pick {
  text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer;
}
.pick span { color: var(--muted); font-size: 13px; }
.pick:hover { border-color: rgba(96, 165, 250, 0.5); }

.toolbar {
  position: sticky; top: 0; z-index: 5; padding: 14px 0; display: flex; flex-direction: column; gap: 10px;
  background: rgba(7, 9, 14, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#search { width: 100%; min-height: 48px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 8px 14px; min-height: 36px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: transparent; }
.glossary summary { cursor: pointer; color: var(--blue-light); font-weight: 600; font-size: 14px; padding: 4px 0; }
.glossary[open] > div {
  max-height: 50vh; overflow: auto; margin-top: 8px; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
}
.glossary h3 { font-size: 14px; margin: 12px 0 6px; color: var(--text-2); }
.gl { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 4px 14px; font-size: 14px; }
.gl dt { color: var(--text-2); }
.gl-intro p { color: var(--text-2); font-size: 14px; }

.list { display: flex; flex-direction: column; gap: 14px; }
.more { height: 1px; }
.card { border-radius: var(--radius-lg); padding: 18px 20px; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.en { font-size: 17px; font-weight: 600; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap;
  background: rgba(96, 165, 250, 0.14); color: var(--blue-light);
}
.badge.warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.badge.ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.badge.lock { background: rgba(148, 163, 184, 0.16); color: var(--text-2); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 13px; }
.where { color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 2px 8px; }
.key { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ctx { color: var(--text-2); font-size: 14px; margin-top: 8px; }
.gl-hits { font-size: 13px; color: var(--muted); margin-top: 6px; }
.current { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); }
.label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.forms { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.forms dt { color: var(--muted); font-size: 13px; padding-top: 2px; }
.forms dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.ph {
  display: inline-block; font-size: 0.85em; padding: 0 6px; margin: 0 1px; border-radius: 6px;
  background: rgba(96, 165, 250, 0.18); color: var(--blue-light); border: 0; unicode-bidi: isolate; direction: ltr;
}
button.ph { cursor: pointer; padding: 6px 10px; min-height: 32px; }
.br, .ws { color: var(--muted); font-size: 0.8em; margin: 0 2px; }

.actions, .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.row.end { justify-content: flex-end; }
.row input { flex: 1 1 220px; }
.btn {
  font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: var(--blue); border: 1px solid transparent;
  border-radius: var(--radius-pill); padding: 10px 18px; min-height: 44px; cursor: pointer;
}
.btn.ghost { background: rgba(255, 255, 255, 0.08); border-color: var(--border); color: var(--text); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn:disabled, .vote:disabled { opacity: 0.45; cursor: default; }
.btn:not(:disabled):hover { box-shadow: 0 4px 20px var(--glow); }

.suggestions { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sug { padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.sug.accepted { border-color: rgba(52, 211, 153, 0.4); }
.sug-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.vote {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--text); background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 12px; min-height: 32px; cursor: pointer;
}

form.suggest { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.flabel { font-size: 13px; color: var(--text-2); }
textarea { width: 100%; resize: vertical; min-height: 64px; line-height: 1.5; }
.ph-row { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.problems { list-style: none; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.problems .err { color: var(--err); }
.problems .err::before { content: '✕ '; }
.problems .warn { color: var(--warn); }
.problems .warn::before { content: '! '; }
.terms { font-size: 12px; color: var(--muted); }

.mine-list { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.mine-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.mine-what { color: var(--text); }
.credits { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.credit { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-2); }
.credit b { color: var(--text); min-width: 160px; }

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 36px; padding: 28px 0; display: flex;
  justify-content: space-between; color: var(--muted); font-size: 13px; flex-wrap: wrap; gap: 12px;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-link { color: var(--text-2); text-decoration: none; }
.footer-link:hover { color: var(--blue-light); }

.check { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; z-index: 50; padding: 20px; }
.check[hidden], .toast[hidden] { display: none; }
.check-box {
  background: #111622; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 14px; align-items: center; max-width: 380px; text-align: center;
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: #1e293b;
  border: 1px solid var(--border); padding: 12px 18px; border-radius: var(--radius-pill); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 32px);
}

@media (max-width: 640px) {
  .container { padding: 0 14px 40px; }
  /* a sticky bar would cover most of a phone screen while editing */
  .toolbar { position: static; }
  /* the fade shows there are more chips past the edge */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .chip { flex: none; }
  .hero { padding: 24px 18px; border-radius: var(--radius-lg); }
  .card { padding: 16px; }
  .card-top { flex-direction: column; }
  .badges { justify-content: flex-start; }
  .gl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
