/* ==========================================================================
   Flowboard — base, shell and shared components
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: var(--fb-fw-regular) var(--fb-fs-body)/var(--fb-lh) var(--fb-font); color: var(--fb-text); background: var(--fb-bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--fb-font-display); line-height: var(--fb-lh-tight); letter-spacing: -.01em; }
h1 { font-size: var(--fb-fs-h1); font-weight: var(--fb-fw-semibold); }
h2 { font-size: var(--fb-fs-h2); font-weight: var(--fb-fw-semibold); }
h3 { font-size: var(--fb-fs-h3); font-weight: var(--fb-fw-semibold); }
h4 { font-size: var(--fb-fs-h4); font-weight: var(--fb-fw-semibold); }
p { margin: 0 0 var(--fb-s-2); }
a { color: var(--fb-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
code { font-family: var(--fb-font-mono); font-size: .85em; background: var(--fb-secondary); padding: 1px 4px; border-radius: var(--fb-r-sm); }
kbd { font-family: var(--fb-font-mono); font-size: 11px; min-width: 20px; padding: 1px 6px; border: 1px solid var(--fb-border-strong); border-bottom-width: 2px; border-radius: var(--fb-r-sm); background: var(--fb-surface-2); color: var(--fb-text-2); display: inline-block; text-align: center; }
:focus-visible { outline: 2px solid var(--fb-focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--fb-text-muted); } .small { font-size: var(--fb-fs-small); } .caption { font-size: var(--fb-fs-caption); color: var(--fb-text-muted); }
.ic { width: 16px; height: 16px; flex: none; vertical-align: middle; }
.ic-20 { width: 20px; height: 20px; } .ic-14 { width: 14px; height: 14px; } .ic-12 { width: 12px; height: 12px; } .ic-24 { width: 24px; height: 24px; }
.fill { fill: currentColor; }
.stack { display: flex; flex-direction: column; gap: var(--fb-s-2); }
.row { display: flex; align-items: center; gap: var(--fb-s-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--fb-s-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--fb-border); margin: var(--fb-s-2) 0; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--fb-s-150); height: 32px; padding: 0 var(--fb-s-3); border-radius: var(--fb-r-btn); border: 0; background: var(--fb-secondary); color: var(--fb-text); font-weight: var(--fb-fw-medium); cursor: pointer; white-space: nowrap; transition: background var(--fb-dur-fast) var(--fb-ease), color var(--fb-dur-fast); text-decoration: none; }
.btn:hover { background: var(--fb-secondary-hover); text-decoration: none; }
.btn:active { background: var(--fb-secondary-active); }
.btn-primary { background: var(--fb-primary); color: var(--fb-on-primary); }
.btn-primary:hover { background: var(--fb-primary-hover); } .btn-primary:active { background: var(--fb-primary-active); }
.btn-subtle { background: transparent; color: var(--fb-text-2); }
.btn-subtle:hover { background: var(--fb-subtle-hover); color: var(--fb-text); } .btn-subtle:active { background: var(--fb-subtle-active); }
.btn-danger { background: var(--fb-danger); color: #fff; } .btn-danger:hover { background: var(--fb-danger-hover); }
[data-theme="dark"] .btn-danger { color: #1B0B09; }
.btn-accent { background: var(--fb-accent); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--fb-disabled); color: var(--fb-text-disabled); cursor: not-allowed; }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--fb-text-muted); border-right-color: transparent; border-radius: 50%; animation: fb-spin .7s linear infinite; }
.btn-sm { height: 28px; padding: 0 var(--fb-s-2); font-size: var(--fb-fs-small); }
.btn-lg { height: 40px; padding: 0 var(--fb-s-5); font-size: var(--fb-fs-h3); }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; } .btn-icon.btn-sm { width: 28px; }
.btn-left { justify-content: flex-start; }
.btn.is-active, .btn[aria-pressed="true"] { background: var(--fb-selected); color: var(--fb-primary); }
@keyframes fb-spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--fb-s-1); margin-bottom: var(--fb-s-3); }
.field > label, .label { font-size: var(--fb-fs-small); font-weight: var(--fb-fw-semibold); color: var(--fb-text-2); }
.input, .select, .textarea { width: 100%; min-height: 36px; padding: var(--fb-s-150) var(--fb-s-2); border: 1px solid var(--fb-border-input); border-radius: var(--fb-r-input); background: var(--fb-surface); color: var(--fb-text); transition: border-color var(--fb-dur-fast), box-shadow var(--fb-dur-fast); }
.input:hover, .select:hover, .textarea:hover { background: var(--fb-surface-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--fb-focus); box-shadow: inset 0 0 0 1px var(--fb-focus); background: var(--fb-surface); }
.input.is-invalid, .textarea.is-invalid { border-color: var(--fb-danger); box-shadow: inset 0 0 0 1px var(--fb-danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--fb-disabled); color: var(--fb-text-disabled); cursor: not-allowed; }
.textarea { min-height: 88px; resize: vertical; line-height: var(--fb-lh); }
.field-error { font-size: var(--fb-fs-small); color: var(--fb-danger-text); display: flex; gap: 4px; align-items: center; }
.field-help { font-size: var(--fb-fs-small); color: var(--fb-text-muted); }
.check { display: flex; align-items: center; gap: var(--fb-s-2); cursor: pointer; padding: 4px 0; }
.check input { width: 16px; height: 16px; accent-color: var(--fb-primary); margin: 0; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--fb-border-strong); border-radius: 999px; transition: background var(--fb-dur); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--fb-dur) var(--fb-ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--fb-primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--fb-focus); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--fb-secondary); border-radius: var(--fb-r-btn); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 var(--fb-s-3); border-radius: 4px; cursor: pointer; font-weight: var(--fb-fw-medium); color: var(--fb-text-2); }
.seg button[aria-pressed="true"] { background: var(--fb-surface); color: var(--fb-text); box-shadow: var(--fb-shadow-raised); }

/* ---------- Avatars ---------- */
.av { --av: 28px; width: var(--av); height: var(--av); border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: calc(var(--av) * .38); font-weight: var(--fb-fw-semibold); flex: none; user-select: none; box-shadow: 0 0 0 2px var(--fb-surface); }
.av-24 { --av: 24px; } .av-32 { --av: 32px; } .av-40 { --av: 40px; } .av-96 { --av: 96px; }
.av.is-inactive { filter: grayscale(1); opacity: .6; }
.av-stack { display: inline-flex; } .av-stack .av + .av { margin-left: -6px; }
.av-more { background: var(--fb-secondary-hover); color: var(--fb-text-2); }

/* ---------- Badges / chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--fb-r-sm); font-size: var(--fb-fs-small); font-weight: var(--fb-fw-medium); background: var(--fb-secondary); color: var(--fb-text-2); }
.chip-success { background: var(--fb-success-bg); color: var(--fb-success-text); } .chip-warning { background: var(--fb-warning-bg); color: var(--fb-warning-text); }
.chip-danger { background: var(--fb-danger-bg); color: var(--fb-danger-text); } .chip-info { background: var(--fb-info-bg); color: var(--fb-info-text); }
.chip-brand { background: var(--fb-primary-soft); color: var(--fb-primary); } .chip-accent { background: var(--fb-accent-soft); color: var(--fb-accent); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; background: var(--fb-danger); color: #fff; }
.tag-enh { font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 1px 6px; border-radius: 3px; background: var(--fb-accent-soft); color: var(--fb-accent); vertical-align: middle; }

/* ---------- App shell ---------- */
.app-header { position: sticky; top: 0; z-index: 50; height: var(--fb-header-h); display: flex; align-items: center; gap: var(--fb-s-2); padding: 0 var(--fb-s-3); background: var(--fb-header-bg); border-bottom: 1px solid var(--fb-header-border); }
.app-header .brand { display: flex; align-items: center; height: 36px; padding: 0 6px; border-radius: var(--fb-r-md); }
.app-header .brand:hover { background: var(--fb-subtle-hover); }
.app-header .brand img { height: 28px; display: block; }
.brand .logo-dark { display: none !important; }
[data-theme="dark"] .brand .logo-dark { display: block !important; } [data-theme="dark"] .brand .logo-light { display: none !important; }
.hdr-nav { display: flex; gap: 2px; }
.hdr-nav a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--fb-r-md); color: var(--fb-text-2); font-weight: var(--fb-fw-medium); }
.hdr-nav a:hover { background: var(--fb-subtle-hover); color: var(--fb-text); text-decoration: none; }
.hdr-nav a[aria-current="page"] { color: var(--fb-primary); background: var(--fb-primary-soft); }
.hdr-search { flex: 1 1 auto; max-width: 560px; margin: 0 auto; position: relative; }
.hdr-search .input { padding-left: 34px; height: 34px; min-height: 34px; background: var(--fb-surface-2); border-color: var(--fb-border); }
.hdr-search > .ic { position: absolute; left: 11px; top: 9px; color: var(--fb-text-muted); pointer-events: none; }
.hdr-search kbd { position: absolute; right: 8px; top: 7px; }
.hdr-actions { display: flex; align-items: center; gap: 4px; }
.hdr-btn { position: relative; }
.hdr-btn .count { position: absolute; top: -2px; right: -2px; box-shadow: 0 0 0 2px var(--fb-header-bg); }
.app-main { min-height: calc(100vh - var(--fb-header-h)); }
.page { max-width: 1240px; margin: 0 auto; padding: var(--fb-s-6) var(--fb-s-6) 96px; }
.page-narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--fb-s-4); margin-bottom: var(--fb-s-6); }
.page-head p { margin: 4px 0 0; color: var(--fb-text-muted); }
.section { margin-bottom: var(--fb-s-8); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--fb-s-3); gap: var(--fb-s-3); }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fb-fs-h3); }
.panel { background: var(--fb-surface); border: 1px solid var(--fb-border); border-radius: var(--fb-r-xl); }
.panel-pad { padding: var(--fb-s-4) var(--fb-s-5); }
.with-side { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--fb-s-6); align-items: start; }
.side-nav { position: sticky; top: calc(var(--fb-header-h) + 24px); display: flex; flex-direction: column; gap: 2px; }
.side-nav .side-title { font-size: var(--fb-fs-small); font-weight: var(--fb-fw-semibold); color: var(--fb-text-muted); padding: 12px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--fb-r-md); color: var(--fb-text-2); font-weight: var(--fb-fw-medium); }
.side-nav a:hover { background: var(--fb-subtle-hover); color: var(--fb-text); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--fb-primary-soft); color: var(--fb-primary); }
.ws-logo { width: 32px; height: 32px; border-radius: var(--fb-r-md); display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.ws-logo-lg { width: 56px; height: 56px; font-size: 22px; border-radius: var(--fb-r-lg); }

/* ---------- Navigation bar (Inbox · Planner · Board · Switch boards) ---------- */
.navbar-float { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 45; display: flex; gap: 2px; padding: 4px; border-radius: var(--fb-r-xl); background: var(--fb-surface-overlay); box-shadow: var(--fb-shadow-overlay); }
.navbar-float a, .navbar-float button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; background: transparent; border-radius: var(--fb-r-lg); color: var(--fb-text-2); font-weight: var(--fb-fw-medium); cursor: pointer; }
.navbar-float a:hover, .navbar-float button:hover { background: var(--fb-subtle-hover); color: var(--fb-text); text-decoration: none; }
.navbar-float [aria-current="page"], .navbar-float [aria-pressed="true"] { background: var(--fb-primary-soft); color: var(--fb-primary); }
.navbar-float .sep { width: 1px; background: var(--fb-border); margin: 6px 2px; }

/* ---------- Board switcher (drawer / pinned sidebar) ---------- */
.switcher { position: fixed; top: var(--fb-header-h); left: 0; bottom: 0; width: var(--fb-sidebar-w); z-index: 44; background: var(--fb-surface); border-right: 1px solid var(--fb-border); box-shadow: var(--fb-shadow-overlay); transform: translateX(-102%); transition: transform var(--fb-dur-slow) var(--fb-ease); display: flex; flex-direction: column; }
.switcher.is-open { transform: none; }
.switcher.is-pinned { box-shadow: none; transform: none; }
body.switcher-pinned .app-main { margin-left: var(--fb-sidebar-w); }
.switcher-head { padding: 12px; display: flex; gap: 6px; border-bottom: 1px solid var(--fb-border); }
.switcher-body { overflow: auto; padding: 8px 8px 80px; }
.sw-section > button { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 8px 4px; font-size: var(--fb-fs-small); font-weight: var(--fb-fw-semibold); color: var(--fb-text-muted); cursor: pointer; }
.sw-section[aria-expanded="false"] .sw-items { display: none; }
.sw-section[aria-expanded="false"] > button .ic { transform: rotate(-90deg); }
.sw-item { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: var(--fb-r-md); color: var(--fb-text); cursor: pointer; }
.sw-item:hover { background: var(--fb-subtle-hover); text-decoration: none; }
.sw-item[draggable="true"] { cursor: grab; }
.sw-item.is-drop { box-shadow: inset 0 2px 0 var(--fb-primary); }
.sw-thumb { width: 32px; height: 22px; border-radius: 4px; flex: none; }
.sw-item .star-btn { margin-left: auto; opacity: 0; }
.sw-item:hover .star-btn, .sw-item .star-btn.is-on { opacity: 1; }
.star-btn { border: 0; background: transparent; padding: 2px; cursor: pointer; color: var(--fb-text-muted); border-radius: 4px; }
.star-btn.is-on { color: var(--fb-accent); } .star-btn.is-on .ic { fill: currentColor; }

/* ---------- Popovers & menus ---------- */
.pop { position: fixed; z-index: 200; width: var(--fb-popover-w); max-height: min(560px, calc(100vh - 24px)); display: flex; flex-direction: column; background: var(--fb-surface-overlay); border-radius: var(--fb-r-pop); box-shadow: var(--fb-shadow-overlay); color: var(--fb-text); animation: fb-pop-in var(--fb-dur) var(--fb-ease); }
.pop-wide { width: 360px; } .pop-xl { width: 440px; }
.pop-head { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; padding: 6px 6px 4px; }
.pop-head h3 { text-align: center; font-size: var(--fb-fs-body); font-weight: var(--fb-fw-semibold); color: var(--fb-text-2); }
.pop-body { padding: 4px 12px 12px; overflow: auto; }
.pop-sec { font-size: var(--fb-fs-small); font-weight: var(--fb-fw-semibold); color: var(--fb-text-muted); margin: 10px 0 6px; }
.menu { display: flex; flex-direction: column; padding: 4px 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--fb-text); border-radius: 0; font-weight: var(--fb-fw-regular); }
.menu a:hover, .menu button:hover, .menu .is-kb { background: var(--fb-subtle-hover); text-decoration: none; }
.menu .ic { color: var(--fb-text-2); }
.menu .danger { color: var(--fb-danger-text); } .menu .danger .ic { color: var(--fb-danger-text); }
.menu .kbd-hint { margin-left: auto; }
.menu hr { border: 0; border-top: 1px solid var(--fb-border); margin: 4px 0; }
.menu .menu-desc { display: block; font-size: var(--fb-fs-small); color: var(--fb-text-muted); }
@keyframes fb-pop-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 150; background: var(--fb-blanket); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow: auto; animation: fb-fade var(--fb-dur); }
.modal { width: 100%; max-width: 560px; background: var(--fb-surface-overlay); border-radius: var(--fb-r-modal); box-shadow: var(--fb-shadow-overlay); display: flex; flex-direction: column; animation: fb-modal-in var(--fb-dur-slow) var(--fb-ease); }
.modal-lg { max-width: 760px; } .modal-sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 8px; }
.modal-head h2 { flex: 1; font-size: var(--fb-fs-h2); }
.modal-body { padding: 8px 20px 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--fb-border); }
body.modal-open { overflow: hidden; }
@keyframes fb-fade { from { opacity: 0; } }
@keyframes fb-modal-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }

/* ---------- Toasts / flags ---------- */
.toasts { position: fixed; left: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 420px; padding: 10px 12px 10px 14px; border-radius: var(--fb-r-lg); background: var(--fb-surface-overlay); color: var(--fb-text); box-shadow: var(--fb-shadow-overlay); border-left: 3px solid var(--fb-success); animation: fb-toast-in var(--fb-dur-slow) var(--fb-ease); }
.toast.is-error { border-left-color: var(--fb-danger); } .toast.is-info { border-left-color: var(--fb-info); }
.toast .t-ic { color: var(--fb-success); } .toast.is-error .t-ic { color: var(--fb-danger); } .toast.is-info .t-ic { color: var(--fb-info); }
.toast .grow { font-weight: var(--fb-fw-medium); }
.toast.leaving { opacity: 0; transform: translateX(-12px); transition: all var(--fb-dur); }
@keyframes fb-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Banners ---------- */
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--fb-r-lg); background: var(--fb-info-bg); color: var(--fb-info-text); margin-bottom: var(--fb-s-4); }
.banner-warning { background: var(--fb-warning-bg); color: var(--fb-warning-text); } .banner-danger { background: var(--fb-danger-bg); color: var(--fb-danger-text); } .banner-success { background: var(--fb-success-bg); color: var(--fb-success-text); }
.offline-banner { position: fixed; top: var(--fb-header-h); left: 50%; transform: translateX(-50%); z-index: 60; margin-top: 8px; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--fb-border); border-radius: var(--fb-r-lg); background: var(--fb-surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fb-fs-body); }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--fb-surface-2); text-align: left; font-size: var(--fb-fs-small); font-weight: var(--fb-fw-semibold); color: var(--fb-text-2); padding: 8px 12px; border-bottom: 1px solid var(--fb-border); white-space: nowrap; }
.tbl th button { border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--fb-border); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--fb-surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .cell-edit { border-radius: 4px; padding: 2px 4px; margin: -2px -4px; cursor: pointer; }
.tbl .cell-edit:hover { background: var(--fb-subtle-hover); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--fb-border); margin-bottom: var(--fb-s-4); overflow-x: auto; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border: 0; background: transparent; color: var(--fb-text-2); font-weight: var(--fb-fw-medium); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--fb-text); text-decoration: none; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--fb-primary); border-bottom-color: var(--fb-primary); }

/* ---------- Empty / error / skeleton ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--fb-text-2); }
.empty .empty-art { width: 120px; height: 84px; margin: 0 auto 16px; }
.empty h3 { margin-bottom: 6px; color: var(--fb-text); }
.empty p { color: var(--fb-text-muted); max-width: 360px; margin: 0 auto 16px; }
.skel { background: linear-gradient(90deg, var(--fb-secondary) 0%, var(--fb-secondary-hover) 50%, var(--fb-secondary) 100%) 0 0 / 200% 100%; animation: fb-skel 1.3s linear infinite; border-radius: var(--fb-r-md); }
@keyframes fb-skel { to { background-position: -200% 0; } }
.error-page { min-height: calc(100vh - var(--fb-header-h)); display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font-family: var(--fb-font-display); font-size: 64px; font-weight: 700; color: var(--fb-primary); line-height: 1; }

/* ---------- Tiles (boards, workspaces) ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: var(--fb-s-3); }
.board-tile { position: relative; height: 104px; border-radius: var(--fb-r-lg); overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px; text-decoration: none; box-shadow: var(--fb-shadow-raised); transition: transform var(--fb-dur-fast), box-shadow var(--fb-dur-fast); }
.board-tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,0) 60%); }
.board-tile:hover { text-decoration: none; box-shadow: var(--fb-shadow-hover); transform: translateY(-1px); }
.board-tile > * { position: relative; }
.board-tile .bt-title { font-weight: 650; font-size: 15px; line-height: 1.25; text-shadow: 0 1px 2px rgba(0,0,0,.25); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-tile .bt-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; opacity: .92; }
.board-tile .star-btn { color: #fff; opacity: .0; } .board-tile:hover .star-btn, .board-tile .star-btn.is-on { opacity: 1; }
.board-tile .star-btn.is-on { color: #F5D27A; }
.board-tile.is-dark-text { color: #1B2A31; } .board-tile.is-dark-text::before { background: none; }
.tile-new { height: 104px; border-radius: var(--fb-r-lg); border: 1.5px dashed var(--fb-border-strong); background: transparent; color: var(--fb-text-2); cursor: pointer; display: grid; place-items: center; font-weight: var(--fb-fw-medium); }
.tile-new:hover { background: var(--fb-subtle-hover); color: var(--fb-text); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(150deg, #0A3F43 0%, #0E6D6A 55%, #1E857F 100%); color: #EAF4F3; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .pattern { position: absolute; inset: 0; opacity: .14; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23F3E6C7' stroke-width='1'%3E%3Cpath d='M28 4 34 22 52 28 34 34 28 52 22 34 4 28 22 22z'/%3E%3Crect x='18' y='18' width='20' height='20' transform='rotate(45 28 28)'/%3E%3C/g%3E%3C/svg%3E"); }
.auth-art h1 { font-size: 34px; line-height: 1.15; max-width: 440px; font-weight: 650; }
.auth-art p { max-width: 420px; color: #C9E3E0; font-size: 15px; }
.auth-preview { position: relative; display: flex; gap: 10px; margin: 40px 0; }
.auth-preview .ap-list { width: 150px; background: rgba(255,255,255,.1); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(2px); }
.auth-preview .ap-title { font-size: 11px; font-weight: 600; color: #D7EBE9; padding: 0 2px 2px; }
.auth-preview .ap-card { background: #fff; border-radius: 6px; padding: 7px 8px; color: #1B2A31; font-size: 11.5px; box-shadow: 0 1px 1px rgba(0,0,0,.15); }
.auth-preview .ap-card i { display: block; height: 6px; width: 34px; border-radius: 3px; margin-bottom: 5px; }
.auth-preview .ap-card.moving { transform: rotate(3deg) translateY(-4px); box-shadow: 0 10px 18px rgba(0,0,0,.25); border-left: 3px solid #D8AE5A; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--fb-surface); }
.auth-form .inner { width: 100%; max-width: 360px; }
.auth-form h2 { font-size: 24px; margin: 24px 0 4px; }
.auth-demo { margin-top: 20px; padding: 10px 12px; border-radius: 8px; background: var(--fb-accent-soft); color: var(--fb-text-2); font-size: 12px; }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

@media (max-width: 1100px) { .hdr-nav .lbl { display: none; } .with-side { grid-template-columns: 1fr; } .side-nav { position: static; flex-direction: row; flex-wrap: wrap; } }


/* ---------- Reduce motion (Settings › Accessibility), in addition to the operating-system setting ---------- */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
.reduce-motion .card.dragging, .reduce-motion .card:active { transform: none !important; }

/* ---------- Print (B-043): print the content, not the app chrome ---------- */
@media print {
  .app-header, .switcher, .navbar-float, .toasts, .pop, .modal-back, .composer, .list-add, .list-foot, .hdr-actions,
  .board-bar .bb-btn, .view-switch, .n-acts, .skip-link { display: none !important; }
  html, body, .app-main, .board-shell, .canvas, .page { background: #fff !important; color: #000 !important; overflow: visible !important; height: auto !important; max-height: none !important; }
  .board-bar { background: none !important; backdrop-filter: none !important; color: #000 !important; }
  .canvas { display: block !important; }
  .list { width: auto !important; max-height: none !important; break-inside: avoid-page; margin: 0 0 12px !important; border: 1px solid #999; background: #fff !important; }
  .list-cards { overflow: visible !important; max-height: none !important; }
  .card, .panel { box-shadow: none !important; border: 1px solid #bbb; break-inside: avoid; }
  table { break-inside: auto; } tr { break-inside: avoid; }
}
.av.has-photo { overflow: hidden; padding: 0; } .av.has-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.ws-logo.has-photo { overflow: hidden; padding: 0; } .ws-logo.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Tables scroll inside their own box instead of widening the page (tablet widths). */
.with-side > * { min-width: 0; }
.tbl-wrap { max-width: 100%; }
@media (max-width: 960px) { .row-between { flex-wrap: wrap; gap: 8px; } }
