/* Shared LDA finishes for the portal. Booking statuses retain their own colours. */
.tutor-portal-body { background: var(--cream); }
.tutor-portal-body .tutor-portal-header { background: var(--paper); border-color: var(--line); }
.tutor-portal-body :is(.tutor-management-panel, .tutor-next-card, .tutor-home-notifications, .tutor-management-card, .tutor-login-card) {
  background: var(--paper);
  border-color: var(--line);
  border-radius: var(--radius);
}
.tutor-portal-body :is(.tutor-login-card, .tutor-management-panel) { box-shadow: 0 8px 28px rgba(36,59,53,.04); }
.tutor-portal-body :is(.tutor-dashboard-stats article, .tutor-quick-actions button, .tutor-profile-summary-button) {
  background: var(--cream);
  border-color: var(--line);
}

/* Explicit text sizes avoid 10px fields inherited from compact legacy labels. */
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) :is(input, select, textarea):not([type=checkbox], [type=radio], [type=range], [type=color], [type=hidden]) {
  background-color: var(--paper);
  border: 1px solid #9cab9f;
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  min-height: 46px;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
}
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) :is(label, legend) {
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.5;
  min-width: 0;
}
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) input::placeholder,
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) textarea::placeholder { color: var(--muted); opacity: 1; }
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) small { font-size: .8rem; line-height: 1.5; }
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) p:not(.eyebrow) { font-size: .875rem; line-height: 1.6; }
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) textarea { resize: vertical; }
.tutor-portal-body input[type=file]::file-selector-button { background: var(--navy); border: 0; border-radius: var(--button-radius); color: var(--paper); cursor: pointer; font: inherit; margin-right: 12px; min-height: 36px; padding: 6px 14px; }
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) input[type=checkbox]:not(.available-payment-toggle input),
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) input[type=radio] {
  accent-color: var(--navy);
  flex: 0 0 20px;
  height: 20px;
  min-height: 20px;
  width: 20px;
  padding: 0;
}
.tutor-portal-body :is(.tutor-profile-fields, .tutor-profile-form, .discount-code-form, .stripe-invoice-form, .rollover-settings-form) { gap: 16px; }
.tutor-portal-body :is(.profile-wide-field, .tutor-card-heading > div, .tutor-management-heading > div) { min-width: 0; }
.tutor-portal-body :is(.tutor-profile-summary-copy, .tutor-profile-summary-actions, .learner-detail-contact) { overflow-wrap: anywhere; }
.tutor-portal-body .tutor-profile-form .profile-wide-field { grid-column: 1 / -1; }
.tutor-portal-body :is(.master-financial-dashboard, .financial-detail-grid, .financial-panel, .financial-tutor-table, .financial-summary-strip) { min-width: 0; max-width: 100%; }
.tutor-portal-body .financial-period-switch { flex-wrap: wrap; max-width: 100%; }
.tutor-portal-body .financial-tutor-table > div { font-size: .8rem; }
.tutor-portal-body .tutor-picker-card { background: var(--paper); border-color: var(--line); min-width: 0; }
.tutor-portal-body .tutor-picker-card.is-disabled-tutor { background: #f8eeee; border-color: #e4b6bc; }
.tutor-portal-body .tutor-picker-copy :is(strong, small, em) { white-space: normal; overflow-wrap: anywhere; }

/* One action scale, with square icon controls and larger primary actions. */
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) button,
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) .button {
  font-family: var(--body-font);
  font-size: .875rem;
  line-height: 1.4;
  min-height: 44px;
}
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) .button {
  border-radius: var(--button-radius);
  font-weight: 700;
  padding: 10px 18px;
  white-space: normal;
}
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) .button:not(.button-small) { min-height: 48px; }
.tutor-portal-body .button.button-danger { background: #963943; border-color: #963943; color: #fff; }
.tutor-portal-body .button.button-danger:hover:not(:disabled) { background: #7c2d36; border-color: #7c2d36; color: #fff; }
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) .button:hover:not(:disabled) { transform: none; box-shadow: 0 4px 14px rgba(36,59,53,.12); }
.tutor-portal-body :is(.tutor-profile-actions, .tutor-enquiry-actions, .tutor-card-heading, .learner-profile-actions, .financial-period-switch) button,
.tutor-portal-body :is(.calendar-history-open, .calendar-today-button) {
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: var(--paper);
  color: var(--navy);
  padding: 9px 14px;
}
.tutor-portal-body :is(.tutor-calendar-navigation, .calendar-history-navigation, .replacement-calendar-navigation) button,
.tutor-portal-body dialog .icon-button { align-items: center; display: inline-flex; flex: 0 0 44px; justify-content: center; min-width: 44px; width: 44px; height: 44px; padding: 0; }
.tutor-portal-body :is(.tutor-calendar-view-switch, .financial-period-switch) button.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--paper);
}
.tutor-portal-body .tutor-management-tabs button.is-active { background: var(--navy); color: var(--paper); box-shadow: 0 4px 14px rgba(36,59,53,.12); }
.tutor-portal-body .tutor-management-tabs button.is-active > span { background: var(--mint-soft); color: var(--navy); }
.tutor-portal-body .tutor-management-tabs button:hover:not(.is-active) { background: var(--mint-soft); color: var(--navy); }
.tutor-portal-body :is(.tutor-quick-actions button strong, .tutor-profile-summary-copy strong, .tutor-notification-item strong) { font-size: .9rem; line-height: 1.45; }
.tutor-portal-body .tutor-quick-actions button { min-width: 0; padding: 14px; }
.tutor-portal-body :where(#tutor-login, #tutor-home, dialog) :is(button:disabled, .button[aria-disabled=true]) { cursor: not-allowed; opacity: .55; box-shadow: none; transform: none; }
.tutor-portal-body :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--yellow-soft);
}
.tutor-portal-body .tutor-management-tabs button:focus-visible { outline-offset: -3px; box-shadow: inset 0 0 0 6px var(--yellow); }

/* Routine dialogs share the website's paper surface and soft shadow. */
.tutor-portal-body dialog:not(.portal-guide-menu) { max-height: calc(100dvh - 24px); }
.tutor-portal-body dialog::backdrop { background: rgba(24,43,36,.58); backdrop-filter: blur(4px); }
.tutor-portal-body :is(.tutor-calendar-action-shell, .tutor-profile-dialog-shell, .tutor-learner-detail-shell, .tutor-enquiry-dialog-shell, .tutor-substitution-shell, .tutor-confirm-dialog-shell, .paid-taster-notification-shell, .tutor-calendar-history-shell, .question-outcome-shell) {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 64px rgba(24,43,36,.22);
  max-height: calc(100dvh - 52px);
  overflow-y: auto;
  padding: 24px;
}
.tutor-portal-body dialog :is(header, footer) { gap: 16px; }
.tutor-portal-body dialog header > div { min-width: 0; }
.tutor-portal-body dialog h2 { font-family: var(--heading-font); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; overflow-wrap: anywhere; }
.tutor-portal-body dialog footer { flex-wrap: wrap; }
.tutor-portal-body .tutor-login-copy > p:not(.eyebrow) { font-size: 1.05rem; }

@media (max-width: 1050px) {
  .tutor-portal-body :is(.tutor-profile-form, .rollover-settings-form) { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tutor-portal-body .tutor-team-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .tutor-portal-body .tutor-next-card { grid-template-columns: minmax(0,1fr); }
  .tutor-portal-body .tutor-home-day-lesson { grid-template-columns: 52px minmax(0,1fr); }
  .tutor-portal-body .tutor-quick-actions { grid-template-columns: minmax(0,1fr); }
  .tutor-portal-body :is(.tutor-profile-form, .tutor-profile-fields, .rollover-settings-form, .stripe-invoice-form, .learner-detail-columns) { grid-template-columns: minmax(0,1fr); }
  .tutor-portal-body .profile-wide-field { grid-column: 1 / -1; }
  .tutor-portal-body :is(.tutor-team-list, .financial-detail-grid) { grid-template-columns: minmax(0,1fr); }
  .tutor-portal-body .master-tutor-note { display: grid; grid-template-columns: 38px minmax(0,1fr); }
  .tutor-portal-body .master-tutor-note > label { grid-column: 1 / -1; width: 100%; }
  .tutor-portal-body :is(.tutor-management-heading, .tutor-card-heading, .tutor-calendar-toolbar, .tutor-calendar-navigation) { flex-wrap: wrap; }
  .tutor-portal-body .tutor-calendar-navigation { justify-content: flex-start; }
  .tutor-portal-body .tutor-calendar-navigation .calendar-tutor-filter { flex-basis: 100%; }
  .tutor-portal-body :is(.tutor-calendar-action-shell, .tutor-profile-dialog-shell, .tutor-learner-detail-shell, .tutor-enquiry-dialog-shell, .tutor-substitution-shell, .tutor-confirm-dialog-shell, .paid-taster-notification-shell, .tutor-calendar-history-shell, .question-outcome-shell) { padding: 18px; }
  .tutor-portal-body dialog .button { max-width: 100%; }
}

/* Lesson and Lesson Planning are same-origin frames with their own stylesheet. */
.is-portal-embed {
  --forest: #243b35;
  --ink: #20312d;
  --paper: #fffef9;
  --canvas: #f3f5ed;
  --line: #ccd5ce;
  --muted: #68756f;
  --gold: #d8b96f;
}
/* The older planning stylesheet has nested rules with higher specificity. */
.is-portal-embed :is(button, input, select, textarea) { font-family: "DM Sans", sans-serif; font-size: .875rem !important; line-height: 1.5; min-height: 44px !important; }
.is-portal-embed :is(input, select, textarea):not([type=checkbox], [type=radio], [type=color], [type=range]) { font-size: 1rem !important; }
.is-portal-embed :is(input[type=checkbox], input[type=radio], input[type=color], input[type=range]) { min-height: 20px !important; }
.is-portal-embed label { font-size: .875rem !important; }
.is-portal-embed small { font-size: .8rem !important; line-height: 1.5; }
.is-portal-embed .packs-live-share b { font-size: .9rem; }
/* Scroll long lists without shrinking their cards below the text height. */
.is-portal-embed :is(.packs-student-list, .packs-list) { grid-auto-rows: max-content; }
.is-portal-embed :is(.packs-student-history-card strong, .packs-student-history-card small) { white-space: normal; }
.is-portal-embed :is(.packs-student-history-card, .packs-student-history-detail) { background-color: var(--paper); }
.is-portal-embed .packs-student-history-card.is-active { background: var(--forest); }
.is-portal-embed button:not(.packs-student-history-card, .packs-icon-button):not([aria-label]) { border-radius: 999px; }
.is-portal-embed :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; box-shadow: 0 0 0 6px #f5e9c8; }
@media (prefers-reduced-motion: reduce) {
  .tutor-portal-body :is(button, a, input, select, textarea) { transition: none; }
}

/* Own-lesson payout setup remains visibly pending until reconciliation. */
.stripe-connect-tutor.master-payout-setup { align-items:stretch; flex-direction:column; gap:12px; }
.stripe-connect-tutor.master-payout-setup > div:first-child { gap:6px; }
.stripe-connect-tutor.master-payout-setup span { font-size:.75rem; }
.stripe-connect-tutor.master-payout-setup strong { font-size:1rem; line-height:1.4; }
.stripe-connect-tutor.master-payout-setup small,.stripe-connect-tutor.master-payout-setup p { font-size:.875rem; line-height:1.55; }
.stripe-connect-tutor.master-payout-setup p { margin:4px 0; }
.stripe-connect-tutor.master-payout-setup > div:last-child { justify-content:flex-start; }
.stripe-connect-tutor.master-payout-setup button { min-height:44px; }
