/* Pixel-closeness overrides derived from the production portal's Tailwind layout. */
.portal-shell{position:relative;min-height:760px;height:min(860px,84vh);border-radius:0;background:#faf9f6;box-shadow:none}
.portal-sidebar{width:15rem;flex-basis:15rem;transition:width .18s ease,flex-basis .18s ease}
.portal-brand{padding:20px;gap:10px}
.portal-brand-logo{width:32px;height:32px;border-radius:8px;font-size:12px}
.portal-brand>span{font-size:15px;font-weight:700}
.portal-nav{padding:8px 12px;gap:4px}
.portal-nav-item{justify-content:flex-start;gap:12px;padding:10px 12px;border-radius:12px;font-size:14px;font-weight:500;min-height:40px}
.portal-nav-svg{width:18px;height:18px;flex:0 0 18px}
.portal-user{padding:16px 12px;border-top:1px solid rgba(255,255,255,.1)}
.portal-user-avatar{width:36px;height:36px}
.portal-user strong{font-size:14px;font-weight:500}.portal-user small{font-size:12px}
.portal-main{position:relative}

/* Inbox — mirror production list width, filters and thread proportions. */
.portal-inbox-shell{position:relative;display:grid;grid-template-columns:24.5rem minmax(0,1fr);height:100%;min-height:0;overflow:hidden}
.portal-conversation-list{width:auto;border-right:1px solid #e6e5de;background:#fff}
.portal-list-production-header{flex:0 0 auto;border-bottom:1px solid #e6e5de;padding:20px 20px 16px;background:#fff}
.portal-list-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.portal-list-title-row h2{margin:0;font-size:20px;line-height:1.2;letter-spacing:-.02em;font-weight:700}
.portal-list-title-row p{margin:4px 0 0;font-size:12px;color:#5b675f}
.sample-badge{min-height:22px;padding:4px 8px;font-size:9px}
.portal-search-box{position:relative;display:block;margin-top:16px}
.portal-search-box svg{position:absolute;left:12px;top:50%;width:16px;height:16px;transform:translateY(-50%);color:#5b675f;pointer-events:none}
.portal-search-box input{width:100%;border:1px solid #e6e5de;border-radius:12px;background:#faf9f6;padding:10px 36px 10px 36px;font:inherit;font-size:12px;outline:none;transition:.15s ease}
.portal-search-box input:focus{border-color:#2f6f62;background:#fff;box-shadow:0 0 0 3px #e4efec}
.portal-status-filters{display:flex;gap:6px;margin:12px -4px 0;padding:0 4px 4px;overflow-x:auto;scrollbar-width:none}.portal-status-filters::-webkit-scrollbar{display:none}
.portal-status-filters button{display:flex;align-items:center;gap:6px;flex:0 0 auto;border:1px solid #e6e5de;border-radius:999px;background:#fff;color:#5b675f;padding:6px 12px;font-size:11px;font-weight:600;white-space:nowrap;cursor:pointer}
.portal-status-filters button span{border-radius:999px;background:#faf9f6;padding:2px 6px;font-size:9px;line-height:1}
.portal-status-filters button.active{border-color:#2f6f62;background:#2f6f62;color:#fff}.portal-status-filters button.active span{background:rgba(255,255,255,.2);color:#fff}
.portal-select-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.portal-select-grid select{width:100%;appearance:none;border:1px solid #e6e5de;border-radius:8px;background:#fff;padding:8px 28px 8px 10px;font-size:11px;font-weight:500;color:#1a211f;outline:none}
.sr-only-demo{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.portal-conversation-scroll{padding:8px;overflow-y:auto}
.sample-list-label{margin:4px -8px 4px;padding:9px 12px 7px;border-top:1px solid #e6e5de;border-bottom:0;background:#faf9f6;font-size:9px;letter-spacing:.08em}
.portal-conversation-card{position:relative;margin-bottom:4px;border:0;border-radius:12px;padding:12px;background:transparent;gap:12px;transition:background .15s ease,box-shadow .15s ease}
.portal-conversation-card:hover{background:#faf9f6}.portal-conversation-card.active{background:#e4efec;box-shadow:inset 0 0 0 1px rgba(47,111,98,.12)}
.portal-conversation-card.active:before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:4px;border-radius:0 999px 999px 0;background:#2f6f62}
.portal-conversation-card .conversation-avatar{width:44px;height:44px;flex:0 0 44px;font-size:11px}
.portal-conversation-copy strong{font-size:14px;font-weight:500}.portal-conversation-card.active .portal-conversation-copy strong{font-weight:600}
.portal-conversation-copy time{font-size:10px;color:#5b675f}.portal-conversation-copy p{margin:2px 0 8px;font-size:12px;line-height:20px;color:#5b675f}
.portal-tags{gap:6px}.portal-tags span{padding:4px 7px;font-size:9px;font-weight:600}.portal-tags .live-mini{background:#2f6f62;color:#fff}
.portal-thread-column{min-width:0;min-height:0;background:#faf9f6}
.production-thread-header{min-height:69px;padding:12px 20px;border-bottom:1px solid #e6e5de;background:#fff;box-shadow:0 1px 8px rgba(24,39,33,.04)}
.production-thread-avatar{width:44px!important;height:44px!important;flex:0 0 44px!important;font-size:12px!important}
.production-thread-header .patient-identity{gap:12px}.production-thread-header .patient-identity strong{font-size:16px;font-weight:700}.production-thread-header .patient-identity span{margin-top:4px;font-size:10px;color:#5b675f}
.production-thread-header .staff-actions{gap:8px}.production-thread-header .mode-pill{min-height:30px;padding:6px 10px;font-size:10px;border-radius:999px}
.portal-details-button{height:36px;border:1px solid #e6e5de;border-radius:10px;background:#fff;padding:0 11px;color:#5b675f;font-size:11px;font-weight:600;cursor:pointer}.portal-details-button:hover{background:#faf9f6;color:#1a211f}
.production-thread-header #takeoverButton{height:36px;padding:0 13px;border-radius:10px;font-size:11px}
.portal-staff-messages{padding:20px 24px!important;background-color:#f5f7f5!important;background-image:radial-gradient(circle at 1px 1px,rgba(47,111,98,.055) 1px,transparent 0)!important;background-size:22px 22px!important}
.portal-staff-messages .staff-message-bubble{max-width:min(78%,640px);font-size:13px;line-height:1.5;border-radius:14px}
.production-staff-composer{padding:12px 16px;border-top:1px solid #e6e5de;background:#fff}.production-staff-composer .staff-compose-row{gap:8px}.production-staff-composer input{min-height:42px;border-radius:12px;font-size:13px}.production-staff-composer button{min-height:42px;border-radius:12px}

/* Lead details behaves like a production side drawer rather than a permanent third column. */
.portal-details-scrim{position:absolute;inset:0;z-index:40;background:rgba(22,33,29,.18);backdrop-filter:blur(1px)}
.portal-details-drawer{position:absolute!important;right:0;top:0;bottom:0;z-index:50;width:min(23rem,88%);max-width:368px;overflow-y:auto;border-left:1px solid #e6e5de;background:#fff;box-shadow:-18px 0 45px rgba(24,39,33,.12);transform:translateX(104%);transition:transform .2s ease;pointer-events:none}
.portal-shell.details-open .portal-details-drawer:not(.hidden){transform:translateX(0);pointer-events:auto}.portal-shell.details-open .portal-details-scrim:not(.hidden){display:block!important}
.portal-details-heading{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid #e6e5de;background:rgba(255,255,255,.96);backdrop-filter:blur(8px)}
.portal-details-heading span,.portal-details-heading strong{display:block}.portal-details-heading span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#5b675f}.portal-details-heading strong{margin-top:3px;font-size:15px}.portal-details-heading button{width:34px;height:34px;border:0;border-radius:10px;background:#faf9f6;color:#5b675f;font-size:22px;cursor:pointer}
.portal-lead-panel,.portal-sample-insights{border-left:1px solid #e6e5de}.lead-panel-section,.sample-insight-section{padding:18px}.lead-panel-section .section-label,.sample-insight-section .section-label{font-size:10px;letter-spacing:.08em}.lead-summary,.sample-insight-section p{font-size:12px!important;line-height:1.6!important}.lead-facts div,.sample-facts div{font-size:11px!important;padding:9px 0!important}
.sample-thread-header{min-height:69px;padding:12px 20px}.sample-avatar{width:44px;height:44px}.sample-thread-person strong{font-size:15px}.sample-thread-person small{font-size:10px}.sample-messages{padding:20px 24px}.sample-bubble{max-width:min(78%,640px);padding:10px 12px;font-size:13px;line-height:1.5}.sample-bubble small{font-size:9px}.sample-thread-footer{font-size:10px}

/* Pipeline — match production measurements. */
.production-page-header{padding:16px 28px}.production-title-row h1{font-size:20px;letter-spacing:-.02em}.production-header-row p{font-size:14px;line-height:1.55}.production-pill{padding:4px 10px;font-size:10px}.production-primary-btn,.production-secondary-btn{height:44px;min-height:44px;border-radius:12px;padding:0 14px;font-size:14px}
.pipeline-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px}.production-metric{border-radius:16px;padding:14px 16px}.production-metric span{font-size:12px}.production-metric strong{font-size:24px}.production-metric small{font-size:10px}
.production-branch-strip{gap:12px;padding:12px 28px 13px}.branch-card{min-width:176px;border-radius:16px;padding:12px}.branch-card strong{font-size:12px}.branch-card b{font-size:10px}.branch-card small{font-size:10px}
.production-filterbar{padding:12px 28px;gap:10px}.production-search{height:44px;min-width:320px;border-radius:12px;padding:0 12px}.production-search input{font-size:14px}.production-filterchips button{height:40px;border-radius:12px;padding:0 12px;font-size:12px}
.production-kanban{gap:16px;padding:20px 28px 24px}.kanban-stage{flex-basis:19rem;min-width:19rem;border-radius:16px}.kanban-stage-header{padding:14px 14px 10px}.kanban-stage h2{font-size:14px}.kanban-stage-count{font-size:10px}.kanban-stage-header p{font-size:10px}.kanban-cards{padding:0 10px 12px;gap:10px}.kanban-card{border-radius:16px;padding:14px}.mini-avatar{width:38px;height:38px;font-size:10px}.kanban-card-copy strong{font-size:14px}.kanban-card-copy b{font-size:11px}.kanban-card-copy p{font-size:11px}.kanban-badges{margin-top:12px!important;gap:6px!important}.kanban-badges span{font-size:9px!important;padding:4px 7px!important}.kanban-card-meta{margin-top:12px!important;font-size:10px!important}

/* Analytics — reproduce production spacing and hierarchy. */
.analytics-header{padding:16px 28px 18px}.analytics-filters{gap:10px;margin-top:16px}.analytics-filters label{min-width:144px}.analytics-filters label>span{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.analytics-filters select,.analytics-filters>button:not(.production-primary-btn){height:44px;border-radius:12px;font-size:13px}.production-icon-btn{width:44px;height:44px;border-radius:12px}
.analytics-content{padding:20px 28px 24px!important;gap:20px!important}.analytics-metric-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:12px!important}.analytics-metric-card{border-radius:16px!important;padding:16px!important}.analytics-metric-card>span{font-size:12px!important}.analytics-metric-card strong{font-size:24px!important}.analytics-metric-card p{font-size:10px!important}.analytics-metric-card small{font-size:10px!important;line-height:1.45!important}.analytics-rate-strip{border-radius:16px!important;padding:10px 16px!important}.analytics-rate-strip>div{padding:12px 16px!important;border-radius:12px!important}.analytics-rate-strip span{font-size:10px!important}.analytics-rate-strip strong{font-size:20px!important}.analytics-rate-strip small{font-size:10px!important}.analytics-two-col{gap:20px!important}.production-panel{border-radius:24px!important;padding:20px!important}.panel-heading{margin-bottom:16px!important}.panel-heading h2{font-size:16px!important}.panel-heading p{font-size:12px!important;line-height:1.55!important}.trend-tabs button,.performance-tabs button{height:36px!important;border-radius:8px!important;font-size:10px!important}.quality-row,.response-stats>div,.small-stat-grid>div{font-size:12px!important}.performance-table>div{min-height:44px!important;font-size:11px!important}

/* Tools — match the production 18rem tool rail and 6/10 spacing. */
.tools-layout{display:flex;height:100%;min-height:0}.tools-inner-sidebar{width:18rem;flex:0 0 18rem;padding:20px;border-right:1px solid #e6e5de;border-bottom:0}.tools-inner-sidebar h2{font-size:20px}.tools-inner-sidebar>div>p{font-size:12px;line-height:20px}.tools-inner-sidebar nav{margin-top:20px;gap:8px}.tools-tool-card{min-height:72px;border-radius:16px;padding:14px;gap:12px}.tool-icon{width:40px;height:40px;border-radius:12px}.tools-tool-card strong{font-size:14px}.tools-tool-card small{font-size:11px;line-height:16px}.tools-soon-label{padding-top:16px;font-size:10px;letter-spacing:.14em}
.tools-content{min-width:0}.tool-page{padding:32px 40px 40px;overflow-y:auto}.tool-header{gap:20px}.tool-header>div:first-child>p{font-size:11px;letter-spacing:.16em}.tool-header h1{font-size:30px;line-height:1.2}.tool-header small{font-size:14px;line-height:24px}.automation-toggle-card{min-width:208px;border-radius:16px;padding:12px 16px}.tool-overview{margin-top:28px;border-radius:16px}.tool-overview>div{padding:16px}.tool-overview small{font-size:11px}.tool-overview strong{font-size:13px}.tool-grid{margin-top:20px;gap:20px;grid-template-columns:minmax(0,1.35fr) minmax(19rem,.65fr)}.tool-stack{gap:20px}.tool-card{border-radius:16px;padding:24px}.tool-card.compact{padding:20px}.tool-section-title b{width:28px;height:28px;border-radius:8px}.tool-section-title strong{font-size:14px}.tool-section-title small{font-size:11px;line-height:18px}.tool-form-grid{margin-top:24px;gap:24px}.input-suffix{border-radius:12px}.input-suffix input{padding:10px 14px;font-size:14px}.preset-row button{font-size:11px;border-radius:8px}.textarea-label textarea,.language-preview textarea{border-radius:12px;padding:12px 14px;font-size:14px;line-height:24px}.tool-footer{padding:12px 40px}

@media(max-width:1279px){.portal-inbox-shell{grid-template-columns:23rem minmax(0,1fr)}.analytics-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}.analytics-metric-card:nth-child(4),.analytics-metric-card:nth-child(5){grid-column:auto}.tool-grid{grid-template-columns:1fr}}
@media(max-width:1023px){.portal-sidebar{width:4.25rem;flex-basis:4.25rem}.portal-brand{justify-content:center;padding:20px 12px}.portal-brand>span,.portal-nav-item>span:not(.portal-nav-svg),.portal-user>div:last-child{display:none}.portal-nav{padding:8px}.portal-nav-item{justify-content:center;padding:10px 8px}.portal-user{justify-content:center;padding:16px 8px}.portal-inbox-shell{grid-template-columns:21.5rem minmax(0,1fr)}.production-page-header{padding-left:20px;padding-right:20px}.production-branch-strip,.production-filterbar,.production-kanban,.analytics-content{padding-left:20px!important;padding-right:20px!important}.tools-layout{flex-direction:column}.tools-inner-sidebar{width:100%;flex:0 0 auto;border-right:0;border-bottom:1px solid #e6e5de;padding:16px}.tools-inner-sidebar nav{display:flex;overflow-x:auto;margin-top:14px}.tools-tool-card{min-width:216px}.tools-soon-label{display:none}.tool-page{padding:24px}.tool-footer{padding:12px 24px}}
@media(max-width:767px){.portal-shell{height:min(820px,86vh);min-height:680px}.portal-inbox-shell{display:block}.portal-conversation-list{width:100%;height:100%}.portal-thread-column{position:absolute;inset:0;background:#faf9f6;transform:translateX(100%);transition:transform .18s ease;z-index:10}.portal-shell.thread-open .portal-thread-column{transform:translateX(0)}.portal-list-production-header{padding:16px}.production-thread-header{padding:10px 12px}.production-thread-header .mode-pill,.portal-details-button{display:none}.portal-staff-messages,.sample-messages{padding:14px!important}.production-page-header{padding:14px}.production-title-row h1{font-size:18px}.production-header-row p{font-size:12px}.production-actions{display:none}.pipeline-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.pipeline-metrics .production-metric:last-child{grid-column:1/-1}.production-branch-strip,.production-filterbar,.production-kanban,.analytics-content{padding-left:14px!important;padding-right:14px!important}.production-search{min-width:100%;flex:1}.production-filterbar{align-items:stretch}.production-filterchips{width:100%}.analytics-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.analytics-metric-card:nth-child(5){grid-column:1/-1}.analytics-two-col{grid-template-columns:1fr!important}.analytics-filters{display:grid!important;grid-template-columns:1fr 1fr}.analytics-filters label{min-width:0}.tool-page{padding:20px 16px}.tool-header{flex-direction:column}.tool-header h1{font-size:24px}.automation-toggle-card{width:100%}.tool-overview{grid-template-columns:1fr!important}.tool-overview>div{border-left:0!important;border-top:1px solid #e6e5de}.tool-overview>div:first-child{border-top:0!important}.tool-grid{grid-template-columns:1fr}.tool-card{padding:18px}.tool-footer{padding:12px 16px}.portal-details-drawer{width:min(22rem,94%)}}
