.tasks-shell { max-width: 1360px; }
.tasks-header-nav { align-items: center; display: flex; gap: 8px; }
.tasks-intro { align-items: end; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 22px; }
.tasks-intro h1 { font-size: clamp(32px, 4vw, 46px); letter-spacing: -0.035em; line-height: 1.08; margin: 0; }
.tasks-intro > div > p:last-child { color: var(--muted); line-height: 1.55; margin: 10px 0 0; max-width: 720px; }
.preview-badge { background: #fff5d9; border: 1px solid #e6ce87; border-radius: 999px; color: #74580b; font-size: 12px; font-weight: 850; padding: 8px 12px; }
.task-grid-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(35, 49, 41, 0.045); overflow: hidden; }
.task-command-bar { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 18px; justify-content: space-between; min-height: 55px; padding: 8px 14px; }
.task-primary-commands { align-items: center; display: flex; flex-wrap: wrap; gap: 4px; }
.task-command { align-items: center; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--ink); cursor: pointer; display: inline-flex; font-size: 13px; font-weight: 750; gap: 5px; min-height: 34px; padding: 6px 10px; }
.task-command:hover:not(:disabled) { background: var(--surface-soft); border-color: var(--line); }
.task-command.is-primary { color: var(--green-dark); font-weight: 850; }
.task-command.is-danger { color: var(--red); }
.task-command:disabled { color: #9ba49e; cursor: not-allowed; }
.selection-summary { color: var(--muted); font-size: 12px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-filters { align-items: end; background: var(--surface-soft); border-bottom: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: minmax(240px, 1fr) minmax(190px, 0.45fr) minmax(150px, 0.3fr) auto; padding: 12px 14px; }
.task-filters label { display: grid; gap: 5px; }
.task-filters label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.task-filters input, .task-filters select { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); min-height: 36px; padding: 6px 9px; width: 100%; }
.task-filters strong { color: var(--muted); font-size: 12px; padding: 0 2px 10px; text-align: right; white-space: nowrap; }
.task-message, .task-form-message { background: var(--green-soft); color: var(--green-dark); font-size: 13px; font-weight: 700; margin: 0; padding: 10px 14px; }
.task-message.is-error, .task-form-message.is-error { background: var(--red-soft); color: var(--red); }
.task-grid-scroll { overflow-x: auto; }
.task-grid { border-collapse: collapse; min-width: 940px; width: 100%; }
.task-grid th { background: #f4f7f4; border-bottom: 1px solid var(--line); color: #546159; font-size: 11px; font-weight: 850; letter-spacing: 0.02em; padding: 9px 10px; text-align: left; text-transform: uppercase; }
.task-grid td { border-bottom: 1px solid #e8ece7; color: var(--ink); font-size: 13px; height: 56px; max-width: 260px; padding: 8px 10px; vertical-align: middle; }
.task-grid tbody tr { cursor: pointer; }
.task-grid tbody tr:hover { background: #f8faf8; }
.task-grid tbody tr:focus-visible { outline: 3px solid var(--green-dark); outline-offset: -3px; }
.task-grid tbody tr.is-selected { background: var(--green-soft); }
.task-grid tbody tr:last-child td { border-bottom: 0; }
.selection-column { text-align: center !important; width: 42px; }
.selection-column input { accent-color: var(--green); height: 16px; width: 16px; }
.number-column { text-align: right !important; white-space: nowrap; }
.task-title-link { background: none; border: 0; color: var(--green-dark); cursor: pointer; display: block; font-weight: 800; max-width: 100%; overflow: hidden; padding: 0; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.task-title-link:hover { text-decoration: underline; }
.task-grid td small { color: var(--muted); display: block; font-size: 10px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-label { display: block; font-weight: 750; }
.status-pill { border-radius: 999px; display: inline-block; font-size: 11px; font-weight: 850; padding: 5px 8px; white-space: nowrap; }
.status-not_started { background: #edf0ed; color: #58635d; }
.status-in_progress { background: #e6f0fb; color: #285d8f; }
.status-blocked { background: #fff3db; color: #7a570d; }
.status-done { background: var(--green-soft); color: var(--green-dark); }
.status-meeting { background: #eee9f8; color: #62448e; }
.task-empty { color: var(--muted); padding: 38px 20px; text-align: center; }
.task-empty strong { color: var(--ink); display: block; font-size: 17px; }
.task-empty p { margin: 6px 0 0; }
.tasks-footnote { align-items: center; color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; padding: 18px 4px 0; }
.tasks-footnote a { color: var(--green-dark); font-weight: 800; }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

.task-dialog, .delete-dialog { background: transparent; border: 0; max-height: 94vh; max-width: calc(100vw - 24px); padding: 0; width: 780px; }
.delete-dialog { width: 520px; }
.task-dialog::backdrop, .delete-dialog::backdrop { background: rgba(28, 37, 32, 0.48); backdrop-filter: blur(2px); }
.task-dialog-card, .delete-dialog-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; margin: 0; max-height: 92vh; overflow: hidden; }
.task-dialog-card > header { align-items: start; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 20px 22px; }
.task-dialog-card h2, .delete-dialog-card h2 { font-size: 24px; letter-spacing: -0.025em; margin: 0; }
.task-dialog-close { background: transparent; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 27px; height: 36px; line-height: 1; width: 36px; }
.task-dialog-close:hover { background: var(--surface-soft); color: var(--ink); }
.task-dialog-body { overflow-y: auto; padding: 20px 22px; }
.source-summary { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; display: grid; gap: 12px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; padding: 13px 15px; }
.source-summary div { min-width: 0; }
.source-summary span, .source-summary strong { display: block; }
.source-summary span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.source-summary strong { font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-summary p { color: var(--muted); font-size: 12px; grid-column: 1 / -1; line-height: 1.5; margin: 0; }
.task-form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-field { display: grid; gap: 6px; }
.task-field > span { font-size: 12px; font-weight: 850; }
.task-field input, .task-field select, .task-field textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); min-height: 40px; padding: 8px 10px; width: 100%; }
.task-field textarea { line-height: 1.5; resize: vertical; }
.task-field input:focus, .task-field select:focus, .task-field textarea:focus { border-color: var(--green); }
.task-field-wide { grid-column: 1 / -1; }
.capacity-field { align-items: start; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: grid; gap: 10px; grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
.capacity-field input { accent-color: var(--green); height: 17px; margin-top: 2px; width: 17px; }
.capacity-field strong, .capacity-field small { display: block; }
.capacity-field strong { font-size: 13px; }
.capacity-field small { color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 3px; }
.task-dialog-card > footer, .delete-dialog-card > footer { border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; padding: 14px 22px; }
.button.danger { background: var(--red); border-color: var(--red); color: #fff; }
.button.danger:hover:not(:disabled) { background: #873138; }
.delete-dialog-card > header { align-items: start; display: grid; gap: 14px; grid-template-columns: auto minmax(0, 1fr); padding: 22px; }
.delete-dialog-card > header > span { align-items: center; background: var(--red-soft); border-radius: 50%; color: var(--red); display: flex; font-size: 20px; font-weight: 900; height: 42px; justify-content: center; width: 42px; }
.delete-dialog-card header p { color: var(--muted); line-height: 1.55; margin: 8px 0 0; }
.delete-dialog-card header p strong { color: var(--ink); }

@media (max-width: 820px) {
  .task-filters { grid-template-columns: 1fr 1fr; }
  .task-search { grid-column: 1 / -1; }
  .task-filters strong { padding-bottom: 8px; }
  .tasks-intro { align-items: start; flex-direction: column; }
  .task-command-bar { align-items: start; flex-direction: column; }
  .selection-summary { max-width: 100%; }
}

@media (max-width: 620px) {
  .tasks-header-nav { gap: 4px; }
  .tasks-header-nav .header-link { font-size: 11px; padding: 7px 8px; }
  .tasks-intro h1 { font-size: 36px; }
  .task-primary-commands { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .task-command { justify-content: center; }
  .task-command.is-primary { grid-column: 1 / -1; }
  .task-filters { grid-template-columns: 1fr; }
  .task-search { grid-column: auto; }
  .task-filters strong { text-align: left; }
  .task-form-grid { grid-template-columns: 1fr; }
  .task-field-wide { grid-column: auto; }
  .source-summary { grid-template-columns: 1fr; }
  .source-summary p { grid-column: auto; }
  .task-dialog-card > footer, .delete-dialog-card > footer { display: grid; grid-template-columns: 1fr; }
  .task-dialog-card > footer .button, .delete-dialog-card > footer .button { width: 100%; }
  .tasks-footnote { align-items: start; flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .task-dialog::backdrop, .delete-dialog::backdrop { backdrop-filter: none; }
}
