.field-invalid {
  border-color: #c64f3c !important;
  box-shadow: 0 0 0 3px rgba(198, 79, 60, .13) !important;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #c64f3c;
  font-size: 10px;
  line-height: 1.5;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

.usage.save-saving b {
  color: #a8862f;
}

.usage.save-error b,
.usage.save-error small {
  color: #bd6048;
}

.usage.save-offline b {
  color: #8b8174;
}

.wiki-audit-panel {
  margin-bottom: 18px;
}

.wiki-audit-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wiki-audit-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--muted);
  background: #f1eee7;
  font-size: 10px;
  white-space: nowrap;
}

.wiki-audit-badge.ready {
  color: #4d8066;
  background: #eaf3ed;
}

.wiki-audit-badge.error {
  color: #a9472d;
  background: #f9e9df;
}

.wiki-audit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 2px 0 14px;
  border: 1px solid rgba(42, 35, 27, .1);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(42, 35, 27, .1);
}

.wiki-audit-metric {
  min-height: 70px;
  padding: 12px;
  background: var(--surface);
}

.wiki-audit-metric span,
.wiki-audit-metric b {
  display: block;
}

.wiki-audit-metric span {
  color: var(--muted);
  font-size: 10px;
}

.wiki-audit-metric b {
  margin-top: 7px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.wiki-audit-error {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(189, 96, 72, .28);
  border-radius: 8px;
  color: #a94e39;
  background: #fff3ed;
  font-size: 11px;
}

.wiki-audit-error small {
  color: var(--muted);
  font-size: 10px;
}

.wiki-audit-boundary {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(42, 35, 27, .1);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.wiki-audit-boundary b {
  color: var(--ink);
  font-size: 11px;
}

.knowledge-coverage-panel {
  margin-bottom: 18px;
}

.formal-source-review-panel {
  margin-bottom: 18px;
}

.formal-review-mappings,
.formal-review-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.formal-review-mapping,
.formal-review-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(42, 35, 27, .1);
  border-radius: 9px;
  background: var(--surface);
}

.formal-review-mapping span,
.formal-review-mapping small,
.formal-review-item p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.formal-review-item summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.formal-review-item p {
  margin: 4px 0 0;
}

.coverage-client-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.coverage-client {
  border: 1px solid rgba(42, 35, 27, .1);
  border-radius: 9px;
  background: var(--surface);
}

.coverage-client summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.coverage-client summary::-webkit-details-marker {
  display: none;
}

.coverage-client summary b,
.coverage-client summary small {
  display: block;
}

.coverage-client summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.coverage-client-body {
  display: grid;
  gap: 5px;
  margin: 0 12px 12px;
  padding-top: 9px;
  border-top: 1px solid rgba(42, 35, 27, .1);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.coverage-client-body p {
  margin: 0;
}

.coverage-client-body b {
  color: var(--ink);
}

.client-readiness-panel {
  margin-bottom: 18px;
}

.readiness-client-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.readiness-client {
  border: 1px solid rgba(42, 35, 27, .1);
  border-radius: 9px;
  background: var(--surface);
}

.readiness-client summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.readiness-client summary::-webkit-details-marker {
  display: none;
}

.readiness-client summary b,
.readiness-client summary small {
  display: block;
}

.readiness-client summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.readiness-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 5px;
  color: #806d39;
  background: #fff6dc;
  font-size: 10px;
  white-space: nowrap;
}

.readiness-status.ready {
  color: #4d8066;
  background: #eaf3ed;
}

.readiness-status.needs-data,
.readiness-status.partial {
  color: #8a5c2d;
  background: #fff0dc;
}

.readiness-fields {
  display: grid;
  gap: 1px;
  margin: 0 12px 12px;
  border-top: 1px solid rgba(42, 35, 27, .1);
}

.readiness-field {
  display: grid;
  grid-template-columns: minmax(100px, .7fr) minmax(0, 1.8fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(42, 35, 27, .07);
  font-size: 11px;
  line-height: 1.55;
}

.readiness-field:last-child {
  border-bottom: 0;
}

.readiness-field-label {
  color: var(--muted);
}

.readiness-field-value {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.readiness-field-value small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 680px) {
  .readiness-field {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.wiki-dry-run-preview {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(161, 123, 37, .22);
  border-radius: 9px;
  background: #fffbf2;
}

.wiki-dry-run-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.wiki-dry-run-head b,
.wiki-dry-run-head small {
  display: block;
}

.wiki-dry-run-head b {
  color: var(--ink);
  font-size: 12px;
}

.wiki-dry-run-head small,
.wiki-dry-run-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.wiki-dry-run-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wiki-dry-run-grid > div {
  padding: 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
}

.wiki-dry-run-grid span,
.wiki-dry-run-grid b {
  display: block;
}

.wiki-dry-run-grid span {
  color: var(--muted);
  font-size: 9px;
}

.wiki-dry-run-grid b {
  margin-top: 4px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.4;
  word-break: break-word;
}

.wiki-dry-run-note {
  margin: 10px 0 0;
}

@media (max-width: 700px) {
  .wiki-audit-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .wiki-audit-grid {
    grid-template-columns: 1fr;
  }

  .wiki-dry-run-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.task-title-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.task-priority {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px !important;
  font-style: normal;
  font-weight: 600;
  line-height: 1.4;
}

.task-priority.priority-high {
  color: #a94e39;
  background: #f9e9df;
}

.task-priority.priority-normal {
  color: #8b6b21;
  background: #f5eddc;
}

.task-priority.priority-low {
  color: #5b7b70;
  background: #e8f2ed;
}

.task-item.task-overdue .task-date:last-of-type b {
  color: #bd6048;
}

.task-item.task-overdue .task-title-line {
  color: #a94e39;
}

.danger-action {
  color: #bd6048 !important;
}

.danger-action:hover {
  border-color: rgba(189, 96, 72, .55) !important;
  color: #a94e39 !important;
}

.client-tasks-panel {
  margin-bottom: 18px;
}

.client-task-group {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.client-task-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.client-task-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.client-task-group-head b {
  display: block;
  font-size: 12px;
}

.client-task-group-head small,
.panel-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.client-task-empty {
  padding: 9px 0 2px;
  color: var(--muted);
  font-size: 10px;
}

.task-project-select {
  display: block;
  width: min(100%, 300px);
  margin-top: 7px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
}

.task-calendar-panel {
  margin-bottom: 18px;
}

.task-calendar-head {
  align-items: center;
}

.task-calendar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.task-calendar-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.task-calendar-filter select {
  min-width: 150px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 11px;
}

.task-calendar-summary {
  display: flex;
  gap: 18px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
}

.task-calendar-legend {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
}

.task-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.task-calendar-legend-item i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--task-accent);
}

.task-calendar-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 3px;
}

.task-calendar {
  min-width: 760px;
  overflow: hidden;
  border: 1px solid rgba(42, 35, 27, .12);
  border-radius: 10px;
  background: #fffefa;
}

.task-calendar-weekdays,
.task-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.task-calendar-weekdays {
  border-bottom: 1px solid rgba(42, 35, 27, .14);
}

.task-calendar-weekdays span {
  padding: 10px 8px;
  border-left: 1px solid rgba(42, 35, 27, .08);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.task-calendar-weekdays span:first-child,
.task-calendar-cell:nth-child(7n + 1) {
  border-left: 0;
}

.task-calendar-cell {
  min-height: 112px;
  padding: 7px;
  border-bottom: 1px solid rgba(42, 35, 27, .08);
  border-left: 1px solid rgba(42, 35, 27, .08);
  background: #fffefa;
}

.task-calendar-cell.outside {
  color: #b1a696;
  background: #fbf7ee;
}

.task-calendar-cell.today {
  background: #fff8e8;
}

.task-calendar-date {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 11px;
}

.task-calendar-date span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 600;
}

.task-calendar-cell.today .task-calendar-date span {
  color: #fff;
  background: #b7953f;
}

.task-calendar-date small {
  color: #a47d21;
  font-size: 9px;
}

.task-calendar-items {
  display: grid;
  gap: 4px;
}

.task-calendar-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-left: 3px solid var(--task-accent, #b7953f);
  border-radius: 5px;
  color: var(--task-text, #5b4633);
  background: var(--task-background, #f6ead2);
  text-align: left;
  cursor: pointer;
}

.task-calendar-item:hover {
  filter: brightness(.98);
  transform: translateY(-1px);
}

.task-calendar-item b,
.task-calendar-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-calendar-item b {
  font-size: 10px;
  line-height: 1.3;
}

.task-calendar-item small {
  color: var(--task-text, #8d6d43);
  font-size: 9px;
}

.task-calendar-item.done {
  opacity: .52;
  text-decoration: line-through;
}

.task-calendar-unplanned {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(42, 35, 27, .18);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
}

.task-calendar-unplanned b {
  flex: 0 0 auto;
  color: var(--ink);
}

.task-calendar-unplanned div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-calendar-unplanned span {
  padding: 4px 7px;
  border-radius: 5px;
  background: #f3eee3;
}

@media (max-width: 800px) {
  .task-calendar-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-calendar-actions {
    justify-content: flex-start;
  }

  .task-calendar-filter {
    width: 100%;
  }

  .task-calendar-filter select {
    flex: 1;
  }
}

@media (max-width: 650px) {
  .task-calendar-summary {
    gap: 10px;
    flex-wrap: wrap;
  }

  .task-calendar {
    min-width: 760px;
  }
}

.personal-tools-panel {
  margin-bottom: 18px;
}

.personal-tool-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 2px;
  color: inherit;
  text-decoration: none;
}

.personal-tool-link:hover .personal-tool-icon {
  transform: translateY(-2px);
  background: #ead9ae;
}

.personal-tool-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #8b6b21;
  background: #f5eee0;
  font-size: 24px;
  transition: transform .2s ease, background .2s ease;
}

.personal-tool-link > span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.personal-tool-link b {
  color: var(--ink);
  font-size: 13px;
}

.personal-tool-link small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-tool-link > strong {
  flex: 0 0 auto;
  color: #a17b25;
  font-size: 11px;
  font-weight: 500;
}

.project-row[data-project-open] {
  cursor: pointer;
}

.project-row[data-project-open]:hover {
  background: rgba(246, 234, 210, .35);
}

.project-open-action {
  flex: 0 0 auto;
  margin-right: 8px;
  color: #a17b25 !important;
  white-space: nowrap;
}

@media (max-width: 650px) {
  .personal-tool-link {
    align-items: flex-start;
  }

  .personal-tool-link > strong {
    font-size: 10px;
  }

  .personal-tool-link small {
    white-space: normal;
  }

  .project-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .project-row > div:nth-child(2) {
    flex: 1 1 calc(100% - 50px);
  }

  .project-open-action {
    margin-left: 40px;
    margin-right: 0;
  }
}
