:root {
  --tt-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --tt-text: #1f2937;
  --tt-muted: #64748b;
  --tt-heading: #1e3a8a;
  --tt-primary: #3b6e8c;
  --tt-primary-hover: #315f79;
  --tt-secondary: #4b5563;
  --tt-danger: #b91c1c;
  --tt-surface: #ffffff;
  --tt-surface-soft: #f8fafc;
  --tt-border: #cbd5e1;
  --tt-border-soft: #e2e8f0;
  --tt-control-height: 38px;
  --tt-radius: 6px;
  --tt-card-radius: 8px;
}

.tt-resource-panel {
  color: var(--tt-text);
  font-family: var(--tt-font);
  font-size: 14px;
  line-height: 1.4;
}

.tt-resource-panel :where(h1, h2, h3, h4, h5, h6) {
  color: var(--tt-heading);
  font-family: var(--tt-font);
  font-weight: 750;
  line-height: 1.2;
}

.tt-resource-panel :where(label, legend, th) {
  color: #334155;
  font-family: var(--tt-font);
  font-weight: 650;
}

.tt-resource-panel :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  min-height: var(--tt-control-height) !important;
  border-radius: 5px !important;
  border-color: var(--tt-border) !important;
  color: var(--tt-text);
  font-family: var(--tt-font) !important;
  font-size: 14px !important;
}

.tt-resource-panel :where(textarea) {
  min-height: 84px !important;
  line-height: 1.4;
}

.tt-resource-panel :where(button, input[type="button"], input[type="submit"], input[type="reset"]) {
  min-height: var(--tt-control-height) !important;
  border-radius: var(--tt-radius) !important;
  font-family: var(--tt-font) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  line-height: 1.2;
}

.tt-resource-panel :where(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--tt-primary) !important;
  outline-offset: 2px;
}

.tt-resource-panel :where(button, input[type="button"], input[type="submit"], input[type="reset"]):disabled {
  cursor: not-allowed !important;
  opacity: .72;
}

.tt-resource-panel :where(table) {
  color: var(--tt-text);
  font-family: var(--tt-font);
}

.tt-resource-panel :where(th) {
  background: var(--tt-surface-soft);
}

.tt-resource-panel :where(.card, .pp-card, .sp-profile-box, .att-section, .sm-card, .ss-service-card, .sa-card) {
  border-color: var(--tt-border-soft) !important;
  border-radius: var(--tt-card-radius) !important;
}

.tt-resource-panel :where(.tab-btn, .sp-tab, .pp-tab, .att-tab, .sm-tab, .sa-tab) {
  border-radius: 7px 7px 0 0 !important;
}

.tt-resource-panel :where(.btn, .pp-btn, .ss-btn, .att-btn, .sm-btn, .sa-btn):not(.danger):not(.btn-danger):not(.pp-btn-danger):not(.ss-btn-remove):not(.att-btn-danger) {
  --tt-module-primary: var(--tt-primary);
}

/* Shared profile-resource component system.
   Student, Staff, and Provider Profiles all use this same outer structure. */
.tt-resource-panel .tt-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 15px;
}

.tt-resource-panel .tt-profile-header h3 {
  margin: 0 !important;
}

.tt-resource-panel .tt-profile-shell {
  box-sizing: border-box;
  border: 1px solid var(--tt-border) !important;
  border-radius: var(--tt-card-radius) !important;
  padding: 16px !important;
  background: var(--tt-surface) !important;
}

.tt-resource-panel .tt-profile-selector {
  margin: 0 0 14px !important;
}

.tt-resource-panel .tt-profile-selector > label {
  display: block;
  margin-bottom: 5px !important;
}

.tt-resource-panel .tt-profile-selector-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tt-resource-panel .tt-profile-selector-control {
  display: block !important;
  flex: 1 1 auto;
  min-width: 0;
}

.tt-resource-panel .tt-profile-selector-control > select,
.tt-resource-panel select.tt-profile-selector-control {
  box-sizing: border-box;
  width: 100% !important;
}

.tt-resource-panel .tt-profile-button {
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: var(--tt-control-height) !important;
  border: 0 !important;
  border-radius: var(--tt-radius) !important;
  padding: 8px 13px !important;
  background: var(--tt-primary) !important;
  color: #fff !important;
  cursor: pointer;
  white-space: nowrap;
}

.tt-resource-panel .tt-profile-button:hover {
  background: var(--tt-primary-hover) !important;
}

.tt-resource-panel .tt-profile-button.secondary {
  background: var(--tt-secondary) !important;
}

.tt-resource-panel .tt-profile-button.danger {
  background: var(--tt-danger) !important;
}

.tt-resource-panel .tt-profile-button:disabled {
  background: #9ca3af !important;
}

.tt-resource-panel .tt-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 5px;
  margin: 0 0 14px !important;
  padding: 0 4px !important;
  border-bottom: 1px solid var(--tt-border) !important;
}

.tt-resource-panel .tt-profile-tab {
  appearance: none;
  min-height: 40px !important;
  margin-bottom: -1px !important;
  padding: 9px 15px !important;
  border: 1px solid var(--tt-border) !important;
  border-bottom: 0 !important;
  border-radius: 7px 7px 0 0 !important;
  background: #f3f4f6 !important;
  color: #475569 !important;
  cursor: pointer;
}

.tt-resource-panel .tt-profile-tab:hover {
  background: #e8eef3 !important;
  color: #25364a !important;
}

.tt-resource-panel .tt-profile-tab.active {
  border-color: #9fb4c5 !important;
  border-bottom: 1px solid var(--tt-surface) !important;
  background: var(--tt-surface) !important;
  color: #25364a !important;
  font-weight: 750 !important;
}

.tt-resource-panel .tt-profile-card {
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 14px !important;
  border: 1px solid var(--tt-border-soft) !important;
  border-radius: var(--tt-card-radius) !important;
  background: #fafafa !important;
}

.tt-resource-panel .tt-profile-actions {
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px !important;
  padding-top: 14px !important;
  border-top: 1px solid var(--tt-border-soft);
}

.tt-resource-panel .tt-profile-action-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-resource-panel .tt-profile-submit {
  align-items: center;
  margin: 0 !important;
}

@media (max-width: 700px) {
  .tt-resource-panel .tt-profile-shell {
    padding: 12px !important;
  }

  .tt-resource-panel .tt-profile-selector-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .tt-resource-panel .tt-profile-selector-control {
    flex-basis: 100%;
  }
}


/* Responsive foundation shared by every dynamically loaded ThinkTink module.
   The shell publishes the visible browser size; each resource publishes its
   own rendered container size without imposing a desktop resolution. */
.tt-resource-panel {
  --tt-available-width: var(--tt-container-width, var(--tt-visible-viewport-width, 100vw));
  --tt-available-height: var(--tt-container-height, var(--tt-visible-viewport-height, 100vh));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tt-resource-panel *,
.tt-resource-panel *::before,
.tt-resource-panel *::after {
  box-sizing: border-box;
}

.tt-resource-panel > *,
.tt-resource-panel :where(form, fieldset, section, article, main, aside, header, footer, nav) {
  min-width: 0;
  max-width: 100%;
}

.tt-resource-panel :where(img, video, canvas, svg) {
  max-width: 100%;
}

:fullscreen .tt-resource-panel,
.tt-resource-panel:fullscreen {
  width: var(--tt-visible-viewport-width, 100vw);
  max-width: var(--tt-visible-viewport-width, 100vw);
  min-height: var(--tt-visible-viewport-height, 100vh);
  max-height: var(--tt-visible-viewport-height, 100vh);
}
