/* Shared visual layer. Loaded after page styles, including mobile overrides. */
:root {
  --rd-font: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --rd-surface: #17202b;
  --rd-border: #334155;
  --rd-text: #e5edf6;
  --rd-accent: #20c78c;
}
body, body * { font-family: var(--rd-font) !important; }
body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .page-title, .section-title, .dialog-title, .modal-title {
  font-weight: 650 !important;
  letter-spacing: -.025em !important;
}
strong, b { font-weight: 650; }
input, select, textarea { font-size: 14px !important; font-weight: 400 !important; }
.nav a { font-size: 14px !important; font-weight: 550 !important; }
body :is(.label, label, th, .field-label, .eyebrow, .nav-label, .status, .status-pill, .template-badge, .template-field) {
  font-weight: 550 !important;
  letter-spacing: .015em !important;
  text-transform: none !important;
}
body :is(.value, .stat-value, .metric-value, .page-title) { font-weight: 650 !important; }
.subtle, .muted { letter-spacing: normal; }

/* Explicit action selectors avoid turning linked cards into buttons. */
body :is(button, input[type="submit"], input[type="button"], .btn, .hero-btn,
  .action-btn, .branch-action, .member-action, .table-action, .daybook-btn,
  .renew-btn, .billing-btn, .diet-button, .diet-restore, .diet-chip, .view-tab,
  .side-btn, .primary-button, .secondary-button, .login-button, .btn-primary,
  .btn-danger, .btn-revoke, .back-btn, .reload-btn, .restore-btn, .add-btn,
  .secondary-btn, .edit-btn, .delete-btn, .pay-btn, .cancel, .bulk-action, .cancel-btn, .mini-btn, .small-btn, .nav-btn, .legal-nav-action, .legal-switcher a) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px !important;
  padding: 7px 12px !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: 8px !important;
  background: var(--rd-surface) !important;
  color: var(--rd-text) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  line-height: 20px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: none;
  box-shadow: 0 1px 2px #0002 !important;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
body :is(button, .btn, .hero-btn, .action-btn, .branch-action, .member-action,
  .renew-btn, .diet-button, .side-btn, .daybook-btn, .login-button):hover:not(:disabled) {
  background: #222f3e !important;
  border-color: #61748d !important;
}
body :is(button[type="submit"], input[type="submit"], .primary, .rd-primary,
  .primary-button, .btn-primary, .dialog-save, .save-btn, .submit-btn, .add-btn,
  .side-btn.member, .pay, .pay-btn, .continue,
  .diet-button:not(.diet-secondary):not(.diet-danger)) {
  background: var(--rd-accent) !important;
  border-color: var(--rd-accent) !important;
  color: #05271c !important;
}
body :is(button[type="submit"], .primary, .rd-primary, .primary-button, .btn-primary,
  .dialog-save, .save-btn, .submit-btn, .add-btn, .side-btn.member, .pay, .pay-btn,
  .continue, .diet-button:not(.diet-secondary):not(.diet-danger)):hover:not(:disabled) {
  background: #48d9a5 !important;
  border-color: #48d9a5 !important;
  color: #05271c !important;
}
body :is(.delete, .delete-btn, .btn-danger, .diet-danger, .diet-remove-row,
  button[name="action"][value="delete"], button[name="action"][value="remove"]) {
  background: #311d26 !important;
  border-color: #70404d !important;
  color: #ffb2bc !important;
}
body :is(.delete, .delete-btn, .btn-danger, .diet-danger, .diet-remove-row):hover:not(:disabled) {
  background: #482532 !important;
  border-color: #b9687b !important;
  color: #ffd1d7 !important;
}
body :is(button, input, select, textarea, a):focus-visible {
  outline: 2px solid #6ee7b7 !important;
  outline-offset: 3px;
}
body :is(button, input[type="submit"], .btn):disabled,
body [aria-disabled="true"] { opacity: .45 !important; cursor: not-allowed !important; box-shadow: none !important; }
body :is(.dialog-close, .modal-close, .msg-close, .calendar-nav, .nav-toggle) {
  padding: 5px !important;
  width: 36px;
  flex: 0 0 auto;
}
/* Keep multi-line date triggers and navigation toggles in their native layout. */
body .date-trigger { justify-content: flex-start; min-height: 52px !important; }
body button.nav-toggle { display: none !important; }
body .calendar-day { padding: 3px !important; min-width: 0; }
body :is(.calendar-day.selected, .calendar-day.is-selected, .view-tab.active, .diet-chip.active, .legal-switcher a.active) {
  background: #183d32 !important; border-color: #20c78c !important; color: #a4f4d3 !important;
}
body :is(button.active, button.is-active, button[aria-pressed="true"], button[aria-selected="true"]) {
  background: #183d32 !important; border-color: #20c78c !important; color: #a4f4d3 !important;
}
body [hidden] { display: none !important; }
.rd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rd-actions .renew-btn { margin: 0; }
.rd-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-btn { min-height: 38px !important; }
@media (max-width: 767px), (pointer: coarse) {
  body :is(button, input[type="submit"], .btn, .hero-btn, .action-btn, .branch-action,
    .member-action, .renew-btn, .diet-button, .daybook-btn, .side-btn, .login-button) {
    min-height: 44px !important;
  }
  .rd-actions > a { flex: 1 1 auto; }
}
@media (max-width: 860px) { body button.nav-toggle { display: inline-flex !important; flex-direction: column; } }
@media (prefers-reduced-motion: reduce) {
  body :is(button, a, input) { transition: none !important; }
}
