:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #eef2f5;
  --text: #1d252d;
  --muted: #657381;
  --line: #d9e0e7;
  --accent: #334155;
  --accent-dark: #1f2937;
  --danger: #b33a3a;
  --warning: #b76c1d;
  --ok: #2f7a48;
  --shadow: 0 16px 40px rgba(31, 44, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  margin: 24px 0 10px;
}

.task-actions h3 {
  margin: 0 0 6px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  font-size: 13px;
  line-height: 1.4;
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-size: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.14);
}

.primary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  background: var(--surface-strong);
  color: var(--text);
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  background: var(--surface-strong);
}

.board-view {
  --project-accent: #607080;
  --project-tint: #f1f4f6;
  --project-column-tint: #eef2f5;
  --project-column-border: #cbd5dc;
  min-height: 100vh;
  padding: 0 24px 24px;
}

.project-theme-teal {
  --project-accent: #2f7f79;
  --project-tint: #eef8f6;
  --project-column-tint: #edf7f5;
  --project-column-border: #bfddd8;
}

.project-theme-blue {
  --project-accent: #396f9f;
  --project-tint: #eef5fb;
  --project-column-tint: #edf6fd;
  --project-column-border: #bfd6ea;
}

.project-theme-violet {
  --project-accent: #7457a6;
  --project-tint: #f3f0fa;
  --project-column-tint: #f1ecfb;
  --project-column-border: #d6c7ec;
}

.project-theme-green {
  --project-accent: #4f7d45;
  --project-tint: #f0f7ee;
  --project-column-tint: #eff8ec;
  --project-column-border: #cbe2c3;
}

.project-theme-amber {
  --project-accent: #b07628;
  --project-tint: #fff6e6;
  --project-column-tint: #fff3d8;
  --project-column-border: #e9d19b;
}

.project-theme-rose {
  --project-accent: #ad5a6a;
  --project-tint: #fff0f3;
  --project-column-tint: #fff0f4;
  --project-column-border: #e7c2cb;
}

.project-theme-slate {
  --project-accent: #607080;
  --project-tint: #f1f4f6;
  --project-column-tint: #eef2f5;
  --project-column-border: #cbd5dc;
}

.workspace-header {
  margin: 0 -24px 18px;
  padding: 22px 24px 18px;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--project-accent) 16%, #ffffff) 0%,
    color-mix(in srgb, var(--project-accent) 7%, #ffffff) 44%,
    #f8fafb 100%
  );
  border-top: 2px solid color-mix(in srgb, var(--project-accent) 52%, #ffffff);
  border-bottom: 1px solid color-mix(in srgb, var(--project-accent) 22%, var(--line));
}

.board-top-row,
.toolbar {
  max-width: 1500px;
  margin: 0 auto;
}

.board-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.user-menu {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  padding: 0 12px;
  font-weight: 700;
}

.user-menu-button:hover,
.user-menu-button[aria-expanded="true"] {
  border-color: #c4d0d9;
  background: var(--surface);
}

.user-menu-caret {
  color: var(--muted);
  font-size: 13px;
}

.user-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(31, 44, 58, 0.14);
}

.user-menu-item {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.user-menu-item:hover:not(:disabled) {
  background: var(--surface-strong);
}

.user-menu-item:disabled {
  color: #9aa6b2;
  cursor: not-allowed;
}

.project-action-menu {
  position: relative;
}

.project-action-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 260px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(31, 44, 58, 0.14);
}

.project-picker {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.project-picker-title {
  margin: 4px 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-picker-item {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px 14px 1fr;
  gap: 6px;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.project-picker-item:hover:not(:disabled) {
  background: var(--surface-strong);
}

.project-picker-item:disabled {
  background: #eef3f5;
  color: var(--project-accent);
  cursor: default;
}

.project-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dot-color, var(--project-accent));
}

.theme-dot-teal {
  --dot-color: #2f7f79;
}

.theme-dot-blue {
  --dot-color: #396f9f;
}

.theme-dot-violet {
  --dot-color: #7457a6;
}

.theme-dot-green {
  --dot-color: #4f7d45;
}

.theme-dot-amber {
  --dot-color: #b07628;
}

.theme-dot-rose {
  --dot-color: #ad5a6a;
}

.theme-dot-slate {
  --dot-color: #607080;
}

.project-picker-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-action-divider {
  height: 1px;
  margin: 6px;
  background: var(--line);
}

.project-action-item {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.project-action-item:hover:not(:disabled) {
  background: var(--surface-strong);
}

.project-action-item:disabled {
  color: #9aa6b2;
  cursor: not-allowed;
}

.project-hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
}

.project-marker {
  display: none;
}

.project-summary {
  min-width: 0;
  flex: 1;
}

.project-summary h2 {
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}

.project-summary .eyebrow {
  display: none;
}

.project-description {
  max-width: 920px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.project-path {
  max-width: 920px;
  margin-top: 6px;
  color: #4c5a67;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.toolbar label {
  min-width: 180px;
}

.toolbar label:last-child {
  flex: 1;
}

.search-field {
  min-width: min(520px, 100%);
}

.quick-add {
  max-width: 1500px;
  margin: 0 auto 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(130px, 190px));
  gap: 12px;
}

.project-form-grid {
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr) minmax(260px, 1fr);
}

.wide {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.board {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  align-items: stretch;
  overflow-x: visible;
  padding-bottom: 12px;
}

.board.board-dragging {
  align-items: stretch;
}

.column {
  min-width: 220px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
}

.board.board-dragging .column {
  background: var(--project-column-tint);
  border-color: var(--project-column-border);
}

.column-drop-target {
  border-color: var(--project-accent);
  background: var(--project-tint);
}

.column-header {
  position: sticky;
  top: 8px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: calc(100% - 28px);
  margin: 0 auto 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--project-accent) 14%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--project-accent) 34%, #ffffff);
  border-radius: 8px;
  box-shadow: 0 5px 12px rgba(31, 44, 58, 0.07);
  font-weight: 700;
}

.column-drop-target .column-header {
  background: color-mix(in srgb, var(--project-accent) 20%, #ffffff);
  border-color: var(--project-accent);
}

.column-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.column-filter {
  min-width: 88px;
  max-width: 96px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 6px;
}

.task-card {
  width: 100%;
  height: 174px;
  text-align: left;
  display: grid;
  grid-template-rows: 20px 44px auto 24px auto;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  color: var(--text);
}

.task-card:hover {
  border-color: color-mix(in srgb, var(--priority-color, var(--accent)) 54%, #ffffff);
  box-shadow: 0 8px 18px rgba(31, 44, 58, 0.08);
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card.dragging {
  cursor: grabbing;
  opacity: 0.58;
}

.task-card-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.task-key {
  justify-self: start;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #43515d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
}

.task-state-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.overdue-badge {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 22px;
}

.overdue-clock {
  position: absolute;
  top: 1px;
  right: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #4d3b26;
  border-radius: 999px;
  background: #fff8e8;
  box-shadow: inset 0 0 0 3px #ffe2a8;
}

.overdue-clock::before,
.overdue-clock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  border-radius: 999px;
  background: #4d3b26;
  transform-origin: 50% 0;
}

.overdue-clock::before {
  height: 6px;
  transform: translate(-50%, -1px) rotate(0deg);
}

.overdue-clock::after {
  height: 5px;
  transform: translate(-50%, -1px) rotate(120deg);
}

.overdue-warning {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 15px;
  height: 13px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #f2b13f;
  color: #3d2b16;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding-top: 3px;
}

.stale-badge {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.stale-oak-leaf {
  width: 20px;
  height: 20px;
  fill: #dfe8bc;
  stroke: #536b35;
  stroke-width: 1.9;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.7));
}

.stale-oak-vein {
  fill: none;
  stroke: #6c7d45;
  stroke-width: 1.25;
  stroke-linecap: round;
}

.priority-card-critical {
  --priority-color: #b33a3a;
  background: #ffeaea;
  border-color: #e8b6b6;
}

.priority-card-high {
  --priority-color: #b76c1d;
  background: #fff1db;
  border-color: #e4c08d;
}

.priority-card-medium {
  --priority-color: #396f9f;
  background: #eaf4fc;
  border-color: #b8d2e7;
}

.priority-card-low {
  --priority-color: #6f7b85;
  background: #f1f5f4;
  border-color: #ccd9d5;
}

.task-subject {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.task-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 700;
  line-height: 1.3;
}

.task-meta,
.chips {
  min-height: 26px;
  overflow: hidden;
}

.task-meta,
.chips,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-tags-row {
  min-width: 0;
  min-height: 26px;
  overflow: hidden;
}

.chip {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 8px;
}

.assignee-chip,
.task-meta-button .user-avatar + span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assignee-chip {
  color: var(--text);
}

.user-avatar {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: var(--user-avatar-color);
  box-shadow: 0 0 0 1px rgba(31, 44, 58, 0.12);
}

.user-avatar-teal {
  --user-avatar-color: #2f7f79;
}

.user-avatar-blue {
  --user-avatar-color: #396f9f;
}

.user-avatar-violet {
  --user-avatar-color: #7457a6;
}

.user-avatar-green {
  --user-avatar-color: #4f7d45;
}

.user-avatar-amber {
  --user-avatar-color: #b07628;
}

.user-avatar-rose {
  --user-avatar-color: #ad5a6a;
}

.user-avatar-slate {
  --user-avatar-color: #607080;
}

.tag-chip {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(96, 112, 128, 0.2);
  border-radius: 999px;
  background: rgba(96, 112, 128, 0.1);
  color: #4a5865;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 8px;
}

.priority-high,
.priority-critical {
  color: #7c2d2d;
  background: rgba(179, 58, 58, 0.12);
}

.priority-medium {
  color: #2f5c83;
  background: rgba(57, 111, 159, 0.12);
}

.priority-low {
  color: #56636e;
  background: rgba(111, 123, 133, 0.13);
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.task-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 36, 0.42);
}

.task-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.project-modal-panel {
  width: min(680px, 100%);
}

.create-task-modal-panel {
  width: min(900px, 100%);
}

.settings-modal-panel {
  width: min(520px, 100%);
}

.filters-modal-panel {
  width: min(760px, 100%);
}

.task-detail-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: 20px;
  align-items: start;
}

.task-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.project-modal-grid {
  display: grid;
  gap: 14px;
}

.project-theme-picker,
.project-status-settings,
.user-color-picker {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.project-theme-picker legend,
.project-status-settings legend,
.user-color-picker legend {
  color: var(--muted);
  font-size: 12px;
  padding: 0 6px;
}

.status-limit-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.status-limit-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.status-limit-option strong,
.status-limit-option small {
  display: block;
}

.status-limit-option small {
  color: var(--muted);
  font-size: 12px;
}

.status-limit-option input {
  min-height: 34px;
  padding: 6px 8px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.theme-option {
  display: grid;
  grid-template-columns: auto 18px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.theme-option input {
  width: 16px;
  height: 16px;
}

.theme-option span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--theme-option-color);
}

.theme-option strong {
  font-size: 13px;
}

.theme-option:has(input:checked) {
  border-color: var(--theme-option-color);
  background: #fff;
}

.theme-option-teal {
  --theme-option-color: #2f7f79;
}

.theme-option-blue {
  --theme-option-color: #396f9f;
}

.theme-option-violet {
  --theme-option-color: #7457a6;
}

.theme-option-green {
  --theme-option-color: #4f7d45;
}

.theme-option-amber {
  --theme-option-color: #b07628;
}

.theme-option-rose {
  --theme-option-color: #ad5a6a;
}

.theme-option-slate {
  --theme-option-color: #607080;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.admin-settings {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.admin-settings h3 {
  margin: 0;
  font-size: 16px;
}

.admin-password-grid {
  display: grid;
  gap: 10px;
}

.admin-password-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-password-actions .hint {
  margin: 0;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

.project-members {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.project-members legend {
  color: var(--muted);
  font-size: 12px;
  padding: 0 6px;
}

.member-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.member-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.member-option:has(input:checked) {
  border-color: rgba(96, 112, 128, 0.32);
  background: #f8fafc;
}

.member-option:has(input:disabled) {
  color: var(--muted);
}

.member-option input {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 0;
  appearance: none;
  border: 1px solid #a9b4bf;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: inset 0 1px 1px rgba(31, 44, 58, 0.04);
  cursor: pointer;
}

.member-option input:checked {
  border-color: #4b5563;
  background: #4b5563;
}

.member-option input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.member-option input:focus-visible {
  outline: 3px solid rgba(96, 112, 128, 0.18);
  outline-offset: 2px;
}

.member-option input:disabled {
  border-color: #c8d0d8;
  background: #dce2e8;
  cursor: default;
}

.member-option input:disabled:checked {
  border-color: #8a96a3;
  background: #8a96a3;
}

.member-option strong,
.member-option small {
  display: block;
}

.member-option small {
  color: var(--muted);
  font-size: 12px;
}

.modal-task-key {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: #43515d;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
}

.task-detail-main,
.task-detail-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 18px;
}

.task-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.task-detail-header h2 {
  margin: 0;
}

.task-title-editor {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}

.task-title-view {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-title-view h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.title-edit-button {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 10px;
  font-size: 13px;
}

.task-title-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.task-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.task-meta-lookup {
  position: relative;
  min-width: 0;
}

.task-meta-button {
  max-width: 210px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta-button::after {
  content: "▾";
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 600;
}

.task-meta-button.is-status {
  border-color: rgba(96, 112, 128, 0.24);
  background: rgba(96, 112, 128, 0.12);
  color: #3e4b58;
}

.add-tag-button::after {
  content: "";
}

.task-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.task-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid rgba(96, 112, 128, 0.2);
  border-radius: 999px;
  background: rgba(96, 112, 128, 0.1);
  color: #4a5865;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 8px 5px 10px;
}

.task-tag-chip button {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(96, 112, 128, 0.16);
  color: inherit;
  font: inherit;
  line-height: 1;
  padding: 0;
}

.task-lookup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  width: min(260px, calc(100vw - 48px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lookup-options {
  display: grid;
  gap: 4px;
}

.lookup-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 7px 8px;
  text-align: left;
}

.lookup-option:hover,
.lookup-option.is-selected {
  background: var(--surface-strong);
}

.task-lookup-wide {
  width: min(320px, calc(100vw - 48px));
}

.task-detail-section {
  display: grid;
  gap: 10px;
}

.task-detail-section h3,
.task-actions h3 {
  margin: 0;
}

.task-actions {
  display: grid;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.task-close-lookup,
.task-close-lookup .primary-button {
  width: 100%;
}

.triage-actions,
.triage-action-group {
  display: grid;
  gap: 8px;
}

.triage-action-group {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.triage-action-group strong {
  font-size: 13px;
}

.triage-action-group select,
.triage-action-group button {
  width: 100%;
}

.close-lookup {
  left: auto;
  right: 0;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.quick-create-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.quick-create-row button {
  padding-inline: 0;
}

.description {
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  padding: 14px;
  background: var(--surface-strong);
  border-radius: 8px;
  margin: 0;
}

.comments,
.history {
  display: grid;
  gap: 8px;
}

.task-history-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.comment,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.comment-head,
.history-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.comment-text,
.history-text {
  line-height: 1.4;
  white-space: pre-wrap;
}

.comment-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.comment-attachment {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.comment-attachment img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.comment-drop-target {
  border-color: var(--accent);
  background: #f1f4f6;
}

.attachment-preview {
  display: grid;
  gap: 8px;
}

.pending-attachment {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.pending-attachment img {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}

.pending-attachment strong,
.pending-attachment span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-attachment span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .board-view {
    padding: 0 14px 14px;
  }

  .workspace-header {
    margin: 0 -14px 14px;
    padding: 14px;
  }

  .board-top-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-hero,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    align-items: stretch;
  }

  .top-actions > button,
  .top-actions .project-action-menu,
  .top-actions .user-menu {
    flex: 1 1 160px;
  }

  .top-actions .project-action-menu > button,
  .top-actions .user-menu-button {
    width: 100%;
    justify-content: center;
  }

  .project-marker {
    flex-basis: 6px;
    min-height: 6px;
  }

  .project-summary h2 {
    font-size: 26px;
  }

  .toolbar label {
    min-width: 0;
  }

  .form-grid,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .task-detail-panel,
  .task-actions {
    grid-template-columns: 1fr;
  }

  .task-detail-header {
    grid-template-columns: 1fr auto;
  }

  .task-title-edit {
    grid-template-columns: 1fr;
  }

  .task-meta-button {
    max-width: 100%;
  }

  .task-card {
    height: 188px;
    grid-template-rows: 20px 48px minmax(28px, auto) 28px auto;
  }

  .task-card .chips,
  .task-card .tags {
    gap: 5px;
  }

  .task-card .tags {
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
  }

  .task-card .tag-chip {
    flex: 0 1 auto;
  }

  .task-card .tag-chip:last-child {
    flex: 0 0 auto;
  }

  .inline-actions {
    justify-content: flex-end;
  }

  .wide {
    grid-column: auto;
  }

  .board {
    grid-template-columns: repeat(6, 260px);
    overflow-x: auto;
  }

  .task-modal {
    align-items: stretch;
    padding: 10px;
  }

  .task-modal-panel {
    max-height: calc(100vh - 20px);
  }
}
