/* myceons skal (okt 2026) — se js/myceon-shell.js. Tokens från app.css (ljust och mörkt). */

/* ── Topbaren ─────────────────────────────────────────────────────────────── */
/* Planen hör till kontomenyn, inte till topbaren som används varje dag. */
.app-topbar .plan-badge, .platform-chat-topbar .plan-badge { display: none !important; }
.user-plan { display: block; margin-top: 2px; font-size: calc(11.5px * var(--t-text-scale, 1)); color: var(--text-muted); }
/* "+" står efter verktygen och lägger bara till verktyg. */
.btn-add-tool { margin-left: 2px; }

/* Design: en flik i Bygg. I Design är App-fliken inte vald (Design visar appen). */
.preview-tab.design-tab.active { color: var(--accent); }
html.in-design .preview-tab[data-tab].active { background: transparent; color: var(--text-secondary); box-shadow: none; }

/* Projektlistan i Bygg: Nytt projekt i rubrikraden. */
.section-new { display: inline-flex; align-items: center; gap: calc(3px * var(--t-space, 1)); height: 22px; padding: 0 calc(8px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1));
  border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); font-size: calc(11.5px * var(--t-text-scale, 1)); cursor: pointer; flex: none; }
.section-new:hover { background: var(--bg-hover); color: var(--text-primary); }
.section-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Projekt-vyn: huvudet står kvar när rutnätet skrollar; Nytt projekt och antal bredvid rubriken. */
.app-layout.mode-projects .projects-view-head {
  position: sticky; top: -28px; z-index: 5; margin: -28px -36px 22px; padding: calc(28px * var(--t-space, 1)) calc(36px * var(--t-space, 1)) calc(14px * var(--t-space, 1));
  background: var(--bg-base); border-bottom: 1px solid var(--border-subtle, var(--border-default));
}
.pvh-titlerow { display: flex; align-items: center; gap: calc(10px * var(--t-space, 1)); }
.pvh-count { font-size: calc(12.5px * var(--t-text-scale, 1)); color: var(--text-muted); }
.pvh-new { display: inline-flex; align-items: center; gap: calc(5px * var(--t-space, 1)); height: 30px; padding: 0 calc(12px * var(--t-space, 1)); margin-left: 6px; border-radius: calc(8px * var(--t-radius, 1));
  border: 1px solid var(--accent); background: var(--accent); color: var(--t-on-strong, #fff); font: inherit; font-size: calc(13px * var(--t-text-scale, 1)); font-weight: 500; cursor: pointer; }
.pvh-new:hover { filter: brightness(1.06); }
.pvh-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) { .app-layout.mode-projects .projects-view-head { margin: -28px -16px 16px; padding: calc(20px * var(--t-space, 1)) calc(16px * var(--t-space, 1)) calc(12px * var(--t-space, 1)); } }

/* ── Samtal: menyn ────────────────────────────────────────────────────────── */
.pc-rail-node.pc-rail-top { font-weight: 600; color: var(--text-primary); }
.pc-rail-node.pc-rail-top .pc-rail-icon { color: var(--accent); }
.pc-rail-node.pc-rail-top .pc-rail-icon .ui-icon { width: 16px; height: 16px; }
@media (min-width: 721px) {
  /* Inställningar längst ned i menyn. */
  .pc-rail > .pc-rail-node[data-rail="adresser"] { margin-top: auto; }
}

/* ── Samtal: listans huvud (står kvar, listan skrollar under) ─────────────── */
.pc-list-head { flex: none; display: flex; flex-direction: column; gap: calc(8px * var(--t-space, 1)); padding: calc(12px * var(--t-space, 1)) calc(12px * var(--t-space, 1)) calc(8px * var(--t-space, 1));
  border-bottom: 1px solid var(--border-subtle, var(--border-default)); background: var(--bg-surface); }
.pc-list-head[hidden] { display: none; }
.plh-row, .plh-row2 { display: flex; align-items: center; gap: calc(8px * var(--t-space, 1)); min-width: 0; }
.plh-title { margin: 0; font-size: calc(15px * var(--t-text-scale, 1)); font-weight: 650; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plh-count { font-size: calc(12px * var(--t-text-scale, 1)); color: var(--text-muted); white-space: nowrap; }
.plh-fill { flex: 1 1 auto; }
.plh-btn { display: inline-flex; align-items: center; gap: calc(4px * var(--t-space, 1)); height: 28px; padding: 0 calc(10px * var(--t-space, 1)); border-radius: calc(8px * var(--t-radius, 1)); border: 1px solid var(--accent);
  background: var(--accent); color: var(--t-on-strong, #fff); font: inherit; font-size: calc(12.5px * var(--t-text-scale, 1)); font-weight: 500; cursor: pointer; white-space: nowrap; }
.plh-btn:hover { filter: brightness(1.06); }
.plh-search .pc-thread-search { width: 100%; margin: 0; box-sizing: border-box; }
.plh-tools { display: flex; flex-direction: column; gap: calc(6px * var(--t-space, 1)); }
.plh-tools[hidden] { display: none; }
.plh-chips { display: flex; flex-wrap: wrap; gap: calc(4px * var(--t-space, 1)); }
.plh-chip { height: 24px; padding: 0 calc(9px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1)); border: 1px solid var(--border-default); background: transparent;
  color: var(--text-secondary); font: inherit; font-size: calc(12px * var(--t-text-scale, 1)); cursor: pointer; }
.plh-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.plh-chip.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 500; }
.plh-chip.plh-clear { border-style: dashed; }
.plh-select { height: 26px; padding: 0 calc(6px * var(--t-space, 1)); border-radius: calc(6px * var(--t-radius, 1)); border: 1px solid var(--border-default); background: var(--bg-base);
  color: var(--text-secondary); font: inherit; font-size: calc(12px * var(--t-text-scale, 1)); }
.plh-link { border: 0; background: none; color: var(--text-muted); font: inherit; font-size: calc(12px * var(--t-text-scale, 1)); cursor: pointer; padding: calc(2px * var(--t-space, 1)) calc(4px * var(--t-space, 1)); border-radius: calc(4px * var(--t-radius, 1)); }
.plh-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.plh-btn:focus-visible, .plh-chip:focus-visible, .plh-select:focus-visible, .plh-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Listan under huvudet: skrollar för sig (på datorn). */
@media (min-width: 721px) {
  #platform-chat-overlay .platform-chat-sidebar { display: flex; flex-direction: column; overflow: hidden; padding-top: 0; }
  #platform-chat-overlay #platform-chat-threads-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}

/* ── Samtal: trådens huvud — handlingarna ─────────────────────────────────── */
.pc-head-acts { display: inline-flex; align-items: center; gap: calc(4px * var(--t-space, 1)); margin-left: auto; margin-right: 6px; flex: none; }
.pc-hact { display: inline-flex; align-items: center; gap: calc(4px * var(--t-space, 1)); height: 28px; padding: 0 calc(9px * var(--t-space, 1)); border-radius: calc(7px * var(--t-radius, 1)); border: 1px solid var(--border-default);
  background: transparent; color: var(--text-secondary); font: inherit; font-size: calc(12.5px * var(--t-text-scale, 1)); cursor: pointer; }
.pc-hact:hover { background: var(--bg-hover); color: var(--text-primary); }
.pc-hact:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pc-hact .ui-icon { width: 13px; height: 13px; }
@media (max-width: 900px) { .pc-hact span { display: none; } .pc-hact { padding: 0 calc(7px * var(--t-space, 1)); } }

/* ── Samtal: läget när inget meddelande är valt ───────────────────────────── */
.platform-chat-empty.pc-brief { text-align: start; line-height: 1.4; font-size: calc(14px * var(--t-text-scale, 1)); }
.platform-chat-empty.pc-brief p { max-width: none; margin: 0; }
.pc-brief { max-width: 680px; margin: 0 auto; padding: calc(36px * var(--t-space, 1)) calc(24px * var(--t-space, 1)) calc(48px * var(--t-space, 1)); display: flex; flex-direction: column; gap: calc(22px * var(--t-space, 1)); color: var(--text-primary); }
.pcb-hello { display: flex; align-items: center; gap: calc(14px * var(--t-space, 1)); }
.pcb-hello h2 { margin: 0; font-size: calc(22px * var(--t-text-scale, 1)); font-weight: 650; }
.pcb-hello p { margin: 2px 0 0; color: var(--text-muted); font-size: calc(13.5px * var(--t-text-scale, 1)); }
.pcb-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: calc(12px * var(--t-radius, 1)); flex: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.pcb-mark .ui-icon { width: 24px; height: 24px; }
.pcb-h { margin: 0 0 10px; font-size: calc(15px * var(--t-text-scale, 1)); font-weight: 650; color: var(--text-primary); }
.pcb-todo { display: flex; flex-direction: column; }
.pcb-since-d > summary { list-style: none; cursor: pointer; }
.pcb-since-d > summary::-webkit-details-marker { display: none; }
.pcb-since-d > summary h3 { display: inline-flex; align-items: baseline; gap: calc(6px * var(--t-space, 1)); margin: 0 0 8px; }
.pcb-since-d > summary h3::after { content: "▸"; font-size: calc(10px * var(--t-text-scale, 1)); transition: transform .15s; }
.pcb-since-d[open] > summary h3::after { transform: rotate(90deg); }
.pcb-since-d .pcb-more { margin: 6px 0 0 10px; }
.pcb-askbox { display: flex; flex-direction: column; gap: calc(10px * var(--t-space, 1)); }
.pcb-day:empty { display: none; }
.pcb-sec h3 { margin: 0 0 8px; font-size: calc(12px * var(--t-text-scale, 1)); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.pcb-sec ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: calc(2px * var(--t-space, 1)); }
.pcb-item { display: flex; align-items: center; gap: calc(10px * var(--t-space, 1)); width: 100%; padding: calc(9px * var(--t-space, 1)) calc(10px * var(--t-space, 1)); border: 0; border-radius: calc(8px * var(--t-radius, 1)); background: transparent;
  color: var(--text-primary); font: inherit; text-align: start; cursor: pointer; }
.pcb-item:hover { background: var(--bg-hover); }
.pcb-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pcb-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pcb-what { font-size: calc(13.5px * var(--t-text-scale, 1)); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcb-sub { font-size: calc(12px * var(--t-text-scale, 1)); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcb-when { flex: none; font-size: calc(12px * var(--t-text-scale, 1)); color: var(--text-muted); }
.pcb-when.is-late { color: var(--error); font-weight: 500; }
.pcb-tag { flex: none; font-size: calc(11px * var(--t-text-scale, 1)); font-weight: 600; padding: calc(2px * var(--t-space, 1)) calc(7px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1)); }
.pcb-tag.is-us { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.pcb-tag.is-them { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pcb-dim { color: var(--text-muted); font-size: calc(12.5px * var(--t-text-scale, 1)); margin: 0; }
.pcb-ask { display: flex; align-items: center; gap: calc(8px * var(--t-space, 1)); padding: calc(6px * var(--t-space, 1)) calc(6px * var(--t-space, 1)) calc(6px * var(--t-space, 1)) calc(12px * var(--t-space, 1)); border-radius: calc(12px * var(--t-radius, 1)); border: 1px solid var(--border-default); background: var(--bg-surface); }
.pcb-ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pcb-ask-ic { color: var(--accent); display: grid; place-items: center; }
.pcb-ask input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: calc(14px * var(--t-text-scale, 1)); padding: calc(6px * var(--t-space, 1)) 0; }
.pcb-ask-go { height: 32px; padding: 0 calc(14px * var(--t-space, 1)); border-radius: calc(8px * var(--t-radius, 1)); border: 0; background: var(--accent); color: var(--t-on-strong, #fff); font: inherit; font-size: calc(13px * var(--t-text-scale, 1)); font-weight: 500; cursor: pointer; }
.pcb-foot { display: flex; align-items: center; flex-wrap: wrap; gap: calc(12px * var(--t-space, 1)); }
.pcb-foot .pc-mail-empty-new { display: inline-flex; align-items: center; gap: calc(6px * var(--t-space, 1)); margin-top: 0; height: 34px; padding: 0 calc(14px * var(--t-space, 1)); border-radius: calc(8px * var(--t-radius, 1));
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: calc(13px * var(--t-text-scale, 1)); font-weight: 500; cursor: pointer; }
.pcb-foot .pc-mail-empty-new:hover { background: var(--bg-hover); }
.pc-brief kbd, .cmdk kbd { font: inherit; font-size: calc(11px * var(--t-text-scale, 1)); padding: calc(1px * var(--t-space, 1)) calc(5px * var(--t-space, 1)); border-radius: calc(4px * var(--t-radius, 1)); border: 1px solid var(--border-default); background: var(--bg-base); color: var(--text-muted); }
@media (max-width: 720px) { .pc-brief { padding: calc(20px * var(--t-space, 1)) calc(16px * var(--t-space, 1)) calc(32px * var(--t-space, 1)); } .pcb-foot .pcb-dim { display: none; } }

/* ── ⌘K ───────────────────────────────────────────────────────────────────── */
.cmdk { position: fixed; inset: 0; z-index: 100100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh calc(16px * var(--t-space, 1)) calc(16px * var(--t-space, 1)); background: color-mix(in srgb, var(--t-text, rgb(0 0 0)) 35%, transparent); }
.cmdk-card { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; border-radius: calc(14px * var(--t-radius, 1));
  border: 1px solid var(--border-default); background: var(--bg-elevated, var(--bg-surface)); box-shadow: var(--shadow-lg, 0 24px 60px rgba(0, 0, 0, .3)); }
.cmdk-in { display: flex; align-items: center; gap: calc(10px * var(--t-space, 1)); padding: calc(12px * var(--t-space, 1)) calc(14px * var(--t-space, 1)); border-bottom: 1px solid var(--border-subtle, var(--border-default)); color: var(--text-muted); }
.cmdk-in input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: calc(15px * var(--t-text-scale, 1)); }
.cmdk-list { overflow-y: auto; padding: calc(6px * var(--t-space, 1)); }
.cmdk-g { padding: calc(8px * var(--t-space, 1)) calc(10px * var(--t-space, 1)) calc(4px * var(--t-space, 1)); font-size: calc(11px * var(--t-text-scale, 1)); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.cmdk-item { display: flex; align-items: center; gap: calc(10px * var(--t-space, 1)); width: 100%; padding: calc(8px * var(--t-space, 1)) calc(10px * var(--t-space, 1)); border: 0; border-radius: calc(8px * var(--t-radius, 1)); background: transparent;
  color: var(--text-primary); font: inherit; font-size: calc(13.5px * var(--t-text-scale, 1)); text-align: start; cursor: pointer; }
.cmdk-item .ui-icon { color: var(--text-secondary); flex: none; }
.cmdk-item.is-on, .cmdk-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cmdk-item.is-on .ui-icon { color: var(--accent); }
.cmdk-l { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-h { flex: 1 1 auto; min-width: 0; font-size: calc(12px * var(--t-text-scale, 1)); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: calc(18px * var(--t-space, 1)); color: var(--text-muted); font-size: calc(13px * var(--t-text-scale, 1)); }


/* ── Hemmet: förslag, godkännanden, sedan sist ────────────────────────────── */
.pcb-suggest { display: flex; flex-wrap: wrap; gap: calc(6px * var(--t-space, 1)); }
.pcb-chip { padding: calc(7px * var(--t-space, 1)) calc(12px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1)); border: 1px solid var(--border-default); background: var(--bg-surface);
  color: var(--text-primary); font: inherit; font-size: calc(13px * var(--t-text-scale, 1)); cursor: pointer; text-align: start; }
.pcb-chip:hover { border-color: var(--accent); color: var(--accent); }
.pcb-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcb-sec.is-approvals h3 { color: var(--warning); }
.pcb-since { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: calc(6px * var(--t-space, 1)); }
.pcb-since li { display: flex; gap: calc(10px * var(--t-space, 1)); font-size: calc(13px * var(--t-text-scale, 1)); color: var(--text-secondary); line-height: 1.45; padding: calc(2px * var(--t-space, 1)) calc(10px * var(--t-space, 1)); }
.pcb-since-t { flex: none; width: 64px; color: var(--text-muted); font-size: calc(12px * var(--t-text-scale, 1)); }
.pc-home.is-myceon { padding-top: calc(28px * var(--t-space, 1)); }

/* ── Verktyget som sammanhang i myceon ────────────────────────────────────── */
.pc-tool-ctx { display: inline-flex; align-items: center; gap: calc(6px * var(--t-space, 1)); align-self: flex-start; margin: 0 0 6px; padding: calc(3px * var(--t-space, 1)) calc(6px * var(--t-space, 1)) calc(3px * var(--t-space, 1)) calc(10px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1));
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: calc(12.5px * var(--t-text-scale, 1)); }
.pc-tool-ctx .ui-icon { width: 12px; height: 12px; }
.pc-tool-ctx button { border: 0; background: none; color: inherit; font-size: calc(15px * var(--t-text-scale, 1)); line-height: 1; cursor: pointer; padding: 0 calc(4px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1)); }
.pc-tool-ctx button:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.otv-ask { gap: calc(5px * var(--t-space, 1)); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-default)); }
.otv-ask .ui-icon { width: 13px; height: 13px; }

/* ── Bygg och Projekt: verktyg märks ──────────────────────────────────────── */
.ot-proj-badge, .proj-badge-tool { display: inline-flex; align-items: center; height: 18px; padding: 0 calc(7px * var(--t-space, 1)); margin-left: 6px; border-radius: calc(999px * var(--t-radius, 1)); flex: none;
  font-size: calc(11px * var(--t-text-scale, 1)); font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ── Organisationen → Verktyg ─────────────────────────────────────────────── */
.ot-admin-lead { color: var(--text-secondary); font-size: calc(13.5px * var(--t-text-scale, 1)); max-width: 720px; margin: 0 0 16px; }
.ot-admin-wrap { overflow-x: auto; }
.ot-admin { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--t-text-scale, 1)); }
.ot-admin th { text-align: start; font-size: calc(11.5px * var(--t-text-scale, 1)); font-weight: 600; color: var(--text-muted); padding: calc(6px * var(--t-space, 1)) calc(10px * var(--t-space, 1)); border-bottom: 1px solid var(--border-default); white-space: nowrap; }
.ot-admin td { padding: calc(10px * var(--t-space, 1)); border-bottom: 1px solid var(--border-subtle, var(--border-default)); vertical-align: top; color: var(--text-primary); }
.ot-admin-name { display: inline-flex; align-items: center; gap: calc(6px * var(--t-space, 1)); border: 0; background: none; padding: 0; color: var(--text-primary); font: inherit; font-weight: 600; cursor: pointer; }
.ot-admin-name:hover span { text-decoration: underline; }
.ot-admin-acts { white-space: nowrap; text-align: end; }
.ot-admin-acts button { margin-left: 4px; }
.ot-danger { color: var(--error) !important; }
.ot-admin td:nth-child(3) { white-space: nowrap; }

/* Trådlänkar i myceons svar (posten: post_overview, search_post). */
.pc-thread-link { display: flex; align-items: center; gap: calc(8px * var(--t-space, 1)); width: 100%; max-width: 520px; margin: 4px 0; padding: calc(8px * var(--t-space, 1)) calc(12px * var(--t-space, 1)); border-radius: calc(10px * var(--t-radius, 1));
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: calc(13.5px * var(--t-text-scale, 1)); text-align: start; cursor: pointer; }
.pc-thread-link:hover { border-color: var(--accent); }
.pc-thread-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pc-thread-link > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-thread-link .ui-icon, .pc-thread-link .pc-ui-icon { flex: none; color: var(--text-muted); }

/* Kollega: inkommande mejl från någon i organisationen (och svar som går till en kollega). */
.pc-msg-colleague { display: inline-block; margin-left: 6px; padding: calc(1px * var(--t-space, 1)) calc(7px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1)); font-size: calc(11px * var(--t-text-scale, 1)); font-weight: 600; vertical-align: 1px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Projekt-vyn: vilken organisation listan gäller, och projekt i ens andra organisationer. */
.projects-org-note { display: flex; flex-wrap: wrap; align-items: center; gap: calc(6px * var(--t-space, 1)) calc(10px * var(--t-space, 1)); margin: 0 0 14px; font-size: calc(13px * var(--t-text-scale, 1)); color: var(--text-muted); }
.projects-org-note b { color: var(--text-primary); font-weight: 600; }
.projects-org-switch { height: 26px; padding: 0 calc(10px * var(--t-space, 1)); border: 1px solid var(--border-default); border-radius: calc(999px * var(--t-radius, 1)); background: var(--bg-surface); color: var(--text-secondary); font: inherit; font-size: calc(12.5px * var(--t-text-scale, 1)); cursor: pointer; }
.projects-org-switch:hover { background: var(--bg-hover); color: var(--text-primary); }
.projects-org-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Topbaren, städad (okt 2026, alternativ B — js/topbar.js) ───────────────────────────── */
/* Loggan och organisationen är en knapp: myceon-märket + organisationens namn. */
.app-topbar .logo, .platform-chat-topbar .pc-brand { display: none; }
.org-switch-host::before { content: none; }
.org-switch { height: 32px; padding: 0 calc(9px * var(--t-space, 1)) 0 calc(4px * var(--t-space, 1)); font-weight: 600; font-size: calc(13.5px * var(--t-text-scale, 1)); }
.org-switch-mark.org-switch-brand { width: 24px; height: 24px; border-radius: calc(7px * var(--t-radius, 1)); font-size: calc(14px * var(--t-text-scale, 1)); font-weight: 700; letter-spacing: 0;
  background: var(--accent, #2563eb); color: var(--text-on-accent, #fff); }
/* Två fästa verktyg + "Alla verktyg · N". */
.org-tool-btn.org-tool-all { border-color: var(--border-subtle, var(--border-default)); background: var(--bg-elevated, transparent); }
.org-tool-btn.org-tool-all:hover { border-color: var(--border-default); }
@media (max-width: 900px) { .org-tool-btn.org-tool-all { display: none; } }
/* Dölj sidopanel sitter i panelen; topbaren visar bara Visa sidopanel när panelen är dold. */
#sidebar-toggle:not(.collapsed) { display: none; }
/* Ångra/gör om: i projektmenyn (klick på projektnamnet) och på ⌘Z — inte som knappar i raden. */
#history-controls { display: none !important; }
.tb-name-zone .project-label { display: none; }
/* Projektet och flikarna står i flödet mellan vänsterklustret och åtgärderna (i stället för absolut
   centrerade över förhandsvisningen, där de krockade med verktygen när de blev fler). */
.app-topbar .topbar-tabs { position: static; flex: 1 1 auto; min-width: 0; justify-content: center; gap: calc(10px * var(--t-space, 1)); pointer-events: auto; }
.app-topbar .tb-name-zone { flex: 0 1 auto; justify-content: flex-end; }
.app-topbar .topbar-tabs .preview-tabs { margin: 0; }
.app-topbar .tb-right-zone { display: none; }
.app-topbar .logo-container { flex: 0 0 auto; gap: calc(10px * var(--t-space, 1)); }
.app-topbar .tb-name-zone { overflow: hidden; }
.app-topbar .tb-name-zone .current-project { max-width: 260px; }
.app-topbar { gap: calc(12px * var(--t-space, 1)); }
.app-topbar .tb-name-zone .current-project { min-width: 0; }
.app-topbar .tb-name-zone .project-name { min-width: 0; text-align: left; }
.app-topbar .logo-container { flex: 0 1 auto; min-width: 0; }
.app-topbar .logo-container > .mode-switch, .app-topbar .logo-container > .btn-new, .app-topbar .org-switch-host { flex-shrink: 0; }
.app-topbar .org-tools { flex-shrink: 0; }
/* Blir det trångt (Topbar.fit): först göms de fästa verktygen (Alla verktyg finns kvar), sedan flikarnas ikoner. */
.app-topbar.tb-tight .org-tools .org-tool-btn:not(.org-tool-all):not(.org-tool-compact):not(.is-on) { display: none; }
.app-topbar.tb-tighter .preview-tab svg, .app-topbar.tb-tighter .tb-name-zone .ot-proj-badge { display: none; }
.app-topbar.tb-tightest .org-tool-all span, .app-topbar.tb-tightest #open-preview-tab-btn { display: none; }
.app-topbar.tb-tightest .org-tool-all::after { content: "▾"; font-size: calc(10px * var(--t-text-scale, 1)); margin-left: 2px; }

/* ── Byggpanelens huvud: samma som listans huvud i Samtal (js/topbar.js installBuildHead) ── */
/* Huvudåtgärden för att skapa något står ytterst till höger i panelens huvud i varje läge. */
.build-head { border-bottom: 1px solid var(--border-subtle, var(--border-default)); padding-bottom: calc(10px * var(--t-space, 1)); background: var(--bg-surface); }
.build-head .bh-collapse, .pc-list-head .plh-collapse { flex: none; width: 28px; height: 28px; margin-left: -4px; display: grid; place-items: center; border: 0; border-radius: calc(7px * var(--t-radius, 1));
  background: transparent; color: var(--text-muted); cursor: pointer; }
.build-head .bh-collapse:hover, .pc-list-head .plh-collapse:hover { background: var(--bg-hover); color: var(--text-primary); }
.build-head .bh-project { min-width: 0; display: inline-flex; align-items: center; gap: calc(6px * var(--t-space, 1)); height: 30px; padding: 0 calc(8px * var(--t-space, 1)); margin-left: -4px; border: 0; border-radius: calc(8px * var(--t-radius, 1));
  background: transparent; color: var(--text-primary); font: inherit; cursor: pointer; }
.build-head .bh-project:hover { background: var(--bg-hover); }
.build-head .bh-project:focus-visible, .build-head .bh-collapse:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.build-head .bh-badge { flex: none; padding: calc(1px * var(--t-space, 1)) calc(7px * var(--t-space, 1)); border-radius: calc(999px * var(--t-radius, 1)); background: var(--accent-subtle, rgba(37, 99, 235, .1)); color: var(--accent); font-size: calc(11px * var(--t-text-scale, 1)); font-weight: 600; }
.build-head .bh-chev { flex: none; color: var(--text-muted); }
.build-head .bh-presence #team-presence { margin: 0; }
.app-layout.mode-design .build-head { display: none; }
/* Projektnamnet bor i panelens huvud — inte i topbaren (där står flikarna) eller i statusraden. */
.app-topbar .tb-name-zone { display: none; }
#chat-project-context { display: none; }
/* Den lilla "+ Nytt" i projektlistan ersätts av panelens "+ Nytt projekt". */
#new-project-btn { display: none; }
/* Projekt-vyn: "+ Nytt projekt" ytterst till höger i huvudet, som i Samtal och Bygg. */
.projects-view-head .pvh-new { order: 99; margin-left: 4px; }
/* Samtal: samma « i listans huvud; topbaren visar bara Visa sidopanel när listan är dold. Mobilen har sin lådknapp. */
.platform-chat-topbar #pc-sidebar-collapse:not(.collapsed) { display: none; }
@media (max-width: 720px) { .pc-list-head .plh-collapse { display: none; } }
/* Utan listhuvud (Kontakter): knappen står kvar i topbaren. */
.platform-chat-overlay:has(.pc-list-head[hidden]) #pc-sidebar-collapse, .platform-chat-overlay:not(:has(.pc-list-head)) #pc-sidebar-collapse { display: inline-flex; }
/* myceon som app på datorn (L29, js/app-install.js) — en tyst rad i Nu */
.ai-nu { margin: 8px 0 0; font-size: calc(13px * var(--t-text-scale, 1)); color: var(--text-secondary); display: flex; flex-wrap: wrap; align-items: center; gap: calc(6px * var(--t-space, 1)); }
.ai-nu-btn, .ai-nu-later { font: inherit; font-size: calc(12.5px * var(--t-text-scale, 1)); border-radius: calc(7px * var(--t-radius, 1)); padding: calc(3px * var(--t-space, 1)) calc(10px * var(--t-space, 1)); cursor: pointer; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); }
.ai-nu-later { border-color: transparent; background: none; color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.ai-nu-btn:focus-visible, .ai-nu-later:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
