/* ══════════════════════════════════════════════════════════════════════
   LOMAinsights employee portal (/team/)
   Built on /home/tokens.css, /brand/ribbon.css and /brand/navigation.css.
   Thesis: one white card on the brand's deep-ink canvas; the ribbon
   gradient is reserved for the single primary action. Motion is limited
   to the shared 160ms hover transitions.
   ══════════════════════════════════════════════════════════════════════ */

.team-page {
    --team-error: #b42318;
    --team-ok: #0d6a4f;
    background: var(--hm-ink);
}

[hidden] { display: none !important; }

/* ── Auth canvas ─────────────────────────────────────────────────────── */
.team-auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: var(--hm-5) clamp(20px, 5vw, 56px) var(--hm-7);
}

.team-auth-brand {
    display: inline-flex; align-items: center; gap: var(--hm-3);
    justify-self: start; min-height: 44px;
    color: var(--hm-on-ink); text-decoration: none;
    font-weight: 600; letter-spacing: -0.02em;
}
.ribbon-public .team-auth .team-auth-brand { color: var(--hm-on-ink); }
.team-auth-brand img { width: 30px; height: 30px; flex: none; }

.team-auth-main {
    display: grid;
    place-items: center;
    padding-top: var(--hm-6);
}

.team-loading { color: var(--hm-on-ink-muted); font-size: var(--hm-small); }

/* ── Card ────────────────────────────────────────────────────────────── */
.team-card {
    width: min(440px, 100%);
    padding: clamp(28px, 4vw, 44px);
    background: var(--hm-paper);
    color: var(--hm-on-paper);
    border-radius: var(--hm-radius-lg);
    box-shadow: var(--hm-shadow-lift);
}

.rb-ink .team-card .rb-eyebrow { color: var(--hm-teal-deep); }
.rb-ink .team-card h1 { color: var(--hm-on-paper); font-size: var(--hm-h2); }
.rb-ink .team-card p { color: var(--hm-on-paper-muted); }
.rb-ink .team-card strong { color: var(--hm-on-paper); font-weight: 600; }
.ribbon-public .rb-ink .team-card :where(a, button, input):focus-visible { outline-color: var(--hm-teal-deep); }

.team-card .rb-eyebrow { margin-bottom: var(--hm-3); }
.team-card .team-lede { margin-top: var(--hm-3); }
.team-content .rb-eyebrow { margin-bottom: var(--hm-3); }

/* ── Form ────────────────────────────────────────────────────────────── */
.team-form {
    display: grid;
    gap: var(--hm-4);
    margin-top: var(--hm-6);
}

.team-field { display: grid; gap: var(--hm-2); }

.team-field label {
    font-size: var(--hm-small);
    font-weight: 600;
    color: var(--hm-on-paper);
}

.team-field input {
    width: 100%;
    min-height: 48px;
    padding: var(--hm-3) var(--hm-4);
    border: 1px solid var(--hm-line-paper);
    border-radius: var(--hm-radius-sm);
    background: #fff;
    color: var(--hm-on-paper);
    font: inherit;
    transition: border-color var(--hm-dur-hover) var(--hm-ease);
}
.team-field input::placeholder { color: var(--hm-on-paper-muted); opacity: 0.7; }
.team-field input:hover { border-color: var(--hm-slate); }
.team-field input:focus { border-color: var(--hm-teal-deep); }

.team-block { width: 100%; }
.team-form .team-block { margin-top: var(--hm-2); }

.rb-ink .team-card .rb-btn--quiet { color: var(--hm-on-paper); border-color: var(--hm-line-paper); }
.rb-ink .team-card .rb-btn--quiet:hover { color: var(--hm-teal-deep); border-color: var(--hm-teal-deep); }

.team-divider {
    display: flex; align-items: center; gap: var(--hm-3);
    margin: var(--hm-5) 0;
    color: var(--hm-on-paper-muted);
    font-size: var(--hm-micro);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.team-divider::before,
.team-divider::after { content: ""; flex: 1; border-top: 1px solid var(--hm-line-paper); }

.rb-ink .team-card .team-hint,
.team-hint { margin-top: var(--hm-3); font-size: var(--hm-small); line-height: 1.5; }
.rb-ink .team-card .team-field .team-hint { margin-top: 0; }

.team-text-btn {
    margin-top: var(--hm-4);
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hm-teal-deep);
    font: inherit;
    font-size: var(--hm-small);
    font-weight: 600;
    cursor: pointer;
}
.team-text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.team-message:empty { display: none; }
.team-card .team-message { margin-top: var(--hm-4); font-size: var(--hm-small); line-height: 1.45; }
.rb-ink .team-card .team-message.error { color: var(--team-error); }
.rb-ink .team-card .team-message.success { color: var(--team-ok); }

/* ── Workspace ───────────────────────────────────────────────────────── */
.team-workspace { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.team-account {
    margin-left: auto;
    display: flex; align-items: center; gap: var(--hm-4);
    font-size: var(--hm-small);
}
.team-account-email { color: var(--hm-on-ink-muted); overflow-wrap: anywhere; }
.team-account .team-text-btn { margin: 0; color: var(--hm-on-ink); }
.team-account .rb-btn--quiet { color: var(--hm-on-ink); }
.team-account .rb-btn--quiet:hover { color: var(--hm-teal); border-color: var(--hm-teal); }
.ribbon-public .team-account :where(button):focus-visible { outline-color: var(--hm-lavender); }

.team-content { flex: 1; padding-block: clamp(40px, 6vw, 80px); }
.team-title { font-size: var(--hm-h2); }

.team-empty {
    margin-top: var(--hm-6);
    padding: clamp(28px, 4vw, 48px);
    border: 1px dashed var(--hm-line-paper);
    border-radius: var(--hm-radius-lg);
    background: #fff;
}
.team-empty h2 { font-size: var(--hm-h3); }
.team-empty p { margin-top: var(--hm-2); color: var(--hm-on-paper-muted); }

/* ── Portal app (clients, meetings, recorder) ────────────────────────── */
.team-content:focus:not(:focus-visible) { outline: none; }
.team-page .team-content p { margin: 0; }

.pt-nav {
    display: flex; gap: var(--hm-2);
    margin-bottom: var(--hm-6);
    border-bottom: 1px solid var(--hm-line-paper);
}
.ribbon-public .pt-nav a {
    display: inline-flex; align-items: center; min-height: 44px;
    padding: 0 var(--hm-3); margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--hm-on-paper-muted); text-decoration: none;
    font-size: var(--hm-small); font-weight: 600;
    transition: color var(--hm-dur-hover) var(--hm-ease), border-color var(--hm-dur-hover) var(--hm-ease);
}
.ribbon-public .pt-nav a:hover { color: var(--hm-on-paper); }
.ribbon-public .pt-nav a[aria-current="page"] { color: var(--hm-on-paper); border-bottom-color: var(--hm-teal-deep); }

.ribbon-public .pt-app a.rb-btn--primary { color: #fff; }

.pt-app[aria-busy="true"] { opacity: 0.6; transition: opacity var(--hm-dur-ui) var(--hm-ease); }

.pt-head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: var(--hm-4); margin-bottom: var(--hm-6);
}
.pt-head .team-title { margin-top: 0; }
.pt-head .rb-eyebrow { margin-bottom: var(--hm-2); }

.pt-crumbs { display: flex; flex-wrap: wrap; gap: var(--hm-2); margin-bottom: var(--hm-4); font-size: var(--hm-small); color: var(--hm-on-paper-muted); }
.ribbon-public .pt-crumbs a { color: var(--hm-teal-deep); text-decoration: none; }
.ribbon-public .pt-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }

.ribbon-public .pt-drive {
    display: inline-flex; align-items: center; min-height: 32px;
    color: var(--hm-teal-deep); font-size: var(--hm-small); font-weight: 600; text-decoration: none;
}
.ribbon-public .pt-drive:hover { text-decoration: underline; text-underline-offset: 3px; }
.pt-head .pt-drive { margin-top: var(--hm-2); }

.pt-section { margin-top: var(--hm-7); }
.pt-section h2, .pt-subhead { font-size: var(--hm-h3); margin-bottom: var(--hm-4); }
.pt-subhead { margin-top: var(--hm-6); }
.team-page .team-content .pt-muted, .pt-muted { color: var(--hm-on-paper-muted); font-size: var(--hm-small); line-height: 1.5; }

.pt-notice {
    margin: var(--hm-3) 0;
    padding: var(--hm-3) var(--hm-4);
    border-radius: var(--hm-radius-sm);
    background: var(--hm-paper-2);
    font-size: var(--hm-small); line-height: 1.45;
}
.team-page .team-content .pt-notice { margin: var(--hm-3) 0; }
.pt-notice.error { background: #fdecea; color: var(--team-error); }
.pt-notice.warning { background: #fff6e0; color: #7a4b00; }

.pt-inline-form { display: flex; gap: var(--hm-2); max-width: 520px; margin-bottom: var(--hm-5); }
.pt-inline-form input,
.pt-panel select,
.pt-voice input {
    flex: 1; min-height: 44px; padding: var(--hm-2) var(--hm-3);
    border: 1px solid var(--hm-line-paper); border-radius: var(--hm-radius-sm);
    background: #fff; color: var(--hm-on-paper); font: inherit;
}
.pt-inline-form input:focus, .pt-panel select:focus, .pt-voice input:focus { border-color: var(--hm-teal-deep); }

.pt-cards {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: var(--hm-3);
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.ribbon-public .pt-card {
    display: grid; gap: var(--hm-1); min-height: 88px; align-content: center;
    padding: var(--hm-4) var(--hm-5);
    border: 1px solid var(--hm-line-paper); border-radius: var(--hm-radius);
    background: #fff; color: var(--hm-on-paper); text-decoration: none;
    transition: border-color var(--hm-dur-hover) var(--hm-ease), transform var(--hm-dur-hover) var(--hm-ease);
}
.ribbon-public .pt-card:hover { border-color: var(--hm-teal-deep); transform: translateY(-1px); }
.pt-card-title { font-weight: 600; }
.pt-row-meta { color: var(--hm-on-paper-muted); font-size: var(--hm-small); }

.pt-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hm-line-paper); }
.pt-row { display: flex; align-items: center; gap: var(--hm-4); border-bottom: 1px solid var(--hm-line-paper); }
.ribbon-public .pt-row-main { flex: 1; display: grid; gap: var(--hm-1); padding: var(--hm-4) 0; color: var(--hm-on-paper); text-decoration: none; }
.ribbon-public .pt-row-main:hover .pt-row-title { color: var(--hm-teal-deep); }
.pt-row-title { font-weight: 600; transition: color var(--hm-dur-hover) var(--hm-ease); }
.pt-badge {
    display: inline-block; margin-left: var(--hm-2); padding: 2px var(--hm-2);
    border-radius: var(--hm-radius-pill); background: var(--hm-paper-2);
    color: var(--hm-on-paper-muted); font-size: var(--hm-micro); font-weight: 600; vertical-align: middle;
}

.pt-panel {
    display: grid; gap: var(--hm-5);
    padding: clamp(20px, 3vw, 36px);
    border: 1px solid var(--hm-line-paper); border-radius: var(--hm-radius-lg);
    background: #fff;
}
.pt-record-form { max-width: 640px; }
.pt-panel > .rb-btn { justify-self: start; }
.pt-panel select { width: 100%; }

.pt-speakers { margin: 0; padding: 0; border: 0; display: grid; gap: var(--hm-3); }
.pt-speakers legend { margin-bottom: var(--hm-2); font-size: var(--hm-small); font-weight: 600; }
.pt-help { margin: var(--hm-2) 0 0; }
.pt-check { display: flex; align-items: center; gap: var(--hm-2); font-weight: 600; cursor: pointer; }
.team-field .pt-check input { width: 1.25rem; height: 1.25rem; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--hm-teal-deep); }
.pt-audio-state { color: #7a4b00; font-size: var(--hm-small); font-weight: 600; }
.pt-audio-state:empty { display: none; }

.pt-live { gap: var(--hm-4); }
.pt-live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hm-4) var(--hm-5); }
.pt-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--team-error); animation: pt-pulse 1.6s ease-in-out infinite; }
@keyframes pt-pulse { 50% { opacity: 0.35; } }
.pt-timer { font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--hm-h3); }
.pt-meter { display: inline-flex; align-items: center; gap: var(--hm-2); font-size: var(--hm-small); color: var(--hm-on-paper-muted); }
.pt-meter-bar { width: 96px; height: 6px; border-radius: var(--hm-radius-pill); background: var(--hm-paper-2); overflow: hidden; }
.pt-meter-bar > span { display: block; height: 100%; background: var(--hm-teal); transform: scaleX(0.02); transform-origin: left; transition: transform var(--hm-dur-hover) var(--hm-ease); }

.pt-transcript { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--hm-3); }
.pt-live .pt-transcript { max-height: 60vh; overflow-y: auto; padding-right: var(--hm-2); }
.pt-seg { display: grid; grid-template-columns: 64px 1fr; gap: var(--hm-3); line-height: 1.55; }
.pt-seg-time { color: var(--hm-on-paper-muted); font-size: var(--hm-small); font-variant-numeric: tabular-nums; padding-top: 2px; }
.pt-spk { display: inline-block; margin-right: var(--hm-2); font-weight: 600; color: var(--pt-spk, var(--hm-on-paper)); }
.pt-spk-me { --pt-spk: var(--hm-indigo); }
.pt-spk-0 { --pt-spk: #2f6f8f; }
.pt-spk-1 { --pt-spk: #8a3f7a; }
.pt-spk-2 { --pt-spk: #2f7a55; }
.pt-spk-3 { --pt-spk: #9a5a12; }
.pt-spk-4 { --pt-spk: #5b4fa8; }
.pt-spk-5 { --pt-spk: #a33a3a; }
.pt-panel .pt-seg-speaker {
    width: auto; max-width: 220px; vertical-align: baseline;
    margin-right: var(--hm-2); padding: 2px var(--hm-2); min-height: 32px;
    border: 1px solid var(--hm-line-paper); border-radius: var(--hm-radius-sm);
    background: #fff; font: inherit; font-size: var(--hm-small); font-weight: 600;
}
.pt-voices { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--hm-2); }
.pt-voice {
    display: grid; grid-template-columns: 96px minmax(0, 280px) minmax(0, 1fr);
    align-items: center; gap: var(--hm-1) var(--hm-3);
}
.pt-voice .pt-spk { margin: 0; font-size: var(--hm-small); }
.pt-voice input, .pt-voice select { min-height: 40px; width: 100%; }
.pt-voice-meta {
    margin: 0; min-width: 0; color: var(--hm-on-paper-muted); font-size: var(--hm-small);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-short { border-top: 1px solid var(--hm-line-paper); padding-top: var(--hm-3); }
.pt-short summary { min-height: 32px; cursor: pointer; color: var(--hm-teal-deep); font-size: var(--hm-small); font-weight: 600; }
.pt-short[open] summary { margin-bottom: var(--hm-3); }
@media (max-width: 720px) {
    .pt-voice { grid-template-columns: 88px minmax(0, 1fr); }
    .pt-voice-meta { grid-column: 2; white-space: normal; }
}
.pt-backups { margin-top: var(--hm-3); font-size: var(--hm-small); }
.ribbon-public .pt-backups a { color: var(--hm-teal-deep); }

.pt-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 600px) {
    .pt-inline-form { flex-direction: column; }
    .pt-seg { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 600px) {
    .team-account { gap: var(--hm-3); flex-wrap: wrap; justify-content: flex-end; }
    .team-account-email { flex-basis: 100%; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
    .team-page .rb-btn:hover,
    .ribbon-public .pt-card:hover { transform: none; }
    .pt-rec-dot { animation: none; }
    .pt-meter-bar > span { transition: none; }
}
