.core-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}
.core-toolbar button,
.core-actions button,
.core-category-link {
  border: 1px solid var(--line, #ddd);
  background: var(--paper, #fff);
  color: var(--ink, #332d29);
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
}
.core-toolbar button.active,
.core-primary {
  background: var(--ink, #332d29) !important;
  color: var(--paper, #fff) !important;
}
.core-toolbar select,
.core-toolbar input {
  border: 1px solid var(--line, #ddd);
  border-radius: 9px;
  padding: 8px;
  background: var(--paper, #fff);
  color: inherit;
}
.core-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.todo-board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.todo-board-panel {
  min-width: 0;
  border: 1px solid var(--line, #ddd);
  border-radius: 14px;
  padding: 13px;
  background: color-mix(in srgb, var(--paper, #fff) 92%, var(--ink, #332d29));
}
.todo-board-panel .core-card {
  padding: 11px;
  margin: 8px 0;
}
.todo-board-panel .core-row {
  align-items: flex-start;
  padding: 9px 0;
}
.todo-board-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.todo-board-heading small {
  color: var(--ink2, #777);
  font-weight: 500;
  margin-right: auto;
}
.todo-board-heading button {
  border: 1px solid var(--line, #ddd);
  background: var(--paper, #fff);
  color: var(--ink, #332d29);
  border-radius: 8px;
  padding: 6px 9px;
}
.todo-board-options {
  display: grid;
  gap: 9px;
}
.todo-board-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line, #ddd);
  border-radius: 10px;
}
.todo-board-option input {
  width: 20px;
  height: 20px;
}
.todo-board-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.todo-board-option small {
  color: var(--ink2, #777);
}
.todo-invite-code {
  font: 800 24px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.15em;
}
.core-card {
  border: 1px solid var(--line, #ddd);
  border-radius: 14px;
  padding: 17px;
  background: var(--paper, #fff);
  margin: 10px 0;
}
.core-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}
.core-card small,
.core-muted {
  color: var(--ink2, #777);
  font-size: 13px;
}
.core-card strong {
  font-size: 25px;
}
.core-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line, #eee);
}
.core-row:last-child {
  border: 0;
}
.core-row .grow {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.core-row button {
  flex-shrink: 0;
}
.core-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.core-error {
  color: #a72e2e;
  padding: 12px;
  white-space: pre-wrap;
}
.core-success {
  color: #3e7543;
}
.core-dialog {
  color: var(--ink, #332d29);
  background: var(--paper, #fff);
  width: min(720px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line, #ddd);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 100px #0004;
}
.core-dialog::backdrop {
  background: #201d1966;
}
.core-dialog h2 {
  margin: 0 0 18px;
  font-size: 22px;
}
.core-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.core-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.core-form input,
.core-form select,
.core-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--line, #ccc);
  border-radius: 8px;
  font: inherit;
  color: inherit;
  background: var(--paper, #fff);
}
.core-form input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.core-form .wide {
  grid-column: 1/-1;
}
.core-calendar-selection {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line, #ddd);
  border-radius: 10px;
}
.core-calendar-selection legend { font-weight: 700; }
.core-calendar-selection .core-calendar-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  overflow-wrap: anywhere;
}
.core-calendar-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.core-form textarea {
  min-height: 82px;
}
.core-dialog footer {
  position: sticky;
  bottom: -24px;
  background: var(--paper, #fff);
  padding: 16px 0 0;
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.core-dialog details {
  grid-column: 1/-1;
}
.core-dialog summary {
  cursor: pointer;
  padding: 10px 0;
}
.core-subtasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.core-subtask {
  display: flex;
  gap: 8px;
  align-items: center;
}
.core-subtask input[type="text"] {
  flex: 1;
}
.core-badge {
  display: inline-block;
  padding: 3px 7px;
  background: #b48a5720;
  border-radius: 5px;
  font-size: 12px;
  margin-right: 6px;
}
.core-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.core-table th,
.core-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line, #ddd);
  overflow-wrap: anywhere;
}
.core-scroll {
  overflow-x: auto;
}
.core-danger {
  color: #a72e2e !important;
}
.core-privacy #financeContent {
  display: none;
}
.core-hint {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink2, #777);
}
@media (max-width: 650px) {
  .core-form {
    grid-template-columns: 1fr;
  }
  .core-row {
    flex-wrap: wrap;
  }
  .core-dialog {
    padding: 18px;
  }
  .core-table {
    min-width: 650px;
  }
  .todo-board-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .todo-board-panel {
    padding: 9px;
  }
  .todo-board-panel .core-actions {
    width: 100%;
  }
}
@media print {
  body > *:not(.core-print) {
    display: none !important;
  }
  .core-print {
    display: block !important;
    color: #000;
    background: #fff;
  }
  .core-print table {
    font-size: 10px;
  }
  .core-print tr {
    break-inside: avoid;
  }
}
.shift-tag{float:right;max-width:68%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:3px 4px 0 0;padding:1px 5px;border-radius:999px;background:rgba(62,109,174,.14);color:#315c94;font-size:10px;font-weight:700}.shift-tag.off,.shift-head.off{background:rgba(79,138,91,.13);color:#3e744a}.shift-head{display:inline-block;margin-top:3px;padding:1px 6px;border-radius:999px;background:rgba(62,109,174,.14);color:#315c94;font-size:10px;font-weight:700;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.core-category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  text-align: left;
  margin-top: 6px;
}
.core-category-link span { overflow-wrap: anywhere; }
#financeRecords { scroll-margin-top: 24px; }

/* Team work stays within the current task page and Aura theme. */
.team-navigation { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.team-navigation button { min-height: 44px; }
.team-surface > h3 { font-size: 20px; }
.team-empty { padding: 24px 12px; text-align: center; color: var(--ink2); }
.team-empty h3 { color: var(--ink); font-size: 18px; }
.team-empty p { margin: 8px 0; line-height: 1.7; }
.team-task-row { align-items: flex-start; }
.team-task-row .grow > div { font-weight: 600; margin-bottom: 5px; }
.team-task-row small { display: block; line-height: 1.7; }
.team-task-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.team-task-meta span { padding: 4px 9px; border-radius: var(--aura-radius-pill, 20px); background: var(--aura-raised, var(--paper)); color: var(--ink2); font-size: 13px; }
.team-note { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.team-overdue { color: var(--aura-warning, var(--ink2)); font-size: 12px; display: block; margin-top: 6px; }
.team-invite-qr { width: 222px; max-width: 100%; height: auto; justify-self: center; background: white; }
.team-dialog .todo-invite-code { text-align: center; user-select: all; overflow-wrap: anywhere; }
.team-camera { width: 100%; max-height: 380px; border-radius: var(--aura-radius-md, 12px); }
.team-dialog h3 { margin: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .team-navigation { gap: 6px; }
  .team-navigation button { flex: 1; padding-inline: 8px; }
  .team-dialog .core-actions button { min-height: 44px; }
  .team-dialog .core-row .core-actions { width: 100%; }
}

/* AI 回報原文與請求 ID 在窄版仍可完整閱讀。 */
.ai-reports { margin-top: 22px; }
#aiReportsSection,
#aiReportsContent,
.ai-report-row,
.ai-report-detail { min-width: 0; }
#aiReportsContent { margin-top: 14px; }
#aiReportsSummary { margin-bottom: 14px; }
.ai-report-summary-row {
  color: var(--ink2, #777);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#aiReportsFilters label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink2, #777);
  font-size: 13px;
}
#aiReportsFilters select,
.ai-report-edit input,
.ai-report-edit select,
.ai-report-edit textarea {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line, #ddd);
  border-radius: 8px;
  background: var(--paper, #fff);
  color: var(--ink, #332d29);
  font: inherit;
}
.ai-report-row {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid var(--line, #ddd);
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink, #332d29);
  text-align: left;
  font: inherit;
}
.ai-report-row:hover,
.ai-report-row:focus-visible { border-color: var(--accent, #3b7dd8); }
.ai-reports :is(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent, #3b7dd8);
  outline-offset: 2px;
}
.ai-report-row-meta,
.ai-report-row-preview { display: block; }
.ai-report-row-meta { color: var(--ink2, #777); font-size: 12px; }
.ai-report-row-preview { margin-top: 4px; font-weight: 600; white-space: pre-wrap; }
.ai-report-detail {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line, #ddd);
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
}
.ai-report-detail h3 { margin: 0 0 10px; }
.ai-report-row,
.ai-report-detail,
.ai-report-mono { overflow-wrap: anywhere; }
.ai-report-mono { white-space: pre-wrap; word-break: break-word; }
.ai-report-fields {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 3fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line, #ddd);
  line-height: 1.6;
}
.ai-report-fields > :last-child { min-width: 0; margin: 0; }
.ai-report-traces { margin-top: 14px; line-height: 1.6; }
.ai-report-request { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 6px 0; }
.ai-report-request code { flex: 1 1 220px; min-width: 0; }
.ai-report-request span { flex: 1 1 220px; min-width: 0; }
.ai-report-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.ai-report-edit label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; }
.ai-report-edit label:nth-child(2) { grid-column: 1 / -1; }
.ai-report-edit textarea { min-height: 88px; resize: vertical; }
.ai-report-edit .go {
  justify-self: start;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #3b7dd8);
  color: #fff;
  font-weight: 700;
}
.ai-report-edit .core-error { padding: 0; align-self: center; }
#aiReportsFilters select { max-width: 100%; }
@media (max-width: 650px) {
  #aiReportsFilters { align-items: stretch; }
  #aiReportsFilters label { flex: 1 1 100%; min-width: 0; flex-direction: column; align-items: stretch; }
  #aiReportsFilters select { width: 100%; }
  .ai-report-fields { grid-template-columns: minmax(0, 1fr); }
  .ai-report-edit { grid-template-columns: minmax(0, 1fr); }
  .ai-report-edit label:nth-child(2) { grid-column: auto; }
  #aiReportsSection button { min-height: 44px; }
}
