@font-face {
  font-family: 'OpenProject Icons';
  src: url('openproject-icon-font.woff2') format('woff2');
  font-display: block;
}

:root {
  color-scheme: light;
  --bg-app: #f6f8fc;
  --bg-sidebar: #fff;
  --bg-surface: #fff;
  --bg-elevated: #f8fafc;
  --bg-hover: #edf1f7;
  --border: #dce2eb;
  --border-subtle: #e8edf3;
  --text-main: #182337;
  --text-muted: #4d5c70;
  --text-dim: #5f6e82;
  --primary: #5745b8;
  --primary-hover: #49399d;
  --primary-soft: #eeebff;
  --accent-text: #4d399d;
  --on-primary: #fff;
  --cyan: var(--accent-text);
  --accent-purple: var(--primary);
  --success: #167461;
  --success-soft: #dff1eb;
  --warning: #a15a13;
  --warning-soft: #fbecd8;
  --danger: #b53b52;
  --danger-soft: #f8e5ea;
  --radius: 8px;
  --shadow: 0 10px 30px #15223724;
  --panel-pad: clamp(16px, 2.6vw, 40px);
  --row-pad: 10px;
  --nav-size: 222px;
  --header-size: 56px;
  --display-font: system-ui, 'Segoe UI', sans-serif;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg-app: #141c29;
  --bg-sidebar: #1a2433;
  --bg-surface: #1a2433;
  --bg-elevated: #212e40;
  --bg-hover: #2a384d;
  --border: #3a485e;
  --border-subtle: #303d50;
  --text-main: #f1f5fc;
  --text-muted: #c0cadc;
  --text-dim: #a4b3ca;
  --primary: #6651bf;
  --primary-hover: #5744b7;
  --primary-soft: #353052;
  --accent-text: #cec4ff;
  --success: #76d6ba;
  --success-soft: #233e37;
  --warning: #f2bd84;
  --warning-soft: #463225;
  --danger: #ff92a7;
  --danger-soft: #492d40;
  --shadow: 0 12px 34px #0c1423a8;
}
:root[data-accent='teal'] { --primary: #167461; --primary-hover: #115b4d; --primary-soft: #dff1eb; --accent-text: #115b4d; }
:root[data-theme='dark'][data-accent='teal'] { --primary: #176e5d; --primary-hover: #155e50; --primary-soft: #21483e; --accent-text: #9ce4d1; }
:root[data-accent='blue'] { --primary: #315ec2; --primary-hover: #264c9d; --primary-soft: #e3edfc; --accent-text: #264c9d; }
:root[data-theme='dark'][data-accent='blue'] { --primary: #3e65c6; --primary-hover: #3056b2; --primary-soft: #2a3b59; --accent-text: #b7d1ff; }
:root[data-density='compact'] { --row-pad: 6px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--display-font);
  background: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.45;
}

/* Top Header */
.top-header {
  height: 54px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  gap: 10px;
  z-index: 40;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
}
.header-select, .input-control, select, input, textarea {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.header-select:focus, .input-control:focus, select:focus, input:focus, textarea:focus {
  border-color: var(--primary);
}
.global-search {
  width: 210px;
  background: var(--bg-elevated);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.notif-btn {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
}
.notif-badge {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 4px;
}
.kbd-chip {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: Consolas, monospace;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Main Workspace Layout */
.workspace-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.sidebar {
  width: 242px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 8px 8px 16px;
  gap: 2px;
}
.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  padding: 9px 10px 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6.5px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 12.8px;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}
.nav-item.active {
  background: var(--primary-soft);
  color: var(--accent-text);
  border-color: var(--border);
  font-weight: 600;
}
.nav-count {
  font-size: 10.5px;
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}

/* Content & Split View */
.main-stage {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}
.content-pane {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 72px;
}
.inspector-pane {
  width: 540px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 18px 40px;
  flex-shrink: 0;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
}
.inspector-pane.hidden {
  display: none;
}

/* Buttons & Badges */
.btn {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-purple {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--on-primary);
}
.btn-purple:hover { background: var(--primary-hover); }
.btn-sm {
  padding: 4px 8px;
  font-size: 11.5px;
}
.btn-xs {
  padding: 2px 6px;
  font-size: 10.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.issue-key-pill {
  font-family: Consolas, 'SFMono-Regular', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
}
.epic-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.version-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.label-pill {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.pts-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
}
.avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-main);
  flex-shrink: 0;
}

/* Cards & Grids */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
}
.card-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
}

/* Fast Table (wp-fast-table) */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
table.fast-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
table.fast-table th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.fast-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
table.fast-table tr:hover {
  background: var(--bg-hover);
}
table.fast-table tr.selected-row {
  background: var(--primary-soft);
}

/* Flagged Impediments & WIP Limits */
.flagged-row {
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
}
.flagged-card {
  border-inline-start: 3px solid var(--danger);
}
.wip-exceeded {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.swimlane-header {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 12px 0 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Scrum Backlog & Sprint Containers */
.sprint-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.sprint-box.active-sprint {
  border-color: var(--accent-text);
}
.sprint-header {
  background: var(--bg-elevated);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* JQL Bar & Floating Bulk Bar */
.jql-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.jql-input {
  font-family: Consolas, 'SFMono-Regular', monospace;
  font-size: 12.5px;
  background: var(--bg-elevated);
  color: var(--accent-text);
  border: 1px solid var(--border);
  padding: 7px 11px;
  border-radius: 6px;
  flex: 1;
}
.bulk-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 90;
  flex-wrap: wrap;
  max-width: 95vw;
}

/* Markdown Rendered Content */
.markdown-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-main);
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin: 8px 0 4px;
  color: var(--text-main);
}
.markdown-body pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: Consolas, monospace;
  font-size: 12px;
  overflow-x: auto;
  margin: 6px 0;
}
.markdown-body code {
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 12px;
  color: var(--accent-text);
}
.markdown-body ul {
  padding-left: 18px;
  margin: 4px 0;
}

/* Monthly Calendar Grid (7 Columns) */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-day-header {
  background: var(--bg-elevated);
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}
.cal-cell {
  background: var(--bg-surface);
  min-height: 112px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.other-month {
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.cal-cell.today-cell {
  box-shadow: inset 0 0 0 2px var(--primary);
}

/* Progress Bar */
.progress-bar {
  width: 80px;
  height: 7px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
}

/* Kanban Boards */
.board-columns {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  min-height: 320px;
}
.board-col {
  min-width: 272px;
  max-width: 272px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.board-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Gantt Timeline */
.gantt-row {
  display: grid;
  grid-template-columns: 350px 1fr;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  min-height: 38px;
}
.gantt-track {
  position: relative;
  height: 28px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
}
.gantt-bar {
  position: absolute;
  top: 5px;
  height: 18px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-main);
  padding: 1px 6px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Decision Market Cards */
.dm-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.branch-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  position: relative;
}
.branch-box.recommended {
  border-color: var(--success);
}
.branch-box.called-off {
  border-style: dashed;
  border-color: var(--warning);
}
.prob-meter {
  height: 10px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
.prob-fill {
  height: 100%;
  transition: width 0.25s ease;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.form-row {
  margin-bottom: 11px;
}
.form-row label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
}

#toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--bg-elevated);
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  max-width: 420px;
  font-size: 12.5px;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
[hidden] { display: none !important; }
#workspace-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#team-gate { padding: 32px; display: grid; place-items: center; min-height: 100vh; }
#team-gate .card { width: min(100%, 460px); }
#team-gate h1 { margin: 0 0 12px; }
.form-error { color: var(--danger); margin: 8px 0; }
.secondary-tools > summary { cursor: pointer; }
.empty-project { max-width: 540px; margin: 32px auto; }
.project-banner { margin-bottom: 12px; }
.member-actions { display: flex; gap: 8px; align-items: center; }
tr.rank-target { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.inspector-conflict { border: 1px solid var(--warning); padding: 10px; margin-bottom: 10px; }

body { height: 100dvh; font-family: var(--display-font); }
a { color: var(--text-main); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}
button:disabled { cursor: default; opacity: .62; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 250; }
.skip-link:focus { top: 9px; }
.top-header {
  height: var(--header-size); padding: 0 20px; gap: 16px;
  background: var(--bg-surface); color: var(--text-main);
}
.brand-group { flex-shrink: 0; gap: 10px; }
.brand-logo { font-size: 17px; font-weight: 750; color: var(--text-main); gap: 9px; }
.brand-icon {
  display: flex; align-items: flex-end; gap: 2px; padding: 8px 7px;
  width: 30px; height: 30px; border-radius: 7px; background: #29334e; box-shadow: none;
}
.brand-icon i { display: block; width: 4px; height: 7px; border-radius: 1px; background: #f9f4ff; transform: skewY(-20deg); }
.brand-icon i:nth-child(2) { height: 10px; background: #e0d2fa; }
.brand-icon i:nth-child(3) { height: 14px; background: #b7a0e9; }
.workspace-search { display: flex; align-items: center; min-width: 0; margin-right: auto; width: min(34vw, 425px); }
.workspace-search > label { position: relative; display: block; width: 100%; }
.search-symbol { position: absolute; top: 9px; left: 12px; color: var(--text-muted); font-size: 15px; line-height: 18px; }
.global-search { width: 100%; min-height: 36px; padding-left: 31px; background: var(--bg-app); }
.header-right { gap: 7px; }
.header-right button { min-height: 34px; }
.header-select, .input-control, select, input, textarea { border-radius: 7px; }
#project-selector { width: 100%; min-width: 0; text-overflow: ellipsis; padding: 8px; }
#create-project-btn { justify-content: center; }
#team-user-label { max-width: 135px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.workspace-utility { color: var(--text-muted); }
.workspace-utility:where(:hover, :focus-visible) { color: var(--text-main); }
#toggle-navigation { display: none; min-width: 38px; justify-content: center; }
.op-icon { font: normal 1em/1 'OpenProject Icons'; }
.workspace-utility .op-icon, #toggle-navigation .op-icon { font-size: 16px; }
.workspace-body, .main-stage, .content-pane { min-width: 0; min-height: 0; }
.sidebar { width: var(--nav-size); padding: 15px 12px; gap: 5px; }
.workspace-switcher { display: grid; gap: 6px; padding: 1px 3px 11px; }
.workspace-switcher label { color: var(--text-muted); font-size: 11px; font-weight: 700; }
#project-navigation { display: grid; gap: 2px; }
.sidebar-section-label { padding: 9px 10px 4px; letter-spacing: .065em; }
.workspace-nav-list { list-style: none; }
.workspace-nav-list > li:has(> [hidden]) { display: none; }
.nav-item {
  width: 100%; padding: 7px 9px; min-height: 35px; gap: 8px; text-align: left; border-radius: 7px;
  background: transparent; color: var(--text-muted); font-weight: 600; font-size: 13px;
}
.nav-item > span:first-child { display: flex; align-items: center; min-width: 0; gap: 9px; }
.nav-item:hover { color: var(--text-main); background: var(--bg-hover); }
.nav-item.active, .nav-item.futarchy-nav.active { background: var(--primary-soft); color: var(--text-main); border-color: transparent; }
.workspace-nav-list .nav-item.active { box-shadow: inset 2px 0 var(--primary); }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 17px; font-size: 15px; font-weight: 500; }
.nav-count { color: var(--text-muted); background: var(--bg-surface); border-color: var(--border); }
.secondary-tools { padding-top: 3px; }
.secondary-tools > summary { margin-top: 4px; list-style-position: inside; border-radius: 7px; }
.secondary-tools[open] > summary { margin-bottom: 3px; }
.sidebar-footer { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); color: var(--text-muted); }
.sidebar-footer .nav-item { padding: 5px 0; }
.sidebar-footer .nav-item:hover { background: transparent; text-decoration: underline; }
.sidebar-footer .mobile-utility { display: none; }
.sandbox-controls { display: grid; gap: 6px; margin-block: 4px 12px; }
.sandbox-controls label { font-size: 12px; }
.workspace-attribution { margin-top: 8px; font-size: 11px; line-height: 1.45; }
.workspace-attribution a { color: inherit; }
.content-pane { padding: 26px var(--panel-pad) 70px; }
.content-pane > .card { min-width: 0; }
.inspector-pane { width: min(505px, 55%); background: var(--bg-surface); box-shadow: none; }
.page-header { flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.page-header > * { min-width: 0; }
.page-title { font-size: clamp(23px, 2.5vw, 29px); line-height: 1.16; font-weight: 720; overflow-wrap: anywhere; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 7px; }
.btn { min-height: 34px; font-size: 13px; padding: 6px 12px; border-radius: 7px; }
.btn-sm { font-size: 12px; min-height: 30px; padding: 4px 9px; }
.btn-xs { font-size: 11px; min-height: 24px; padding: 2px 7px; }
.btn-primary, .btn-purple { color: var(--on-primary); }
.btn-purple:hover { background: var(--primary-hover); }
.btn-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.btn-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.form-error { color: var(--danger); }
.kbd-chip, .label-pill, .pts-badge { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border); }
.issue-key-pill { background: var(--primary-soft); color: var(--text-main); border-color: transparent; font-weight: 620; }
.epic-pill { background: var(--primary-soft); color: var(--text-main); border-color: transparent; }
.version-pill { background: var(--success-soft); color: var(--success); border-color: transparent; }
.markdown-body, .markdown-body :is(h1,h2,h3), .tab-btn.active { color: var(--text-main); }
.markdown-body pre, .markdown-body code { background: var(--bg-elevated); color: var(--text-main); }
.card { padding: 16px; }
.card-title { font-size: 15px; }
.card-title > h2 { font-size: inherit; }
table.fast-table th { background: var(--bg-elevated); }
table.fast-table td { padding: var(--row-pad) 10px; border-bottom-color: var(--border-subtle); }
table.fast-table tr:hover { background: var(--bg-elevated); }
table.fast-table tr.selected-row { background: var(--primary-soft); }
.jql-bar { background: var(--bg-surface); }
.jql-input { min-width: min(100%, 16rem); background: var(--bg-elevated); color: var(--text-main); }
.bulk-bar { background: var(--bg-surface); }
.sprint-box, .swimlane-header, .cal-day-header { background: var(--bg-elevated); }
.cal-cell, .gantt-track, .branch-box { background: var(--bg-surface); }
.progress-bar { background: var(--bg-hover); }
.progress-fill { background: var(--primary); }
.board-columns { scroll-snap-type: x proximity; padding: 3px 0 12px; }
.board-col { background: var(--bg-elevated); scroll-snap-align: start; }
.board-card { border-radius: var(--radius); cursor: default; overflow-wrap: anywhere; }
.board-card:hover { transform: none; }
.board-card-open { max-inline-size: 100%; border: 0; padding: 0; color: var(--text-main); background: transparent; text-align: left; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
.board-card-open:hover { text-decoration: underline; }
.board-meta, .issue-metadata { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--text-muted); font-size: 12px; }
.table-action { border: 0; background: transparent; color: var(--accent-text); text-align: start; cursor: pointer; }
.table-action:hover { text-decoration: underline; }
.issue-key { white-space: nowrap; font-variant-numeric: tabular-nums; }
.issue-filter-bar, .issue-extra-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.issue-filter-bar { margin-bottom: 12px; }
.issue-filter-bar select { max-width: 100%; }
.issue-filter-bar details[open] { flex-basis: 100%; }
.issue-filter-bar summary { display: list-item; list-style-position: inside; width: fit-content; }
.issue-extra-filters { padding-top: 8px; }
.inspector-field-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(160px,100%),1fr)); gap: 10px; }
.inspector-fields { margin: 0; border: 0; padding: 0; min-width: 0; }
.inspector-attachments input[type='file'] { max-width: 100%; }
.modal-backdrop { padding: 12px; background: #1b1129a8; }
.modal-card { padding: clamp(16px, 3vw, 25px); border-radius: var(--radius); max-height: 91dvh; }
.modal-card:focus { outline: 0; }
.confirmation-dialog { width: min(400px, calc(100% - 32px)); margin: auto; color: var(--text-main); }
.confirmation-dialog::backdrop { background: #10141c80; }
.confirmation-dialog h2 { font-size: 19px; }
.confirmation-dialog p { margin: 8px 0 18px; overflow-wrap: anywhere; }
.confirmation-dialog .dash-actions { justify-content: flex-end; }
.preference-widgets {
  border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; margin-bottom: 14px;
  display: flex; flex-wrap: wrap; gap: 7px 16px;
}
.preference-widgets legend { color: var(--text-muted); padding: 0 5px; font-size: 12px; font-weight: 650; }
.preference-widgets label { display: inline-flex; align-items: center; gap: 4px; }
.preference-widgets input { accent-color: var(--primary); }
.command-results { max-height: 52dvh; overflow-y: auto; display: grid; gap: 3px; padding: 3px; }
.command-results small { color: var(--text-muted); }
.toast { background: var(--bg-surface); color: var(--text-main); }
#toast-container { max-width: calc(100vw - 36px); overflow-wrap: anywhere; }
#team-gate { min-height: 100dvh; overflow-y: auto; padding: 20px; }
#team-gate .card { width: min(100%, 420px); padding: clamp(18px, 4vw, 31px); box-shadow: var(--shadow); }
#team-gate .brand-logo { margin-bottom: 24px; }
#team-gate h1 { font-size: clamp(24px, 5vw, 31px); line-height: 1.12; letter-spacing: -.035em; }
#team-gate form > button[type='submit'] { margin-top: 8px; width: 100%; justify-content: center; }
#team-gate .project-banner { color: var(--text-muted); margin-bottom: 18px; }

.workspace-dashboard { max-width: 1370px; margin: 0 auto; }
.dashboard-header { margin: 5px 0 21px; }
.dashboard-header .page-subtitle { max-width: 70ch; }
.eyebrow { color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.dash-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 18px; border-block: 1px solid var(--border); }
.dash-metric { display: grid; gap: 3px; align-content: start; padding: 12px 16px; }
.dash-metric + .dash-metric { border-inline-start: 1px solid var(--border); }
.dash-metric dt { color: var(--text-muted); font-size: 12px; font-weight: 650; }
.dash-metric strong { font-size: 25px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-metric small { display: block; color: var(--text-muted); overflow-wrap: anywhere; }
.dash-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 15px; align-items: start; }
.dash-stack { display: grid; gap: 15px; min-width: 0; }
.dash-card { min-width: 0; }
.dash-card > .card-title { margin-bottom: 5px; }
.dash-list { display: grid; padding: 0; list-style: none; }
.dash-list > li + li { border-top: 1px solid var(--border-subtle); }
.dash-row {
  display: grid; grid-template-columns: 84px minmax(0,1fr) auto; gap: 8px; align-items: center;
  border: 0; background: transparent; color: var(--text-main); cursor: pointer; width: 100%; text-align: left;
  padding: var(--row-pad) 0; font-size: 13px; min-width: 0;
}
.dash-row:hover .dash-subject { text-decoration: underline; }
.dash-key { color: var(--text-muted); font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; overflow-wrap: anywhere; }
.dash-subject { font-weight: 630; overflow-wrap: anywhere; }
.dash-state { color: var(--text-muted); font-size: 11px; }
.dash-blank { padding: 12px 0 4px; color: var(--text-muted); }
.dash-status { border-radius: 20px; padding: 3px 9px; font-size: 11px; font-weight: 700; background: var(--bg-elevated); color: var(--text-main); }
.dash-status[data-status='on_track'], .dash-status[data-status='finished'] { background: var(--success-soft); color: var(--success); }
.dash-status[data-status='at_risk'] { background: var(--warning-soft); color: var(--warning); }
.dash-status[data-status='off_track'] { background: var(--danger-soft); color: var(--danger); }
.dash-progress { width: 100%; margin: 10px 0 4px; }
.dash-people { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 0 0; }
.dash-people .avatar-circle { width: 29px; height: 29px; color: var(--accent-text); background: var(--primary-soft); }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.workflow-bar { display: flex; gap: 3px; height: 11px; overflow: hidden; border-radius: 12px; margin: 13px 0; }
.workflow-bar > span { display: block; min-width: 4px; background: var(--status-color); }
.workflow-legend { display: flex; flex-wrap: wrap; gap: 7px 15px; list-style: none; color: var(--text-muted); font-size: 12px; }
.workflow-legend > li { display: flex; gap: 5px; align-items: center; }
.workflow-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--status-color); }
.workflow-legend strong { color: var(--text-main); font-variant-numeric: tabular-nums; }
.dash-row.dash-forecast-row { grid-template-columns: minmax(0, 1fr) auto; }
.dash-forecast-odds { color: var(--success); font-variant-numeric: tabular-nums; }

.forecast-page { max-width: 1230px; margin: 0 auto; }
.forecast-layout { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.5fr); gap: 15px; align-items: start; }
.forecast-list { display: grid; gap: 7px; }
.forecast-list > button {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; align-items: center;
  text-align: left; color: var(--text-main); background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 12px; cursor: pointer; font-size: 13px;
}
.forecast-list > button:hover { border-color: var(--primary); }
.forecast-list > button[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); }
.forecast-list > button > strong { overflow-wrap: anywhere; }
.forecast-list .forecast-list-odds { font-size: 18px; font-weight: 730; text-align: right; }
.forecast-list small, .forecast-muted { color: var(--text-muted); }
.forecast-summary { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; margin-bottom: 9px; }
.forecast-summary h2 { font-size: clamp(18px, 2.2vw, 25px); letter-spacing: -.025em; line-height: 1.25; overflow-wrap: anywhere; }
.forecast-summary strong { font-size: 32px; line-height: 1; letter-spacing: -.055em; }
.forecast-summary .forecast-odds-label { display: block; text-align: right; }
.forecast-detail { min-width: 0; }
.forecast-detail h3 { font-size: 14px; margin-bottom: 5px; }
.forecast-copy { white-space: pre-wrap; overflow-wrap: anywhere; margin: 7px 0 12px; }
.forecast-section { padding: 13px 0; border-top: 1px solid var(--border-subtle); }
.forecast-section:last-child { padding-bottom: 0; }
.forecast-section .dash-actions { margin-top: 7px; }
.forecast-chart { width: 100%; height: 144px; display: block; }
.forecast-chart-axis { display: flex; justify-content: space-between; gap: 6px; margin-top: 3px; font-size: 11px; color: var(--text-muted); }
.forecast-position { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.forecast-position div { background: var(--bg-elevated); padding: 8px; border-radius: 7px; }
.forecast-position dt { color: var(--text-muted); font-size: 11px; }
.forecast-position dd { font-size: 14px; font-weight: 720; overflow-wrap: anywhere; }
.forecast-balance { align-self: center; color: var(--text-muted); }
.forecast-quote { padding: 11px; margin: 10px 0; background: var(--bg-elevated); border-radius: 7px; }

@media (max-width: 1160px) {
  :root { --nav-size: 198px; }
  .header-right .shortcut-hint, #refresh-project-btn { display: none; }
  .dash-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-metric:nth-child(3) { border-inline-start: 0; }
  .dash-metric:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 900px) {
  :root { --nav-size: 218px; }
  .top-header { padding: 0 12px; gap: 10px; }
  .header-right { gap: 5px; }
  #toggle-navigation { display: inline-flex; }
  .sidebar { position: absolute; z-index: 30; inset: var(--header-size) auto 0 0; box-shadow: var(--shadow); }
  :root:not([data-nav-open='true']) .sidebar { display: none; }
  .inspector-pane { position: absolute; inset: 0 0 0 auto; z-index: 20; width: min(540px, 100%); box-shadow: var(--shadow); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .top-header { gap: 7px; }
  .workspace-search { width: auto; flex: 1; }
  .global-search::placeholder { color: transparent; }
  .header-right { margin-left: auto; }
  #team-user-label, #inbox-btn, #commands-btn { display: none; }
  .sidebar-footer .mobile-utility { display: flex; }
  .sidebar-footer button { min-height: 36px; }
  .top-header .btn { min-height: 36px; }
  .brand-logo { font-size: 14px; }
  .brand-icon { width: 28px; height: 28px; }
  .content-pane { padding-top: 18px; }
  .dash-grid, .forecast-layout, .content-pane .grid-2, .content-pane .grid-3,
  .modal-card .grid-2, .modal-card .grid-3 { grid-template-columns: minmax(0,1fr); }
  .dash-row { grid-template-columns: 66px minmax(0,1fr); }
  .dash-row .dash-state { grid-column: 2; }
  .dash-metric strong { font-size: 21px; }
  .dash-metric { padding: 9px 10px; }
  .forecast-position { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fast-table th, .fast-table td { min-width: 0; }
  .jql-bar .jql-input { flex: 1 1 75%; min-width: 0; }
}
@media (max-width: 350px) {
  .top-header .brand-logo > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; } }

/* Scoped styles adapted from @tabler/core 1.7.5, The Tabler Authors, MIT. See docs/THIRD_PARTY_NOTICES.md. */
/* Tabler vertical navigation. */
#workspace-sidebar .workspace-nav-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  margin: 0;
  gap: 2px;
}
#workspace-sidebar .workspace-nav-list .nav-item {
  display: flex;
  align-items: center;
  min-height: 2.1rem;
  padding-inline: 0.625rem;
}
#workspace-sidebar .workspace-nav-list .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1rem;
  margin-inline-end: 0.125rem;
  color: var(--text-dim);
}
#workspace-sidebar .workspace-nav-list .nav-item:hover .nav-icon,
#workspace-sidebar .workspace-nav-list .nav-item[aria-current='page'] .nav-icon {
  color: inherit;
}

/* Tabler page header, button list and vertically aligned table. */
.content-pane .page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  min-height: 2.25rem;
}
.jql-bar > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.content-pane .fast-table > :not(caption) > * > * {
  vertical-align: middle;
}
