/* Screens: overview, changes, files, file, history, apps (screens.js).
   Theme variables only; radii 8 / 12 / 22. */

/* ── Shared bits ─────────────────────────────────────────────── */
.pathl { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--mono); font-size: .88em; direction: ltr; }
.pathl-d { color: var(--dim); }
.pathl-b { color: var(--text); }
.fb-wrap { white-space: pre-wrap !important; word-break: break-word; }
.chip .icon { margin-left: -2px; }
.chip-accent { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip:active { filter: brightness(1.15); }
button.row { background: none; font: inherit; color: inherit; }
.empty .icon { color: var(--dim); opacity: .8; }
.empty .btn .icon { color: inherit; opacity: 1; }

/* skeleton rows while a list loads */
.skel-list { padding: 8px 0; }
.skel-row { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.skel { height: 12px; border-radius: 6px; background: var(--key); opacity: .6;
  animation: skel 1.2s ease-in-out infinite alternate; }
.skel-a { width: 70%; margin-bottom: 8px; }
.skel-b { width: 40%; height: 10px; }
@keyframes skel { from { opacity: .35; } to { opacity: .7; } }

/* ── 1. Overview ─────────────────────────────────────────────── */
.ov-list { padding: 4px 0 24px; }
.ov-card { display: block; padding: 12px 14px; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: border-color .15s; }
.ov-card.ov-needs { border-color: color-mix(in srgb, var(--yellow) 55%, transparent); }
.ov-card.ov-working { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.ov-top { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.ov-dot { display: flex; align-items: center; }
.ov-tab { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ov-state { font-size: .78em; font-weight: 600; padding: 1px 8px; border-radius: 8px; flex: none;
  background: var(--key); color: var(--dim2); }
.ov-state.st-working { background: var(--accent-soft); color: var(--accent); }
.ov-state.st-waiting { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); }
.ov-state.st-ready { background: var(--add-bg); color: var(--green); }
.ov-ago { margin-left: auto; color: var(--dim); font-size: .8em; flex: none; }
.ov-title { margin-top: 4px; font-size: .95em; line-height: 1.35; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ov-act { display: flex; gap: 10px; align-items: baseline; margin-top: 6px; font-family: var(--mono);
  font-size: .8em; color: var(--accent); }
.ov-act-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-act-time { flex: none; color: var(--dim2); font-variant-numeric: tabular-nums; }
.ov-todos { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .8em; color: var(--dim2); }
.ov-bar { flex: none; width: 72px; height: 6px; border-radius: 3px; background: var(--key); overflow: hidden; }
.ov-bar-fill { display: block; height: 100%; background: var(--green); border-radius: 3px; transition: width .3s; }
.ov-todo-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-screen {
  margin: 10px 0 0; padding: 7px 9px; border-radius: 8px; overflow: hidden; white-space: pre;
  font: calc(9.5px * var(--scale)) / 1.35 var(--mono); color: var(--fg);
  background: color-mix(in srgb, var(--bg) 55%, black);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35); max-height: calc(10 * 1.35 * 9.5px * var(--scale) + 14px);
  pointer-events: none;
}
.ov-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .78em; color: var(--dim2); }
.ov-foot .sep { color: var(--dim); }
.ov-foot .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* asleep / closed chats: one compact line block */
.ov-card.ov-asleep { padding: 9px 14px; background: transparent; }
.ov-card.ov-asleep .ov-tab { color: var(--dim2); }
.ov-card.ov-asleep .ov-title { -webkit-line-clamp: 1; color: var(--dim2); font-size: .88em; margin-top: 2px; }
.ov-card.ov-asleep .ov-foot { margin-top: 4px; }

/* ── 2. Changes ──────────────────────────────────────────────── */
.chg-sum { display: flex; flex-direction: column; gap: 6px; }
.chg-branch { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; min-width: 0; }
.chg-branch .icon { color: var(--accent); }
.chg-branch .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chg-stats { display: flex; gap: 10px; font-size: .88em; color: var(--dim2); font-variant-numeric: tabular-nums; }
.chg-root { font-size: .78em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chg-files { border-top: 1px solid var(--line); margin-top: 6px; }
.chg-row { gap: 10px; padding-right: 10px; }
.chg-st { flex: none; min-width: 34px; text-align: center; font-family: var(--mono); letter-spacing: .02em; }
.chg-nums { flex: none; display: flex; gap: 6px; font-family: var(--mono); font-size: .8em; font-variant-numeric: tabular-nums; }
.chg-chev { flex: none; color: var(--dim); transition: transform .15s; }
.chg-file.open > .chg-row .chg-chev { transform: rotate(180deg); }
.chg-file.open > .chg-row { background: var(--raised); }
.chg-detail { display: none; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); }
.chg-file.open > .chg-detail { display: block; }
.chg-detail > .diff + .diff, .chg-detail > .diff + .chg-sub { margin-top: 10px; }
.chg-detail .loading { padding: 16px; }
.chg-sub { padding: 4px 4px 6px; font-size: .78em; color: var(--dim2); }
.chg-note { padding: 10px 14px; color: var(--dim2); font-size: .85em; }
.chg-commit .row-s { font-size: .78em; }
/* the "Wrap lines" chip, for git diffs and edit diffs alike */
.chg-wrap .diff .ln { white-space: pre-wrap; width: auto; word-break: break-word; }

/* ── 3. Files ────────────────────────────────────────────────── */
.crumbs { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px 8px; overflow-x: auto;
  scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--bg); }
.crumbs::-webkit-scrollbar { display: none; }
.crumb { flex: none; height: 36px; padding: 0 10px; border-radius: 18px; color: var(--dim2);
  font-family: var(--mono); font-size: .85em; white-space: nowrap; }
.crumb:active { background: var(--key); }
.crumb.cur { color: var(--text); font-weight: 600; }
.crumb-sep { flex: none; color: var(--dim); opacity: .7; }
.fl-row { min-height: 52px; }
.fl-ic { color: var(--dim2); display: flex; }
.fl-dir .fl-ic { color: var(--accent); }
.fl-dir .row-t { font-weight: 600; }
.fl-hidden .row-t { color: var(--dim2); }
.fl-row .row-end { line-height: 1.3; font-variant-numeric: tabular-nums; }
.fl-ago { color: var(--dim); font-size: .92em; }

/* ── 4. File viewer ──────────────────────────────────────────── */
.fv-box { padding: 8px 8px 24px; }
.fv-note { margin: 0 4px 8px; padding: 8px 12px; border-radius: 8px; font-size: .85em;
  background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--yellow); }
.fv-src pre.code { border-radius: 8px; }
.fv-md { padding: 4px 8px; overflow-wrap: anywhere; }
.fv-md img { max-width: 100%; }
.fv-imgbox { overflow: auto; border-radius: 8px; text-align: center; cursor: zoom-in;
  background: repeating-conic-gradient(color-mix(in srgb, var(--text) 6%, transparent) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.fv-img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.fv-imgbox.zoom { cursor: zoom-out; text-align: left; }
.fv-imgbox.zoom .fv-img { max-width: none; margin: 0; }
.fv-hint { text-align: center; color: var(--dim); font-size: .8em; padding: 8px; }
/* HTML preview fills the screen below the chips */
.fv-body.fv-full { display: flex; flex-direction: column; overflow: hidden; }
.fv-full .fv-box { flex: 1; display: flex; flex-direction: column; padding: 0; }
.fv-full .fv-note { margin: 8px; }
.fv-preview { flex: 1; display: flex; min-height: 0; }
.fv-frame { flex: 1; width: 100%; min-height: 100%; border: 0; background: #fff; }

/* ── 5. History ──────────────────────────────────────────────── */
.screen-history .search-box { flex: none; }
.search-box input::-webkit-search-cancel-button { display: none; }
.hs-clear { width: 36px; height: 36px; margin-right: -8px; border-radius: 18px; display: flex;
  align-items: center; justify-content: center; color: var(--dim2); }
.hs-clear:active { background: var(--key); }
.hs-chips { flex: none; padding-top: 0; }
.hs-row .row-end { font-variant-numeric: tabular-nums; }
.hs-untitled { color: var(--dim2); }
.hs-hit { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.hs-role { flex: none; width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center;
  justify-content: center; margin-top: 2px; }
.hs-user { background: var(--key); color: var(--keytext); }
.hs-you { font-size: .62em; font-weight: 700; letter-spacing: .02em; }
.hs-claude { background: var(--accent-soft); color: var(--accent); }
.hs-hit-top { display: flex; gap: 8px; align-items: baseline; }
.hs-hit-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-hit-ago { flex: none; color: var(--dim); font-size: .8em; }
.hs-snip { margin: 3px 0 2px; font-size: .88em; color: var(--dim2); line-height: 1.4; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.hs-snip b { color: var(--text); font-weight: 700; background: var(--accent-soft); border-radius: 3px; padding: 0 1px; }

/* ── 6. Apps ─────────────────────────────────────────────────── */
.ap-row { align-items: center; padding-top: 12px; padding-bottom: 12px; }
.ap-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; background: var(--accent-soft); color: var(--accent); }
.ap-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ap-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ap-top .badge { flex: none; }
.ap-ver { color: var(--text); }
.ap-file { font-size: .76em; color: var(--dim); }
.ap-btn { flex: none; min-height: 40px; padding: 0 16px; font-size: .9em; }
.ap-btn-s { min-height: 34px; padding: 0 12px; font-size: .82em; }
.ap-open { border-bottom: none; }
.ap-vers { padding: 0 16px 8px 68px; border-bottom: 1px solid var(--line); }
.ap-v { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ap-ic.has-img { background: none; }
.ap-img { width: 40px; height: 40px; border-radius: 10px; display: block; }
