:root {
    --portal-bg: #f3f1eb;
    --portal-surface: #fffdf8;
    --portal-text: #17342d;
    --portal-muted: #5f6f6a;
    --portal-line: #ddd4c6;
    --portal-brand: #1d6b52;
    --portal-brand-dark: #144b39;
    --portal-accent: #cda15b;
    --portal-danger: #9f3f33;
    --portal-shadow: 0 18px 45px rgba(25, 34, 30, 0.08);
    --portal-radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(205, 161, 91, 0.14), transparent 22%),
        linear-gradient(180deg, #f8f5ef 0%, var(--portal-bg) 100%);
    color: var(--portal-text);
}

a {
    color: inherit;
    text-decoration: none;
}

.portal-shell {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 52px;
}

.portal-topbar,
.portal-card,
.portal-hero,
.portal-admin-table {
    background: rgba(255, 253, 248, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(221, 212, 198, 0.9);
    box-shadow: var(--portal-shadow);
}

.portal-topbar,
.portal-hero,
.portal-card,
.portal-admin-table {
    border-radius: 22px;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    min-height: 154px;
    padding: 28px 32px;
    margin-bottom: 14px;
    background:
        radial-gradient(circle at 90% 0%, rgba(205, 161, 91, 0.12), transparent 36%),
        rgba(255, 253, 248, 0.94);
}

.portal-topbar-heading {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.portal-layout-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 17px;
    background: linear-gradient(145deg, var(--portal-brand), var(--portal-brand-dark));
    box-shadow: 0 12px 25px rgba(29, 107, 82, 0.2);
    color: #fff;
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 27px;
    font-weight: 700;
}

.portal-layout-logo {
    display: flex;
    align-items: center;
    width: 190px;
    min-height: 58px;
    flex: 0 0 190px;
}

.portal-layout-logo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
}

.portal-layout-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--portal-brand);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.portal-branding h1,
.portal-hero h1,
.portal-card h2,
.portal-admin-table h2 {
    margin: 0;
}

.portal-branding h1 {
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(30px, 3.3vw, 45px);
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.portal-branding p,
.portal-hero p,
.portal-card p,
.portal-muted {
    color: var(--portal-muted);
}

.portal-branding p {
    max-width: 720px;
    margin: 9px 0 0;
    font-size: 14px;
    line-height: 1.5;
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.portal-btn,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 13px;
    padding: 0 17px;
    background: var(--portal-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.portal-btn:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    background: var(--portal-brand-dark);
}

.portal-btn.secondary {
    background: rgba(255, 255, 255, 0.55);
    color: var(--portal-brand-dark);
    border: 1px solid var(--portal-line);
}

.portal-btn.secondary:hover {
    border-color: rgba(29, 107, 82, 0.35);
    background: rgba(29, 107, 82, 0.06);
}

.portal-admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 9px;
    border: 1px solid rgba(221, 212, 198, 0.9);
    border-radius: 17px;
    background: rgba(255, 253, 248, 0.78);
    box-shadow: 0 10px 28px rgba(25, 34, 30, 0.05);
}

.portal-admin-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.portal-admin-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 0 14px;
    border-radius: 11px;
    color: var(--portal-muted);
    font-size: 13px;
    font-weight: 800;
}

.portal-admin-nav a:hover,
.portal-admin-nav a.active {
    background: rgba(29, 107, 82, 0.09);
    color: var(--portal-brand-dark);
}

.portal-admin-nav a.active {
    box-shadow: inset 0 0 0 1px rgba(29, 107, 82, 0.08);
}

.portal-admin-nav .portal-admin-nav-exit {
    color: var(--portal-danger);
}

.portal-page-content {
    min-width: 0;
}

.portal-hero {
    padding: clamp(30px, 5vw, 52px);
    margin-bottom: 22px;
    background:
        linear-gradient(135deg, rgba(20, 75, 57, 0.98), rgba(29, 107, 82, 0.88)),
        var(--portal-brand-dark);
    color: #fff;
}

.portal-hero-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(29, 107, 82, 0.1);
    color: var(--portal-brand-dark);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-hero .portal-hero-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.portal-hero h1 {
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(34px, 5vw, 54px);
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.portal-hero p {
    max-width: 760px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.65;
}

.portal-grid {
    display: grid;
    gap: 20px;
}

.portal-grid.docs {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.portal-card {
    padding: 26px;
}

.portal-enterprise-list {
    align-items: stretch;
}

.portal-enterprise-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    gap: 30px;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.portal-enterprise-card:hover {
    transform: translateY(-3px);
    border-color: rgba(29, 107, 82, 0.22);
    box-shadow: 0 24px 52px rgba(25, 34, 30, 0.11);
}

.portal-enterprise-label {
    display: block;
    margin-bottom: 8px;
    color: var(--portal-brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-enterprise-card .portal-btn {
    align-self: flex-start;
}

.portal-catalog-hero {
    position: relative;
    overflow: hidden;
}

.portal-catalog-hero::after {
    position: absolute;
    width: 360px;
    height: 360px;
    top: -210px;
    right: -80px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    content: "";
}

.portal-catalog-help {
    display: flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    max-width: 760px;
    margin-top: 28px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    line-height: 1.5;
}

.portal-catalog-help strong {
    flex: 0 0 auto;
    color: #fff;
}

.portal-catalog-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 34px 4px 18px;
}

.portal-catalog-heading .portal-enterprise-label {
    margin-bottom: 7px;
}

.portal-catalog-heading h2 {
    margin: 0;
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -0.025em;
}

.portal-enterprise-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 20px;
}

.portal-enterprise-tile {
    display: flex;
    flex-direction: column;
    min-height: 430px;
    overflow: hidden;
    border: 1px solid rgba(221, 212, 198, 0.95);
    border-radius: 24px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 16px 38px rgba(23, 52, 45, 0.07);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.portal-enterprise-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(29, 107, 82, 0.28);
    box-shadow: 0 24px 52px rgba(23, 52, 45, 0.12);
}

.portal-enterprise-tile:focus-visible {
    outline: 3px solid rgba(29, 107, 82, 0.3);
    outline-offset: 4px;
}

.portal-enterprise-visual {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(20, 75, 57, 0.98), rgba(29, 107, 82, 0.78)),
        var(--portal-brand-dark);
}

.portal-enterprise-visual > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 280ms ease;
}

.portal-enterprise-tile:hover .portal-enterprise-visual > img {
    transform: scale(1.025);
}

.portal-enterprise-visual.is-logo {
    padding: 34px;
}

.portal-enterprise-visual.is-logo > img {
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.portal-enterprise-visual-placeholder {
    padding: 48px;
}

.portal-enterprise-visual-placeholder::before,
.portal-enterprise-visual-placeholder::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    content: "";
}

.portal-enterprise-visual-placeholder::before {
    width: 240px;
    height: 240px;
    top: -130px;
    right: -60px;
}

.portal-enterprise-visual-placeholder::after {
    width: 160px;
    height: 160px;
    top: -85px;
    right: -20px;
}

.portal-enterprise-visual-placeholder img {
    position: relative;
    z-index: 1;
    width: min(100%, 210px);
    height: auto;
    object-fit: contain;
}

.portal-enterprise-tile-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 25px 26px 27px;
}

.portal-enterprise-tile-content h2 {
    margin: 0;
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 25px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.portal-enterprise-tile-content p {
    margin: 11px 0 24px;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.6;
}

.portal-enterprise-tile-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    color: var(--portal-brand);
    font-size: 13px;
    font-weight: 900;
}

.portal-enterprise-tile-action span {
    font-size: 18px;
    transition: transform 180ms ease;
}

.portal-enterprise-tile:hover .portal-enterprise-tile-action span {
    transform: translateX(4px);
}

.portal-catalog-empty {
    text-align: center;
}

.portal-owner-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 10%, rgba(205, 161, 91, 0.22), transparent 28%),
        radial-gradient(circle at 90% 90%, rgba(29, 107, 82, 0.14), transparent 30%),
        #f2efe8;
}

.portal-owner-shell {
    display: grid;
    place-items: center;
    width: min(1180px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 0;
}

.portal-owner-card {
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(390px, 0.86fr);
    width: 100%;
    min-height: min(700px, calc(100vh - 80px));
    overflow: hidden;
    border: 1px solid rgba(221, 212, 198, 0.95);
    border-radius: 30px;
    background: var(--portal-surface);
    box-shadow: 0 32px 80px rgba(23, 52, 45, 0.14);
}

.portal-owner-media {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background:
        linear-gradient(150deg, rgba(20, 75, 57, 0.95), rgba(29, 107, 82, 0.72)),
        linear-gradient(45deg, #17342d, #8f774f);
}

.portal-owner-media::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(12, 34, 27, 0.35));
    content: "";
    pointer-events: none;
}

.portal-owner-media img {
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
}

.portal-owner-media.is-logo {
    display: grid;
    place-items: center;
    padding: clamp(34px, 6vw, 84px);
}

.portal-owner-media.is-logo::after {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 48%),
        linear-gradient(180deg, transparent, rgba(12, 34, 27, 0.18));
}

.portal-owner-media.is-logo img {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    height: auto;
    min-height: 0;
    max-height: 78%;
    border-radius: 20px;
    box-shadow: 0 24px 55px rgba(12, 34, 27, 0.24);
    object-fit: contain;
}

.portal-owner-media-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: end start;
    padding: 48px;
}

.portal-owner-media-placeholder::before,
.portal-owner-media-placeholder::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    content: "";
}

.portal-owner-media-placeholder::before {
    width: 420px;
    height: 420px;
    top: -150px;
    right: -110px;
}

.portal-owner-media-placeholder::after {
    width: 260px;
    height: 260px;
    top: -75px;
    right: -30px;
}

.portal-owner-media-placeholder span {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.portal-owner-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(42px, 6vw, 78px);
}

.portal-owner-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    color: var(--portal-brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.portal-owner-kicker i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--portal-accent);
    box-shadow: 0 0 0 5px rgba(205, 161, 91, 0.16);
}

.portal-owner-content h1 {
    max-width: 580px;
    margin: 0;
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(38px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

.portal-owner-content > div > p {
    max-width: 480px;
    margin: 24px 0 0;
    color: var(--portal-muted);
    font-size: 17px;
    line-height: 1.65;
}

.portal-owner-access {
    margin-top: 42px;
}

.portal-owner-access-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
}

.portal-owner-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    min-width: min(100%, 300px);
    min-height: 58px;
    padding: 0 22px 0 26px;
    border-radius: 16px;
    background: var(--portal-brand);
    box-shadow: 0 14px 30px rgba(29, 107, 82, 0.2);
    color: #fff;
    font-weight: 800;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.portal-owner-button:hover {
    transform: translateY(-2px);
    background: var(--portal-brand-dark);
    box-shadow: 0 18px 34px rgba(20, 75, 57, 0.24);
}

.portal-owner-button.secondary {
    border: 1px solid var(--portal-line);
    background: transparent;
    box-shadow: none;
    color: var(--portal-brand-dark);
}

.portal-owner-button.secondary:hover {
    border-color: rgba(29, 107, 82, 0.35);
    background: rgba(29, 107, 82, 0.06);
    box-shadow: none;
}

.portal-owner-button:focus-visible {
    outline: 3px solid rgba(205, 161, 91, 0.72);
    outline-offset: 4px;
}

.portal-owner-button span {
    font-size: 22px;
    font-weight: 400;
}

.portal-owner-access small {
    display: block;
    max-width: 330px;
    margin-top: 14px;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.5;
}

.portal-owner-help {
    margin-top: 44px;
    padding-top: 22px;
    border-top: 1px solid var(--portal-line);
    color: var(--portal-muted);
    font-size: 13px;
}

.portal-owner-help a {
    margin-left: 5px;
    color: var(--portal-brand-dark);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(29, 107, 82, 0.3);
    text-underline-offset: 3px;
}

.portal-owner-login-content {
    position: relative;
}

.portal-owner-login-content h1 {
    font-size: clamp(38px, 4.5vw, 56px);
}

.portal-owner-back {
    position: absolute;
    top: 34px;
    left: clamp(42px, 6vw, 78px);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--portal-muted);
    font-size: 13px;
    font-weight: 800;
}

.portal-owner-back:hover {
    color: var(--portal-brand-dark);
}

.portal-owner-form {
    display: grid;
    gap: 17px;
    margin-top: 34px;
}

.portal-owner-form .portal-alert {
    margin: 0 0 2px;
}

.portal-owner-form .portal-field {
    gap: 8px;
}

.portal-owner-form .portal-field label {
    color: var(--portal-brand-dark);
    font-size: 13px;
}

.portal-owner-form .portal-field input {
    min-height: 52px;
    border-radius: 14px;
    background: #fff;
    font-size: 16px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.portal-owner-form .portal-field input:focus {
    border-color: var(--portal-brand);
    box-shadow: 0 0 0 4px rgba(29, 107, 82, 0.1);
    outline: none;
}

.portal-owner-form .portal-owner-button {
    width: 100%;
    margin-top: 4px;
}

.portal-owner-login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.5;
}

.portal-owner-login-footer a {
    flex: 0 0 auto;
    color: var(--portal-brand-dark);
    font-weight: 800;
}

.portal-owner-library-shell {
    width: min(1180px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 34px 0 52px;
}

.portal-owner-library-header {
    display: grid;
    grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr);
    min-height: 310px;
    overflow: hidden;
    border: 1px solid rgba(221, 212, 198, 0.95);
    border-radius: 28px;
    background: var(--portal-surface);
    box-shadow: 0 28px 65px rgba(23, 52, 45, 0.12);
}

.portal-owner-library-media {
    min-height: 310px;
}

.portal-owner-library-media.is-logo {
    padding: 34px;
}

.portal-owner-library-media.is-logo img {
    max-height: 72%;
}

.portal-owner-library-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(38px, 5vw, 64px);
}

.portal-owner-library-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.portal-owner-library-topline .portal-owner-kicker {
    margin-bottom: 0;
}

.portal-owner-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--portal-line);
    border-radius: 999px;
    color: var(--portal-brand-dark);
    font-size: 13px;
    font-weight: 800;
}

.portal-owner-logout:hover {
    border-color: var(--portal-brand);
    background: rgba(29, 107, 82, 0.06);
}

.portal-owner-library-content h1 {
    max-width: 720px;
    margin: 0;
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(38px, 5vw, 60px);
    letter-spacing: -0.035em;
    line-height: 1.02;
}

.portal-owner-library-content > p {
    max-width: 560px;
    margin: 20px 0 0;
    color: var(--portal-muted);
    font-size: 16px;
    line-height: 1.6;
}

.portal-owner-library-main {
    margin-top: 36px;
}

.portal-owner-library-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 0 4px;
}

.portal-owner-library-label {
    display: block;
    margin-bottom: 7px;
    color: var(--portal-brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-owner-library-toolbar h2 {
    margin: 0;
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(30px, 4vw, 42px);
    letter-spacing: -0.025em;
}

.portal-owner-document-count {
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(29, 107, 82, 0.09);
    color: var(--portal-brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.portal-owner-document-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.portal-owner-document-card {
    display: flex;
    flex-direction: column;
    min-height: 310px;
    padding: 26px;
    border: 1px solid rgba(221, 212, 198, 0.95);
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 16px 38px rgba(23, 52, 45, 0.07);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.portal-owner-document-card:hover {
    transform: translateY(-3px);
    border-color: rgba(29, 107, 82, 0.25);
    box-shadow: 0 22px 46px rgba(23, 52, 45, 0.11);
}

.portal-owner-document-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.portal-owner-document-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    background: var(--portal-brand);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.portal-owner-document-category {
    overflow: hidden;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: right;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.portal-owner-document-card h3 {
    margin: 26px 0 0;
    color: var(--portal-brand-dark);
    font-size: 22px;
    line-height: 1.2;
}

.portal-owner-document-card > p {
    margin: 12px 0 24px;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.6;
}

.portal-owner-document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: auto;
}

.portal-owner-document-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid var(--portal-line);
    border-radius: 13px;
    color: var(--portal-brand-dark);
    font-size: 13px;
    font-weight: 800;
}

.portal-owner-document-button:hover {
    border-color: var(--portal-brand);
    background: rgba(29, 107, 82, 0.05);
}

.portal-owner-document-button.primary {
    border-color: var(--portal-brand);
    background: var(--portal-brand);
    color: #fff;
}

.portal-owner-document-button.primary:hover {
    background: var(--portal-brand-dark);
}

.portal-owner-library-empty {
    display: grid;
    justify-items: center;
    padding: 58px 24px;
    border: 1px dashed var(--portal-line);
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.7);
    text-align: center;
}

.portal-owner-library-empty h3 {
    margin: 20px 0 7px;
    color: var(--portal-brand-dark);
    font-size: 21px;
}

.portal-owner-library-empty p {
    max-width: 460px;
    margin: 0;
    color: var(--portal-muted);
}

.portal-owner-library-note {
    margin-top: 24px;
    padding: 20px 22px;
    border: 1px solid rgba(205, 161, 91, 0.2);
    border-radius: 18px;
    background: rgba(205, 161, 91, 0.1);
    color: var(--portal-brand-dark);
    font-size: 13px;
    line-height: 1.6;
}

.portal-doc-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--portal-brand) 0%, var(--portal-brand-dark) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.portal-doc-meta {
    font-size: 13px;
    color: var(--portal-muted);
    margin: 10px 0 14px;
}

.portal-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.portal-form {
    display: grid;
    gap: 18px;
}

.portal-field {
    display: grid;
    gap: 8px;
}

.portal-field label {
    color: var(--portal-brand-dark);
    font-size: 13px;
    font-weight: 800;
}

.portal-field input,
.portal-field textarea,
.portal-field select {
    width: 100%;
    min-height: 49px;
    padding: 13px 15px;
    border: 1px solid rgba(191, 181, 165, 0.82);
    border-radius: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.82);
    color: var(--portal-text);
    font: inherit;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.portal-field input:hover,
.portal-field textarea:hover,
.portal-field select:hover {
    border-color: rgba(29, 107, 82, 0.42);
}

.portal-field input:focus,
.portal-field textarea:focus,
.portal-field select:focus {
    border-color: var(--portal-brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 107, 82, 0.09);
}

.portal-field textarea {
    min-height: 124px;
    resize: vertical;
}

.portal-alert {
    margin-bottom: 18px;
    border-radius: 16px;
    padding: 16px 18px;
    background: rgba(255, 241, 239, 0.9);
    border: 1px solid rgba(159, 63, 51, 0.16);
    color: var(--portal-danger);
    font-size: 14px;
    line-height: 1.55;
}

.portal-toast {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 1000;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    width: min(470px, calc(100% - 32px));
    padding: 15px 14px 15px 16px;
    border: 1px solid rgba(159, 63, 51, 0.22);
    border-radius: 17px;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 22px 55px rgba(23, 52, 45, 0.2);
    color: var(--portal-text);
    animation: portal-toast-in 240ms ease-out both;
    transition: opacity 180ms ease, transform 180ms ease;
}

.portal-toast-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(159, 63, 51, 0.1);
    color: var(--portal-danger);
    font-size: 16px;
    font-weight: 900;
}

.portal-toast-content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.portal-toast-content strong {
    color: var(--portal-brand-dark);
    font-size: 13px;
}

.portal-toast-content span {
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.45;
}

.portal-toast-close {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--portal-muted);
    font-size: 20px;
    font-weight: 400;
}

.portal-toast-close:hover {
    transform: none;
    background: rgba(23, 52, 45, 0.06);
    color: var(--portal-brand-dark);
}

.portal-toast.is-leaving {
    animation: none;
    opacity: 0;
    transform: translate(-50%, 14px);
}

@keyframes portal-toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, 18px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.portal-notice {
    margin-bottom: 18px;
    border-radius: 16px;
    padding: 16px 18px;
    background: rgba(237, 247, 239, 0.92);
    border: 1px solid rgba(29, 107, 82, 0.2);
    color: var(--portal-brand-dark);
    font-size: 14px;
    line-height: 1.55;
}

.portal-admin-form {
    margin-bottom: 22px;
    padding: clamp(24px, 4vw, 36px);
}

.portal-admin-form > h2,
.portal-admin-table > h2,
.portal-login-card > h2 {
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(25px, 3vw, 32px);
    letter-spacing: -0.025em;
}

.portal-admin-form > h2 {
    margin-bottom: 20px;
}

.portal-section-kicker {
    display: block;
    margin-bottom: 9px;
    color: var(--portal-brand);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.portal-admin-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.portal-admin-summary .portal-card {
    display: grid;
    gap: 8px;
    min-height: 142px;
    padding: 25px 27px;
    box-shadow: 0 12px 30px rgba(25, 34, 30, 0.055);
}

.portal-admin-summary .portal-card span:last-child {
    color: var(--portal-muted);
    font-size: 13px;
    font-weight: 700;
}

.portal-admin-summary-value {
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(38px, 5vw, 54px);
    font-weight: 800;
    line-height: 1;
    color: var(--portal-brand-dark);
}

.portal-login-card {
    width: min(500px, 100%);
    margin: 42px auto 0;
    padding: clamp(28px, 5vw, 42px);
}

.portal-admin-login-layout .portal-shell {
    width: min(700px, calc(100% - 32px));
    padding-top: 42px;
}

.portal-admin-login-layout .portal-topbar {
    min-height: 0;
    margin-bottom: 18px;
    padding: 24px 28px;
}

.portal-admin-login-layout .portal-topbar-heading {
    gap: 18px;
}

.portal-admin-login-layout .portal-layout-logo {
    width: 160px;
    min-height: 42px;
    flex-basis: 160px;
}

.portal-admin-login-layout .portal-layout-logo img {
    max-height: 42px;
}

.portal-admin-login-layout .portal-branding h1 {
    font-size: clamp(28px, 4vw, 36px);
}

.portal-admin-login-layout .portal-branding p {
    margin-top: 7px;
    font-size: 13px;
}

.portal-admin-login-layout .portal-login-card {
    width: 100%;
    margin: 0;
    padding: 34px 38px 38px;
}

.portal-login-card > p {
    margin: 10px 0 26px;
    font-size: 14px;
    line-height: 1.6;
}

.portal-admin-login-form button {
    width: 100%;
    margin-top: 2px;
}

.portal-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
}

.portal-field.full,
.portal-form-actions {
    grid-column: 1 / -1;
}

.portal-form-actions,
.portal-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.portal-inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-inline-form input {
    width: 130px;
    min-height: 39px;
    padding: 8px 10px;
    border: 1px solid var(--portal-line);
    border-radius: 10px;
}

.portal-url-box {
    overflow-wrap: anywhere;
    margin: 16px 0;
    padding: 16px 18px;
    border: 1px dashed var(--portal-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--portal-brand-dark);
    font-size: 13px;
    line-height: 1.6;
}

.portal-contact-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-contact {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--portal-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
}

.portal-contact strong {
    color: var(--portal-brand-dark);
}

.portal-contact span {
    color: var(--portal-muted);
    overflow-wrap: anywhere;
}

.portal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.portal-check input {
    width: 18px;
    height: 18px;
}

.portal-admin-table {
    padding: clamp(22px, 4vw, 34px);
    overflow: auto;
}

table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--portal-line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--portal-muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

tbody tr {
    transition: background 150ms ease;
}

tbody tr:hover {
    background: rgba(29, 107, 82, 0.035);
}

td {
    color: var(--portal-text);
    font-size: 13px;
    line-height: 1.5;
}

td strong {
    color: var(--portal-brand-dark);
}

.portal-table-empty {
    padding: 38px 18px;
    color: var(--portal-muted);
    text-align: center;
}

.portal-table-empty strong {
    display: block;
    margin-bottom: 5px;
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 19px;
}

.portal-footer-note {
    margin-top: 18px;
    padding: 19px 21px;
    border: 1px solid rgba(205, 161, 91, 0.18);
    border-radius: 17px;
    background: rgba(205, 161, 91, 0.1);
    color: var(--portal-brand-dark);
    font-size: 13px;
    line-height: 1.6;
}

.portal-diagnostic-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: clamp(24px, 4vw, 34px);
}

.portal-diagnostic-summary h2 {
    margin: 0 0 8px;
    color: var(--portal-brand-dark);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(26px, 3vw, 34px);
}

.portal-diagnostic-summary p {
    margin: 0;
}

.portal-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-status.ok {
    color: var(--portal-brand-dark);
    background: #dff1e4;
}

.portal-status.aviso {
    color: #76531d;
    background: #f8ebcb;
}

.portal-status.erro {
    color: var(--portal-danger);
    background: #f8dfdb;
}

.portal-readiness-detail {
    display: grid;
    gap: 4px;
    margin-top: 9px;
    max-width: 230px;
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-readiness-detail span::before {
    content: "Pendente: ";
    color: #76531d;
    font-weight: 700;
}

.portal-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 16px 0 20px;
}

.portal-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 15px;
    border: 1px solid var(--portal-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--portal-muted);
    font-size: 14px;
}

.portal-checklist-item::before {
    content: "";
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--portal-accent);
}

.portal-checklist-item.ok {
    color: var(--portal-brand-dark);
}

.portal-checklist-item.ok::before {
    background: var(--portal-brand);
}

.portal-qr-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    gap: 22px;
    align-items: start;
}

.portal-qr-print-card {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: clamp(28px, 4vw, 42px);
    border: 1px solid var(--portal-line);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(205, 161, 91, 0.12), transparent 30%),
        #fff;
    box-shadow: var(--portal-shadow);
    text-align: center;
}

.portal-qr-print-card h2,
.portal-qr-print-card p {
    margin: 0;
}

.portal-qr-print-card p {
    color: var(--portal-muted);
    line-height: 1.55;
}

.portal-qr-print-kicker {
    color: var(--portal-brand);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-qrcode-preview {
    display: grid;
    place-items: center;
    width: min(100%, 290px);
    min-height: 290px;
    padding: 16px;
    border: 1px solid rgba(221, 212, 198, 0.75);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(25, 34, 30, 0.06);
}

.portal-qrcode-preview svg {
    display: block;
    width: 100%;
    height: auto;
}

.portal-qr-readable-url {
    max-width: 100%;
    color: var(--portal-brand-dark);
    font-size: 11px;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .portal-topbar {
        min-height: 0;
    }

    .portal-qr-workspace {
        grid-template-columns: 1fr;
    }

    .portal-owner-card {
        grid-template-columns: 1fr;
    }

    .portal-owner-media {
        min-height: 340px;
        max-height: 40vh;
    }

    .portal-owner-content {
        padding: 44px;
    }

    .portal-owner-library-header {
        grid-template-columns: 1fr;
    }

    .portal-owner-library-media {
        min-height: 260px;
        max-height: 34vh;
    }

    .portal-owner-document-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .portal-shell {
        width: calc(100% - 20px);
        padding-top: 16px;
    }

    .portal-topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 22px;
    }

    .portal-topbar-heading {
        align-items: flex-start;
        gap: 14px;
    }

    .portal-layout-mark {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 14px;
        font-size: 23px;
    }

    .portal-admin-layout .portal-topbar-heading {
        flex-direction: column;
    }

    .portal-catalog-layout .portal-topbar-heading {
        flex-direction: column;
    }

    .portal-layout-logo {
        width: 168px;
        min-height: 44px;
        flex-basis: auto;
    }

    .portal-layout-logo img {
        max-height: 44px;
    }

    .portal-branding h1 {
        font-size: clamp(29px, 9vw, 39px);
    }

    .portal-catalog-help {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .portal-catalog-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-enterprise-tile {
        min-height: 0;
    }

    .portal-admin-login-layout .portal-shell {
        width: calc(100% - 20px);
        padding-top: 16px;
    }

    .portal-admin-login-layout .portal-topbar {
        padding: 22px;
    }

    .portal-admin-login-layout .portal-login-card {
        padding: 28px 22px 30px;
    }

    .portal-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .portal-admin-nav {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }

    .portal-admin-nav-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .portal-admin-nav a {
        width: 100%;
    }

    .portal-admin-nav .portal-admin-nav-exit {
        border-top: 1px solid var(--portal-line);
    }

    .portal-diagnostic-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-hero,
    .portal-card,
    .portal-admin-table {
        padding: 20px 18px;
    }

    .portal-form-grid {
        grid-template-columns: 1fr;
    }

    .portal-admin-summary {
        grid-template-columns: 1fr;
    }

    .portal-admin-summary .portal-card {
        min-height: 0;
    }

    .portal-admin-table {
        border-radius: 18px;
    }

    .portal-inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-inline-form input {
        width: 100%;
    }

    .portal-table-empty {
        min-width: 280px;
    }

    .portal-owner-shell {
        width: calc(100% - 20px);
        padding: 10px 0;
    }

    .portal-owner-card {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 20px);
        border-radius: 22px;
    }

    .portal-owner-media {
        min-height: 33vh;
        max-height: 310px;
    }

    .portal-owner-media.is-logo {
        padding: 28px;
    }

    .portal-owner-media.is-logo img {
        max-height: 82%;
        border-radius: 14px;
    }

    .portal-owner-media-placeholder {
        padding: 26px;
    }

    .portal-owner-content {
        justify-content: flex-start;
        padding: 34px 26px 30px;
    }

    .portal-owner-kicker {
        margin-bottom: 18px;
    }

    .portal-owner-content h1 {
        font-size: clamp(34px, 11vw, 48px);
    }

    .portal-owner-content > div > p {
        margin-top: 18px;
        font-size: 15px;
    }

    .portal-owner-access {
        margin-top: 30px;
    }

    .portal-owner-button {
        width: 100%;
    }

    .portal-owner-access-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .portal-owner-help {
        margin-top: 30px;
    }

    .portal-owner-back {
        position: static;
        margin-bottom: 34px;
    }

    .portal-owner-login-content h1 {
        font-size: clamp(34px, 10vw, 46px);
    }

    .portal-owner-form {
        margin-top: 28px;
    }

    .portal-owner-login-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-owner-library-shell {
        width: calc(100% - 20px);
        padding: 10px 0 30px;
    }

    .portal-owner-library-header {
        border-radius: 22px;
    }

    .portal-owner-library-media {
        min-height: 220px;
        max-height: 270px;
    }

    .portal-owner-library-content {
        padding: 30px 24px 34px;
    }

    .portal-owner-library-topline {
        margin-bottom: 24px;
    }

    .portal-owner-library-content h1 {
        font-size: clamp(34px, 10vw, 46px);
    }

    .portal-owner-library-main {
        margin-top: 30px;
    }

    .portal-owner-library-toolbar {
        align-items: flex-start;
    }

    .portal-owner-library-toolbar h2 {
        font-size: 32px;
    }

    .portal-owner-document-card {
        min-height: 0;
        padding: 22px;
    }

    .portal-owner-document-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .portal-owner-document-actions > :only-child {
        grid-column: 1 / -1;
    }

    .portal-owner-library-note {
        margin-top: 18px;
    }
}

@media print {
    body.portal-print-qrcode {
        background: #fff;
    }

    body.portal-print-qrcode .portal-shell > * {
        display: none !important;
    }

    body.portal-print-qrcode .portal-shell,
    body.portal-print-qrcode .portal-qr-workspace,
    body.portal-print-qrcode .portal-qr-print-card {
        display: block !important;
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    body.portal-print-qrcode .portal-qr-workspace > :not(.portal-qr-print-card) {
        display: none !important;
    }

    body.portal-print-qrcode .portal-qr-print-card {
        width: 90mm;
        margin: 10mm auto;
        padding: 8mm;
    }

    body.portal-print-qrcode .portal-qrcode-preview {
        width: 55mm;
        min-height: 55mm;
        margin: 4mm auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-toast {
        animation: none;
        transition: none;
        transform: translateX(-50%);
    }
}
