:root {
  --bg: #f4f6f8; --panel: #ffffff; --panel-2: #f0f2f5; --hover: #eceff3;
  --line: #e2e6eb; --line-2: #d3d9e0;
  --text: #0f1728; --muted: #5a6577; --faint: #8a94a4;
  --accent: #059669; --accent-2: #10b981; --accent-soft: rgba(16, 185, 129, .12); --accent-ink: #047857;
  --btn: #059669; --on-btn: #ffffff;
  --warn: #b45309; --warn-soft: rgba(245, 158, 11, .14);
  --bad: #dc2626; --bad-soft: rgba(239, 68, 68, .11);
  --add: rgba(16, 185, 129, .13); --add-ink: #047857; --del: rgba(239, 68, 68, .11); --del-ink: #b91c1c;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, .2);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d12; --panel: #10141b; --panel-2: #161b24; --hover: #1b212c;
    --line: #1f2632; --line-2: #2b3443;
    --text: #e8ecf2; --muted: #9ba6b6; --faint: #687286;
    --accent: #34d399; --accent-2: #10b981; --accent-soft: rgba(52, 211, 153, .12); --accent-ink: #6ee7b7;
    --btn: #34d399; --on-btn: #04241a;
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
    --bad: #f87171; --bad-soft: rgba(248, 113, 113, .12);
    --add: rgba(52, 211, 153, .11); --add-ink: #6ee7b7; --del: rgba(248, 113, 113, .11); --del-ink: #fca5a5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0d12; --panel: #10141b; --panel-2: #161b24; --hover: #1b212c;
  --line: #1f2632; --line-2: #2b3443;
  --text: #e8ecf2; --muted: #9ba6b6; --faint: #687286;
  --accent: #34d399; --accent-2: #10b981; --accent-soft: rgba(52, 211, 153, .12); --accent-ink: #6ee7b7;
  --btn: #34d399; --on-btn: #04241a;
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .12);
  --add: rgba(52, 211, 153, .11); --add-ink: #6ee7b7; --del: rgba(248, 113, 113, .11); --del-ink: #fca5a5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; overflow: hidden;
}
button { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; }
.ic { flex: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- top bar */
.topbar {
  height: 58px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: var(--panel); position: relative; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; letter-spacing: -.015em; width: 236px; flex: none; }
.logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #10b981, #0ea5e9); box-shadow: 0 4px 14px rgba(16, 185, 129, .35);
}
.search { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  padding: 0 40px 0 36px; color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--panel); }
kbd { position: absolute; right: 10px; font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; pointer-events: none; }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 12.5px; font-weight: 600; transition: filter .15s;
}
.pill:hover { filter: brightness(.97); }
.pill.ok { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; }

/* ---------- layout */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 268px minmax(300px, 380px) 1fr; }
.sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 12px 10px; }
.files { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.detail { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); }

.side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; min-height: 36px; }
.side-head h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; display: flex; align-items: center; }
.side-empty { color: var(--faint); font-size: 13px; padding: 6px 10px; margin: 0; list-style: none; }

#projects { display: flex; flex-direction: column; gap: 2px; max-height: 45%; overflow: auto; margin-bottom: 10px; }
.project { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.project:hover { background: var(--hover); }
.project.on { background: var(--accent-soft); }
.p-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); flex: none; transition: .2s; }
.project.on .p-icon { background: var(--accent-2); color: #fff; box-shadow: 0 3px 10px rgba(16, 185, 129, .35); }
.p-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.p-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project.on .p-name { color: var(--accent-ink); }
.p-sub { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub.bad { color: var(--warn); }
.p-remove { opacity: 0; }
.project:hover .p-remove, .project:focus-within .p-remove { opacity: 1; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 8px; }
body.live .live-dot { background: var(--accent-2); animation: ping 2s infinite; }
#activity { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 0; }
.act { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 9px; cursor: pointer; text-align: left; }
.act:hover { background: var(--hover); }
.act .ext { width: 28px; height: 28px; font-size: 8.5px; border-radius: 7px; }
.act.new { animation: slidein .35s ease; }
.a-text { min-width: 0; display: flex; flex-direction: column; }
.a-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-name em { font: 600 11px var(--mono); font-style: normal; color: var(--accent-ink); margin-left: 4px; }
.a-sub { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- files column */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px 14px 4px; }
.stats:empty { display: none; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat-v { font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-k { font-size: 11.5px; color: var(--muted); }
.stat.hi .stat-v { color: var(--accent-ink); }
.files-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; gap: 10px; }
.files-head h2 { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg, .tabs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex: none; }
.seg button, .tabs button { border: 0; background: none; padding: 4px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: .15s; white-space: nowrap; }
.seg button.on, .tabs button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.file-list { list-style: none; margin: 0; padding: 0 0 12px; overflow: auto; flex: 1; min-height: 0; }
.file { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 8px; border-radius: 11px; cursor: pointer; transition: background .15s; }
.file:hover { background: var(--hover); }
.file.on { background: var(--accent-soft); }
.file.on .f-name { color: var(--accent-ink); }
.file.gone .f-name { text-decoration: line-through; opacity: .55; }
.file.flash { animation: flash 1.8s ease; }
.ext {
  flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .02em;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
}
.f-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.f-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-dir { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 11.5px; color: var(--faint); flex: none; }
.count { font: 600 11px var(--mono); background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 0 8px; }
.empty { color: var(--muted); padding: 24px 20px; text-align: center; font-size: 13px; line-height: 1.6; }
mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; border-radius: 3px; }

/* ---------- detail */
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; flex-wrap: wrap; }
.d-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.d-title .ext { width: 46px; height: 46px; font-size: 11px; border-radius: 13px; }
.d-title h1 { font-size: 21px; letter-spacing: -.02em; word-break: break-all; line-height: 1.2; }
.crumbs { font-size: 12px; color: var(--faint); margin-bottom: 2px; word-break: break-all; }
.d-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.chip.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.d-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; border-top: 1px solid var(--line); }

.timeline { list-style: none; margin: 0; padding: 10px 8px; overflow: auto; border-right: 1px solid var(--line); }
.tl { position: relative; display: flex; gap: 12px; width: 100%; text-align: left; padding: 9px 10px 9px 8px; border-radius: 11px; border: 1px solid transparent; background: none; cursor: pointer; transition: background .15s; }
.tl::before { content: ''; position: absolute; left: 14px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline li:first-child .tl::before { top: 50%; }
.timeline li:last-child .tl::before { bottom: 50%; }
.timeline li:only-child .tl::before { display: none; }
.tl:hover { background: var(--hover); }
.tl.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); }
.dot { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line-2); margin-top: 3px; flex: none; transition: .2s; }
.tl.on .dot { border-color: var(--accent-2); }
.tl.latest .dot { background: var(--accent-2); border-color: var(--accent-2); animation: pulse 2.6s infinite; }
.tl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vn { font: 600 13px var(--mono); }
.tl-sub { font-size: 11.5px; color: var(--faint); }
.badge-latest {
  display: inline-block; font: 700 9.5px var(--font); letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, #10b981, #0ea5e9); box-shadow: 0 2px 8px rgba(16, 185, 129, .35); vertical-align: middle;
}
.delta b { font: 600 11px var(--mono); margin-left: 5px; }
.delta .a { color: var(--add-ink); }
.delta .d { color: var(--del-ink); }

.viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.v-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.v-actions { display: flex; gap: 6px; }
.v-body { flex: 1; overflow: auto; min-height: 0; background: var(--bg); }
.v-foot { font-size: 11.5px; color: var(--faint); padding: 6px 14px; border-top: 1px solid var(--line); }

.code-view { font: 12.5px/1.65 var(--mono); min-width: 100%; width: max-content; padding: 6px 0 16px; }
.ln { display: grid; grid-template-columns: 54px 1fr; }
.diff .ln { grid-template-columns: 46px 46px 22px 1fr; }
.no { color: var(--faint); text-align: right; padding-right: 12px; user-select: none; opacity: .8; }
.sg { user-select: none; text-align: center; }
.code { white-space: pre; padding-right: 20px; tab-size: 4; }
.ln.add { background: var(--add); }
.ln.add .sg, .ln.add .code { color: var(--add-ink); }
.ln.del { background: var(--del); }
.ln.del .sg, .ln.del .code { color: var(--del-ink); }
.ln.hunk { grid-template-columns: 1fr; background: var(--panel-2); color: var(--muted); margin: 6px 0; }
.ln.hunk .code { padding: 3px 14px; }
.diff-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; padding: 8px 14px; font-size: 12px; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); }
.note { margin: 16px; padding: 12px 14px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.note.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.note.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.img-wrap { padding: 24px; display: grid; place-items: center; }
.img-wrap img { max-width: 100%; border-radius: 8px; box-shadow: var(--shadow); background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px; }

.placeholder, .welcome { margin: auto; text-align: center; padding: 40px 24px; max-width: 560px; color: var(--muted); }
.placeholder .ic { color: var(--faint); margin-bottom: 12px; }
.placeholder h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.placeholder p { margin: 0; }
.w-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 20px; color: #fff; background: linear-gradient(135deg, #10b981, #0ea5e9); box-shadow: 0 12px 32px rgba(16, 185, 129, .35); animation: float 5s ease-in-out infinite; }
.welcome h1 { font-size: 28px; letter-spacing: -.025em; color: var(--text); line-height: 1.2; }
.welcome > p { font-size: 15px; margin: 12px 0 24px; line-height: 1.6; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: left; }
.steps li { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12.5px; color: var(--text); }
.steps b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; margin-bottom: 8px; }
.hint-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); font-size: 13px; text-align: left; margin-top: 16px; color: var(--text); line-height: 1.5; }
.hint-card > .ic { color: var(--warn); margin-top: 2px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--panel); font-weight: 600; font-size: 13px; cursor: pointer;
  text-decoration: none; color: var(--text); transition: background .15s, filter .15s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--btn); color: var(--on-btn); border-color: transparent; box-shadow: 0 2px 10px color-mix(in srgb, var(--accent-2) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.danger-text { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }

/* ---------- modal */
.scrim { position: fixed; inset: 0; background: rgba(5, 8, 12, .5); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 40; animation: fade .15s; padding: 16px; }
.modal { width: min(580px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.m-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 4px; }
.m-head h2 { font-size: 17px; letter-spacing: -.01em; }
.m-body { padding: 4px 20px 6px; }
.m-body p { color: var(--muted); line-height: 1.55; }
.m-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 14px 20px 18px; }
.spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field small { color: var(--faint); font-size: 11.5px; }
.field input, .field textarea {
  height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  padding: 0 12px; font: 13px var(--mono); outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--bad); font-size: 12.5px; min-height: 1em; margin: 4px 0 0; }

/* ---------- toasts, loading, offline */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100vw - 36px); }
.toast { display: flex; gap: 10px; align-items: center; padding: 11px 15px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; animation: tin .3s cubic-bezier(.2, .9, .3, 1.2); transition: opacity .3s, transform .3s; }
.toast.ok .ic { color: var(--accent-2); }
.toast.bad .ic { color: #f87171; }
.toast.info .ic { color: #38bdf8; }
.toast.out { opacity: 0; transform: translateY(8px); }
.loading { display: grid; place-items: center; min-height: 160px; flex: 1; }
.loading::after { content: ''; width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--accent-2); border-radius: 50%; animation: spin .8s linear infinite; }
.offline { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); text-align: center; padding: 24px; }
.offline h2 { font-size: 20px; margin: 14px 0 6px; }
.offline p { color: var(--muted); margin: 0; }
.offline .loading { min-height: 40px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); } 70%, 100% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent-2) 30%, transparent); box-shadow: inset 3px 0 0 var(--accent-2); } 100% { box-shadow: inset 3px 0 0 transparent; } }
@keyframes slidein { from { opacity: 0; transform: translateX(-8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
@keyframes tin { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 228px 320px 1fr; }
  .brand { width: auto; }
  .d-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .timeline { display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .timeline li { flex: none; }
  .tl { width: auto; }
  .tl::before { display: none; }
}
@media (max-width: 860px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .topbar { position: sticky; top: 0; gap: 10px; }
  .brand span:last-child, kbd { display: none; }
  .layout { display: flex; flex-direction: column; }
  .sidebar, .files { border-right: 0; border-bottom: 1px solid var(--line); }
  #projects { max-height: none; }
  #activity { max-height: 200px; }
  .file-list { max-height: 55vh; }
  .detail { min-height: 85vh; }
  .d-head, .chips { padding-left: 16px; padding-right: 16px; }
  .steps, .grid2 { grid-template-columns: 1fr; }
  .pill span { display: none; }
}

/* ---------- cloud additions */
.files-tools { display: flex; gap: 6px; padding: 0 16px 8px; }
.files-tools .btn { flex: 1; justify-content: center; }
.files.drag { outline: 2px dashed var(--accent-2); outline-offset: -8px; background: var(--accent-soft); }
.progress { height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--bg) 40%, transparent); margin-top: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent-2); transition: width .2s; }
.toast .t-body { display: flex; flex-direction: column; min-width: 180px; }
.code-box { font: 12.5px/1.6 var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; word-break: break-all; user-select: all; color: var(--text); }
.steps-list { margin: 8px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.7; font-size: 13px; }

/* login page */
.login-wrap { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 32px 28px 26px; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.login-card .w-icon { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 18px; }
.login-card h1 { font-size: 22px; text-align: center; letter-spacing: -.02em; }
.login-card > p { text-align: center; color: var(--muted); margin: 6px 0 18px; }
.login-card .btn { width: 100%; justify-content: center; height: 42px; margin-top: 4px; }
.pw-row { position: relative; }
.pw-row input { padding-right: 44px; }
.pw-row button { position: absolute; right: 5px; top: 5px; }
