/* =========================================================
   Theme tokens
   Modern neutrals with a blue accent and a soft blue glow behind the
   app; Jira-style structure (top bar, project sidebar, issue keys).
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #f4f5f9;
  --bg-glow: rgba(47, 107, 216, 0.06);
  --chrome: rgba(255, 255, 255, 0.78);
  --surface: #ffffff;
  --surface-2: #f4f5f9;
  --surface-3: #e9ebf2;
  --column-bg: rgba(244, 245, 249, 0.7);
  --hover: rgba(21, 22, 40, 0.045);
  --active: rgba(21, 22, 40, 0.08);
  --border: #e2e4ec;
  --border-strong: #cdd0db;
  --input-border: #dcdfe8;
  --text: #1d1e26;
  --text-2: #3d4152;
  --muted: #5f6376;
  --faint: #9a9db0;

  --accent: #2f6bd8;
  --accent-hover: #2659bd;
  --accent-soft: rgba(47, 107, 216, 0.1);
  --accent-text: #2a5bc4;
  --on-accent: #ffffff;
  --btn-bg: #ffffff;
  --btn-hover: #f4f5f9;
  --btn-text: #15161c;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --success: #16a34a;

  /* status tones: solid, soft background, text */
  --gray: #6b7280;    --gray-soft: rgba(100, 116, 139, 0.12); --gray-text: #4b5563;
  --red: #dc2626;     --red-soft: rgba(220, 38, 38, 0.08);    --red-text: #b91c1c;
  --yellow: #d97706;  --yellow-soft: rgba(217, 119, 6, 0.1);  --yellow-text: #b45309;
  --blue: #2563eb;    --blue-soft: rgba(37, 99, 235, 0.1);    --blue-text: #1d4ed8;
  --cyan: #0891b2;    --cyan-soft: rgba(8, 145, 178, 0.1);    --cyan-text: #0e7490;
  --green: #16a34a;   --green-soft: rgba(22, 163, 74, 0.1);   --green-text: #15803d;

  --type-bug: #ef4444;
  --type-feature: #2f6bd8;
  --p-critical: #d65555;
  --p-high: #e07b3c;
  --p-medium: #d49a2e;
  --p-low: #5b84d9;
  --avatar-l: 38%;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-done: #15803d; /* done / resolved: the status green, stepped for charts */
  --grid: #e9ebf2;
  --axis: #cdd0db;

  --shadow-sm: 0 1px 2px rgba(20, 22, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 22, 40, 0.08);
  --shadow-lg: 0 24px 64px rgba(20, 22, 40, 0.14);
  --overlay: rgba(20, 22, 32, 0.4);
  --ring: 0 0 0 3px var(--accent-soft);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  /* One height for every button, input, select, chip and tab bar; one for compact ones. */
  --control: 38px;
  --control-sm: 30px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101116;
    --bg-glow: rgba(53, 112, 220, 0.07);
    --chrome: rgba(20, 21, 27, 0.78);
    --surface: #17181e;
    --surface-2: #1d1f27;
    --surface-3: #252833;
    --column-bg: rgba(27, 29, 37, 0.7);
    --hover: rgba(255, 255, 255, 0.05);
    --active: rgba(255, 255, 255, 0.09);
    --border: #262833;
    --border-strong: #363948;
    --input-border: #2e3140;
    --text: #e4e5ea;
    --text-2: #c3c6d4;
    --muted: #9094a8;
    --faint: #62667a;
    --accent: #3570dc;
    --accent-hover: #2f66cf;
    --accent-soft: rgba(53, 112, 220, 0.18);
    --accent-text: #86a9f0;
    --btn-bg: #1d1f27;
    --btn-hover: #252833;
    --btn-text: #ececf1;
    --danger: #ef4444;
    --danger-hover: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --success: #22c55e;
    --gray: #6b7280;    --gray-soft: rgba(148, 163, 184, 0.14); --gray-text: #a1a7b6;
    --red: #ef4444;     --red-soft: rgba(239, 68, 68, 0.14);    --red-text: #f87171;
    --yellow: #f59e0b;  --yellow-soft: rgba(245, 158, 11, 0.14); --yellow-text: #fbbf24;
    --blue: #3b82f6;    --blue-soft: rgba(59, 130, 246, 0.16);  --blue-text: #60a5fa;
    --cyan: #06b6d4;    --cyan-soft: rgba(6, 182, 212, 0.15);   --cyan-text: #22d3ee;
    --green: #22c55e;   --green-soft: rgba(34, 197, 94, 0.14);  --green-text: #4ade80;
    --type-feature: #3570dc;
    --p-critical: #e47c7c;
    --p-high: #e39762;
    --p-medium: #d8b25e;
    --p-low: #7d9fe3;
    --avatar-l: 74%;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-done: #1fa855;
    --grid: #252833;
    --axis: #363948;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
    --overlay: rgba(4, 5, 8, 0.65);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101116;
  --bg-glow: rgba(53, 112, 220, 0.07);
  --chrome: rgba(20, 21, 27, 0.78);
  --surface: #17181e;
  --surface-2: #1d1f27;
  --surface-3: #252833;
  --column-bg: rgba(27, 29, 37, 0.7);
  --hover: rgba(255, 255, 255, 0.05);
  --active: rgba(255, 255, 255, 0.09);
  --border: #262833;
  --border-strong: #363948;
  --input-border: #2e3140;
  --text: #e4e5ea;
  --text-2: #c3c6d4;
  --muted: #9094a8;
  --faint: #62667a;
  --accent: #3570dc;
  --accent-hover: #2f66cf;
  --accent-soft: rgba(53, 112, 220, 0.18);
  --accent-text: #86a9f0;
  --btn-bg: #1d1f27;
  --btn-hover: #252833;
  --btn-text: #ececf1;
  --danger: #ef4444;
  --danger-hover: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --success: #22c55e;
  --gray: #6b7280;    --gray-soft: rgba(148, 163, 184, 0.14); --gray-text: #a1a7b6;
  --red: #ef4444;     --red-soft: rgba(239, 68, 68, 0.14);    --red-text: #f87171;
  --yellow: #f59e0b;  --yellow-soft: rgba(245, 158, 11, 0.14); --yellow-text: #fbbf24;
  --blue: #3b82f6;    --blue-soft: rgba(59, 130, 246, 0.16);  --blue-text: #60a5fa;
  --cyan: #06b6d4;    --cyan-soft: rgba(6, 182, 212, 0.15);   --cyan-text: #22d3ee;
  --green: #22c55e;   --green-soft: rgba(34, 197, 94, 0.14);  --green-text: #4ade80;
  --type-feature: #3570dc;
  --p-critical: #e47c7c;
  --p-high: #e39762;
  --p-medium: #d8b25e;
  --p-low: #7d9fe3;
  --avatar-l: 74%;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-done: #1fa855;
  --grid: #252833;
  --axis: #363948;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --overlay: rgba(4, 5, 8, 0.65);
}

/* Tone hooks: anything with a tone class picks up that status colour. */
.gray, .tone-gray { --tone: var(--gray); --tone-soft: var(--gray-soft); --tone-text: var(--gray-text); }
.red, .tone-red { --tone: var(--red); --tone-soft: var(--red-soft); --tone-text: var(--red-text); }
.yellow, .tone-yellow { --tone: var(--yellow); --tone-soft: var(--yellow-soft); --tone-text: var(--yellow-text); }
.blue, .tone-blue { --tone: var(--blue); --tone-soft: var(--blue-soft); --tone-text: var(--blue-text); }
.cyan, .tone-cyan { --tone: var(--cyan); --tone-soft: var(--cyan-soft); --tone-text: var(--cyan-text); }
.green, .tone-green { --tone: var(--green); --tone-soft: var(--green-soft); --tone-text: var(--green-text); }

/* =========================================================
   Base
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 0% -10%, var(--bg-glow), transparent 70%),
    radial-gradient(900px 480px at 100% 110%, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 13px; font-weight: 650; }
a { color: var(--accent-text); text-decoration: none; }
.link { color: var(--accent-text); font-weight: 600; text-decoration: none; cursor: pointer; text-underline-offset: 2px; }
.link:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

.spacer { flex: 1; }
.muted { color: var(--muted); }
.subtle { color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; }
.icon.xs { width: 12px; height: 12px; stroke-width: 2.4; }
.icon.lg { width: 20px; height: 20px; }

kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font: 500 11px/1 var(--mono);
}

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* =========================================================
   Controls
   ========================================================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--control); padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-text);
  font-size: 13.5px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.12s, opacity 0.12s;
}
.btn:hover { background: var(--btn-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.danger:hover { background: var(--danger-hover); }
.btn.danger-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.small { height: var(--control-sm); padding: 0 10px; border-radius: var(--radius-sm); font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn kbd { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.28); color: inherit; }

.icon-btn {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--control); height: var(--control); padding: 0;
  border: 0; border-radius: var(--radius); background: transparent;
  color: var(--muted); cursor: pointer; transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: var(--active); }
.icon-btn.small { width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-sm); }
.icon-btn.small .icon { width: 14px; height: 14px; }
.icon-btn .icon { width: 18px; height: 18px; }

.armed { background: var(--danger) !important; color: #fff !important; border-color: transparent !important; width: auto !important; padding: 0 10px !important; font-size: 12px; font-weight: 600; }

.link-btn { border: 0; padding: 0; background: none; font-size: inherit; }

.input, .boxed, .video-field, .global-search input, .pill {
  width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 13.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input, .video-field, .global-search input, .pill { height: var(--control); padding: 0 12px; }
.boxed { padding: 7px 12px; line-height: 22px; }
.input:hover, .boxed:hover, .video-field:hover, .global-search input:hover, .pill:hover { border-color: var(--border-strong); }
.input:focus, .boxed:focus, .video-field:focus-within, .global-search input:focus { border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }

.bare {
  display: block; width: 100%; padding: 0; border: 0; outline: 0; resize: none; overflow: hidden;
  background: transparent; color: var(--text);
}

/* Segmented controls: Board/List, theme, issue type, report ranges */
.seg {
  display: inline-flex; flex-shrink: 0; height: var(--control); padding: 3px; gap: 2px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.seg button, .seg a {
  display: inline-flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 12px; border: 0; border-radius: calc(var(--radius) - 3px);
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.seg button:hover, .seg a:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg a[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.seg a { text-decoration: none; }
.seg .icon { width: 14px; height: 14px; }

/* Filters: flat and filled, "Label: value" */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: var(--control); padding: 0 10px 0 12px; max-width: 280px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chip:hover { background: var(--surface-3); }
.chip[aria-expanded="true"] { border-color: var(--accent); }
.chip b { font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .icon.xs { color: var(--muted); }
.chip.active { background: var(--accent-soft); color: var(--accent-text); padding-right: 5px; }
.chip.active b { color: inherit; }
.chip-x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--accent-text); }
.chip-x:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }

/* =========================================================
   Status / priority / type / avatars
   ========================================================= */

.lozenge {
  display: inline-flex; align-items: center; height: 20px; max-width: 100%; padding: 0 7px;
  border-radius: 6px; font-size: 10.5px; font-weight: 700; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--tone-soft, var(--gray-soft)); color: var(--tone-text, var(--gray-text));
}

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--tone, var(--gray)); }

.prio-icon { width: 16px; height: 16px; display: block; }
.type-icon { width: 16px; height: 16px; display: block; }
.type-icon rect { rx: 4.5px; }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%;
  color: hsl(var(--h) 65% var(--avatar-l));
  background: hsl(var(--h) 75% 55% / 0.18);
  border: 1px solid hsl(var(--h) 70% 55% / 0.3);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; line-height: 1;
}
.avatar.sm { width: 20px; height: 20px; font-size: 8.5px; }
.avatar.lg { width: 32px; height: 32px; font-size: 11.5px; }
.avatar.xl { width: 40px; height: 40px; font-size: 14px; }
.avatar-none { background: transparent; color: var(--faint); border: 1.5px dashed var(--border-strong); }
.avatar-none svg { width: 55%; height: 55%; }

.key { font: 500 11.5px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.key.done { text-decoration: line-through; }

/* =========================================================
   Boot & auth
   ========================================================= */

.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--accent); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.auth-inner { width: min(400px, 100%); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-product { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.auth-logo .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.auth-logo .brand-mark svg { width: 26px; height: 26px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: 24px; }
.auth-head p { margin-top: 6px; color: var(--muted); }
.auth-card { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 500; }
.auth-switch { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* =========================================================
   App shell: full-width top bar, collapsible sidebar, main
   ========================================================= */

/* Registered so the sidebar width animates, and the header's first zone with it. */
@property --side-w { syntax: "<length>"; inherits: true; initial-value: 236px; }
.app {
  --side-w: 236px;
  display: grid; height: 100dvh;
  grid-template: "top top" 56px "side main" minmax(0, 1fr) / var(--side-w) minmax(0, 1fr);
  transition: --side-w 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app.sidebar-collapsed { --side-w: 64px; }

.topbar {
  grid-area: top; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr);
  background: var(--chrome); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); z-index: 30;
}
/* The product sits above the sidebar (the sidebar's edge runs on through the header);
   the workspace, search and actions sit above the page, lined up with its content. */
.topbar-start {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-width: 0; padding: 0 10px 0 16px; border-right: 1px solid var(--border);
}
.topbar-main { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 0 14px 0 28px; }
.product { display: grid; place-items: center; flex-shrink: 0; border-radius: 9px; }
.product .brand-mark { width: 30px; height: 30px; }
.product .brand-mark svg { width: 17px; height: 17px; }
/* Collapsed, the rail shows the product mark; hovering it swaps in the expand button. */
@media (min-width: 861px) {
  .app.sidebar-collapsed .topbar-start { justify-content: center; padding: 0; }
  .app.sidebar-collapsed .sidebar-toggle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 0; }
  .app.sidebar-collapsed .topbar-start:hover .sidebar-toggle,
  .app.sidebar-collapsed .sidebar-toggle:focus-visible { opacity: 1; background: var(--surface); }
  .app.sidebar-collapsed .topbar-start:hover .product { opacity: 0; }
}
.org {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-width: 0; height: var(--control); margin-left: -6px; padding: 0 10px 0 6px; border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: background 0.12s;
}
.org:hover { background: var(--hover); }
.org-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  font-size: 14px; font-weight: 700; line-height: 1;
}
.org-name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

.topbar-center { flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; min-width: 0; }
.global-search { position: relative; display: flex; align-items: center; width: min(520px, 100%); min-width: 0; }
.global-search > .icon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.global-search input { padding: 0 44px 0 36px; }
.global-search input::-webkit-search-cancel-button { display: none; }
.global-search > kbd { position: absolute; right: 8px; pointer-events: none; }
.global-search input:focus ~ kbd { display: none; }
.create-btn { flex-shrink: 0; }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  width: max(100%, 460px); max-height: min(460px, 70vh); overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: menu-in 0.12s ease-out;
}
.search-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.search-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 13.5px;
}
.search-item.active { background: var(--surface-2); }
.search-item .key { width: 64px; flex-shrink: 0; }
.search-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.search-title mark { background: var(--accent-soft); color: var(--accent-text); border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 18px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.search-foot { display: flex; gap: 14px; padding: 8px 10px 4px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--faint); }
.search-foot span { display: inline-flex; align-items: center; gap: 4px; }
.search-foot kbd { min-width: 18px; height: 18px; font-size: 10px; }

.topbar-end { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 9px; border: 2px solid var(--surface);
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.user-btn { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.user-btn:hover .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }

.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent);
}
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.sidebar {
  grid-area: side; display: flex; flex-direction: column; min-height: 0; overflow: hidden auto;
  background: var(--chrome); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid var(--border);
}
.sidebar-head { display: none; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 10px; }
.nav-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.nav-label { padding: 14px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); white-space: nowrap; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.nav a .icon { width: 18px; height: 18px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--surface-3); font-size: 11px; font-weight: 700; color: var(--text-2); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] .nav-count { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
.nav-count:empty { display: none; }

/* Collapsed: an icon rail */
.app.sidebar-collapsed .nav { padding-inline: 10px; }
.app.sidebar-collapsed .nav a { justify-content: center; padding: 0; gap: 0; }
.app.sidebar-collapsed .nav-text { display: none; }
.app.sidebar-collapsed .nav-label { height: 1px; padding: 0; margin: 10px 6px; background: var(--border); }
/* Collapsed, the open count becomes a small badge on the icon's corner. */
.app.sidebar-collapsed .nav-count {
  position: absolute; top: -2px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; margin: 0;
  border: 2px solid var(--surface); border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10px;
}
.app.sidebar-collapsed .nav a[aria-current="page"] .nav-count { background: var(--accent); color: var(--on-accent); }

.scrim { display: none; }
main { grid-area: main; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* =========================================================
   Page
   ========================================================= */

.page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-head { padding: 20px 28px 0; }
.page-head .crumbs { margin-bottom: 10px; }
.page-sub { margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.page-head:not(:has(.toolbar)) + .results { padding-top: 16px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 38px; }
.page-icon {
  display: grid; place-items: center; width: var(--control); height: var(--control); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent-text);
}
.page-icon .icon { width: 19px; height: 19px; }
.head-count { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-lg); background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--muted); }
.head-count:empty { display: none; }
.title-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 0; }
.avatar-group { display: flex; align-items: center; padding-left: 6px; }
.avatar-btn {
  display: grid; place-items: center; width: 34px; height: 34px; margin-left: -8px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface); cursor: pointer; position: relative;
  transition: transform 0.12s;
}
.avatar-btn:hover { transform: translateY(-2px); z-index: 2; }
.avatar-btn .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-btn[aria-pressed="true"] { z-index: 3; }
.avatar-btn[aria-pressed="true"] .avatar,
.avatar-more[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.avatar-more { width: 32px; height: 32px; margin-left: -6px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }
.avatar-more:hover { background: var(--border); }

.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Filters and sort sit together at the right end of the toolbar. */
.toolbar-right { flex: 1 1 0; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.sort-slot { display: flex; }
.toolbar-right .chips { display: contents; }

.results { flex: 1; min-height: 0; overflow: auto; padding: 0 28px 20px; }
.results.board-mode { overflow-y: hidden; }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 320px; padding: 40px 16px; color: var(--muted);
}
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 10px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-icon .type-icon { width: 24px; height: 24px; }
.empty h2 { color: var(--text); font-size: 17px; }
.empty p { max-width: 360px; }
.empty .btn { margin-top: 12px; }

/* =========================================================
   Board
   ========================================================= */

.board { display: flex; gap: 14px; height: 100%; min-width: min-content; }
.column {
  flex: 0 0 286px; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--column-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background 0.15s, border-color 0.15s;
}
.column.drop-target { background: var(--accent-soft); border-color: var(--accent); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 14px; flex-shrink: 0; }
.column-head h2 { font-size: 13px; font-weight: 700; white-space: nowrap; }
.column-head .icon-btn { margin-left: auto; opacity: 0; }
.column:hover .column-head .icon-btn, .column-head .icon-btn:focus-visible { opacity: 1; }
.count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--surface-3); font-size: 11px; font-weight: 700; color: var(--muted); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.count:empty { display: none; }
.column-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 10px 10px; }
.column-empty { padding: 18px 0; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--faint); font-size: 12.5px; text-align: center; }

.card {
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; padding: 12px 12px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none; cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.45; }
.card.just-moved { animation: pop 0.4s ease-out; }
@keyframes pop { 0% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } 100% { box-shadow: var(--shadow-sm); } }
.card-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-foot { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 11.5px; color: var(--muted); min-height: 24px; }
.card-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.meta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .icon { width: 13px; height: 13px; }
.card-date { white-space: nowrap; }

/* =========================================================
   List view (table)
   ========================================================= */

.results.list-mode { padding: 0 28px 20px; }
.table { min-width: 760px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.tr {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: 22px 76px minmax(200px, 1fr) 140px 180px 120px 76px;
  min-height: 46px; padding: 0 16px; border-bottom: 1px solid var(--border);
}
.tr:last-child { border-bottom: 0; }
.tr.th {
  position: sticky; top: 0; z-index: 1; min-height: 38px; background: var(--surface-2);
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.row { cursor: pointer; color: var(--text); transition: background 0.1s; }
.row:hover, .row:focus-visible { background: var(--hover); outline: none; }
.cell-key { display: flex; align-items: center; gap: 8px; min-width: 0; }
.table.mixed .tr { grid-template-columns: 22px 100px minmax(200px, 1fr) 140px 180px 120px 76px; }
.row-title { min-width: 0; display: flex; align-items: center; gap: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 550; }
.col-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.status-btn, .cell-btn {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 30px; padding: 0 6px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
}
.status-btn .icon { color: var(--muted); }
.cell-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-btn:hover, .cell-btn:hover { background: var(--surface-3); }

/* =========================================================
   Menus (popover)
   ========================================================= */

.menu {
  position: fixed; inset: auto; margin: 0;
  min-width: 220px; max-width: 320px; max-height: min(400px, 70vh);
  display: flex; flex-direction: column;
  padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  overflow: hidden; outline: none;
}
.menu:popover-open { animation: menu-in 0.12s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-search { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; margin: 0 -6px 4px; border-bottom: 1px solid var(--border); color: var(--faint); }
.menu-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13.5px; color: var(--text); padding: 4px 0; }
.menu-list { overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 1px; }
.menu-item {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-item.active { background: var(--surface-2); }
.menu-item .icon { color: var(--muted); }
.menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-hint { color: var(--faint); font-size: 12px; }
.menu-check { color: var(--accent-text) !important; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .icon { color: var(--danger); }
.menu-divider { height: 1px; margin: 4px -6px; background: var(--border); }
.menu-header { padding: 8px 10px 10px; }
.menu-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.menu-user { display: flex; align-items: center; gap: 12px; }
.menu-user div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.menu-user b { font-weight: 650; font-size: 13.5px; }
.menu-user span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

.notif-menu { width: min(400px, calc(100vw - 16px)); max-width: none; max-height: min(540px, 78vh); }
.notif-menu .menu-header { padding: 6px 8px 8px; }
.notif-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.notif-head b { font-size: 15px; font-weight: 700; }
.notif-head span { font-size: 12px; color: var(--muted); }
.notif-menu .menu-item { align-items: flex-start; padding: 9px 10px; gap: 12px; }
.notif-menu .menu-label { display: flex; flex-direction: column; gap: 3px; white-space: normal; }
.notif-text { font-size: 13px; line-height: 1.45; color: var(--text-2); }
.notif-text b { color: var(--text); font-weight: 600; }
.notif-text .lozenge { vertical-align: 1px; }
.notif-meta { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-menu .menu-item.unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif-menu .menu-item.unread.active { background: var(--surface-2); }
.notif-menu .menu-item.unread::after { content: ""; flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.notif-empty { padding: 18px 4px 12px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }

/* =========================================================
   Dialogs
   ========================================================= */

dialog { padding: 0; border: 0; max-width: none; max-height: none; color: var(--text); background: var(--surface); }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
dialog[open] { animation: fade-up 0.18s ease-out; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px) scale(0.99); } }

.modal {
  width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 100px); margin: 50px auto auto;
  border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: auto;
}

/* Create issue */
.composer-dialog { width: min(760px, calc(100vw - 24px)); }
.composer { display: flex; flex-direction: column; }
.composer-head { display: flex; align-items: flex-start; gap: 8px; padding: 26px 22px 6px 32px; }
.composer-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.composer-head .form-note { margin-top: 4px; }
.composer-body { padding: 18px 32px 28px; display: flex; flex-direction: column; gap: 24px; }
.form-note { font-size: 12.5px; color: var(--muted); }
.req { color: var(--danger); }
.form-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.boxed {
  padding: 11px 14px; border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.boxed:focus { border-color: var(--accent); box-shadow: var(--ring); }
.composer-title { font-weight: 600; }
.composer-props { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pill { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; text-align: left; }
.pill > span:not(.lozenge):not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill > .icon:last-child { margin-left: auto; color: var(--muted); }
.video-field { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; color: var(--faint); }
.form-field > .video-field { flex: none; }
.video-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13.5px; }
.composer-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 18px 32px 22px; background: var(--surface); border-top: 1px solid var(--border); }
.seg[aria-label="Ticket type"] { align-self: flex-start; }
.seg .type-icon { width: 15px; height: 15px; }

/* Images: thumbnails, drop zone (as in the Iwish app) */
.images { display: flex; flex-wrap: wrap; gap: 10px; }
.images:empty { display: none; }
.thumb {
  position: relative; width: 132px; height: 96px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.thumb:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.thumb-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-remove {
  position: absolute; top: 5px; right: 5px; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.65); color: #fff; cursor: pointer; opacity: 0; transition: opacity 0.12s, background 0.12s;
}
.thumb-remove:hover { background: var(--red); }
.thumb:hover .thumb-remove, .thumb-remove:focus-visible, .thumb-remove.armed { opacity: 1; }
.thumb-remove.armed { height: 22px; border-radius: 11px; font-size: 11px; }
@media (hover: none) { .thumb-remove { opacity: 1; } }
.thumb.uploading { display: grid; place-items: center; }
.thumb.uploading:hover { transform: none; border-color: var(--border); box-shadow: none; }
.thumb.uploading .spinner { width: 20px; height: 20px; }

.dropzone {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 16px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  color: var(--text); font: inherit; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.dropzone:hover, .dropzone.active { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.active { transform: scale(1.01); }
.dropzone-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: var(--radius-lg);
  background: var(--accent-soft); color: var(--accent-text); transition: transform 0.15s;
}
.dropzone:hover .dropzone-icon, .dropzone.active .dropzone-icon { transform: translateY(-2px); }
.dropzone-title { font-size: 13.5px; font-weight: 600; }
.dropzone-hint { font-size: 12px; color: var(--muted); }
.dz-drop, .dropzone.active .dz-idle { display: none; }
.dropzone.active .dz-drop { display: inline; }
.images + .dropzone { margin-top: 10px; }

/* Issue view: a large centred dialog */
.drawer {
  inset: 0; margin: 40px auto auto;
  width: min(1180px, calc(100vw - 48px)); height: calc(100dvh - 80px);
  border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.drawer[open] { display: flex; flex-direction: column; }

.detail-head { display: flex; align-items: center; gap: 4px; height: 58px; padding: 0 14px 0 24px; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font: 500 12.5px/1 var(--mono); }
.type-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
/* Bugs and features share one look in the issue view. */
.type-chip { background: var(--accent-soft); color: var(--accent-text); }

.detail-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.detail-main { overflow-y: auto; padding: 32px 48px 56px; display: flex; flex-direction: column; gap: 36px; }
.detail-main > * { width: 100%; max-width: 820px; }
.detail-side { overflow-y: auto; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; border-left: 1px solid var(--border); background: var(--surface); }
/* Avatars, priority arrows and the type label keep a soft version of their colour here,
   so the summary and description still lead. */
.detail-side .avatar, .detail-side .prio-icon, .detail-side .type-chip { filter: saturate(0.6); opacity: 0.9; }
.detail-main > *, .detail-side > *, .composer-body > * { flex-shrink: 0; }

.title-input { font-size: 26px; font-weight: 700; line-height: 34px; letter-spacing: -0.015em; padding: 4px 8px; margin: 0 -8px; border-radius: var(--radius-sm); }
.title-input:hover { background: var(--hover); }
.title-input:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent), var(--ring); }
.desc-wrap { position: relative; display: flex; flex-direction: column; gap: 8px; }
.field-heading, .section-head h3, .details-box h3 { font-size: 14px; font-weight: 650; color: var(--text); letter-spacing: -0.01em; }
.desc-wrap .section-head { margin-bottom: 0; }
.save-state { margin-left: auto; font-size: 12px; color: var(--muted); opacity: 0; transition: opacity 0.2s; }
.save-state.show { opacity: 1; }
/* The saved description, formatted; click to edit */
.desc-view { min-height: 32px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--radius-sm); cursor: text; }
.desc-view:hover { background: var(--hover); }
.desc-empty { color: var(--faint); }
.desc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.desc-actions .hint { margin-right: auto; font-size: 12px; color: var(--faint); }

/* Markdown editor: Write / Preview, a formatting toolbar, then the text */
.md-editor { display: flex; flex-direction: column; border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--surface); transition: border-color 0.12s, box-shadow 0.12s; }
.md-editor:hover { border-color: var(--border-strong); }
.md-editor:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.md-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 4px 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.md-tabs { display: flex; gap: 2px; }
.md-tabs button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.md-tabs button:hover { color: var(--text); }
.md-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.md-tools { display: flex; align-items: center; gap: 1px; }
.md-tool { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.md-tool:hover { background: var(--hover); color: var(--text); }
.md-tool .icon { width: 15px; height: 15px; }
.md-sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border); }
.previewing .md-tools { opacity: 0.4; }
.md-input { display: block; width: 100%; min-height: 140px; padding: 10px 12px; border: 0; outline: 0; resize: vertical; background: none; color: var(--text); font: inherit; font-size: 14px; line-height: 22px; }
.md-input::placeholder { color: var(--faint); }
.md-preview { padding: 10px 12px; }
.md-empty { color: var(--faint); }
.md-hint { padding: 6px 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--faint); }

/* Formatted Markdown (descriptions, previews, the feedback page) */
.markdown { font-size: 14.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.markdown > * { margin-top: 0; margin-bottom: 0; }
.markdown > * + * { margin-top: 10px; }
.markdown h3 { font-size: 17px; font-weight: 650; }
.markdown h4 { font-size: 15px; font-weight: 650; }
.markdown h5 { font-size: 14px; font-weight: 650; color: var(--text-2); }
.markdown ul, .markdown ol { margin-bottom: 0; padding-left: 22px; }
.markdown li + li { margin-top: 3px; }
.markdown li.task { list-style: none; margin-left: -22px; display: flex; align-items: flex-start; gap: 8px; }
.markdown li.task input { margin-top: 5px; accent-color: var(--accent); }
.markdown blockquote { margin: 0; padding: 2px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.markdown pre { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; }
.markdown pre code { padding: 0; background: none; font-size: 12.5px; }
.markdown a { color: var(--accent-text); text-underline-offset: 2px; }
.markdown hr { border: 0; border-top: 1px solid var(--border); }
.markdown .key-link { font-family: var(--mono); font-size: 0.9em; }

.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-head .actions { margin-left: auto; display: flex; gap: 4px; }
.section-head .seg { margin-left: 10px; }

.videos { display: flex; flex-direction: column; gap: 10px; }
.video { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; min-width: 0; }
.video-row .video-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); }
.video-link { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; text-decoration: none; color: var(--text); }
.video-link b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-link span { font-size: 12px; color: var(--muted); }
.video-link:hover b { color: var(--accent-text); }
.add-btn { color: var(--muted); }
/* Each ticket tab starts with its add control: a field (with an icon) and a button. */
.add-row { display: flex; gap: 8px; margin-bottom: 6px; }
.add-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: var(--control); padding: 0 12px;
  border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--surface); color: var(--faint);
  font: inherit; font-size: 13.5px; text-align: left; transition: border-color 0.12s, box-shadow 0.12s;
}
.add-field:hover { border-color: var(--border-strong); }
.add-field:focus-within, .add-field:focus-visible { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.add-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.add-field input::placeholder { color: var(--faint); }
button.add-field { cursor: pointer; }
.relation-pill { width: auto; flex-shrink: 0; gap: 6px; font-weight: 600; }
.tab-empty { padding: 6px 0; font-size: 13px; color: var(--muted); }
.tab-panel .dropzone { flex-direction: row; justify-content: center; gap: 12px; padding: 12px 16px; }
.tab-panel .dropzone-icon { width: 32px; height: 32px; margin: 0; }
.tab-panel .dropzone-hint { display: none; }
/* Attachments: room between the drop area, the images, the video link field and the videos */
.tab-panel[data-panel="attachments"] { gap: 14px; }
.tab-panel[data-panel="attachments"] .add-row { margin-bottom: 0; }
.tab-panel .images:empty, .tab-panel .videos:empty { display: none; }

/* Activity */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; }
.timeline::before { content: ""; position: absolute; left: 15.5px; top: 14px; bottom: 14px; width: 1px; background: var(--border); }
.tl-event { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; font-size: 13.5px; color: var(--muted); line-height: 22px; }
.tl-dot { position: relative; display: grid; place-items: center; width: 32px; height: 22px; flex-shrink: 0; }
.tl-dot > * { background: var(--surface); box-shadow: 0 0 0 4px var(--surface); border-radius: 50%; }
.tl-dot .icon { width: 15px; height: 15px; color: var(--muted); }
.tl-event b { color: var(--text); font-weight: 600; }
.tl-event .lozenge { vertical-align: 1px; }
.tl-time { white-space: nowrap; color: var(--faint); }
.tl-empty { padding: 8px 0 8px 44px; color: var(--muted); }
.tl-comment { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.tl-comment > .avatar { position: relative; box-shadow: 0 0 0 4px var(--surface); background-color: var(--surface); background-image: linear-gradient(hsl(var(--h) 75% 55% / 0.18), hsl(var(--h) 75% 55% / 0.18)); }
.bubble { flex: 1; min-width: 0; padding: 10px 14px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.bubble-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 2px; }
.bubble-head b { font-weight: 650; }
.bubble-head .muted { font-size: 12px; }
.bubble-head .icon-btn { opacity: 0; }
.bubble-actions { margin-left: auto; display: flex; gap: 2px; }
.bubble:hover .icon-btn, .bubble .icon-btn:focus-visible, .bubble .icon-btn.armed { opacity: 1; }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.comment-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.comment-edit textarea { resize: none; height: auto; min-height: 64px; padding: 8px 10px; line-height: 1.55; }
.comment-edit-foot { display: flex; justify-content: flex-end; gap: 6px; }

.comment-composer { display: flex; gap: 12px; margin-bottom: 14px; }
.comment-box {
  flex: 1; min-width: 0; border: 1px solid var(--input-border); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: border-color 0.12s, box-shadow 0.12s;
}
.comment-box:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.comment-box textarea { display: block; padding: 10px 14px 4px; min-height: 44px; font-size: 14px; line-height: 1.55; }
.comment-box-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px 14px; }
.comment-box-foot .hint { font-size: 12px; color: var(--faint); }
.comment-box-foot .btn { margin-left: auto; }

/* Ticket properties: a plain list of label and value, no boxes. Values you can change highlight on hover. */

.details-box { display: flex; flex-direction: column; gap: 8px; }
.details-box h3 { padding: 4px 2px 0; }
.props { display: flex; flex-direction: column; gap: 2px; }
.prop { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; min-height: 34px; }
.prop-label { font-size: 13px; color: var(--muted); }
.prop-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 30px; padding: 0 6px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text);
  font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer;
}
.prop-btn:hover { background: var(--surface-3); }
.prop-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-value { display: flex; align-items: center; gap: 8px; min-width: 0; height: 30px; padding: 0 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.prop-value span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop .prio-icon { width: 14px; height: 14px; }
.dates { display: flex; flex-direction: column; gap: 3px; padding: 4px 2px; font-size: 12px; color: var(--muted); }

/* Full-screen image viewer */
.viewer {
  inset: 0; width: 100vw; height: 100dvh; margin: 0; padding: 64px 72px 76px;
  border: 0; border-radius: 0; background: rgba(5, 6, 10, 0.88); color: #fff; overflow: hidden;
  backdrop-filter: blur(3px);
}
.viewer[open] { display: flex; align-items: center; justify-content: center; animation: fade 0.15s ease-out; }
.viewer::backdrop { background: transparent; backdrop-filter: none; }
@keyframes fade { from { opacity: 0; } }
.viewer-img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6); background: #fff;
  cursor: zoom-in; touch-action: none; user-select: none; transition: transform 0.12s ease-out;
}
.viewer-img.zoomed { cursor: grab; }
.viewer-img.dragging { cursor: grabbing; transition: none; }
.viewer-btn {
  position: absolute; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(20, 22, 30, 0.75); color: #fff; cursor: pointer;
  backdrop-filter: blur(6px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); transition: background 0.15s;
}
.viewer-btn .icon { width: 20px; height: 20px; }
.viewer-btn:hover { background: rgba(45, 48, 60, 0.9); }
.viewer :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.viewer-close { top: 14px; right: 14px; }
.viewer-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 14px; top: 50%; transform: translateY(-50%); }
.viewer-prev .icon, .viewer-next .icon { width: 24px; height: 24px; }
.viewer-toolbar {
  position: absolute; z-index: 1; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 99px;
  background: rgba(20, 22, 30, 0.75); backdrop-filter: blur(6px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.viewer-toolbar button, .viewer-open {
  display: inline-flex; align-items: center; justify-content: center; height: 34px; min-width: 34px; padding: 0 8px;
  border: 0; border-radius: 99px; background: transparent; color: #fff; font: inherit; font-size: 13px;
  font-variant-numeric: tabular-nums; cursor: pointer; text-decoration: none;
}
.viewer-toolbar button:hover:not(:disabled), .viewer-open:hover { background: rgba(255, 255, 255, 0.16); }
.viewer-toolbar button:disabled { opacity: 0.35; cursor: default; }
.viewer-zoom { min-width: 56px !important; }
.viewer-count, .viewer-open { margin-left: 4px; border-left: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0 99px 99px 0 !important; }
.viewer-count { padding: 0 10px 0 12px; color: rgba(255, 255, 255, 0.8); font-size: 13px; font-variant-numeric: tabular-nums; }
.viewer-count:not([hidden]) + .viewer-open { margin-left: 0; }

/* =========================================================
   Toasts & tooltip
   ========================================================= */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; pointer-events: auto;
  min-width: 260px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 500; animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast .icon { width: 18px; height: 18px; color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast span { flex: 1; }
.toast-action { flex-shrink: 0; }
.toast.leaving { animation: toast-out 0.18s ease-in forwards; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(16px); opacity: 0; } }

.tooltip {
  position: fixed; z-index: 1001; pointer-events: none;
  padding: 8px 10px; border-radius: var(--radius-sm); min-width: 120px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 12px; line-height: 1.5;
}
.tooltip .tip-title { font-weight: 650; margin-bottom: 2px; }
.tooltip .tip-row { display: flex; align-items: center; gap: 6px; }
.tooltip .tip-row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }

/* =========================================================
   Skeletons
   ========================================================= */

.sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { height: 96px; border-radius: var(--radius-lg); }
.sk-line { height: 12px; }

/* =========================================================
   Reports
   ========================================================= */

.page.scroll { overflow-y: auto; }
.report-body { padding: 20px 28px 36px; display: flex; flex-direction: column; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.tile { padding: 16px 18px; }
.tile-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.tile-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); }
.tile-icon .icon { width: 15px; height: 15px; }
.tile-value { margin: 12px 0 4px; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.tile-sub { font-size: 12.5px; color: var(--muted); }

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { padding: 18px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel.wide { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.panel-head > div:first-child { flex: 1; }
.panel-head .subtle { margin-top: 2px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 2px; border-radius: 1px; }
.key-1 { background: var(--series-1); }
.key-2 { background: var(--series-2); }
.key-done { background: var(--series-done); }

.chart { position: relative; width: 100%; min-height: 240px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .s1 { stroke: var(--series-1); }
.chart .s2 { stroke: var(--series-2); }
.chart .sd { stroke: var(--series-done); }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .marker { stroke: var(--surface); stroke-width: 2; }
.chart .marker.s1 { fill: var(--series-1); }
.chart .marker.s2 { fill: var(--series-2); }
.chart .marker.sd { fill: var(--series-done); }
.chart .col.s1 { fill: var(--series-1); }
.chart .col.s2 { fill: var(--series-2); }
.chart .col.sd { fill: var(--series-done); }
.chart .band-hover { fill: var(--hover); }
.legend.swatches i { width: 10px; height: 10px; border-radius: 3px; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 32%) 1fr; align-items: center; gap: 12px; font-size: 13px; }
.bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); }
.bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { height: 14px; width: calc((100% - 3rem) * var(--w)); border-radius: 0 4px 4px 0; background: var(--series-1); transition: filter 0.12s; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 12px; }
.bar-row:hover .bar { filter: brightness(1.12); }

.table-toggle summary { cursor: pointer; font-size: 12px; color: var(--muted); width: fit-content; }
.table-toggle summary:hover { color: var(--text); }
.mini-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }
.mini-table th, .mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table td + td, .mini-table th + th { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { max-height: 240px; overflow: auto; }

.oldest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.oldest li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.oldest li:last-child { border-bottom: 0; }
.oldest a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.oldest a:hover .oldest-title { color: var(--accent-text); }
.oldest-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.oldest .age { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* =========================================================
   Home
   ========================================================= */

.tile-link { color: var(--text); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.tile-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
/* Stage boards (All issues, My work): equal columns that share the width. */
.stage-board .column { flex: 1 1 0; min-width: 240px; }
.stage-board .column-head .count { margin-left: auto; }
.card-tags .lozenge { height: 20px; }
.reasons { display: flex; gap: 6px; flex-shrink: 0; }
/* Linked issues in the issue view */
.linked-row { display: flex; align-items: center; gap: 4px; }
.linked-row .issue-row { flex: 1; min-width: 0; margin: 0; }
.linked-row .icon-btn { opacity: 0; }
.linked-row:hover .icon-btn, .linked-row .icon-btn:focus-visible, .linked-row .icon-btn.armed { opacity: 1; }
@media (hover: none) { .linked-row .icon-btn { opacity: 1; } }

/* Sub-tasks in the ticket view: tick, rename in place, remove on hover */
.subtasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.subtask { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 4px 0 2px; border-radius: var(--radius-sm); }
.subtask:hover { background: var(--hover); }
.subtask-check { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.subtask-title { flex: 1; min-width: 0; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13.5px; }
.subtask-title:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: var(--ring); }
.subtask.done .subtask-title { color: var(--muted); text-decoration: line-through; }
.subtask .icon-btn { opacity: 0; }
.subtask:hover .icon-btn, .subtask .icon-btn:focus-visible { opacity: 1; }
@media (hover: none) { .subtask .icon-btn { opacity: 1; } }

/* A note under the description while blockers are still open */
.blocked-note { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--red-soft); color: var(--red-text); font-size: 13px; }
.blocked-note b { font-weight: 650; }

/* The ticket view's tabs: Sub-tasks, Links, Attachments, Activity */
.detail-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); }
.detail-tabs button {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; margin-bottom: -1px; padding: 0 2px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.detail-tabs button:hover { color: var(--text); }
.detail-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.detail-tabs .count:empty { display: none; }
.tab-panel { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.tab-panel[hidden] { display: none; }
.tab-group { margin-top: 10px; }
.tab-group:empty, .tab-group[hidden] { display: none; }
.tab-group h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.activity-section { margin-top: 8px; }
/* On cards and list rows */
.blocked-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--red-soft); color: var(--red-text); font-size: 11px; font-weight: 650; white-space: nowrap; }
.blocked-chip .icon { width: 12px; height: 12px; }
.meta.all-done { color: var(--green-text); }
.link-menu { width: min(420px, calc(100vw - 16px)); max-width: none; }
.link-menu .menu-label .key { margin-right: 4px; }

.issue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.issue-row {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; margin: 0 -10px;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 13.5px;
}
.issue-row:hover { background: var(--hover); }
.issue-row .key { width: 60px; flex-shrink: 0; }
.issue-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.panel-empty { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--green-soft); color: var(--green-text); font-size: 13.5px; font-weight: 500; }
.panel-empty .icon { width: 18px; height: 18px; }

.issue-row .lozenge { flex-shrink: 0; }

/* =========================================================
   Settings
   ========================================================= */

.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: 32px; padding: 20px 28px 48px; align-items: start; }
/* The list of sections on the left stays in view while the cards scroll. */
.settings-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; margin-left: -10px; }
.settings-nav-label { padding: 14px 10px 6px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.settings-nav-label:first-child { padding-top: 0; }
.settings-nav button {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-2); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.settings-nav button:hover { background: var(--hover); color: var(--text); }
.settings-nav button .icon { color: var(--muted); }
.settings-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-card { padding: 0; gap: 0; scroll-margin-top: 16px; }
.settings-card-head { padding: 18px 22px 0; }
.settings-card-head .subtle { margin-top: 4px; line-height: 1.5; }
.settings-fields { display: flex; flex-direction: column; gap: 14px; padding: 16px 22px 22px; max-width: 480px; }
.settings-form { display: flex; flex-direction: column; min-width: 0; }
/* Save buttons sit in a footer strip, like the other forms. */
.settings-card-foot { display: flex; justify-content: flex-end; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.team-page .invite-row { max-width: 720px; }
.seg[aria-label="Theme"] { align-self: flex-start; }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--gray-soft); color: var(--gray-text); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); }
code { font-family: var(--mono); font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

.invite { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.invite-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.invite-text span { color: var(--muted); line-height: 1.5; }
.invite-row { display: flex; gap: 8px; }
.invite-row .input { flex: 1; min-width: 0; }
.member-count { margin-top: 2px; }
.members { list-style: none; margin: -6px 0 0; padding: 0; display: flex; flex-direction: column; }
.member { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.member:last-child { border-bottom: 0; }
.member.inactive > .avatar, .member.inactive .member-meta { opacity: 0.55; }
.member-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.member-meta b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-meta span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-spacer { width: 26px; flex-shrink: 0; }

.info-dialog { width: min(460px, calc(100vw - 24px)); margin: 18vh auto auto; }
.info-head { display: flex; align-items: center; gap: 8px; padding: 18px 14px 4px 22px; }
.info-head h2 { flex: 1; font-size: 16px; font-weight: 700; }
.info-body { padding: 4px 22px 4px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.info-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .detail-main { padding: 20px 24px 40px; }
  .drawer { width: calc(100vw - 32px); margin-top: 24px; height: calc(100dvh - 48px); }
}

@media (max-width: 860px) {
  .app, .app.sidebar-collapsed { grid-template: "top" 56px "main" minmax(0, 1fr) / minmax(0, 1fr); }
  .topbar { grid-template-columns: auto minmax(0, 1fr); }
  .topbar-start { padding: 0 0 0 8px; border-right: 0; }
  .product { display: none; }
  .topbar-main { gap: 6px; padding: 0 8px 0 6px; }
  .org { margin-left: 0; padding: 0 4px; }
  .org-name { display: none; }
  .global-search > kbd { display: none; }
  .global-search input { padding-right: 12px; }
  .search-results { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; }
  .search-item .key, .search-item .lozenge, .search-foot { display: none; }
  .create-btn { width: 36px; padding: 0; }
  .create-btn span { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: 272px;
    transform: translateX(-100%); transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg); background: var(--surface);
  }
  .sidebar-head { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 10px 0 16px; flex-shrink: 0; border-bottom: 1px solid var(--border); }
  .sidebar-head .org-name { display: block; flex: 1; }
  .app.sidebar-collapsed .nav a { justify-content: flex-start; padding: 0 10px; gap: 10px; }
  .app.sidebar-collapsed .nav-text { display: inline; }
  .app.sidebar-collapsed .nav-label { height: auto; padding: 14px 10px 6px; margin: 0; background: none; }
  .app.sidebar-collapsed .nav-count { position: static; min-width: 22px; height: 20px; padding: 0 7px; margin-left: auto; border: 0; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 11px; }
  .app.sidebar-collapsed .nav a[aria-current="page"] .nav-count { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: var(--overlay); }
  .page-head { padding: 14px 16px 0; }
  .page-head .crumbs { display: none; }
  h1 { font-size: 20px; }
  .page-icon { width: 32px; height: 32px; }
  .btn-label { display: none; }
  .title-actions .btn { width: 36px; padding: 0; }
  .results, .results.list-mode { padding: 0 16px 20px; }
  .table { min-width: 0; }
  .tr { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 0 12px; }
  .tr .cell-key, .tr.th > :nth-child(2), .tr .col-assignee, .tr .col-priority, .tr .col-date { display: none; }
  .table.mixed .tr { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .bulk-bar .chip { flex-shrink: 0; }
  .row-title .meta { display: none; }
  .toolbar { gap: 8px; padding: 12px 0; }
  .toolbar-right { flex: 1 1 100%; flex-wrap: nowrap; margin-left: 0; }
  .toolbar-right .chips { display: flex; flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .sort-slot .chip span, .sort-slot .chip b { display: none; }
  .board { scroll-snap-type: x mandatory; }
  .column { flex: 0 0 min(286px, 84vw); scroll-snap-align: start; }
  .stage-board .column { flex: 0 0 min(286px, 84vw); }
  .column-head .icon-btn { opacity: 1; }
  .report-body { padding: 16px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .settings-nav { display: none; }
  .settings-fields { max-width: none; padding: 14px 16px 18px; }
  .settings-card-head { padding: 16px 16px 0; }
  .settings-card-foot { padding: 12px 16px; }
  .drawer { margin: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .detail-head { padding: 0 8px 0 16px; }
  /* One scrolling column: title, then status and details, then the rest. */
  .detail-grid { display: flex; flex-direction: column; gap: 22px; overflow-y: auto; padding: 16px 16px 40px; }
  .detail-main { display: contents; }
  .detail-side { order: -1; overflow: visible; padding: 0; border: 0; background: none; }
  .title-input { order: -2; }
  .modal, .info-dialog { margin: auto auto 0; width: 100vw; max-height: 92dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .composer-props { grid-template-columns: minmax(0, 1fr); }
  .composer-head { padding: 20px 12px 4px 20px; }
  .composer-body { padding: 16px 20px 24px; gap: 20px; }
  .composer-props { gap: 20px; }
  .composer-foot { padding: 14px 20px 18px; }
  .thumb { width: calc(50% - 5px); }
  .viewer { padding: 64px 8px 80px; }
  .viewer-prev, .viewer-next { top: auto; bottom: 16px; transform: none; width: 38px; height: 38px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .tile-value { font-size: 24px; }
}

@media (max-width: 520px) {
  .reasons .tag:not(:first-child), .issue-row > .avatar, .issue-row > .key { display: none; }
  .theme-btn { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .tile { padding: 12px 14px; }
  .detail-head .btn-label { display: none; }
  .section-head .seg { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================================
   Labels, due dates, watching, mentions
   ========================================================= */

.label-chip {
  display: inline-flex; align-items: center; height: 20px; max-width: 160px; padding: 0 8px; border-radius: 10px;
  background: var(--tone-soft); color: var(--tone-text); font-size: 11.5px; font-weight: 600; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.due-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; flex-shrink: 0;
  background: var(--tone-soft, var(--surface-3)); color: var(--tone-text, var(--muted)); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.due-chip .icon { width: 12px; height: 12px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.row-title .label-chip, .row-title .due-chip { height: 18px; font-size: 11px; }
.row-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.labels-pill { height: auto; min-height: var(--control); padding-block: 6px; }
.labels-pill .muted { flex: 1; }

.labels-btn { height: auto; min-height: 30px; padding-block: 4px; }
.prop-date {
  height: 30px; margin: 0 6px; padding: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; color-scheme: inherit;
}
.prop-date:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.prop.due-red .prop-label { color: var(--red-text); }
.prop.due-yellow .prop-label { color: var(--yellow-text); }

.watch-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.active-watch { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.watchers { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -4px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.mention { padding: 0 3px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.mention-box { min-width: 220px; }
.label-menu { width: min(320px, calc(100vw - 16px)); }

.label-form { display: flex; flex-direction: column; gap: 16px; }
.swatches { display: flex; gap: 8px; }
.swatch {
  width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  background: var(--tone); box-shadow: inset 0 0 0 3px var(--surface);
}
.swatch[aria-checked="true"] { border-color: var(--text); }
.label-preview { min-height: 20px; }
.label-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.label-list li { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--border); }
.label-list li:last-child { border-bottom: 0; }
.label-actions { margin-left: auto; display: flex; gap: 2px; }

.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; line-height: 1.4; }
.switch {
  appearance: none; flex-shrink: 0; width: 38px; height: 22px; margin: 0; border-radius: 11px; cursor: pointer;
  background: var(--border-strong); position: relative; transition: background 0.15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.15s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =========================================================
   Public feedback page
   ========================================================= */

.fb { min-height: 100dvh; }
.fb-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 56px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--chrome); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.fb-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.fb-tag { padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; }
.fb-inner { width: min(760px, 100%); margin: 0 auto; padding: 0 16px 64px; }
.fb-hero { padding: 48px 0 28px; display: flex; flex-direction: column; gap: 10px; }
.fb-hero h1 { font-size: 30px; text-wrap: balance; }
.fb-hero p { color: var(--muted); font-size: 15px; max-width: 56ch; }
.fb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fb-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.fb-search { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center; }
.fb-search .icon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.fb-search .input { padding-left: 36px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fb-item { display: flex; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.vote {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex-shrink: 0;
  width: 56px; height: 60px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  color: var(--muted); cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.vote b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.vote:hover { border-color: var(--accent); color: var(--accent-text); }
.vote.voted { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.vote.voted b { color: var(--accent-text); }
.fb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fb-body h2 { font-size: 15.5px; }
.fb-body p { color: var(--text-2); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fb-meta { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.fb-empty { padding: 32px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.info-dialog:has(.fb-form) { width: min(560px, calc(100vw - 24px)); }
.fb-form { display: flex; flex-direction: column; gap: 16px; }
.fb-form .seg { align-self: flex-start; }
.fb-textarea { height: auto; min-height: 110px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.fb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 520px) {
  .fb-hero h1 { font-size: 24px; }
  .fb-two { grid-template-columns: 1fr; }
  .fb-item { gap: 12px; padding: 14px; }
}

/* =========================================================
   Weekly sprints
   ========================================================= */

.chart .line.ideal { stroke-dasharray: 5 5; stroke-width: 1.5; }
.legend i.dashed { background: repeating-linear-gradient(90deg, var(--series-2) 0 4px, transparent 4px 7px); }
.panel-empty.neutral { background: var(--surface-2); color: var(--muted); }

.sprint-focus { gap: 18px; }
.sprint-focus-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sprint-focus-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sprint-focus-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 24px; }
.sprint-progress { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sprint-progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.progress { display: block; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.3s; }
.progress.small { width: 80px; height: 6px; flex-shrink: 0; }
.sprint-stages { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.sprint-stages > span { display: inline-flex; align-items: center; gap: 6px; }
.sprint-stages b { color: var(--text); }
.sprint-links { display: flex; gap: 8px; flex-wrap: wrap; }

.title-row > .tag { height: 24px; }

@media (max-width: 1100px) {
  .sprint-focus-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 520px) {
}

/* Issues page: the main sprint dropdown, apart from the filters */
.sprint-slot { display: flex; }
.sprint-select {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control); padding: 0 10px;
  border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; transition: border-color 0.12s, box-shadow 0.12s;
}
.sprint-select:hover { border-color: var(--border-strong); }
.sprint-select[aria-expanded="true"] { border-color: var(--accent); box-shadow: var(--ring); }
.sprint-select > .icon:first-child { color: var(--accent-text); }
.sprint-select > .icon:last-child { color: var(--muted); }
.sprint-select b { font-weight: 600; }

.sprint-badge {
  display: inline-flex; align-items: center; height: 18px; margin-left: 8px; padding: 0 6px; border-radius: 9px; vertical-align: 1px;
  background: var(--surface-3); color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.sprint-badge.current { background: var(--yellow-soft); color: var(--yellow-text); }
.sprint-badge.complete { background: var(--green-soft); color: var(--green-text); }
.sprint-select .sprint-badge { margin-left: 2px; }

/* Sprints calendar: one stretch per week (Monday to Sunday) */
.sprint-focus-title h2 { font-size: 17px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.cal-layout.with-detail { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-head h2 { font-size: 16px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 0 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cal-days span { padding-left: 8px; }
.cal-weeks { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-week { position: relative; min-height: 96px; border-bottom: 1px solid var(--border); }
.cal-week:last-child { border-bottom: 0; }
.cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 100%; min-height: 96px; }
.cal-cell { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-right: 1px solid var(--border); }
.cal-cell:last-child { border-right: 0; }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-date { color: var(--faint); }
.cal-date { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-date { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: -2px 0 0 -4px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.cal-due { font-size: 11px; color: var(--muted); }
.cal-stretches {
  position: absolute; left: 0; right: 0; bottom: 8px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 0; padding: 0 6px; pointer-events: none;
}
.cal-stretch {
  position: relative; height: 30px; overflow: hidden; margin: 0 2px; pointer-events: auto;
  display: flex; align-items: center; padding: 0 10px; border: 1px solid transparent; border-radius: 0;
  background: var(--surface-3); color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
/* A sprint crossing into the next row continues there with squared ends. */
.cal-stretch.starts { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.cal-stretch.ends { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
/* A sprint crossing into the next row continues there without a gap at the edges. */
.cal-stretch:not(.starts) { margin-left: 0; }
.cal-stretch:not(.ends) { margin-right: 0; }
.cal-stretch:hover { border-color: var(--border-strong); }
.cal-stretch.selected { border-color: var(--accent); box-shadow: var(--ring); }
.cal-stretch.current { background: var(--yellow-soft); color: var(--yellow-text); }
.cal-stretch.complete { background: var(--green-soft); color: var(--green-text); }
.cal-stretch-fill { position: absolute; inset: 0 auto 0 0; background: currentColor; opacity: 0.14; pointer-events: none; }
.cal-stretch-text { position: relative; display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; }
.cal-stretch-text b { font-weight: 700; }
.cal-stretch-text span { opacity: 0.85; }

.sprint-detail { gap: 16px; position: sticky; top: 16px; }
.sprint-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sprint-detail-head h2 { display: flex; align-items: center; font-size: 17px; }
.sprint-detail-goal { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
.sprint-detail .sprint-links .btn { flex: 1; }
.sprint-facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.sprint-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.sprint-facts dt { font-size: 13px; color: var(--muted); }
.sprint-facts dd { margin: 0; display: flex; flex-direction: column; align-items: flex-end; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sprint-facts dd span { font-size: 11.5px; font-weight: 500; color: var(--muted); }

@media (max-width: 1100px) {
  .cal-layout.with-detail { grid-template-columns: minmax(0, 1fr); }
  .sprint-detail { position: static; }
}
@media (max-width: 520px) {
  .cal-week, .cal-cells { min-height: 76px; }
  .cal-due { display: none; }
  .cal-stretch-text span:last-child { display: none; }
}

/* =========================================================
   Organisations and projects
   ========================================================= */

button.org { border: 0; background: transparent; font: inherit; cursor: pointer; }
.org-chevron { color: var(--muted); }
.org-mark.sm { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
.topbar-sep { color: var(--faint); font-size: 18px; margin: 0 -6px; }
.project-btn {
  display: inline-flex; align-items: center; gap: 8px; height: var(--control); max-width: 260px; padding: 0 10px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; flex-shrink: 1; min-width: 0;
}
.project-btn:hover, .project-btn[aria-expanded="true"] { background: var(--hover); }
.project-btn b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-btn .icon:last-child { color: var(--muted); }
.project-dot { display: inline-block; flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; background: var(--tone); }
.menu-section { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.menu .key { margin-left: 4px; }

.composer-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.project-table { padding: 6px 18px; gap: 0; }
.pt-row {
  display: grid; grid-template-columns: minmax(180px, 2fr) 80px minmax(150px, 1.4fr) 70px 70px auto; align-items: center; gap: 12px;
  min-height: 56px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.pt-row:last-child { border-bottom: 0; }
.pt-row.archived .pt-name b { color: var(--muted); }
.pt-head { min-height: 38px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.pt-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-name b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-people { display: flex; align-items: center; gap: 8px; padding: 4px 6px; margin-left: -6px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; cursor: pointer; }
.pt-people:hover { background: var(--hover); }
.pt-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.google-btn { gap: 10px; background: var(--surface); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--faint); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 860px) {
  .topbar-sep { display: none; }
  .project-btn { max-width: 140px; padding: 0 6px; }
  .project-btn .key { display: none; }
  .pt-row { grid-template-columns: minmax(0, 1fr) 60px auto; }
  .pt-row > :nth-child(3), .pt-row > :nth-child(4), .pt-row > :nth-child(5) { display: none; }
}
@media (max-width: 520px) {
  .composer-top { grid-template-columns: minmax(0, 1fr); }
  .project-btn b { max-width: 90px; }
}
.pill > .project-dot, .pill > .key { flex: none !important; }

/* Bulk edit */
.row-check { display: grid; place-items: center; }
.row-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.tr.row.selected { background: var(--accent-soft); }
.bulk-hint { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12.5px; }
.bulk-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 8px 10px 8px 14px; border: 1px solid var(--accent); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-md);
}
.bulk-bar > b { font-size: 13.5px; }
.bulk-sep { width: 1px; height: 22px; background: var(--border); }
@media (max-width: 860px) {
  .bulk-bar { overflow-x: auto; flex-wrap: nowrap; }
}

.inline-input { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.inline-input .input { width: 90px; }

/* Report tables (projects, people, sprints) */
.report-table { display: flex; flex-direction: column; }
.rt-row {
  display: grid; grid-template-columns: minmax(160px, 1.4fr) minmax(100px, 1fr) 80px 80px minmax(140px, 1.2fr); align-items: center; gap: 12px;
  min-height: 44px; padding: 0 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent;
  color: var(--text); font: inherit; font-size: 13.5px; text-align: left; font-variant-numeric: tabular-nums;
}
.rt-row.six { grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(70px, 1fr)); }
.rt-row.seven { grid-template-columns: minmax(170px, 2fr) repeat(6, minmax(64px, 1fr)); }
.rt-row:last-child { border-bottom: 0; }
button.rt-row { cursor: pointer; }
button.rt-row:hover { background: var(--hover); }
.rt-row.active { background: var(--accent-soft); }
.rt-head { min-height: 36px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.rt-row .warn { color: var(--red-text); font-weight: 650; }
.st-name { font-weight: 600; white-space: nowrap; }
.st-pct { display: flex; align-items: center; gap: 10px; }
.report-body .panel { position: relative; }
.pdf-btn { position: absolute; top: 12px; right: 12px; opacity: 0; }
.panel:hover .pdf-btn, .pdf-btn:focus-visible { opacity: 1; }
@media (hover: none) { .pdf-btn { opacity: 1; } }
.report-body .panel .panel-head .legend { margin-right: 30px; }
@media (max-width: 860px) {
  .report-table { overflow-x: auto; }
  .rt-row, .rt-row.six, .rt-row.seven { min-width: 560px; }
}

/* PDF export: print only the chosen report or panel */
@media print {
  @page { margin: 14mm; }
  body.printing { background: #fff !important; }
  body.printing .topbar, body.printing .sidebar, body.printing .toasts, body.printing .pdf-btn,
  body.printing .page-head .toolbar, body.printing .title-actions, body.printing details.table-toggle summary { display: none !important; }
  body.printing .app { display: block; height: auto; }
  body.printing .page.scroll { overflow: visible; }
  body.printing .panel { break-inside: avoid; box-shadow: none; }
  body.printing .report-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body.printing .print-target.panel { border: 0; }
  body.printing main:has(.print-target.panel) .page-head,
  body.printing main:has(.print-target.panel) .report-body > :not(:has(.print-target)):not(.print-target),
  body.printing main:has(.print-target.panel) .report-grid > :not(.print-target) { display: none !important; }
}
@media (max-width: 520px) {
  .org-chevron, .project-btn > .icon:first-child { display: none; }
  .project-btn { max-width: 110px; gap: 4px; }
  .project-btn b { max-width: 80px; }
  .topbar-main { gap: 4px; }
}
