:root {
    --bg: #eef2f4;
    --surface: #f8fafb;
    --surface-soft: #ffffff;
    --ink: #12222f;
    --muted: #5b6d7b;
    --border: #dbe4ea;
    --accent: #0d5f73;
    --accent-strong: #0a4b5b;
    --danger: #b74646;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(18, 34, 47, 0.06);
    --shadow-md: 0 10px 24px rgba(18, 34, 47, 0.08);
    --transition: 160ms ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    background: radial-gradient(circle at 12% 8%, #f7fbfc 0%, var(--bg) 45%, #e6ecef 100%);
    color: var(--ink);
}

.marketing-body {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.marketing-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid #d7e2e9;
    background: rgba(248, 252, 253, 0.95);
    position: sticky;
    top: 0;
    z-index: 30;
}

.marketing-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.marketing-nav > a:not(.button) {
    color: #2f5668;
    padding: 8px 10px;
    border-radius: 9px;
}

.marketing-nav > a:not(.button):hover {
    background: #e7f0f4;
}

.marketing-main {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 22px;
    display: grid;
    gap: 14px;
}

.marketing-hero {
    display: grid;
    gap: 18px;
}

.marketing-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 2.8vw, 2.5rem);
    line-height: 1.1;
}

.marketing-hero-lead {
    margin: 0;
    max-width: 40rem;
    line-height: 1.55;
    font-size: 1.02rem;
}

.marketing-kicker {
    display: inline-flex;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #cfe0e8;
    background: #f5fafc;
    color: #2d5b70;
    font-weight: 700;
    font-size: 0.82rem;
}

.marketing-hero-actions {
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.marketing-proof-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.marketing-proof-section {
    display: grid;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid #e4edf2;
    margin-top: 2px;
}

.marketing-proof-heading {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5b6d7b;
}

.marketing-proof-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.marketing-proof-grid > li {
    margin: 0;
    display: flex;
    min-width: 0;
}

.marketing-proof-grid .marketing-proof-chip {
    width: 100%;
}

.marketing-proof-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f0f6f9;
    border: 1px solid #d4e3eb;
    color: #2a4d5e;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    min-height: 3.25rem;
    box-sizing: border-box;
}

@media (max-width: 720px) {
    .marketing-proof-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 400px) {
    .marketing-proof-grid {
        grid-template-columns: 1fr;
    }

    .marketing-proof-chip {
        min-height: 0;
        justify-content: flex-start;
        text-align: left;
    }
}

.marketing-grid-steps {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.marketing-step-card {
    background: #fbfdfe;
}

.marketing-step-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.marketing-step-card p {
    margin: 0;
}

.marketing-final-cta {
    display: grid;
    gap: 10px;
}

.marketing-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Features page: fixed columns, equal-height rows, balanced cards */
.marketing-features-intro.panel {
    margin-bottom: 0;
}

.marketing-features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.marketing-feature-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    margin: 0;
}

.marketing-feature-card h2 {
    font-size: 1.05rem;
    line-height: 1.28;
    color: #153948;
    letter-spacing: -0.01em;
}

.marketing-feature-card p {
    margin: 0;
    flex: 1 1 auto;
    font-size: 0.94rem;
    line-height: 1.5;
    color: #3a5566;
}

.marketing-features-cta-actions {
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .marketing-features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .marketing-features-grid {
        grid-template-columns: 1fr;
    }
}

/* Home: same feature grid + equal-height “How it works” row */
.marketing-home-features {
    margin-top: 0;
}

.marketing-how-panel h2 {
    margin: 0 0 14px;
}

.marketing-how-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.marketing-how-grid .marketing-step-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    margin: 0;
}

.marketing-how-grid .marketing-step-card h3 {
    font-size: 1.02rem;
    color: #153948;
}

.marketing-how-grid .marketing-step-card p {
    margin: 0;
    flex: 1 1 auto;
    font-size: 0.94rem;
    line-height: 1.5;
    color: #3a5566;
}

@media (max-width: 900px) {
    .marketing-how-grid {
        grid-template-columns: 1fr;
    }
}

.marketing-audience-panel h2 {
    margin: 0 0 8px;
}

.marketing-audience-lead {
    margin: 0 0 10px;
}

.marketing-audience-list {
    margin-top: 0;
}

/* FAQ page — grouped sections, two-column cards */
.marketing-faq-intro h1 {
    margin: 0;
}

.marketing-faq-lead {
    margin: 0;
    max-width: 36rem;
    line-height: 1.55;
    font-size: 1.02rem;
}

.marketing-faq-page {
    display: grid;
    gap: 28px;
}

.marketing-faq-section {
    display: grid;
    gap: 14px;
}

.marketing-faq-section-title {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4edf2;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5b6d7b;
}

.marketing-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.marketing-faq-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    margin: 0;
}

.marketing-faq-question {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.3;
    font-weight: 700;
    color: #153948;
}

.marketing-faq-answer {
    flex: 1 1 auto;
}

.marketing-faq-answer p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.55;
    color: #3a5566;
}

.marketing-faq-answer p + p {
    margin-top: 10px;
}

@media (max-width: 800px) {
    .marketing-faq-grid {
        grid-template-columns: 1fr;
    }
}

.marketing-list {
    margin: 10px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.marketing-pricing-plans {
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .marketing-pricing-plans {
        grid-template-columns: 1fr;
    }
}

.marketing-pricing-plans .marketing-plan-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.marketing-plan-top {
    min-height: 32px;
    display: flex;
    align-items: flex-start;
    margin-bottom: 2px;
}

.marketing-plan-price {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.marketing-plan-price .muted {
    font-size: 0.92rem;
    font-weight: 500;
    margin-left: 4px;
}

.marketing-plan-lead {
    margin: 0 0 10px;
    min-height: 2.75rem;
}

.marketing-plan-features {
    flex: 1 1 auto;
    margin-top: 0;
}

.marketing-plan-footnote {
    margin: 14px 0 0;
    font-size: 0.88rem;
    line-height: 1.45;
    min-height: 3.1rem;
}

.marketing-plan-actions {
    margin-top: auto;
    padding-top: 16px;
    flex-direction: column;
    align-items: stretch;
}

.marketing-plan-actions .button {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.marketing-plan-card--plus {
    border-color: #c8dae3;
    background: linear-gradient(180deg, #fbfdfe 0%, #f4f9fb 100%);
    box-shadow: 0 10px 24px rgba(18, 34, 47, 0.08);
    position: relative;
}

.marketing-plan-badge {
    display: inline-block;
    margin: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0d5f73;
    background: rgba(13, 95, 115, 0.12);
    border: 1px solid rgba(13, 95, 115, 0.2);
}

.marketing-plan-badge--starter {
    color: #224051;
    background: rgba(34, 64, 81, 0.08);
    border-color: rgba(34, 64, 81, 0.16);
}

.marketing-compare-wrap {
    margin-top: 14px;
    border-radius: 12px;
    border: 1px solid #dbe4ea;
    background: #fff;
}

.marketing-compare-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.92rem;
    table-layout: fixed;
}

.marketing-compare-table thead th {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid #dbe4ea;
    background: #f4f9fb;
    color: #1a3d4c;
    font-weight: 700;
}

.marketing-compare-table thead th:first-child {
    width: 22%;
}

.marketing-compare-table thead th:nth-child(2),
.marketing-compare-table thead th:nth-child(3) {
    width: 39%;
}

.marketing-compare-table tbody th {
    text-align: left;
    font-weight: 600;
    color: #224051;
    padding: 12px 12px;
    border-bottom: 1px solid #e8eef2;
    vertical-align: top;
}

.marketing-compare-table td {
    padding: 12px 12px;
    border-bottom: 1px solid #e8eef2;
    vertical-align: top;
    color: #2c4353;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.marketing-compare-table tbody tr:last-child th,
.marketing-compare-table tbody tr:last-child td {
    border-bottom: none;
}

.marketing-compare-disclaimer {
    margin: 14px 0 0;
    line-height: 1.45;
}

.marketing-cost-snapshot {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 16px 0 18px;
}

.marketing-cost-snapshot__card {
    border-radius: 12px;
    border: 1px solid #dbe4ea;
    padding: 16px 18px;
    background: #fff;
}

.marketing-cost-snapshot__card--flux {
    border-color: #b8d4dc;
    background: linear-gradient(165deg, #f7fcfd 0%, #eef6f8 100%);
}

.marketing-cost-snapshot__card--adobe {
    background: #fafbfc;
}

.marketing-cost-snapshot__brand {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1a3d4c;
}

.marketing-cost-snapshot__price {
    margin: 0 0 8px;
    font-size: 1.35rem;
    line-height: 1.2;
    color: #12222f;
}

.marketing-cost-snapshot__price .muted {
    font-size: 0.88rem;
    font-weight: 500;
    margin-left: 4px;
}

.marketing-cost-snapshot__note {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
}

.marketing-cost-snapshot__note a {
    color: #0d5f73;
    font-weight: 600;
}

/* Sitewide footer (guest, app, marketing, share, editor) */
.site-footer {
    flex-shrink: 0;
    border-top: 1px solid #d7e2e9;
    color: #4b6778;
    padding: 12px 20px;
    font-size: 0.84rem;
    background: rgba(255, 255, 255, 0.88);
}

.marketing-body .site-footer {
    padding: 14px 24px;
    font-size: 0.9rem;
    background: rgba(248, 252, 253, 0.96);
}

.share-body .site-footer {
    background: #e5edf2;
    border-top-color: #cfdbe4;
}

.share-body .site-footer-inner {
    max-width: none;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    text-align: center;
}

.site-footer-copy {
    margin: 0;
}

.site-footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
}

.site-footer-links a {
    color: #2d4a5c;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.site-footer-links a:hover {
    color: #0c6175;
}

.site-footer-sep {
    color: #9bb0bd;
    user-select: none;
}

.site-footer--editor {
    padding: 6px 12px;
    font-size: 0.72rem;
    background: #f2f7f9;
    border-top: 1px solid #d7e2e9;
}

.site-footer--editor .site-footer-inner {
    gap: 8px 12px;
}

/* Auth pages: full-width strip, no white “card” — break out of body horizontal padding */
.site-footer--guest {
    flex-shrink: 0;
    align-self: stretch;
    width: calc(100% + 2 * var(--guest-pad, 24px));
    max-width: none;
    margin-left: calc(-1 * var(--guest-pad, 24px));
    margin-right: calc(-1 * var(--guest-pad, 24px));
    margin-top: 28px;
    padding: 16px var(--guest-pad, 24px) calc(var(--guest-pad, 24px) + 8px);
    box-sizing: border-box;
    background: transparent;
    border-top: 1px solid rgba(180, 198, 210, 0.55);
    color: #5d7384;
    font-size: 0.8rem;
}

.site-footer--guest .site-footer-inner {
    max-width: 640px;
}

.site-footer--guest .site-footer-links a {
    color: #4a6578;
}

.site-footer--guest .site-footer-links a:hover {
    color: #0c6175;
}

/* Mobile: legal footer hidden until user scrolls to bottom (not used in PDF editor chrome) */
@media (max-width: 768px) {
    .site-footer--mobile-reveal {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        width: 100%;
        max-width: none;
        margin: 0;
        align-self: unset;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 32px rgba(17, 41, 58, 0.14);
        padding: 12px max(16px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        transform: translateY(110%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.3s;
    }

    .site-footer--mobile-reveal.is-footer-revealed {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
    }

    .site-footer--guest.site-footer--mobile-reveal {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    @media (prefers-reduced-motion: reduce) {
        .site-footer--mobile-reveal {
            transition-duration: 0.01ms;
        }
    }
}

.marketing-legal {
    max-width: 720px;
    margin: 0 auto;
}

.marketing-legal-updated {
    margin-top: 0;
}

.marketing-legal-prose {
    margin-top: 18px;
    display: grid;
    gap: 14px;
    color: #355667;
    line-height: 1.55;
    font-size: 0.95rem;
}

.marketing-legal-prose h2 {
    margin: 20px 0 0;
    font-size: 1.05rem;
    color: #1f3d4d;
}

.marketing-legal-prose h2:first-of-type {
    margin-top: 8px;
}

.marketing-legal-prose p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.muted {
    color: var(--muted);
    margin: 0;
}

.guest-body {
    --guest-pad: 24px;
    min-height: 100vh;
    padding: var(--guest-pad) var(--guest-pad) 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.guest-page-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    min-height: 0;
}

.guest-page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.guest-page-main .auth-shell {
    width: 100%;
}

.auth-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.auth-brand {
    padding: 42px;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #f9fcfd 0%, #eaf2f5 100%);
    box-shadow: var(--shadow-md);
    border: 1px solid #d3dfe7;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    box-sizing: border-box;
}

.auth-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    min-height: 100%;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #0a5164, #1e7f90);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Otter icon: white mask overlay on the original gradient badge */
.logo-otter {
    position: relative;
}

.logo-otter::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/otter-mark-white.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 92% 92%;
    opacity: 1;
    mix-blend-mode: normal;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.22));
    pointer-events: none;
}

.auth-brand h1 {
    margin: 0;
    font-size: 2rem;
}

.auth-brand p {
    margin: 0;
    color: var(--muted);
    max-width: 28ch;
}

.auth-card h2 {
    margin: 0;
    font-size: 1.5rem;
}

.auth-form {
    margin-top: 20px;
    display: grid;
    gap: 14px;
}

.auth-form label,
.settings-form label,
.property-group label {
    display: grid;
    gap: 7px;
    font-size: 0.9rem;
    color: #2c4353;
}

input,
textarea,
select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fefefe;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    border-color: #7aa5b7;
    box-shadow: 0 0 0 3px rgba(56, 132, 153, 0.15);
}

.button {
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    white-space: nowrap;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--accent), #197a8d);
    color: #f7fbfc;
    box-shadow: 0 7px 20px rgba(12, 84, 101, 0.25);
}

.button-primary:hover {
    background: linear-gradient(135deg, var(--accent-strong), #146b7c);
}

.button-light {
    background: #eef4f7;
    color: #224051;
    border: 1px solid #d2e0e7;
}

.button-ghost {
    background: transparent;
    border: 1px solid #d2dee6;
    color: #305062;
}

.button-danger {
    background: #fdf0f0;
    color: var(--danger);
    border: 1px solid #f0c7c7;
}

.auth-foot {
    margin-bottom: 0;
    margin-top: 16px;
    color: var(--muted);
}

.auth-foot a {
    color: var(--accent);
    font-weight: 700;
}

.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.nav-backdrop {
    display: none;
}

.top-bar-leading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.top-bar-leading h1 {
    margin: 0;
    font-size: 1.3rem;
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

.nav-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #d2e0e7;
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.nav-burger:hover {
    background: #f2f7fa;
}

.nav-burger-lines {
    position: relative;
    width: 20px;
    height: 2px;
    background: #1e3d4d;
    border-radius: 1px;
    transition: background 0.2s;
}

.nav-burger-lines::before,
.nav-burger-lines::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: #1e3d4d;
    border-radius: 1px;
    transition: transform 0.25s ease, top 0.25s ease;
}

.nav-burger-lines::before {
    top: -7px;
}

.nav-burger-lines::after {
    top: 7px;
}

.nav-burger.is-active .nav-burger-lines {
    background: transparent;
}

.nav-burger.is-active .nav-burger-lines::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-burger.is-active .nav-burger-lines::after {
    top: 0;
    transform: rotate(-45deg);
}

.main-nav {
    padding: 20px;
    border-right: 1px solid #d7e1e8;
    background: linear-gradient(165deg, #f9fcfd 0%, #edf4f7 100%);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.main-nav nav {
    display: grid;
    gap: 8px;
}

.main-nav nav a {
    border-radius: 10px;
    padding: 10px 12px;
    color: #355164;
    transition: background var(--transition), color var(--transition);
}

.main-nav nav a.active,
.main-nav nav a:hover {
    background: #dbe8ee;
    color: #0f3d4d;
}

.logout-form {
    margin-top: auto;
}

.logout-form button {
    width: 100%;
    border: 1px solid #d8e1e9;
    border-radius: 10px;
    background: #fff;
    color: #324f60;
    padding: 10px 12px;
    cursor: pointer;
}

.guest-nav-actions {
    margin-top: auto;
    display: grid;
    gap: 8px;
}

.guest-nav-actions .button {
    width: 100%;
    text-align: center;
}

.content-area {
    padding: 24px;
    display: grid;
    gap: 16px;
    align-content: start;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(238, 242, 244, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 8px 10px;
}

.top-bar h1 {
    margin: 0;
    font-size: 1.3rem;
}

.top-user {
    font-size: 0.95rem;
    color: #355667;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-chip {
    border-radius: 999px;
    border: 1px solid #c4d8e2;
    background: #e8f2f7;
    color: #1e556b;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 9px;
    line-height: 1.1;
}

.panel {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel h2,
.panel h3,
.panel h4 {
    margin: 0;
}

.upload-panel {
    display: grid;
    gap: 16px;
}

.dropzone {
    border: 1px dashed #9eb7c3;
    border-radius: 14px;
    background: linear-gradient(145deg, #fbfdfe, #f1f7fa);
    min-height: 160px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #355767;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    padding: 18px;
}

.dropzone.dragging,
.dropzone:hover {
    border-color: #4b7f90;
    box-shadow: 0 14px 22px rgba(26, 87, 102, 0.15);
    transform: translateY(-2px);
}

.progress {
    margin-top: 14px;
    height: 8px;
    width: 220px;
    background: #dce7ed;
    border-radius: 999px;
    overflow: hidden;
}

.progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #177488, #3ba3b5);
    transition: width 120ms linear;
}

.upload-error-box {
    margin-top: 10px;
    border: 1px solid #f0c9c9;
    background: #fff5f5;
    border-radius: 12px;
    padding: 10px 12px;
    color: #8b2e2e;
    font-size: 0.9rem;
    display: grid;
    gap: 8px;
}

.upload-error-list {
    margin: 0;
    padding-left: 18px;
}

#word-dropzone {
    min-height: 140px;
}

.storage-panel {
    display: grid;
    gap: 10px;
}

.storage-inline {
    margin: 10px 0 6px;
    display: grid;
    gap: 6px;
}

.storage-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.storage-meter {
    width: 100%;
    height: 10px;
    background: #deeaef;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d1e0e7;
}

/* Stacked bar: files/versions (teal) + completed signed PDFs (violet) */
.storage-meter--stacked .storage-meter-fill {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    overflow: hidden;
}

.storage-meter-segment {
    display: block;
    min-width: 0;
    height: 100%;
}

.storage-meter-segment--files {
    background: linear-gradient(90deg, #0f7287, #27a1b3);
}

.storage-meter-segment--signed {
    background: linear-gradient(90deg, #5b3a7a, #8b5bb8);
}

.storage-meter-legend {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 0.78rem;
    color: #4b6778;
    line-height: 1.3;
}

.storage-meter-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.storage-meter-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(17, 41, 58, 0.12);
}

.storage-meter-legend-swatch--files {
    background: linear-gradient(135deg, #0f7287, #27a1b3);
}

.storage-meter-legend-swatch--signed {
    background: linear-gradient(135deg, #5b3a7a, #8b5bb8);
}

.hidden {
    display: none !important;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.doc-card {
    border: 1px solid #d9e3ea;
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    display: grid;
    gap: 10px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.doc-card header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.doc-card h4 {
    margin: 0;
    font-size: 1rem;
}

.doc-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-card footer {
    display: flex;
    gap: 8px;
}

.docs-title-row .muted {
    margin-top: 4px;
}

.recent-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.recent-doc-card {
    border: 1px solid #d7e2e9;
    background: linear-gradient(165deg, #ffffff 0%, #f8fbfd 100%);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    height: 100%;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    box-shadow: 0 4px 10px rgba(17, 41, 58, 0.06);
}

.recent-doc-card:hover {
    transform: translateY(-3px);
    border-color: #afc7d3;
    box-shadow: 0 14px 24px rgba(17, 41, 58, 0.12);
}

.recent-doc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.recent-doc-head-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.recent-doc-icon {
    border-radius: 10px;
    background: linear-gradient(135deg, #0c6175, #2b8ea0);
    color: #f0fbff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 6px 9px;
    line-height: 1;
}

.recent-doc-pages {
    font-size: 0.8rem;
    color: #315669;
    border: 1px solid #cfe0e8;
    background: #eff6f9;
    border-radius: 999px;
    padding: 5px 8px;
}

.recent-doc-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.25;
    min-width: 0;
    /* Reserve two lines so short titles don’t shrink card layout vs. wrapped titles */
    min-height: calc(1.15rem * 1.25 * 2);
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-doc-filename {
    margin: 0;
    min-width: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.35;
    min-height: calc(0.92rem * 1.35 * 2);
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-doc-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #577283;
    font-size: 0.8rem;
}

.recent-doc-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.recent-doc-actions .button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

/* --- Public share (view-only) viewer --- */
body.share-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #eef2f5;
}

.share-unavailable {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.share-unavailable-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 440px;
    gap: 16px;
}

.share-unavailable-inner h1 {
    margin: 0;
    line-height: 1.25;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
}

.share-unavailable-message {
    margin: 0;
    line-height: 1.55;
    max-width: 34em;
}

.share-unavailable-actions {
    margin-top: 8px;
}

.share-unavailable-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-height: 44px;
    padding: 12px 24px;
}

.share-unavailable-cta {
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 18px 20px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #dbe5eb;
    box-shadow: 0 4px 18px rgba(17, 41, 58, 0.07);
}

.share-unavailable-cta-text {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: #2c4555;
    line-height: 1.5;
}

.share-unavailable-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
}

.share-unavailable-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0c6175, #2b8ea0);
    color: #f0fbff;
    overflow: hidden;
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 0;
    flex-shrink: 0;
}

.share-viewer-root {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    background: #fff;
    box-shadow: none;
    border-bottom: 1px solid #dbe5eb;
}

.share-viewer-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #dbe5eb;
    background: linear-gradient(180deg, #fff 0%, #f8fbfd 100%);
}

.share-viewer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.share-viewer-home-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    outline-offset: 3px;
}

.share-viewer-home-link:focus-visible {
    outline: 2px solid #0c6175;
}

.share-viewer-home-link:hover .share-viewer-logo {
    filter: brightness(1.06);
}

.share-viewer-logo {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0c6175, #2b8ea0);
    color: #f0fbff;
    overflow: hidden;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Otter icon inside logo badges */
.logo-mark img,
.editor-logo img,
.share-viewer-logo img,
.share-unavailable-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.share-viewer-brand strong {
    display: block;
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(78vw, 920px);
}

.share-viewer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
}

/* Match editor header icon actions (print / export) — scoped so editor mobile rules don’t hide download link */
.share-viewer-actions .editor-header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 8px 12px;
    text-decoration: none;
    box-sizing: border-box;
}

.share-viewer-actions .editor-header-icon-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.share-viewer-cta {
    padding: 10px 18px;
    border-bottom: 1px solid #d4e8ee;
    background: linear-gradient(90deg, #e8f6fa 0%, #f0fafc 50%, #e8f4f8 100%);
}

.share-viewer-cta-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #2a4a5a;
    text-align: center;
}

.share-viewer-cta-text strong {
    font-weight: 700;
    color: #163949;
}

.share-viewer-cta-link {
    font-weight: 700;
    color: #0c6175;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.share-viewer-cta-link:hover {
    color: #094a5a;
}

.share-viewer-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #e8eef2;
    background: #fafcfd;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.share-viewer-toolbar::-webkit-scrollbar {
    height: 4px;
}

.share-viewer-toolbar::-webkit-scrollbar-thumb {
    background: #c5d6df;
    border-radius: 4px;
}

/* Keep controls on one row; spacer shrinks instead of forcing a wrap */
.share-toolbar-spacer {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
}

.share-viewer-toolbar > .share-tool-btn,
.share-viewer-toolbar > .icon-btn,
.share-viewer-toolbar > .share-page-indicator {
    flex-shrink: 0;
}

.share-page-indicator {
    font-size: 0.85rem;
    color: #315669;
    font-weight: 600;
    min-width: 56px;
    text-align: center;
}

.share-tool-btn {
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Match editor canvas zoom icon buttons inside public share/signed viewers */
.share-viewer-toolbar .icon-btn {
    width: 36px;
    min-width: 36px;
    box-sizing: border-box;
    padding: 7px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7e2e9;
    border-radius: 8px;
    background: #f8fcfe;
    color: #254a5a;
    cursor: pointer;
}

.share-viewer-toolbar .icon-btn:hover {
    background: #eef6f9;
    border-color: #c5d6df;
}

.share-viewer-toolbar .icon-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.share-canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 10px 12px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #eef2f5;
}

#share-pdf-canvas {
    display: block;
    box-shadow: 0 6px 24px rgba(17, 41, 58, 0.12);
    background: #fff;
}

.share-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    color: #315669;
    z-index: 50;
}

.share-loading.hidden {
    display: none;
}

.share-link-field input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
}

.share-modal-actions {
    flex-wrap: wrap;
    margin-top: 12px;
}

@media (max-width: 640px) {
    .share-viewer-brand strong {
        white-space: normal;
        max-width: 100%;
    }

    .share-viewer-cta-text {
        font-size: 0.82rem;
        text-align: left;
    }
}

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.activity-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border: 1px solid #dde5eb;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fefefe;
    color: #355667;
    font-size: 0.9rem;
    gap: 10px;
}

.activity-list li span {
    flex: 1 1 auto;
    min-width: 0;
}

.activity-detail {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.activity-list li time {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--muted);
}

.activity-list-full {
    gap: 10px;
}

.activity-show-all-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.activity-show-all-link:hover {
    text-decoration: underline;
}

.activity-pagination {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
    row-gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.activity-pagination-cell {
    display: flex;
    align-items: center;
}

.activity-pagination-cell--start {
    justify-content: flex-start;
}

.activity-pagination-cell--end {
    justify-content: flex-end;
}

/* Same box for real buttons and placeholders so the row stays balanced */
.activity-pagination .activity-pagination-btn {
    box-sizing: border-box;
    min-width: 7.25rem;
    min-height: 42px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    line-height: 1.2;
}

.activity-pagination .activity-pagination-btn.button {
    margin: 0;
}

.activity-pagination-btn--placeholder {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

.activity-page-status {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    white-space: nowrap;
}

.conversion-queue-panel {
    display: grid;
    gap: 10px;
}

.word-jobs-note {
    margin-top: -4px;
}

.word-jobs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.word-jobs-list li {
    border: 1px solid #dde5eb;
    border-radius: 10px;
    background: #fefefe;
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

.word-jobs-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.word-jobs-title {
    margin: 0;
    font-size: 0.95rem;
    color: #1f3d4c;
    font-weight: 700;
    word-break: break-word;
}

.word-jobs-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.word-jobs-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.word-jobs-status {
    border-radius: 999px;
    border: 1px solid #cfe0e8;
    background: #eef6f9;
    color: #2c5f75;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 9px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.word-jobs-status.status-queued {
    background: #eef6f9;
    border-color: #cfe0e8;
    color: #2c5f75;
}

.word-jobs-status.status-processing {
    background: #eef3ff;
    border-color: #d4ddff;
    color: #344f9f;
}

.word-jobs-status.status-completed {
    background: #eaf8ef;
    border-color: #c8e9d5;
    color: #1f6a45;
}

.word-jobs-status.status-failed {
    background: #fff2f2;
    border-color: #f0cbcb;
    color: #9f3f3f;
}

.flash {
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 0.92rem;
}

.flash.success {
    background: #e9f7ef;
    border: 1px solid #b9e2c8;
    color: #1f6e42;
}

.flash.error {
    background: #fceeee;
    border: 1px solid #f1c8c8;
    color: #9d3030;
}

.flash.warning {
    background: #fff8e6;
    border: 1px solid #e8d49a;
    color: #7a5a12;
}

.editor-flash-stack {
    position: relative;
    z-index: 50;
}

.flash--editor-top {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.guest-banner {
    border-radius: 12px;
    border: 1px solid #cfe0e8;
    background: linear-gradient(135deg, #f4fafc, #eaf3f7);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #2a5263;
}

.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: grid;
    gap: 8px;
}

.toast {
    background: #0f2430;
    color: #f2f8fb;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: var(--shadow-md);
    animation: toast-in 220ms ease;
}

@keyframes toast-in {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.table-wrap {
    overflow: auto;
}

.file-tools-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 12px 0 14px;
    flex-wrap: wrap;
}

.file-tools-right {
    margin-left: auto;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.file-bulk-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.folder-tools-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.folder-browser-grid {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.folder-browser-item {
    border: 1px solid #dde5eb;
    border-radius: 12px;
    background: #fdfefe;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.folder-browser-item.active {
    border-color: #9ebfcd;
    box-shadow: 0 0 0 2px rgba(40, 106, 128, 0.08);
}

.folder-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-open-link {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.folder-open-link strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.folder-tools-row .file-search-wrap input,
.folder-tools-row select,
#create-folder-btn {
    height: 42px;
}

.folder-color-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.folder-color-label {
    font-size: 0.85rem;
    color: #355667;
    white-space: nowrap;
    line-height: 1;
}

.folder-color-inline select {
    min-width: 120px;
}

.folder-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(15, 28, 38, 0.08);
}

.folder-viewing-note {
    margin-top: 0;
}

.folder-breadcrumb {
    margin-top: 2px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #48677a;
}

.folder-breadcrumb a {
    color: #2d6279;
}

.folder-breadcrumb strong {
    color: #173545;
}

.file-search-wrap {
    flex: 1 1 320px;
    min-width: 220px;
}

.file-search-wrap input {
    width: 100%;
}

.file-search-count {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.2;
}

.inline-select {
    display: grid;
    gap: 5px;
    min-width: 180px;
    font-size: 0.85rem;
    color: #355667;
}

.folder-manage-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.folder-manage-list li {
    border: 1px solid #dde5eb;
    border-radius: 10px;
    background: #fdfefe;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.folder-manage-list li div {
    display: grid;
    gap: 2px;
}

.pdf-lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* User PNGs (black on transparent) tinted via mask + background */
.pdf-lock-icon__graphic {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* Muted pastels — readable but not a focal point */
.pdf-lock-icon--open {
    color: #a8c4e4;
}

.pdf-lock-icon--open .pdf-lock-icon__graphic--open {
    background-color: #a8c4e4;
    -webkit-mask-image: url(../images/pdf-lock-open.png);
    mask-image: url(../images/pdf-lock-open.png);
}

.pdf-lock-icon--encrypted {
    color: #d9ca9e;
}

.pdf-lock-icon--encrypted .pdf-lock-icon__graphic--closed {
    background-color: #d9ca9e;
    -webkit-mask-image: url(../images/pdf-lock-closed.png);
    mask-image: url(../images/pdf-lock-closed.png);
}

.file-table-sec-col {
    width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    text-align: left;
    font-size: 0.92rem;
    border-bottom: 1px solid #e0e8ed;
    padding: 12px 10px;
}

.file-table tbody tr:hover {
    background: #f6fafc;
}

.file-table .actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.file-actions-icon-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Icon-only actions (file row + folder delete) — matches attached artwork */
.file-table .actions .file-action-icon,
.folder-actions .file-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    line-height: 0;
}

.file-table .actions .file-action-icon img,
.folder-actions .file-action-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.file-table .actions .button-danger.file-action-icon,
.folder-actions .button-danger.file-action-icon {
    padding: 0;
}

.file-table .actions .sig-req-inline-form {
    display: inline-flex;
    margin: 0;
}

.sig-req-section-title {
    font-size: 1.05rem;
    margin: 0 0 4px;
    color: #1a3d4c;
}

.sig-req-section-hint {
    margin: 0 0 14px;
}

.sig-inbox-title {
    margin: 0 0 6px;
    font-size: 1.12rem;
    color: #143847;
}

.sig-inbox-intro {
    margin: 0 0 14px;
    max-width: 48rem;
}

.sig-inbox-pending-panel {
    border-color: #b8d4e0;
    background: linear-gradient(180deg, #f9fcfe 0%, #f3f9fb 100%);
}

.sig-inbox-signed-panel {
    margin-bottom: 12px;
}

.sig-completed-panel-head {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.sig-completed-panel-title {
    margin: 0;
}

.sig-completed-search-field {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 320px;
    margin-left: auto;
}

.sig-req-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid #d5e1e8;
    font-size: 0.92rem;
    background: #fff;
    color: #1a3d4c;
}

.sig-req-search-input::placeholder {
    color: #7a94a3;
}

.sig-req-search-input:focus {
    outline: none;
    border-color: #5d95a6;
    box-shadow: 0 0 0 2px rgba(13, 95, 115, 0.12);
}

.sig-completed-intro {
    margin-top: 0;
}

.sig-req-delete-btn {
    color: #8b3a3a;
    border-color: #e8c9c9;
}

.sig-req-delete-btn:hover {
    background: #fff5f5;
    border-color: #dcb0b0;
    color: #6d2d2d;
}

.file-row-move {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-row-move select {
    min-width: 140px;
}

/* ---------- File Manager: mobile-friendly (narrow screens) ---------- */
#file-manager-root .folder-breadcrumb {
    flex-wrap: wrap;
    row-gap: 4px;
    max-width: 100%;
    line-height: 1.35;
}

@media (max-width: 768px) {
    #file-manager-root .panel-title-row {
        flex-direction: column;
        align-items: stretch;
    }

    #file-manager-root .panel-title-row h2 {
        width: 100%;
    }

    #file-manager-root .panel-title-row .row-gap {
        width: 100%;
        justify-content: stretch;
    }

    #file-manager-root .panel-title-row .row-gap .button {
        flex: 1 1 auto;
        min-height: 44px;
        justify-content: center;
    }

    #file-manager-root .storage-inline {
        padding: 12px;
        border-radius: 12px;
    }

    #file-manager-root .folder-tools-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #file-manager-root .folder-tools-row .file-search-wrap,
    #file-manager-root .folder-tools-row .folder-color-inline {
        min-width: 0;
        width: 100%;
        flex: 1 1 auto;
    }

    #file-manager-root .folder-tools-row #create-folder-btn {
        width: 100%;
        min-height: 44px;
    }

    #file-manager-root .folder-browser-grid {
        gap: 8px;
    }

    #file-manager-root .folder-browser-item {
        padding: 12px 14px;
    }

    /*
     * Folders with rename/delete: keep one tap target for the name + count on the left,
     * pin action icons to row 1 (same line as the folder title), not beside the file count.
     */
    #file-manager-root .folder-browser-item:has(.folder-actions) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        column-gap: 10px;
        row-gap: 6px;
        align-items: start;
    }

    #file-manager-root .folder-browser-item:has(.folder-actions) .folder-open-link {
        grid-column: 1;
        grid-row: 1 / span 2;
        display: grid;
        gap: 4px;
        min-width: 0;
        align-self: stretch;
    }

    #file-manager-root .folder-browser-item:has(.folder-actions) .folder-open-link strong {
        min-width: 0;
    }

    #file-manager-root .folder-browser-item:has(.folder-actions) .folder-actions {
        grid-column: 2;
        grid-row: 1;
        width: auto;
        flex-direction: row;
        justify-content: flex-end;
        align-items: flex-start;
        align-self: start;
        justify-self: end;
        gap: 10px;
    }

    #file-manager-root .file-tools-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #file-manager-root .file-tools-right {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #file-manager-root .file-tools-right .inline-select {
        min-width: 0;
        width: 100%;
    }

    #file-manager-root .file-tools-right .inline-select select {
        width: 100%;
        min-height: 44px;
    }

    #file-manager-root .file-tools-right > .button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    #file-manager-root .file-search-count {
        text-align: center;
        font-size: 0.88rem;
    }

    #file-manager-root .file-bulk-actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #file-manager-root .file-bulk-actions-row .button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    /* Replace wide table scroll with stacked “cards” per file */
    #file-manager-root .table-wrap {
        overflow: visible;
    }

    #file-manager-root .file-table {
        display: block;
        width: 100%;
    }

    /* Keep “select all” visible; hide other column headers (labels come from data-label on cells). */
    #file-manager-root .file-table thead {
        display: block;
        margin-bottom: 4px;
    }

    #file-manager-root .file-table thead tr {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 4px 2px 10px;
    }

    #file-manager-root .file-table thead th {
        display: none;
        border: none;
        padding: 0;
    }

    #file-manager-root .file-table thead th:first-child {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    #file-manager-root .file-table thead th:first-child::after {
        content: 'Select all';
        font-weight: 700;
        font-size: 0.8rem;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    #file-manager-root .file-table tbody {
        display: block;
    }

    /*
     * Card grid per row:
     * Row 1: checkbox + lock (lock flush right, same edge as values)
     * Row 2: name · row 3: pages | size · updated · actions
     * Uniform: fixed label width, full-width dividers, even vertical padding
     */
    #file-manager-root .file-table tbody tr {
        --file-card-pad-y: 11px;
        --file-card-label: clamp(4.5rem, 30vw, 6.5rem);
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto auto auto auto;
        column-gap: 12px;
        row-gap: 0;
        align-items: stretch;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 10px 14px 12px;
        margin-bottom: 12px;
        background: var(--surface-soft);
        box-shadow: var(--shadow-sm);
    }

    /* Full-width rule above pages/size (column-gap would break a border on cells) */
    #file-manager-root .file-table tbody tr::before {
        content: '';
        grid-column: 1 / -1;
        grid-row: 3;
        align-self: start;
        height: 0;
        border-top: 1px solid var(--border);
        margin: 0;
        padding: 0;
    }

    #file-manager-root .file-table tbody td {
        display: flex;
        align-items: center;
        gap: 10px;
        width: auto;
        max-width: none;
        min-width: 0;
        padding: var(--file-card-pad-y) 0;
        border: none;
        font-size: 0.92rem;
        text-align: right;
        vertical-align: middle;
    }

    /* Label + value: same label width, values share one right margin */
    #file-manager-root .file-table tbody td:nth-child(3),
    #file-manager-root .file-table tbody td:nth-child(4),
    #file-manager-root .file-table tbody td:nth-child(5),
    #file-manager-root .file-table tbody td:nth-child(6) {
        justify-content: flex-start;
    }

    #file-manager-root .file-table tbody td:nth-child(3)::before,
    #file-manager-root .file-table tbody td:nth-child(4)::before,
    #file-manager-root .file-table tbody td:nth-child(5)::before,
    #file-manager-root .file-table tbody td:nth-child(6)::before {
        flex: 0 0 var(--file-card-label);
        width: var(--file-card-label);
        max-width: var(--file-card-label);
        text-align: left;
        line-height: 1.3;
    }

    #file-manager-root .file-table tbody td:nth-child(3) .file-cell-value,
    #file-manager-root .file-table tbody td:nth-child(4) .file-cell-value,
    #file-manager-root .file-table tbody td:nth-child(5) .file-cell-value,
    #file-manager-root .file-table tbody td:nth-child(6) .file-cell-value {
        flex: 1 1 auto;
        min-width: 0;
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    #file-manager-root .file-table tbody td:nth-child(3) {
        align-items: flex-start;
    }

    #file-manager-root .file-table tbody td:nth-child(3) .file-cell-value {
        padding-top: 0.15em;
    }

    #file-manager-root .file-table tbody td:nth-child(4),
    #file-manager-root .file-table tbody td:nth-child(5),
    #file-manager-root .file-table tbody td:nth-child(6) {
        align-items: center;
    }

    #file-manager-root .file-table tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
        padding-top: 4px;
        padding-bottom: var(--file-card-pad-y);
    }

    #file-manager-root .file-table tbody td:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
        justify-self: stretch;
        padding-top: 4px;
        padding-bottom: var(--file-card-pad-y);
    }

    #file-manager-root .file-table tbody td:nth-child(3) {
        grid-column: 1 / -1;
        grid-row: 2;
        border-top: 1px solid var(--border);
        padding-top: var(--file-card-pad-y);
        padding-bottom: var(--file-card-pad-y);
    }

    #file-manager-root .file-table tbody td:nth-child(4) {
        grid-column: 1;
        grid-row: 3;
        padding-top: var(--file-card-pad-y);
        padding-bottom: var(--file-card-pad-y);
        padding-right: 6px;
    }

    #file-manager-root .file-table tbody td:nth-child(5) {
        grid-column: 2;
        grid-row: 3;
        padding-top: var(--file-card-pad-y);
        padding-bottom: var(--file-card-pad-y);
        padding-left: 6px;
    }

    #file-manager-root .file-table tbody td:nth-child(4),
    #file-manager-root .file-table tbody td:nth-child(5) {
        position: relative;
        z-index: 1;
        background: var(--surface-soft);
    }

    #file-manager-root .file-table tbody td:nth-child(6) {
        grid-column: 1 / -1;
        grid-row: 4;
        border-top: 1px solid var(--border);
        padding-top: var(--file-card-pad-y);
        padding-bottom: var(--file-card-pad-y);
    }

    #file-manager-root .file-table tbody td:nth-child(7) {
        grid-column: 1 / -1;
        grid-row: 5;
    }

    #file-manager-root .file-table tbody td:last-child {
        border-bottom: none;
    }

    #file-manager-root .file-table tbody td[data-label='Name'] {
        word-break: break-word;
    }

    #file-manager-root .file-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.7rem;
        letter-spacing: 0.05em;
        color: var(--muted);
        text-transform: uppercase;
        flex-shrink: 0;
    }

    #file-manager-root .file-table tbody td[data-label=""]::before {
        display: none;
    }

    #file-manager-root .file-table tbody td.file-table-select-cell {
        justify-content: flex-start;
    }

    #file-manager-root .file-table tbody td.file-table-sec-col[data-label=""] {
        justify-content: flex-end;
    }

    #file-manager-root .file-table tbody td.actions {
        display: block;
        padding-top: var(--file-card-pad-y);
        padding-bottom: 8px;
        padding-left: 0;
        padding-right: 0;
        margin-top: 0;
        border-top: 1px solid var(--border);
        text-align: left;
    }

    #file-manager-root .file-table tbody td.actions::before {
        content: 'Actions';
        display: block;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-bottom: 10px;
        font-weight: 700;
        font-size: 0.7rem;
        letter-spacing: 0.05em;
        color: var(--muted);
        text-transform: uppercase;
        text-align: left;
        line-height: 1.3;
    }

    /*
     * Equal columns so icons span the full card width (3 or 4 actions).
     * Scroll only if the row physically can’t fit (tiny viewports).
     */
    #file-manager-root .file-table tbody td.actions .file-actions-icon-row {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(36px, 1fr);
        align-items: center;
        justify-items: center;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-bottom: 2px;
        margin-bottom: 2px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    #file-manager-root .file-table tbody td.actions .file-actions-icon-row .file-action-icon {
        width: 40px;
        min-width: 40px;
        max-width: 100%;
        height: 40px;
    }

    /* Trash: text buttons, full-width two-up */
    #file-manager-root .file-table tbody td.actions .file-actions-icon-row:has(.restore-btn) {
        display: flex;
        flex-wrap: wrap;
        overflow-x: visible;
        justify-content: stretch;
        gap: 8px;
    }

    #file-manager-root .file-table tbody td.actions .file-actions-icon-row:has(.restore-btn) .button {
        flex: 1 1 calc(50% - 4px);
        min-width: min(100%, 140px);
        min-height: 44px;
        justify-content: center;
    }

    /* Move: folder + button on one line */
    #file-manager-root .file-table tbody td .file-row-move {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
        margin-top: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    #file-manager-root .file-table tbody td .file-row-move select {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        min-height: 44px;
        max-width: none;
    }

    #file-manager-root .file-table tbody td .file-row-move .move-btn {
        flex: 0 0 auto;
        min-height: 44px;
        padding-left: 14px;
        padding-right: 14px;
        white-space: nowrap;
    }
}

.empty-state,
.blank-state {
    border-radius: 14px;
    padding: 24px;
    border: 1px dashed #cad9e2;
    background: #f9fcfd;
    text-align: center;
}

/* Guest /sign/{token} pages: anchor action button toward bottom of the card */
.sign-landing-card {
    display: flex;
    flex-direction: column;
    min-height: min(320px, 52vh);
}

.sign-landing-card .sign-landing-body {
    flex: 0 0 auto;
}

.sign-landing-card .sign-landing-footer {
    margin-top: auto;
    padding-top: 28px;
}

.empty-illustration {
    width: 88px;
    height: 62px;
    border-radius: 14px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #dcebf2, #f7fcff);
    box-shadow: inset 0 -14px 20px rgba(140, 172, 184, 0.3);
}

.row-gap {
    display: flex;
    gap: 8px;
}

.centered-actions {
    justify-content: center;
}

.modal {
    border: 0;
    border-radius: 14px;
    padding: 0;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: hidden;
}

.modal::backdrop {
    background: rgba(8, 22, 30, 0.35);
}

.modal-body {
    padding: 18px;
    display: grid;
    gap: 14px;
}

.modal-body menu {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 560px) {
    .modal {
        width: calc(100vw - 20px);
        max-width: 100%;
        max-height: calc(100dvh - 20px);
    }

    .modal-body {
        padding: 16px;
    }

    .modal-body menu {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
    }

    .modal-body menu .button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
}

.signature-modal-body {
    box-sizing: border-box;
}

#signature-modal,
#settings-signature-draw-dialog {
    width: min(720px, calc(100vw - 24px));
}

#settings-signature-pad-canvas {
    width: 100%;
    height: 170px;
    display: block;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
}

.signature-modal-body .row-gap {
    flex-wrap: wrap;
}

.signature-pad-wrap {
    border: 1px solid #d4e1e8;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
}

#signature-pad-canvas {
    width: 100%;
    height: 170px;
    display: block;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
}

.eraser-preview {
    position: absolute;
    border: 1.5px solid rgba(31, 41, 55, 0.9);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    pointer-events: none;
    z-index: 12;
    display: none;
}

.inline-add-page-btn {
    position: absolute;
    z-index: 9;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #cfe1ea;
    background: rgba(255, 255, 255, 0.95);
    color: #35596a;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    display: none;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(18, 34, 47, 0.08);
}

.inline-add-page-btn:hover {
    border-color: #9dbdcb;
    background: #f7fbfd;
}

.settings-account-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.settings-account-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.settings-account-panel .settings-account-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
    color: var(--ink);
}

.settings-account-panel > p.muted {
    margin: 0 0 12px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.settings-account-panel .settings-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Same visual size for both account actions; pin to bottom when cards are equal height */
.settings-account-panel .settings-form > .button.button-primary {
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    font-size: 0.95rem;
}

.settings-form {
    display: grid;
    gap: 12px;
    max-width: 480px;
}

.settings-account-row .settings-form {
    max-width: none;
}

@media (max-width: 880px) {
    .settings-account-row {
        grid-template-columns: 1fr;
    }
}

.settings-signature-preview-wrap {
    margin: 12px 0;
    min-height: 100px;
    border: 1px dashed #c5d4dc;
    border-radius: 12px;
    padding: 16px;
    background: #f8fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-signature-preview {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.settings-signature-preview.hidden {
    display: none;
}

.settings-signature-empty {
    margin: 0;
    text-align: center;
}

.settings-signature-sync-note {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #8a5a16;
    background: #fff8eb;
    border: 1px solid #f0e0c2;
    border-radius: 10px;
    padding: 10px 12px;
}

.settings-signature-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 8px;
}

.settings-signature-actions > .button,
.settings-signature-actions > .settings-signature-upload-label {
    flex: 1 1 180px;
    min-width: 0;
}

.settings-signature-actions .button,
.settings-signature-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.settings-signature-upload-label {
    cursor: pointer;
    margin: 0;
}

.settings-signature-hint {
    margin: 0;
    font-size: 0.92rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.shortcut-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.shortcut-list li {
    display: flex;
    justify-content: space-between;
    border: 1px solid #dfe7ed;
    border-radius: 10px;
    padding: 10px 12px;
}

.admin-tool-grid {
    display: grid;
    gap: 14px;
}

.admin-tool-grid hr {
    border: 0;
    border-top: 1px solid #deeaef;
    width: 100%;
    margin: 2px 0;
}

.admin-user-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-user-table th,
.admin-user-table td {
    text-align: left;
    font-size: 0.92rem;
    border-bottom: 1px solid #e0e8ed;
    padding: 10px 8px;
}

.admin-user-table .right {
    text-align: right;
}

.admin-user-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    border: 1px solid #d3dfe7;
    background: #eef4f7;
    color: #294a5c;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.1;
}

.badge-admin {
    border-color: #b7d3df;
    background: #e2f1f8;
    color: #1b4f63;
}

.badge-standard {
    border-color: #d8e2e8;
    background: #f2f6f8;
    color: #3d5a6b;
}

kbd {
    font-family: inherit;
    background: #e9f1f5;
    border: 1px solid #cedce5;
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 700;
}

.editor-shell {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #edf2f5;
    display: grid;
    grid-template-rows: auto 1fr auto;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.editor-header {
    height: 64px;
    border-bottom: 1px solid #d7e2e9;
    background: #f8fbfd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-home-link {
    display: inline-flex;
    border-radius: 10px;
    transition: transform var(--transition), filter var(--transition);
}

.editor-home-link:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.editor-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f6073, #247f8f);
    color: #fff;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.editor-title small {
    color: var(--muted);
}

.editor-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.editor-actions .editor-header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 8px 12px;
}

.editor-actions .editor-header-icon-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.editor-actions .button-primary.editor-header-icon-btn img {
    filter: brightness(0) invert(1);
}

.guest-editor-chip {
    border-radius: 999px;
    border: 1px solid #c7dce7;
    background: #eef7fb;
    color: #2a5a70;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.editor-body {
    display: grid;
    grid-template-columns: 220px 1fr 290px;
    min-height: 0;
    min-width: 0;
}

.thumb-sidebar,
.property-sidebar {
    background: #f7fbfd;
    border-right: 1px solid #dbe5eb;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
}

.property-sidebar {
    border-right: 0;
    border-left: 1px solid #dbe5eb;
    padding: 14px 12px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.thumb-sidebar .split-group {
    margin-bottom: 6px;
    padding-bottom: 8px;
}

.thumb-sidebar .panel-head {
    margin-top: 0;
    margin-bottom: 4px;
}

.thumb-sidebar .panel-head h4 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.2;
    color: #1a3d4c;
}

.thumb-list {
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
    /* Don’t use overflow-x: hidden here — it forces overflow-y to clip and
       cuts off the top border when .thumb-item uses transform (active page). */
    overflow: visible;
    padding-top: 2px;
}

.thumb-item {
    border-radius: 10px;
    border: 1px solid #d7e3ea;
    background: #fff;
    padding: 8px;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
    min-width: 0;
}

.thumb-item:hover,
.thumb-item.active {
    border-color: #5d95a6;
    box-shadow: 0 2px 12px rgba(18, 34, 47, 0.08);
}

.thumb-canvas-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2eaef;
    background: #f6fafc;
    line-height: 0;
}

.thumb-item canvas {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
    border: 0;
    border-radius: 0;
}

.thumb-item span {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #466273;
}

.thumb-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #d9e4ea;
    background: rgba(255, 255, 255, 0.96);
    color: #45606f;
    font-size: 0.74rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.thumb-delete-btn:hover {
    border-color: #c9d8e1;
    background: #fff;
    color: #243f4f;
}

.thumb-add-page {
    display: grid;
    place-items: center;
    min-height: 47px;
    gap: 4px;
    border-style: dashed;
    color: #35596a;
}

.thumb-add-page .thumb-add-icon {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.canvas-area {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 10px;
    padding: 12px;
    min-height: 0;
    min-width: 0;
}

.floating-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #d9e5ec;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    width: 100%;
}

.floating-toolbar button,
.canvas-controls button {
    border: 1px solid #d7e2e9;
    border-radius: 8px;
    background: #f8fcfe;
    padding: 7px 10px;
    color: #254a5a;
    cursor: pointer;
}

.canvas-controls .icon-btn {
    width: 36px;
    min-width: 36px;
    padding: 7px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.canvas-controls .icon-btn svg {
    display: block;
}

.canvas-controls .icon-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.canvas-controls .icon-btn .icon-flip-x {
    transform: scaleX(-1);
}

.floating-toolbar button.active {
    background: #e1eef4;
    border-color: #8cb0bf;
    color: #123c4b;
}

.canvas-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.canvas-controls input[type="search"] {
    width: min(260px, 100%);
    background: #fff;
}

.mobile-panel-toggle {
    display: none;
}

.canvas-wrap {
    min-height: 0;
    overflow: auto;
    border: 1px solid #d5e1e8;
    border-radius: 14px;
    background: #e6edf2;
    display: grid;
    place-items: center;
    position: relative;
    padding: 22px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
}

#pdf-canvas {
    position: absolute;
    top: 24px;
    left: 24px;
    transform: none;
    border-radius: 4px;
}

#pdf-canvas {
    box-shadow: 0 12px 26px rgba(20, 39, 54, 0.15);
}

.canvas-container {
    position: absolute;
    top: 24px;
    left: 24px;
    transform: none;
}

.canvas-container canvas {
    border-radius: 4px;
}

.loading-layer {
    position: absolute;
    inset: 0;
    background: rgba(240, 246, 249, 0.86);
    display: grid;
    place-items: center;
    color: #36596a;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.property-group {
    border-top: 1px solid #dce6ec;
    padding-top: 10px;
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.property-sidebar .property-group:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.property-group h5 {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5c7381;
}

.property-group p {
    margin: 0;
    color: #425f70;
    font-size: 0.86rem;
    line-height: 1.35;
}

.property-group label {
    gap: 4px;
}

#tool-color {
    width: 56px;
    height: 28px;
    padding: 2px 6px;
}

#tool-opacity,
#tool-stroke {
    margin: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#tool-opacity:focus,
#tool-stroke:focus {
    box-shadow: none;
}

.text-style-row {
    gap: 6px;
}

.text-style-row .text-style-btn {
    flex: 1;
    padding: 6px 10px;
}

.text-style-row .text-style-btn.active {
    background: #e1eef4;
    border-color: #8cb0bf;
    color: #123c4b;
}

.editor-edit-locked .locked-panel {
    opacity: 0.55;
}

.editor-edit-locked .locked-canvas #annotation-canvas,
.editor-edit-locked .locked-canvas .canvas-container {
    pointer-events: none;
}

.version-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    max-height: clamp(260px, 48vh, 620px);
    overflow: auto;
}

.versions-group {
    gap: 6px;
}

.split-group {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
    border-bottom: 1px solid #dce6ec;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.version-list li {
    background: #fff;
    border: 1px solid #dbe6ec;
    border-radius: 9px;
    padding: 9px 10px;
    display: grid;
    gap: 4px;
}

.version-list .version-label {
    font-size: 0.98rem;
    line-height: 1.2;
    color: #1e3d4c;
}

.version-list .version-meta {
    font-size: 0.76rem;
    color: var(--muted);
}

.version-list .version-restore-btn {
    justify-self: start;
    padding: 5px 10px;
    min-height: auto;
    font-size: 0.82rem;
}

#restore-original-btn {
    width: 100%;
}

@media (max-width: 1200px) {
    .editor-body {
        grid-template-columns: 180px 1fr 250px;
    }
}

@media (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 88px 1fr;
    }

    .main-nav {
        padding: 14px 10px;
    }

    .brand-link span:last-child {
        display: none;
    }

    .main-nav nav a,
    .logout-form button {
        font-size: 0.82rem;
    }

    .main-nav nav a {
        width: 100%;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .guest-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .recent-doc-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .editor-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .thumb-sidebar,
    .property-sidebar {
        border: 0;
        border-top: 1px solid #dbe5eb;
    }

    .thumb-list {
        grid-template-columns: none;
        overflow: auto;
        grid-auto-flow: column;
        grid-auto-columns: minmax(104px, 1fr);
        scroll-snap-type: x mandatory;
    }

    .thumb-item {
        scroll-snap-align: start;
    }

    .file-tools-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .marketing-top {
        padding: 10px 14px;
        position: static;
        flex-direction: column;
        align-items: flex-start;
    }

    .marketing-nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .marketing-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .marketing-main {
        padding: 14px;
    }

    .marketing-body .site-footer {
        padding: 12px 14px;
    }

    .site-footer-inner {
        flex-direction: column;
        gap: 8px;
    }

    .app-shell {
        display: block;
        position: relative;
    }

    .nav-burger {
        display: inline-flex;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 205;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(17, 41, 58, 0.42);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        appearance: none;
    }

    .nav-backdrop[hidden] {
        display: none !important;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 88vw);
        height: 100vh;
        height: 100dvh;
        max-height: none;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        z-index: 210;
        margin: 0;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        border-right: 1px solid #d7e1e8;
        border-bottom: none;
        padding: max(14px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        box-shadow: 6px 0 36px rgba(17, 41, 58, 0.15);
    }

    /* Keep the link stack compact; only the logout/actions block pins to the bottom */
    .main-nav > .brand-link {
        flex: 0 0 auto;
    }

    .main-nav > nav {
        flex: 0 0 auto;
        min-height: 0;
    }

    .app-shell.is-nav-open .main-nav {
        transform: translateX(0);
    }

    .brand-link span:last-child,
    .main-nav nav a,
    .logout-form button {
        font-size: 0.9rem;
    }

    .brand-link span:last-child {
        display: inline;
    }

    .main-nav nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
        overflow: visible;
        padding-bottom: 0;
    }

    .main-nav nav a {
        white-space: normal;
        width: 100%;
        flex: 0 0 auto;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
    }

    .logout-form {
        margin-top: auto;
        padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    }

    .logout-form button {
        width: 100%;
        padding: 10px 12px;
    }

    .guest-nav-actions {
        margin-top: auto;
        grid-template-columns: 1fr;
        padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    }

    html.app-nav-open {
        overflow: hidden;
    }

    @media (prefers-reduced-motion: reduce) {
        .main-nav {
            transition: none;
        }

        .nav-burger-lines::before,
        .nav-burger-lines::after {
            transition: none;
        }
    }

    .content-area {
        padding: 14px;
        gap: 12px;
    }

    .top-bar {
        position: static;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        background: transparent;
        backdrop-filter: none;
        padding: 0;
    }

    .top-user {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .panel {
        padding: 14px;
    }

    .panel-title-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .guest-banner .row-gap,
    .row-gap {
        flex-wrap: wrap;
    }

    .word-jobs-main {
        flex-direction: column;
    }

    .word-jobs-actions {
        width: 100%;
    }

    .guest-banner .row-gap .button {
        flex: 1 1 auto;
    }

    .card-grid,
    .recent-doc-grid {
        grid-template-columns: 1fr;
    }

    .file-tools-row,
    .folder-tools-row {
        align-items: stretch;
    }

    .file-search-wrap {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .file-tools-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .file-search-count {
        width: 100%;
    }

    .folder-color-inline {
        min-height: 42px;
    }

    .folder-browser-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .folder-actions {
        width: 100%;
    }

    .folder-actions .button:not(.file-action-icon) {
        flex: 1 1 auto;
    }

    .folder-actions .file-action-icon {
        flex: 0 0 auto;
    }

    .table-wrap {
        overflow-x: auto;
    }

    .file-table,
    .admin-user-table {
        min-width: 0;
        width: 100%;
    }

    .file-table th,
    .file-table td {
        padding: 10px 8px;
        font-size: 0.86rem;
    }

    .file-table .actions {
        min-width: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .file-row-move {
        width: 100%;
    }

    .file-row-move select {
        flex: 1 1 auto;
        min-width: 120px;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-brand {
        padding: 24px;
        min-height: auto;
    }

    .editor-header {
        height: auto;
        padding: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .editor-title {
        width: 100%;
        min-width: 0;
    }

    .editor-title > div {
        min-width: 0;
    }

    .editor-title strong,
    .editor-title small {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .editor-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .editor-actions::-webkit-scrollbar {
        display: none;
    }

    .editor-actions > * {
        min-width: 0;
        flex-shrink: 0;
    }

    /* Icon actions: one row, equal slots (Rename / Print / Export / Share / Save) */
    .editor-actions .editor-header-icon-btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        width: auto;
        min-height: 40px;
        padding: 6px 2px;
    }

    .editor-actions .editor-header-icon-btn img {
        width: 22px;
        height: 22px;
    }

    /* Public share / signed PDF viewers: same icon buttons as editor */
    .share-viewer-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .share-viewer-brand {
        width: 100%;
    }

    .share-viewer-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .share-viewer-actions .editor-header-icon-btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        min-height: 40px;
        padding: 6px 8px;
    }

    .share-viewer-actions .editor-header-icon-btn img {
        width: 22px;
        height: 22px;
    }

    .editor-actions .button:not(.editor-header-icon-btn) {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 0.86rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .editor-actions .guest-editor-chip,
    .editor-actions a.button.button-light {
        display: none;
    }

    /* Mobile: canvas fills the middle; Pages/Properties are bottom sheets */
    .editor-body {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        grid-template-columns: unset;
        grid-template-rows: unset;
    }

    .canvas-area {
        flex: 1;
        min-height: 0;
        order: unset;
        padding: 8px;
        gap: 8px;
        display: grid;
        grid-template-rows: auto auto minmax(200px, 1fr);
    }

    .canvas-wrap {
        min-height: 0;
        padding: 8px;
    }

    .floating-toolbar,
    .canvas-controls {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .floating-toolbar button,
    .canvas-controls button {
        flex: 0 0 auto;
        scroll-snap-align: start;
        min-height: 40px;
        min-width: 40px;
    }

    .canvas-controls .icon-btn {
        width: 44px;
        min-width: 44px;
    }

    .canvas-controls input[type="search"] {
        flex: 0 0 auto;
        width: min(200px, 42vw);
        min-width: 120px;
    }

    .mobile-panel-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-height: 40px;
        padding-left: 12px;
        padding-right: 12px;
        font-weight: 700;
    }

    .editor-mobile-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 38;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(17, 41, 58, 0.45);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        appearance: none;
    }

    .editor-mobile-backdrop:not([hidden]) {
        display: block;
    }

    .thumb-sidebar,
    .property-sidebar {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 42;
        max-height: min(52dvh, 520px);
        margin: 0;
        border-radius: 16px 16px 0 0;
        border-top: 1px solid #c5d8e3;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        box-shadow: 0 -10px 36px rgba(17, 41, 58, 0.2);
        overflow-x: hidden;
        overflow-y: auto;
        padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
        animation: editor-mobile-sheet-in 0.22s ease-out;
    }

    .thumb-sidebar::before,
    .property-sidebar::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 12px;
        border-radius: 999px;
        background: #c5d8e3;
    }

    @keyframes editor-mobile-sheet-in {
        from {
            transform: translateY(100%);
            opacity: 0.85;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .editor-shell.show-mobile-pages .thumb-sidebar,
    .editor-shell.show-mobile-properties .property-sidebar {
        display: block;
    }

    .editor-shell.show-mobile-pages #mobile-pages-toggle,
    .editor-shell.show-mobile-properties #mobile-properties-toggle {
        background: #e1eef4;
        border-color: #8cb0bf;
        color: #123c4b;
    }

    #pdf-canvas,
    .canvas-container {
        top: 8px;
        left: 8px;
    }

    /* Sign / prepare PDF viewer: fill space, wrap toolbar so nothing is clipped off-screen */
    .sig-prep-shell .canvas-area {
        grid-template-rows: auto 1fr;
        min-height: 0;
    }

    .sig-prep-shell .canvas-controls {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 6px;
        column-gap: 6px;
        overflow-x: visible;
        padding-bottom: 2px;
        max-width: 100%;
    }

    .sig-prep-shell .sig-canvas-controls-spacer {
        display: none;
        flex: 0 0 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        overflow: hidden;
    }

    .sig-prep-shell .canvas-controls .button.button-light {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 0.8rem;
    }

    .sig-prep-shell .sig-page-indicator {
        min-width: 3.25rem;
    }

    /* Public sign link: keep Home visible (default mobile editor hides text buttons in the header). */
    .sig-sign-shell .editor-actions a.button.button-light {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.86rem;
    }
}

html.editor-mobile-panel-open,
html.editor-mobile-panel-open body {
    overflow: hidden;
}

@media (max-width: 640px) {
    .guest-body {
        --guest-pad: 12px;
        padding: var(--guest-pad) var(--guest-pad) 0;
    }

    .guest-page-main {
        align-items: flex-start;
    }

    .auth-shell {
        gap: 12px;
    }

    .auth-brand {
        order: 2;
        padding: 18px;
    }

    .auth-card {
        order: 1;
    }

    .marketing-hero-actions {
        display: grid;
        gap: 8px;
        width: 100%;
    }

    .marketing-hero-actions .button {
        width: 100%;
        text-align: center;
    }

    .main-nav nav {
        gap: 6px;
    }

    .editor-actions .button:not(.editor-header-icon-btn) {
        flex: 1 1 100%;
    }

    .sig-sign-shell .editor-actions a.button.button-light {
        flex: 0 0 auto;
    }

    .thumb-list {
        grid-auto-columns: minmax(86px, 1fr);
        gap: 8px;
    }
}

@media (max-width: 560px) {
    .marketing-nav {
        gap: 6px;
    }

    .marketing-nav .button {
        padding: 8px 10px;
    }

    .top-bar h1 {
        font-size: 1.15rem;
    }

    .panel {
        padding: 12px;
    }

    .button {
        padding: 9px 12px;
    }

    .guest-nav-actions {
        grid-template-columns: 1fr;
    }

    .folder-color-inline {
        width: 100%;
        justify-content: space-between;
    }

    .folder-color-inline select {
        flex: 1 1 auto;
    }

    #create-folder-btn {
        width: 100%;
    }

    .file-tools-right .button {
        flex: 1 1 auto;
    }

    .inline-select {
        width: 100%;
    }

    .inline-select select {
        width: 100%;
    }

    .storage-inline-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .editor-actions .button:not(.editor-header-icon-btn) {
        width: 100%;
    }

    .editor-actions .editor-header-icon-btn {
        width: auto;
    }

    .canvas-controls input[type="search"] {
        width: 180px;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    #signature-pad-canvas {
        height: 140px;
    }

    .main-nav {
        padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
        gap: 10px;
    }

    .main-nav nav {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: visible;
        gap: 6px;
    }

    .main-nav nav a {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }

    .button,
    .main-nav nav a,
    .logout-form button {
        min-height: 44px;
    }

    .editor-actions .button:not(.editor-header-icon-btn) {
        width: 100%;
        font-size: 0.84rem;
    }

    .editor-actions .editor-header-icon-btn {
        width: auto;
        min-height: 40px;
    }

    .file-table .actions .button:not(.file-action-icon) {
        flex: 1 1 100%;
    }

    .file-table .actions .file-action-icon {
        flex: 0 0 auto;
        width: 44px;
        min-width: 44px;
        height: 44px;
    }

    .folder-actions .file-action-icon {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }
}

@media (prefers-color-scheme: dark) {
    body:not(.guest-body) {
        --bg: #111a21;
        --surface: #17242e;
        --surface-soft: #1a2b36;
        --ink: #e7f1f7;
        --muted: #9bb0bd;
        --border: #2c3f4b;
        background: radial-gradient(circle at 8% 8%, #1d2d38, #111a21 44%, #0d141a 100%);
    }

    body:not(.guest-body) .panel,
    body:not(.guest-body) .doc-card,
    body:not(.guest-body) .recent-doc-card,
    body:not(.guest-body) .nav-burger {
        background: #1a2b36;
        border-color: #2c3f4b;
    }

    body:not(.guest-body) .nav-burger:hover {
        background: #223a48;
    }

    body:not(.guest-body) .nav-burger-lines,
    body:not(.guest-body) .nav-burger-lines::before,
    body:not(.guest-body) .nav-burger-lines::after {
        background: #dce8ee;
    }

    body:not(.guest-body) .main-nav,
    body:not(.guest-body) .top-bar,
    body:not(.guest-body) .editor-header,
    body:not(.guest-body) .thumb-sidebar,
    body:not(.guest-body) .property-sidebar,
    body:not(.guest-body) .floating-toolbar,
    body:not(.guest-body) .canvas-wrap,
    body:not(.guest-body) .file-table tbody tr:hover,
    body:not(.guest-body) .folder-manage-list li,
    body:not(.guest-body) .folder-browser-item,
    body:not(.guest-body) .shortcut-list li,
    body:not(.guest-body) .version-list li {
        background: #1a2b36;
        border-color: #2c3f4b;
        color: #dce8ee;
    }

    body:not(.guest-body) .file-table .actions .file-action-icon:not(.button-danger) img,
    body:not(.guest-body) .folder-actions .file-action-icon:not(.button-danger) img {
        filter: brightness(0) invert(0.92);
    }

    body:not(.guest-body) .file-table .actions .button-danger.file-action-icon img,
    body:not(.guest-body) .folder-actions .button-danger.file-action-icon img {
        filter: brightness(0) invert(1);
    }

    body:not(.guest-body) input,
    body:not(.guest-body) textarea,
    body:not(.guest-body) select,
    body:not(.guest-body) .button-light,
    body:not(.guest-body) .button-ghost,
    body:not(.guest-body) .floating-toolbar button,
    body:not(.guest-body) .canvas-controls button {
        background: #233643;
        border-color: #36505e;
        color: #dce8ee;
    }

    body:not(.guest-body) .recent-doc-pages {
        background: #233643;
        border-color: #36505e;
        color: #dce8ee;
    }

    body:not(.guest-body) .storage-meter {
        background: #223744;
        border-color: #36505e;
    }

    body:not(.guest-body) .storage-meter-segment--files {
        background: linear-gradient(90deg, #13657a, #2e92a5);
    }

    body:not(.guest-body) .storage-meter-segment--signed {
        background: linear-gradient(90deg, #6d4d9a, #9d72c9);
    }

    body:not(.guest-body) .storage-meter-legend {
        color: #b8cad4;
    }

    body:not(.guest-body) .storage-meter-legend-swatch {
        border-color: rgba(255, 255, 255, 0.12);
    }

    body:not(.guest-body) .storage-meter-legend-swatch--files {
        background: linear-gradient(135deg, #13657a, #2e92a5);
    }

    body:not(.guest-body) .storage-meter-legend-swatch--signed {
        background: linear-gradient(135deg, #6d4d9a, #9d72c9);
    }

    body:not(.guest-body) .role-chip,
    body:not(.guest-body) .badge,
    body:not(.guest-body) .badge-admin,
    body:not(.guest-body) .badge-standard {
        background: #213340;
        border-color: #36505e;
        color: #dbe8ee;
    }

    body:not(.guest-body) .admin-user-table th,
    body:not(.guest-body) .admin-user-table td {
        border-bottom-color: #2f424f;
    }

    body:not(.guest-body) .recent-doc-icon {
        background: linear-gradient(135deg, #13657a, #2e92a5);
    }

    body:not(.guest-body) .pdf-lock-icon--open {
        color: #8aa9c4;
    }

    body:not(.guest-body) .pdf-lock-icon--open .pdf-lock-icon__graphic--open {
        background-color: #8aa9c4;
    }

    body:not(.guest-body) .pdf-lock-icon--encrypted {
        color: #b8a882;
    }

    body:not(.guest-body) .pdf-lock-icon--encrypted .pdf-lock-icon__graphic--closed {
        background-color: #b8a882;
    }
}

/* Request Sign — new request + prepare */
.sig-fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0;
}

.sig-fieldset legend {
    padding: 0 6px;
    font-weight: 700;
    color: var(--ink);
}

.sig-new-form .sig-signer-row {
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0;
}

#sig-signer-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sig-signer-label {
    flex: 1 1 200px;
    display: grid;
    gap: 4px;
    font-size: 0.85rem;
}

/* New signature request — full-width, balanced columns + aside */
.sig-new-page.panel {
    max-width: 100%;
}

.sig-new-page-head {
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.sig-new-page-head .panel-title {
    min-width: 0;
}

form.sig-new-form.settings-form {
    max-width: none;
    width: 100%;
    gap: 20px;
    box-sizing: border-box;
}

.sig-new-title-block {
    display: grid;
    gap: 6px;
    max-width: 640px;
}

.sig-new-label-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    opacity: 0.92;
}

.sig-new-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 24px;
    align-items: stretch;
}

.sig-new-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
    min-width: 0;
}

.sig-fieldset.sig-fieldset--card {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

.sig-fieldset-lead {
    margin: 0 0 12px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.sig-fieldset-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
}

.sig-fieldset-stack--grow {
    flex: 1;
}

.sig-fieldset-footnote {
    margin: 12px 0 0;
}

.sig-new-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted-ink, #5c6d78);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 4px 0;
}

.sig-new-divider::before,
.sig-new-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.sig-new-aside {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    background: var(--surface-soft);
    box-sizing: border-box;
    align-self: start;
    position: sticky;
    top: 80px;
}

.sig-new-aside-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.sig-new-aside-steps {
    margin: 0 0 12px;
    padding-left: 1.2rem;
    display: grid;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--ink);
}

.sig-new-aside-note {
    margin: 0;
    line-height: 1.4;
}

.sig-new-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}

.sig-new-submit {
    min-height: 44px;
    padding: 12px 22px;
}

.sig-add-signer-btn {
    align-self: flex-start;
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .sig-new-layout {
        grid-template-columns: 1fr;
    }

    .sig-new-aside {
        position: static;
        order: -1;
    }
}

@media (max-width: 820px) {
    .sig-new-main-grid {
        grid-template-columns: 1fr;
    }
}

.sig-prep-panel .sig-prep-viewer-toolbar,
.sig-prep-toolbar {
    margin: 12px 0;
    align-items: flex-end;
}

.sig-prep-toolbar .sig-inline,
.sig-prep-viewer-toolbar label {
    display: grid;
    gap: 4px;
    font-size: 0.85rem;
    min-width: 140px;
}

.row-gap.wrap {
    flex-wrap: wrap;
}

/* Allow right sidebar column to shrink so text wraps instead of clipping (overflow-x: hidden). */
.sig-prep-shell .property-sidebar {
    min-width: 0;
}

/*
 * Request sign prepare: use block + centered inline-block (not grid place-items center).
 * Grid centering was sizing the scroll box incorrectly when zoomed — scrollbars never appeared,
 * so the top of the page became unreachable.
 */
.sig-prep-shell .canvas-wrap.sig-prep-canvas-wrap {
    display: block;
    overflow-x: auto;
    overflow-y: auto;
    text-align: center;
    min-height: min(48vh, 520px);
    max-height: min(calc(100vh - 220px), 1680px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

/* Mobile: let the PDF pane grow with the layout (avoid empty band + tiny viewer). Overrides max-height above. */
@media (max-width: 768px) {
    .sig-prep-shell .canvas-wrap.sig-prep-canvas-wrap {
        max-height: none;
        height: 100%;
        min-height: min(44dvh, 70vh);
        align-self: stretch;
    }
}

.sig-prep-shell .sig-prep-loading.loading-layer {
    position: absolute;
    inset: 0;
    z-index: 8;
    border-radius: 14px;
}

/* Page + overlay: shrink-to-fit canvas; parent text-align centers horizontally */
.sig-prep-shell .canvas-wrap.sig-prep-canvas-wrap .sig-prep-page-stage {
    position: relative;
    display: inline-block;
    vertical-align: top;
    line-height: 0;
    text-align: left;
    box-shadow: 0 12px 26px rgba(20, 39, 54, 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

#sig-pdf-canvas {
    display: block;
    background: #fff;
}

.sig-prep-overlay {
    position: absolute;
    left: 0;
    top: 0;
    cursor: crosshair;
}

.sig-canvas-controls-spacer {
    flex: 1 1 auto;
    min-width: 8px;
}

.sig-page-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 4rem;
    text-align: center;
}

/*
 * Request-sign prepare + public sign pages: .canvas-area has only toolbar + PDF (no floating tool row).
 * The default editor uses 3 grid rows; the extra 1fr row was empty and stole vertical space (huge gap above the footer).
 */
.sig-prep-shell .canvas-area {
    grid-template-rows: auto 1fr;
}

.sig-prep-property-sidebar label {
    display: grid;
    gap: 4px;
    font-size: 0.85rem;
    margin-top: 8px;
}

.sig-prep-property-sidebar label:first-of-type {
    margin-top: 0;
}

.sig-prep-property-sidebar .sig-field-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    max-height: min(280px, 32vh);
    overflow: auto;
}

.sig-prep-property-sidebar .sig-link-list {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

/* Sent request: signers + resend — compact for narrow sidebar */
.sig-prep-property-sidebar .sig-signers-block {
    min-width: 0;
}

.sig-prep-property-sidebar .sig-signers-intro {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sig-signer-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.sig-signer-item {
    border: 1px solid #dde5eb;
    border-radius: 8px;
    padding: 7px 9px;
    background: #fff;
    min-width: 0;
    box-sizing: border-box;
}

.sig-signer-item__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.sig-signer-item__name {
    font-size: 0.86rem;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.sig-signer-item__status {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef4f7;
    color: #3d5a6a;
    line-height: 1.2;
}

.sig-signer-item__status--signed {
    background: #e3f4ea;
    color: #1a6b3c;
}

.sig-signer-item__email {
    display: block;
    margin-top: 4px;
    font-size: 0.76rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.sig-prep-property-sidebar .sig-resend-form {
    margin-top: 10px;
    min-width: 0;
}

.sig-prep-property-sidebar .sig-resend-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
    text-align: center;
}

.sig-prep-property-sidebar .sig-resend-hint {
    margin: 6px 0 0;
    font-size: 0.76rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sig-prep-property-sidebar .sig-resend-hint--done {
    margin-top: 10px;
    margin-bottom: 0;
}

/* Guest signer session (/sign/{token}) */
/* Read-only overlay normally sets pointer-events:none on .sig-prep-field — re-enable for signers. */
.sig-sign-shell .sig-prep-overlay-hit[data-readonly="1"] .sig-sign-field--mine {
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0;
}

.sig-sign-shell .sig-prep-overlay-hit[data-readonly="1"] .sig-sign-field--mine:focus {
    outline: 2px solid #0d5f73;
    outline-offset: 1px;
}

.sig-sign-field--foreign {
    opacity: 0.42;
    pointer-events: none;
    border-style: dashed !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.sig-sign-field--mine {
    cursor: pointer;
}

.sig-sign-field--filled {
    background: rgba(46, 125, 50, 0.12);
    border-style: solid !important;
    border-color: rgba(46, 125, 50, 0.75) !important;
}

.sig-sign-field--empty {
    animation: sig-pulse-empty 1.8s ease-in-out infinite;
}

@keyframes sig-pulse-empty {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 95, 115, 0.35); }
    50% { box-shadow: 0 0 0 5px rgba(13, 95, 115, 0.12); }
}

.sig-sign-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: min(480px, 94vw);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.sig-sign-dialog::backdrop {
    background: rgba(15, 35, 45, 0.45);
}

.sig-sign-dialog__inner {
    padding: 18px 20px;
}

.sig-sign-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.sig-sign-text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d5e1e8;
    font-size: 0.95rem;
}

.sig-sign-pad-wrap {
    display: grid;
    gap: 10px;
}

.sig-sign-pad {
    width: 100%;
    max-width: 420px;
    height: auto;
    border: 1px solid #d5e1e8;
    border-radius: 8px;
    touch-action: none;
}

.sig-sign-intro {
    font-size: 0.82rem;
    line-height: 1.35;
}

.sig-sign-progress {
    margin-top: 6px;
    margin-bottom: 0;
}

.sig-sign-sidebar-li {
    font-size: 0.86rem;
}

.sig-sign-field-preview {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 4px 4px;
    box-sizing: border-box;
    pointer-events: none;
}

.sig-sign-field-preview--foreign {
    opacity: 1;
}

.sig-sign-field-preview-text {
    font-size: clamp(9px, 1.8vw, 13px);
    line-height: 1.2;
    color: #143944;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    max-height: 100%;
}

.sig-sign-field-preview-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.sig-sign-field-tap-hint {
    font-size: clamp(8px, 1.5vw, 11px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #0d5f73;
    text-align: center;
    padding: 2px 4px;
    line-height: 1.2;
}

.sig-sign-field-preview--waiting .sig-sign-field-waiting {
    font-size: clamp(8px, 1.4vw, 10px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6a8494;
}

.sig-prep-overlay-hit {
    z-index: 2;
}

/* Placed field: interactive wrapper (move / resize when selected) */
.sig-prep-field {
    position: absolute;
    box-sizing: border-box;
    border: 2px dashed #0d5f73;
    border-radius: 4px;
    background: rgba(13, 95, 115, 0.08);
    pointer-events: none;
    z-index: 3;
    user-select: none;
    -webkit-user-select: none;
}

.sig-prep-overlay-hit:not([data-readonly]) .sig-prep-field {
    pointer-events: auto;
    cursor: move;
}

.sig-prep-field--selected {
    border-style: solid;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(13, 95, 115, 0.25);
    z-index: 4;
}

.sig-prep-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #0d5f73;
    border-radius: 2px;
    z-index: 5;
    pointer-events: auto;
    touch-action: none;
}

.sig-prep-handle-nw { left: -5px; top: -5px; cursor: nwse-resize; }
.sig-prep-handle-n { left: 50%; top: -5px; transform: translateX(-50%); cursor: ns-resize; }
.sig-prep-handle-ne { right: -5px; top: -5px; cursor: nesw-resize; }
.sig-prep-handle-e { right: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.sig-prep-handle-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.sig-prep-handle-s { left: 50%; bottom: -5px; transform: translateX(-50%); cursor: ns-resize; }
.sig-prep-handle-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.sig-prep-handle-w { left: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

.sig-prep-rect--draft {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid rgba(46, 125, 50, 0.85);
    border-radius: 4px;
    background: rgba(46, 125, 50, 0.12);
    pointer-events: none;
    z-index: 6;
}

.sig-prep-rect-tag {
    position: absolute;
    left: 2px;
    top: 2px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.92);
    padding: 2px 5px;
    border-radius: 4px;
    color: #1f3d4c;
    pointer-events: none;
    user-select: none;
}

.sig-prep-loading.hidden {
    display: none;
}

.sig-field-li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #dde5eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.88rem;
}

.sig-field-li code {
    font-size: 0.82rem;
    background: #eef4f7;
    padding: 1px 5px;
    border-radius: 4px;
}

.sig-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.sig-link-list li {
    display: grid;
    gap: 6px;
}

.sig-link-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sig-link-input {
    flex: 1 1 240px;
    min-width: 0;
    font-size: 0.82rem;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d5e1e8;
}

p.small {
    font-size: 0.86rem;
}
