:root {
  --action-height: 42px;
  --action-height-compact: 36px;
  --action-radius: 4px;
  --action-pad: 14px;
  --action-font-size: 13px;
  --action-brand: #b51f2a;
  --action-brand-hover: #941923;
  --action-text: #282725;
  --action-muted: #66625e;
  --action-border: #d9d5cf;
  --action-border-hover: #aaa49d;
  --action-surface: #fff;
  --action-surface-hover: #f5f3f0;
  --action-danger-surface: #f1efec;
  --action-focus: rgba(181, 31, 42, .22);
}

/*
 * Shared action hierarchy for the management and learning applications.
 * Navigation, tabs, photo previews and disclosure controls intentionally keep
 * their own interaction styles because they are not command buttons.
 */
.platform-page .btn,
.platform-page .action-btn,
.learning-page .secondary-inline,
.learning-page .secondary,
.learning-page .danger-outline,
.learning-page .dialog-actions button:not(.close),
.learning-page .sheet-footer button:not(.close),
.learning-page .material-card-actions button,
.learning-page .published-form-actions button,
.learning-page .submission-actions button,
.learning-page .review-actions button,
.learning-page .practical-person-toolbar button,
.learning-page .practical-form-actions button,
.learning-page #submitPracticalAssessment,
.learning-page #publishLearningForm,
.learning-page #publishMaterialButton,
.learning-page #submitAssessment,
.learning-page #submitReflection,
.learning-page #copyQrLink,
.learning-page #confirmAudienceSelection,
.learning-page #confirmPublishLearningForm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  min-height: var(--action-height);
  margin: 0;
  padding: 0 var(--action-pad);
  border: 1px solid var(--action-border);
  border-radius: var(--action-radius);
  color: var(--action-text);
  background: var(--action-surface);
  box-shadow: none;
  font-size: var(--action-font-size);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, opacity .16s ease;
}

.platform-page .btn:hover,
.platform-page .action-btn:hover,
.learning-page .secondary-inline:hover,
.learning-page .secondary:hover,
.learning-page .dialog-actions button:not(.close):hover,
.learning-page .sheet-footer button:not(.close):hover,
.learning-page .material-card-actions button:hover,
.learning-page .published-form-actions button:hover,
.learning-page .submission-actions button:hover,
.learning-page .review-actions button:hover,
.learning-page .practical-person-toolbar button:hover {
  border-color: var(--action-border-hover);
  color: #111;
  background: var(--action-surface-hover);
}

/* Primary: one emphasized commit/create action per working area. */
.platform-page .btn.primary,
.learning-page #submitPracticalAssessment,
.learning-page .practical-form-actions button[type="submit"],
.learning-page #publishLearningForm,
.learning-page #publishMaterialButton,
.learning-page #submitAssessment,
.learning-page #submitReflection,
.learning-page #confirmAudienceSelection,
.learning-page #confirmPublishLearningForm,
.learning-page .material-card-actions button[data-material-action] {
  border-color: var(--action-brand);
  color: #fff;
  background: var(--action-brand);
  box-shadow: 0 4px 10px rgba(143, 23, 32, .14);
}

.platform-page .btn.primary:hover,
.learning-page #submitPracticalAssessment:hover,
.learning-page .practical-form-actions button[type="submit"]:hover,
.learning-page #publishLearningForm:hover,
.learning-page #publishMaterialButton:hover,
.learning-page #submitAssessment:hover,
.learning-page #submitReflection:hover,
.learning-page #confirmAudienceSelection:hover,
.learning-page #confirmPublishLearningForm:hover,
.learning-page .material-card-actions button[data-material-action]:hover {
  border-color: var(--action-brand-hover);
  color: #fff;
  background: var(--action-brand-hover);
  box-shadow: 0 5px 13px rgba(143, 23, 32, .18);
}

/* Secondary and soft actions share the same quiet outline treatment. */
.platform-page .btn.ghost,
.platform-page .btn.soft,
.platform-page .btn.white,
.learning-page .secondary-inline,
.learning-page .secondary,
.learning-page #copyQrLink {
  border-color: var(--action-border);
  color: var(--action-text);
  background: var(--action-surface);
}

/* Compact table/list actions. */
.platform-page .action-btn,
.platform-page #momentsView .moment-download-button,
.platform-page #momentsView .moment-caption-button,
.platform-page #momentsView .moment-delete-button,
.learning-page .material-card-actions button,
.learning-page .published-form-actions button,
.learning-page .submission-actions button,
.learning-page .review-actions button,
.learning-page .practical-standard-list button {
  min-height: var(--action-height-compact);
  padding-inline: 10px;
  border-radius: var(--action-radius);
  font-size: 12px;
}

.platform-page #momentsView .moment-download-button,
.platform-page #momentsView .moment-caption-button,
.platform-page #momentsView .moment-delete-button,
.learning-page .practical-standard-list button {
  border: 1px solid var(--action-border);
  color: var(--action-text);
  background: var(--action-surface);
}

/*
 * Destructive or irreversible actions are deliberately neutral by default.
 * The confirmation dialog carries the warning, so lists do not become a field
 * of red controls competing with the primary action.
 */
.platform-page .btn.danger,
.platform-page .danger-link,
.platform-page .moment-delete-button,
.platform-page [data-task-delete],
.platform-page [data-delete-report],
.platform-page [data-delete-issue],
.learning-page .danger-outline,
.learning-page [data-remove-question],
.learning-page [data-practical-standard-status][data-active="false"] {
  border-color: var(--action-border) !important;
  color: var(--action-muted) !important;
  background: var(--action-danger-surface) !important;
  box-shadow: none !important;
}
.learning-page [data-practical-standard-delete] {
  border-color: var(--action-border) !important;
  color: var(--action-muted) !important;
  background: var(--action-danger-surface) !important;
  box-shadow: none !important;
}

.platform-page .btn.danger:hover,
.platform-page .danger-link:hover,
.platform-page .moment-delete-button:hover,
.platform-page [data-task-delete]:hover,
.platform-page [data-delete-report]:hover,
.platform-page [data-delete-issue]:hover,
.learning-page .danger-outline:hover,
.learning-page [data-remove-question]:hover,
.learning-page [data-practical-standard-status][data-active="false"]:hover {
  border-color: var(--action-border-hover) !important;
  color: #343230 !important;
  background: #e9e6e2 !important;
}
.learning-page [data-practical-standard-delete]:hover {
  border-color: var(--action-border-hover) !important;
  color: #343230 !important;
  background: #e9e6e2 !important;
}

/* Small icon-only remove controls stay compact and equally quiet. */
.platform-page .draft-item button[data-remove-draft],
.platform-page .standards-grid button[data-standard-remove],
.platform-page .remove-photo {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--action-border);
  border-radius: var(--action-radius);
  color: var(--action-muted);
  background: var(--action-danger-surface);
}

/* Text actions remain low emphasis but use the same typography and focus. */
.platform-page .text-btn {
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  border-radius: var(--action-radius);
  color: var(--action-brand);
  background: transparent;
  font-size: var(--action-font-size);
  font-weight: 650;
}
.platform-page .text-btn:hover { background: #f7f1f1; }

.platform-page .btn:focus-visible,
.platform-page .action-btn:focus-visible,
.platform-page .text-btn:focus-visible,
.platform-page .moment-download-button:focus-visible,
.platform-page .moment-caption-button:focus-visible,
.platform-page .moment-delete-button:focus-visible,
.learning-page .secondary-inline:focus-visible,
.learning-page .secondary:focus-visible,
.learning-page .danger-outline:focus-visible,
.learning-page .dialog-actions button:focus-visible,
.learning-page .sheet-footer button:focus-visible,
.learning-page .material-card-actions button:focus-visible,
.learning-page .published-form-actions button:focus-visible,
.learning-page .submission-actions button:focus-visible,
.learning-page .review-actions button:focus-visible,
.learning-page .practical-person-toolbar button:focus-visible,
.learning-page .practical-form-actions button:focus-visible,
.learning-page #submitPracticalAssessment:focus-visible {
  outline: 3px solid var(--action-focus);
  outline-offset: 2px;
}

.platform-page button:disabled,
.learning-page button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

@media (max-width: 560px) {
  :root { --action-height: 44px; --action-height-compact: 44px; }
  .platform-page .draft-item button[data-remove-draft],
  .platform-page .standards-grid button[data-standard-remove],
  .platform-page .remove-photo {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .learning-page .practical-person-toolbar button,
  .learning-page .practical-form-actions button,
  .learning-page #submitPracticalAssessment { width: 100%; }
}

@media (max-width: 900px) and (max-height: 500px) {
  :root { --action-height: 44px; --action-height-compact: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .platform-page button,
  .learning-page button { transition-duration: .01ms !important; }
}
