:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --ink: #1d2733;
  --muted: #5c6878;
  --line: #dde2ea;
  --accent: #2f6fb0;
  --accent-soft: #e6eef8;
  --ok: #2f8a4f;
  --warn: #c2571a;
  --bad: #c0392b;
  --term-bg: #1b2029;
  --term-ink: #d7dde6;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
button { font: inherit; }
code { font-family: var(--mono); font-size: .92em; background: #eef1f5; padding: 0 .25em; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* ------------------------------------------------ antet */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1600px; margin: 0 auto; padding: 12px 18px; display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
h1 { margin: 2px 0 2px; font-size: 20px; line-height: 1.25; }
.task { margin: 2px 0 0; max-width: 900px; }
.section { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.hints { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: #3c4a5c; }
.hints li { margin: 2px 0; background: #fff8e5; border-radius: 6px; padding: 2px 8px; }
.sc-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; min-width: 220px; }
.pick { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.pick select { font: inherit; font-size: 14px; max-width: 280px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.btns { display: flex; gap: 6px; }
.btns button, .ed-actions button, .ed-conflict button {
  border: 1px solid var(--line); background: #fbfcfd; border-radius: 7px; padding: 5px 11px; cursor: pointer; font-size: 14px; color: var(--ink);
}
.btns button:hover, .ed-actions button:hover, .ed-conflict button:hover { border-color: var(--accent); }
.btns button:disabled { opacity: .5; cursor: default; }
.goal { margin: 0; font-size: 13px; padding: 3px 10px; border-radius: 99px; background: #eef1f5; color: var(--muted); }
.goal.done { background: #e3f3e8; color: var(--ok); font-weight: 600; }

/* ------------------------------------------------ așezare */
.lab { max-width: 1600px; margin: 0 auto; padding: 14px 18px 20px; display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 10fr); gap: 14px; align-items: start; }
.viz-pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.card h2 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.where { text-transform: none; letter-spacing: 0; font-weight: 400; font-family: var(--mono); }

/* ------------------------------------------------ terminal */
.term-pane { position: sticky; top: 10px; background: var(--term-bg); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: min(calc(100vh - 40px), 640px); min-height: 380px; }
.term { flex: 1; overflow-y: auto; padding: 10px 12px 4px; font-family: var(--mono); font-size: 13px; line-height: 1.45; color: var(--term-ink); white-space: pre-wrap; word-break: break-word; cursor: text; }
.ln { min-height: 1.45em; }
.ln.cmdline { color: #fff; margin-top: 4px; }
.ln.sys { color: #8fa1b8; font-style: italic; }
.ln.err { color: #ff7b72; }
.ln.hint { color: #c9a96b; }
.ln.warn { color: #f0a35e; }
.ln.sim { color: #8fb4e0; }
.ln.okc { color: #7ee2a8; }
.ln.st-g, .st-g { color: #7ee2a8; }
.ln.st-r, .st-r { color: #ff8f86; }
.ln.d-meta { color: #fff; font-weight: 600; }
.ln.d-add { color: #7ee2a8; }
.ln.d-del { color: #ff8f86; }
.d-hunk { color: #6fc6e8; }
.d-hash { color: #e5c07b; }
.g-chars, .ln.g-chars { color: #c678dd; }
.dec-head { color: #56d4e8; font-weight: 700; }
.dec-branch { color: #7ee2a8; font-weight: 600; }
.dec-remote { color: #ff8f86; font-weight: 600; }
.dec-tag { color: #e5c07b; font-weight: 600; }
.ps-user { color: #7ee2a8; }
.ps-path { color: #6fb3f2; }
.ps-git { color: #e5c07b; }
.prompt { display: flex; align-items: baseline; gap: 8px; padding: 6px 12px 10px; font-family: var(--mono); font-size: 13px; color: var(--term-ink); border-top: 1px solid #2a313d; flex-wrap: wrap; }
.ps1 { white-space: nowrap; }
.prompt input { flex: 1; min-width: 160px; background: transparent; border: 0; outline: 0; color: #fff; font: inherit; caret-color: #7ee2a8; padding: 2px 0; }

/* ------------------------------------------------ graful */
.graph { overflow-x: auto; overflow-y: hidden; }
.graph > .muted { margin: 6px 0; }
.gsvg { display: block; font-family: var(--mono); }
.gsvg .edge { fill: none; stroke-width: 2; }
.gsvg .edge.ghost { stroke-dasharray: 4 3; opacity: .45; }
.gsvg .node { cursor: pointer; }
.gsvg .node .hit { fill: transparent; stroke: none; }
.gsvg .node circle:not(.hit) { stroke-width: 2.5; }
.gsvg .node.head circle:not(.hit) { stroke: #111 !important; stroke-width: 3; }
.gsvg .node.ghost circle:not(.hit) { fill: #fff !important; stroke-dasharray: 3 2; opacity: .6; }
.gsvg .node.sel circle:not(.hit) { stroke: #e0a100 !important; stroke-width: 4; }
.gsvg .node.nou circle:not(.hit) { animation: pulse 1.2s ease-out 1; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(2.2); opacity: .2; } 60% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1); } }
.gsvg .hash { fill: #8a94a3; }
.gsvg .msg { fill: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.gsvg .msg.ghost { fill: #9aa3af; font-style: italic; }
.gsvg .more { fill: var(--muted); font-style: italic; }
.gsvg .ref rect { stroke-width: 1.2; }
.gsvg .ref text { font-weight: 600; }
.gsvg .ref.current rect { fill: #1d2733; stroke: #1d2733; }
.gsvg .ref.current text { fill: #fff; }
.gsvg .ref.head rect { fill: #1d2733; stroke: #1d2733; }
.gsvg .ref.head text { fill: #fff; }
.gsvg .ref.branch rect { fill: #e3f3e8; stroke: #2f8a4f; }
.gsvg .ref.branch text { fill: #1f6b3a; }
.gsvg .ref.remote rect { fill: #fff; stroke: #c0392b; stroke-dasharray: 3 2; }
.gsvg .ref.remote text { fill: #a3311f; }
.gsvg .ref.tag rect { fill: #fdf3d3; stroke: #c99a06; }
.gsvg .ref.tag text { fill: #7a5c00; }
.gsvg .ref.ghost rect { fill: #f3f4f6; stroke: #9aa3af; stroke-dasharray: 3 2; }
.gsvg .ref.ghost text { fill: #6b7280; }
.legend { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.lg { padding: 0 8px; border-radius: 99px; border: 1px solid; }
.lg.current { background: #1d2733; color: #fff; border-color: #1d2733; }
.lg.branch { background: #e3f3e8; color: #1f6b3a; border-color: #2f8a4f; }
.lg.remote { color: #a3311f; border-color: #c0392b; border-style: dashed; }
.lg.tag { background: #fdf3d3; color: #7a5c00; border-color: #c99a06; }
.lg.ghost { color: #6b7280; border-color: #9aa3af; border-style: dashed; }
.commit-detail { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; font-size: 13px; }
.cdet p { margin: 2px 0; word-break: break-all; }

/* ------------------------------------------------ cele trei zone */
.zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.zones.one { grid-template-columns: minmax(0, 1fr); }
.zone { background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.zone h3 { margin: 0 0 4px; font-size: 13px; }
.zone ul { list-style: none; margin: 0; padding: 0; }
.zone li { margin: 2px 0; }
.zone .muted { margin: 2px 0; font-size: 13px; }
.file { display: flex; width: 100%; gap: 6px; align-items: center; justify-content: space-between; text-align: left; border: 1px solid transparent; background: #fff; border-radius: 6px; padding: 2px 6px; cursor: pointer; font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.file:hover { border-color: var(--accent); }
.file .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .tag { font-family: system-ui, sans-serif; font-size: 11px; padding: 0 6px; border-radius: 99px; white-space: nowrap; }
.file.untracked .tag { background: #eceff3; color: #4b5563; }
.file.untracked .fname { color: #6b7280; }
.file.modified .tag { background: #fde9dc; color: var(--warn); }
.file.deleted .tag, .file.sdeleted .tag { background: #fbe1de; color: var(--bad); }
.file.deleted .fname, .file.sdeleted .fname { text-decoration: line-through; color: #9aa3af; }
.file.ignored { opacity: .55; }
.file.ignored .tag { background: #f1f2f4; color: #6b7280; }
.file.conflict { border-color: var(--bad); }
.file.conflict .tag { background: var(--bad); color: #fff; }
.file.added .tag, .file.smodified .tag { background: #e3f3e8; color: var(--ok); }
.opbar { margin: 8px 0 0; padding: 3px 10px; border-radius: 6px; background: #fdecea; color: var(--bad); font-weight: 600; font-size: 13px; display: inline-block; }
.note { margin: 6px 0 0; font-size: 13px; }
.file-view { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.fv-head { display: flex; gap: 6px; align-items: baseline; padding: 4px 8px; background: #f2f4f7; font-size: 13px; }
.fv-head .x { margin-left: auto; border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); }
.file-view pre { margin: 0; padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; max-height: 260px; overflow: auto; white-space: pre; }
.fv-tip { margin: 0; padding: 0 10px 6px; font-size: 12px; }

/* ------------------------------------------------ depozitele de la distanță */
.remote + .remote { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.remote h3 { margin: 0 0 4px; font-size: 13px; font-weight: 500; }
.rname { font-weight: 700; color: var(--accent); }
.url { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.remote .muted { margin: 2px 0; font-size: 13px; }
.prs { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.prs li { margin: 2px 0; }
.prn { font-weight: 700; color: var(--accent); }
.prs-st { font-size: 11px; padding: 0 6px; border-radius: 99px; }
.prs-st.open { background: #e3f3e8; color: var(--ok); }
.prs-st.merged { background: #efe6f8; color: #6b3fa0; }
.prs-st.closed { background: #fbe1de; color: var(--bad); }

/* ------------------------------------------------ editorul */
.editor { position: fixed; inset: 0; background: rgba(20, 26, 34, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.ed-box { background: var(--surface); border-radius: 12px; width: min(820px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.ed-head { padding: 10px 14px 0; font-family: var(--mono); font-size: 14px; }
.ed-hint { margin: 4px 14px 0; font-size: 13px; color: var(--muted); }
.ed-conflict { margin: 6px 14px 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ed-conflict button { font-size: 13px; padding: 3px 8px; }
#ed-text { margin: 8px 14px; flex: 1; min-height: 260px; height: 46vh; resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.45; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); background: #fcfdfe; tab-size: 2; }
.ed-actions { display: flex; gap: 8px; padding: 0 14px 12px; }
.ed-actions .primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.kbd { font-size: 11px; opacity: .75; margin-left: 4px; }

/* ------------------------------------------------ încorporat (iframe pe platformă) */
body.embed .top-inner { padding: 8px 10px; }
body.embed .pick, body.embed .eyebrow, body.embed .section { display: none; }
body.embed h1 { font-size: 17px; }
body.embed .lab { padding: 10px; }
body.embed .term-pane { position: relative; top: 0; height: 560px; }

/* ------------------------------------------------ telefon: panourile unul sub altul */
@media (max-width: 860px) {
  .top-inner { flex-direction: column; gap: 8px; padding: 10px 12px; }
  .sc-actions { align-items: stretch; width: 100%; min-width: 0; }
  .pick { flex-wrap: wrap; }
  .pick select { max-width: 100%; flex: 1; }
  .lab { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 16px; }
  .term-pane, body.embed .term-pane { position: relative; top: 0; height: 420px; min-height: 0; }
  .term, .prompt { font-size: 12.5px; }
  .prompt input { font-size: 16px; }
  .zones { grid-template-columns: minmax(0, 1fr); }
  #ed-text { font-size: 14px; height: 50vh; }
}
