@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=Atkinson+Hyperlegible:wght@400;700&display=swap");

:root {
    --ink: #0f172a;
    --ink-soft: #24324a;
    --muted: #5b6a85;
    --brand: #0f3d78;
    --brand-2: #1f8ad5;
    --accent: #f59e0b;
    --accent-2: #f97316;
    --surface: rgba(230, 235, 243, 0.96);
    --surface-2: rgba(222, 228, 238, 0.96);
    --line: rgba(15, 23, 42, 0.08);
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
    --radius-xl: 24px;
    --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-display: "Fraunces", "Times New Roman", serif;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: linear-gradient(135deg, #dde4ee 0%, #d5deea 45%, #cfd9e6 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

body h1,
body h2,
body h3,
body h4 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

body .app-shell {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

body .app-sidebar {
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

body .app-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

body .app-panel {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

body .accent-gradient {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}

body .accent-warm {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: #fff;
}

body .text-muted {
    color: var(--muted);
}

body .bg-white {
    background-color: rgba(225, 232, 244, 0.98);
}

body .bg-slate-50 {
    background-color: rgba(218, 226, 240, 0.96);
}

body .bg-slate-100,
body .bg-gray-100 {
    background-color: rgba(208, 218, 234, 0.96);
}

body .border-slate-100,
body .border-slate-200,
body .border-gray-100,
body .border-gray-200 {
    border-color: var(--line);
}

body .shadow-2xl {
    box-shadow: var(--shadow);
}

body .shadow-xl,
body .shadow-lg,
body .shadow-md {
    box-shadow: var(--shadow-soft);
}

body input,
body textarea,
body select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background-color: rgba(226, 233, 245, 0.96);
}

body input:focus,
body textarea:focus,
body select:focus {
    outline: none;
    border-color: rgba(31, 138, 213, 0.6);
    box-shadow: 0 0 0 3px rgba(31, 138, 213, 0.12);
}

body .input-error {
    border-color: rgba(239, 68, 68, 0.7) !important;
    background-color: rgba(254, 242, 242, 0.8) !important;
}

footer {
    background: #0b1f3a !important;
    color: #dbe7ff !important;
}

footer a {
    color: #bcd0ff !important;
}

footer a:hover {
    color: #ffffff !important;
}

#parj-admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 12, 26, 0.82);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.parj-admin-overlay-card {
    width: min(520px, 100%);
    background: #0f1e3a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px;
    color: #e2e8f0;
    box-shadow: 0 30px 60px rgba(8, 15, 30, 0.5);
}

.parj-admin-overlay-title {
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
}

.parj-admin-overlay-text {
    margin-top: 8px;
    font-size: 14px;
    color: #cbd5f5;
}

.parj-admin-overlay-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.parj-admin-overlay-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 13px;
    background: #f59e0b;
    color: #0f172a;
    cursor: pointer;
}

.parj-admin-overlay-btn.ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

body .error-text {
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
}

body .app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-weight: 600;
    font-size: 12px;
}

body .app-highlight {
    border-left: 4px solid rgba(245, 158, 11, 0.8);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.6));
}

body.no-copy {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body.no-copy input,
body.no-copy textarea,
body.no-copy select,
body.no-copy [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body .app-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.15), transparent);
}

body .app-floating {
    animation: app-float 6s ease-in-out infinite;
}

.flow-guide {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.flow-steps {
    display: grid;
    gap: 12px;
}

.flow-step {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.flow-step:hover {
    transform: translateY(-2px);
    border-color: rgba(31, 138, 213, 0.25);
}

.flow-step.active {
    border-color: rgba(31, 138, 213, 0.6);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    background: rgba(31, 138, 213, 0.08);
}

.flow-step .step-num {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--muted);
}

.flow-step.active .step-num {
    background: var(--brand);
    color: #fff;
}

.flow-step .step-title {
    font-weight: 700;
    color: var(--ink);
}

.flow-step .step-desc {
    font-size: 13px;
    color: var(--muted);
}

.flow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (min-width: 1024px) {
    .flow-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.sidebar-link.active {
    background: rgba(37, 99, 235, 0.12);
    color: #1e3a8a;
    border-left: 3px solid #2563eb;
}

.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    -webkit-line-clamp: 3;
}

@keyframes app-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.parj-hidden {
    display: none !important;
}

#parj-utility {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 75;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-body);
}

.parj-utility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.parj-utility-toggle.icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.parj-utility-toggle.icon-only .parj-toggle-text {
    display: none;
}

#parj-share-btn {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    z-index: 76;
    font-size: 12px;
}

#parj-share-btn:hover {
    background: rgba(15, 23, 42, 1);
}

body.has-admin-action #parj-share-btn {
    right: 10px;
}

@media (max-width: 640px) {
    #parj-share-btn {
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
}

.parj-utility-panel {
    width: 280px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

#parj-modal-root {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
}

.parj-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: all;
}

.parj-modal {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 20px;
    display: grid;
    gap: 14px;
}

.parj-modal[data-variant="error"] {
    border-color: #fecaca;
}

.parj-modal[data-variant="warning"] {
    border-color: #fed7aa;
}

.parj-modal[data-variant="success"] {
    border-color: #bbf7d0;
}

.parj-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.parj-modal[data-variant="error"] .parj-modal-title {
    color: #b91c1c;
}

.parj-modal[data-variant="warning"] .parj-modal-title {
    color: #b45309;
}

.parj-modal[data-variant="success"] .parj-modal-title {
    color: #047857;
}

.parj-modal-message {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.parj-modal-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14px;
}

.parj-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.parj-modal-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.parj-modal-btn-primary {
    background: #2563eb;
    color: #fff;
}

.parj-modal-btn-primary:hover {
    background: #1d4ed8;
}

.parj-modal-btn-ghost {
    background: #f1f5f9;
    color: #475569;
}

.parj-modal-btn-ghost:hover {
    background: #e2e8f0;
}

.parj-utility-section + .parj-utility-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.parj-utility-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 6px;
}

.parj-utility-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(249, 250, 255, 0.9);
    font-size: 13px;
}

.parj-utility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.parj-utility-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
}

.parj-utility-action {
    border: none;
    background: rgba(31, 138, 213, 0.12);
    color: #1e3a8a;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.parj-utility-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 6px;
}

.parj-utility-check input {
    accent-color: #1d4ed8;
}

body.a11y-large-text {
    font-size: 17px;
}

body.a11y-large-text h1,
body.a11y-large-text h2,
body.a11y-large-text h3 {
    font-size: 1.08em;
}

body.a11y-high-contrast {
    --surface: #ffffff;
    --surface-2: #ffffff;
    --line: rgba(15, 23, 42, 0.2);
    --brand: #0b3b66;
    --brand-2: #1d4ed8;
    --accent: #b45309;
    --accent-2: #c2410c;
    background: #f8fafc !important;
}

body.a11y-dyslexia {
    --font-body: "Atkinson Hyperlegible", "IBM Plex Sans", sans-serif;
}

body.a11y-reduce-motion *,
body.a11y-reduce-motion *::before,
body.a11y-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

@media (max-width: 640px) {
    #parj-utility {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .parj-utility-panel {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    body.app {
        display: block;
    }

    main.ml-64 {
        min-width: 0;
        overflow-x: hidden;
    }

    body.has-sidebar #parj-breadcrumbs .parj-breadcrumb-inner {
        padding-left: 16rem;
    }
}
