/* The customer portal (Views/Portal/*, PortalController): its own page - not the site's layout. A compact dashboard
   once signed in (a side menu, a top bar); light and dark - following the device until the visitor picks one with the
   switch (html[data-theme], js/sd-portal-theme.js); down to phone width. No external fonts or scripts. */
:root {
    --pt-bg: #f4f6fa;
    --pt-card: #ffffff;
    --pt-side: #ffffff;
    --pt-ink: #0f172a;
    --pt-text: #334155;
    --pt-muted: #64748b;
    --pt-line: #e2e8f0;
    --pt-soft: #f1f5f9;
    --pt-accent: #0e9384;
    --pt-accent-ink: #0b6e63;
    --pt-accent-soft: #e3f5f2;
    --pt-link: #1d5fd6;
    --pt-ok: #067647;
    --pt-ok-soft: #e7f8ee;
    --pt-warn: #b54708;
    --pt-warn-soft: #fff5e0;
    --pt-bad: #b42318;
    --pt-bad-soft: #fdeceb;
    --pt-blue: #175cd3;
    --pt-blue-soft: #ebf2ff;
    --pt-violet: #6941c6;
    --pt-focus: rgba(14, 147, 132, 0.35);
    --pt-hero-a: #0b7a6e;
    --pt-hero-b: #1d4ed8;
    --pt-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.03);
    --pt-radius: 12px;
    color-scheme: light;
}
/* Dark: the device's setting, unless the visitor chose light ... */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --pt-bg: #0e1016;
        --pt-card: #171a23;
        --pt-side: #12141c;
        --pt-ink: #f1f4f9;
        --pt-text: #cbd2dd;
        --pt-muted: #8e99ab;
        --pt-line: #262b38;
        --pt-soft: #1f2330;
        --pt-accent: #24ad9a;
        --pt-accent-ink: #63d8c6;
        --pt-accent-soft: rgba(36, 173, 154, 0.15);
        --pt-link: #8fb4ff;
        --pt-ok: #4ed493;
        --pt-ok-soft: rgba(78, 212, 147, 0.13);
        --pt-warn: #fdb022;
        --pt-warn-soft: rgba(253, 176, 34, 0.13);
        --pt-bad: #f97066;
        --pt-bad-soft: rgba(249, 112, 102, 0.14);
        --pt-blue: #84adff;
        --pt-blue-soft: rgba(132, 173, 255, 0.13);
        --pt-violet: #b69cf7;
        --pt-focus: rgba(36, 173, 154, 0.45);
        --pt-hero-a: #0b4f48;
        --pt-hero-b: #1e2f73;
        --pt-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
        color-scheme: dark;
    }
}
/* ... or they chose dark */
:root[data-theme="dark"] {
    --pt-bg: #0e1016;
    --pt-card: #171a23;
    --pt-side: #12141c;
    --pt-ink: #f1f4f9;
    --pt-text: #cbd2dd;
    --pt-muted: #8e99ab;
    --pt-line: #262b38;
    --pt-soft: #1f2330;
    --pt-accent: #24ad9a;
    --pt-accent-ink: #63d8c6;
    --pt-accent-soft: rgba(36, 173, 154, 0.15);
    --pt-link: #8fb4ff;
    --pt-ok: #4ed493;
    --pt-ok-soft: rgba(78, 212, 147, 0.13);
    --pt-warn: #fdb022;
    --pt-warn-soft: rgba(253, 176, 34, 0.13);
    --pt-bad: #f97066;
    --pt-bad-soft: rgba(249, 112, 102, 0.14);
    --pt-blue: #84adff;
    --pt-blue-soft: rgba(132, 173, 255, 0.13);
    --pt-violet: #b69cf7;
    --pt-focus: rgba(36, 173, 154, 0.45);
    --pt-hero-a: #0b4f48;
    --pt-hero-b: #1e2f73;
    --pt-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pt {
    margin: 0;
    min-height: 100vh;
    background: var(--pt-bg);
    color: var(--pt-text);
    font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--pt-link); text-underline-offset: 2px; }
h1, h2 { color: var(--pt-ink); line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 10px; }
small { color: var(--pt-muted); }
:focus-visible { outline: 3px solid var(--pt-focus); outline-offset: 2px; border-radius: 6px; }
.pt-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pt-skip { position: absolute; left: -999px; top: 8px; background: var(--pt-card); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.pt-skip:focus { left: 12px; }
.pt-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The company's logo (the dark mode one in dark mode); its name only when there's no logo for the mode */
.pt-brand { display: inline-flex; align-items: center; min-height: 36px; color: var(--pt-ink); text-decoration: none; font-weight: 700; font-size: 16px; }
.pt-brand img { display: block; max-height: 36px; max-width: 180px; object-fit: contain; }
.pt-brand .pt-logo-dark { display: none; }
.pt-brand.has-light .pt-brand-name, .pt-brand.has-both .pt-brand-name { display: none; }
.pt-brand.has-dark .pt-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .pt-brand.has-both .pt-logo-light { display: none; }
    :root:not([data-theme="light"]) .pt-brand.has-both .pt-logo-dark,
    :root:not([data-theme="light"]) .pt-brand.has-dark .pt-logo-dark { display: block; }
    :root:not([data-theme="light"]) .pt-brand.has-dark .pt-brand-name { display: none; }
    :root:not([data-theme="light"]) .pt-brand.has-light img { background: #fff; padding: 4px 8px; border-radius: 8px; box-sizing: content-box; max-height: 30px; }
}
:root[data-theme="dark"] .pt-brand.has-both .pt-logo-light { display: none; }
:root[data-theme="dark"] .pt-brand.has-both .pt-logo-dark,
:root[data-theme="dark"] .pt-brand.has-dark .pt-logo-dark { display: block; }
:root[data-theme="dark"] .pt-brand.has-dark .pt-brand-name { display: none; }
:root[data-theme="dark"] .pt-brand.has-light img { background: #fff; padding: 4px 8px; border-radius: 8px; box-sizing: content-box; max-height: 30px; }

/* The light / dark switch: a moon in light mode, a sun in dark mode */
.pt-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; flex: none;
    border: 1px solid var(--pt-line); border-radius: 10px; background: var(--pt-card); color: var(--pt-text); cursor: pointer;
}
.pt-icon-btn:hover { color: var(--pt-ink); border-color: var(--pt-accent); }
.pt-theme .pt-ico + .pt-ico { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .pt-theme .pt-ico:first-child { display: none; }
    :root:not([data-theme="light"]) .pt-theme .pt-ico + .pt-ico { display: block; }
}
:root[data-theme="dark"] .pt-theme .pt-ico:first-child { display: none; }
:root[data-theme="dark"] .pt-theme .pt-ico + .pt-ico { display: block; }

/* Signed in: the side menu and the top bar */
.pt-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.pt-side {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
    padding: 16px 12px; background: var(--pt-side); border-right: 1px solid var(--pt-line);
}
.pt-side .pt-brand { padding: 2px 8px; }
.pt-nav { display: flex; flex-direction: column; gap: 2px; }
.pt-nav a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
    color: var(--pt-text); text-decoration: none; font-weight: 600; font-size: 13.5px;
}
.pt-nav a .pt-ico { color: var(--pt-muted); }
.pt-nav a:hover { background: var(--pt-soft); color: var(--pt-ink); }
.pt-nav a.is-active { background: var(--pt-accent-soft); color: var(--pt-accent-ink); box-shadow: inset 3px 0 0 var(--pt-accent); }
.pt-nav a.is-active .pt-ico { color: var(--pt-accent); }
.pt-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--pt-warn); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 18px; }
:root[data-theme="dark"] .pt-badge { color: #1a1205; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pt-badge { color: #1a1205; } }
.pt-side-foot { margin-top: auto; padding: 10px 10px 0; border-top: 1px solid var(--pt-line); color: var(--pt-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.pt-body { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.pt-bar {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 24px;
    background: color-mix(in srgb, var(--pt-bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pt-line);
}
.pt-bar-title { margin-right: auto; font-weight: 700; font-size: 15px; color: var(--pt-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-menu-btn { display: none; }
.pt-me { display: inline-flex; align-items: center; gap: 9px; padding: 3px 10px 3px 3px; border-radius: 999px; text-decoration: none; color: var(--pt-ink); min-width: 0; }
.pt-me:hover, .pt-me.is-active { background: var(--pt-soft); }
.pt-avatar {
    display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
    background: linear-gradient(135deg, var(--pt-accent), var(--pt-blue)); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.pt-me-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.pt-me-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.pt-me-text small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.pt-signout { margin: 0; }
.pt-scrim { position: fixed; inset: 0; z-index: 19; background: rgba(2, 6, 23, 0.45); }
.pt-app .pt-main { flex: 1; width: 100%; max-width: 1200px; padding: 20px 24px 28px; }
.pt-app .pt-foot { padding: 0 24px 22px; color: var(--pt-muted); font-size: 12.5px; }

/* Signed out: the logo and the switch above the page */
body.pt-solo { background: radial-gradient(1200px 500px at 50% -10%, var(--pt-accent-soft), transparent 70%), var(--pt-bg); }
.pt-solo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 460px; margin: 44px auto 0; padding: 0 16px; }
.pt-solo .pt-main { padding: 0 16px 28px; }
.pt-solo .pt-flash { max-width: 460px; margin: 18px auto 0; }
.pt-solo .pt-foot { text-align: center; padding: 0 16px 26px; color: var(--pt-muted); font-size: 12.5px; }

/* Cards and page parts */
.pt-card { background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: var(--pt-radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--pt-shadow); }
.pt-narrow { max-width: 460px; margin: 18px auto; }
.pt-app .pt-narrow { margin: 6px 0 14px; }
.pt-medium { max-width: 760px; }
.pt-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pt-card-head h2 { margin: 0; }
.pt-card-head a { font-size: 13px; font-weight: 600; text-decoration: none; }
.pt-lead { font-size: 15px; color: var(--pt-text); }
.pt-muted { color: var(--pt-muted); }
.pt-small { font-size: 12.5px; }
.pt-prewrap { white-space: pre-wrap; }
.pt-back { margin: 0 0 10px; font-size: 13px; }
.pt-back a { text-decoration: none; }
.pt-empty { color: var(--pt-muted); margin: 6px 0; }
.pt-note { padding: 10px 14px; border-radius: 10px; background: var(--pt-soft); margin: 12px 0 0; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 14px; align-items: start; }
.pt-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pt-page-head h1 { margin: 0; }

/* Home: the welcome band and the counts */
.pt-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    padding: 20px 24px; margin-bottom: 14px; border-radius: 14px; color: #fff;
    background: linear-gradient(120deg, var(--pt-hero-a), var(--pt-hero-b));
}
.pt-hero::after {
    content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 70%); pointer-events: none;
}
.pt-hero h1 { color: #fff; font-size: 22px; margin-bottom: 4px; }
.pt-hero .pt-lead { margin: 0; max-width: 620px; color: rgba(255, 255, 255, 0.86); }
.pt-hero-text, .pt-hero-actions { position: relative; z-index: 1; }
.pt-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-hero .pt-btn { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.pt-hero .pt-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: #fff; }
.pt-hero .pt-btn-primary { background: #fff; border-color: #fff; color: #0b4f48; }
.pt-hero .pt-btn-primary:hover { background: #f1f5f9; filter: none; }
.pt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pt-stat {
    --c: var(--pt-muted);
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--pt-radius); text-decoration: none;
    background: var(--pt-card); border: 1px solid var(--pt-line); box-shadow: var(--pt-shadow); border-top: 3px solid var(--c);
}
.pt-stat:hover { border-color: var(--c); }
.pt-stat-num { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--pt-ink); font-variant-numeric: tabular-nums; }
.pt-stat-label { font-size: 12.5px; font-weight: 600; color: var(--pt-muted); }
.pt-stat.is-warn { --c: var(--pt-warn); }
.pt-stat.is-warn .pt-stat-num { color: var(--pt-warn); }
.pt-stat.is-ok { --c: var(--pt-ok); }
.pt-stat.is-blue { --c: var(--pt-blue); }
.pt-stat.is-accent { --c: var(--pt-accent); }

/* Messages */
.pt-flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }
.pt-flash.is-ok { background: var(--pt-ok-soft); color: var(--pt-ok); }
.pt-flash.is-error { background: var(--pt-bad-soft); color: var(--pt-bad); }

/* Buttons and forms */
.pt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
    border: 1px solid var(--pt-line); border-radius: 10px; background: var(--pt-card); color: var(--pt-ink);
    font: inherit; font-weight: 600; font-size: 13.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.pt-btn:hover { border-color: var(--pt-accent); }
.pt-btn:disabled { opacity: 0.6; cursor: default; }
.pt-btn-primary { background: var(--pt-accent); border-color: var(--pt-accent); color: #fff; }
.pt-btn-primary:hover { filter: brightness(0.95); }
.pt-btn-quiet { border-color: transparent; background: transparent; color: var(--pt-muted); }
.pt-btn-wide { width: 100%; margin-top: 6px; }
.pt-btn-big { min-height: 44px; padding: 0 22px; font-size: 15px; }
.pt-form { display: flex; flex-direction: column; gap: 6px; }
.pt-form label, .pt-form legend { font-weight: 600; font-size: 14px; color: var(--pt-ink); margin-top: 8px; }
.pt-form label small { font-weight: 400; }
.pt-form input[type="text"], .pt-form input[type="email"], .pt-form input[type="password"], .pt-form select, .pt-form textarea, .pt-search input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--pt-line); border-radius: 10px; background: var(--pt-card); color: var(--pt-ink); font: inherit;
}
.pt-form textarea { resize: vertical; min-height: 110px; }
.pt-form input:focus, .pt-form input[type="password"]:focus, .pt-form select:focus, .pt-form textarea:focus, .pt-search input:focus { outline: none; border-color: var(--pt-accent); box-shadow: 0 0 0 3px var(--pt-focus); }
.pt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.pt-row > div { display: flex; flex-direction: column; gap: 6px; }
.pt-form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.pt-form-foot .pt-btn-primary { margin-left: auto; }
.pt-file { display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; cursor: pointer; font-weight: 600; color: var(--pt-link) !important; }
.pt-file input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.pt-file:focus-within { outline: 3px solid var(--pt-focus); border-radius: 6px; }
.pt-chosen { font-size: 13px; color: var(--pt-muted); overflow-wrap: anywhere; }
.pt-choices { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.pt-choices-row { flex-direction: row; flex-wrap: wrap; }
.pt-choice { display: flex !important; align-items: center; gap: 10px; margin: 0 !important; padding: 10px 14px; border: 1px solid var(--pt-line); border-radius: 10px; cursor: pointer; font-weight: 500 !important; }
.pt-choice:has(input:checked) { border-color: var(--pt-accent); background: var(--pt-accent-soft); }
.pt-choice span { display: flex; flex-direction: column; }
.pt-search { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.pt-search input { min-width: 0; flex: 1 1 220px; }

/* Lists */
.pt-list { list-style: none; margin: 0; padding: 0; }
.pt-list li + li { border-top: 1px solid var(--pt-line); }
.pt-row-main { display: flex; flex-direction: column; min-width: 0; }
.pt-list .pt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 4px; text-decoration: none; color: inherit; }
.pt-list .pt-row:hover strong { color: var(--pt-link); }
.pt-list strong { color: var(--pt-ink); overflow-wrap: anywhere; }
.pt-ref { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--pt-muted); text-transform: uppercase; }
.pt-links { list-style: none; margin: 0; padding: 0; }
.pt-links li { padding: 7px 0; border-top: 1px solid var(--pt-line); }
.pt-links li:first-child { border-top: 0; }
.pt-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--pt-blue-soft); color: var(--pt-blue); }
.pt-status.is-pending { background: var(--pt-warn-soft); color: var(--pt-warn); }
.pt-status.is-resolved, .pt-status.is-closed { background: var(--pt-ok-soft); color: var(--pt-ok); }
.pt-status.is-on_hold { background: var(--pt-soft); color: var(--pt-muted); }
.pt-tag { padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pt-tag.is-warn { background: var(--pt-warn-soft); color: var(--pt-warn); }
.pt-tag.is-bad { background: var(--pt-bad-soft); color: var(--pt-bad); }
.pt-tabs { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pt-tabs nav { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--pt-soft); }
.pt-tabs a { padding: 6px 14px; border-radius: 9px; text-decoration: none; color: var(--pt-text); font-weight: 600; font-size: 14px; }
.pt-tabs a.is-active { background: var(--pt-card); color: var(--pt-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }
.pt-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pt-chip { display: inline-flex; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--pt-line); background: var(--pt-card); color: var(--pt-text); text-decoration: none; font-size: 13.5px; font-weight: 600; margin-right: 6px; }
.pt-chip.is-active { border-color: var(--pt-accent); background: var(--pt-accent-soft); color: var(--pt-accent-ink); }
.pt-table-wrap { overflow-x: auto; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pt-muted); padding: 6px 10px; border-bottom: 1px solid var(--pt-line); }
.pt-table td { padding: 10px; border-bottom: 1px solid var(--pt-line); vertical-align: top; }
.pt-table td small { display: block; }
.pt-table a { text-decoration: none; }
.pt-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.pt-dl dt { color: var(--pt-muted); font-size: 14px; }
.pt-dl dd { margin: 0; color: var(--pt-ink); overflow-wrap: anywhere; }
.pt-articles { list-style: none; margin: 0; padding: 0; }
.pt-articles li { padding: 12px 0; border-top: 1px solid var(--pt-line); }
.pt-articles li:first-child { border-top: 0; }
.pt-articles p { margin: 4px 0; color: var(--pt-text); }
.pt-articles a { text-decoration: none; }

/* A request */
.pt-ticket-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.pt-ticket-head h1 { margin: 2px 0 6px; overflow-wrap: anywhere; }
.pt-ticket-head p { margin: 0; }
.pt-ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.pt-ticket-side form { margin: 0; }
.pt-thread { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pt-msg { max-width: 86%; padding: 14px 18px; border-radius: var(--pt-radius); border: 1px solid var(--pt-line); background: var(--pt-card); }
.pt-msg.is-customer { align-self: flex-end; background: var(--pt-accent-soft); border-color: transparent; }
.pt-msg.is-desk { align-self: flex-start; }
.pt-msg-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 6px; font-size: 13.5px; }
.pt-msg-head strong { color: var(--pt-ink); }
.pt-msg-head span { color: var(--pt-muted); white-space: nowrap; }
.pt-msg-body { overflow-wrap: anywhere; }
.pt-msg-body p:last-child { margin-bottom: 0; }
.pt-msg-body img { max-width: 100%; height: auto; }
.pt-msg-body table { max-width: 100%; display: block; overflow-x: auto; }
.pt-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pt-files a { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--pt-card); border: 1px solid var(--pt-line); text-decoration: none; font-size: 13.5px; overflow-wrap: anywhere; }
.pt-article h1 { margin-top: 4px; }
.pt-article-body { overflow-wrap: anywhere; font-size: 15.5px; }
.pt-article-body img { max-width: 100%; height: auto; }
.pt-article-body pre, .pt-article-body code { background: var(--pt-soft); border-radius: 6px; padding: 1px 5px; }
.pt-article-body pre { padding: 12px; overflow-x: auto; }
.pt-helpful form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-weight: 600; }

@media (max-width: 900px) {
    .pt-shell { grid-template-columns: minmax(0, 1fr); }
    .pt-side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; width: 264px; height: auto; transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: 0 10px 40px rgba(2, 6, 23, 0.3); }
    body.pt-menu-open .pt-side { transform: none; }
    .pt-menu-btn { display: inline-flex; }
    .pt-bar { padding: 8px 14px; }
    .pt-app .pt-main { padding: 16px 14px 24px; }
    .pt-app .pt-foot { padding: 0 14px 20px; }
}
@media (prefers-reduced-motion: reduce) { .pt-side { transition: none; } }
@media (max-width: 720px) {
    h1 { font-size: 20px; }
    .pt-me-text { display: none; }
    .pt-me { padding: 2px; }
    .pt-card { padding: 14px; }
    .pt-msg { max-width: 100%; }
    .pt-ticket-side { align-items: flex-start; }
    .pt-hero { padding: 18px; }
    .pt-hero-actions, .pt-hero-actions .pt-btn { width: 100%; }
    .pt-form-foot .pt-btn-primary { width: 100%; margin-left: 0; }
    .pt-grid { grid-template-columns: 1fr; }
    .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pt-solo-top { margin-top: 24px; }
}

/* Signing in with a password, Microsoft, two-step verification, My account and the administrators' area (script 101) */
.pt-me-name { text-decoration: none; padding: 4px 8px; border-radius: 9px; }
.pt-me-name:hover, .pt-me-name.is-active { background: var(--pt-soft); }
.pt-form label:has(.pt-label-link) { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pt-label-link { font-weight: 500; font-size: 13.5px; color: var(--pt-link); text-decoration: none; }
.pt-label-link:hover { text-decoration: underline; }
.pt-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--pt-muted); font-size: 13px; }
.pt-or::before, .pt-or::after { content: ""; flex: 1; border-top: 1px solid var(--pt-line); }
.pt-btn-ms { gap: 10px; text-decoration: none; }
.pt-ms-logo { display: inline-grid; grid-template-columns: 8px 8px; gap: 2px; }
.pt-ms-logo i { display: block; width: 8px; height: 8px; }
.pt-ms-logo i:nth-child(1) { background: #f25022; } .pt-ms-logo i:nth-child(2) { background: #7fba00; }
.pt-ms-logo i:nth-child(3) { background: #00a4ef; } .pt-ms-logo i:nth-child(4) { background: #ffb900; }
.pt-link-signin { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--pt-line); }
.pt-link-signin summary { cursor: pointer; color: var(--pt-link); font-size: 14px; font-weight: 500; }
.pt-link-signin[open] summary { margin-bottom: 4px; }
.pt-code { font-size: 20px !important; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; text-align: center; }
.pt-steps { margin: 6px 0 4px; padding-left: 20px; color: var(--pt-text); }
.pt-steps li { margin: 8px 0; }
.pt-qr { display: block; width: 200px; height: 200px; margin: 10px 0 6px; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--pt-line); image-rendering: pixelated; }
.pt-key { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--pt-soft); font-size: 13px; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.pt-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.pt-codes code { display: block; padding: 8px 10px; border-radius: 9px; background: var(--pt-soft); text-align: center; font-size: 15px; letter-spacing: 0.05em; }
.pt-check { display: grid !important; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; justify-content: start !important; font-weight: 600; cursor: pointer; margin: 10px 0 4px; }
.pt-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--pt-accent); }
.pt-check small { grid-column: 2; font-weight: 400; color: var(--pt-muted); font-size: 13.5px; }
.pt-check-danger { color: var(--pt-bad) !important; }
.pt-btn-danger { color: var(--pt-bad); border-color: color-mix(in srgb, var(--pt-bad) 40%, var(--pt-line)); }
.pt-btn-danger:hover { background: var(--pt-bad-soft); }
.pt-tag.is-ok { background: var(--pt-ok-soft); color: var(--pt-ok); }
.pt-tag.is-blue { background: var(--pt-blue-soft); color: var(--pt-blue); }
.pt-tag:not(.is-ok):not(.is-warn):not(.is-bad):not(.is-blue) { background: var(--pt-soft); color: var(--pt-muted); }
.pt-people td strong { margin-right: 6px; }
.pt-people .pt-tag { margin-right: 4px; vertical-align: 1px; }
.pt-people tr.is-muted td { color: var(--pt-muted); }
.pt-right { text-align: right; white-space: nowrap; }
.pt-page-head h1 small { font-size: 15px; font-weight: 500; margin-left: 6px; }
.pt-history { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.pt-history li { padding: 9px 0; border-top: 1px solid var(--pt-line); color: var(--pt-text); }
.pt-history li:first-child { border-top: 0; padding-top: 0; }
.pt-history li span { font-weight: 600; color: var(--pt-ink); }
.pt-history small { display: block; color: var(--pt-muted); font-size: 12.5px; margin-top: 2px; }
.pt-form .pt-choices + .pt-check, .pt-form .pt-check + .pt-choices { margin-top: 12px; }
@media (max-width: 640px) {
    .pt-codes { grid-template-columns: 1fr 1fr; }
    .pt-people thead { display: none; }
    .pt-people tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--pt-line); }
    .pt-people td { border: 0 !important; padding: 0 !important; }
    .pt-people td:nth-child(2), .pt-people td:nth-child(3) { grid-column: 1; font-size: 13.5px; }
    .pt-people td:nth-child(4) { grid-row: 1; grid-column: 2; }
}

/* Onboarding (script 102): the stages' progress */
.pt-stages { list-style: none; margin: 0; padding: 0; }
.pt-stage { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--pt-line); }
.pt-stage:first-child { border-top: 0; padding-top: 0; }
.pt-stage strong { display: block; color: var(--pt-ink); }
.pt-stage small { display: block; color: var(--pt-muted); font-size: 13.5px; margin-top: 2px; }
.pt-stage-status { font-size: 13.5px; font-weight: 600; color: var(--pt-muted); }
.pt-stage.is-done .pt-stage-status { color: var(--pt-ok); }
.pt-stage.is-in_progress .pt-stage-status { color: var(--pt-blue); }
.pt-stage-dot { width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--pt-line); background: var(--pt-card); }
.pt-stage.is-in_progress .pt-stage-dot { border-color: var(--pt-blue); background: var(--pt-blue-soft); }
.pt-stage.is-done .pt-stage-dot { border-color: var(--pt-ok); background: var(--pt-ok); box-shadow: inset 0 0 0 3px var(--pt-card); }
.pt-h3 { font-size: 15px; margin: 16px 0 4px; color: var(--pt-ink); }
.pt-h3:first-of-type { margin-top: 4px; }


/* iPhone / iPad: form fields at 16px so Safari doesn't zoom in when one is tapped (iOS only - see css/ios-no-zoom.css) */
@supports (-webkit-touch-callout: none) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    select, textarea, [contenteditable="true"] { font-size: max(16px, 1em) !important; }
}

/* Admin > a person > Remove from the portal: the button opens the confirmation */
.pt-remove > summary { display: inline-flex; list-style: none; cursor: pointer; }
.pt-remove > summary::-webkit-details-marker { display: none; }
.pt-remove[open] > summary { display: none; }
.pt-remove p { margin: 0 0 12px; }

/* An email as it looked (a sandboxed frame; sd-portal.js sizes it) */
.pt-email-frame { display: block; width: 100%; min-height: 40px; border: 0; background: #fff; border-radius: 8px; }


/* Proposals (PortalController.Proposals.cs): where each is up to, its documents and who signs */
.pt-status.is-p-to_sign { background: var(--pt-warn-soft); color: var(--pt-warn); }
.pt-status.is-p-not_yet, .pt-status.is-p-expired, .pt-status.is-p-replaced { background: var(--pt-soft); color: var(--pt-muted); }
.pt-status.is-p-waiting, .pt-status.is-p-with_others { background: var(--pt-blue-soft); color: var(--pt-blue); }
.pt-status.is-p-signed { background: var(--pt-ok-soft); color: var(--pt-ok); }
.pt-status.is-p-declined { background: var(--pt-bad-soft); color: var(--pt-bad); }
.pt-quote { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--pt-accent); background: var(--pt-soft); border-radius: 0 10px 10px 0; }
.pt-quote p { margin: 2px 0 0; }
.pt-docs { list-style: none; margin: 0; padding: 0; }
.pt-docs li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--pt-line); }
.pt-docs li:first-child { border-top: 0; padding-top: 2px; }
.pt-docs li > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.pt-docs strong { color: var(--pt-ink); overflow-wrap: anywhere; }
.pt-doc-actions { display: flex; gap: 6px; }
.pt-doc-actions .pt-btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.pt-signers { list-style: none; margin: 0 0 8px; padding: 0; }
.pt-signers li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--pt-line); }
.pt-signers li:first-child { border-top: 0; padding-top: 2px; }
.pt-signer-main { display: flex; flex-direction: column; min-width: 0; }
.pt-signer-main strong { color: var(--pt-ink); }
.pt-signer-main small { font-size: 12.5px; }
.pt-signer-status { font-size: 12.5px; font-weight: 600; color: var(--pt-muted); text-align: right; }
.pt-signer-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--pt-line); background: var(--pt-card); }
.pt-signers li.is-sent .pt-signer-dot, .pt-signers li.is-viewed .pt-signer-dot { border-color: var(--pt-warn); background: var(--pt-warn-soft); }
.pt-signers li.is-sent .pt-signer-status, .pt-signers li.is-viewed .pt-signer-status { color: var(--pt-warn); }
.pt-signers li.is-signed .pt-signer-dot { border-color: var(--pt-ok); background: var(--pt-ok); box-shadow: inset 0 0 0 2px var(--pt-card); }
.pt-signers li.is-signed .pt-signer-status { color: var(--pt-ok); }
.pt-signers li.is-declined .pt-signer-dot { border-color: var(--pt-bad); background: var(--pt-bad); }
.pt-signers li.is-declined .pt-signer-status { color: var(--pt-bad); }

/* Agreements (PortalController.Agreements.cs): each agreement's items and who they're assigned to - no prices */
.pt-stat.is-violet { --c: var(--pt-violet); }
.pt-agreement-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pt-agreement-head h2 { margin: 2px 0 2px; font-size: 16px; }
.pt-agreement-head p { margin: 0; }
.pt-status.is-a-active { background: var(--pt-ok-soft); color: var(--pt-ok); }
.pt-status.is-a-paused { background: var(--pt-warn-soft); color: var(--pt-warn); }
.pt-status.is-a-ended { background: var(--pt-soft); color: var(--pt-muted); }
.pt-items { border: 1px solid var(--pt-line); border-radius: 10px; overflow: hidden; }
.pt-item { display: grid; grid-template-columns: minmax(0, 1.4fr) 60px minmax(0, 1.6fr); gap: 12px; align-items: center; padding: 8px 12px; }
.pt-item + .pt-item { border-top: 1px solid var(--pt-line); }
.pt-item.is-head { background: var(--pt-soft); color: var(--pt-muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.pt-item.is-assembly { background: color-mix(in srgb, var(--pt-soft) 60%, transparent); }
.pt-item.is-part .pt-item-name { padding-left: 18px; position: relative; }
.pt-item.is-part .pt-item-name::before { content: ""; position: absolute; left: 4px; top: 2px; bottom: 50%; width: 8px; border-left: 2px solid var(--pt-line); border-bottom: 2px solid var(--pt-line); border-bottom-left-radius: 4px; }
.pt-item-name { display: flex; flex-direction: column; min-width: 0; }
.pt-item-name strong { color: var(--pt-ink); font-weight: 600; overflow-wrap: anywhere; }
.pt-item-name small { font-size: 12px; }
.pt-item-qty { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--pt-ink); }
.pt-item.is-head .pt-item-qty { color: var(--pt-muted); font-weight: 700; }
.pt-item-who { display: flex; flex-wrap: wrap; gap: 4px; }
.pt-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--pt-blue-soft); color: var(--pt-blue); font-size: 12.5px; font-weight: 600; }
.pt-chip.is-me { background: var(--pt-accent-soft); color: var(--pt-accent-ink); }
.pt-chip.is-free { background: transparent; border: 1px dashed var(--pt-line); color: var(--pt-muted); }
@media (max-width: 720px) {
    .pt-item { grid-template-columns: minmax(0, 1fr) auto; }
    .pt-item.is-head { display: none; }
    .pt-item-who { grid-column: 1 / -1; }
}
