:root {
  --bg: #17121f;
  --panel: #221a2c;
  --panel-2: #2e2339;
  --text: #f4e8d0;
  --muted: #bba9b6;
  --author-color: #bba9b6;
  --primary: #e89a52;
  --danger: #ff6f91;
  --border: #45354f;
  --bg-gradient-top: #2a1f36;
}

/* ── Light theme overrides (toggled via html.theme-light, see theme.js) ── */
html.theme-light {
  --bg: #f2f4fa;
  --panel: #ffffff;
  --panel-2: #eaeefa;
  --text: #1b2136;
  --muted: #5c6480;
  --author-color: #5c6480;
  --primary: #a8501f;
  --danger: #d63a5c;
  --border: #d7dcee;
  --bg-gradient-top: #ffffff;
}

html.theme-light body {
  background: radial-gradient(circle at top, var(--bg-gradient-top) 0%, var(--bg) 55%);
}

html.theme-light .dm-msg {
  background: color-mix(in srgb, var(--panel) 92%, black);
}

/* Dark text on the light theme's strong blue is hard to read (3.5:1); white is 5.3:1. */
html.theme-light button.primary,
html.theme-light .primary {
  color: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, var(--bg-gradient-top) 0%, var(--bg) 55%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  flex: 1 0 100%;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-title-row .muted {
  margin: 0;
}

.board-switcher-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
}

.topbar-controls-row {
  --topbar-control-height: 38px;
  --board-control-width: 132px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-controls-row .board-switcher-row > .back-boards-btn,
.topbar-controls-row .board-switcher-row > #boardSwitcher {
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
  width: var(--board-control-width);
  min-width: var(--board-control-width);
  max-width: var(--board-control-width);
  font-size: 0.9rem;
  padding-top: 0;
  padding-bottom: 0;
}

.topbar-controls-row .board-switcher-row > .back-boards-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-boards-btn {
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.back-boards-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}

#boardSwitcher {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  min-width: 140px;
}

.picker-logout {
  align-self: center;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-actions {
   display: flex;
   gap: 0.5rem;
   align-items: center;
   flex-wrap: wrap;
 }

/* Keep board topbar controls visually aligned to one consistent size. */
#boardTopbarActions {
  margin-left: auto;
  justify-content: flex-end;
}

#boardTopbarActions > .search-box,
#boardTopbarActions > button,
#boardTopbarActions > .logout-form > button,
#boardTopbarActions > .filter-controls-dropdown > #filterControlsBtn {
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.9rem;
}

#boardTopbarActions > button,
#boardTopbarActions > .logout-form > button,
#boardTopbarActions > .filter-controls-dropdown > #filterControlsBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

 .filter-controls-dropdown {
   position: relative;
   display: inline-block;
 }

 #filterControlsBtn {
   padding: 0.35rem 0.65rem;
   background: var(--panel);
   color: var(--text);
   border: 1px solid var(--border);
    border-radius: 8px;
   cursor: pointer;
   font-size: 0.85rem;
   white-space: nowrap;
 }

 #filterControlsBtn:hover {
   background: var(--panel-2);
 }

 .filter-controls-menu {
   position: absolute;
   top: calc(100% + 0.5rem);
   left: 0;
   background: var(--panel);
   border: 1px solid var(--border);
   border-radius: 0.3rem;
   padding: 0.75rem;
   min-width: 280px;
   z-index: 100;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
 }

 .filter-section {
   margin-bottom: 0.75rem;
   display: flex;
   flex-direction: column;
   gap: 0.35rem;
 }

 .filter-section:last-child {
   margin-bottom: 0;
 }

 .filter-section label {
   font-size: 0.8rem;
   color: var(--muted);
   font-weight: bold;
 }

 .filter-section select {
   padding: 0.35rem 0.5rem;
   background: var(--panel-2);
   color: var(--text);
   border: 1px solid var(--border);
   border-radius: 0.2rem;
   font-size: 0.85rem;
 }

 .sort-dir-toggle {
   padding: 0.35rem 0.5rem;
   background: var(--panel-2);
   color: var(--text);
   border: 1px solid var(--border);
   border-radius: 0.2rem;
   cursor: pointer;
   font-size: 0.85rem;
   width: 100%;
 }

 .sort-dir-toggle:hover {
   background: var(--panel-2);
   opacity: 0.8;
 }

 .tags-expand-btn {
   padding: 0.35rem 0.5rem;
   background: var(--panel-2);
   color: var(--text);
   border: 1px solid var(--border);
   border-radius: 0.2rem;
   cursor: pointer;
   font-size: 0.85rem;
   text-align: left;
 }

 .tags-expand-btn:hover {
   background: var(--panel-2);
   opacity: 0.8;
 }

 .ticket-tags-control {
   display: flex;
   flex-direction: column;
   gap: 0.35rem;
   min-width: 170px;
   max-width: 260px;
 }

#ticketTagsDropdown {
  max-width: 260px;
}

.logout-form {
  margin: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-2) 80%, black);
  color: var(--text);
  font-size: 0.85rem;
}

/* ── Shared site navigation link, used to move between Portal/Forum/Wiki/MCWorkspace/Admin ── */
.site-nav-link {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.site-nav-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.site-nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Keep the pancake nav menu grouped on the right side in MCWorkspace toolbars. */
#boardTopbarActions > .pancake-menu,
#pickerLogoutActions > .pancake-menu {
  margin-left: auto;
}

/* ── Pancake (hamburger) navigation menu, shared across every page ──────────
   Replaces the old row of separate Portal/Forum/Wiki/Admin/Logout buttons
   with a single compact dropdown so page headers stay uncluttered. ── */
.pancake-menu {
  position: relative;
  display: inline-flex;
}

.pancake-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pancake-toggle:hover,
.pancake-menu.open .pancake-toggle {
  border-color: var(--primary);
  color: var(--primary);
}

.pancake-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.pancake-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 500;
}

.pancake-menu.align-left .pancake-dropdown {
  left: 0;
  right: auto;
}

.pancake-menu.open .pancake-dropdown {
  display: flex;
}

.pancake-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.pancake-link:hover {
  background: var(--panel-2);
  color: var(--primary);
}

.pancake-divider {
  height: 1px;
  margin: 0.3rem 0.2rem;
  background: var(--border);
}

.pancake-logout-form {
  margin: 0;
}

.pancake-logout-btn {
  color: var(--danger);
}

.pancake-logout-btn:hover {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--danger);
}

input,
textarea,
select,
button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

button {
  cursor: pointer;
}

button.primary {
  white-space: nowrap;
  background: var(--primary);
  color: #1e1408;
  border-color: transparent;
  font-weight: 700;
}

main {
  flex: 1;
  padding: 0.75rem 1.25rem 1.25rem;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.column {
  background: color-mix(in srgb, var(--panel) 87%, black);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  min-height: 320px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  overflow-x: hidden;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
}

.column-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.column-quick-edit {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
}

.drop-zone {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.drop-zone.drag-over {
  outline: 2px dashed var(--primary);
  border-radius: 10px;
}

.card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
}

.card p {
  margin: 0.45rem 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--muted);
}

.ticket-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--author-color);
}

.card-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.35rem;
}

.card-actions button {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

button.danger {
  border-color: transparent;
  background: var(--danger);
  color: #2d0815;
}

.modal-screen {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, black);
  color: var(--text);
  width: min(1100px, 96vw);
  max-height: 90vh;
  padding: 0;
}

.compact-modal {
  width: min(560px, 92vw);
  max-height: 78vh;
}

.modal-screen::backdrop {
  background: rgba(6, 8, 14, 0.86);
  backdrop-filter: blur(2px);
}

.modal-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1rem 1.1rem;
}

.compact-panel {
  min-height: min(46vh, 460px);
}

/* ── Editor panel: horizontal split ─────────────────────────── */
.editor-panel {
  flex-direction: row;
  gap: 0;
  padding: 0;
  align-items: stretch;
  min-height: min(80vh, 940px);
  overflow: hidden;
}

.editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.editor-main h2 {
  margin: 0;
  font-size: 1.1rem;
}

.desc-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#editorDescription {
  flex: 1;
  min-height: 120px;
}

/* Rich text contenteditable */
.rich-editor {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  outline: none;
  cursor: text;
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
  display: block;
}

.rich-editor span[data-author] {
  /* colored inline spans — color set via style attribute */
  border-radius: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.description-inline-image {
  display: block;
  max-width: min(100%, 560px);
  max-height: 420px;
  margin: 0.4rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.editor-main menu {
  margin-top: auto;
}

/* ── Tasks sidebar ───────────────────────────────────────────── */
.editor-sidebar {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.sidebar-add-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

#checklistContainer {
  flex: 1;
  overflow-y: auto;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* ── Checklist items ─────────────────────────────────────────── */
.checklist-item {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) auto 88px 1.4rem;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: opacity 0.15s;
}

.checklist-item.completed {
  opacity: 0.55;
}

.checklist-item.completed .checklist-text {
  text-decoration: line-through;
}

.checklist-checkbox {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--primary);
  padding: 0;
  border: none;
  background: transparent;
}

.checklist-text {
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
  min-width: 0;
}

.checklist-tag-dots {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.1rem 0;
}

.checklist-task-open {
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.3rem 0.4rem;
}

.checklist-task-open:hover {
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel-2) 40%, transparent);
}

.task-detail-panel {
  min-height: min(72vh, 820px);
}

.tag-assignment-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tag-assignment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-volume-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.settings-volume-row input[type="range"] {
  flex: 1;
  min-width: 0;
}

.todo-date-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.todo-date-btn {
  flex: 0 1 auto;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.hidden-date-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tag-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}

.tag-summary-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.tag-pill,
.ticket-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--panel-2) 55%, black);
  color: var(--text);
  white-space: nowrap;
}

.tag-pill-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.tag-add-btn {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
}

.tag-picker-collapsed {
  display: none;
}

.tag-picker:not(.tag-picker-collapsed) {
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-2) 32%, transparent);
}

.tag-filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.tag-filter-empty {
  margin: 0;
}

.ticket-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.ticket-tag-chip .tag-pill-dot {
  width: 0.5rem;
  height: 0.5rem;
}

#taskDetailDescription,
#taskDetailWork {
  resize: vertical;
}

.checklist-assignee {
  font-size: 0.78rem;
  padding: 0.3rem 0.4rem;
  color: var(--muted);
  min-width: 0;
}

.checklist-remove {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
  padding: 0.1rem 0.25rem;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 4px;
}

.checklist-remove:hover {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
}

/* ── Settings / Notifications panel ─────────────────────────── */
.settings-panel {
  min-height: min(60vh, 680px);
}

.settings-panel.compact-panel {
  min-height: min(46vh, 460px);
}

.confirm-panel {
  width: min(460px, 92vw);
  min-height: auto;
}

#confirmMessage {
  white-space: pre-wrap;
}

.ticket-notes {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-2) 35%, transparent);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ticket-notes-header {
  font-size: 0.88rem;
  font-weight: 700;
}

.ticket-notes-list {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.ticket-note {
  width: fit-content;
  max-width: min(92%, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem;
}

.ticket-note.own {
  margin-left: auto;
  border-color: color-mix(in srgb, var(--author-color) 55%, var(--border));
  background: color-mix(in srgb, var(--panel) 86%, var(--author-color));
}

.ticket-note-meta {
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.ticket-note-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.85rem;
}

.ticket-note-image {
  display: block;
  max-width: 220px;
  max-height: 160px;
  border-radius: 8px;
  margin-top: 0.35rem;
  object-fit: contain;
  border: 1px solid var(--border);
  background: var(--bg);
}

.ticket-note-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.ticket-note-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.ticket-note-actions button {
  padding: 0.22rem 0.45rem;
  font-size: 0.75rem;
}

.ticket-note-edit textarea {
  width: 100%;
  min-height: 80px;
}

.ticket-note-file {
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  color: var(--muted);
}

.ticket-notes-compose {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ticket-notes-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

#ticketNoteInput {
  resize: vertical;
}

.modal-panel label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ── Board picker landing ────────────────────────────────────── */
.board-picker-screen {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.board-picker-content {
  width: min(860px, 100%);
}

.board-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.board-picker-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.board-picker-create {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.board-picker-create input {
  min-width: 160px;
}

.board-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.board-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s;
}

.board-card:hover {
  border-color: var(--primary);
}

.board-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.board-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.board-card-id {
  font-size: 0.75rem;
  color: var(--muted);
}

.board-card-open {
  white-space: nowrap;
}

.board-card-del {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

/* ── Notification items ──────────────────────────────────────── */
.notification-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  cursor: pointer;
}

.notification-item:hover {
  border-color: var(--primary);
}

.notification-item.done {
  opacity: 0.55;
}

.notification-item.done .notif-task {
  text-decoration: line-through;
}

.notif-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.notif-dot.done {
  background: #6ef2a2;
}

.notif-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.notif-ticket {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-task {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-col {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.users-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.users-section-header {
  margin-top: 0.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.user-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.user-last-seen {
  font-size: 0.75rem;
}

.user-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #6f778f;
}

.user-status-dot.online {
  background: #6ef2a2;
}

.messages-panel {
  width: min(920px, 96vw);
}

.messages-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 0.8rem;
}

.messages-users,
.messages-thread {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 0.7rem;
}

.messages-users-title {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.dm-user-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.45rem;
  text-align: left;
  margin-bottom: 0.35rem;
}

.dm-user-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #6f778f;
  flex-shrink: 0;
}

.dm-user-dot.online {
  background: #6ef2a2;
}

.dm-user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-thread-list {
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  margin: 0.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dm-msg {
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #111625;
}

.dm-msg.own {
  border-color: var(--primary);
}

.dm-msg-meta {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.dm-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

@media (max-width: 860px) {
  .messages-layout {
    grid-template-columns: 1fr;
  }
}

/* Phones: the less used board buttons fold into "More", and empty columns stay short. */
.more-actions-btn {
  display: none;
}

@media (max-width: 640px) {
  .more-actions-btn {
    display: inline-flex;
  }

  .topbar-actions .topbar-secondary {
    display: none;
  }

  .topbar-actions.show-more .topbar-secondary {
    display: inline-flex;
  }

  .column {
    min-height: 0;
  }

  .drop-zone {
    min-height: 64px;
  }
}

/* ── Assigned Tasks button & badge ───────────────────────────── */
.notif-btn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 1rem;
  height: 1rem;
  line-height: 1rem;
  text-align: center;
  padding: 0 0.18rem;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@keyframes messageUnreadFlash {
  0% {
    background: var(--panel);
    border-color: var(--border);
    color: var(--text);
  }
  50% {
    background: color-mix(in srgb, var(--danger) 72%, #000);
    border-color: var(--danger);
    color: #fff;
  }
  100% {
    background: var(--panel);
    border-color: var(--border);
    color: var(--text);
  }
}

.messages-unread-flash {
  animation: messageUnreadFlash 1.8s ease-in-out infinite;
}

/* ── Search box ──────────────────────────────────────────────── */
.search-box {
  min-width: 180px;
}

#ticketTagSortSelect,
#taskTagSortSelect {
  min-width: 160px;
}

.tag-manager {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem;
  background: color-mix(in srgb, var(--panel-2) 40%, transparent);
}

.tag-manager h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.tag-manager-create {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.column-manager {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem;
  background: color-mix(in srgb, var(--panel-2) 40%, transparent);
}

.column-manager h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.column-manager-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

#columnManagerList {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.column-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
}

.column-id {
  font-size: 0.72rem;
  color: var(--muted);
}

.column-row input[type="text"] {
  min-width: 0;
}

#tagManagerList {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tag-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
}

.tag-row .tag-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tag-row input[type="text"] {
  min-width: 0;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 2rem;
}

.tag-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
  background: color-mix(in srgb, var(--panel-2) 60%, black);
}

.tag-chip.selected {
  border-color: var(--text);
}

.checklist-tags {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: 0.25rem;
}

.mini-tag {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.ticket-tags .ticket-tag-chip,
.tag-summary .tag-pill {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-card-meta,
.ticket-card-due {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.ticket-card-due {
  color: var(--text);
}

.calendar-summary {
  margin-top: -0.25rem;
}

.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 46vh;
  overflow-y: auto;
}

.calendar-day {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem;
  background: color-mix(in srgb, var(--panel-2) 42%, transparent);
}

.calendar-day-heading {
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.calendar-entry {
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.calendar-entry.completed {
  opacity: 0.6;
}

.calendar-entry-title {
  font-size: 0.88rem;
  font-weight: 700;
}

.calendar-entry-meta {
  font-size: 0.75rem;
}

/* ── Ticket progress on cards ────────────────────────────────── */
.ticket-progress {
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0.2rem 0 0.05rem;
}

menu {
  display: flex;
  justify-content: end;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
  padding: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
}

@media (max-width: 960px) {
  .board {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  #boardTopbarActions {
    margin-left: 0;
  }

  #boardTopbarActions > .pancake-menu,
  #pickerLogoutActions > .pancake-menu {
    margin-left: 0;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions > * {
    flex: 1;
  }
}

/* ── Tickets: priority, assignees, blockers ── */
.ticket-fields {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 0.7rem;
  align-items: start;
  margin: 0.4rem 0 0.8rem;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-label {
  font-size: 0.85rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 1.2rem;
}

.person-chip,
.blocker-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 0.82rem;
}

.blocker-chip.done {
  text-decoration: line-through;
  opacity: 0.7;
}

.chip-remove {
  border: none;
  background: none;
  padding: 0 0.1rem;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0.35rem 0;
}

.prio {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prio-urgent { background: #c0392b; color: #fff; }
.prio-high { background: #e89a52; color: #1e1408; }
.prio-low { background: transparent; color: var(--muted); border: 1px solid var(--border); }

.blocked-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.initials {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
}

@media (max-width: 760px) {
  .ticket-fields {
    grid-template-columns: 1fr;
  }
}

/* ── Workspace home: boards by team ── */
.team-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.team-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.board-picker-create select {
  max-width: 170px;
}

/* ── Workspace home: My Work ── */
.my-work {
  margin-bottom: 1.6rem;
}

.my-work-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.my-work-header h2 {
  margin: 0;
}

.my-work-group {
  margin: 0 0 0.9rem;
}

.my-work-group h3 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.my-work-group.overdue h3 {
  color: var(--danger);
}

.my-work-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.35rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.my-work-item:hover {
  border-color: var(--primary);
}

.my-work-item .title {
  font-weight: 600;
}

.my-work-item .meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.my-work-item .due {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.my-work-group.overdue .due {
  color: var(--danger);
  font-weight: 700;
}

/* ── Page headers: the dusk landscape from the banner behind the page title ── */
.page-hero {
  position: relative;
  padding: 1.1rem 1.3rem 4.6rem;
  border: 2px solid #120e18;
  border-radius: 6px;
  /* the strip sits along the bottom; above it the night sky colour continues behind the title */
  background: #26203a url("img/scene-strip.png") center bottom / 100% auto no-repeat;
  image-rendering: pixelated;
  box-shadow: 0 4px 0 #120e18;
}

.page-hero h1 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #f4e8d0;
  text-shadow: 2px 2px 0 #14101a;
}

.page-hero h1 img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

.page-hero p {
  color: #f0d9b8;
  text-shadow: 1px 1px 0 #14101a;
}

.page-hero .crumb {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: #e8b77a;
  text-decoration: none;
  text-shadow: 1px 1px 0 #14101a;
}

.page-hero .crumb:hover {
  text-decoration: underline;
}

.tab-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  vertical-align: -3px;
  margin-right: 0.3rem;
}

/* ════════════════════════════════════════════════════════════════════════
   Staff HQ layout pass (2026-10-29). Modelled on Trello, Linear and Asana:
   a slim header, one board toolbar with a "⋯ Board" menu, compact cards that
   open on click, short columns with "+ Add ticket", and a ticket view with the
   work on the left and its properties on the right. Later rules win over the
   older ones above.
   ════════════════════════════════════════════════════════════════════════ */
.hq-topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem 0.5rem;
  --topbar-control-height: 34px;
}
.hq-topbar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.hq-brand {
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.hq-brand h1 { font-size: 1.25rem; }
.hq-topbar .board-switcher-row { min-width: 0; }
.hq-topbar .back-boards-btn,
.hq-topbar #boardSwitcher {
  height: var(--topbar-control-height);
  font-size: 0.88rem;
}
.hq-topbar #boardSwitcher {
  max-width: 240px;
  font-weight: 700;
}
.hq-global {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hq-global > button,
.hq-global .pancake-toggle {
  height: var(--topbar-control-height);
  padding: 0 0.7rem;
  font-size: 0.85rem;
}
.hq-global .user-chip { white-space: nowrap; }

.hq-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin-left: 0 !important;
  justify-content: flex-start !important;
}
.hq-toolbar .search-box {
  flex: 0 1 280px;
  min-width: 120px;
  height: var(--topbar-control-height);
}
.hq-toolbar button,
.hq-toolbar #filterControlsBtn {
  height: var(--topbar-control-height);
  font-size: 0.88rem;
  white-space: nowrap;
}

.board-menu { position: relative; }
.board-menu .more-actions-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}
.board-menu .notif-badge { position: static; }
.board-menu-dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 50;
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.3rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.board-menu.open .board-menu-dropdown { display: flex; flex-direction: column; }
.board-menu-item {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  height: auto !important;
}
.board-menu-item:hover { background: var(--panel-2); }

/* Board: columns side by side, as tall as their cards. */
main { padding-top: 0.4rem; }
.board {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.column {
  flex: 1 0 280px;
  max-width: 380px;
  min-height: 0;
  max-height: calc(100vh - 175px);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.column-header { margin-bottom: 0.5rem; }
.column-header h2 {
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.column-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.drop-zone {
  min-height: 48px;
  gap: 0.5rem;
  overflow-y: auto;
}
.column-add {
  margin-top: 0.5rem;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  text-align: left;
  font-size: 0.85rem;
}
.column-add:hover { color: var(--text); border-color: var(--primary); }

/* Cards: title, two lines of description, one row of badges. */
.card {
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.12s;
}
.card:hover, .card:focus-visible { border-color: var(--primary); }
.card h3 { font-size: 0.93rem; line-height: 1.3; }
.card p.ticket-card-description {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  white-space: normal;
}
.card .card-badges { margin: 0.45rem 0 0; }
.card-people { margin-left: auto; display: inline-flex; gap: 0.15rem; }
.due-badge, .subtask-badge {
  font-size: 0.72rem;
  padding: 0.08rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.due-badge.overdue { background: #c0392b; border-color: #c0392b; color: #fff; }
.due-badge.today { background: #e89a52; border-color: #e89a52; color: #1e1408; }
.due-badge.soon { color: #f0c27a; border-color: #8a6a3a; }
.due-badge.done { text-decoration: line-through; opacity: 0.7; }
.subtask-badge.complete { color: #6ef2a2; border-color: #2f7a52; }

/* Home: boards are one clickable row each, with progress. */
.board-picker-header { margin: 1.5rem 0 0.75rem; }
.board-picker-create {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.9rem;
}
.board-picker-create[hidden] { display: none; }
.board-picker-create label { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.board-picker-create input { flex: 1 1 220px; }
a.board-card { color: inherit; text-decoration: none; }
.board-card-arrow { color: var(--muted); font-size: 1.1rem; }
a.board-card:hover .board-card-arrow { color: var(--primary); }
.board-card-overdue { color: #ff8a80; font-weight: 700; }
.board-card-progress {
  margin-top: 0.35rem;
  height: 4px;
  max-width: 260px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.board-card-progress span { display: block; height: 100%; background: #6ef2a2; }

/* Ticket view */
.editor-panel { min-height: min(78vh, 860px); }
.editor-main { gap: 0.9rem; padding: 0.9rem 1.2rem 1.2rem; }
.editor-topline { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.editor-main .editor-breadcrumb { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.editor-close {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  padding: 0.2rem 0.5rem;
  color: var(--muted);
}
.editor-close:hover { color: var(--text); }
.editor-title-input {
  font-size: 1.35rem;
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.25rem 0.4rem;
  margin-left: -0.4rem;
}
.editor-title-input:hover, .editor-title-input:focus { border-color: var(--border); background: var(--panel); }
.editor-section { display: flex; flex-direction: column; gap: 0.4rem; }
.editor-section-title {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.editor-section.desc-label { flex: 0 0 auto; }
#editorDescription { min-height: 110px; max-height: 40vh; flex: 0 0 auto; }
.editor-subtasks .sidebar-header { padding: 0; border: 0; gap: 0.5rem; justify-content: flex-start; }
.editor-subtasks .sidebar-header select { margin-left: auto; max-width: 150px; font-size: 0.8rem; }
.editor-subtasks #checklistContainer { overflow: visible; padding: 0; flex: 0 0 auto; }
.ticket-notes { border: 0; padding: 0; }

.editor-props {
  width: 290px;
  padding: 1rem;
  gap: 0.9rem;
  overflow-y: auto;
  background: color-mix(in srgb, var(--panel) 70%, black);
}
.prop { display: flex; flex-direction: column; gap: 0.3rem; }
.prop.todo-date-block { align-items: stretch; }
.prop .todo-date-btn { align-self: flex-start; }
.prop-footer { justify-content: flex-start; }
.editor-subtasks .sidebar-header h3 { font-size: 0.78rem; }
.prop-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.prop .todo-date-btn { text-align: left; }
.prop-footer { margin: auto 0 0; padding: 0.6rem 0 0; border-top: 1px solid var(--border); }
button.danger-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
  padding-left: 0;
}
button.danger-quiet:hover { text-decoration: underline; }

.danger-zone {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
.danger-zone h3 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.danger-zone p { margin: 0 0 0.55rem; }

/* Phones: one toolbar block, columns swipe sideways like the Trello app, ticket properties above the work. */
@media (max-width: 760px) {
  .hq-topbar { padding: 0.55rem 0.75rem 0.4rem; }
  .hq-topbar-row { flex-wrap: wrap; gap: 0.5rem; }
  .hq-topbar .board-switcher-row { order: 3; flex: 1 0 100%; }
  .hq-topbar #boardSwitcher { flex: 1; max-width: none; width: auto; min-width: 0; }
  .hq-topbar .back-boards-btn { width: auto; min-width: 0; }
  .hq-global .user-chip { display: none; }
  .hq-global > button, .hq-global .pancake-toggle { padding: 0 0.55rem; }
  .hq-toolbar { flex-wrap: wrap; }
  .hq-toolbar .search-box { flex: 1 0 100%; max-width: none; }
  .hq-toolbar > * { flex: 1 1 auto; }
  .hq-toolbar > .board-menu > button, .hq-toolbar > .filter-controls-dropdown > button { width: 100%; }
  .board-menu-dropdown { left: auto; right: 0; }
  main { padding: 0.3rem 0.6rem 0.8rem; }
  .board { scroll-snap-type: x mandatory; gap: 0.6rem; }
  .column { flex: 0 0 86vw; max-width: none; scroll-snap-align: start; max-height: calc(100vh - 210px); }
  .editor-panel { flex-direction: column; overflow-y: auto; }
  /* title first, then the properties, then the work (Linear mobile) */
  .editor-main { display: contents; }
  .editor-topline, .editor-title-input { margin: 0 0.9rem; }
  .editor-topline { order: 1; padding-top: 0.8rem; }
  .editor-title-input { order: 2; }
  .editor-props { width: 100%; order: 3; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0.6rem 0; }
  .editor-main > .editor-section { order: 4; margin: 0 0.9rem 0.9rem; }
  .prop-footer { margin-top: 0; }
}

/* My work (2026-10-29): tabs, short rows, plain-language due dates. */
.my-work-header { display: block; margin-bottom: 0.7rem; }
.my-work-header h2 { margin: 0 0 0.2rem; font-size: 1.3rem; }
.my-work-header p { margin: 0; }
.my-work-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.6rem;
  overflow-x: auto;
}
.my-work-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  white-space: nowrap;
}
.my-work-tab:hover { color: var(--text); }
.my-work-tab.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 700; }
.my-work-tab-count {
  font-size: 0.72rem;
  background: var(--panel-2);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  margin-left: 0.2rem;
}
.my-work-rows {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.my-work-rows .my-work-item {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 0.6rem 0.8rem;
  gap: 0.7rem;
}
.my-work-rows .my-work-item:last-child { border-bottom: 0; }
.my-work-rows .my-work-item:hover { background: var(--panel-2); }
.my-work-status {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--muted);
}
.my-work-status.started {
  border-color: #f0c27a;
  background: linear-gradient(90deg, #f0c27a 50%, transparent 50%);
}
.my-work-text { flex: 1; min-width: 0; }
.my-work-item .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-work-item .meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.my-work-item .meta { justify-content: flex-start; font-size: 0.8rem; margin-top: 0.1rem; }
.my-work-item .meta .team-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.my-work-side { display: flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; }
.my-work-side .due-badge { font-size: 0.78rem; padding: 0.12rem 0.5rem; }
.my-work-more {
  margin-top: 0.5rem;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
}
.my-work-more:hover { color: var(--text); border-color: var(--primary); }
.my-work-empty { padding: 0.8rem 0.2rem; }
@media (max-width: 760px) {
  .my-work-rows .my-work-item { padding: 0.6rem; }
  .my-work-item .meta { white-space: normal; }
  .my-work-item .title { white-space: normal; }
}

/* ════════════════════════════════════════════════════════════════════════
   Staff HQ home (2026-10-31): land on every board laid out as tiles by team,
   with My work behind the 🔔 button in the header (index.html#my-work).
   ════════════════════════════════════════════════════════════════════════ */
.board-picker-screen .board-picker-content { width: min(1180px, 100%); }
.board-picker-screen [hidden] { display: none !important; }

.hq-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: var(--topbar-control-height);
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}
.hq-bell:hover { border-color: var(--primary); }
.hq-bell.active { border-color: var(--primary); background: var(--panel-2); font-weight: 700; }
.hq-bell-icon { font-size: 0.95rem; line-height: 1; }
.hq-bell-badge {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--primary);
  color: #1e1408;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}
.hq-bell-badge.late { background: #c0392b; color: #fff; }
.hq-bell-badge[hidden] { display: none; }

.hq-hero { margin-bottom: 1.4rem; padding-bottom: 5.2rem; }
.hq-hero h1 { margin: 0 0 0.25rem; font-size: 1.55rem; }
.hq-hero p { margin: 0 0 0.9rem; }
.hq-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hq-stat {
  min-width: 104px;
  padding: 0.45rem 0.75rem;
  border: 2px solid #120e18;
  border-radius: 6px;
  background: rgba(23, 18, 31, 0.82);
  box-shadow: 0 3px 0 #120e18;
  color: #f4e8d0;
}
.hq-stat strong { display: block; font-size: 1.35rem; line-height: 1.2; }
.hq-stat span { font-size: 0.75rem; color: #d8c4a6; text-transform: uppercase; letter-spacing: 0.05em; }
.hq-stat.doing strong { color: #f0c27a; }
.hq-stat.warn strong { color: #ffb36b; }
.hq-stat.late strong { color: #ff8a80; }
.hq-stat.done strong { color: #6ef2a2; }

.hq-back {
  display: inline-block;
  margin-bottom: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.hq-back:hover { color: var(--primary); }
.board-picker-screen .my-work { max-width: 860px; margin: 0 auto; }

.hq-team { margin: 0 0 1.6rem; }
.hq-team-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  padding-left: 0.6rem;
  border-left: 4px solid var(--team);
}
.hq-team-head h3 { margin: 0; font-size: 1.05rem; }
.hq-team-info { font-size: 0.8rem; color: var(--muted); }
.hq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.8rem;
}
.hq-tile {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
a.hq-tile:hover {
  transform: translateY(-2px);
  border-color: var(--team);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.hq-tile-band {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--team) 55%, transparent), color-mix(in srgb, var(--team) 18%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--team) 50%, var(--border));
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hq-tile-band img { width: 16px; height: 16px; image-rendering: pixelated; }
.hq-tile-flag {
  margin-left: auto;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #8a5a1c;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.hq-tile-flag.late { background: #c0392b; }
.hq-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem 0.75rem;
}
.hq-tile-body h4 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.hq-seg {
  display: flex;
  gap: 2px;
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.hq-seg span { display: block; flex-basis: 0; }
.hq-seg-todo { background: #7d6f93; }
.hq-seg-doing { background: #f0c27a; }
.hq-seg-done { background: #6ef2a2; }
.hq-seg-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.7rem; font-size: 0.78rem; color: var(--muted); }
.hq-key::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.3rem;
  border-radius: 2px;
  vertical-align: 0;
}
.hq-key-todo::before { background: #7d6f93; }
.hq-key-doing::before { background: #f0c27a; }
.hq-key-done::before { background: #6ef2a2; }
.hq-tile-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.hq-people { display: flex; }
.hq-person {
  width: 24px;
  height: 24px;
  margin-right: -6px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.hq-updated { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.hq-team-add {
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}
.hq-team-add:hover { color: var(--text); border-color: var(--team); background: var(--panel); }
html.theme-light .hq-seg-todo, html.theme-light .hq-key-todo::before { background: #a99cc0; }
html.theme-light .hq-seg-doing, html.theme-light .hq-key-doing::before { background: #e0a040; }
html.theme-light .hq-seg-done, html.theme-light .hq-key-done::before { background: #2fae6a; }

@media (max-width: 760px) {
  .hq-bell-label { display: none; }
  .hq-hero { padding-bottom: 3.6rem; }
  .hq-stat { min-width: 0; flex: 1 1 calc(33% - 0.5rem); }
  .hq-grid { grid-template-columns: 1fr; }
}

/* ── Economy dashboard (2026-10-31): economy.html. Made = series 1 (blue), spent = series 2 (orange); both pass the
      palette checks on the dark and light panels. Text never takes the series colours. ── */
.econ-root {
  --series-made: #3987e5;
  --series-spent: #d95926;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
html.theme-light .econ-root {
  --series-made: #2a78d6;
  --series-spent: #eb6834;
}
.econ-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.econ-toolbar button {
  height: var(--topbar-control-height, 34px);
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}
.econ-toolbar button.active { border-color: var(--primary); background: var(--panel-2); font-weight: 700; }
.econ-updated { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.econ-error { padding: 0.6rem 0.8rem; border: 1px solid var(--danger); border-radius: 8px; color: var(--text); }
.econ-card {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  min-width: 0;
}
.econ-card h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.econ-card h3 { margin: 0.6rem 0 0.4rem; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.econ-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.econ-table-toggle {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
}
.econ-table-toggle:hover { color: var(--text); border-color: var(--primary); }
.econ-help { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.econ-foot { margin-top: 0.5rem; }
.econ-empty { margin: 1rem 0; color: var(--muted); font-size: 0.88rem; }
.econ-legend { display: flex; gap: 1rem; margin: 0 0 0.4rem; color: var(--muted); font-size: 0.8rem; }
.econ-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.econ-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.econ-key.made { background: var(--series-made); }
.econ-key.spent { background: var(--series-spent); }
.econ-chart { width: 100%; overflow: hidden; }
.econ-chart svg { display: block; max-width: 100%; }
.econ-bar.made { fill: var(--series-made); }
.econ-bar.spent { fill: var(--series-spent); }
.econ-hit { fill: transparent; cursor: crosshair; }
.econ-hit:hover { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.econ-axis { stroke: var(--muted); stroke-width: 1; opacity: 0.7; }
.econ-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.econ-tick { fill: var(--muted); font-size: 11px; }
.econ-line { fill: none; stroke: var(--series-made); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.econ-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.econ-dot { fill: var(--series-made); stroke: var(--panel); stroke-width: 2; pointer-events: none; }
.econ-tooltip {
  position: fixed;
  z-index: 50;
  min-width: 170px;
  max-width: 280px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.8rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.econ-tooltip[hidden] { display: none; }
.econ-tip-title { margin-bottom: 0.3rem; font-weight: 700; }
.econ-tip-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.08rem 0; }
.econ-tip-row span { flex: 1; color: var(--muted); }
.econ-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.econ-split > .econ-card { margin-bottom: 1rem; }
.econ-card .econ-split { gap: 1.5rem; }
.econ-row { margin: 0 0 0.55rem; }
.econ-row-head { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.86rem; }
.econ-row-head span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.econ-row-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.econ-row-value small { color: var(--muted); }
.econ-track { height: 6px; margin-top: 0.25rem; border-radius: 4px; background: color-mix(in srgb, var(--border) 60%, transparent); }
.econ-fill { height: 100%; border-radius: 4px; }
.econ-fill.made { background: var(--series-made); }
.econ-fill.spent { background: var(--series-spent); }
.econ-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0.4rem 0 0; font-size: 0.88rem; }
.econ-facts dt { color: var(--muted); }
.econ-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.econ-table-wrap { max-height: 320px; overflow: auto; }
.econ-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.econ-table th, .econ-table td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); text-align: right; }
.econ-table th:first-child, .econ-table td:first-child { text-align: left; }
.econ-table th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; }
.econ-root code { font-size: 0.8rem; }
.hq-econ-link { gap: 0.35rem; }
@media (max-width: 720px) {
  .econ-root { padding: 1rem 16px 2rem; }
  .econ-split { grid-template-columns: 1fr; gap: 0; }
  .econ-card .econ-split { gap: 0; }
  .econ-updated { margin-left: 0; flex-basis: 100%; }
}
