/* FlightDeck design system. Tokens first, then components. System font stack only. */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;

  --bg-page: #f4f6f7;
  --bg-surface: #ffffff;
  --text: #1c1c1c;
  --text-secondary: #3f4246;
  --text-tertiary: #5c5f63;
  --text-muted: #7f8387;
  --border: #e6eaec;
  --border-strong: #dce1e4;

  --primary: #00a7c1;
  --primary-dark: #00758b;
  --primary-darker: #00586a;
  --primary-tint: #e3f5f8;

  --error: #e5533a;
  --error-text: #8f2a17;
  --error-tint: #fcede8;
  --warning: #e8a13a;
  --warning-text: #7a4a00;
  --warning-tint: #fdf3e1;
  --success: #3f9c6d;
  --success-text: #1f5e40;
  --success-tint: #e7f3ec;

  --status-todo: #9a9da1;
  --status-progress: #00a7c1;
  --status-review: #6ed8d0;
  --status-done: #00758b;
  --priority-urgent: #e5533a;
  --priority-high: #e8a13a;
  --priority-medium: #8fa3c7;
  --priority-low: #c3c8cc;

  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 280px;
  --sidebar-rail: 64px;
}

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

html {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-page);
}

body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-page);
}

h1,
h2,
h3 {
  margin: 0 0 4px;
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 28px; }
h2 { font-size: 16px; }

a { color: var(--primary-dark); }

:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.text-secondary { color: var(--text-tertiary); }

/* ---- Layout ---- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.app[data-sidebar="collapsed"] {
  grid-template-columns: var(--sidebar-rail) 1fr;
}

.main-content {
  padding: 32px 40px;
  min-width: 0;
}

.page-header { margin-bottom: 24px; }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ---- Buttons ---- */

.btn[hidden] { display: none; } /* .btn sets display, which would otherwise override the hidden attribute */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-dark);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-darker); }

.btn-ghost {
  background: var(--bg-surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }

.icon-btn {
  display: inline-flex;
  padding: 6px;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.icon-btn:hover { background: var(--primary-tint); color: var(--primary-dark); }

/* ---- Forms ---- */

.form-group { margin-bottom: 16px; }

.form-input {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.form-input:disabled { background: var(--bg-page); cursor: not-allowed; }

/* ---- Badges and tags ---- */

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-darker);
}

.tag-error { background: var(--error-tint); color: var(--error-text); }
.tag-warning { background: var(--warning-tint); color: var(--warning-text); }
.tag-success { background: var(--success-tint); color: var(--success-text); }

/* ---- Modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90; /* above the side panels, card menus and search results */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 28, 28, 0.4);
}

.modal-box {
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
  background: var(--bg-surface);
  border-radius: var(--radius);
}

/* ---- Sidebar ---- */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  padding: 20px 14px;
  overflow: hidden;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #ffffff;
  background: var(--primary);
  border-radius: var(--radius-sm);
}

.brand-name span { color: var(--primary-dark); }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.nav-item:hover:not(.is-disabled) { background: var(--bg-page); }
.nav-item.is-active { background: var(--primary-tint); color: var(--primary-darker); }
.nav-item.is-disabled { color: var(--text-muted); cursor: not-allowed; }

.nav-icon { flex: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }

/* Collapsed rail: labels hidden; hovering opens it temporarily over the page. */
.app[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-rail); }
.app[data-sidebar="collapsed"] .nav-label,
.app[data-sidebar="collapsed"] .brand-name,
.app[data-sidebar="collapsed"] .sidebar-search { display: none; }

.app[data-sidebar="collapsed"] .sidebar:hover,
.app[data-sidebar="collapsed"] .sidebar:focus-within {
  width: var(--sidebar-width);
  box-shadow: 4px 0 16px rgba(28, 28, 28, 0.08);
}

.app[data-sidebar="collapsed"] .sidebar:hover .nav-label,
.app[data-sidebar="collapsed"] .sidebar:hover .brand-name,
.app[data-sidebar="collapsed"] .sidebar:hover .sidebar-search,
.app[data-sidebar="collapsed"] .sidebar:focus-within .nav-label,
.app[data-sidebar="collapsed"] .sidebar:focus-within .brand-name,
.app[data-sidebar="collapsed"] .sidebar:focus-within .sidebar-search {
  display: block;
}

/* ---- Error pages ---- */

.error-page {
  max-width: 480px;
  margin: 12vh auto;
  text-align: center;
}

.error-code {
  margin: 0;
  font-size: 56px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ---- Sign-in ---- */

.app[data-sidebar="none"] { grid-template-columns: 1fr; }

.auth-card {
  width: min(420px, 100%);
  margin: 8vh auto;
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-accent { color: var(--primary-dark); margin-left: -8px; }
.auth-title { margin: 16px 0; font-size: 22px; }
.auth-step label { display: block; margin-bottom: 4px; font-weight: 600; }

.auth-error,
.auth-success {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.auth-error { background: var(--error-tint); color: var(--error-text); }
.auth-success { background: var(--success-tint); color: var(--success-text); }
.auth-error[hidden] { display: none; }

.qr { display: block; margin: 8px auto; }
.recovery-codes { columns: 2; padding-left: 20px; font-family: var(--font-mono); }

/* ---- User menu ---- */

.user-menu { position: relative; margin-top: 8px; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  text-align: left;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.user-menu-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-menu-text span { font-size: 12px; }

.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-darker);
  background: var(--primary-tint);
  border-radius: 50%;
}

.user-menu-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(28, 28, 28, 0.12);
}

.user-menu-panel[hidden] { display: none; }

.user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.user-menu-item:hover { background: var(--bg-page); }

/* ---- Tabs and admin tables ---- */

.tabs { display: flex; flex-wrap: nowrap; gap: 2px; margin-bottom: 20px; overflow-x: auto; border-bottom: 1px solid var(--border-strong); }

.tab {
  flex: 0 0 auto;
  padding: 10px 10px;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-tertiary);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tab.is-active { color: var(--primary-darker); border-bottom-color: var(--primary-dark); }

.ws-card { margin-bottom: 16px; }
.notice { margin-bottom: 16px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.inline-form .form-input { width: auto; flex: 1 1 160px; }
.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.form-row .form-input { width: auto; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-surface); }

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.admin-table thead th { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.admin-table .form-input { padding: 5px 8px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.matrix .group-row th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-page);
}

.matrix th[scope="row"] { font-weight: 500; }
.perm-note { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.perm-cell { text-align: center !important; width: 90px; }
.perm-cell input { width: 18px; height: 18px; accent-color: var(--primary-dark); }
.dot-changed { margin-left: 4px; font-size: 10px; color: var(--warning); }

/* ---- Statuses, projects and epics ---- */

.modal-overlay[hidden] { display: none; }
.modal-box { max-height: 90vh; overflow: auto; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.swatches[hidden] { display: none; }

.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.swatch.is-on { border-color: var(--text); }
.swatch-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.status-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.status-row {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.status-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-name { flex: 1 1 180px; width: auto; }
.status-dot { width: 24px; height: 24px; }
.check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.project-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { gap: 6px; }

.pj-toolbar { margin-bottom: 12px; }
.pj-label { font-size: 12px; }
/* Three choices on one row (the shared .segmented grid has three equal columns, which would squash them). */
.pj-views { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 4px; }
.pj-views .seg { padding: 5px 12px; white-space: nowrap; }
.columns[hidden], .plan-host[hidden] { display: none; } /* .columns sets display, which would otherwise override hidden */
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }

.column {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.column-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.column-head h2 { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.column-body { display: flex; flex-direction: column; gap: 8px; }
/* Projects page: the three columns are fixed to the window and each scrolls on its own. */
.columns-fixed { height: calc(100vh - 250px); min-height: 360px; align-items: stretch; }
.columns-fixed .column { display: flex; flex-direction: column; min-height: 0; }
.columns-fixed .column-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
@media (max-width: 900px) {
  .columns-fixed { height: auto; }
  .columns-fixed .column-body { max-height: 60vh; }
}
.pj-search { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.pj-search .form-input { flex: 1; min-width: 0; }
.pj-search input[type="search"]::-webkit-search-cancel-button { display: none; }

.pj-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pj-card.is-selected { border-color: var(--primary); background: var(--primary-tint); }

.pj-card-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

div.pj-card-main { cursor: default; }
.pj-title { display: flex; align-items: center; gap: 8px; }
.pj-meta { font-size: 12px; }
.pj-actions { display: flex; gap: 2px; }

.pj-form .form-row { align-items: flex-end; }
.pj-form .form-group { flex: 1; }
.team-picks { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.team-pick { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; }
.milestones { margin: 0 0 8px; padding: 0; list-style: none; }
.milestones li { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.pj-milestones { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

@media (max-width: 1100px) {
  .sp-plan { grid-template-columns: 1fr; }
  .sp-headgrid { grid-template-columns: 1fr; }
  .sp-startbox { align-items: flex-start; text-align: left; }
  .columns { grid-template-columns: 1fr; }
}

/* ---- Tickets ---- */

.ticket-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  overflow-y: auto;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: -8px 0 24px rgba(28, 28, 28, 0.08);
}

.ticket-panel[hidden] { display: none; }
.pad { padding: 16px; }
.panel-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0; }
.panel-head { padding: 0 16px; }
/* The close button and the heading stay put while the rest of the ticket scrolls. */
.panel-top { position: sticky; top: 0; z-index: 8; padding-bottom: 6px; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.panel-titlebar { padding: 0 16px; }
/* The comments scroll in their own box, so the box to write in is never miles away. */
.comment-list { max-height: min(340px, 40vh); overflow-y: auto; padding-right: 4px; }
.panel-body { padding: 0 16px 16px; flex: 1; }
.panel-title { margin: 8px 0; font-size: 20px; }
.crumbs { margin: 0; font-size: 13px; color: var(--text-tertiary); }

.panel-foot {
  position: sticky;
  bottom: 0;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.panel-status { margin: 0; font-size: 13px; color: var(--success-text); }
.panel-status.is-error { color: var(--error-text); }

.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.fact { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: var(--bg-page); border-radius: 999px; }
.fact.is-late { color: var(--error-text); background: var(--error-tint); }
.avatar-right { margin-left: auto; }
.avatar-empty { background: var(--bg-page); color: var(--text-muted); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-tint);
  border: 0;
  border-radius: 999px;
}

.status-pill.is-button { cursor: pointer; }
.menu-wrap { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  min-width: 160px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(28, 28, 28, 0.12);
}

.menu[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; font: inherit; text-align: left; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.menu-item:hover { background: var(--bg-page); }

/* Priority signal bars */
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { display: block; width: 3px; background: var(--priority-low); border-radius: 1px; }
.bars i:nth-child(1) { height: 5px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 12px; }
.bars.prio-1 i.on { background: var(--priority-urgent); }
.bars.prio-2 i.on { background: var(--priority-high); }
.bars.prio-3 i.on { background: var(--priority-medium); }
.bars.prio-4 i.on { background: var(--priority-low); }

.description { margin-bottom: 12px; }
.prose { font-size: 14px; }
.prose.is-clamped { max-height: 6.5em; overflow: hidden; }
.prose p { margin: 0 0 8px; }
.prose code, .prose pre { font-family: var(--font-mono); background: var(--bg-page); border-radius: 4px; }
.prose pre { padding: 8px; overflow-x: auto; }
.prose blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--border-strong); color: var(--text-tertiary); }
.link-btn { padding: 0; font: inherit; font-size: 13px; color: var(--primary-dark); background: none; border: 0; cursor: pointer; }
.hint { font-size: 12px; margin: 4px 0 8px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg { padding: 9px; font: inherit; font-weight: 600; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.seg.is-on { color: var(--primary-darker); background: var(--primary-tint); border-color: var(--primary); }

.tf-section { margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tf-section > header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.tf-row { padding: 6px 12px; }
.tf-label { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--text-tertiary); }
.req { color: var(--error); }
.tf-row.is-invalid .form-input { border-color: var(--error); background: var(--error-tint); }
.field-error { margin: 4px 0 0; font-size: 12px; color: var(--error-text); }
.field-error[hidden] { display: none; }
.tf > .tf-row { padding-left: 0; padding-right: 0; }
.also summary { cursor: pointer; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.also-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; padding: 8px 4px; overflow-y: auto; }
.tag-error { background: var(--error-tint); color: var(--error-text); }
.modal-wide { width: min(640px, calc(100vw - 32px)); }

.summary { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 12px 0; }
.summary dt { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.summary dd { margin: 0; }

.ticket-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.ticket-row:hover { border-color: var(--primary); }
.ticket-row.is-faded { opacity: 0.45; }
.ticket-row.is-mine { border-color: var(--primary); background: var(--primary-tint); }
.ticket-top { display: flex; align-items: center; gap: 8px; }
.ticket-title { flex: 1; min-width: 0; }
.ticket-key { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quick-add .form-input { width: 100%; }
.move-prompt { margin-top: 8px; padding: 8px; background: var(--warning-tint); border-radius: var(--radius-sm); }
.move-prompt[hidden] { display: none; }

/* ---- Ticket icons and colour cues ---- */

.type-icon { flex: none; vertical-align: -3px; }
.type-task { color: var(--primary-dark); }
.type-feature { color: var(--warning); }
.type-bug { color: var(--error); }
.seg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

.select-with { display: flex; align-items: center; gap: 8px; }
.select-with .form-input { flex: 1; }
.indicator { display: inline-flex; align-items: center; justify-content: center; width: 22px; }
.swatch-dot.big { width: 14px; height: 14px; border-radius: 50%; }

.fact.prio-text-1 { color: var(--error-text); background: var(--error-tint); }
.fact.prio-text-2 { color: var(--warning-text); background: var(--warning-tint); }
.fact.prio-text-3 { color: #34456b; background: #e9eef8; }
.fact.prio-text-4 { color: var(--text-tertiary); background: var(--bg-page); }

/* ---- Subtasks, dependencies, comments, hold ---- */

.tab-box { padding-top: 12px; }
.sub-list, .comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sub-item { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sub-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.sub-title { flex: 1; text-align: left; }
.sub-title.is-done { text-decoration: line-through; color: var(--text-muted); }
.sub-detail { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--bg-page); }
.sub-detail .form-row { margin-bottom: 0; }

.dep-heading { margin: 12px 0 4px; font-size: 13px; color: var(--text-tertiary); }
.dep-row { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dep-main { display: flex; flex: 1; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.dep-title { flex: 1; min-width: 120px; font-weight: 600; }
.dep-pick { flex-wrap: wrap; }
.dep-choices { display: flex; gap: 6px; padding: 0 10px 8px; }
.dep-choices[hidden] { display: none; }
.search-results { margin-top: 6px; }
.blocked-note { padding: 8px 10px; color: var(--error-text); background: var(--error-tint); border-radius: var(--radius-sm); }
.hidden-note { font-size: 12px; }

.comment { display: flex; gap: 10px; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta { margin: 0; font-size: 13px; }
.comment-body { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { position: relative; display: flex; flex-direction: column; gap: 8px; }
.mention-list { display: flex; flex-direction: column; padding: 4px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: 0 6px 20px rgba(28, 28, 28, 0.12); }
.mention-list[hidden] { display: none; }

.hold-banner,
.hold-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  color: var(--warning-text);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, var(--warning-tint), var(--warning-tint) 8px, #fbe7c1 8px, #fbe7c1 16px);
}

.hold-form { flex-direction: column; align-items: stretch; background: var(--warning-tint); }
.hold-tag { color: var(--warning-text); background: repeating-linear-gradient(135deg, var(--warning-tint), var(--warning-tint) 5px, #fbe7c1 5px, #fbe7c1 10px); border: 1px solid var(--warning); }
.prompt { margin-bottom: 12px; padding: 10px; background: var(--warning-tint); border: 1px solid var(--warning); border-radius: var(--radius-sm); }
.prompt p { margin: 0 0 8px; }

/* ---- Several tickets at once, toast, subtask add ---- */

.seg-two { grid-template-columns: repeat(2, 1fr); max-width: 320px; margin-bottom: 12px; }
.bulk-heading { margin: 16px 0 8px; font-size: 14px; }
.bulk-preview { margin-bottom: 12px; }
.bulk-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.bulk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.bulk-row:last-child { border-bottom: 0; }
.bulk-row.is-sub { padding-left: 30px; background: var(--bg-page); }
.bulk-row.has-error { background: var(--error-tint); }
.bulk-num { min-width: 20px; color: var(--text-muted); font-size: 12px; }
.bulk-title { flex: 1; min-width: 140px; overflow-wrap: anywhere; }
.bulk-warning { flex-basis: 100%; padding-left: 28px; font-size: 12px; color: var(--warning-text); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag-plain { background: var(--bg-page); color: var(--text-secondary); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 14px;
  color: #ffffff;
  background: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(28, 28, 28, 0.25);
  transform: translateX(-50%);
}

.toast .link-btn { color: #7fe3f3; font-weight: 600; }
.toast .icon-btn { color: #ffffff; }

.sub-add { display: flex; flex-direction: column; gap: 6px; }
.sub-add .form-input { width: 100%; }
.sub-add .link-btn { align-self: flex-start; }
.sub-more { margin-bottom: 0; }
.sub-more .form-row { align-items: center; }
.sub-share-row { align-items: center; gap: 8px; flex-wrap: wrap; }
.sub-share-row .form-input { width: 90px; flex: 0 0 auto; }
.sub-share-note, .sub-allocated { font-size: 12px; }
.sub-allocated { margin: 8px 0 0; }
.fact.sub-share { white-space: nowrap; }
.sub-more .form-input { flex: 1; width: auto; }
.sub-more[hidden] { display: none; }

/* ---- My work ---- */

.mw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.mw-head h1 { margin: 2px 0 6px; }
.mw-head p { margin: 0; }
.mw-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mw-views { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); max-width: 380px; margin-bottom: 0; }
.mw-chip { padding: 2px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.mw-chip.is-late { color: var(--error-text); background: var(--error-tint); }
.mw-chip.is-soon { color: var(--warning-text); background: var(--warning-tint); }

.mw-group { margin-bottom: 20px; }
.mw-group-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0 0 8px; font-size: 15px; }
.mw-group > summary { cursor: pointer; }
.mw-group > summary .mw-group-title { display: inline-flex; }
.mw-count { font-weight: 400; color: var(--text-muted); }
.mw-hint { margin-left: auto; font-size: 12px; font-weight: 400; }
.mw-list { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.mw-row { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.mw-row:last-child { border-bottom: 0; }
.mw-row.is-late { background: var(--error-tint); }
.mw-row.is-attention { background: var(--warning-tint); }
/* A row wraps when the page is narrow (a ticket panel open beside it): the title keeps a readable width and
   the status, due date and action drop to the next line instead of squeezing it to one letter wide. */
.mw-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.mw-main { display: flex; flex: 1 1 200px; flex-direction: column; gap: 2px; min-width: min(200px, 100%); padding: 0; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.mw-title { font-weight: 600; overflow-wrap: break-word; word-break: normal; }
.mw-title.is-done { text-decoration: line-through; color: var(--text-muted); }
.mw-detail { font-size: 12px; color: var(--text-tertiary); }
.mw-detail.is-reason { color: var(--warning-text); }
.mw-row.is-late .mw-detail.is-reason { color: var(--error-text); }
.mw-due { min-width: 70px; text-align: right; font-size: 13px; color: var(--text-secondary); }
.mw-due.is-late { color: var(--error-text); font-weight: 600; }
.mw-hold-note { margin: 4px 0 0 36px; font-size: 12px; }
.mw-subs { margin: 8px 0 0 36px; padding: 0; list-style: none; border-left: 2px solid var(--border-strong); }
.mw-sub { display: flex; align-items: center; gap: 10px; padding: 4px 0 4px 12px; }
.mw-start { color: var(--primary-darker); border-color: var(--primary); }
.mw-empty { text-align: center; }
.mw-prompt-host .prompt { margin: 8px 0 0; }

.mw-weeknav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.mw-weeklabel { min-width: 120px; text-align: center; }
.mw-weekstate { margin-left: auto; font-weight: 600; }
.mw-weekstate.is-over { color: var(--error-text); }
.mw-weekstate.is-nearing { color: var(--warning-text); }
.mw-weekstate.is-room { color: var(--success-text); }
.mw-weekgrid { padding: 0; overflow-x: auto; }
.mw-days, .mw-bars { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); min-width: 640px; }
.mw-day { padding: 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mw-day:last-child { border-right: 0; }
.mw-day.is-today { background: var(--primary-tint); }
.mw-dayname { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.mw-load { display: flex; flex-direction: column; gap: 4px; }
.mw-bar { display: block; height: 6px; overflow: hidden; background: var(--border); border-radius: 999px; }
.mw-bar i { display: block; height: 100%; border-radius: 999px; }
.mw-load.is-room .mw-bar i { background: var(--success); }
.mw-load.is-nearing .mw-bar i { background: var(--warning); }
.mw-load.is-over .mw-bar i { background: var(--error); }
.mw-pts { font-size: 12px; color: var(--text-tertiary); }
.mw-bars { gap: 6px 4px; padding: 10px 4px; }
.mw-barcard { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 10px; font: inherit; text-align: left; color: var(--text); border: 1px solid var(--border-strong); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); cursor: pointer; }
.mw-barcard.is-late { border-color: var(--error); }
.mw-barcard.from-before { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.mw-barcard.goes-on { border-right-style: dashed; }
.mw-bartitle { font-weight: 600; overflow-wrap: anywhere; }
.mw-barmeta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.mw-barmeta .is-late { color: var(--error-text); font-weight: 600; }
.mw-nobars, .mw-foot { padding: 12px 14px; font-size: 13px; }

/* ---- Board ---- */

.bd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.bd-head h1 { margin: 0; }
.bd-head p { margin: 0; }
.bd-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.bd-seg { display: inline-flex; margin: 0; }
.bd-seg .seg { padding: 5px 12px; }
.bd-label { font-size: 12px; }
.bd-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.bd-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd-group + .bd-group { padding-left: 18px; border-left: 1px solid var(--border); }
.bd-filter-btn { margin-left: auto; }
.btn.is-on { color: var(--primary-darker); background: var(--primary-tint); border-color: var(--primary); }
.bd-filter { margin-bottom: 12px; padding: 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.bd-filter[hidden] { display: none; }
.bd-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; margin-bottom: 8px; }
.bd-filter-grid .form-group { margin: 0; }
.bd-scroll { overflow-x: auto; padding-bottom: 8px; }
#bd-board { min-width: min-content; }
.bd-heads, .bd-cells { display: grid; gap: 10px; }
.bd-head { padding: 8px 12px; font-weight: 600; border-top: 3px solid var(--border-strong); border-radius: var(--radius-sm); }
.bd-lane { margin-top: 10px; }
.bd-lane-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; font: inherit; text-align: left; color: inherit; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.bd-lane-head:hover { border-color: var(--primary); }
.bd-lane.is-standup .bd-lane-head { background: var(--primary-tint); border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-tint); }
.standup-tag { color: var(--primary-darker); background: #ffffff; border: 1px solid var(--primary); font-weight: 700; }
.bd-chev { width: 14px; color: var(--text-muted); }
.bd-flags { display: inline-flex; gap: 6px; margin-left: auto; }
.bd-loadbar { display: inline-block; width: 90px; height: 6px; overflow: hidden; background: var(--border); border-radius: 999px; }
.bd-loadbar i { display: block; height: 100%; }
.bd-loadbar.is-room i { background: var(--success); }
.bd-loadbar.is-nearing i { background: var(--warning); }
.bd-loadbar.is-over i { background: var(--error); }
.bd-loadtext { font-size: 12px; }
.bd-loadtext.is-over { color: var(--error-text); }
.bd-loadtext.is-nearing { color: var(--warning-text); }
.bd-loadtext.is-room { color: var(--success-text); }
.bd-cells { margin-top: 8px; }
.bd-cell { display: flex; flex-direction: column; gap: 8px; min-height: 48px; padding: 6px; background: var(--bg-page); border-radius: var(--radius-sm); }
.bd-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; font: inherit; text-align: left; color: inherit; background: var(--bg-surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.bd-card:hover { border-color: var(--primary); }
.bd-card.is-held { background: repeating-linear-gradient(135deg, var(--bg-surface), var(--bg-surface) 8px, var(--warning-tint) 8px, var(--warning-tint) 16px); }
.bd-ctop, .bd-cfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bd-cfoot > .avatar, .bd-cfoot > .avatar-stack { margin-left: auto; }
.avatar-stack { display: inline-flex; flex: none; align-items: center; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--bg-surface); }
.avatar-stack .avatar + .avatar { margin-left: -9px; }
.bd-ctitle { font-weight: 600; overflow-wrap: anywhere; }
.bd-epic { font-size: 12px; }
.bd-due { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.bd-due.is-late { color: var(--error-text); }
.bd-meta { font-size: 12px; color: var(--text-tertiary); }
.bd-card.is-compact { flex-direction: row; align-items: center; gap: 8px; padding: 6px 10px; }
.bd-card.is-compact .bd-ctitle { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.bd-dot { width: 9px; height: 9px; flex: none; background: var(--error); border-radius: 50%; }
.bd-more { align-self: flex-start; }
.bd-empty { margin-top: 12px; text-align: center; }
.bd-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 16px; font-size: 12px; }
.bd-legend-title { font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bd-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.bd-help { font-size: 12px; }
.tag-warn { color: var(--warning-text); background: var(--warning-tint); }
.avatar-sm { width: 22px; height: 22px; font-size: 10px; }

/* Board interaction: drag, menu, link dot, focus, quick add */
.bd-card { position: relative; }
.bd-cardmain { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; padding: 0; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.bd-card.is-compact { padding-right: 32px; }
.bd-card.is-compact .bd-cardmain { flex-direction: row; align-items: center; gap: 8px; }
.bd-card .bd-ctop { padding-right: 24px; }
.bd-card.can-drag { cursor: grab; }
.bd-card.is-dragging { opacity: 0.4; }
.bd-card.is-dim { opacity: 0.35; filter: blur(1px); }
.bd-card.is-selected { outline: 2px solid var(--primary); }
.bd-card.is-linktarget { outline: 2px dashed var(--primary); }
.bd-menu { position: absolute; top: 6px; right: 6px; z-index: 6; }
.bd-menubtn { display: block; padding: 0 6px; line-height: 20px; list-style: none; color: var(--text-tertiary); border-radius: 6px; cursor: pointer; }
.bd-menubtn::-webkit-details-marker { display: none; }
.bd-menubtn:hover, .bd-menu[open] .bd-menubtn { background: var(--bg-page); }
.bd-menulist { position: absolute; right: 0; z-index: 20; display: flex; flex-direction: column; gap: 2px; min-width: 190px; padding: 4px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: 0 6px 20px rgba(28, 28, 28, 0.15); }
.bd-menuitem { padding: 6px 8px; font: inherit; text-align: left; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.bd-menuitem:hover { background: var(--bg-page); }
.bd-give { padding: 4px 6px; }
.bd-linkdot { position: absolute; top: 50%; right: -7px; width: 12px; height: 12px; background: var(--primary); border: 2px solid var(--bg-surface); border-radius: 50%; cursor: crosshair; opacity: 0; }
.bd-card:hover .bd-linkdot, .bd-card:focus-within .bd-linkdot { opacity: 1; }
.bd-cell.is-over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.bd-dropline { flex: none; height: 3px; background: var(--primary); border-radius: 2px; }
.bd-add { align-self: flex-start; opacity: 0; }
.bd-cell:hover .bd-add, .bd-cell:focus-within .bd-add, .bd-add:focus { opacity: 1; }
.bd-addform { display: flex; align-items: center; gap: 6px; }
.bd-addform .form-input { flex: 1; min-width: 0; }
#bd-board { position: relative; }
.bd-lines { position: absolute; top: 0; left: 0; z-index: 5; pointer-events: none; }
.bd-line { fill: none; stroke: var(--primary-dark); stroke-width: 2; }
.bd-line.is-related { stroke: var(--text-muted); stroke-dasharray: 5 4; }
.bd-line.is-subtask { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 3 3; }
.bd-subcard { position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0 0 6px 14px; padding: 6px 10px; font-size: 12px; background: var(--bg-page); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius-sm); }
.bd-subcard .bd-cardmain { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 0; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.bd-subcard .bd-ctop { display: flex; align-items: center; gap: 6px; }
.bd-subcard .bd-ctitle { font-weight: 500; }
.bd-subcard .avatar { align-self: flex-end; }
.bd-subcard.is-done .bd-ctitle { text-decoration: line-through; color: var(--text-tertiary); }
.bd-subcard.is-compact { flex-direction: row; align-items: center; padding: 4px 8px; }
.bd-subcard.is-compact .bd-cardmain { flex-direction: row; align-items: center; gap: 6px; }
.bd-subcard.is-compact .bd-ctitle { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bd-subcard.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-tint); }
.bd-subcard.is-dim { opacity: 0.45; }
.bd-arrowtip { fill: var(--primary-dark); }

/* ---- Delete ticket ---- */

.danger-zone { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--border); }
.danger-zone p { margin: 0 0 8px; }
.btn-danger { color: #ffffff; background: var(--error); border-color: var(--error); }
.btn-danger:hover { background: #c9442d; }
.btn-danger-text { color: var(--error-text); }

/* ---- Workload ---- */

.wl-summary { margin: 12px 0 8px; font-weight: 600; }
.wl-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.wl-seg { display: inline-flex; margin: 0; }
.wl-seg .seg { padding: 5px 12px; }
.wl-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; font-size: 13px; }
.wl-key { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.wl-key.is-over { background: var(--error); }
.wl-key.is-nearing { background: var(--warning); }
.wl-key.is-room { background: var(--success); }
.wl-help { font-size: 12px; max-width: 80ch; }
.wl-group { margin: 20px 0; }
.wl-group-title { margin: 0 0 10px; font-size: 16px; }
.wl-over-note { color: var(--error-text); font-weight: 400; font-size: 13px; }
.wl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wl-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; font: inherit; text-align: left; color: inherit; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.wl-card:hover, .wl-card.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-tint); }
.wl-card.is-over { background: var(--error-tint); border-color: #f1c4b9; }
.wl-card.is-nearing { background: var(--warning-tint); border-color: #f0d9aa; }
.wl-who { display: flex; align-items: center; gap: 10px; }
.wl-role { display: block; font-size: 12px; }
.wl-figures { display: flex; align-items: center; gap: 16px; }
.wl-fig { display: flex; flex-direction: column; }
.wl-big { font-size: 24px; line-height: 1.1; }
.wl-big.is-over { color: var(--error-text); }
.wl-big.is-nearing { color: var(--warning-text); }
.wl-big.is-room { color: var(--success-text); }
.wl-figures .wl-ring { margin-left: auto; }
.wl-ring-track { stroke: var(--border-strong); }
.wl-ring-text { font-size: 12px; font-weight: 700; fill: var(--text); }
.wl-ring.is-over .wl-ring-value { stroke: var(--error); }
.wl-ring.is-nearing .wl-ring-value { stroke: var(--warning); }
.wl-ring.is-room .wl-ring-value { stroke: var(--success); }
.wl-pill { align-self: flex-start; padding: 2px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.wl-pill.is-over { color: var(--error-text); background: #f8d9d1; }
.wl-pill.is-nearing { color: var(--warning-text); background: #fae6bd; }
.wl-pill.is-room { color: var(--success-text); background: var(--success-tint); }
.wl-statusbar { display: flex; height: 8px; overflow: hidden; background: var(--border); border-radius: 999px; }
.wl-statusbar i { display: block; height: 100%; }
.wl-statusrows { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px solid var(--border); }
.wl-statusrow { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.wl-pts { margin-left: auto; }
.wl-none { font-size: 13px; }

.wl-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100vw); padding: 16px; overflow-y: auto; background: var(--bg-surface); border-left: 1px solid var(--border-strong); box-shadow: -8px 0 24px rgba(28, 28, 28, 0.1); }
.wl-panel[hidden] { display: none; }
.wl-phead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wl-phead p { margin: 0; }
.wl-phead .wl-pill { margin-left: auto; }
.wl-inuse { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 8px 0; }
.wl-inuse .text-secondary { margin-left: auto; font-size: 12px; }
.wl-sub { margin: 16px 0 6px; font-size: 13px; color: var(--text-tertiary); }
.wl-weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.wl-wk { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.wl-wkbar { display: flex; align-items: flex-end; width: 100%; height: 56px; border-bottom: 2px solid var(--text); }
.wl-wkbar i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; }
.wl-wk.is-over .wl-wkbar i { background: var(--error); }
.wl-wk.is-nearing .wl-wkbar i { background: var(--warning); }
.wl-wk.is-room .wl-wkbar i { background: var(--success); }
.wl-handoff { margin: 14px 0; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--error); border-radius: var(--radius-sm); }
.wl-group-box { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.wl-group-head { display: flex; align-items: center; gap: 4px; padding: 8px 10px; background: var(--bg-page); }
.wl-group-head .text-secondary { margin-left: auto; font-size: 12px; }
.wl-ticket { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; font: inherit; text-align: left; color: inherit; background: none; border: 0; border-top: 1px solid var(--border); cursor: pointer; }
.wl-ticket:hover { background: var(--bg-page); }
.wl-ttitle { flex: 1; min-width: 120px; overflow-wrap: anywhere; }
.wl-capacity { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.wl-capacity .text-secondary { margin-right: auto; }

/* Capacity warning in the ticket form */
.cap-hint { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.cap-line { margin: 0; padding: 6px 10px; font-size: 13px; border-radius: var(--radius-sm); }
.cap-line.is-room { color: var(--success-text); background: var(--success-tint); }
.cap-line.is-nearing { color: var(--warning-text); background: var(--warning-tint); }
.cap-line.is-over { color: var(--error-text); background: var(--error-tint); }

.tf-folded > summary { padding: 8px 12px; cursor: pointer; }
.tf-folded > .tf-row { padding: 0 12px 12px; }
.tf-folded[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }

/* ---- Sprints ---- */

.sp-tabnote { font-size: 12px; font-weight: 400; }
.sp-head { margin-bottom: 16px; }
.sp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.sp-name { font-size: 20px; }
.sp-pill { padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--primary-darker); background: var(--primary-tint); border-radius: 999px; }
.sp-pill.is-active { color: var(--success-text); background: var(--success-tint); }
.sp-headgrid { display: grid; grid-template-columns: 1fr minmax(220px, auto); gap: 16px 32px; align-items: start; }
.sp-label { display: inline-block; margin-right: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; color: var(--text-muted); }
.sp-headgrid .form-input { width: 100%; margin-top: 4px; }
.sp-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.sp-when .form-input { width: auto; margin-top: 0; }
.sp-seg { display: inline-flex; margin: 0; }
.sp-seg .seg { padding: 5px 12px; }
.sp-startbox { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.sp-startbox p { margin: 0; }
.sp-planned strong { font-size: 22px; color: var(--primary-dark); }
.sp-blocked { max-width: 240px; font-size: 13px; }
.sp-goal { margin: 0 0 8px; }

.sp-plan { display: grid; grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 1fr) minmax(260px, 0.9fr); gap: 16px; align-items: start; }
.sp-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--bg-page); border-radius: var(--radius); }
.sp-panel.sp-sprint { background: var(--primary-tint); border: 1px dashed var(--primary); }
.sp-panel.sp-capacity { background: var(--bg-surface); border: 1px solid var(--border); }
.sp-panel.is-over { outline: 2px dashed var(--primary); }
.sp-panelhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sp-panelhead .btn { margin-left: auto; }
.sp-sprinttitle { color: var(--primary-darker); }
.sp-help { margin: 0; font-size: 12px; }
.sp-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.sp-empty { padding: 12px; text-align: center; }
.sp-card { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); }
.sp-card[draggable="true"] { cursor: grab; }
.sp-card.is-dragging { opacity: 0.4; }
.sp-card.is-blocked { border-left-color: var(--border-strong); }
.sp-cardmain { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; padding: 0; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.sp-cardtop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.sp-cardtitle { font-weight: 600; overflow-wrap: anywhere; }
.sp-problem { font-size: 12px; font-weight: 600; color: var(--warning-text); }
.sp-points { min-width: 26px; padding: 2px 6px; text-align: center; font-weight: 600; background: var(--bg-page); border: 1px solid var(--border-strong); border-radius: 6px; }

.sp-person { padding: 10px 0; border-top: 1px solid var(--border); }
.sp-personhead { display: flex; align-items: center; gap: 8px; }
.sp-pts { margin-left: auto; font-weight: 600; }
.sp-pts.is-over { color: var(--error-text); }
.sp-capbar { display: flex; height: 8px; margin: 8px 0 4px; overflow: hidden; background: var(--border); border-radius: 999px; }
.sp-capbar i { display: block; height: 100%; }
.sp-capbar .sp-other { background: #9a9da1; }
.sp-capbar .sp-planned-bar { background: var(--primary); }
.sp-capbar.is-over .sp-planned-bar { background: var(--error); }
.sp-personmeta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.sp-days { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Sprints: Current tab and dialogs ---- */

.btn-dark { color: #ffffff; background: var(--text); border-color: var(--text); }
.btn-dark:hover { background: #000000; }
.sp-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.sp-alldone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 12px 16px; background: var(--success-tint); border: 1px solid var(--success); border-radius: var(--radius); }
.sp-show { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.sp-progress { margin-bottom: 16px; }
.sp-progresshead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.sp-percent { font-size: 20px; color: var(--primary-dark); }
.sp-pace.is-behind { color: var(--error-text); }
.sp-pace.is-on_track { color: var(--success-text); }
.sp-daysleft { margin-left: auto; }
.sp-scope { margin: 0 0 10px; color: var(--warning-text); }
.sp-progressbar { position: relative; display: flex; height: 14px; overflow: hidden; background: var(--border); border-radius: 999px; }
.sp-progressbar .sp-seg-part { display: block; height: 100%; }
.sp-marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.sp-marker-key { display: inline-block; width: 2px; height: 12px; background: var(--text); }
.sp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 13px; }
.sp-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.sp-changes { margin-bottom: 16px; }
.sp-subhead { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.05em; color: var(--warning-text); }
.sp-change { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.sp-change:first-of-type { border-top: 0; }
.sp-changelabel { font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--warning-text); }
.sp-change.is-removed .sp-changelabel { color: var(--text-tertiary); }
.sp-linkbtn { padding: 0; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.sp-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 10px; }
.sp-pcard { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sp-pcard.is-over { border-color: var(--error); }
.sp-room { display: block; font-size: 12px; }
.sp-figures { display: flex; align-items: center; gap: 16px; }
.sp-fig { display: flex; flex-direction: column; }
.sp-big { font-size: 22px; line-height: 1.1; }
.sp-big.is-done { color: var(--primary-dark); }
.sp-figures .sp-ring { margin-left: auto; }
.sp-ring-track { stroke: var(--border-strong); }
.sp-ring-value { stroke: var(--primary); }
.sp-ring-text { font-size: 11px; font-weight: 700; fill: var(--text); }
.sp-gauge { align-self: flex-start; padding: 2px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.sp-gauge.is-over { color: var(--error-text); background: #f8d9d1; }
.sp-gauge.is-nearing { color: var(--warning-text); background: #fae6bd; }
.sp-gauge.is-room { color: var(--success-text); background: var(--success-tint); }
.sp-statusbar { display: flex; height: 6px; overflow: hidden; background: var(--border); border-radius: 999px; }
.sp-statusbar i { display: block; height: 100%; }
.sp-statusrows { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px solid var(--border); }
.sp-statusrow { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sp-columns { display: grid; gap: 12px; margin-top: 16px; overflow-x: auto; }
.sp-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border-top: 3px solid var(--border-strong); border-radius: var(--radius-sm); }
.sp-colhead { display: flex; align-items: center; gap: 8px; }
.sp-colpts { margin-left: auto; font-size: 12px; }
.sp-mini { display: flex; align-items: center; gap: 6px; padding: 7px 9px; font: inherit; text-align: left; color: inherit; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.sp-mini.is-held { background: repeating-linear-gradient(135deg, var(--bg-surface), var(--bg-surface) 8px, var(--warning-tint) 8px, var(--warning-tint) 16px); }
.sp-minititle { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-added { font-weight: 700; color: var(--warning-text); }
.sp-closestats { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 14px; }
.sp-stat { display: flex; flex-direction: column; }
.sp-stat strong { font-size: 22px; }
.sp-closelist { display: flex; flex-direction: column; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 40vh; overflow-y: auto; }
.sp-closerow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.sp-closerow:last-child { border-bottom: 0; }
.sp-closerow .form-input { width: auto; min-width: 120px; }
.sp-closerow .sp-seg { margin-left: auto; flex-shrink: 0; }

/* ---- Sprints: History, tags and the My work sprint bar ---- */

.sprint-tag { color: var(--primary-dark); background: var(--primary-tint, #e0f2f1); font-weight: 600; }
.sprint-expected { font-weight: 500; opacity: 0.85; }
.pj-forecast { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-histstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.sp-histstats .sp-stat { padding: 14px 16px; }
.sp-chartcard { margin-bottom: 16px; overflow-x: auto; }
.sp-chartkey { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-bottom: 8px; }
.sp-chart { display: block; max-width: 100%; height: auto; }
.sp-grid { stroke: var(--border); stroke-width: 1; }
.sp-axis { font-size: 11px; fill: var(--text-secondary); }
.sp-bar-committed { fill: var(--border-strong); background: var(--border-strong); }
.sp-bar-done { fill: var(--primary); background: var(--primary); }
.sp-average { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; }
.sp-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.sp-swatch-line { height: 0; width: 16px; border-top: 2px dashed var(--text); border-radius: 0; background: none; }
.sp-histlist { overflow-x: auto; }
.sp-teamchips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.mw-sprint { margin-bottom: 16px; padding: 14px 16px; }
.mw-sprint-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.mw-sprint-link { color: inherit; text-decoration: none; }
.mw-sprint-link:hover strong { text-decoration: underline; }
.mw-sprint-pace.is-behind { color: var(--error-text); }
.mw-sprint-pace.is-on_track { color: var(--success-text); }
.mw-sprint-goal { margin: 4px 0 0; }
.mw-sprint-track { position: relative; height: 10px; margin: 10px 0 6px; background: var(--border); border-radius: 999px; }
.mw-sprint-fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--primary); border-radius: 999px; }
.mw-sprint-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.mw-sprint-detail { margin: 0; font-size: 13px; }

.sp-minigroup { display: flex; flex-direction: column; }
.sp-minisubs { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 6px 18px; }
.sp-sublines { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.sp-subline { font-size: 12px; }
.sp-subline.is-done { text-decoration: line-through; color: var(--text-tertiary); }
.sp-subtick { display: inline-block; width: 14px; }
.sp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp-subchip { align-self: flex-start; }
.sp-swaprow { align-items: flex-start; }
.sp-swapmain { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.sp-swaptop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sp-swaprow.is-blocked { background: var(--warning-tint); }
.sp-swaprow .sp-problem { color: var(--warning-text); font-size: 12px; }

/* ---- Following, Updates and the bell ---- */

.mw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.mw-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px; align-self: start; min-width: 0; }
.mw-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.mw-updates-scroll { max-height: min(56vh, 520px); margin-right: -6px; padding-right: 6px; }
.mw-follows-scroll { max-height: min(30vh, 260px); }
.mw-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mw-more-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 4px 0 8px; }
.mw-count { font-size: 12px; }
.mw-more-row .link-btn { font-size: 13px; }
.mw-side[hidden] { display: none; } /* display:flex would otherwise win over the hidden attribute */
.mw-side-card { padding: 14px 16px; }
.mw-side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mw-side-head .link-btn { margin-left: auto; }
.mw-badge { min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; color: #ffffff; background: var(--primary-dark); border-radius: 999px; }
.mw-side-sub { margin: 10px 0 4px; font-size: 11px; letter-spacing: 0.05em; }
.mw-updates, .mw-follows { margin: 0; padding: 0; list-style: none; }
.mw-update + .mw-update { border-top: 1px solid var(--border); }
.mw-update-main { display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 8px 0; font: inherit; text-align: left; color: inherit; background: none; border: 0; cursor: pointer; }
.mw-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; background: var(--primary); border-radius: 50%; }
.mw-dot.is-off { background: transparent; }
.mw-update-text { display: flex; flex-direction: column; min-width: 0; }
.mw-update.is-new .mw-update-line { font-weight: 600; }
.mw-update-snippet, .mw-update-meta { font-size: 12px; overflow-wrap: anywhere; }
.mw-follow { padding: 8px 0; }
.mw-follow + .mw-follow { border-top: 1px solid var(--border); }
.mw-follow-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.mw-follow-link:hover strong { text-decoration: underline; }
.mw-follow-bar { height: 6px; margin: 6px 0 4px; overflow: hidden; background: var(--border); border-radius: 999px; }
.mw-follow-bar i { display: block; height: 100%; background: var(--primary); }
.mw-follow-meta { font-size: 12px; }
.mw-unfollow { display: block; margin-top: 4px; font-size: 12px; }
.hold-inline { display: inline-flex; }
.panel-title-field { margin: 4px 0; }
.panel-title-input { width: 100%; padding: 4px 6px; margin-left: -6px; font: inherit; font-size: 20px; font-weight: 700; color: inherit; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); }
.panel-title-input:hover { border-color: var(--border); }
.panel-title-input:focus { background: var(--bg-surface); border-color: var(--primary); outline: none; }
.panel-title-field.is-invalid .panel-title-input { border-color: var(--error); }
.follow-bell.is-on { color: var(--primary-dark); }
.follow-menu { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.follow-check { display: flex; align-items: center; gap: 4px; font-size: 13px; }
@media (max-width: 1100px) { .mw-layout { grid-template-columns: minmax(0, 1fr); } .mw-side { position: static; } .mw-updates-scroll { max-height: 60vh; } }

/* ---- Team view ---- */

.mw-layout.is-team { grid-template-columns: minmax(0, 1fr); }
.tm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.tm-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tm-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.tm-count { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; font: inherit; text-align: left; color: inherit; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.tm-count-n { font-size: 22px; line-height: 1; }
.tm-count.is-alert .tm-count-n { color: var(--error-text); }
.tm-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tm-card { padding: 12px 14px; }
.tm-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.tm-head .link-btn { margin-left: auto; }
.tm-list { margin: 0; padding: 0; list-style: none; }
.tm-person { display: grid; grid-template-columns: 28px minmax(0, 1fr) 70px auto; align-items: center; gap: 8px; padding: 4px 0; }
.tm-person-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-person-pts { font-size: 12px; white-space: nowrap; }
.tm-bar { display: block; height: 6px; overflow: hidden; background: var(--border); border-radius: 999px; }
.tm-bar i { display: block; height: 100%; background: var(--primary); }
.tm-person.is-nearing .tm-bar i { background: var(--warning-text); }
.tm-person.is-over .tm-bar i { background: var(--error); }
.tm-note { margin: 6px 0 0; font-size: 12px; }
.tm-note.is-over { color: var(--error-text); font-weight: 600; }
.tm-more { display: inline-block; margin-top: 6px; font-size: 13px; }
.tm-work { padding: 4px 0; }
.tm-work-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.tm-work-link:hover strong { text-decoration: underline; }
.tm-work-meta { display: block; font-size: 12px; }
.tm-work .tm-bar { margin: 4px 0 2px; }
.tm-tabs { display: flex; gap: 2px; margin-bottom: 6px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tm-tab { flex: 0 0 auto; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-tertiary); white-space: nowrap; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.tm-tab.is-active { color: var(--primary-darker); border-bottom-color: var(--primary-dark); }
.tm-row + .tm-row { border-top: 1px solid var(--border); }
.tm-row-main { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 0; font: inherit; text-align: left; color: inherit; text-decoration: none; background: none; border: 0; cursor: pointer; }
.tm-row-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-risk { align-items: flex-start; }
.tm-risk-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tm-risk-reason { font-size: 13px; color: var(--error-text); }
.tm-risk-meta { font-size: 12px; }
.tm-late { font-size: 12px; font-weight: 600; color: var(--error-text); white-space: nowrap; }
.tm-feed-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.tm-showall { margin-top: 6px; }
@media (max-width: 1100px) { .tm-grid { grid-template-columns: minmax(0, 1fr); } .tm-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tm-pair { grid-template-columns: minmax(0, 1fr); } }

/* ---- Digest ---- */

.mw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mw-tools .mw-views { margin-bottom: 0; }
.dg-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 14px; }
.dg-channels { margin: 0; }
.dg-test-result { margin: 0 0 12px; font-size: 13px; }
.dg-schedule { font-size: 13px; }
.dg-toggle { margin-left: auto; font-weight: 600; color: var(--primary-dark); }
.dg-preview { margin-bottom: 12px; overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.dg-strip { margin: 0; padding: 8px 16px; font-size: 13px; background: var(--bg-page); border-bottom: 1px solid var(--border); }
.dg-body { padding: 16px; }
.dg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dg-icon { flex-shrink: 0; width: 36px; height: 36px; background: var(--primary); border-radius: 8px; position: relative; }
.dg-icon::before, .dg-icon::after { content: ""; position: absolute; left: 10px; height: 2px; background: #ffffff; border-radius: 1px; }
.dg-icon::before { top: 13px; width: 16px; box-shadow: 0 5px 0 #ffffff; }
.dg-icon::after { top: 23px; width: 10px; }
.dg-title { font-size: 16px; }
.dg-week { margin: 0; font-size: 13px; }
.dg-block { margin-bottom: 12px; }
.dg-block-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.dg-block-title.is-late { color: var(--error-text); }
.dg-block-title.is-warn { color: var(--warning-text); }
.dg-rows { margin: 0; padding: 0; list-style: none; }
.dg-row { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; }
.dg-row-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dg-row-note { flex-shrink: 0; font-size: 12px; color: var(--text-tertiary); text-align: right; }
.dg-row-note.is-late { color: var(--error-text); }
.dg-more { margin: 2px 0 0; font-size: 12px; }
.dg-note-box { margin: 8px 0 0; padding: 12px 16px; background: var(--bg-page); border-radius: var(--radius); }
.dg-notes-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.dg-following-title { margin-top: 10px; }
.dg-notes { margin: 0; padding: 0 0 0 18px; font-size: 13px; }
.dg-note { margin: 0 0 12px; padding: 8px 10px; font-size: 13px; color: var(--warning-text); background: var(--warning-tint); border-radius: var(--radius-sm); }

/* ---- Side panels share the screen with the page ----
   A ticket panel (and the Workload person panel) sit on the right and the page shrinks to the
   space that is left, instead of the panel covering it. On narrow screens they overlay. */

@media (min-width: 901px) {
  body.ticket-open .app { margin-right: min(420px, 100vw); }
  body.wl-open .app { margin-right: min(420px, 100vw); }
  body.ticket-open.wl-open .app { margin-right: calc(2 * min(420px, 100vw)); }
  /* With both open, the person overview sits beside the ticket, not behind it. */
  body.ticket-open .wl-panel { right: min(420px, 100vw); }
}
body.ticket-open .ticket-panel { z-index: 50; }

/* ---- Responsive ---- */

@media (max-width: 1100px) {
  .main-content { padding: 28px 28px; }
}

@media (max-width: 900px) {
  .app,
  .app[data-sidebar="collapsed"] { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 20px 16px; }
}

/* ---- Roadmap ---- */
.rm-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rm-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rm-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rm-label { font-size: 12px; }
.rm-filter { margin-bottom: 12px; padding: 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rm-filter[hidden] { display: none; }
.rm-filter-btn.is-on { background: var(--primary-tint, #e0f2f1); border-color: var(--primary); color: var(--primary-dark); }
.rm-now { min-width: 120px; justify-content: center; font-weight: 600; }
.rm-bar.is-dragging { cursor: grabbing; opacity: 0.9; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); z-index: 4; }
.rm-drag-tip { position: absolute; left: 0; top: -22px; padding: 1px 6px; font-size: 11px; white-space: nowrap; color: #fff; background: #1C1C1C; border-radius: 4px; pointer-events: none; }
.rm-nav { display: inline-flex; align-items: center; gap: 4px; }
/* Today, Month, Quarter and Year sit on one row (the shared .segmented grid has three columns). */
.rm-scales { display: inline-grid; grid-template-columns: repeat(4, auto); gap: 4px; }
.rm-scales .seg { padding: 5px 12px; white-space: nowrap; }
.rm-switch.is-on { background: var(--primary-tint, #e0f2f1); border-color: var(--primary); color: var(--primary-dark); }
.rm-completed { width: auto; min-width: 170px; }
.rm-frame { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff); }
.rm-frame:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rm-grid { min-width: 900px; position: relative; }
.rm-row { display: grid; grid-template-columns: var(--rm-left, 260px) minmax(0, 1fr); min-height: 34px; border-bottom: 1px solid var(--border); }
.rm-head { position: sticky; top: 0; z-index: 3; background: var(--surface, #fff); min-height: 30px; }
.rm-label { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 4px 10px; min-width: 0; background: var(--surface, #fff); border-right: 1px solid var(--border); }
.rm-project .rm-label { font-weight: 600; background: inherit; }
/* The project name always shows: the health tag and progress wrap onto a second line instead of squeezing it out. */
/* A project's label: the name on its own line(s), then one tidy line of indicators, then a thin progress bar. */
.rm-project .rm-plabel { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 10px; }
.rm-pline { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.rm-pline .rm-name { flex: 1 1 auto; white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; line-height: 1.25; }
.rm-pline .swatch-dot { margin-top: 5px; flex: 0 0 auto; }
.rm-pinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-left: 30px; }
.rm-pinfo .rm-meta { font-weight: 400; }
.rm-mini { height: 4px; margin-left: 30px; overflow: hidden; background: var(--border); border-radius: 999px; }
.rm-mini i { display: block; height: 100%; border-radius: 999px; }
.rm-tip { position: fixed; z-index: 95; width: max-content; max-width: 320px; padding: 10px 12px; font-size: 12px; line-height: 1.4; color: var(--text); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(28, 28, 28, 0.18); pointer-events: none; }
.rm-tip[hidden] { display: none; }
.rm-tip-line { margin: 0 0 3px; }
.rm-tip-line.is-title { font-weight: 700; margin-top: 6px; }
.rm-tip-line.is-title:first-child { margin-top: 0; }
.rm-tip-line.is-muted { color: var(--text-tertiary); }
.rm-tip-line.is-late { color: var(--error-text); }
.rm-nodates { position: absolute; left: 12px; top: 8px; font-size: 12px; }
.rm-project .rm-pbar { height: 22px; top: 4px; border-radius: 6px; cursor: default; }
.rm-project .rm-pbar.is-movable { cursor: grab; }
.rm-project .rm-milestone { top: 4px; z-index: 3; line-height: 22px; font-size: 18px; color: var(--text); text-shadow: 0 0 2px #fff, 0 0 2px #fff; cursor: help; }
.rm-project .rm-milestone.is-late { color: var(--error-text); }
.rm-links { position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none; }
.rm-link { fill: none; stroke: var(--primary-dark, #00758b); stroke-width: 1.5; }
.rm-arrowtip { fill: var(--primary-dark, #00758b); }
.rm-project .rm-health, .rm-project .rm-meta { flex: 0 0 auto; }
/* Project rows are a step darker than the page, so each project reads as a band. */
.rm-project { background: #e3e8eb; background: color-mix(in srgb, var(--text) 8%, var(--bg-surface)); border-top: 1px solid var(--border-strong); }
.rm-project .rm-track { background: inherit; }
.rm-name, .rm-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rm-meta { font-size: 12px; font-weight: 400; white-space: nowrap; }
.rm-track { position: relative; min-height: 34px; touch-action: none; }
.rm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: 0.6; }
.rm-tick-label { position: absolute; top: 6px; margin-left: 4px; font-size: 11px; white-space: nowrap; }
.rm-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); z-index: 1; }
.rm-pbar { position: absolute; top: 9px; height: 16px; border: 1px solid; border-radius: 8px; background: rgba(127, 127, 127, 0.12); overflow: hidden; }
.rm-pfill { position: absolute; left: 0; top: 0; bottom: 0; opacity: 0.45; }
.rm-milestone { position: absolute; top: 7px; transform: translateX(-50%); color: var(--text-secondary); font-size: 16px; line-height: 20px; z-index: 1; }
.rm-milestone.is-late { color: #D6402B; }
.rm-goal { position: absolute; top: 7px; transform: translateX(-50%); color: var(--text-secondary); font-size: 16px; line-height: 20px; z-index: 1; }
.rm-goal.is-at_risk { color: #C98A1A; }
.rm-goal.is-late { color: #D6402B; }
.rm-goal.is-done { color: #4C8F5B; }
.rm-goals-head { margin-top: 8px; }
.rm-bar { position: absolute; top: 6px; height: 16px; border: 2px solid; border-radius: 4px; z-index: 1; box-sizing: border-box; }
.rm-bar.is-outline { background: var(--surface, #fff); }
.rm-bar.is-held { background-image: repeating-linear-gradient(45deg, rgba(232, 161, 58, 0.55) 0 6px, transparent 6px 12px); }
.rm-bar.is-movable { cursor: grab; }
.rm-bar:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rm-bar.is-clip-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.rm-bar.is-clip-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rm-handle { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.rm-handle-start { left: -3px; }
.rm-handle-end { right: -3px; }
.rm-forecast { position: absolute; top: 12px; height: 4px; border-top: 2px dashed; color: #D6402B; z-index: 0; }
.rm-dot { position: absolute; top: 24px; width: 8px; height: 8px; margin-left: -4px; border: 2px solid var(--primary); border-radius: 50%; background: var(--surface, #fff); box-sizing: content-box; z-index: 1; }
.rm-dot.is-done { background: var(--primary); }
.rm-dot.is-late { border-color: #D6402B; }
.rm-dot-big { top: 11px; }
/* Levels: project, then its epics and epic-less tickets one step in, then an epic's tickets another step. */
.rm-ticket .rm-label { padding-left: calc(10px + var(--rm-indent, 0px)); }
/* A ticket's label: key and title, then dates / priority / subtasks, then any status tags, each on its own line. */
.rm-tlabel { flex-direction: column; align-items: stretch; gap: 3px; padding-top: 6px; padding-bottom: 6px; }
.rm-tline { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.rm-tline .ticket-key { flex: 0 0 auto; white-space: nowrap; }
.rm-tline .rm-title { flex: 1 1 auto; }
.rm-tline .avatar, .rm-tline .avatar-stack { flex: none; }
.rm-tinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding-left: 0; }
.rm-status { flex: 0 0 auto; padding: 0 8px; font-size: 11px; white-space: nowrap; }
.rm-ttags { display: flex; flex-wrap: wrap; gap: 4px; }
.rm-ttags .tag, .rm-ttags .fact { white-space: nowrap; }
.rm-subrow .rm-label { padding-left: calc(10px + var(--rm-indent, 0px)); }
.rm-epic { background: var(--bg-page); }
.rm-epic .rm-label { padding-left: calc(6px + var(--rm-indent, 0px)); font-weight: 600; background: inherit; border-left: 4px solid var(--rm-epic-colour, var(--border-strong)); }
.rm-epic .rm-track { background: inherit; }
.pj-overview { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; width: 100%; }
.pj-ostats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; }
.pj-mini { margin-left: 0; }
.rm-dates { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
.rm-epic-tag { flex: 0 0 auto; padding: 0 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 999px; }
.rm-ebar { position: absolute; top: 10px; height: 12px; border: 1px solid; border-radius: 4px; background: rgba(127, 127, 127, 0.1); overflow: hidden; cursor: default; }
.rm-efill { display: block; height: 100%; opacity: 0.45; }
.rm-ticket.is-selected .rm-label { background: var(--primary-tint, #e0f2f1); }
.rm-subchip { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 0 2px; }
.rm-health.is-on_track { color: #1C7A3E; background: #E4F4EA; }
.rm-health.is-at_risk { color: #8A5A00; background: #FFF1D6; }
.rm-health.is-overdue { color: #A8281A; background: #FDE7E4; }
.rm-banner, .rm-empty { padding: 12px; margin: 0; }
.rm-help { margin-top: 12px; font-size: 13px; }
@media (max-width: 900px) { .rm-grid { --rm-left: 190px; } }

/* ---- Plan changes ---- */
.plan-host[hidden] { display: none; }
.plan-host { margin-top: 12px; }
.is-planning .rm-toolbar, .is-planning .rm-filter, .is-planning .rm-frame, .is-planning .rm-help { display: none; }
.rm-plan { padding: 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.plan-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .plan-layout { grid-template-columns: minmax(0, 1fr); } }
.plan-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.plan-note { margin: 0 0 8px; font-size: 13px; }
.plan-left, .plan-right { min-width: 0; }
.plan-left { position: sticky; top: 12px; }
.plan-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-order-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 8px 10px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.plan-order-row.is-fixed { opacity: 0.75; }
.plan-order-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.plan-deliver, .plan-locked { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.plan-date { width: auto; padding: 2px 6px; }
.plan-section { margin-bottom: 18px; }
.plan-tradeoff { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-pill { padding: 6px 10px; border-radius: 6px; background: var(--bg-subtle, #f6f7f8); font-size: 13px; }
.plan-pill.is-warn, .plan-delta.is-warn { color: #8A5A00; }
.plan-pill.is-warn { background: #FFF1D6; }
.plan-pill.is-bad, .plan-delta.is-bad, .plan-knock.is-bad { color: #A8281A; }
.plan-pill.is-bad { background: #FDE7E4; }
.plan-pill.is-good, .plan-delta.is-good, .plan-knock.is-good { color: #1C7A3E; }
.plan-pill.is-good { background: #E4F4EA; }
.plan-ba { display: flex; flex-direction: column; gap: 6px; }
.plan-ba-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 70px; align-items: center; gap: 8px; font-size: 13px; }
.plan-ba-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-ba-track { position: relative; height: 22px; background: var(--bg-subtle, #f6f7f8); border-radius: 4px; }
.plan-bar { position: absolute; height: 8px; border-radius: 4px; }
.plan-bar.is-before { top: 3px; background: #C3C8CC; }
.plan-bar.is-after { top: 11px; }
.plan-bar.is-bad { background: #D6402B; }
.plan-target { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; background: var(--primary); transform: rotate(45deg); }
.plan-delta { font-size: 12px; text-align: right; }
.plan-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.plan-grid th, .plan-grid td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.plan-cell { text-align: center; }
.plan-cell.is-near { background: #FFF1D6; }
.plan-cell.is-over { background: #FDE7E4; color: #A8281A; font-weight: 600; }
.plan-arrow { margin-left: 3px; font-size: 10px; }
.plan-carry, .plan-swap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; font-size: 13px; }
.plan-list { margin: 0; padding-left: 18px; font-size: 13px; }
.plan-sprint-row { list-style: none; margin-left: -18px; margin-bottom: 4px; }
.plan-hint { margin: 0 0 12px; }
.plan-bar-sticky { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08); z-index: 5; }
.plan-reason-label { font-weight: 600; }
.plan-reason { flex: 1 1 280px; min-height: 40px; }
.plan-buttons { display: inline-flex; gap: 8px; margin-left: auto; }
.rm-phandle { cursor: ew-resize; }
.rm-pbar.is-movable { cursor: grab; }
.mw-plan-card { border-left: 3px solid var(--primary); }
.mw-plan-reason { margin: 4px 0; font-size: 13px; }
.mw-plan-list { margin: 0; padding-left: 16px; font-size: 13px; }

.plan-move { margin-bottom: 14px; padding: 10px 12px; background: var(--bg-subtle, #f6f7f8); border: 1px solid var(--border); border-radius: var(--radius); }
.plan-move .form-group { margin: 0 0 8px; }
.plan-move-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-move-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.plan-focus-line { margin: 0 0 4px; font-size: 15px; }
.plan-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; padding: 0; }
.plan-chip { padding: 3px 10px; font-size: 12px; background: var(--bg-subtle, #f6f7f8); border: 1px solid var(--border); border-radius: 12px; }
.plan-focus-target { margin: 6px 0 0; font-weight: 600; }
.plan-focus-target.is-good { color: #1C7A3E; }
.plan-focus-target.is-bad { color: #A8281A; }
.plan-people th[scope="row"] { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-person.has-overlap th[scope="row"] { font-weight: 700; }
.plan-person-toggle { font-weight: inherit; }
.plan-replanned { display: block; font-size: 10px; font-weight: 400; color: var(--text-secondary); }
.plan-collisions > td { padding: 8px 12px; background: var(--bg-subtle, #f6f7f8); white-space: normal; }
.plan-collision { margin-bottom: 8px; }
.plan-collision li.is-focus { font-weight: 600; }
.plan-levers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-lever { padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); }
.plan-lever.is-blocked, .plan-lever.is-split { border-left-color: #E8A13A; }
.plan-lever-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.plan-lever-detail { margin: 4px 0; font-size: 13px; }
.plan-lever-cost { margin: 0 0 6px; font-size: 12px; }
.plan-clears { background: #E4F4EA; color: #1C7A3E; }
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; color: #ffffff; background: var(--primary-dark); border-radius: 999px; }
.app[data-sidebar="collapsed"] .sidebar:not(:hover):not(:focus-within) .nav-count { display: none; }

/* ---- Several tickets (table) ---- */
.modal-box.is-table { width: min(1240px, calc(100vw - 32px)); }
.bt-scroll { overflow: auto; max-height: 52vh; border: 1px solid var(--border); border-radius: 8px; }
.bt-table { border-collapse: separate; border-spacing: 0; min-width: 2000px; width: 100%; font-size: 13px; }
.bt-table th, .bt-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); background: var(--bg-surface); vertical-align: top; text-align: left; }
.bt-table thead th { position: sticky; top: 0; z-index: 3; font-size: 12px; color: var(--text-secondary); background: var(--bg-page); }
.bt-table .bt-handle { position: sticky; left: 0; z-index: 2; width: 92px; min-width: 92px; white-space: nowrap; background: var(--bg-page); }
.bt-table thead .bt-handle { z-index: 4; }
.bt-table td.bt-title, .bt-table th.bt-title { position: sticky; left: 92px; z-index: 2; min-width: 240px; box-shadow: 1px 0 0 var(--border); }
.bt-table thead th.bt-title { z-index: 4; background: var(--bg-page); }
.bt-defaults th, .bt-defaults td { background: var(--primary-tint); border-bottom: 2px solid var(--border-strong); }
.bt-defaults .bt-handle { white-space: normal; font-weight: 600; color: var(--primary-darker); }
.bt-input { width: 100%; min-width: 120px; padding: 5px 6px; font-size: 13px; }
.bt-text { min-width: 220px; min-height: 30px; resize: vertical; }
.bt-description, .bt-table th.bt-description { min-width: 230px; }
.bt-hint { display: block; margin-top: 2px; font-size: 11px; }
.bt-num { display: inline-block; min-width: 20px; color: var(--text-muted); }
.bt-indent { margin-left: 4px; }
.bt-indent.is-on { color: var(--primary-darker); background: var(--primary-tint); }
.bt-row.is-sub .bt-title input { margin-left: 18px; width: calc(100% - 18px); }
.bt-cell.is-off { opacity: 0.45; }
.bt-assignee_ids, .bt-table th.bt-assignee_ids { min-width: 190px; }
.bt-people summary { padding: 4px 8px; font-size: 13px; }
.bt-cell.is-off .bt-people { pointer-events: none; }
.bt-cell.has-error .form-input { border-color: var(--error); background: var(--error-tint); }
.bt-tools { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.bt-errors .auth-error { margin: 4px 0; }

/* ---- Goals ---- */
.gl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.gl-section { margin-bottom: 24px; }
.gl-heading { margin: 0 0 6px; font-size: 1.1rem; }
.gl-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.gl-card { padding: 14px 16px; min-width: 0; }
.gl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gl-name { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.gl-meta { margin: 2px 0 8px; font-size: 0.85rem; }
.gl-who { margin: 12px 0 6px; font-size: 0.95rem; }
.gl-progress { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.gl-bar { height: 8px; background: var(--bg-page); border-radius: 999px; overflow: hidden; }
.gl-fill { display: block; height: 100%; background: var(--primary); }
.gl-fill.gl-at_risk { background: #C98A1A; }
.gl-fill.gl-late { background: #D0554A; }
.gl-fill.gl-done { background: #4C8F5B; }
.gl-tag-at_risk { background: #fdf3df; color: #8a5a00; }
.gl-tag-late { background: var(--error-tint); color: var(--error-text); }
.gl-tag-done { background: #e6f4ea; color: #1e6b34; }
.gl-tickets { margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.gl-ticket { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.gl-ticket.is-done .link-btn:first-child { text-decoration: line-through; }
.gl-link { display: flex; gap: 8px; margin-bottom: 8px; }
.gl-link .form-input { flex: 1; min-width: 0; }
.gl-form { padding: 14px 16px; margin-bottom: 16px; }
.gl-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.gl-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Ideas ---- */
.id-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.id-filters { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); max-width: 520px; margin: 12px 0; }
.id-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.id-card { padding: 14px 16px; }
.id-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.id-title { margin: 0; font-size: 1rem; }
.id-meta { margin: 2px 0 8px; font-size: 0.85rem; }
.id-details { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.id-outcome { margin: 0 0 8px; font-weight: 500; }
.id-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.id-form { max-width: 760px; margin: 12px 0; padding: 16px; }
.id-triage { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.id-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.id-empty { padding: 16px 0; }

/* ---- Insights ---- */
.ins-controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.ins-controls .form-input { width: auto; }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.ins-card { padding: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.ins-title { margin: 0 0 2px; font-size: 1rem; }
.ins-hint, .ins-note { margin: 0 0 10px; font-size: 0.85rem; }
.ins-chart { width: 100%; height: auto; display: block; }
.ins-axis { stroke: var(--border-strong); stroke-width: 1; }
.ins-mark { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.ins-tick, .ins-value { font-size: 10px; fill: var(--text-secondary); }
.ins-s0 { fill: #00A7C1; background: #00A7C1; }
.ins-s1 { fill: #4C8F5B; background: #4C8F5B; }
.ins-s2 { fill: #C98A1A; background: #C98A1A; }
.ins-s3 { fill: #8B5FBF; background: #8B5FBF; }
.ins-s4 { fill: #D0554A; background: #D0554A; }
.ins-s5 { fill: #8F9397; background: #8F9397; }
.ins-state-room { fill: #4C8F5B; }
.ins-state-nearing { fill: #C98A1A; }
.ins-state-over { fill: #D0554A; }
.ins-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.85rem; }
.ins-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ins-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.ins-stat { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.ins-big { font-size: 1.8rem; font-weight: 700; }
.ins-table-wrap { margin-top: 10px; font-size: 0.85rem; }
.ins-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.ins-table th, .ins-table td { padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.ins-oldest { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.ins-oldest li { display: flex; flex-direction: column; }
@media (max-width: 600px) { .ins-grid { grid-template-columns: 1fr; } }

/* ---- Help ---- */
.help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.help-toc { position: sticky; top: 16px; }
.help-toc ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-secondary); text-decoration: none; }
.help-toc a:hover { background: var(--primary-tint); color: var(--primary-darker); }
.help-body { max-width: 760px; }
.help-section { margin-bottom: 32px; scroll-margin-top: 16px; }
.help-section h2 { margin: 0 0 6px; }
.help-audience { margin: 0 0 10px; }
.help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; } }

/* ---- Search ---- */
.search-results {
  position: fixed;
  z-index: 80;
  width: min(380px, calc(100vw - 32px));
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.search-results ul { margin: 0; padding: 0; list-style: none; }
.search-group { margin: 8px 8px 2px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.search-item:hover, .search-item.is-active { background: var(--primary-tint); }
.search-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.search-main { display: flex; flex-direction: column; min-width: 0; }
.search-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.search-sub { font-size: 0.8rem; }
.search-empty { margin: 8px; }

/* ---- Pill fields: the value as words; a click opens the choice ---- */

.pills { margin: 4px 0 12px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-field { position: relative; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-page);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
/* Each section of the ticket has its own tint, so the pills group at a glance. */
.pg-status .pill-btn { background: var(--primary-tint); }
.pg-people .pill-btn { background: var(--success-tint); }
.pg-dates .pill-btn { background: var(--warning-tint); }
.pg-where .pill-btn { background: var(--bg-page); box-shadow: inset 0 0 0 1px var(--border-strong); }
.pg-sprint .pill-btn { background: var(--error-tint); }
.pill-btn:hover:not(:disabled) { border-color: var(--border-strong); }
.pill-btn:disabled { cursor: default; opacity: 1; }
.pill-btn[aria-expanded="true"], .pill-subs.is-on { background: var(--primary-tint); border-color: var(--primary); }
.pill-label { font-weight: 500; color: var(--text-tertiary); }
.pill-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-field.is-late .pill-btn { color: var(--error-text); background: var(--error-tint); }
.pill-field.is-invalid .pill-btn { border-color: var(--error-text); background: var(--error-tint); }
.pill-field .field-error { margin: 2px 0 0 10px; }
.pill-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  max-height: 260px;
  padding: 4px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(28, 28, 28, 0.14);
}
.pill-pop[hidden] { display: none; }
.pill-pop .menu-item.is-on { font-weight: 700; }
.pill-pop .form-input { min-width: 160px; }
/* The hours box offers quick picks as you type; the browser's extra down arrow is not needed. */
.pill-pop input[list]::-webkit-calendar-picker-indicator { display: none !important; }
.pill-pop input[type="number"] { -moz-appearance: textfield; }
.pill-pop .also-list { max-height: 200px; overflow-y: auto; }
.panel-bar-end { display: flex; align-items: center; gap: 4px; }
/* The results of the dependency search (not the global search box, which floats). */
.dep-results { margin-top: 6px; }
.mw-type { display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--text-tertiary); }
.mw-line .mw-status { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
.sub-row { flex-wrap: wrap; }
.sub-status { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
/* ---- Attachments: images and videos on tickets and comments ---- */
.comment-delete { margin-left: 6px; padding: 0 4px; font-size: 11px; color: var(--text-muted); }
.comment-delete:hover { color: var(--error-text); }
.att-new { margin: 0 0 12px; }
.att-staged { margin: 8px 0 0; padding: 0; list-style: none; }
.att-staged-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.att-staged-item .att-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-section { margin: 12px 0 16px; }
.att-heading { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--text-tertiary); }
.att-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 12px; font-size: 13px; color: var(--text-tertiary); border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); }
.att-drop.is-over { color: var(--text); background: var(--primary-tint); border-color: var(--primary); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.att-grid:empty { display: none; }
.att-item { margin: 0; overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.att-open { display: block; width: 100%; padding: 0; background: none; border: 0; cursor: zoom-in; }
.att-media { display: block; width: 100%; max-height: 140px; object-fit: cover; background: var(--bg-page); }
video.att-media { object-fit: contain; }
.att-caption { display: flex; align-items: center; gap: 6px; padding: 4px 6px; font-size: 11px; }
.att-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { flex: 0 0 auto; }
.att-uploading { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12px; }
.att-progress { flex: 1 1 auto; height: 8px; }
.att-error { margin: 4px 0; font-size: 12px; }
.att-comment { margin: 6px 0; }
.comment-body + .att-grid { margin-top: 6px; }
.att-viewer { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; background: rgba(28, 28, 28, 0.85); }
.att-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(1000px, 100%); color: #fff; }
.att-viewer-bar .icon-btn { color: #fff; }
.att-viewer-img { max-width: min(1000px, 100%); max-height: calc(100vh - 90px); object-fit: contain; background: #fff; border-radius: 6px; }
.dep-menu { z-index: 30; right: 0; left: auto; min-width: 260px; }
.dep-choices { display: flex; flex-wrap: wrap; gap: 4px; }
.actions-menu { right: 0; left: auto; min-width: 220px; padding: 8px; }
.more { margin-top: 16px; }
.more > summary { cursor: pointer; font-size: 13px; color: var(--text-tertiary); }
.more-body { padding-top: 8px; }

/* ---- The subtasks window: beside the ticket panel ---- */

.subtask-window {
  position: fixed;
  top: 0;
  right: min(420px, 100vw);
  bottom: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  width: min(380px, 100vw);
  overflow-y: auto;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: -8px 0 24px rgba(28, 28, 28, 0.08);
}
.subtask-window[hidden] { display: none; }
.sw-body { padding: 8px 16px 16px; }

@media (min-width: 1101px) {
  body.ticket-open.subtasks-open .app { margin-right: calc(min(420px, 100vw) + min(380px, 100vw)); }
  body.ticket-open.subtasks-open .wl-panel { right: calc(min(420px, 100vw) + min(380px, 100vw)); }
  body.ticket-open.subtasks-open.wl-open .app { margin-right: calc(2 * min(420px, 100vw) + min(380px, 100vw)); }
}
@media (max-width: 1100px) {
  /* Not enough room beside the ticket: the subtasks window covers it until it is closed. */
  .subtask-window { right: 0; z-index: 60; width: min(420px, 100vw); }
}

.ws-digest-facts { margin: 16px 0; padding-left: 18px; }
.pw-note { margin: 4px 0 0; font-size: 12px; }
.remember-note { margin: 4px 0 0; font-size: 12px; }
.dv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.dv-row:first-of-type { border-top: 0; }
.dv-main { flex: 1 1 220px; min-width: 0; }
.dv-meta { font-size: 12px; }
.status-days { width: 72px; padding: 2px 6px; }
.cl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 0 0 16px; }
.cl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; margin: 0 0 6px; font: inherit; text-align: left; color: inherit; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cl-ticket { cursor: pointer; }
.cl-ticket:hover { background: var(--bg-page); }
.cl-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.cl-title { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.cl-filters { flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
/* ---- Roadmap overview ---- */
.rm-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.rm-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; min-width: 0; }
.rm-heading h1, .rm-heading p { margin: 0; }
.rm-levels { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 4px; padding: 3px; background: var(--border); border-radius: var(--radius-sm); }
.rm-levels .seg { padding: 6px 16px; border-color: transparent; background: transparent; color: var(--text-tertiary); }
.rm-levels .seg.is-on { background: var(--bg-surface); color: var(--text); box-shadow: 0 1px 2px rgba(27, 29, 36, 0.08); }
.rm-levels[hidden], .rm-crumb[hidden], .rm-overview[hidden] { display: none; }
.rm-crumb { display: flex; align-items: baseline; gap: 8px; }
.rm-crumb-root { padding: 0; font: inherit; font-size: 24px; font-weight: 700; color: var(--primary-dark); background: none; border: 0; cursor: pointer; }
.rm-crumb-root:hover { text-decoration: underline; }
.rm-crumb-sep { font-size: 22px; color: var(--text-muted); }
.rm-crumb-label { margin: 0; font-size: 24px; }

.om {
  --om-team-0: #1f6fb2; --om-team-1: #e08a1e; --om-team-2: #2e9c85; --om-team-3: #c2412d; --om-team-4: #7b5ea7; --om-team-5: #4b6584;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: stretch;
  height: calc(100vh - 170px); min-height: 440px;
}
.om-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.om-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px; border-bottom: 1px solid var(--border); }
.om-timebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.om-seg { display: inline-grid; grid-auto-flow: column; grid-template-columns: none; gap: 4px; padding: 3px; background: var(--border); border-radius: var(--radius-sm); }
.om-seg .seg { padding: 5px 12px; white-space: nowrap; border-color: transparent; background: transparent; color: var(--text-tertiary); font-size: 13px; }
.om-seg .seg.is-on { background: var(--bg-surface); color: var(--text); box-shadow: 0 1px 2px rgba(27, 29, 36, 0.08); }
.om-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.om-grid { min-width: 640px; }
.om-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.om-first { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; font: inherit; text-align: left; color: var(--text); background: transparent; border: 0; border-right: 1px solid var(--border); cursor: pointer; min-width: 0; }
button.om-first:hover .om-name { text-decoration: underline; }
.om-first-head { cursor: default; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.om-head .om-first { padding-top: 12px; }
.om-name { font-weight: 700; overflow-wrap: anywhere; }
.om-count, .om-ongoing { font-size: 12px; color: var(--text-tertiary); }
.om-ongoing { color: var(--text-muted); }
.om-band .om-first { border-left: 4px solid var(--om-tone, var(--om-project, var(--border-strong))); background: color-mix(in srgb, var(--om-tone, var(--om-project, #888)) 9%, var(--bg-surface)); }
.om-band .om-name { color: var(--om-tone, var(--om-project, var(--text))); }
.om-tone-0 { --om-tone: var(--om-team-0); } .om-tone-1 { --om-tone: var(--om-team-1); } .om-tone-2 { --om-tone: var(--om-team-2); }
.om-tone-3 { --om-tone: var(--om-team-3); } .om-tone-4 { --om-tone: var(--om-team-4); } .om-tone-5 { --om-tone: var(--om-team-5); }
.om-band-track { background: color-mix(in srgb, var(--om-tone, var(--om-project, #888)) 5%, var(--bg-surface)); }
.om-avatars { display: inline-flex; align-items: center; }
.om-avatar { width: 24px; height: 24px; font-size: 10px; box-shadow: 0 0 0 2px var(--bg-surface); background: var(--bg-surface); color: var(--text); border: 1px solid var(--border-strong); }
.om-avatars .om-avatar + .om-avatar { margin-left: -5px; }
.om-more { margin-left: 4px; font-size: 11px; color: var(--text-muted); }
.om-track { position: relative; min-width: 0; }
.om-head-track { height: 44px; }
.om-col { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; padding: 4px 8px; border-left: 1px solid var(--border); min-width: 0; overflow: hidden; }
.om-quarter { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: var(--primary-dark); white-space: nowrap; }
.om-col-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.om-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.om-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--error); opacity: 0.7; z-index: 1; pointer-events: none; }
.om-lane { position: absolute; left: 0; right: 0; height: 46px; }
.om-bar { position: absolute; top: 0; height: 28px; padding: 0; overflow: hidden; text-align: left; font: inherit; color: var(--text); border: 1.5px solid var(--success); border-radius: 8px; cursor: pointer; z-index: 2; }
.om-bar.is-at_risk { border-color: var(--warning); }
.om-bar.is-overdue { border-color: var(--error); }
.om-bar.is-light { border-style: dashed; color: var(--text-tertiary); }
.om-bar.is-ongoing { border-color: var(--text-tertiary); background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(128, 128, 128, 0.12) 6px 12px); }
.om-leftbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.om-ongoing-toggle.is-on { color: var(--primary-darker); background: var(--primary-tint); border-color: var(--primary); }
.om-bar.is-selected { border-color: var(--text); border-style: solid; }
.om-bar.is-dim { opacity: 0.28; }
.om-bar.is-cut-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.om-bar.is-cut-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.om-bar:focus-visible, .om-overlap:focus-visible, button.om-first:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.om-fill { position: absolute; left: 0; top: 0; bottom: 0; }
.om-bar-text { position: relative; display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 8px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.om-bar-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.om-bar-pct { font-size: 12px; color: var(--text-tertiary); }
.om-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.om-dot.is-overdue { background: var(--error); }
.om-ms { position: absolute; top: 24px; display: flex; flex-direction: column; align-items: center; gap: 1px; transform: translateX(-50%); z-index: 3; }
.om-diamond { display: inline-block; width: 9px; height: 9px; background: var(--text); transform: rotate(45deg); }
.om-ms.is-late .om-diamond { background: var(--error); }
.om-ms-date { font-size: 10px; font-weight: 600; white-space: nowrap; }
.om-ms.is-late .om-ms-date { color: var(--error); }
.om-empty { margin: 0; padding: 16px 12px; font-size: 13px; color: var(--text-tertiary); position: relative; }
.om-none { padding: 24px 12px; }
.om-foot { padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.om-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-tertiary); }
.om-key { display: inline-flex; align-items: center; gap: 6px; }
.om-swatch { display: inline-block; width: 16px; height: 10px; border: 1.5px solid var(--success); border-radius: 3px; }
.om-swatch.is-at_risk { border-color: var(--warning); } .om-swatch.is-overdue { border-color: var(--error); }
.om-swatch.is-shared { border: 1.5px dashed var(--text-muted); }
.om-today-key { display: inline-block; width: 2px; height: 12px; background: var(--error); }
.om-hint { margin: 6px 0 0; font-size: 12px; }

.om-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.om-panel { padding: 14px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.om-selected { border-color: var(--text); }
.om-panel-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.om-panel-title { margin: 0; font-size: 15px; font-weight: 700; }
.om-selected .om-panel-head { justify-content: flex-start; }
.om-selected .om-close { margin-left: auto; }
.om-square { flex: none; width: 10px; height: 10px; border-radius: 2px; }
.om-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 13px; color: var(--text-tertiary); }
.om-pill { display: inline-block; padding: 1px 8px; font-size: 12px; font-weight: 700; border-radius: 999px; white-space: nowrap; background: var(--success-tint); color: var(--success-text); }
.om-pill.is-at_risk, .om-pill.is-nearing { background: var(--warning-tint); color: var(--warning-text); }
.om-pill.is-overdue, .om-pill.is-over { background: var(--error-tint); color: var(--error-text); }
.om-why { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--warning); border-radius: var(--radius-sm); background: var(--warning-tint); color: var(--warning-text); }
.om-why.is-overdue { border-color: var(--error); background: var(--error-tint); color: var(--error-text); }
.om-why-head { display: block; margin-bottom: 4px; font-size: 13px; }
.om-reason { margin-top: 8px; }
.om-reason-head { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--text); }
.om-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.om-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; font-size: 12px; color: var(--text); }
.om-item-key { font-weight: 700; }
.om-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-item-meta { color: var(--text-tertiary); white-space: nowrap; }
.om-more-line { margin: 2px 0 0; font-size: 12px; }
.om-line { margin: 8px 0; font-size: 13px; }
.om-small-head { display: block; margin-bottom: 6px; font-size: 12px; }
.om-people-list, .om-next-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.om-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.om-open { margin-top: 12px; }
.om-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.om-tile { display: flex; flex-direction: column; padding: 8px 10px; border-top: 3px solid var(--success); border-radius: var(--radius-sm); background: var(--bg-page); font-size: 12px; color: var(--text-tertiary); }
.om-tile.is-at_risk { border-top-color: var(--warning); } .om-tile.is-overdue { border-top-color: var(--error); }
.om-tile-n { font-size: 20px; color: var(--text); }
.om-facts { margin: 0 0 10px; padding-left: 18px; font-size: 13px; }
.om-next-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.om-next-date { color: var(--text-tertiary); }
.om-next-risk { font-size: 12px; font-weight: 700; color: var(--error-text); }
.om-intro { margin: 8px 0; font-size: 13px; }
.om-calm { color: var(--success-text); }
.om-overlap { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; padding: 10px; font: inherit; text-align: left; color: var(--text); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.om-overlap.is-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.om-overlap-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.om-overlap-who { display: flex; flex-direction: column; font-size: 13px; }
.om-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.om-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; font-size: 12px; background: var(--bg-page); border-radius: 4px; }
.om-chip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.om-more-btn { margin-top: 8px; }
.om-load { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.om-load-grid { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.om-load-grid th { font-weight: 600; text-align: center; color: var(--text-muted); }
.om-load-grid tbody th { text-align: left; color: var(--text); font-size: 12px; }
.om-load-corner { text-align: left; }
.om-cell { display: block; padding: 3px 0; text-align: center; font-weight: 700; border-radius: 4px; background: var(--bg-page); color: var(--text-secondary); }
.om-cell.is-some { background: #cfeae0; }
.om-cell.is-nearing { background: #f8dda8; color: var(--warning-text); }
.om-cell.is-over { background: #f6b9ac; color: var(--error-text); }
.om-busiest { margin: 6px 0 0; font-size: 12px; font-weight: 600; }
.om-busiest.is-low { color: var(--success-text); } .om-busiest.is-nearing { color: var(--warning-text); } .om-busiest.is-over { color: var(--error-text); }
@media (max-width: 1100px) {
  .om { grid-template-columns: minmax(0, 1fr); height: auto; }
  .om-scroll { max-height: 70vh; }
  .om-side { overflow: visible; }
}

/* ---- Scrollbar ---- */

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