/* A védett munkatér ugyanazt a világos, műszaki arculatot használja. */
.partner-page [hidden] { display: none !important; }
/* A belépés, a jelszó-visszaállítás és a kapcsolatfelvétel különálló blokkok. */
#partner-auth-form {
    display: grid;
    gap: 18px;
}
.partner-login .portal-form {
    margin: 0;
    gap: 20px;
}
.partner-login .portal-field {
    display: grid;
    gap: 8px;
    margin: 0;
}
#partner-auth-form > .portal-button {
    justify-self: start;
}
.partner-login .partner-invitation {
    margin-top: 28px;
}
.portal-toast {
    position: fixed;
    z-index: 1000;
    inset-inline-end: max(16px, env(safe-area-inset-right));
    inset-block-end: max(16px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    width: min(420px, calc(100% - 32px));
    padding: 10px 12px;
    border: 1px solid #b5ce93;
    border-radius: 12px;
    background: #f1f7e9;
    color: #344f22;
    box-shadow: 0 12px 36px #19261926;
}
.portal-toast[hidden] { display: none; }
.portal-toast.is-error { background: #fff4ed; border-color: #dfb392; color: #843b1c; }
.portal-toast p { margin: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.portal-toast-mark { display: flex; padding: 6px; border-radius: 8px; background: #e4eed8; }
.portal-toast.is-error .portal-toast-mark { background: #f8e7dc; }
.portal-toast svg { width: 18px; height: 18px; }
.portal-toast > button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.portal-toast > button:hover { background: #1b28100f; }
.partner-workspace { padding-block: 12px 60px; }
.portal-heading, .portal-section-heading, .portal-card-top, .portal-actions, .portal-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.portal-heading { padding: 26px 0 32px; align-items: flex-start; }
.partner-workspace .portal-heading h1 { font-size: clamp(28px, 3.2vw, 42px); margin: 10px 0; }
.portal-workspace-title { display: flex; align-items: center; gap: .3em; }
.portal-workspace-title > span { min-width: 0; overflow-wrap: anywhere; }
.portal-workspace-title > svg {
    box-sizing: border-box;
    flex: none;
    width: 1.12em;
    height: 1.12em;
    padding: .2em;
    border: 1px solid #d5e2c7;
    border-radius: .25em;
    color: #52743b;
    background: #edf4e5;
}
.portal-heading p { margin: 6px 0; }
.portal-actions { flex-wrap: wrap; }
.portal-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: #edf2e8; border: 1px solid #dce5d5; border-radius: 16px; margin: 0 0 30px; }
.portal-tabs button, .portal-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 18px; border: 1px solid #a5bd85; border-radius: 10px; color: #24361e; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; background: linear-gradient(125deg,#bfdf76,#a0cc4b); transition: background .2s, box-shadow .2s; text-decoration: none; }
.portal-tabs button { background: transparent; border-color: transparent; }
.portal-tabs button[aria-current] { background: #fff; box-shadow: 0 3px 12px #31482a0c; border-color: #cfdbc5; }
.portal-button.secondary { background: #f8faf5; border-color: #cfdbc5; }
.portal-button:hover, .portal-tabs button:hover { box-shadow: 0 3px 12px #31482a18; border-color: #739b43; }
.portal-button:focus-visible, .portal-tabs button:focus-visible, .portal-form :focus-visible { outline: 3px solid #6a942e; outline-offset: 3px; }
.portal-button svg, .portal-tabs svg, .portal-panel h3 svg, .portal-document svg { width: 21px; height: 21px; flex-shrink: 0; }
.portal-section-heading { margin: 25px 0 20px; }
.portal-section-heading h2 { margin: 0; font-size: 26px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,310px),1fr)); gap: 20px; }
.portal-card, .portal-panel, .portal-empty { padding: 26px; background: linear-gradient(135deg,#fff,#f8faf4); border: 1px solid #d8e2d0; border-radius: 18px; box-shadow: 0 7px 25px #24362106; min-width: 0; overflow-wrap: anywhere; }
.portal-card > svg, .portal-card-top > svg, .portal-empty > svg { width: 34px; height: 34px; color: #638c33; }
.portal-card h2, .portal-card h3 { font-size: 24px; margin: 18px 0 10px; line-height: 1.25; }
.portal-card > .portal-button { margin: 12px 6px 0 0; }
.portal-card-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin-top: 12px; }
.project-card { border-top: 3px solid #8db943; display: flex; flex-direction: column; align-items: flex-start; }
.portal-card-top { width: 100%; margin-bottom: 20px; }
.portal-project-description { flex: 1; white-space: pre-line; }
.portal-muted, .portal-document small { color: #60706e; font-size: 15px; }
.portal-badge { display: inline-block; border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; background: #edf3e5; color: #456922; border: 1px solid #d0dfbf; }
.status-development { color: #315a7a; background: #eef5fa; border-color: #c7dce9; }
.status-review { color: #805b1e; background: #fff6e6; border-color: #e9d8b2; }
.status-archived { color: #626b70; background: #f1f3f3; border-color: #dce0e0; }
.portal-project-heading { padding: 24px 0; }
.project-art {
    pointer-events: none;
    user-select: none;
    width: min(330px, 100%);
    aspect-ratio: 300 / 116;
    overflow: hidden;
    color: #4d7d62;
    background: radial-gradient(ellipse, #e6f0df 0%, transparent 72%);
}
.project-art svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.project-art .art-guides { opacity: .38; stroke-dasharray: 2 2; }
.project-art .art-window { fill: #e9f1e7; fill-opacity: .38; opacity: .6; }
.project-art .art-dots { stroke-width: 2.4; }
.project-art-development { color: #36675f; }
.project-art .art-code {
    font: 9px/1 monospace;
    fill: currentColor;
    stroke: none;
    transform-box: fill-box;
    animation: art-type 8s steps(24, end) infinite both;
}
.art-code:nth-of-type(2) { animation-delay: 1.35s; }
.art-code:nth-of-type(3) { animation-delay: 2.7s; }
@keyframes art-type {
    0% { clip-path: inset(0 100% 0 0) fill-box; }
    20%, 78% { clip-path: inset(0) fill-box; opacity: 1; }
    92%, 100% { clip-path: inset(0) fill-box; opacity: 0; }
}
.project-art-prototype { color: #536c95; }
.art-layout { fill: #c5d6eb; fill-opacity: .5; animation: art-wireframe 7s ease-in-out infinite; }
@keyframes art-wireframe {
    0%, 100% { fill-opacity: .12; }
    45%, 68% { fill-opacity: .78; }
}
.art-cursor { fill: currentColor; animation: art-point 7s ease-in-out infinite; }
@keyframes art-point {
    0%, 100% { transform: translate(22px, 10px); }
    40%, 65% { transform: translate(-23px, -5px); }
}
.art-signal { stroke-width: 2; }
.art-scan { stroke-width: 2.5; animation: art-sweep 5s linear infinite; }
@keyframes art-sweep {
    0% { opacity: 0; }
    10%, 90% { opacity: .8; }
    100% { opacity: 0; transform: translateX(190px); }
}
.project-art-repair { color: #877044; }
.art-patch { stroke-dasharray: 95; animation: art-patch 6s ease-in-out infinite; }
.art-check { stroke-width: 3; stroke: #43754b; stroke-dasharray: 38; animation: art-verify 6s ease-in-out infinite; }
@keyframes art-patch {
    0%, 100% { stroke-dashoffset: 95; }
    38%, 85% { stroke-dashoffset: 0; }
}
@keyframes art-verify {
    0%, 38%, 100% { stroke-dashoffset: 38; }
    60%, 85% { stroke-dashoffset: 0; }
}
@media (max-width: 760px) {
    .project-art { width: min(260px, 100%); }
}
@media (prefers-reduced-motion: reduce) {
    .project-art :is(.art-code, path) { animation: none; }
}
.portal-project-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 12px 24px;
    overflow-wrap: anywhere;
}
.portal-project-title > div { min-width: 0; }
.portal-project-title:has(> .project-art) {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.portal-project-title > .project-art {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: min(100%, 600px);
    opacity: .4;
    mask-image: linear-gradient(to right, transparent, #000 38%);
}
.portal-project-title > .portal-project-demos { grid-column: 1 / -1; }
.portal-project-admin {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid #d8e2d0;
    border-radius: 12px;
    background: #f5f8ef;
}
.portal-project-tabs { margin-bottom: 12px; padding: 6px; border-radius: 12px; }
.portal-project-tabs button { padding: 7px 12px; min-height: 40px; font-size: 14px; }
.portal-project-tabs svg { width: 17px; height: 17px; }
.portal-preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid #c7dce9;
    border-radius: 12px;
    background: #eef5fa;
}
.portal-preview-bar p { margin: 0; }
@media (max-width: 760px) {
    .portal-project-title:has(> .project-art) { grid-template-columns: minmax(0, 1fr); }
    .portal-project-title > .project-art {
        grid-column: 1;
        grid-row: auto;
        order: 1;
        width: min(74%, 320px);
        opacity: .28;
    }
}
.portal-project-demos { display: grid; gap: 8px; }
.portal-demo-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.portal-demo-controls > .portal-button { min-width: 0; max-width: 100%; }
.portal-demo-source {
    display: grid;
    gap: 2px;
    padding: 8px 12px;
    border: 1px solid #d5e2c7;
    border-radius: 8px;
    background: #f5f8ef;
    color: #385621;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.portal-demo-supervisor-preview { margin-inline-start: auto; }
/* Mindkét felirat mérete számít, így váltáskor a gomb helye megmarad. */
.portal-demo-labels { display: grid; min-width: 0; }
.portal-demo-labels > span {
    display: flex;
    grid-area: 1 / 1;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}
.portal-demo-labels > [aria-hidden="true"] { visibility: hidden; }
.portal-demo-link, .portal-demo-toggle {
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.portal-demo-link { background: #b4d971; }
.portal-demo-toggle[aria-busy="true"] { background-color: #e9f1df; cursor: progress; }
.portal-demo-link[aria-disabled="true"] {
    background-color: #f2f4ef;
    border-color: #d8e2d0;
    color: #5d6d5e;
    cursor: not-allowed;
    box-shadow: none;
}
.portal-project-heading h2 { font-size: clamp(27px,3vw,38px); margin: 12px 0; }
.portal-project-heading > p { white-space: pre-line; }
.portal-project-title:has(> .portal-project-demos) + p:not(:empty) { margin-block-start: 12px; }
.portal-panel h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; font-size: 22px; }
.portal-timeline { list-style: none; margin: 0; padding: 0; }
.portal-timeline p { white-space: pre-wrap; overflow-wrap: anywhere; }
.portal-document { display: flex; gap: 12px; align-items: center; padding: 14px 0; color: #385621; text-decoration: none; border-bottom: 1px solid #e2e8db; overflow-wrap: anywhere; }
.portal-document small { display: block; margin-top: 5px; }
.portal-form { display: grid; gap: 18px; margin: 18px 0; }
.portal-field { display: grid; gap: 7px; font-weight: 600; }
.portal-field input, .portal-field select, .portal-field textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #b9c7b0; border-radius: 8px; background: #fff; color: #263238; font: inherit; font-weight: 400; }
.portal-field textarea { resize: vertical; }
.portal-bilingual { display: grid; gap: 10px; min-width: 0; }
.portal-locale-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.portal-locale-fields {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 8px 12px 12px;
    border: 1px solid #d9e4cf;
    border-radius: 10px;
}
.portal-locale-fields legend { padding-inline: 5px; font-weight: 700; }
.portal-translation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.portal-translation-actions .portal-button { min-height: 34px; padding: 5px 9px; font-size: 13px; }
.portal-translation-actions [role="status"]:empty { display: none; }
@media (max-width: 600px) {
    .portal-locale-grid { grid-template-columns: minmax(0, 1fr); }
}
.portal-upload { padding-top: 20px; }
/* Projektanyagok: több forrásból összeállított feltöltés és közös idővonal. */
.material-composer { display: grid; gap: 18px; }
.material-picker { display: grid; gap: 10px; min-width: 0; }
.material-quick-notes, .material-source-buttons, .material-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.material-quick-notes .portal-button { flex: 1; }
.material-drop { padding: 25px 18px; border: 2px dashed #bdceab; border-radius: 16px; background: linear-gradient(135deg,#f6faef,#fff); text-align: center; transition: border-color .2s, background .2s; }
.material-drop > svg { width: 34px; height: 34px; padding: 8px; color: #5e822d; background: #e9f1dc; border-radius: 12px; box-sizing: content-box; margin: 0 auto 12px; display: block; }
.material-drop > strong { display: block; font-size: 22px; }
.material-drop p { font-size: 15px; color: #60706e; margin: 8px 0 18px; }
.material-source-buttons { justify-content: center; }
.material-source-buttons .portal-button { padding: 9px 12px; gap: 6px; font-size: 14px; }
.material-source-buttons .portal-button svg { width: 16px; height: 16px; }
.material-drop.is-over { border-color: #6b9837; background: #edf6df; box-shadow: 0 0 0 4px #88ad4919; }
.material-drop:focus-visible { outline: 3px solid #749e40; outline-offset: 4px; }
.material-queue { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.material-queue:empty { display: none; }
.material-queue li { display: flex; align-items: center; gap: 10px; padding: 12px; background: #f7f9f3; border: 1px solid #dce4d4; border-radius: 10px; min-width: 0; }
.material-queue li > svg { width: 22px; height: 22px; flex-shrink: 0; color: #688d39; }
.material-queue li > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.material-queue strong { font-size: 15px; display: block; }
.material-queue small { display: block; font-size: 13px; color: #60706e; margin-top: 3px; }
.material-queue .portal-button { font-size: 12px; padding: 8px; }
.material-queue .has-error { border-color: #d8a284; background: #fff7f1; }
.material-queue .material-error { color: #843b1c; }
.material-optimize { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #53624a; }
.material-optimize input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; accent-color: #6b9534; }
.material-composer progress { width: 100%; height: 9px; accent-color: #80a742; }
.material-composer .portal-muted { margin: 0; }
.material-composer > .portal-button { width: 100%; }
.portal-button:disabled { opacity: .5; cursor: not-allowed; }
.material-history-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 16px 0 8px; }
.material-filters .portal-button { font-size: 14px; padding: 8px 12px; }
.material-filters .portal-button[aria-pressed="true"] { background: #e6f0d5; border-color: #aac781; color: #38551f; }
.material-event {
    --ink: #44613f;
    --tint: #eff4ec;
    --rim: #c5d3ba;
    --node: 32px;
    --inset: 10px;
    display: grid;
    grid-template-columns: var(--node) minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 12px;
    position: relative;
    padding: var(--inset) 0;
    overflow-wrap: anywhere;
}
.material-event[data-state="done"] { --ink: #476c27; --tint: #edf5e3; --rim: #b6ce9d; }
.material-event[data-state="progress"] { --ink: #236781; --tint: #e7f4f8; --rim: #abcfd9; }
.material-event[data-state="review"] { --ink: #745185; --tint: #f3edf7; --rim: #d9c6e1; }
.material-event[data-state="blocked"] { --ink: #845b25; --tint: #faf2e4; --rim: #e0c79d; }
.material-event[data-state="planned"] { --ink: #596861; --tint: #f6f8f4; --rim: #cad3c8; }
.material-event + .material-event::after {
    content: '';
    position: absolute;
    inset: 0 0 auto calc(var(--node) + 12px);
    height: 1px;
    background: linear-gradient(to right, #dce5d5, transparent);
    pointer-events: none;
}
.material-node {
    display: grid;
    place-items: center;
    width: var(--node);
    height: var(--node);
    box-sizing: border-box;
    border: 1px solid var(--rim);
    border-radius: 50%;
    color: var(--ink);
    background: var(--tint);
    z-index: 1;
}
.material-node svg { width: 18px; height: 18px; }
.material-rail {
    position: absolute;
    left: calc(var(--node) / 2 - 1.5px);
    top: calc(var(--inset) + var(--node));
    bottom: calc(-1 * var(--inset));
    width: 3px;
    overflow: hidden;
    background: repeating-linear-gradient(to bottom, #cbd5c7 0 3px, transparent 3px 6px);
}
.material-rail.is-moving { background: linear-gradient(#88a96b, #bfd2a8); }
.material-rail.is-moving::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, #e9ffc9 65%, #689d39 95%, transparent) 0 0 / 100% 14px no-repeat;
    animation: material-travel 3.6s ease-in-out infinite;
}
.material-event:nth-child(3n + 2) .material-rail::after { animation-delay: -.9s; }
.material-event:nth-child(3n) .material-rail::after { animation-delay: -1.8s; }
@keyframes material-travel {
    0% { background-position-y: -14px; }
    80%, 100% { background-position-y: calc(100% + 14px); }
}
.material-entry-content { min-width: 0; }
.material-entry-heading, .material-event-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 10px; }
.material-event h4 { font-size: 16px; line-height: 1.3; margin: 0; }
.material-state { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; font-size: 12px; line-height: 1.55; font-weight: 600; color: var(--ink); background: var(--tint); }
.material-state svg { width: 13px; height: 13px; }
.material-event-meta {
    grid-column: 2 / -1;
    font-size: 12px;
    color: #58695f;
    line-height: 1.45;
}
.material-entry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}
.material-event-meta .portal-badge { font-size: 12px; padding: 1px 6px; }
.material-event-meta .material-reply-link { padding: 2px 0; min-height: 24px; }
.material-event-body { margin: 2px 0; font-size: 14px; line-height: 1.45; }
.material-actor { font-weight: 600; }
.material-attachment-actions { display: flex; align-items: start; justify-self: end; gap: 6px; }
.material-attach {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 2px 7px;
    border: 1px solid #d5e2c7;
    border-radius: 7px;
    background: transparent;
    color: #496638;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.material-attach svg { width: 14px; height: 14px; flex-shrink: 0; }
.material-attach:hover { background: #f5f8ef; border-color: #91ae70; }
.material-attach:focus-visible { outline: 2px solid #6a942e; outline-offset: 2px; }
.material-attach:disabled, .material-reply-link:disabled { opacity: .6; cursor: default; }
.material-files { position: relative; justify-self: end; }
.material-files[open] { z-index: 3; }
.material-files summary, .material-key-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #496638;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
}
.material-key-button { border: 0; background: transparent; padding: 6px; }
.material-key-button svg, .material-files summary svg { width: 16px; height: 16px; flex-shrink: 0; }
.material-files summary { min-height: 28px; max-width: min(22vw, 230px); padding: 2px 8px; background: #f5f8ef; border: 1px solid #d5e2c7; border-radius: 7px; }
.material-files summary::-webkit-details-marker { display: none; }
.material-files summary:hover, .material-files[open] summary { border-color: #91ae70; }
.material-file-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.material-file-count { display: none; }
.material-file-list {
    position: fixed;
    inset: auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(300px, 68vw);
    max-height: 44vh;
    margin: 0;
    overflow: hidden;
    padding: 8px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #cedbc5;
    border-radius: 10px;
    box-shadow: 0 8px 24px #22351a26;
}
.material-file-list[popover]:not(:popover-open) { display: none; }
.material-file-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 0 4px 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e5ece0;
    color: #496638;
    font-size: 13px;
    font-weight: 600;
}
.material-file-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d5e2c7;
    border-radius: 6px;
    background: #f5f8ef;
    color: inherit;
    cursor: pointer;
}
.material-file-close svg { width: 17px; height: 17px; }
.material-file-close:hover { background: #e9f1df; border-color: #91ae70; }
.material-file-close:focus-visible { outline: 2px solid #6a942e; outline-offset: 2px; }
.material-file-items { overflow: auto; }
.material-download { padding: 6px; gap: 8px; margin: 0; border: 0; border-radius: 5px; font-size: 14px; }
.material-file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.material-preview-link {
    min-width: 0;
    padding: 6px;
    gap: 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    text-align: start;
    cursor: pointer;
}
.material-preview-link > span { flex: 1; min-width: 0; }
.material-preview-link svg:last-child, .material-download-icon svg { width: 16px; height: 16px; }
.material-download-icon { display: grid; min-width: 32px; min-height: 36px; place-items: center; }
.material-preview-link:hover { background: #edf5e2; }
.material-preview-link:focus-visible, .material-download-icon:focus-visible { outline: 2px solid #6a942e; outline-offset: -2px; }
.material-download small, .material-file-list .portal-muted { font-size: 12px; line-height: 1.4; }
.material-file-list p { margin: 2px 6px; }
.material-file-list time { margin: 0 6px; }
.material-key h3 { font-size: 16px; margin: 18px 0 6px; }
.material-key ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); padding: 0; margin: 0; gap: 6px 12px; }
.material-key li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.material-key svg { width: 18px; height: 18px; flex: none; color: #52743b; }
.material-download > span:first-of-type { flex: 1; min-width: 0; }
.material-download:hover { border-color: #8eaf61; background: #edf5e2; }
.material-composer-panel {
    margin-bottom: 22px;
    padding: 12px 16px;
    border: 1px solid #d8e2d0;
    border-radius: 10px;
    background: #f5f8ef;
}
.material-composer-panel > summary { color: #47692b; font-weight: 600; cursor: pointer; }
.material-composer-panel .material-composer { margin-top: 16px; }
.material-composer-actions, .material-reply-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}
.material-reply-context {
    padding: 10px 12px;
    background: #e9f1df;
    border-radius: 8px;
    overflow-wrap: anywhere;
}
.material-reply-link {
    padding: 6px 0;
    border: 0;
    color: #47692b;
    background: transparent;
    font: inherit;
    font-weight: 600;
    text-align: start;
    overflow-wrap: anywhere;
    cursor: pointer;
}
.material-reply-link:hover { text-decoration: underline; }
.material-entry-action { min-height: 28px; font-size: 12px; }
.material-delete { border-color: #ebc6ba; color: #8b3f2d; }
.material-delete:hover { background: #fcece5; border-color: #d59f8f; }
.material-delete-confirm > .portal-button {
    justify-self: start;
    border-color: #dfa695;
    color: #782c1e;
    background: #fcece5;
}
.material-delete-confirm > .portal-button:hover { border-color: #a55a47; }
.material-reply-link:focus-visible,
.material-event[tabindex="-1"]:focus { outline: 2px solid #6a942e; outline-offset: 3px; }
.material-event[tabindex="-1"] { scroll-margin-top: 100px; }
.material-event-saved {
    border-radius: 10px;
    background: #f0f7e7;
}
.portal-dialog { width: min(560px,calc(100% - 30px)); max-height: 90vh; box-sizing: border-box; border: 1px solid #ccd7c1; border-radius: 18px; padding: 26px; color: #263238; background: #fcfdfb; box-shadow: 0 30px 100px #16231c40; }
.portal-dialog:has(.portal-bilingual) { width: min(760px, calc(100% - 30px)); }
.portal-dialog::backdrop { background: #16231c88; backdrop-filter: blur(4px); }
.portal-dialog header h2 { font-size: 24px; margin: 0; }
.portal-dialog > .portal-form { margin-bottom: 0; }
.portal-file-viewer[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    width: min(1120px, calc(100% - 24px));
    height: 88vh;
    height: 88dvh;
    padding: clamp(12px, 2vw, 22px);
    overflow: hidden;
}
.portal-file-viewer header { gap: 10px; }
.portal-file-viewer header h2 { font-size: clamp(15px, 2vw, 21px); overflow-wrap: anywhere; }
.portal-file-viewer header button { flex-shrink: 0; padding: 4px 10px; min-height: 36px; font-size: 14px; }
.file-viewer-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-width: 0; min-height: 0; }
.file-viewer-toolbar, .file-viewer-tools, .file-viewer-tool-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.file-viewer-toolbar { justify-content: space-between; }
.file-viewer-tools { gap: 6px 12px; }
.file-viewer-tool, .file-viewer-sheet-select, .file-viewer-page-input {
    min-height: 34px;
    box-sizing: border-box;
    padding: 3px 8px;
    border: 1px solid #ccdabc;
    border-radius: 7px;
    color: #365023;
    background: #f7faf3;
    font: inherit;
    font-size: 14px;
}
.file-viewer-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 32px;
    cursor: pointer;
    text-decoration: none;
}
.file-viewer-tool:disabled { opacity: .48; cursor: default; }
.file-viewer-tool:hover:not(:disabled) { border-color: #91ae70; background: #ebf3df; }
.file-viewer-tool svg { width: 16px; height: 16px; }
.file-viewer-download { margin-inline-start: auto; }
.file-viewer-page-input { width: 58px; }
.file-viewer-sheet-select { max-width: min(360px, 70vw); }
.file-viewer-counter { color: #506353; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.file-viewer-counter:empty { display: none; }
.file-viewer-surface {
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 10px;
    border: 1px solid #d7e1d0;
    border-radius: 9px;
    background: #eef2eb;
}
.file-viewer-panel :focus-visible { outline: 2px solid #6a942e; outline-offset: 1px; }
.file-viewer-status { padding: 8px; margin: 0; color: #4f6256; }
.file-viewer-image { display: block; max-width: none; height: auto; margin-inline: auto; background: #fff; }
.file-viewer-paper {
    max-width: 810px;
    margin-inline: auto;
    padding: clamp(14px, 4vw, 44px);
    box-sizing: border-box;
    color: #23312c;
    background: #fff;
    overflow-wrap: anywhere;
}
.file-viewer-paper img { max-width: 100%; height: auto; }
.file-viewer-paper table { border-collapse: collapse; }
.file-viewer-paper :is(td, th) { border: 1px solid #d7e1d0; padding: 4px 8px; }
.file-viewer-plain { white-space: pre-wrap; }
.file-viewer-sheet { margin: 0; border-collapse: separate; border-spacing: 0; background: #fff; font-size: 13px; }
.file-viewer-sheet :is(th, td) { border: solid #dbe5d4; border-width: 0 1px 1px 0; padding: 5px 8px; }
.file-viewer-sheet thead { position: sticky; top: -10px; z-index: 1; background: #e6eedf; }
.file-viewer-sheet tbody th { position: sticky; left: -10px; background: #edf3e8; text-align: right; }
.file-viewer-sheet tbody td { min-width: 82px; max-width: 300px; overflow-wrap: anywhere; white-space: pre-wrap; }
.stage-template-picker > summary,
.stage-template-option {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #263238;
    cursor: pointer;
}
.stage-template-picker > summary {
    min-height: 24px;
    padding: 11px 13px;
    list-style: none;
    border: 1px solid #b9c7b0;
    border-radius: 8px;
    background: #fff;
    font-weight: 400;
}
.stage-template-picker > summary::-webkit-details-marker { display: none; }
.stage-template-picker > summary > span { display: flex; align-items: center; gap: 9px; }
.stage-template-picker > summary::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-inline-start: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    flex: none;
}
.stage-template-picker[open] > summary::after { transform: rotate(225deg); }
.stage-template-picker svg { width: 18px; height: 18px; color: #52743b; flex: none; }
.stage-template-options {
    max-height: min(42vh, 290px);
    overflow: auto;
    margin-top: 6px;
    padding: 4px;
    background: #fff;
    border: 1px solid #d8e2d0;
    border-radius: 8px;
}
.stage-template-options h3 { margin: 9px 9px 2px; color: #516252; font-size: 13px; }
.stage-template-option {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font: inherit;
    font-weight: 400;
    text-align: start;
}
.stage-template-option:hover, .stage-template-option[aria-pressed="true"] { background: #eef5e8; }
.stage-template-option:focus-visible { outline-offset: -3px; }
.portal-animation-picker { margin-top: 16px; }
.portal-animation-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 10px;
    margin-top: 16px;
}
.portal-animation-preview figure {
    display: grid;
    justify-items: center;
    margin: 0;
    padding: 10px;
    border: 1px solid #d8e2d0;
    border-radius: 10px;
}
.portal-animation-preview figcaption { text-align: center; font-weight: 600; }
.portal-busy .portal-button, .portal-busy .portal-tabs button { pointer-events: none; opacity: .65; }
.workflow-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.portal-notification { margin-top: 12px; gap: 10px; }
.portal-notification > :is(strong, p, .workflow-mail-attachments), .workflow-compose-layout {
    font-size: 14px;
    line-height: 1.4;
}
.portal-notification > .portal-muted { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.portal-notification > .portal-button { justify-self: start; }
.portal-notification-preview > .portal-button, form.portal-notification > .portal-button { justify-self: end; }
.workflow-compose-layout, .workflow-compose-main, .workflow-compose-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 12px;
}
@media (min-width: 900px) {
    .workflow-compose-layout { grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 20px; }
}
.workflow-compose-main > .portal-field { max-width: 190px; }
.portal-notification .portal-field { min-width: 0; gap: 4px; }
.portal-notification .portal-field :is(input, select, textarea) { min-height: 36px; padding: 7px 9px; line-height: 1.45; }
.portal-notification .portal-field textarea { height: clamp(120px, 20vh, 195px); min-height: 100px; }
.workflow-recipients { min-width: 0; margin: 0; border: 1px solid #d9e4cf; border-radius: 8px; padding: 4px 9px 6px; }
.workflow-recipients legend { font-weight: 600; }
.workflow-recipient-list { max-height: 120px; overflow: auto; }
.workflow-recipients label { display: flex; gap: 7px; align-items: flex-start; padding: 4px 0; overflow-wrap: anywhere; }
.workflow-recipients small { display: block; color: #58695f; font-size: 12px; }
.workflow-recipients input { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: #648933; }
.workflow-mail-preview {
    box-sizing: border-box;
    width: 100%;
    height: clamp(270px, 62vh, 560px);
    border: 1px solid #d9e4cf;
    border-radius: 10px;
    background: #f1f4ed;
}
.workflow-mail-upload { display: grid; gap: 6px; min-width: 0; }
.workflow-mail-upload .material-drop { padding: 12px 8px; }
.workflow-mail-upload .material-drop > svg { width: 22px; height: 22px; margin-bottom: 6px; }
.workflow-mail-upload .material-drop > strong { font-size: 16px; }
.workflow-mail-upload .material-drop p { margin: 4px 0 10px; font-size: 13px; }
.workflow-mail-upload .material-source-buttons { gap: 5px; }
.workflow-mail-upload .material-source-buttons .portal-button { min-height: 34px; padding: 5px 8px; font-size: 12px; }
.workflow-mail-upload > small { font-size: 12px; }
.workflow-mail-attachments ul { list-style: none; margin: 4px 0 0; padding: 0; }
.workflow-mail-attachments a { display: inline-flex; align-items: center; gap: 6px; color: #496638; overflow-wrap: anywhere; }
.workflow-mail-attachments svg, .workflow-mail-count svg { width: 15px; height: 15px; flex: none; }
.workflow-notification-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.workflow-notification-panel > header h3 { margin: 0; }
.workflow-notification-table .portal-button { min-height: 36px; padding: 6px 10px; gap: 6px; font-size: 13px; }
.workflow-notification-scroll { min-width: 0; overflow-x: auto; }
.workflow-notification-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.workflow-notification-table th, .workflow-notification-table td { padding: 9px 10px; text-align: start; vertical-align: top; }
.workflow-notification-table th { color: #465941; background: #edf3e5; }
.workflow-notification-table td { border-bottom: 1px solid #dce5d5; overflow-wrap: anywhere; }
.workflow-notification-table small { display: block; margin-top: 3px; color: #58695f; font-size: 12px; }
.workflow-notification-table .workflow-mail-count { display: flex; align-items: center; gap: 4px; }
.workflow-notification-table .portal-badge { padding: 3px 7px; font-size: 12px; }
.workflow-delivery-failed { color: #843b1c; background: #fff4ed; border-color: #dfb392; }
.workflow-delivery-sending { color: #805b1e; background: #fff6e6; border-color: #e9d8b2; }
.workflow-delivery-draft, .workflow-delivery-cancelled { color: #58645e; background: #f1f3ef; border-color: #dce0da; }
@media (max-width: 760px) {
    .portal-heading, .portal-section-heading { flex-direction: column; align-items: stretch; }
    .portal-card, .portal-panel { padding: 20px; }
    .portal-tabs { gap: 4px; }
    .portal-tabs button { padding: 10px; font-size: 15px; flex: 1; }
    .portal-dialog { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .portal-button, .portal-tabs button, .material-drop { transition: none; }
    .material-rail.is-moving::after { animation: none; background: none; }
}
@media (max-width: 600px) {
    .material-event { --node: 27px; column-gap: 7px; }
    .material-node svg { width: 16px; height: 16px; }
    .material-file-label { display: none; }
    .material-file-count { display: inline; }
    .material-files summary { gap: 3px; padding-inline: 5px; }
}
