/* Approved A palette. Loaded last in the app and administration.
 * Surface overrides are intentional: older page/native selectors use IDs.
 * Sizes and layout remain owned by their components. Colour/avatar choices
 * and content cards keep their own visual meaning rather than action styling.
 */
:root {
  --button-primary: #4b746e;
  --button-primary-hover: #3e655f;
  --button-primary-border: #426861;
  --button-secondary: #e8eee8;
  --button-secondary-hover: #dce6dd;
  --button-secondary-border: #a8b9ae;
  --button-secondary-ink: #304a3e;
}
:where(button, input[type="submit"], input[type="button"], a.primary-button, a.secondary-button, a.ghost-button, .rail-nav a, .mobile-nav > a) {
  --action-bg: var(--button-secondary);
  --action-hover: var(--button-secondary-hover);
  --action-border: var(--button-secondary-border);
  --action-ink: var(--button-secondary-ink);
  --action-shadow: 0 2px 3px #34362c0d;
}
:is(button, input[type="submit"], input[type="button"], a.primary-button, a.secondary-button, a.ghost-button, .rail-nav a, .mobile-nav > a):not(:where(.custom-color-option, .avatar-select-option, .school-menu-option, .route-card, .all-chore-summary-card, .ai-item-source)) {
  background: var(--action-bg) !important;
  border: 1px solid var(--action-border) !important;
  border-radius: 10px !important;
  color: var(--action-ink) !important;
  box-shadow: var(--action-shadow) !important;
  text-shadow: none !important;
  font-family: var(--font-body, "Aptos", "Segoe UI", sans-serif) !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
:is(button, input[type="submit"], input[type="button"], a.primary-button, a.secondary-button, a.ghost-button, .rail-nav a, .mobile-nav > a):not(:where(.custom-color-option, .avatar-select-option, .school-menu-option, .route-card, .all-chore-summary-card, .ai-item-source)):hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--action-hover) !important;
}
/* Primary actions and selected views share one calm, flat surface. */
:is(.primary-button, .chore-done-button, .time-stepper-done, .logout-button,
    button.is-active, button.is-selected, button[aria-selected="true"], button[aria-pressed="true"],
    .rail-nav a.is-active, .mobile-nav > a.is-active,
    .secondary-button[data-reward-mode],
    .admin-login-form button[type="submit"], .tracking-footer button[type="submit"]) {
  --action-bg: var(--button-primary);
  --action-hover: var(--button-primary-hover);
  --action-border: var(--button-primary-border);
  --action-ink: #fff;
  --action-shadow: 0 2px 4px #25493c12;
}
/* Navigation sits on a dark rail: inactive destinations stay quiet. */
:is(.rail-nav a, .mobile-nav > a, .mobile-nav > button, .admin-nav button):not(.is-active) {
  --action-bg: transparent;
  --action-hover: #ffffff14;
  --action-border: transparent;
  --action-ink: #f1f3eb;
  --action-shadow: none;
}
:is(.danger-button, .delete-confirm-button,
    [data-delete-chore], [data-delete-inbox-chat], [data-delete-reward], [data-delete-streak-bonus],
    [data-delete-user], [data-remove-calendar-feed], [data-remove-grade], [data-school-task-delete]) {
  --action-bg: #f5e9e5;
  --action-hover: #eddbd5;
  --action-border: #ba8c80;
  --action-ink: #853e32;
  --action-shadow: 0 2px 3px #653b3010;
}
:is(.primary-button.danger-button, .delete-confirm-button, #deleteFamilySubmit) {
  --action-bg: #a65346;
  --action-hover: #8e4439;
  --action-border: #94473b;
  --action-ink: #fff;
}
/* Disabled controls remain readable without looking available. */
:is(button, input[type="submit"], input[type="button"], a.primary-button, a.secondary-button, a.ghost-button):is(:disabled, [aria-disabled="true"]):not(.custom-color-option) {
  --action-bg: #e5e7e2 !important;
  --action-hover: #e5e7e2 !important;
  --action-border: #c7cec5 !important;
  --action-ink: #667064 !important;
  --action-shadow: none !important;
  opacity: 1 !important;
  cursor: not-allowed;
}
:is(button, input[type="submit"], input[type="button"], a.primary-button, a.secondary-button, a.ghost-button, .rail-nav a, .mobile-nav > a):focus-visible {
  outline: 3px solid #987332 !important;
  outline-offset: 3px !important;
}
@media (forced-colors: active) {
  :is(button, input[type="submit"], input[type="button"], a.primary-button, a.secondary-button, a.ghost-button) {
    border-color: ButtonText !important;
  }
}

/* Adjacent-month dates and today must remain distinguishable. */
.calendar-picker-days button.is-muted:not(.is-selected) {
  --action-bg: #f4f3ed;
  --action-ink: #777970;
  --action-border: #d3d6cc;
  --action-shadow: none;
}
.calendar-picker-days button.is-today { --action-border: var(--button-primary-border); }

/* The bottom navigation replaces the rail through the tablet breakpoint. */
@media (max-width: 1050px) {
  html body:not(.is-native-app) .rail { display: none; }
}

/* Former text-only actions also need breathing room and a useful hit area. */
html body :is(.parent-homework-link, .auth-text-button) {
  min-height: 44px !important;
  padding: 8px 12px !important;
  line-height: 1.3;
  text-decoration: none;
}

/* Dashboard follow-ups are full actions; row shortcuts stay visually light. */
html body #parentCommandCenter :is(.parent-attention-row > button, .parent-child-card footer button) {
  min-height: 44px !important;
  padding: 8px 14px !important;
  gap: 10px;
  max-width: 100%;
}
html body #parentCommandCenter .parent-homework-link {
  --action-bg: transparent;
  --action-hover: #edf2ec;
  --action-border: transparent;
  --action-ink: #426861;
  --action-shadow: none;
  min-height: 32px !important;
  padding: 4px 2px !important;
  text-decoration: underline;
  text-decoration-color: #a8b9ae;
  text-underline-offset: 4px;
}
html body #parentCommandCenter .parent-homework-link:hover { text-decoration-color: currentColor; }
html body .parent-day-toggle { gap: 4px; background: #f8f9f4; }
html body .parent-day-toggle button {
  --action-bg: transparent;
  --action-hover: #edf2ec;
  --action-border: transparent;
  --action-ink: #526257;
  --action-shadow: none;
}
html body .parent-day-toggle button[aria-pressed="true"] {
  --action-bg: var(--button-secondary);
  --action-hover: var(--button-secondary-hover);
  --action-border: var(--button-secondary-border);
  --action-ink: var(--button-secondary-ink);
}
/* Identity labels inside a selected chip inherit its contrasting text colour. */
html body #schoolRoot .school-child-chips button .school-child-identity { color: inherit; }
@media(max-width:640px) {
  html body #parentCommandCenter .parent-homework-link { min-height:44px !important; }
}

/* Day captions must follow the selected button instead of legacy muted labels. */
html body :is(.child-day-tabs, .family-day-tabs, .period-child-tabs, .reference-child-switcher) button:is(.is-active, [aria-pressed="true"], [aria-selected="true"]) > :is(span, strong) { color: inherit; }

/* Keep row icons and action labels on the same centre line. */
html body #parentCommandCenter .parent-row-label { align-items:center; align-self:start; padding-top:0; }
html body #parentCommandCenter .parent-chore-progress { min-height:32px; }
