.tenant-environment { margin-right: auto; color: #52627a; font-size: .8125rem; }
#tenant-main-content.mv-app-shell__main { padding: 0; }
.tenant-main-inner { padding: 1.5rem 2rem 2rem; }
.mv-portal-topbar { position: sticky; top: 0; z-index: 20; }
.mv-account__trigger { min-height: 3.25rem; margin: 0; }
.portal-page .mv-account__trigger { border: 1px solid transparent; background: #fff; color: var(--mv-text); }
.mv-app-shell__content .mv-portal-topbar .mv-account__trigger:hover:not([aria-expanded="true"]) { border-color: var(--mv-gold); background: #fff; }
.portal-page .mv-account__trigger[aria-expanded="true"] { background: var(--mv-subtle); }
.mv-account__logout { min-height: 3rem; }
.portal-page .mv-account__logout,
.portal-page .mv-account__logout:hover { background: #fff; color: var(--mv-text); }
.mv-account__action { width: 100%; min-height: 3rem; display: flex; align-items: center; gap: .75rem; margin: 0; padding: .7rem 1.25rem; border: 0; border-bottom: 1px solid var(--mv-border); border-radius: 0; background: white; color: var(--mv-text); font-weight: 600; text-align: left; }
.mv-account__action:hover { background: var(--mv-subtle); }
.mv-account__action .mv-icon { width: 1.25rem; height: 1.25rem; color: #52627a; }
.mv-account__avatar img { display: block; }
.tenant-profile-view { max-width: none; margin: 0; }
.tenant-profile-view[tabindex="-1"]:focus { outline: none; }
.tenant-profile-heading { margin: .5rem 0 1.5rem; }
.tenant-profile-heading h1 { margin: .35rem 0 .4rem; color: #0f172a; font: 700 2.25rem/1.15 Manrope, Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.025em; }
.tenant-profile-heading p:last-child { margin: 0; color: #64748b; }
.tenant-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, .3fr); gap: 1.5rem; align-items: start; }
.tenant-profile-main { min-width: 0; }
.tenant-profile-tabs { margin-bottom: 1.25rem; }
.tenant-profile-summary { display: grid; justify-items: center; text-align: center; }
.tenant-profile-summary > div:first-child { width: 100%; text-align: left; }
.tenant-profile-summary > strong { margin-top: 1.25rem; font: 750 1.25rem/1.2 var(--mv-font-heading); }
.tenant-profile-summary > small { margin-top: .25rem; color: #64748b; }
.tenant-profile-summary > .profile-badge { margin-top: .8rem; }
.tenant-profile-panel { min-height: 28rem; }
.tenant-profile-view .mv-profile-card { min-width: 0; padding: 1.625rem; border: 1px solid var(--mv-border); border-radius: .75rem; background: white; box-shadow: var(--mv-shadow-1); }
.tenant-profile-view .mv-profile-card:first-child { align-self: start; }
.tenant-profile-view .mv-profile-card h2 { margin: 0 0 .35rem; font-size: 1.2rem; }
.tenant-profile-view .mv-profile-card > div:first-child > p { margin: 0 0 1.25rem; color: #64748b; }
.tenant-profile-view .mv-profile-photo { padding: 0; border: 0; box-shadow: none; }
.tenant-profile-view .mv-profile-photo__preview { width: 9rem; height: 9rem; display: grid; place-items: center; overflow: hidden; border-radius: 999px; background: var(--mv-navy); color: white; font-size: 3rem; font-weight: 750; }
.tenant-profile-view .mv-profile-photo__preview img { width: 100%; height: 100%; object-fit: cover; }
.tenant-profile-view .mv-profile-photo .mv-secondary { display: inline-grid; grid-template-columns: 1.125rem auto; align-items: center; justify-content: center; column-gap: .5rem; margin-top: 1rem; white-space: nowrap; }
.tenant-profile-view .mv-profile-photo .mv-secondary > span { display: inline-flex; align-items: center; }
.tenant-profile-view .mv-profile-photo .mv-secondary .mv-icon { width: 1.125rem; height: 1.125rem; }
.tenant-profile-view .mv-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; align-items: start; }
.tenant-profile-view .mv-profile-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tenant-profile-view .mv-profile-grid__wide { grid-column: span 2; }
.tenant-profile-view .mv-profile-grid__full { grid-column: 1 / -1; }
.tenant-profile-view .mv-profile-grid > label { display: grid; grid-template-rows: auto 3rem minmax(1.25rem, auto); gap: .35rem; align-items: start; }
.tenant-profile-view .mv-profile-grid :is(input, select) { width: 100%; min-height: 3rem; box-sizing: border-box; }
.tenant-profile-view .mv-profile-grid label:last-child { grid-column: 1 / -1; max-width: 28rem; }
.tenant-profile-view .mv-profile-grid small { display: block; margin: 0; color: #64748b; font-weight: 400; }
.tenant-profile-view .mv-profile-grid input[readonly] { background: var(--mv-subtle); color: #52627a; }
.tenant-profile-view .mv-profile-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--mv-border); }
.tenant-profile-view .mv-profile-actions + .mv-inline-status-notice { margin: .75rem 0 0; }
.mv-save-action { display: inline-grid; grid-template-columns: auto 1rem; align-items: center; gap: .45rem; }
.mv-save-action__busy, .mv-save-action__spinner { display: none; }
.mv-save-action.is-busy .mv-save-action__label { display: none; }
.mv-save-action.is-busy .mv-save-action__busy, .mv-save-action.is-busy .mv-save-action__spinner { display: block; }
.mv-save-action__spinner { width: .9rem; height: .9rem; box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: mv-save-spin .8s linear infinite; }
@keyframes mv-save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mv-save-action__spinner { animation: none; } }
.profile-access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.profile-access-grid > div { display: grid; gap: .3rem; padding: 1rem; border: 1px solid var(--mv-border); border-radius: .5rem; background: var(--mv-subtle); }
.profile-access-grid small, .mv-profile-access-help { color: #64748b; }
.mv-profile-access-help { margin-top: 1.25rem; }
.tenant-profile-view .mv-inline-status-notice { justify-content: center; margin: .75rem 0 0; text-align: left; }
.tenant-workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.25rem; }
.tenant-workspace-context { margin: 0 0 .45rem; color: #4c2b91; font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.tenant-workspace-header h1 { margin: 0; color: #0f172a; font: 700 2.25rem/1.15 Manrope, Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.025em; }

.eyebrow { margin: 0; color: #6a51c7; font-size: .78rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.language-settings { margin: 1.25rem 0; padding: 1rem; border: 1px solid #e1e5ef; border-radius: .85rem; background: #f7f8fc; }
.language-settings h3 { margin: 0 0 .75rem; }
.language-settings label { margin-top: .65rem; }
#tenant-language-setting { margin-top: .75rem; }
.memberships { display: grid; gap: .75rem; }
.membership { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border: 1px solid #e1e5ef; border-radius: .75rem; padding: 1rem; }
.membership button { margin: 0; }
.membership small { display: block; margin-top: .3rem; color: #68748a; }
.error { min-height: 1.5rem; color: #ad2831; }
.invitation-acceptance { margin: 0; padding: 1rem; }
.workspace { margin: 0; padding: 0; border: 0; }
.profile-badge { padding: .35rem .6rem; border-radius: 999px; background: #eeeafd; color: #563eae; font-size: .78rem; font-weight: 800; }
.module-message { color: #68748a; line-height: 1.5; }
.time-entry-view { margin-top: 1.25rem; padding: 1.25rem; border: 1px solid #dbe2ea; border-radius: .75rem; background: white; box-shadow: 0 .125rem .5rem rgba(15, 23, 42, .04); }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.section-heading h3 { margin: .3rem 0 0; font-size: 1.5rem; }
.compact { min-height: 2.5rem; margin: 0; padding: .55rem .8rem; }
.time-entry-form { margin-top: 1.25rem; padding: 1rem; border-radius: .85rem; background: #f7f8fc; }
.form-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.form-row label { margin-top: 0; }
.form-actions { display: flex; gap: .65rem; align-items: center; }
.danger { background: #fff0f1; color: #a21d2b; }
.danger:hover { background: #fbdde0; }
.time-entry-list { display: grid; gap: .75rem; margin-top: 1.25rem; }
.time-entry-card { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border: 1px solid #e1e5ef; border-radius: .75rem; padding: 1rem; }
.time-entry-card p { margin: .35rem 0 0; color: #68748a; overflow-wrap: anywhere; }
.reference-meta { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.status-pill { padding: .2rem .45rem; border-radius: 999px; background: #e5f5ed; color: #147044; font-size: .72rem; font-weight: 800; }
.status-pill.inactive { background: #edf0f7; color: #68748a; }
.status-pill.status-degraded { background: #fff3d8; color: #805600; }
.status-pill.status-denied, .status-pill.status-blocked { background: #fff0f1; color: #a21d2b; }
.status-pill.locked, .status-pill.status-submitted { background: #fff3d8; color: #805600; }
.status-pill.status-approved { background: #e5f5ed; color: #147044; }
.status-pill.status-rejected { background: #fff0f1; color: #a21d2b; }
.status-pill.status-draft { background: #edf0f7; color: #536078; }
.entry-actions { display: flex; gap: .5rem; flex: 0 0 auto; }
.delete-confirmation { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.delete-confirmation span { width: 100%; color: #a21d2b; font-size: .85rem; font-weight: 750; text-align: right; }
.empty-state { margin: 0; padding: 1.25rem; border: 1px dashed #bcc5d8; border-radius: .75rem; color: #68748a; text-align: center; }
.entry-selector { margin: 1rem 0; border: 1px solid #d9deea; border-radius: .75rem; padding: .85rem; }
.entry-selector legend { padding: 0 .35rem; font-weight: 750; }
.entry-option { display: flex; gap: .7rem; align-items: start; margin: 0; padding: .55rem 0; font-weight: 500; }
.entry-option + .entry-option { border-top: 1px solid #e1e5ef; }
.entry-option input { width: 1.15rem; min-height: 1.15rem; margin: .15rem 0 0; flex: 0 0 auto; }
.timesheet-card { align-items: start; }
.timesheet-entry-summary { margin: .75rem 0 0; padding-left: 1.25rem; color: #536078; }
.timesheet-entry-summary li + li { margin-top: .3rem; }
.rejection-reason { color: #a21d2b !important; }
.review-form { min-width: min(100%, 18rem); flex-wrap: wrap; }
.review-form textarea { flex-basis: 100%; }
.access-list { display: grid; gap: .75rem; margin-top: .75rem; }
.access-invitation-form { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(18rem, 1.3fr) auto; gap: .75rem; align-items: end; }
.organization-settings-form { display: grid; grid-template-columns: minmax(16rem, 28rem) auto; gap: .75rem; align-items: end; max-width: 42rem; }
.organization-settings-form button { margin: 0; }
.organization-settings-form small { display: block; margin-top: .35rem; color: #68748a; }
.access-invitation-form button { margin: 0; }
.access-role-options { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: .55rem .7rem; border: 1px solid #d9deea; border-radius: .65rem; }
.access-role-options legend { padding: 0 .25rem; font-weight: 750; }
.access-role-options label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-size: .85rem; }
.access-role-options input { width: 1rem; min-height: 1rem; }
.access-membership-card { display: grid; grid-template-columns: minmax(12rem, 1.2fr) minmax(18rem, 1.5fr) minmax(9rem, .8fr) auto; gap: .75rem; align-items: end; padding: 1rem; border: 1px solid #e1e5ef; border-radius: .75rem; }
.access-membership-card p, .access-invitation-card p { margin: .3rem 0 0; color: #68748a; overflow-wrap: anywhere; }
.access-membership-card button { margin: 0; }
.access-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.access-audit { grid-column: 1 / -1; color: #68748a; }
.access-invitation-card { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem; border: 1px solid #e1e5ef; border-radius: .75rem; }
.ai-credit-view { margin-top: 1.25rem; padding: 1.25rem; border: 1px solid #dbe2ea; border-radius: .75rem; background: white; box-shadow: 0 .125rem .5rem rgba(15, 23, 42, .04); }
.ai-credit-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.ai-credit-metrics article { display: grid; gap: .4rem; padding: 1rem; border: 1px solid #e1e5ef; border-radius: .75rem; background: #f7f8fc; }
.ai-credit-metrics span { color: #68748a; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.ai-credit-metrics strong { color: #231b42; font-size: 1.5rem; }
.ai-warning-list { display: grid; gap: .5rem; }
.ai-warning { margin: 0; padding: .7rem .85rem; border-left: .25rem solid #b7791f; border-radius: .4rem; background: #fff8e6; color: #674200; }
.ai-warning--critical { border-left-color: #ad2831; background: #fff0f1; color: #8b1e29; }
.ai-credit-tabs, .mv-shell nav.ai-credit-tabs { display: flex; gap: .35rem; margin: 1.25rem 0 0; border-bottom: 1px solid #dbe2ea; }
.ai-credit-tabs button { min-height: 2.75rem; margin: 0 0 -1px; padding: .6rem .9rem; border: 0; border-bottom: .2rem solid transparent; border-radius: .4rem .4rem 0 0; background: transparent; color: #536078; }
.ai-credit-tabs button:hover, .ai-credit-tabs button.active { border-bottom-color: #6f50c9; background: #f5f2ff; color: #563eae; }
.ai-credit-panel { padding: 1rem 0; }
.ai-credit-panel h4 { margin: 0 0 .75rem; }
.ai-responsive-table { max-width: 100%; overflow-x: auto; }
.ai-responsive-table table { width: 100%; border-collapse: collapse; }
.ai-responsive-table th, .ai-responsive-table td { padding: .7rem .65rem; border-bottom: 1px solid #e1e5ef; text-align: left; vertical-align: top; }
.ai-responsive-table th { color: #536078; font-size: .75rem; letter-spacing: .03em; text-transform: uppercase; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .panel { padding: 2rem 1.125rem; }
  .portal-entry-card { min-height: 0; padding: 2rem 1.5rem; }
  .portal-brand--light { margin-bottom: 1.75rem; }
  .portal-story { min-height: 27.5rem; padding: 3.5rem 1.75rem; }
  .portal-story .portal-brand { margin-bottom: 2.375rem; }
  .portal-story-module { width: 9.375rem; height: 9.375rem; }
  body.app-authenticated .shell, body.app-authenticated .panel { padding: 0; }
  .tenant-main-inner { padding: 1.25rem 1rem 2rem; }
  .mv-portal-topbar { align-items: center; }
  .tenant-environment { width: 100%; }
  .tenant-workspace-header { align-items: flex-start; flex-direction: column; }
  .tenant-workspace-header h1 { font-size: 1.875rem; }
  .tenant-profile-heading h1 { font-size: 1.875rem; }
  .tenant-profile-layout, .tenant-profile-view .mv-profile-grid, .tenant-profile-view .mv-profile-grid--three, .profile-access-grid { grid-template-columns: 1fr; }
  .tenant-profile-summary { order: -1; }
  .tenant-profile-view .mv-profile-grid__wide, .tenant-profile-view .mv-profile-grid__full { grid-column: auto; }
  .tenant-profile-view .mv-profile-actions { flex-direction: column-reverse; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .time-entry-card { align-items: stretch; flex-direction: column; }
  .entry-actions button { flex: 1; }
  .entry-actions { flex-wrap: wrap; }
  .review-form { width: 100%; }
  .access-invitation-form, .access-membership-card, .organization-settings-form { grid-template-columns: 1fr; }
  .access-invitation-card { align-items: stretch; flex-direction: column; }
  .ai-credit-metrics { grid-template-columns: 1fr; }
  .ai-credit-tabs { overflow-x: auto; }
  .ai-responsive-table table, .ai-responsive-table tbody, .ai-responsive-table tr, .ai-responsive-table td { display: block; }
  .ai-responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .ai-responsive-table tr { padding: .5rem 0; border-bottom: 1px solid #dbe2ea; }
  .ai-responsive-table td { display: grid; grid-template-columns: minmax(7rem, .8fr) minmax(0, 1.2fr); gap: .5rem; border: 0; }
  .ai-responsive-table td::before { content: attr(data-label); color: #536078; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
  .delete-confirmation span { text-align: left; }
  .portal-stepper ol { gap: .3rem; }
  .portal-stepper li { gap: .3rem; min-width: 0; font-size: .625rem; white-space: normal; }
  .portal-stepper li > b { min-width: 0; overflow-wrap: anywhere; }
  .portal-stepper li:not(:last-child)::after { min-width: .2rem; }
  .portal-entry-identity { grid-template-columns: 2.75rem minmax(0,1fr); }
  .portal-entry-identity .portal-link-button { grid-column: 2; justify-self: start; }
  .portal-language-options { grid-template-columns: 1fr; }
  .portal-language-options button { min-height: 4rem; }
}

@media (max-width: 420px) {
  .portal-entry-card { padding: 1.75rem 1.25rem; }
  .portal-entry-card h1 { font-size: 1.875rem; }
  .portal-brand span { font-size: 1.5625rem; }
  .portal-story { min-height: 25rem; padding: 3rem 1.375rem; }
  .portal-story .portal-brand span { font-size: 1.6875rem; }
  .portal-story h2 { font-size: 1.8125rem; }
  .portal-story strong { font-size: 1.375rem; }
  .portal-footer { min-height: 3.5rem; }
}

@media (max-width: 350px) {
  .portal-stepper li { flex: 1; }
  .portal-stepper li:last-child { flex: 0 0 auto; }
  .portal-stepper li > b { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .portal-stepper li:not(:last-child)::after { min-width: .75rem; margin-left: .25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .portal-loader, .portal-loading-tasks li.is-active > span, .portal-progress span, .portal-entry-view { animation: none !important; }
  .portal-progress span { background: var(--mv-purple); }
}
