/* Browser specific adjustments on top of the desktop app's stylesheets. */
/* Links styled as menu items, cards and buttons keep the colours of their class (.nav-item, .primary…);
   only plain links inside rows inherit the text colour. */
a.nav-item, a.client-card, a.text-button, a.secondary, a.primary, .cd-file-row a, .context-files a { text-decoration: none; }
a.client-card, .cd-file-row a, .context-files a { color: inherit; }
a.nav-item { display: flex; }
a.client-card { display: block; }
a.primary, a.secondary { display: inline-flex; align-items: center; gap: 7px; }
a.primary.disabled { pointer-events: none; opacity: .5; }
.cd-file-row > a:first-of-type { flex: 1; min-width: 0; display: grid; text-align: left; }
.context-files a { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.sidebar-footer .icon-button { margin-left: auto; }
.window-titlebar { -webkit-app-region: no-drag; app-region: no-drag; padding-right: 16px; }
#dock:empty { display: none; }
#modal-root .modal-backdrop, #modal-root .ws-drawer-backdrop { z-index: 1000; }
.notification-popover button.unread strong::before { content: '• '; color: #3976d8; }
button.copied { color: #22a06b !important; }
.flow-card[draggable="true"] { cursor: grab; }

/* Command palette */
.palette-modal { width: min(640px, 94vw); padding: 14px; }
.palette-shell .flow-search { width: 100%; }
.palette-shell .flow-search input { width: 100%; }
.palette-results { display: grid; gap: 2px; margin-top: 10px; max-height: 52vh; overflow: auto; }
.palette-row { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.palette-row span { display: grid; min-width: 0; }
.palette-row strong, .palette-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-row small { opacity: .65; }
.palette-row.active, .palette-row:hover { background: rgba(57, 118, 216, .16); }
.palette-foot { display: block; margin-top: 8px; opacity: .6; }

/* Organization: users table, chips, role claim matrix */
.org-head-actions { display: flex; gap: 10px; align-items: center; }
.org-head-actions .flow-search { min-width: 260px; }
.org-table { display: grid; gap: 4px; }
.org-table-head, .org-table-row { display: grid; grid-template-columns: 2.2fr 1.2fr 2fr 1.6fr 1.2fr 90px; gap: 12px; align-items: center; padding: 8px 10px; }
.org-table-head { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.org-table-row { border-radius: 12px; border: 1px solid rgba(127, 140, 170, .16); }
.org-user-cell { display: flex; gap: 10px; align-items: center; text-align: left; background: transparent; border: 0; color: inherit; cursor: pointer; padding: 0; }
.org-user-cell span:last-child { display: grid; min-width: 0; }
.org-user-cell small { opacity: .65; overflow: hidden; text-overflow: ellipsis; }
.org-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.org-chip { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(57, 118, 216, .14); }
.org-chip.base { background: rgba(57, 118, 216, .32); font-weight: 700; }
.role-modal { width: min(760px, 96vw); }
.claim-matrix { display: grid; gap: 2px; margin: 6px 0 4px; }
.claim-row { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr) 70px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.claim-row:nth-child(even) { background: rgba(127, 140, 170, .07); }
.claim-row span:not(:first-child) { text-align: center; }
.claim-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.claim-row input { width: 17px; height: 17px; }

/* Quick note: floating button that opens the capture panel */
.quick-fab { position: absolute; right: 28px; bottom: 24px; z-index: 6; width: 54px; height: 54px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #3976d8, #214fa6); box-shadow: 0 12px 28px rgba(33, 79, 166, .45), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .18s ease, box-shadow .18s ease; }
.quick-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 16px 34px rgba(33, 79, 166, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.quick-fab:focus-visible { outline: 3px solid rgba(57, 118, 216, .5); outline-offset: 3px; }
.quick-fab.has-draft::after { content: ''; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #f5a524; border: 2px solid #214fa6; }
.quick-dock { animation: quick-open .18s ease-out; transform-origin: bottom right; }
@keyframes quick-open { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.quick-head { display: flex; align-items: flex-start; gap: 10px; }
.quick-head > div { flex: 1; min-width: 0; }
.quick-head h2 { margin: 0; }
.quick-head p { margin: 2px 0 0; font-size: 12px; opacity: .7; }
.quick-head-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3976d8, #214fa6); flex: none; }
.quick-capture-actions { justify-content: flex-end; }

/* Organization page: title block stacks; tabs and content share one column */
.org-page .org-header > div:only-child { display: block; }
.org-page .org-header > div:only-child span { display: block; }
.org-page .cd-tabs { border: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 10px 16px 0; }
.org-page .cd-content { padding: 18px 0 0; overflow: visible; }
.login-help { display: block; text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Quick actions: radial menu around the floating button (bottom right, every page) */
.qa { position: absolute; right: 28px; bottom: 24px; z-index: 40; width: 56px; height: 56px; }
.qa .qa-main { position: absolute; inset: 0; right: auto; bottom: auto; width: 56px; height: 56px; z-index: 2; }
.qa .qa-main svg { transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.qa.open .qa-main svg { transform: rotate(135deg); }
.qa.open .qa-main { box-shadow: 0 0 0 8px color-mix(in srgb, #3976d8 18%, transparent), 0 14px 30px rgba(33, 79, 166, .45); }
.qa::before { content: ''; position: absolute; right: -40px; bottom: -40px; width: 0; height: 0; border-radius: 50%; background: radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--surface) 92%, transparent) 0 60%, transparent 70%); transition: width .22s ease, height .22s ease; pointer-events: none; z-index: 0; }
.qa.open::before { width: 230px; height: 230px; }
.qa-item { position: absolute; left: 6px; top: 6px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; z-index: 1;
  transform: translate(0, 0) scale(.3); opacity: 0; pointer-events: none; box-shadow: 0 8px 18px rgba(6, 12, 30, .3);
  transition: transform .26s cubic-bezier(.3, 1.4, .5, 1) var(--d), opacity .18s ease var(--d); }
.qa.open .qa-item { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; pointer-events: auto; }
.qa-item:hover { filter: brightness(1.1); }
.qa-item:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 3px; }
.qa-item.tone-amber { background: linear-gradient(135deg, #f0a43a, #d07a12); }
.qa-item.tone-blue { background: linear-gradient(135deg, #3976d8, #214fa6); }
.qa-item.tone-violet { background: linear-gradient(135deg, #8a72f0, #5b45c9); }
.qa-item.tone-green { background: linear-gradient(135deg, #2fb380, #1b8a5f); }
.qa-label { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 700;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(6, 12, 30, .18); opacity: 0; transition: opacity .15s; pointer-events: none; }
.qa.open .qa-item .qa-label { opacity: 1; transition-delay: calc(var(--d) + .12s); }
@media (prefers-reduced-motion: reduce) { .qa-item, .qa .qa-main svg, .qa::before { transition: none; } }
