:root {
    --cs-green: #3f6f52;
    --cs-green-deep: #345c44;
    --cs-green-ink: #24382c;
    --cs-text: #1c2420;
    --cs-muted: #5a635e;
    --cs-line: #dde2de;
    --cs-wash: #f3f5f4;
    --cs-paper: #ffffff;
    --cs-nav: #f7f8f7;
    --cs-type: system-ui, "Segoe UI", "Source Sans 3", "Source Sans Pro", "Noto Sans", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--cs-type);
    background: var(--cs-wash);
    margin: 0;
    min-height: 100vh;
    color: var(--cs-text);
    font-size: 15px;
    line-height: 1.5;
}

body.p-auth {
    background:
        radial-gradient(1200px 600px at 50% 0%, #f7fbf8 0%, #eef4f0 55%, #e7eee9 100%);
}

.zygomel-lockup {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a4a32;
    flex-shrink: 0;
}
.zygomel-lockup .mark {
    width: 32px;
    height: auto;
    display: block;
    flex: 0 0 auto;
}
.zygomel-lockup .mark path:not([fill="none"]) { fill: currentColor; }
.zygomel-lockup .mark path[stroke] { stroke: currentColor; }
.zygomel-lockup .names {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.zygomel-lockup .word {
    font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    font-weight: 500;
    font-size: 22px;
    line-height: 1;
    letter-spacing: -0.03em;
    color: inherit;
    white-space: nowrap;
    padding-bottom: 0.18em;
}
.zygomel-lockup .tag {
    display: block;
    font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    font-weight: 500;
    font-size: 8px;
    line-height: 1;
    color: #2a5c42;
    white-space: nowrap;
    transform-origin: left center;
}

a {
    color: var(--cs-green-ink);
}

.p-header {
    background: var(--cs-paper);
    color: var(--cs-text);
    border-top: 3px solid var(--cs-green);
    border-bottom: 1px solid var(--cs-line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.p-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 6px 20px;
}

.p-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--cs-text);
    text-decoration: none;
}

.p-brand > div > span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--cs-muted);
}
.p-brand .zygomel-lockup { display: flex; }
.p-brand .zygomel-lockup .word {
    font-size: 22px;
    font-weight: 500;
    color: #1a4a32;
}

.p-logo {
    height: 36px;
    width: auto;
    display: block;
}

.p-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
    padding: 0 20px 10px;
    background: var(--cs-nav);
    border-top: 1px solid var(--cs-line);
}

.p-nav a {
    color: var(--cs-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0 6px;
    border-bottom: 2px solid transparent;
}

.p-nav a:hover {
    color: var(--cs-green-ink);
}

.p-nav a[aria-current="page"] {
    color: var(--cs-green-ink);
    font-weight: 600;
    border-bottom-color: var(--cs-green);
}

.p-nav a.p-signout {
    margin-left: auto;
    border: 1px solid var(--cs-line);
    border-radius: 4px;
    padding: 4px 11px;
    font-size: 13px;
    letter-spacing: 0.03em;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.p-nav-msg {
    padding-right: 4px;
}

.p-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 10px;
    background: var(--cs-green);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
    font-weight: 700;
}

.p-card.unread-reply {
    border-left: 3px solid var(--cs-green);
    background: #f7faf8;
}

.p-pill {
    display: inline-block;
    background: transparent;
    color: var(--cs-green-ink);
    border: 1px solid var(--cs-line);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

.p-wrap {
    max-width: 1260px;
    margin: 0 auto;
    padding: 20px 24px 48px;
}

body.p-auth .p-wrap {
    max-width: 440px;
    padding-top: 40px;
}

body.p-auth-split .p-wrap {
    max-width: 1120px;
    padding-top: 28px;
}

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 400px);
    gap: 32px 40px;
    align-items: center;
}

.auth-welcome {
    position: relative;
    min-height: 280px;
    padding: 12px 8px 8px 0;
    overflow: hidden;
}

.auth-welcome-logo {
    position: absolute;
    right: 4%;
    top: 46%;
    transform: translateY(-50%);
    width: min(240px, 70%);
    opacity: 0.16;
    pointer-events: none;
    user-select: none;
}

.auth-welcome-copy {
    position: relative;
    z-index: 1;
    max-width: 36rem;
}

.auth-welcome h1 {
    margin: 0 0 8px;
    font-size: 1.7rem;
    font-weight: 650;
    color: var(--cs-green-ink);
    line-height: 1.25;
}

.auth-welcome .auth-lead {
    margin: 0 0 18px;
    font-size: 1.05rem;
    color: var(--cs-muted);
}

.auth-welcome hr {
    border: 0;
    border-top: 1px solid var(--cs-line);
    margin: 0 0 18px;
    max-width: 12rem;
}

.auth-welcome h2 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--cs-green-ink);
}

.auth-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-bullets li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 12px;
}

.auth-bullets svg {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-top: 1px;
}

.auth-split .p-card {
    margin-bottom: 0;
    padding: 28px 28px 22px;
}

.auth-split.auth-split-wide {
    grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
    align-items: start;
}

.auth-split .p-card .btn {
    width: 100%;
}

.auth-split .p-card > p {
    text-align: center;
}

@media (max-width: 840px) {
    .auth-split {
        grid-template-columns: 1fr;
    }
    .auth-welcome {
        min-height: 0;
        padding: 0 0 8px;
    }
    .auth-welcome-logo {
        width: 70%;
        opacity: 0.07;
    }
}

.p-back {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.p-back a {
    color: var(--cs-green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.p-back a:hover {
    border-bottom-color: var(--cs-green);
}

.p-card {
    background: var(--cs-paper);
    border: 1px solid var(--cs-line);
    border-radius: 4px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: none;
}

h1, h2, h3 {
    color: var(--cs-green-ink);
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 1.45rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.4rem; }

label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    font-size: 13px;
    color: var(--cs-green-ink);
}

input, select, textarea {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    margin-top: 4px;
    margin-bottom: 8px;
    border: 1px solid #cfd6d1;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: var(--cs-text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cs-green);
    color: #fff;
    padding: 4px 12px;
    min-height: 32px;
    box-sizing: border-box;
    border: 1px solid var(--cs-green);
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
    margin: 8px 0 0;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
}

.btn:hover {
    background: var(--cs-green-deep);
}

.btn-sec {
    background: transparent;
    color: var(--cs-green-ink);
    border: 1px solid var(--cs-line);
}

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td {
    border-bottom: 1px solid var(--cs-line);
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}
th {
    background: var(--cs-nav);
    color: var(--cs-muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.err {
    background: #f8eeee;
    border-left: 3px solid #a33b3b;
    padding: 10px 12px;
    border-radius: 4px;
    color: #a33b3b;
    font-size: 14px;
}

.ok {
    background: #eef6f0;
    border-left: 3px solid var(--cs-green);
    padding: 10px 12px;
    border-radius: 4px;
    color: var(--cs-green-ink);
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
}

.p-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.p-link-list li {
    border-bottom: 1px solid var(--cs-line);
}

.p-link-list li:last-child {
    border-bottom: 0;
}

.p-link-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    text-decoration: none;
    color: var(--cs-text);
    font-size: 15px;
}

.p-link-list a:hover {
    color: var(--cs-green);
}

.p-link-list span {
    color: var(--cs-muted);
    font-size: 13px;
}

.muted { color: var(--cs-muted); font-size: 13px; }

.visit-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.visit-actions form { margin: 0; display: inline-flex; }
.video-consult { display: contents; }
.video-join-btn { min-width: 96px; }
.backup { font-family: Consolas, monospace; }
.mfa-qr {
    display: inline-block;
    padding: 12px;
    margin: 8px 0 12px;
    background: #fff;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
}
.mfa-qr canvas,
.mfa-qr svg,
.mfa-qr img {
    display: block;
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.p-foot {
    text-align: center;
    color: var(--cs-muted);
    font-size: 13px;
    padding: 8px 16px 28px;
}

@media (max-width: 760px) {
    .grid { grid-template-columns: 1fr; }
    .p-nav a.p-signout { margin-left: 0; }
    .p-top { padding: 6px 14px; }
    .p-nav { padding: 0 14px 10px; }
    .p-wrap { padding: 16px 14px 36px; }
}
