* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f7f7f9;
  color: #1a1a1a;
}
main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: #1a1a2e;
  color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar .brand { font-weight: 700; }
.topbar .who { margin-left: auto; opacity: 0.85; font-size: 0.9em; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  max-width: none;
}
.login-box {
  background: #fff;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 320px;
}
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9em; }
.login-box input { padding: 8px; border: 1px solid #ccc; border-radius: 6px; }
.login-box button {
  padding: 10px; border: none; border-radius: 6px;
  background: #1a1a2e; color: #fff; font-weight: 600; cursor: pointer;
}
.error { color: #e74c3c; font-size: 0.9em; }
.hint { color: #666; font-size: 0.85em; }

.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.filter-toggle a {
  padding: 6px 14px; border-radius: 20px; text-decoration: none; color: #333;
  border: 1px solid #ccc; margin-left: 8px; font-size: 0.9em;
}
.filter-toggle a.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

.priority-pill {
  color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 0.8em; text-transform: capitalize;
}

.back-link { display: inline-block; margin-bottom: 12px; color: #333; text-decoration: none; }
.task-header {
  background: #fff; border-left: 6px solid #999; border-radius: 8px;
  padding: 18px 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.task-description { color: #444; }
.task-meta { display: flex; gap: 14px; font-size: 0.9em; color: #555; flex-wrap: wrap; }
.task-meta a { color: #1a1a2e; }

.legend { display: flex; gap: 18px; margin-top: 12px; font-size: 0.85em; flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.legend .dot-behind { background: #fff; border: 2px dashed #c0392b; }

.due-badge {
  padding: 2px 8px; border-radius: 12px; font-size: 0.8em;
  background: #eee; color: #444;
}
.due-badge.soon { background: #fdebd0; color: #b9770e; }
.due-badge.overdue { background: #fadbd8; color: #c0392b; font-weight: 600; }

.timeline { display: flex; flex-direction: column; gap: 4px; }
.timeline-date {
  margin-top: 18px; margin-bottom: 4px; font-weight: 700; color: #555;
  font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.03em;
}
.timeline-item {
  display: flex; flex-direction: column; gap: 8px; background: #fff;
  border-left: 5px solid #999; border-radius: 8px; padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.timeline-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.timeline-item.needs-confirm { background: #fffaf3; }
.timeline-item-link {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 10px; text-decoration: none; color: inherit;
}
.timeline-item-main { display: flex; flex-direction: column; gap: 2px; }
.timeline-item-title { font-weight: 600; }
.timeline-item-project { font-size: 0.8em; color: #777; }
.timeline-item-meta { display: flex; gap: 10px; align-items: center; font-size: 0.85em; color: #555; }
.needs-confirm-badge { background: #fdebd0; color: #b9770e; font-weight: 600; }
.confirm-inline-form { margin: 0; }
.confirm-btn {
  padding: 6px 14px; border: none; border-radius: 6px; background: #27ae60;
  color: #fff; font-weight: 600; cursor: pointer; font-size: 0.85em;
}
.confirm-btn:hover { background: #219150; }

.confirm-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fdebd0; color: #8a5a00; border-left: 4px solid #e67e22;
  padding: 14px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95em;
  flex-wrap: wrap;
}
.confirm-banner form { margin: 0; }

.profile-form { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.profile-form label { display: flex; flex-direction: column; gap: 4px; }
.profile-form input { padding: 8px; border: 1px solid #ccc; border-radius: 6px; }
.profile-form button {
  align-self: flex-start; padding: 8px 18px; border: none; border-radius: 6px;
  background: #1a1a2e; color: #fff; font-weight: 600; cursor: pointer;
}

.assign-form { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.assign-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9em; }
.assign-form input, .assign-form textarea, .assign-form select {
  padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-family: inherit;
  width: 100%; font-size: 1em;
}
.assign-form textarea { resize: vertical; min-height: 70px; }
.assign-form input[type="checkbox"] { width: auto; padding: 0; border: none; flex: none; }
.assign-form .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }

.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 0.9em; }
.priority-picker { display: flex; gap: 4px; }
.priority-option {
  flex: 1; display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 3px; padding: 4px 4px; border: 1px solid #ddd; border-radius: 6px; cursor: pointer;
  font-size: 0.72em; font-weight: 600; color: #777; background: #fff; user-select: none;
}
.priority-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.priority-option .priority-icon { font-size: 0.9em; line-height: 1; }
.priority-option.priority-low:has(input:checked) { border-color: #2ecc71; background: #eafaf1; color: #1e824c; }
.priority-option.priority-medium:has(input:checked) { border-color: #f1c40f; background: #fef9e7; color: #9a7d0a; }
.priority-option.priority-high:has(input:checked) { border-color: #e74c3c; background: #fdedec; color: #a93226; }

.assignee-picker { display: flex; flex-direction: column; gap: 4px; }
.assignee-picker select { font-weight: 600; }
.assignee-picker-note { font-size: 0.8em; color: #1e824c; }

.primary-btn {
  align-self: flex-start; padding: 10px 20px; border: none; border-radius: 6px;
  background: #1a1a2e; color: #fff; font-weight: 600; cursor: pointer; font-size: 0.95em;
  margin-right: 12px;
}

.candidate-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px; margin: 16px 0; align-items: start;
}
.candidate-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: #fff; border-radius: 8px; padding: 12px 16px; border: 2px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); cursor: pointer; height: 100%;
}
.candidate-card:has(input:checked) { border-color: #1a1a2e; }
.candidate-card.recommended { background: #f4fbf6; }
.candidate-main { flex: 1; }
.candidate-name { font-weight: 600; }
.candidate-role { font-weight: 400; color: #777; font-size: 0.85em; }
.candidate-skills { font-size: 0.85em; color: #2ecc71; margin-top: 2px; }
.candidate-skills.muted { color: #999; }
.candidate-reason { font-size: 0.85em; color: #1e824c; margin-top: 2px; }
.candidate-stats { display: flex; gap: 8px; flex-wrap: wrap; }

.recommended-tag {
  display: inline-block; background: #2ecc71; color: #fff; font-size: 0.7em;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 6px; border-radius: 4px; margin-right: 6px; vertical-align: middle;
}

.warning-note {
  background: #fdebd0; color: #8a5a00; border-left: 4px solid #e67e22;
  padding: 10px 14px; border-radius: 6px; font-size: 0.85em; margin: 12px 0;
}

.workload-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.workload-row {
  background: #fff; border-radius: 8px; padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 6px;
}
.workload-name { font-weight: 600; font-size: 0.95em; }
.workload-name a { color: inherit; text-decoration: none; }
.workload-name a:hover { text-decoration: underline; }
.workload-bar-track { background: #eee; border-radius: 6px; height: 8px; overflow: hidden; }
.workload-bar-fill { background: #1a1a2e; height: 100%; border-radius: 6px; }
.workload-stats { display: flex; gap: 8px; }

.project-progress-section, .off-track-section { margin-bottom: 28px; }
.project-progress-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.project-progress-row {
  background: #fff; border-radius: 8px; padding: 10px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 6px;
}
.project-progress-label { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.95em; }
.project-progress-fill { background: #27ae60; }

.off-track-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.off-track-row {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  background: #fdf2f0; border-left: 4px solid #c0392b; border-radius: 8px; padding: 10px 16px;
  text-decoration: none; color: inherit; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.off-track-row:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.off-track-main { display: flex; flex-direction: column; gap: 2px; }
.off-track-title { font-weight: 600; }
.off-track-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.blocking-badge { background: #f5d0c5; color: #8a2f0f; font-weight: 600; }

.focus-section { margin-bottom: 28px; }
.stacked-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #eee; margin-top: 8px; }
.stacked-bar-segment { height: 100%; }
.stacked-bar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 0.85em; color: #444; }
.stacked-bar-legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.team-focus-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.team-focus-row {
  background: #fff; border-radius: 8px; padding: 12px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.team-focus-name { font-weight: 600; font-size: 0.95em; }

.done-tag {
  display: inline-block; background: #27ae60; color: #fff; font-size: 0.55em;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 3px 8px; border-radius: 4px; vertical-align: middle; margin-left: 8px;
}
.due-badge.done-badge { background: #d6f5df; color: #1e824c; font-weight: 600; }
.timeline-item.done { opacity: 0.6; }
.timeline-item.done .timeline-item-title { text-decoration: line-through; }

.secondary-btn { background: #666; }

.dashboard-columns { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.dashboard-col { flex: 1 1 360px; min-width: 0; }
.column-heading {
  font-size: 1em; text-transform: uppercase; letter-spacing: 0.03em; color: #555;
  margin-bottom: 8px;
}

.deps-picker { display: flex; flex-direction: column; gap: 4px; }
.dep-group-label {
  font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  color: #777; margin-top: 8px;
}
.dep-option {
  display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 6px;
  padding: 8px 10px; font-size: 0.9em; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dep-option.recommended { background: #f4fbf6; }
.dep-option .due-badge { margin-left: auto; }

.todo-days { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.todo-day {
  background: #fff; border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-left: 5px solid #ccc;
}
.todo-day.todo-today { border-left-color: #1a1a2e; background: #f4f4fa; }
.todo-day.todo-overloaded { border-left-color: #c0392b; }
.todo-day-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.todo-day-label { font-weight: 700; font-size: 1.05em; }
.todo-day.todo-today .todo-day-label { color: #1a1a2e; }
.todo-day-items { display: flex; flex-direction: column; gap: 6px; }
.todo-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none;
  color: inherit; background: #fafafa; border-radius: 6px; padding: 8px 12px; font-size: 0.9em;
}
.todo-item:hover { background: #f0f0f5; }
.todo-item-title { font-weight: 600; }
.todo-item-project { color: #777; font-size: 0.9em; }
.blocked-badge { background: #eaeaf5; color: #4a4a7a; }

.notes-items { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.notes-task-card {
  background: #fff; border-left: 5px solid #999; border-radius: 8px;
  padding: 12px 16px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.notes-task-include, .checkbox-line {
  flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 0.95em;
}
.candidate-list.compact { gap: 6px; margin: 4px 0 0; }
.candidate-list.compact .candidate-card { padding: 8px 12px; }

.paste-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 100px; border: 2px dashed #bbb; border-radius: 8px;
  background: #fafafa; color: #777; font-size: 0.9em; text-align: center;
  padding: 16px; cursor: text;
}
.paste-zone:focus { outline: none; border-color: #1a1a2e; background: #f4f4fa; }
.paste-zone img { max-width: 100%; max-height: 220px; border-radius: 6px; }

.ai-progress { margin-top: 10px; max-width: 560px; }
.ai-progress-bar { background: #eee; border-radius: 6px; height: 10px; overflow: hidden; }
.ai-progress-fill {
  height: 100%; width: 0%; background: #1a1a2e; border-radius: 6px;
  transition: width 0.2s ease;
}
.ai-progress-pct { font-weight: 700; }

.table-scroll { overflow-x: auto; margin-top: 12px; border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.9em; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; }
.data-table th {
  background: #f4f4f8; font-weight: 700; color: #555; text-transform: uppercase;
  font-size: 0.78em; letter-spacing: 0.02em;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafafa; }
.data-table a { color: #1a1a2e; }

.source-link { font-size: 0.85em; color: #1a1a2e; }

.source-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f4f4f8;
  border: 1px solid #e0e0e8;
  border-radius: 8px;
  padding: 18px 20px;
  line-height: 1.5;
  font-family: inherit;
}

.th-filterable { position: relative; }
.th-label { margin-right: 4px; }
.th-filter-btn {
  background: none; border: none; cursor: pointer; font-size: 0.85em; color: #777;
  padding: 0 2px; vertical-align: middle; text-transform: none;
}
.th-filter-btn:hover { color: #1a1a2e; }
.th-filter-dropdown {
  display: none; position: fixed; z-index: 20;
  background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12); min-width: 200px; text-transform: none;
  font-weight: 400; letter-spacing: normal;
}
.th-filter-dropdown.open { display: block; }
.sort-options { display: flex; flex-direction: column; gap: 2px; }
.sort-options + .filter-group-title { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; }
.sort-option-btn {
  background: none; border: none; cursor: pointer; text-align: left; padding: 5px 6px;
  font-size: 0.85em; font-weight: 400; color: #1a1a1a; border-radius: 5px; white-space: nowrap;
}
.sort-option-btn:hover { background: #f0f0f5; }
.filter-group-title {
  font-size: 0.78em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  color: #777; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.filter-group-title button {
  font-size: 0.85em; font-weight: 600; background: none; border: none; color: #1a1a2e;
  cursor: pointer; text-decoration: underline; padding: 0; text-transform: none; letter-spacing: normal;
}
.filter-options { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.filter-option { display: flex; align-items: center; gap: 6px; font-size: 0.85em; font-weight: 400; }
.filter-option input { width: auto; }
.filter-empty-msg { font-size: 0.9em; color: #777; padding: 8px 0; }

.meeting-notes-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.meeting-note-card {
  background: #fff; border-radius: 8px; padding: 14px 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-left: 5px solid #1a1a2e;
}
.meeting-note-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85em; color: #777; margin-bottom: 8px; }
.meeting-note-text {
  white-space: pre-wrap; word-break: break-word; background: #f7f7f9; border-radius: 6px;
  padding: 10px 14px; font-size: 0.9em; line-height: 1.5; margin-bottom: 10px;
}
.meeting-note-tasks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meeting-note-tasks-label { font-size: 0.8em; color: #777; margin-right: 4px; }
.meeting-note-task-link {
  background: #eaeaf5; color: #1a1a2e; text-decoration: none; font-size: 0.8em; padding: 4px 10px;
  border-radius: 12px;
}
.meeting-note-task-link:hover { background: #dcdcf0; }

/* Bigger, easier-to-tap everything on phones -- 16px inputs stop iOS Safari
   from auto-zooming on focus, and buttons/rows get real thumb-sized targets
   instead of ones sized for a mouse cursor. */
@media (max-width: 640px) {
  main { padding: 16px; }
  .topbar { gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
  .assign-form input, .assign-form textarea, .assign-form select,
  .profile-form input, .login-box input {
    font-size: 16px; padding: 13px;
  }
  .primary-btn, .confirm-btn, .login-box button, .profile-form button {
    padding: 14px 22px; font-size: 1.05em; width: 100%;
  }
  .priority-option { padding: 14px 8px; font-size: 1em; }
  .candidate-card { padding: 16px 18px; }
  .candidate-list, .candidate-list.compact { grid-template-columns: 1fr; }
  .timeline-item-link, .off-track-row, .todo-item { padding: 4px 0; }
  .data-table th, .data-table td { padding: 12px 14px; }
  .th-filter-dropdown { min-width: 170px; }
}
