#portal-app {max-width:1200px;}
#portal-status {padding:1rem;border-left:4px solid var(--tih-blue);background:var(--tih-card);line-height:1.7;overflow-wrap:anywhere;}
.portal-panel {padding:clamp(1.1rem,3vw,2rem);margin:1.2rem 0;border:1px solid var(--tih-border);border-radius:16px;background:var(--tih-card);min-width:0;}
.portal-panel h2 {font-size:1.5rem;}.portal-panel h3 {margin-top:1.5rem;}
.portal-columns {display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:1.3rem;align-items:start;}
#portal-app label {display:block;font-weight:650;font-size:.9rem;line-height:1.6;margin:.8rem 0 .4rem;}
#portal-app input:not([type=checkbox]),#portal-app select,#portal-app textarea {box-sizing:border-box;max-width:100%;width:100%;min-width:0;min-height:46px;padding:.75rem;border:1px solid var(--tih-border);border-radius:10px;background:var(--tih-soft);color:var(--tih-ink);font:inherit;}
#portal-app input[type=checkbox] {width:18px;height:18px;accent-color:var(--tih-red);}
#portal-app fieldset {border:0;min-width:0;padding:0;}#portal-app fieldset:disabled {opacity:.6;}
#portal-app textarea {resize:vertical;}#portal-app .btn {margin-top:.8rem;white-space:normal;}
html body.tih-branded #portal-app .btn-outline {color:var(--tih-ink);border:1px solid var(--tih-border);background:var(--tih-card);}
.portal-row {padding:1rem 0;border-bottom:1px solid var(--tih-border);overflow-wrap:anywhere;}
.portal-row button {display:block;text-align:left;border:0;background:transparent;color:var(--tih-navy);font:inherit;font-weight:700;min-height:44px;cursor:pointer;}
html[data-theme=dark] .portal-row button {color:#a9caff;}
.portal-row p,.portal-row small {display:block;margin:.3rem 0;color:var(--tih-copy);line-height:1.7;}
.portal-copy,.portal-message p {white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;}
.portal-message,.portal-milestone {padding:1rem;margin:.8rem 0;border:1px solid var(--tih-border);border-radius:10px;}
.portal-message.internal {border-left:4px solid var(--tih-red);background:var(--tih-warm);}
#portal-login {max-width:720px;margin-inline:auto;}#portal-verify {padding-top:1rem;border-top:1px solid var(--tih-border);}
#portal-detail {scroll-margin-top:110px;}#portal-app [hidden] {display:none!important;}
#portal-app button:disabled {opacity:.6;cursor:wait;}
@media(max-width:850px){.portal-columns {grid-template-columns:minmax(0,1fr);}}

#portal-status {scroll-margin-top:120px;color:var(--tih-ink);}
#portal-status[data-state=error] {border-left-color:#b42318;background:#fff0ee;color:#861d14;}
#portal-status[data-state=pending] {border-left-color:#245fba;}
#portal-status[data-state=pending]::before {content:"";display:inline-block;width:.8rem;height:.8rem;margin-right:.6rem;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:portal-spin .8s linear infinite;}
.portal-recovery {display:flex;gap:1rem;align-items:center;flex-wrap:wrap;margin:.8rem 0;}
.portal-recovery button {padding:.6rem 1rem;border:1px solid var(--tih-border);border-radius:8px;background:var(--tih-card);color:var(--tih-ink);font:inherit;cursor:pointer;min-height:44px;}
@keyframes portal-spin {to{transform:rotate(360deg);}}
@media(prefers-reduced-motion:reduce){#portal-status[data-state=pending]::before {animation:none;}}

/* Focused account screens share the site's TIH brand and accessibility controls. */
.portal-heading {padding:2rem 0 0;background:var(--tih-soft);}
.portal-heading h1 {font-size:clamp(1.7rem,4vw,2.5rem);margin:.25rem 0 1rem;line-height:1.2;}
.portal-heading .section-label {font-size:.75rem;letter-spacing:.12em;}
.portal-switcher {display:flex;gap:1.25rem;flex-wrap:wrap;border-bottom:1px solid var(--tih-border);}
.portal-switcher a {padding:.75rem 0;min-height:44px;color:var(--tih-copy);font-size:.9rem;text-decoration:none;border-bottom:3px solid transparent;}
.portal-switcher a[aria-current] {border-bottom-color:var(--tih-red);color:var(--tih-navy);font-weight:750;}
body[data-portal] main > .section {padding:1.25rem 0 3rem;}
body.portal-auth-active #portal-app {max-width:560px;}
#portal-login {max-width:520px;margin:.75rem auto;padding:clamp(1.25rem,4vw,2.5rem);border-radius:22px;box-shadow:0 16px 50px rgba(11,42,107,.07);}
.portal-auth-brand {font-size:.7rem;letter-spacing:.14em;font-weight:800;color:var(--tih-copy);margin-bottom:1.2rem;}
.portal-auth-brand span {color:var(--tih-red);padding:0 .4rem;}
#portal-login #auth-title {font-size:clamp(1.65rem,5vw,2rem);line-height:1.2;margin:0 0 .65rem;}
#portal-login #auth-intro {font-size:1rem;line-height:1.6;color:var(--tih-copy);margin:0 0 1.25rem;}
#portal-app #auth-form label,#portal-app #verify-form label {font-size:.9rem;}
#portal-app #auth-form input,#portal-app #verify-form input {min-height:52px;background:var(--tih-card);font-size:1rem;border-radius:10px;}
#portal-app input:focus-visible,#portal-app button:focus-visible,.portal-switcher a:focus-visible {outline:3px solid #76baff;outline-offset:3px;}
#portal-app .portal-auth-submit {display:flex;width:100%;justify-content:center;min-height:50px;margin-top:1.25rem;border-radius:10px;font-size:1rem;}
.portal-password {position:relative;}
#portal-app .portal-password input {padding-right:4.5rem;}
#portal-app .portal-password button {position:absolute;right:.35rem;top:.25rem;min-height:44px;padding:0 .75rem;border:0;background:transparent;color:var(--tih-navy);font:inherit;font-size:.85rem;cursor:pointer;}
#portal-app .portal-hint {font-size:.85rem;line-height:1.6;color:var(--tih-copy);margin:.7rem 0;}
.portal-divider {position:relative;text-align:center;border-top:1px solid var(--tih-border);margin:1.6rem 0 .4rem;height:.2rem;}
.portal-divider span {position:relative;top:-.85rem;padding:0 .8rem;background:var(--tih-card);color:var(--tih-copy);font-size:.85rem;}
#portal-app .portal-text-button {border:0;padding:.45rem .1rem;background:transparent;color:var(--tih-navy);font:inherit;font-size:.9rem;font-weight:700;min-height:44px;text-decoration:underline;text-underline-offset:3px;cursor:pointer;}
.portal-auth-switch {text-align:center;font-size:.9rem;margin:.7rem 0;}
.portal-auth-help {border-top:1px solid var(--tih-border);padding-top:1rem;font-size:.85rem;color:var(--tih-copy);}
.portal-auth-help summary {cursor:pointer;min-height:35px;}
#portal-app .portal-auth-help p {font-size:.85rem;line-height:1.6;}
#portal-app .portal-auth-footer {margin:1.5rem 0 0;padding-top:1.25rem;border-top:1px solid var(--tih-border);font-size:.8rem;line-height:1.9;color:var(--tih-copy);}
#portal-verify {padding-top:0;border-top:0;}
#verify-help {font-size:.95rem;line-height:1.7;overflow-wrap:anywhere;}
#portal-app #auth-code {font-variant-numeric:tabular-nums;font-size:1.6rem;letter-spacing:.4em;text-align:center;min-height:64px;}
.portal-code-actions {display:flex;justify-content:space-between;flex-wrap:wrap;gap:.5rem;}
#portal-status {font-size:.9rem;line-height:1.6;border-radius:10px;padding:.75rem 1rem;margin:0 0 .75rem;}
#portal-status:empty {display:none;}
.portal-recovery {display:none;font-size:.85rem;}
#portal-status[data-state=error] + .portal-recovery {display:flex;}
body.portal-auth-active .whatsapp-float,body.portal-auth-active .tih-audio-ctl,body.portal-auth-active #tih-chat-btn,body.portal-auth-active #tih-chat-win,body.portal-auth-active #tih-greet {display:none!important;}
html[data-theme=dark] #portal-app .portal-text-button,html[data-theme=dark] #portal-app .portal-password button,html[data-theme=dark] .portal-switcher a[aria-current] {color:#b9d5ff;}
@media(max-width:480px){.portal-heading{padding-top:1.25rem;}.portal-switcher{gap:1rem;}.portal-switcher a{font-size:.8rem;}#portal-login{border-radius:16px;}body[data-portal] .site-header .brand{font-size:1rem;}}

/* Form controls stay fixed under the pointer and while requests refresh. */
html body[data-portal] #portal-app button,
html body[data-portal] #portal-app button:hover,
html body[data-portal] #portal-app button:active {transform:none!important;}

/* A calm, task-focused workspace with persistent section navigation. */
body[data-portal] #portal-workspace {font-size:1rem;}
.portal-workspace-header {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.25rem 0 1.75rem;}
.portal-member {display:flex;gap:.85rem;align-items:center;min-width:0;}
#portal-avatar {display:grid;place-items:center;flex:0 0 50px;width:50px;height:50px;border-radius:16px;background:var(--tih-navy);color:#fff;font-size:1rem;font-weight:800;}
#portal-person {font-weight:750;line-height:1.4;margin:.1rem 0;font-size:1rem;overflow-wrap:anywhere;}
#portal-app .portal-eyebrow {font-size:.66rem;font-weight:800;letter-spacing:.13em;line-height:1.7;color:var(--tih-copy);margin:0 0 .4rem;}
.portal-role {font-size:.75rem;color:var(--tih-copy);}
#portal-app .portal-workspace-header .btn {margin:0;font-size:.85rem;min-height:44px;}
.portal-shell {display:grid;grid-template-columns:205px minmax(0,1fr);gap:1.75rem;align-items:start;}
.portal-sidebar {position:sticky;top:105px;border:1px solid var(--tih-border);border-radius:16px;background:var(--tih-card);padding:.65rem;}
.portal-sidebar nav {display:grid;gap:.25rem;}
#portal-app .portal-sidebar nav button {display:flex;align-items:center;gap:.6rem;border:0;background:transparent;border-radius:10px;min-height:48px;padding:.7rem .75rem;text-align:left;color:var(--tih-copy);font:inherit;font-size:.85rem;font-weight:650;cursor:pointer;}
#portal-app .portal-sidebar nav button[aria-current] {background:var(--tih-soft);color:var(--tih-navy);box-shadow:inset 3px 0 var(--tih-red);}
.portal-sidebar nav span {font-size:1.15rem;}
.portal-sidebar-help {border-top:1px solid var(--tih-border);padding:1.25rem .6rem .5rem;margin-top:1rem;font-size:.8rem;line-height:1.7;color:var(--tih-copy);}
#portal-app .portal-sidebar-help p {font-size:.8rem;line-height:1.7;margin:.4rem 0 .7rem;}
.portal-sidebar-help a {font-weight:700;}
.portal-main {min-width:0;}
.portal-view-heading,.portal-section-heading {display:flex;align-items:center;justify-content:space-between;gap:1rem;}
#portal-app .portal-view-heading h2 {font-size:clamp(1.4rem,3vw,1.8rem);margin:.25rem 0 .5rem;line-height:1.3;}
#portal-app .portal-view-heading p:not(.portal-eyebrow) {font-size:.95rem;line-height:1.7;color:var(--tih-copy);margin:.25rem 0;}
#portal-app .portal-view-heading .btn {margin:0;min-height:44px;font-size:.85rem;}
#portal-app .portal-muted {font-size:.85rem;color:var(--tih-copy);margin:1.2rem 0 .65rem;}
.portal-stats {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.7rem;}
#portal-app .portal-stat {display:flex;flex-direction:column;align-items:flex-start;text-align:left;padding:1.1rem .9rem;border:1px solid var(--tih-border);border-radius:14px;background:var(--tih-card);color:var(--tih-ink);font:inherit;cursor:pointer;gap:.4rem;}
#portal-app .portal-stat > span:first-child {font-size:.78rem;color:var(--tih-copy);line-height:1.5;}
#portal-app .portal-stat strong {font-size:1.9rem;line-height:1.2;}
#portal-app .portal-stat .portal-stat-link {font-size:.67rem;font-weight:700;color:var(--tih-copy);margin-top:.4rem;}
#portal-app .portal-stat:hover {border-color:var(--tih-blue);box-shadow:0 3px 12px #0b2a6b0b;}
#portal-app .portal-next-step {display:flex;align-items:center;justify-content:space-between;gap:1rem;background:linear-gradient(110deg,var(--tih-card),var(--tih-soft));border-left:4px solid var(--tih-red);}
#portal-app .portal-next-step h3 {margin:.3rem 0;font-size:1.15rem;line-height:1.5;}
#portal-app .portal-next-step p:not(.portal-eyebrow) {font-size:.85rem;line-height:1.7;margin:.4rem 0;color:var(--tih-copy);}
#portal-app .portal-next-step .btn {font-size:.85rem;flex-shrink:0;}
#portal-workspace .portal-panel {margin:0 0 1.25rem;border-radius:16px;padding:clamp(1rem,2.5vw,1.6rem);}
#portal-overview .portal-panel {margin-top:1.25rem;}
#portal-workspace .portal-panel h2 {font-size:1.45rem;line-height:1.4;}
#portal-workspace h2 {scroll-margin-top:120px;}
#portal-app .portal-section-heading h2,#portal-app .portal-section-heading h3 {margin:0;}
#portal-app .portal-section-heading .btn,#portal-app .portal-section-heading .portal-text-button {margin:0;}
#portal-app .portal-section-heading h3 {font-size:1.1rem;}
.portal-row:last-child {border-bottom:0;}
#portal-app .portal-row > button {font-size:.95rem;line-height:1.5;padding:.3rem 0;color:var(--tih-navy);}
.portal-row-meta {display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;font-size:.78rem;color:var(--tih-copy);margin:.3rem 0;}
.portal-status-badge,.portal-type-badge {display:inline-flex;padding:.25rem .6rem;border-radius:7px;background:var(--tih-soft);color:var(--tih-copy);font-size:.72rem;font-weight:750;line-height:1.7;text-transform:capitalize;}
.portal-status-badge.open {background:#eaf2ff;color:#124685;}.portal-status-badge.in_progress {background:#edf0ff;color:#3b43a0;}.portal-status-badge.waiting_for_client {background:#fff3dd;color:#805500;}.portal-status-badge.resolved {background:#e5f5ee;color:#16653c;}.portal-status-badge.cancelled {background:#f1f1f1;color:#535353;}
#queue-filters {padding:1rem;margin:1.25rem 0;background:var(--tih-soft);border-radius:12px;}
#portal-app #queue-filters label {margin-top:.4rem;}
#portal-app #queue-filters .btn {font-size:.85rem;}
#portal-app .portal-empty {text-align:center;padding:2rem 1rem;color:var(--tih-copy);}
#portal-app .portal-empty strong {color:var(--tih-ink);font-size:1rem;}
#portal-app .portal-empty p {font-size:.9rem;line-height:1.8;}
#portal-app .portal-data-note {font-size:.8rem;line-height:1.8;color:var(--tih-copy);}
#portal-create {max-width:760px;}
#portal-create > p:not(.portal-eyebrow),#portal-detail > p {font-size:.95rem;line-height:1.8;color:var(--tih-copy);}
.portal-detail-heading {padding:1rem 0 1.5rem;margin-bottom:1rem;border-bottom:1px solid var(--tih-border);}
#detail-meta {font-size:.8rem;line-height:1.8;color:var(--tih-copy);}
.portal-badges {display:flex;gap:.5rem;flex-wrap:wrap;}
#staff-controls {background:var(--tih-soft);border:1px solid var(--tih-border);padding:1rem 1.25rem;border-radius:12px;margin:1.5rem 0;}
#staff-controls h3 {margin-top:0;}
#portal-app .portal-staff-notice {font-size:.8rem;color:var(--tih-copy);line-height:1.7;}
.portal-message {border-radius:12px;}
.portal-message strong {font-size:.85rem;}.portal-message small {font-size:.75rem;color:var(--tih-copy);}
.portal-message.internal {border-left-color:#bd6900;background:var(--tih-warm);}
#portal-app .portal-private-choice {padding:.85rem;background:var(--tih-soft);border:1px solid var(--tih-border);border-radius:10px;font-size:.85rem;}
#portal-app .portal-private-choice input {margin-right:.5rem;vertical-align:middle;}
#audit-panel {margin:1.5rem 0 0;padding:1rem;border:1px solid var(--tih-border);border-radius:10px;font-size:.85rem;line-height:1.8;}#audit-panel summary{cursor:pointer;font-weight:700;}
body[data-portal] .tih-audio-ctl,body[data-portal] .whatsapp-float {display:none!important;}
html[data-theme=dark] #portal-app .portal-sidebar nav button[aria-current],html[data-theme=dark] #portal-app .portal-row > button {color:#b9d5ff;}
@media(max-width:1050px){.portal-shell{grid-template-columns:180px minmax(0,1fr);gap:1rem;}.portal-stats{grid-template-columns:repeat(2,minmax(0,1fr));}.portal-next-step{flex-wrap:wrap;}}
@media(max-width:720px){.portal-shell{grid-template-columns:minmax(0,1fr);}.portal-sidebar{position:static;padding:.4rem;border-radius:12px;}.portal-sidebar nav{grid-template-columns:repeat(3,minmax(0,1fr));gap:.2rem;}#portal-app .portal-sidebar nav button{flex-direction:column;justify-content:center;text-align:center;font-size:.72rem;padding:.55rem .3rem;gap:.2rem;min-height:64px;}#portal-app .portal-sidebar nav button[aria-current]{box-shadow:inset 0 -3px var(--tih-red);}.portal-sidebar-help{display:none;}.portal-workspace-header{padding:.5rem 0 1rem;}.portal-stats{gap:.6rem;}#portal-app .portal-stat{padding:1rem;}#portal-app .portal-view-heading{align-items:flex-start;}#portal-app .portal-next-step .btn{width:100%;}.portal-section-heading{flex-wrap:wrap;}}

body[data-portal] #main-content {min-height:calc(100dvh - 190px);}
body[data-portal] .brand-section-art,body[data-portal] #back-to-top {display:none!important;}
.portal-workspace-footer {border-top:1px solid var(--tih-border);padding:1.5rem 0;background:var(--tih-card);color:var(--tih-copy);}
.portal-workspace-footer .container {display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.75rem;}
.portal-workspace-footer p,.portal-workspace-footer a {font-size:.78rem;line-height:1.8;margin:0;}
.portal-workspace-footer nav {display:flex;flex-wrap:wrap;gap:1rem;}
@media(max-width:480px){.portal-workspace-footer .container{flex-direction:column;align-items:flex-start;}}

.portal-draft-status {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.2rem;margin:0 0 1.25rem;border:1px solid #e8cf9b;border-left:4px solid #bd7800;border-radius:12px;background:var(--tih-card);}
#portal-app .portal-draft-status strong {font-size:.9rem;color:var(--tih-ink);}
#portal-app .portal-draft-status p {font-size:.8rem;line-height:1.7;color:var(--tih-copy);margin:.25rem 0 0;}
.portal-draft-status > div:last-child {display:flex;gap:.85rem;flex-wrap:wrap;}
#portal-app .portal-draft-status .portal-text-button {font-size:.8rem;}
#portal-app .portal-network {padding:1rem;border:1px solid #dfbe73;border-radius:10px;font-size:.9rem;line-height:1.8;background:var(--tih-card);}
.portal-filter-actions {display:flex;align-items:center;gap:1rem;flex-wrap:wrap;}
#portal-app .portal-next-action {padding:1rem 1.2rem;border:1px solid var(--tih-border);border-left:4px solid var(--tih-blue);border-radius:12px;background:var(--tih-soft);margin:1.25rem 0;}
#portal-app .portal-next-action strong {font-size:.95rem;}
#portal-app .portal-next-action p {font-size:.9rem;line-height:1.8;color:var(--tih-copy);margin:.5rem 0 0;}
#milestone-progress {display:block;width:100%;height:10px;margin:1rem 0 1.5rem;accent-color:#167148;border:0;border-radius:10px;overflow:hidden;}
#milestone-progress::-webkit-progress-bar {background:var(--tih-soft);border-radius:10px;}
#milestone-progress::-webkit-progress-value {background:#167148;border-radius:10px;}
#milestone-progress::-moz-progress-bar {background:#167148;border-radius:10px;}
@media(max-width:720px){.portal-draft-status{align-items:flex-start;flex-direction:column;gap:.25rem;}.portal-draft-status > div:last-child{gap:.75rem;}}

.portal-heading .portal-purpose {max-width:65ch;padding:0 0 1.25rem;margin:0;color:var(--tih-copy);font-size:.95rem;line-height:1.8;}
.portal-access-required {max-width:560px;margin:1rem auto;border-top:4px solid var(--tih-blue);}
#portal-app .portal-access-required h2 {font-size:1.6rem;line-height:1.4;}
#portal-app .portal-access-required p {font-size:.95rem;line-height:1.8;}
#portal-app .portal-staff-access-note {font-size:.85rem;line-height:1.8;padding:1rem;background:var(--tih-soft);border-radius:10px;color:var(--tih-copy);}
.staff-site-header {background:var(--tih-card);border-bottom:1px solid var(--tih-border);padding:.85rem 0;}
.staff-site-header .container {display:flex;align-items:center;justify-content:space-between;gap:1rem;}
.staff-brand {display:flex;align-items:center;gap:.7rem;color:var(--tih-ink);text-decoration:none;font-size:.9rem;font-weight:750;line-height:1.5;}
.staff-brand img {width:42px;height:42px;object-fit:contain;}
.staff-brand small {display:block;font-size:.75rem;font-weight:500;color:var(--tih-copy);}
.staff-site-header nav {display:flex;gap:1rem;align-items:center;font-size:.8rem;}
.staff-site-header nav a {color:var(--tih-copy);text-decoration:none;min-height:44px;display:inline-flex;align-items:center;}
body[data-portal=staff] .portal-heading {background:#0b2345;padding:1.75rem 0 .5rem;border-bottom:3px solid #348cff;}
body[data-portal=staff] .portal-heading h1 {color:#fff;}
body[data-portal=staff] .portal-heading .section-label {color:#92c5ff;}
body[data-portal=staff] .portal-heading .portal-purpose {color:#d1e2f9;}
body[data-portal=staff] .portal-workspace-header {padding-top:.6rem;}
body[data-portal=staff] #portal-avatar {background:#153c6c;border-radius:12px;}
body[data-portal=staff] #portal-app .portal-sidebar nav button[aria-current] {box-shadow:inset 3px 0 #348cff;}
body[data-portal=staff] .portal-role {display:inline-flex;background:var(--tih-soft);border:1px solid var(--tih-border);padding:.2rem .55rem;border-radius:6px;font-size:.7rem;}
body[data-portal=staff] .portal-team-actions {border-top:3px solid #348cff;background:var(--tih-card);}
#portal-app .portal-team-actions h3 {margin:.5rem 0;font-size:1.2rem;}
#portal-app .portal-team-actions > p:not(.portal-eyebrow) {font-size:.9rem;line-height:1.8;color:var(--tih-copy);}
.portal-team-buttons {display:flex;align-items:center;gap:.85rem;flex-wrap:wrap;}
body[data-portal=staff] #portal-app .portal-team-buttons .btn {font-size:.85rem;}
body[data-portal=staff] .portal-stat {border-top:3px solid #bad6f9!important;}
body[data-portal=staff] #portal-app .portal-stat[data-status=open] {border-top-color:#348cff!important;}
@media(max-width:720px){body[data-portal=staff] .portal-sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr));}body[data-portal=staff] #portal-app .portal-sidebar nav button[aria-current]{box-shadow:inset 0 -3px #348cff;}.staff-brand{font-size:.78rem;}.staff-brand img{width:34px;height:34px;}.staff-site-header nav{gap:.7rem;}.staff-site-header nav a[href="/"]{display:none;}.staff-site-header .dark-mode-toggle{width:38px;height:38px;min-width:38px;}.portal-team-buttons{align-items:stretch;flex-direction:column;}.portal-team-buttons .btn{width:100%;}}

/* Connection state replaces the form until authentication is ready. */
body.portal-booting .portal-heading,body.portal-load-failed .portal-heading {display:none;}
body.portal-booting #portal-login,body.portal-booting #portal-workspace,body.portal-booting #portal-access-required {display:none!important;}
body.portal-booting #portal-app,body.portal-load-failed #portal-app {max-width:560px;}
body.portal-booting main > .section,body.portal-load-failed main > .section {padding:clamp(2rem,8vh,5rem) 0 3rem;}
body.portal-booting #portal-connection,body.portal-load-failed #portal-connection {border:1px solid var(--tih-border);border-radius:24px;padding:clamp(1.5rem,5vw,2.5rem);background:var(--tih-card);box-shadow:0 18px 65px #0b2a6b0b;text-align:center;}
#portal-loading {padding:.5rem 0 .75rem;}
.portal-loading-mark {width:106px;height:106px;margin:0 auto 1.7rem;position:relative;display:grid;place-items:center;}
.portal-loading-mark::before {content:"";position:absolute;inset:0;border:2px solid var(--tih-border);border-radius:50%;}
.portal-loading-mark span {position:absolute;inset:0;border:3px solid transparent;border-top-color:var(--tih-blue);border-right-color:var(--tih-red);border-radius:50%;animation:portal-spin 1.5s linear infinite;}
.portal-loading-mark img {display:block;width:68px;height:68px;object-fit:contain;}
#portal-app .portal-loading-eyebrow {font-size:.65rem;line-height:1.7;letter-spacing:.15em;font-weight:800;color:var(--tih-copy);margin:0 0 .7rem;}
#portal-app #portal-loading-title {font-size:clamp(1.5rem,5vw,1.9rem);line-height:1.3;margin:0 0 .75rem;color:var(--tih-ink);}
#portal-app #portal-loading-copy {font-size:.95rem;line-height:1.8;color:var(--tih-copy);margin:0 0 1.75rem;}
#portal-loading-steps {list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem;padding:0;margin:0 0 .8rem;}
#portal-loading-steps li {display:flex;align-items:center;flex-direction:column;gap:.55rem;font-size:.72rem;line-height:1.6;color:var(--tih-copy);}
#portal-loading-steps li span {display:grid;place-items:center;width:29px;height:29px;border:1px solid var(--tih-border);border-radius:50%;font-size:.75rem;font-weight:750;background:var(--tih-soft);}
#portal-loading-steps li[data-state=current] {font-weight:750;color:var(--tih-blue);}
#portal-loading-steps li[data-state=current] span {background:var(--tih-blue);color:#fff;border-color:var(--tih-blue);}
#portal-loading-steps li[data-state=complete] span {background:#e8f5ed;color:#17663d;border-color:#b2d9c2;}
body.portal-booting #portal-status,body.portal-load-failed #portal-status {font-size:.83rem;line-height:1.8;border:0;background:var(--tih-soft);padding:.8rem;border-radius:10px;margin:.5rem 0 0;text-align:center;max-width:none;}
body.portal-booting #portal-status[data-state=pending]::before {display:none;}
body.portal-load-failed #portal-status[data-state=error] {color:#861d14;background:#fff0ee;}
body.portal-load-failed .portal-loading-mark span {animation:none;border-color:#d7e1ee;}
body.portal-load-failed .portal-recovery {justify-content:center;margin:1rem 0 0;}
body.portal-load-failed #portal-status[data-state=error] + .portal-recovery {display:flex;}
@media(prefers-reduced-motion:reduce){.portal-loading-mark span{animation:none;border-right-color:var(--tih-blue);}}
@media(max-width:480px){body.portal-booting #portal-connection,body.portal-load-failed #portal-connection{border-radius:18px;}.portal-loading-mark{margin-bottom:1.35rem;}#portal-loading-steps{gap:.4rem;}}
