:root {
  --bg: #E4E7EA;
  --panel: #F3F5F6;
  --ink: #1a222c;
  --muted: #4a5563;
  --line: #cfd5db;
  --accent: #0f5f63;
  --accent-2: #c45c26;
  --ok: #1f7a4d;
  --warn: #a15c12;
  --bad: #a33b32;
  --nav: #161b22;
  --nav-ink: #eef2f6;
  --nav-active: rgba(255,255,255,0.09);
  --shadow: 0 8px 18px rgba(28, 36, 48, 0.06);
  --radius: 14px;
  --graphite: #12161c;
  font-family: "Segoe UI", "Helvetica Neue", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { margin: 0; min-height: 100%; overflow-x: hidden; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); display: flex; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav {
  width: 268px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 28%),
    var(--nav);
  color: var(--nav-ink);
  min-height: 100vh;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark-wrap {
  width: 76px; height: 76px; border-radius: 16px;
  background: #fff; overflow: hidden; flex: 0 0 76px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
  display: grid; place-items: center;
}
.brand-mark {
  width: 76px; height: 76px; display: block;
  object-fit: cover; object-position: center;
  transform: scale(1.82);
}
.brand strong { display: block; letter-spacing: 0.08em; font-size: 19px; }
.brand .byline { display: block; font-size: 13px; opacity: 0.68; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 3px; }
.brand span { display: block; font-size: 12px; opacity: 0.72; max-width: 160px; line-height: 1.3; }
.nav a {
  display: block; color: var(--nav-ink); text-decoration: none;
  padding: 12px 12px; border-radius: 10px; opacity: 0.82;
  border-left: 3px solid transparent;
  min-height: 44px;
}
.nav a.active {
  background: var(--nav-active); opacity: 1;
  border-left-color: #c9d6e0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.nav a:hover { background: rgba(255,255,255,0.06); opacity: 1; }
.nav-foot { margin-top: auto; font-size: 12px; opacity: 0.55; }
#app { flex: 1; padding: 36px 44px 72px; max-width: 1280px; min-width: 0; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 30px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; }
.lede { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 26px; margin-top: 8px; font-weight: 650; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.drop {
  border: 2px dashed #c5cbd2;
  border-radius: 20px;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  background: #eceff2;
  padding: 32px;
}
.drop.over { border-color: var(--accent); background: #e4eef0; }
button, .btn {
  background: var(--accent); color: white; border: 0; border-radius: 999px;
  padding: 11px 18px; cursor: pointer; font: inherit;
  text-decoration: none; display: inline-block;
  min-height: 44px;
}
button.secondary, .btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.resume-action { background: var(--accent-2); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  font: inherit; background: #fff; color: var(--ink);
}
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #e8ebef; font-size: 12px; }
.pill.ok { background: #d9eadf; }
.pill.warn { background: #f7ead3; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.step { padding: 6px 10px; border-radius: 999px; background: #e4e8ec; font-size: 12px; }
.step.done { background: #d9eadf; }
.step.current { background: #d7ecec; font-weight: 700; }
.step.failed { background: #f3d6d3; }
.banner { padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.banner.warn { background: #f7ead3; }
.banner.ok { background: #dff3e6; }
.banner.bad { background: #f6d9d6; }
.banner.refresh { background: #f7ead3; border: 1px dashed var(--warn); }
.live-progress { margin: 8px 0 12px; }
.translation-progress { margin: 0 0 18px; }
.translation-progress .translation-stage { margin: 0 0 10px; font-size: 20px; }
.progress-track {
  height: 16px;
  border-radius: 999px;
  background: #d5dbe1;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  width: var(--progress-width, 0%);
  min-width: 0;
  transform-origin: left center;
}
.progress-percent { font-size: 28px; font-weight: 700; margin: 10px 0 0; }
.progress-units { margin: 4px 0 0; color: var(--muted); }
.progress-prep { margin: 6px 0 0; color: var(--muted); }
.progress-eta { margin: 8px 0 0; font-weight: 650; }
.job-state-label { font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 140px; }
.editor { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 16px; min-height: 70vh; }
.outline { overflow: auto; }
.outline button { display: block; width: 100%; text-align: left; background: transparent; color: inherit; border: 0; border-radius: 8px; margin: 0 0 4px; }
.outline button.current { background: #d7ecec; font-weight: 700; }
.qa-finding.selected { box-shadow: 0 0 0 2px var(--accent); }
.expert-review-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.expert-findings { max-height: 78vh; overflow: auto; }
.expert-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.expert-page-wrap { overflow: auto; max-height: 70vh; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.expert-page { position: relative; display: block; }
.expert-page img { width: 100%; height: auto; display: block; }
.expert-highlight {
  position: absolute;
  border: 2px solid #c45c26;
  background: rgba(196, 92, 38, 0.18);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7);
}
.qa-finding.blocking { border-color: #c97a72; }
.qa-finding.expert { border-color: #c9a56a; }
.qa-finding .qa-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qa-finding pre { white-space: pre-wrap; background: #f4f6f8; padding: 10px; border-radius: 8px; font: inherit; }
.quality-report { border-left: 4px solid var(--accent); }
#qa-filters button.current { background: var(--accent); color: #fff; }
.src, .tgt { white-space: pre-wrap; min-height: 70vh; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
details.advanced { margin-top: 24px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cost-box h2 { font-size: 16px; }
.cost-box label { display: block; margin-top: 12px; font-weight: 650; }
.cost-box #max-spend-usd { max-width: 160px; }
.tgt { min-height: 50vh; }
.money {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  gap: 2px;
}
.money-usd { font-weight: 650; }
.money-eur, .money-eur-only { font-size: 13px; color: var(--muted); font-weight: 500; }
.card .v .money-usd { font-size: 24px; }
.card .v .money-eur, .card .v .money-eur-only { font-size: 13px; font-weight: 500; }
.ctx-help { margin: 0 0 18px; }
.ctx-help a {
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.ctx-help a:hover { border-bottom-style: solid; }
.doc-index p { margin: 6px 0; }
.doc-index a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.doc-section { margin-bottom: 16px; }
.doc-status { font-size: 14px; color: var(--muted); margin: 0; }
.op-future { margin-top: 24px; }
.op-future .card .v { font-size: 14px; font-weight: 600; }
.status-pending { color: var(--muted); font-size: 13px; font-weight: 500; }
.install-block h3 { margin-top: 8px; }
.startup {
  position: fixed; inset: 0; z-index: 40;
  background: var(--graphite); color: #f4f7fa;
  display: grid; place-items: center;
}
.startup.entry {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(1100px 520px at 14% 18%, rgba(196,210,222,0.10), transparent 58%),
    radial-gradient(720px 420px at 86% 8%, rgba(15,95,99,0.20), transparent 52%),
    #12161c;
}
.entry-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 420px);
  min-height: 100%;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
}
.entry-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 64px 48px;
  text-align: left;
  width: 100%;
  min-width: 0;
}
.entry-brand-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 26rem;
}
.entry-brand-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.startup-inner { text-align: center; padding: 32px 24px; max-width: 360px; }
.startup-mark { width: 152px; height: 152px; object-fit: contain; margin: 0 0 28px; display: block; }
.startup-name { margin: 0; font-size: 40px; letter-spacing: 0.28em; font-weight: 650; }
.startup-by { margin: 10px 0 0; font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.72; }
.startup-tag { margin: 24px 0 0; font-size: 19px; line-height: 1.55; opacity: 0.86; font-style: italic; }
.startup-spinner {
  width: 28px; height: 28px; margin: 28px 0 14px;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: #fff; border-radius: 50%;
  animation: hidra-spin 0.9s linear infinite;
}
.startup-status { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; }
.startup-foot { margin: 18px 0 0; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.42; }
.startup.is-error .startup-spinner { display: none; }
.startup.is-error .startup-status { opacity: 1; color: #f3d6d3; text-transform: none; letter-spacing: 0; }
.startup.is-ready .startup-spinner { display: none; }
.startup.is-ready .startup-status { display: none; }
.entry-login {
  background: rgba(18, 22, 28, 0.72);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 56px 40px;
  display: flex; flex-direction: column; justify-content: center;
  backdrop-filter: blur(10px);
  min-width: 0;
}
.entry-login h1 { font-size: 26px; letter-spacing: 0.18em; margin-bottom: 0; }
.entry-login-kicker { margin: 6px 0 18px; letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; opacity: 0.6; }
.entry-login .lede { color: rgba(244,247,250,0.72); }
.entry-login label { color: rgba(244,247,250,0.7); }
.entry-login input {
  background: #1a2028; color: #f4f7fa; border-color: rgba(255,255,255,0.12);
}
.entry-login button { width: 100%; }
.startup.is-booting .entry-login { opacity: 0.35; pointer-events: none; }
@keyframes hidra-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .startup-spinner { animation: none; border-top-color: rgba(255,255,255,0.18); opacity: 0.7; }
}
body.is-login .nav { display: none; }
body.is-login #app { display: none; }
.login-panel { padding: 32px; }
.login-panel h1 { font-size: 28px; }
.session-chip { font-size: 12px; opacity: 0.75; margin-bottom: 12px; }
.admin-only { margin-top: 28px; }
.workflow {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px;
  pointer-events: none; user-select: none;
}
.workflow-caption { margin: 0 0 20px; font-size: 12px; color: var(--muted); }
.workflow span {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: transparent; color: #7a8490;
  border: 1px solid #d0d5db; cursor: default;
}
.workflow span.upcoming {
  background: transparent; color: #8a929c;
  border-color: #d5dade; font-weight: 400;
}
.workflow span.done {
  background: #dce8e6; color: #2d4a48;
  border-color: #b7cdc8; font-weight: 500;
}
.workflow span.now {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 700; box-shadow: 0 0 0 3px rgba(15,95,99,0.16);
}
.help-tip { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--accent); cursor: help; border-bottom: 1px dotted var(--accent); }
.onboard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.onboard h2 { margin-top: 0; }
.operator-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.console-out { white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 12px; max-height: 320px; overflow: auto; background: #0f1a22; color: #d7e6ef; padding: 12px; border-radius: 10px; }
.release-box.blocked { border-left: 4px solid var(--bad); }
.release-box.ok { border-left: 4px solid var(--ok); }
.visual-qa-box.blocked { border-left: 4px solid var(--bad); }
.visual-qa-box.ok { border-left: 4px solid var(--ok); }
.visual-pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.visual-page { width: 120px; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.visual-crop { max-width: 160px; height: auto; display: block; margin-bottom: 6px; border: 1px solid var(--line); }
.pill.bad { background: #f3d6d3; }
.nav a.admin-link { font-size: 13px; opacity: 0.7; }
body.is-user .admin-link { display: none; }
.fx-note { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.system-accounts { margin-top: 28px; }
@media (max-width: 980px) {
  body { display: block; }
  .nav { width: auto; min-height: 0; position: relative; flex-direction: row; flex-wrap: wrap; }
  .editor, .row { grid-template-columns: 1fr; }
  #app { padding: 20px; }
  .expert-review-layout, .expert-compare { grid-template-columns: 1fr; }
  .entry-shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    min-height: 0;
    width: 100%;
    max-width: 100%;
  }
  .entry-brand,
  .entry-brand-group {
    display: contents;
  }
  .entry-brand-cluster {
    order: 1;
    text-align: center;
    align-items: center;
    padding: 28px 20px 8px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-top: max(28px, env(safe-area-inset-top));
    max-width: none;
    width: 100%;
  }
  .entry-login {
    order: 2;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
  .startup-foot {
    order: 3;
    text-align: center;
    margin: 8px 0 0;
    padding: 16px 20px max(24px, env(safe-area-inset-bottom));
    width: 100%;
  }
}
@media (max-width: 900px) {
  .qa-finding .qa-pair { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .entry-brand-cluster { padding: 24px 16px 8px; }
  .entry-login { padding: 20px 16px 12px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .startup-mark { width: 112px; height: 112px; margin-bottom: 18px; }
  .startup-name { font-size: 32px; letter-spacing: 0.22em; }
  .startup-by { font-size: 13px; }
  .startup-tag { font-size: 16px; margin-top: 16px; }
  .startup-foot { padding: 12px 16px max(20px, env(safe-area-inset-bottom)); }
  .nav a { min-height: 44px; }
}
@media (max-width: 420px) {
  .startup-mark { width: 104px; height: 104px; }
  .startup-name { font-size: 28px; }
}
