/* Employee help portal — tokens, buttons and fields come from app.css. */

body.portal { background: var(--surface); min-height: 100%; }
.pt-top {
    position: sticky; top: 0; z-index: 10;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
    background: linear-gradient(90deg, var(--rail-from), var(--rail-to)); color: #fff;
}
.pt-brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.pt-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.pt-brand strong { font-size: 0.95rem; }
.pt-brand small { font-size: 0.7rem; opacity: 0.8; }
.pt-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, 0.16); }
.pt-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; }
.pt-user .ghost-btn { color: #fff; border-color: rgba(255, 255, 255, 0.4); background: transparent; }
.pt-user .ghost-btn:hover { background: rgba(255, 255, 255, 0.12); }

.pt-main { max-width: 68rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; }
.pt-loading { padding: 3rem 0; text-align: center; color: var(--muted); }
.pt-small { font-size: 0.75rem; }
.pt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pt-link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.pt-link:hover { text-decoration: underline; }
.pt-back { display: inline-block; margin-bottom: 0.8rem; color: var(--brand); font-size: 0.8rem; font-weight: 600; text-decoration: none; }
.pt-wide { width: 100%; justify-content: center; }

.pt-badge { display: inline-flex; align-items: center; white-space: nowrap; border-radius: var(--radius-pill); padding: 0.25rem 0.6rem; font-size: 0.7rem; font-weight: 600; background: var(--neutral-bg); color: var(--neutral-fg); }
.pt-badge.tone-brand { background: var(--brand-bg); color: var(--brand-fg); }
.pt-badge.tone-info { background: var(--info-bg); color: var(--info-fg); }
.pt-badge.tone-warn { background: var(--warn-bg); color: var(--warn-fg); }
.pt-badge.tone-ok { background: var(--ok-bg); color: var(--ok-fg); }

/* sign in */
.pt-auth { display: grid; place-items: center; min-height: calc(100vh - 10rem); }
.pt-auth-card { width: min(26rem, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: var(--shadow); }
.pt-auth-card h1 { margin: 0.2rem 0 0.4rem; font-size: 1.4rem; color: var(--navy); }
.pt-auth-card .muted { font-size: 0.82rem; margin: 0 0 1.1rem; }
.pt-auth-card .field { margin-bottom: 0.9rem; }
.pt-auth-card .field input { width: 100%; }
.pt-code { font-size: 1.5rem !important; letter-spacing: 0.5em; text-align: center; font-weight: 600; }
.pt-sent { font-size: 0.82rem; margin: 0 0 0.9rem; }
.pt-auth-links { display: flex; justify-content: space-between; margin-top: 0.8rem; }
.pt-foot { margin: 1.2rem 0 0 !important; font-size: 0.72rem !important; text-align: center; }

/* home */
.pt-hero {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem; margin-bottom: 1.2rem;
}
.pt-hero h1 { margin: 0 0 0.25rem; font-size: 1.35rem; color: var(--navy); }
.pt-hero p { margin: 0; }
.pt-cta { padding: 0.75rem 1.4rem; font-size: 0.92rem; text-decoration: none; }
.pt-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.pt-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem 1.3rem; }
.pt-card h1 { margin: 0 0 0.3rem; font-size: 1.3rem; color: var(--navy); line-height: 1.3; }
.pt-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.pt-card-head h2 { margin: 0; font-size: 0.95rem; }
.pt-empty { padding: 1.2rem 0; text-align: center; font-size: 0.85rem; }
.pt-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pt-tabs button { background: none; border: 0; padding: 0.35rem 0.8rem; font: inherit; font-size: 0.78rem; color: var(--muted); cursor: pointer; }
.pt-tabs button + button { border-left: 1px solid var(--line); }
.pt-tabs button.active { background: var(--brand-bg); color: var(--brand-fg); font-weight: 600; }
.pt-tickets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pt-tickets a {
    display: flex; justify-content: space-between; align-items: center; gap: 0.8rem;
    padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink);
}
.pt-tickets a:hover { border-color: var(--brand); background: var(--brand-tint); }
.pt-tickets a.attention { border-left: 3px solid var(--amber); }
.pt-t-main { display: flex; flex-direction: column; min-width: 0; }
.pt-t-main strong { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-t-main .muted { font-size: 0.72rem; }
.pt-devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pt-devices li { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); }
.pt-dev-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-bg); color: var(--brand); flex: none; }
.pt-dev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.84rem; gap: 0.1rem; }
.pt-dev-main .muted { font-size: 0.72rem; }
.pt-dev-main .pt-badge { align-self: flex-start; margin-top: 0.2rem; }
.pt-devices .ghost-btn { text-decoration: none; }

/* new request */
.pt-narrow { max-width: 46rem; margin: 0 auto; }
.pt-step { border: 0; padding: 0; margin: 1.3rem 0 0; }
.pt-step legend { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.7rem; color: var(--navy); }
.pt-step legend span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.75rem; }
.pt-step legend em { font-weight: 400; color: var(--muted); font-style: normal; font-size: 0.8rem; }
.pt-step .field { margin-top: 0.8rem; }
.pt-step .field input, .pt-step .field textarea { width: 100%; }
.pt-choices, .pt-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.5rem; }
.pt-choice, .pt-type, .pt-impact label { position: relative; cursor: pointer; }
.pt-choice input, .pt-type input, .pt-impact input { position: absolute; opacity: 0; pointer-events: none; }
.pt-choice > span, .pt-type > span, .pt-impact label > span {
    display: flex; gap: 0.6rem; align-items: center; height: 100%;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 0.65rem 0.75rem; background: var(--card); transition: border-color 0.12s, background 0.12s;
}
.pt-type > span, .pt-impact label > span { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.pt-choice > span > span { display: flex; flex-direction: column; }
.pt-choice small, .pt-type small, .pt-impact small { color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.pt-choice strong, .pt-type strong, .pt-impact strong { font-size: 0.84rem; }
.pt-choice:hover > span, .pt-type:hover > span, .pt-impact label:hover > span { border-color: var(--brand); }
.pt-choice input:checked + span, .pt-type input:checked + span, .pt-impact input:checked + span { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.pt-choice input:focus-visible + span, .pt-type input:focus-visible + span, .pt-impact input:focus-visible + span { box-shadow: var(--focus-ring); }
.pt-impact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.pt-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.pt-actions .ghost-btn { text-decoration: none; }

/* request detail */
.pt-ticket .eyebrow { margin: 0; }
.pt-meta { margin: 0 0 1.1rem; font-size: 0.8rem; }
.pt-stepper { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.pt-stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; font-size: 0.74rem; color: var(--muted); text-align: center; }
.pt-stepper li::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.pt-stepper li:first-child::before { display: none; }
.pt-stepper li.done::before, .pt-stepper li.current::before { background: var(--brand); }
.pt-step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); font-weight: 700; font-size: 0.75rem; }
.pt-stepper li.done .pt-step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.pt-stepper li.current { color: var(--ink); font-weight: 600; }
.pt-stepper li.current .pt-step-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-bg); }
.pt-stepper li.hold .pt-step-dot { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 4px var(--warn-bg); }
.pt-cancelled { padding: 0.7rem 0.9rem; background: var(--neutral-bg); border-radius: var(--radius); font-size: 0.82rem; margin-bottom: 1rem; }
.pt-callout { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.84rem; background: var(--neutral-bg); }
.pt-callout.tone-warn { background: var(--warn-bg); }
.pt-callout.tone-warn strong { color: var(--warn-fg); }
.pt-callout.tone-ok { background: var(--ok-bg); }
.pt-callout.tone-ok strong { color: var(--ok-fg); }
.pt-resolution { margin: 0.2rem 0; white-space: pre-wrap; color: var(--ink); }
.pt-resolve-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.pt-resolve .field textarea { width: 100%; }
.pt-expect { margin: 0 0 1rem; font-size: 0.82rem; color: var(--muted); }
.pt-h2 { margin: 1.5rem 0 0.7rem; font-size: 0.9rem; }
.pt-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.pt-msg { display: flex; }
.pt-msg.from-you { justify-content: flex-end; }
.pt-bubble { max-width: 85%; border-radius: 14px; padding: 0.6rem 0.85rem; background: var(--surface); border: 1px solid var(--line); }
.pt-msg.from-you .pt-bubble { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); border-bottom-right-radius: 4px; }
.pt-msg.from-it .pt-bubble { border-bottom-left-radius: 4px; }
.pt-msg-head { display: flex; gap: 0.6rem; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.2rem; }
.pt-msg-head strong { color: var(--ink); }
.pt-msg-text { font-size: 0.86rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-reply { margin-top: 1rem; }
.pt-reply textarea { width: 100%; border: 1px solid var(--input-line); border-radius: var(--radius); padding: 0.6rem 0.75rem; font: inherit; font-size: 0.86rem; background: var(--card); color: var(--ink); resize: vertical; }
.pt-reply textarea:focus { outline: 0; border-color: var(--brand); box-shadow: var(--focus-ring); }
.pt-reply .pt-actions { margin-top: 0.5rem; }
.pt-attach { cursor: pointer; }
.pt-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; }
.pt-files li { display: flex; gap: 0.6rem; align-items: center; }
.pt-history { margin-top: 1.4rem; font-size: 0.8rem; }
.pt-history summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.pt-history ul { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.pt-history li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line-soft); padding-bottom: 0.3rem; }

@media (max-width: 820px) {
    .pt-grid { grid-template-columns: minmax(0, 1fr); }
    .pt-impact { grid-template-columns: minmax(0, 1fr); }
    .pt-user-name { display: none; }
}
@media (max-width: 480px) {
    .pt-stepper li span:last-child { font-size: 0.64rem; }
    .pt-bubble { max-width: 100%; }
    .pt-hero { padding: 1.1rem; }
    .pt-cta { width: 100%; justify-content: center; }
}
