/* ---------------------------------------------------------------- avatars */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex-shrink: 0; color: #fff; font-weight: 700; cursor: pointer; background: var(--panel2); vertical-align: middle; }
.avatar.s16 { width: 16px; height: 16px; font-size: 8px; }
.avatar.s20 { width: 20px; height: 20px; font-size: 9px; }
.avatar.s24 { width: 24px; height: 24px; font-size: 10px; }
.avatar.s28 { width: 28px; height: 28px; font-size: 11px; }
.avatar.s32 { width: 32px; height: 32px; font-size: 12px; }
.avatar.s36 { width: 36px; height: 36px; font-size: 13px; }
.avatar.s40 { width: 40px; height: 40px; font-size: 14px; }
.avatar.s64 { width: 64px; height: 64px; font-size: 22px; }
.avatar.s96 { width: 96px; height: 96px; font-size: 32px; }
.avatar.static-av { cursor: default; }
.avatar-edit { position: relative; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; cursor: pointer; flex-shrink: 0; border: 2px solid var(--line); transition: border-color .15s; }
.avatar-edit:hover, .avatar-edit.over { border-color: var(--accent); }
.avatar-edit-ov { position: absolute; inset: auto 0 0 0; padding: 5px 4px 6px; text-align: center; font-size: 11px; font-weight: 600; background: rgba(12, 14, 20, .78); color: #ffffff; opacity: 0; transition: opacity .15s; pointer-events: none; }
.avatar-edit:hover .avatar-edit-ov, .avatar-edit.over .avatar-edit-ov { opacity: 1; }
.avatar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar.ring { box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 6px 24px rgba(0,0,0,.35); }
.side .brand .logo { background: linear-gradient(90deg, #ff7a59, #ffc457); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 20px; }
.side .brand .me { cursor: pointer; }

/* chat with avatars */
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .msg-main { flex: 1; min-width: 0; }
.msg .who { cursor: pointer; }
.msg .who:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- home */
.home { padding: 0 0 40px; }
.hero { position: relative; overflow: hidden; margin: 20px 24px 8px; padding: 26px 28px; border-radius: 18px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  background: radial-gradient(1200px 300px at 0% 0%, rgba(255,122,89,.55), transparent 60%), radial-gradient(900px 300px at 100% 100%, rgba(91,157,255,.55), transparent 60%), linear-gradient(120deg, #2a1f3d, #1b2a44 60%, #1d3b3a);
  background-size: 140% 140%; animation: drift 18s ease-in-out infinite alternate; border: 1px solid rgba(255,255,255,.08); }
@keyframes drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .hero { animation: none; } .tile img { transition: none; } }
.hero-l { display: flex; gap: 16px; align-items: center; }
.hello { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.hero-sub { color: #dfe6f5; opacity: .9; margin-top: 2px; }
.hero-sub a { color: #ffd38a; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 14px; min-width: 110px; }
.stat b { display: block; font-size: 26px; line-height: 1; }
.stat span { color: #cfd6e6; font-size: 12px; }
.hero-actions { display: flex; gap: 10px; }
button.big { padding: 10px 16px; font-weight: 700; border-radius: 10px; }
button.primary.big { background: linear-gradient(90deg, #ff7a59, #ff9f43); border: none; box-shadow: 0 6px 20px rgba(255,122,89,.35); color: var(--bg); }
button.primary.big:hover { filter: brightness(1.08); }
button.ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 8px 24px; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } }
.wall-title { margin: 14px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.wall { columns: 3 260px; column-gap: 14px; }
.tile { break-inside: avoid; margin-bottom: 14px; position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--panel); border: 1px solid var(--line); transform: translateZ(0); }
.tile img { display: block; width: 100%; height: auto; transition: transform .35s ease; }
.tile:hover img { transform: scale(1.04); }
.tile-over { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; background: linear-gradient(to top, rgba(0,0,0,.75), transparent 45%, transparent 75%, rgba(0,0,0,.35)); }
.tile-top { display: flex; gap: 6px; }
.tile-bot { display: flex; gap: 8px; align-items: center; }
.tile-cap { flex: 1; font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.chip { background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chips .chip { background: var(--panel2); }
.fire { font-size: 12px; background: rgba(0,0,0,.4); border-radius: 999px; padding: 1px 8px; }
.fire.on { background: rgba(255,122,89,.85); }

.home-side { display: grid; gap: 14px; align-content: start; margin-top: 38px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.panel h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.nextup { padding: 7px 8px; border-radius: 8px; cursor: pointer; position: relative; }
.nextup:hover, .qrow:hover, .win:hover, .person:hover { background: var(--panel2); }
.nextup .due { position: absolute; right: 8px; top: 8px; }
.due { font-size: 11px; border-radius: 999px; padding: 0 7px; background: var(--panel2); color: var(--dim); }
.due.today { background: var(--warn); color: #111; }
.due.over { background: var(--bad); color: #fff; }
.qrow, .win { display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.qtext { font-size: 13px; }
.win .check { color: var(--ok); font-weight: 800; }
.people { display: grid; gap: 4px; }
.person { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }

/* ---------------------------------------------------------------- modals: profile, compose, post */
.modal h3 { margin: 0; }
.modal label { color: var(--dim); font-size: 12px; margin-bottom: -6px; }
.modal input:not([type=checkbox]), .modal textarea, .modal select { width: 100%; }
.modal { max-height: 92vh; overflow-y: auto; }
.modal.post { width: min(980px, 94vw); }
.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head h2 { margin: 0; }
.statusline { color: var(--ok); font-size: 13px; margin-top: 4px; }
.bio { margin: 4px 0; color: #d7dbe5; }
.stack { display: grid; gap: 6px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.miniwall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.miniwall img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--dim); cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--accent); color: var(--text); }
.previews { display: flex; flex-wrap: wrap; gap: 6px; }
.previews img { height: 80px; border-radius: 8px; }
.viewer { display: grid; gap: 8px; }
.viewer img { width: 100%; border-radius: 10px; background: #000; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-head .firebtn { margin-left: auto; }
.firebtn.on { background: rgba(255,122,89,.85); border-color: transparent; }
.post-body { font-size: 15px; }
.replies { display: grid; gap: 8px; }
.reply { display: flex; gap: 8px; padding: 8px; border-radius: 8px; background: var(--bg); }
.reply.accepted { border: 1px solid var(--ok); }
.reply .acc { color: var(--ok); }

/* ---------------------------------------------------------------- dependencies */
.dep { font-size: 11px; margin-left: 3px; }
.uses { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.usechip { font-size: 10px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--warn); }
.usechip.done { color: var(--ok); border-color: rgba(63,191,127,.4); }
.usechip.big { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.usechip .x { color: var(--dim); }
.depline { font-size: 13px; padding: 5px 8px; border-radius: 6px; margin: 4px 0; }
.depline.lock { background: rgba(229,83,75,.12); }
.depline.warn { background: rgba(227,179,65,.12); }

:root { --todo: #4a5163; }

/* ================= NEW for this design (listed in SPEC.md "Design system additions") ================= */
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* N1 top bar on Home + N2 ghost tabs: project-only tabs shown before a project is picked */
.tabs.need-project { align-items:center; }
.np-label { color:var(--dim); font-size:12px; margin-right:4px; }
.ghost-tab { background:transparent; border:1px dashed var(--line); color:var(--dim); }
.ghost-tab:hover, .ghost-tab.open { border-style:solid; border-color:var(--accent); color:var(--text); background:var(--panel2); }
.gwrap { position:relative; }
/* N3 project picker (menu under a ghost tab or the launcher) */
.picker { position:absolute; right:0; top:calc(100% + 6px); width:320px; z-index:6; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:6px; box-shadow:0 12px 32px rgba(0,0,0,.5); }
.picker.wide { width:460px; }
.pk-head { padding:6px 8px 8px; color:var(--dim); font-size:12px; } .pk-head b { color:var(--text); }
.pk-row { display:grid; grid-template-columns:86px 1fr auto; gap:8px; align-items:center; padding:7px 8px; border-radius:6px; color:var(--text); }
.pk-row:hover, .pk-row:first-of-type { background:var(--panel2); }
.pk-code { color:var(--dim); font-size:11px; letter-spacing:.06em; }
.pk-name { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pk-foot { padding:8px; border-top:1px solid var(--line); margin-top:6px; }
.lm-row { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; padding:6px 8px; border-radius:6px; }
.lm-row:hover { background:var(--panel2); }
.lm-name { color:var(--text); font-weight:600; display:flex; gap:8px; align-items:baseline; min-width:0; }
.lm-name .pk-code { min-width:76px; }
.lm-links, .pc-links { display:flex; gap:4px; }
.lm-links a, .pc-links a { font-size:12px; padding:2px 8px; border:1px solid var(--line); border-radius:6px; color:var(--text); background:var(--panel2); position:relative; z-index:1; }
.lm-links a:hover, .pc-links a:hover { border-color:var(--accent); }
/* N4 sidebar: name the project list, show that a project row opens */
.side .projects-head { border-top:1px solid var(--line); margin-top:10px; padding-top:12px; color:var(--text); }
.side .projects-head + .sec { padding-top:6px; }
.side .item.proj .go { color:var(--dim); font-weight:400; }
.side .item.proj.active { box-shadow:inset 3px 0 var(--accent); }
/* N5 project cards on Home */
.projwrap { padding:4px 24px 0; }
.pj-head { display:flex; align-items:baseline; gap:14px; flex-wrap:wrap; }
.pj-head .wall-title { margin-bottom:8px; }
.projcards { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:14px; }
.projcard { position:relative; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:12px 14px; display:grid; gap:8px; }
.projcard:hover { border-color:var(--accent); }
.pc-top { display:flex; justify-content:space-between; align-items:center; }
.pc-code { color:var(--dim); font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.projcard h3 { font-size:15px; }
.pc-open { color:var(--text); display:flex; justify-content:space-between; gap:8px; }
.pc-open::after { content:""; position:absolute; inset:0; border-radius:14px; }   /* whole card opens the project */
.pc-arrow { color:var(--accent); }
.pc-prog { display:grid; gap:4px; }
.pc-facts { display:flex; gap:6px; flex-wrap:wrap; min-height:20px; }
.fact { font-size:11px; border-radius:999px; padding:1px 8px; background:var(--panel2); color:var(--text); }
.fact.you { background:var(--accent-fill); color:var(--text); } .fact.quiet { background:none; color:var(--dim); padding-left:0; }
/* N6 project hero: the Home hero, scoped to one project (no drift animation, stats are links) */
.phero { padding:20px 24px; }
.ph-code { font-size:11px; letter-spacing:.08em; color:#cfd6e6; text-transform:uppercase; }
.phero .hello { font-size:24px; }
a.stat:hover { border-color:rgba(255,255,255,.4); }
.stat.bad b { color:#ff9c96; }
.ph-prog { flex-basis:100%; display:grid; gap:4px; }
/* N7 status bar: one segment per Tracker status */
.statusrow { margin-top:8px; }
.sr-head { display:flex; justify-content:space-between; align-items:baseline; gap:10px; flex-wrap:wrap; }
.segbar { display:flex; gap:2px; height:10px; border-radius:5px; overflow:hidden; margin:2px 0 10px; }
.segbar span { min-width:4px; }
.legend { display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.leg { color:var(--dim); font-size:12px; display:inline-flex; gap:5px; align-items:center; } .leg b { color:var(--text); }
.leg i { width:8px; height:8px; border-radius:2px; display:inline-block; }
.legend .total { margin-left:auto; }
/* N8 task rows */
.sect-head { display:flex; justify-content:space-between; align-items:baseline; margin-top:6px; }
.sect-head a, .more { font-size:12px; }
.more { display:block; padding:8px 8px 2px; }
.trows { background:var(--panel); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.trow { display:grid; grid-template-columns:minmax(0,1fr) 70px 130px 104px; gap:10px; align-items:center; padding:8px 14px; color:var(--text); border-bottom:1px solid var(--panel2); }
.trow.nowho { grid-template-columns:minmax(0,1fr) 70px 104px; }
.trow:last-child { border-bottom:0; } .trow:hover { background:var(--panel2); }
.t-main { min-width:0; display:grid; } .t-main b, .t-main .meta { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.t-who { font-size:12px; white-space:nowrap; display:flex; gap:6px; align-items:center; } .dim { color:var(--dim); }
.trow .due { justify-self:end; } .due.none { background:none; }
.trow .pill { justify-self:start; }
table.mini { background:var(--panel); border:1px solid var(--line); border-radius:14px; border-collapse:separate; border-spacing:0; overflow:hidden; }
table.mini td:first-child, table.mini th:first-child { padding-left:14px; }
table.mini tr:last-child td { border-bottom:0; }
.prog { display:flex; gap:8px; align-items:center; }
.load { margin-left:auto; font-size:12px; color:var(--dim); }
button.wide { width:100%; }
.wall.one { columns:auto; max-width:300px; }
.ph-left > .sect:first-child .sect-head { margin-top:0; }
.phome .home-side { margin-top:8px; }

/* narrow window: tabs get their own row so "Home" plus seven tabs still fit (N9) */
@media (max-width:1100px) {
  .home-grid { grid-template-columns:1fr; } .home-side { margin-top:0; }
  .top { flex-wrap:wrap; row-gap:8px; } .top h2 { max-width:60%; }
  .top .tabs { flex-basis:100%; margin-left:0; flex-wrap:wrap; }
  .picker { right:auto; left:0; }
  .trow { grid-template-columns:minmax(0,1fr) 64px 120px 100px; }
}

/* N5 integration: scoped equivalents of the mock's base resets. */
.projcard h3 { margin:0; }
.projcard .pc-open,
.projcard .pc-links a,
.showcard .showhead h3 > a,
.showcard .pc-links a { text-decoration:none; }

/* N5 integration: reserve the actual document gutter only on staff Home. */
html:has(.body.home > .projwrap) { scrollbar-gutter: stable; }

/* N5 integration: the card progress bar (the app only styles .bar under .showprog). */
.pc-prog .bar { height:8px; border-radius:4px; background:rgba(255,255,255,.08); overflow:hidden; }
.pc-prog .bar span { display:block; height:100%; background:linear-gradient(90deg,#3fbf7f,#8be0b1); border-radius:4px; }
/* Phone: hero actions clip off the right edge at 390px (t_7d689301) */
@media (max-width: 760px) { .hero-actions { flex-wrap: wrap; } .hero { margin: 12px; padding: 18px; } }
/* N6-N8 integration: scoped equivalents of the mock's base rules, Project Home only (uxdesigner t_ea4511c9). */
:where(.phome) a:where(.stat, .trow, .leg, .more, .card, .tile, .nextup, .qrow, .win, .person, .mediarow, .news, .face),
:where(.phome .sect-head) a { text-decoration:none; }
:where(.phome) a:where(.stat, .card, .tile, .nextup, .qrow, .win, .person, .mediarow, .news, .face) { color:var(--text); }
:where(.phome) a:where(.card, .tile) { display:block; }
.hero.phero { animation:none; background-size:auto; }
table.mini th { position:static; background:none; }
.trow .due { white-space:nowrap; }
.phome .nextup { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:8px; align-items:start; }
.phome .nextup .due { position:static; grid-column:2; grid-row:1; white-space:nowrap; }
.phome .nextup .meta { grid-column:1 / -1; }
.phome .nextup b { overflow-wrap:anywhere; }
.phome .qrow .mkind { font-family:ui-monospace, Consolas, monospace; font-size:13px; font-weight:700; color:#ffb547; }
.phome .ph-left .mediarow { margin-top:0; background:var(--panel); border:1px solid var(--line); }
.phome .faces { margin-bottom:10px; }
