* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

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

button {
    cursor: pointer;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.app-shell {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-bg);
    padding: 36px 26px 44px;
    box-shadow: 12px 0 32px rgba(16, 24, 40, 0.04);
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
}

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

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--primary), #ff6474);
    color: #fff;
    box-shadow: 0 10px 20px rgba(239, 51, 72, 0.24);
}

.brand-mark .icon {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.24);
}

.upload-main,
.primary-button,
.white-button,
.ghost-button,
.outline-red,
.tool-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    border-radius: 7px;
    border: 1px solid transparent;
    font-weight: 750;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.upload-main:hover,
.primary-button:hover,
.white-button:hover,
.ghost-button:hover,
.outline-red:hover,
.tool-pill:hover {
    transform: translateY(-1px);
}

.upload-main {
    width: 100%;
    margin: 40px 0 24px;
    background: linear-gradient(135deg, var(--primary), #f53b4d);
    color: #fff;
    box-shadow: 0 12px 20px rgba(239, 51, 72, 0.2);
    font-size: 16px;
}

.side-nav {
    display: grid;
    gap: 4px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 39px;
    padding: 0 18px;
    border-radius: 7px;
    color: #596174;
    font-size: 15px;
    font-weight: 540;
}

.side-link.active {
    background: color-mix(in srgb, var(--primary) 11%, #fff);
    color: var(--primary);
    font-weight: 780;
}

.tool-link.active {
    background: color-mix(in srgb, var(--primary) 9%, #fff);
}

.tools-nav .color-blue,
.tools-nav .color-purple,
.tools-nav .color-green,
.tools-nav .color-orange,
.tools-nav .color-indigo,
.tools-nav .color-violet,
.tools-nav .color-pink,
.tools-nav .color-sky,
.tools-nav .color-mint {
    background: transparent;
}

.tools-nav .color-blue { color: #2F80ED; }
.tools-nav .color-purple { color: #8B5CF6; }
.tools-nav .color-green { color: #54C276; }
.tools-nav .color-orange { color: #F97316; }
.tools-nav .color-indigo { color: #6272F2; }
.tools-nav .color-violet { color: #9057F8; }
.tools-nav .color-pink { color: #EF4776; }
.tools-nav .color-sky { color: #228AEC; }
.tools-nav .color-mint { color: #27B987; }

.nav-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 14px;
    color: #98A2B3;
    font-size: 11px;
    font-weight: 800;
}

.nav-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #EAECF0;
}

.full {
    width: 100%;
}

.main-area {
    min-width: 0;
    padding: 30px 34px 22px 52px;
}

.topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    position: relative;
    margin-bottom: 10px;
}

.icon-button,
.icon-action {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: #4B5565;
    border-radius: 8px;
}

.has-dot::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    top: 8px;
    right: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--app-bg);
}

.profile-wrap,
.table-actions {
    position: relative;
}

.profile-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    color: #111827;
    font-weight: 620;
}

.avatar {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #FFD1D5;
    color: var(--primary);
    font-weight: 800;
}

.floating-menu,
.row-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    padding: 10px;
    display: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.16);
    z-index: 50;
}

.floating-menu.open,
.row-menu.open {
    display: grid;
    gap: 4px;
}

.floating-menu a,
.row-menu a,
.row-menu button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 6px;
    color: #344054;
    background: transparent;
    text-align: left;
}

.floating-menu a:hover,
.row-menu a:hover,
.row-menu button:hover {
    background: #F6F8FB;
}

.notification-menu {
    right: 180px;
    width: 280px;
}

.notification-menu p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    padding: 13px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: #344054;
}

.flash.success {
    border-color: #ABEFC6;
    background: #ECFDF3;
    color: #067647;
}

.flash.error {
    border-color: #FECDCA;
    background: #FEF3F2;
    color: #B42318;
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
}

.welcome h1,
.page-title h1,
.tool-hero h1,
.editor-heading h1,
.admin-heading h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.2;
    font-weight: 850;
}

.welcome p,
.page-title p,
.tool-hero p,
.editor-heading p,
.admin-heading p {
    margin: 8px 0 0;
    color: #4B5565;
    font-size: 15px;
}

.hero-panel {
    position: relative;
    min-height: 372px;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 520px;
    align-items: center;
    padding: 56px 62px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.16) 0 120px, transparent 121px),
        linear-gradient(116deg, #F22D43 0%, #DE2037 48%, #E84556 100%);
    color: #fff;
    box-shadow: 0 22px 40px rgba(239, 51, 72, 0.16);
}

.hero-panel::before,
.hero-panel::after {
    content: "";
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.hero-panel::before {
    width: 720px;
    height: 420px;
    left: 500px;
    top: 120px;
    transform: rotate(-18deg);
}

.hero-panel::after {
    width: 820px;
    height: 520px;
    right: -120px;
    top: -340px;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.hero-copy h2 {
    margin: 0;
    max-width: 620px;
    font-size: 39px;
    line-height: 1.3;
    font-weight: 860;
}

.hero-copy p {
    margin: 18px 0 52px;
    font-size: 18px;
}

.hero-actions {
    display: flex;
    gap: 28px;
}

.white-button {
    min-width: 205px;
    padding: 0 28px;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12);
}

.white-button.centered {
    color: var(--primary);
}

.ghost-button {
    min-width: 198px;
    padding: 0 28px;
    border-color: rgba(255, 255, 255, 0.82);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.outline-red {
    min-height: 42px;
    padding: 0 18px;
    border-color: color-mix(in srgb, var(--primary) 65%, #fff);
    color: var(--primary);
    background: #fff;
}

.hero-art {
    position: relative;
    z-index: 2;
    height: 320px;
}

.paper-preview {
    position: absolute;
    top: 10px;
    right: 126px;
    width: 278px;
    height: 342px;
    background: #fff;
    border-radius: 7px 7px 0 0;
    box-shadow: 0 22px 44px rgba(16, 24, 40, 0.18);
}

.paper-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(247, 249, 253, 0.7));
    pointer-events: none;
}

.fold {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #E5EAF2, #fff 52%);
    clip-path: polygon(0 0, 100% 100%, 100% 0);
    border-radius: 0 7px 0 7px;
}

.paper-line {
    position: absolute;
    left: 126px;
    width: 108px;
    height: 6px;
    border-radius: 10px;
    background: #E8EBF0;
}

.paper-line.short {
    top: 30px;
    left: 34px;
    width: 70px;
}

.paper-line:nth-of-type(3) {
    top: 50px;
    left: 34px;
    width: 155px;
}

.paper-line.wide {
    top: 115px;
    width: 122px;
}

.paper-line:nth-of-type(6) {
    top: 146px;
    width: 130px;
}

.paper-line:nth-of-type(7) {
    top: 178px;
    width: 126px;
}

.paper-media {
    position: absolute;
    left: 34px;
    top: 82px;
    width: 72px;
    height: 62px;
    border-radius: 4px;
    background:
        radial-gradient(circle at 58% 28%, #EF3348 0 7px, transparent 8px),
        linear-gradient(135deg, transparent 52%, #EF3348 53%),
        linear-gradient(45deg, #EF3348 0 40%, #FFC4C9 41%);
    opacity: 0.92;
}

.text-box {
    position: absolute;
    left: 32px;
    top: 166px;
    width: 74px;
    height: 70px;
    display: grid;
    place-items: center;
    color: #1F2937;
    font-family: Georgia, serif;
    font-size: 39px;
    border: 2px dashed #4F8EF7;
}

.signature-box {
    position: absolute;
    right: 32px;
    bottom: 30px;
    width: 122px;
    height: 50px;
    display: grid;
    place-items: center;
    color: #111827;
    font-family: "Brush Script MT", "Segoe Script", cursive;
    font-size: 28px;
    border: 1px dashed #FF6B79;
    background: #FFF3F4;
    transform: rotate(-1deg);
}

.hero-tool {
    position: absolute;
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    box-shadow: 0 10px 25px rgba(16, 24, 40, 0.18);
}

.hero-tool-pencil {
    left: 48px;
    top: 86px;
    background: linear-gradient(145deg, #4F8EF7, #236DE1);
}

.hero-tool-grid {
    right: 78px;
    top: 74px;
    background: linear-gradient(145deg, #64D27A, #35B35D);
}

.hero-tool-sign {
    left: 32px;
    bottom: 66px;
    background: linear-gradient(145deg, #AF8BFF, #6F5AF2);
}

.hero-tool-image {
    right: 0;
    bottom: 86px;
    background: linear-gradient(145deg, #FFB35E, #F97316);
}

.section-heading,
.documents-heading,
.editor-heading,
.admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.section-heading {
    margin: 32px 0 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 850;
}

.section-heading a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #344054;
    font-weight: 700;
}

.danger-link {
    color: var(--primary) !important;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
}

.all-tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-card {
    position: relative;
    min-height: 210px;
    padding: 24px 24px 22px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(16, 24, 40, 0.07);
}

.tool-card.large {
    min-height: 190px;
}

.tool-card:hover {
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
    box-shadow: 0 16px 32px rgba(16, 24, 40, 0.1);
}

.tool-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    margin-bottom: 20px;
}

.tool-icon .icon {
    width: 25px;
    height: 25px;
}

.tool-icon.jumbo {
    width: 62px;
    height: 62px;
    margin: 0;
}

.color-blue {
    background: linear-gradient(145deg, #55A5FF, #2F80ED);
}

.color-purple {
    background: linear-gradient(145deg, #A78BFA, #7C3AED);
}

.color-green {
    background: linear-gradient(145deg, #7BD991, #4FB96D);
}

.color-orange {
    background: linear-gradient(145deg, #FFAA63, #EF7E36);
}

.color-indigo {
    background: linear-gradient(145deg, #8B9BFF, #6272F2);
}

.color-violet {
    background: linear-gradient(145deg, #B181FF, #9057F8);
}

.color-pink {
    background: linear-gradient(145deg, #FF6F96, #EF4776);
}

.color-sky {
    background: linear-gradient(145deg, #57B8FF, #228AEC);
}

.color-mint {
    background: linear-gradient(145deg, #69D9B5, #27B987);
}

.tool-card strong {
    margin-bottom: 8px;
    font-size: 17px;
    color: #101828;
}

.tool-card p {
    margin: 0;
    color: #667085;
    line-height: 1.4;
}

.card-arrow {
    position: absolute;
    right: 22px;
    bottom: 20px;
    color: #667085;
}

.documents-table {
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.table-row {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 190px 300px 110px;
    align-items: center;
    min-height: 54px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
    color: #667085;
    font-size: 14px;
}

.table-row:last-child {
    border-bottom: 0;
}

.table-head {
    min-height: 50px;
    color: #667085;
    font-size: 13px;
}

.doc-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #344054;
    font-weight: 650;
}

.doc-name a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-chip {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 5px;
    color: #fff;
    background: linear-gradient(145deg, #FF7884, var(--primary));
}

.pdf-chip .icon {
    width: 16px;
    height: 16px;
}

.mini-star,
.mini-lock {
    display: inline-flex;
    color: #F59E0B;
}

.mini-lock {
    color: #667085;
}

.mini-star .icon,
.mini-lock .icon {
    width: 15px;
    height: 15px;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.empty-state {
    padding: 32px;
    color: var(--muted);
    text-align: center;
}

.ad-slot {
    min-height: 86px;
    margin: 22px 0;
    display: grid;
    place-items: center;
    border: 1px dashed #CBD5E1;
    border-radius: 8px;
    color: #98A2B3;
    background: rgba(255, 255, 255, 0.72);
}

.sidebar-ad {
    min-height: 180px;
    margin-top: 24px;
}

.page-title {
    margin: 22px 0 24px;
}

.plan-label {
    color: var(--accent);
    font-weight: 800;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.44);
    z-index: 100;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    position: relative;
    width: min(520px, 100%);
    padding: 30px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-card h2 {
    margin: 0;
    font-size: 26px;
}

.modal-card p {
    color: var(--muted);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: #F2F4F7;
    color: #475467;
}

.drop-zone {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 190px;
    padding: 24px;
    border: 2px dashed #D0D5DD;
    border-radius: 8px;
    color: #667085;
    text-align: center;
}

.drop-zone.dragging {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, #fff);
}

.drop-zone input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.drop-title {
    color: #101828;
    font-weight: 800;
}

.primary-button {
    min-height: 50px;
    padding: 0 24px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #F24152);
    box-shadow: 0 10px 20px rgba(239, 51, 72, 0.18);
}

.primary-button.compact {
    min-height: 40px;
    padding: 0 16px;
}

.upload-form,
.stacked-form {
    display: grid;
    gap: 18px;
}

.tool-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 20px 0 24px;
}

.tool-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.tool-form-card,
.tool-side-card,
.settings-card,
.login-card,
.installer-card,
.unlock-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.06);
}

.tool-form-card,
.tool-side-card,
.settings-card {
    padding: 24px;
}

.tool-upload-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 4%, #fff);
}

.tool-upload-strip strong {
    display: block;
    color: #101828;
}

.tool-upload-strip p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 14px;
}

.tool-side-card h2,
.settings-card h2 {
    margin: 0 0 14px;
}

.tool-side-card p,
.muted-copy {
    color: var(--muted);
    line-height: 1.5;
}

.field-group {
    margin: 0;
    padding: 0;
    border: 0;
}

.field-group legend,
.field span {
    display: block;
    margin-bottom: 9px;
    color: #344054;
    font-weight: 780;
}

.doc-picker {
    display: grid;
    gap: 10px;
}

.doc-picker label {
    display: grid;
    grid-template-columns: 18px 24px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.doc-picker label:has(input:checked) {
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
    background: color-mix(in srgb, var(--primary) 5%, #fff);
}

.doc-picker small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #D0D5DD;
    border-radius: 7px;
    background: #fff;
    color: #101828;
    outline: 0;
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 13%, transparent);
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-tool {
    min-height: 380px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    color: var(--muted);
    text-align: center;
}

.empty-tool .icon {
    width: 52px;
    height: 52px;
    color: var(--primary);
}

.capability-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.capability-list span {
    padding: 7px 10px;
    border: 1px solid #F2C94C;
    border-radius: 999px;
    color: #B54708;
    background: #FFFAEB;
    font-size: 12px;
    font-weight: 800;
}

.capability-list span.ok {
    border-color: #ABEFC6;
    color: #067647;
    background: #ECFDF3;
}

.capability-list.block {
    display: grid;
}

.editor-heading {
    margin: 20px 0 18px;
}

.editor-shell {
    display: grid;
    gap: 14px;
}

.editor-form-shell {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.editor-workbench {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.text-editor-panel {
    min-width: 0;
    max-height: calc(100vh - 210px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

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

.panel-title h2 {
    margin: 0;
    font-size: 18px;
}

.panel-title span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.text-editor-panel p {
    margin: 8px 0 14px;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}

.text-line-list {
    display: grid;
    gap: 10px;
}

.editable-line {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #F8FAFC;
}

.editable-line.deleted {
    border-color: #FECDCA;
    background: #FEF3F2;
}

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

.editable-line-head strong {
    color: #344054;
    font-size: 13px;
}

.text-delete-button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #FECDCA;
    border-radius: 7px;
    background: #fff;
    color: #B42318;
    font-size: 12px;
    font-weight: 800;
}

.editable-line.deleted .text-delete-button {
    border-color: #ABEFC6;
    color: #067647;
}

.editable-line textarea {
    width: 100%;
    min-height: 62px;
    padding: 9px;
    border: 1px solid #D0D5DD;
    border-radius: 7px;
    resize: vertical;
    color: #101828;
    background: #fff;
}

.editable-line.deleted textarea {
    color: #98A2B3;
    text-decoration: line-through;
    background: #FFF7F6;
}

.tool-pill {
    min-height: 40px;
    padding: 0 14px;
    border-color: var(--border);
    background: #fff;
    color: #344054;
}

.tool-pill.muted {
    color: var(--muted);
}

.editor-stage {
    position: relative;
    height: calc(100vh - 210px);
    min-height: 640px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #E8ECF3;
}

.pdf-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.annotation-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.annotation-box {
    position: absolute;
    min-width: 120px;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 8px 10px;
    border: 2px dashed #4F8EF7;
    background: rgba(255, 255, 255, 0.82);
    color: #111827;
    pointer-events: auto;
    user-select: none;
}

.annotation-remove {
    position: absolute;
    top: -11px;
    right: -11px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 13px;
    line-height: 1;
}

.annotation-box.signature {
    border-color: #FF6B79;
    font-family: "Brush Script MT", "Segoe Script", cursive;
    font-size: 24px;
}

.annotation-box.link {
    border-color: #60A5FA;
    color: #1D4ED8;
    text-decoration: underline;
}

.annotation-box.image {
    border-color: #F97316;
    color: #C2410C;
}

.annotation-box.erase {
    border-color: #EF4444;
    background: #fff;
    color: #B42318;
    resize: both;
    overflow: auto;
}

.annotation-box:focus {
    outline: 3px solid rgba(79, 142, 247, 0.24);
}

.admin-heading {
    margin: 20px 0 24px;
}

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

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding-bottom: 90px;
}

.settings-card.wide {
    grid-column: 1 / -1;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.color-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    align-items: center;
    gap: 12px;
    color: #344054;
    font-weight: 700;
}

.color-field input {
    width: 56px;
    height: 42px;
    padding: 0;
    border: 1px solid #D0D5DD;
    border-radius: 7px;
    background: transparent;
}

.save-bar {
    position: fixed;
    right: 34px;
    bottom: 22px;
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14);
    z-index: 30;
}

.admin-login-page,
.installer-page,
.unlock-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
    background: var(--app-bg);
}

.login-card,
.installer-card,
.unlock-card {
    width: min(620px, 100%);
    padding: 32px;
    text-align: center;
}

.login-card h1,
.installer-card h1,
.unlock-card h1 {
    margin: 24px 0 10px;
}

.login-card p,
.installer-card p,
.unlock-card p {
    color: var(--muted);
}

.install-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
    text-align: left;
}

.install-checks div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #F8FAFC;
}

.install-checks div.ok {
    border-color: #ABEFC6;
    background: #ECFDF3;
}

.install-checks div.warn {
    border-color: #FECDCA;
    background: #FEF3F2;
}

.install-checks div.optional {
    border-color: #FEC84B;
    background: #FFFAEB;
}

.install-checks span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.install-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.installer-note {
    margin-top: 24px;
    font-size: 14px;
}

.unlock-card .icon {
    width: 54px;
    height: 54px;
    color: var(--primary);
}

@media (max-width: 1350px) {
    .app-shell {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .main-area {
        padding-left: 30px;
    }

    .tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-art {
        display: none;
    }
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .main-area {
        padding: 18px;
    }

    .topbar {
        justify-content: space-between;
        gap: 10px;
    }

    .profile-button span:not(.avatar) {
        display: none;
    }

    .hero-panel {
        min-height: 360px;
        padding: 32px 24px;
    }

    .hero-copy h2 {
        font-size: 30px;
    }

    .hero-actions,
    .tool-workspace,
    .admin-grid,
    .form-grid.two,
    .install-checks {
        grid-template-columns: 1fr;
        display: grid;
    }

    .tools-grid,
    .all-tools-grid {
        grid-template-columns: 1fr;
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px;
    }

    .table-head {
        display: none;
    }

    .table-actions {
        justify-content: flex-start;
    }

    .save-bar {
        left: 18px;
        right: 18px;
        justify-content: space-between;
    }

    .editor-stage {
        height: 620px;
    }
}

.mobile-menu-button,
.sidebar-close {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

.site-footer {
    margin-top: 34px;
    padding: 22px 0 6px;
    border-top: 1px solid var(--border);
    color: #667085;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 10px;
}

.footer-links a {
    color: #344054;
    font-weight: 700;
}

.site-footer p {
    margin: 0;
    font-size: 14px;
}

.static-page {
    max-width: 900px;
    margin: 22px 0;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.06);
}

.static-page h1 {
    margin: 0 0 18px;
    font-size: 30px;
}

.static-content {
    color: #475467;
    line-height: 1.7;
}

.editor-ad-panel:empty {
    display: none;
}

.editor-shell:has(.editor-ad-panel:not(:empty)) {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.editor-shell:has(.editor-ad-panel:not(:empty)) .editor-toolbar {
    grid-column: 1 / -1;
}

.editor-ad-panel {
    min-width: 0;
}

.admin-shell {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
    background: #F6F8FC;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 14px;
    background: #111827;
    color: #fff;
}

.admin-brand {
    padding: 6px 8px 18px;
    font-size: 22px;
}

.admin-nav {
    display: grid;
    gap: 4px;
    margin-top: 12px;
}

.admin-nav a,
.admin-sidebar-actions a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
    font-weight: 700;
}

.admin-nav a.active,
.admin-nav a:hover,
.admin-sidebar-actions a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-nav .icon,
.admin-sidebar-actions .icon {
    width: 18px;
    height: 18px;
}

.admin-sidebar-actions {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 18px;
    display: grid;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-main {
    min-width: 0;
    padding: 22px;
}

.admin-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-topline h1 {
    margin: 0;
    font-size: 24px;
}

.admin-topline p {
    margin: 4px 0 0;
    color: #667085;
}

.admin-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.admin-stat,
.admin-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.05);
}

.admin-stat {
    padding: 16px;
}

.admin-stat span {
    display: block;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
}

.admin-card {
    padding: 18px;
}

.admin-card h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.compact-card {
    max-width: 900px;
}

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

.admin-save-row {
    position: sticky;
    bottom: 14px;
    display: flex;
    justify-content: flex-end;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12);
}

.compact-form {
    text-align: left;
}

.compact-login {
    max-width: 460px;
}

.compact-colors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-editor-list,
.ad-demo-grid {
    display: grid;
    gap: 12px;
}

.page-editor {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #F8FAFC;
}

.page-editor-head,
.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.page-editor-head label,
.switch-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475467;
    font-size: 13px;
    font-weight: 700;
}

.ad-demo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ad-code-field {
    display: grid;
    gap: 8px;
}

.demo-ad-box {
    min-height: 76px;
    display: grid;
    place-items: center;
    border: 1px dashed #CBD5E1;
    border-radius: 8px;
    background: repeating-linear-gradient(135deg, #F8FAFC, #F8FAFC 10px, #EEF2F7 10px, #EEF2F7 20px);
    color: #667085;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .admin-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-colors,
    .ad-demo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(320px, 86vw);
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        z-index: 120;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: grid;
        position: absolute;
        top: 14px;
        right: 14px;
        width: 34px;
        height: 34px;
        place-items: center;
        border: 0;
        border-radius: 7px;
        background: #F2F4F7;
        color: #344054;
    }

    .sidebar-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.46);
        z-index: 110;
    }

    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 40px;
        padding: 0 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fff;
        color: #344054;
        font-weight: 800;
    }

    .hero-copy h2 {
        font-size: 28px;
        line-height: 1.22;
    }

    .hero-copy p {
        margin-bottom: 28px;
        font-size: 16px;
    }

    .hero-actions .white-button,
    .hero-actions .ghost-button {
        width: 100%;
        min-width: 0;
    }

    .documents-table {
        overflow: hidden;
    }

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

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-sidebar-actions {
        position: static;
        margin-top: 14px;
    }

    .admin-main {
        padding: 16px;
    }

    .admin-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-overview-grid {
        grid-template-columns: 1fr;
    }

    .page-editor-head,
    .admin-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .tool-upload-strip {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-shell:has(.editor-ad-panel:not(:empty)) {
        grid-template-columns: 1fr;
    }

    .editor-workbench {
        grid-template-columns: 1fr;
    }

    .text-editor-panel {
        max-height: none;
    }
}

@media (max-width: 560px) {
    .main-area {
        padding: 14px;
    }

    .welcome h1,
    .page-title h1,
    .tool-hero h1,
    .editor-heading h1 {
        font-size: 22px;
    }

    .hero-panel {
        min-height: 0;
        padding: 24px 18px;
    }

    .hero-copy h2 {
        font-size: 24px;
    }

    .section-heading,
    .documents-heading,
    .editor-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .tool-card {
        min-height: 180px;
    }

    .modal-card,
    .login-card,
    .installer-card,
    .unlock-card {
        padding: 22px;
    }

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

    .footer-links {
        flex-direction: column;
    }
}

/* =====================================================
   SNAPPDF CLOUD — NEW FEATURES CSS
   Blog, AI Tools, QR Tools, 404, Enhancements
   ===================================================== */

/* ── Blog Grid ─────────────────────────────────────── */
.blog-page-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    padding-bottom: 1.5rem;
}

.blog-search-form {
    display: flex;
    gap: .5rem;
    width: 100%;
    max-width: 420px;
}

.blog-search-form input {
    flex: 1;
    padding: .55rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .2s;
}

.blog-search-form input:focus { border-color: var(--primary); }

.blog-search-form button {
    padding: .55rem .9rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.blog-search-info {
    font-size: .9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.blog-grid-home {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

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

.blog-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: #fff;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .18s, transform .18s;
}

.blog-card:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.blog-card-img {
    height: 170px;
    background-size: cover;
    background-position: center;
    background-color: var(--app-bg);
}

.blog-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.blog-card-img-placeholder .icon { width: 40px; height: 40px; opacity: .35; }

.blog-card-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    flex: 1;
}

.blog-card-body h2,
.blog-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: var(--text);
}

.blog-card-body p {
    font-size: .875rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
    flex: 1;
}

.blog-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--primary);
    background: rgba(239,51,72,.08);
    padding: .2rem .55rem;
    border-radius: 20px;
}

.blog-read-more {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: .3rem;
}

.blog-read-more .icon { width: 14px; height: 14px; }

/* ── Single Article ───────────────────────────────── */
.single-article {
    max-width: 780px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.article-hero-img {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.article-hero-img img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
}

.article-cta-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(239,51,72,.07), rgba(239,51,72,.03));
    border: 1.5px solid rgba(239,51,72,.2);
    border-radius: 10px;
    padding: .9rem 1.2rem;
    margin-bottom: 1.25rem;
}

.article-cta-bar span {
    font-size: .9rem;
    color: var(--muted);
    flex: 1;
}

.article-cta-bottom { margin-top: 2rem; }

.article-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.article-meta time { font-size: .83rem; color: var(--muted); }

.single-article h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 1.5rem;
    color: var(--text);
}

.article-body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
}

.article-body h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.75rem 0 .6rem;
    color: var(--text);
}

.article-body p { margin: 0 0 1rem; }

.article-body ul, .article-body ol {
    padding-left: 1.5rem;
    margin: 0 0 1rem;
}

.article-body li { margin-bottom: .4rem; }

.article-body a { color: var(--primary); text-decoration: underline; }

/* Related Articles */
.related-articles { margin-top: 2.5rem; border-top: 1.5px solid var(--border); padding-top: 1.5rem; }
.related-articles h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* Article tools strip */
.article-tools-strip {
    margin-top: 2rem;
    border-top: 1.5px solid var(--border);
    padding-top: 1.25rem;
}

.article-tools-strip h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .85rem;
    color: var(--text);
}

.tools-strip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.tool-chip {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    font-size: .85rem;
    font-weight: 500;
    background: #fff;
    transition: border-color .15s, background .15s;
}

.tool-chip:hover { border-color: var(--primary); background: rgba(239,51,72,.04); }
.tool-icon.small { width: 22px; height: 22px; padding: 3px; }

/* ── AI Tools Grid ────────────────────────────────── */
.ai-tools-grid { margin-bottom: 2rem; }

.ai-tool-card { cursor: pointer; }

.coming-soon-card { opacity: .8; }

/* ── Side article links ───────────────────────────── */
.side-article-link {
    display: block;
    font-size: .85rem;
    color: var(--text);
    text-decoration: none;
    padding: .45rem 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.45;
    transition: color .15s;
}

.side-article-link:hover { color: var(--primary); }

/* ── QR Tools ─────────────────────────────────────── */
.qr-tool-wrapper {
    max-width: 520px;
}

.drop-zone-qr {
    border: 2.5px dashed var(--border);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}

.drop-zone-qr:hover,
.drop-zone-qr.drag-over {
    border-color: var(--primary);
    background: rgba(239,51,72,.04);
}

.drop-zone-qr .icon { width: 40px; height: 40px; color: var(--muted); }
.drop-zone-qr p { margin: 0; font-weight: 600; font-size: .95rem; }
.drop-zone-qr small { color: var(--muted); font-size: .82rem; }

.qr-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.qr-preview-wrap img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    display: block;
}

.qr-loading {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 0;
    color: var(--muted);
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.qr-result-card {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    background: #fff;
    margin-bottom: 1.25rem;
}

.qr-result-card h3 { font-size: .9rem; color: var(--muted); margin: 0 0 .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.qr-result-text {
    font-family: 'Courier New', monospace;
    font-size: .92rem;
    word-break: break-all;
    background: var(--app-bg);
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
}

.qr-result-actions { display: flex; gap: .65rem; flex-wrap: wrap; }

.qr-error {
    color: #c0392b;
    background: rgba(192,57,43,.08);
    border: 1.5px solid rgba(192,57,43,.2);
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .9rem;
    margin-bottom: 1rem;
}

/* QR Generator specific */
.qr-gen-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }

.qr-gen-form label { display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; font-weight: 600; }

.qr-gen-form textarea {
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    resize: vertical;
    outline: none;
    transition: border-color .18s;
    color: var(--text);
    background: #fff;
}

.qr-gen-form textarea:focus { border-color: var(--primary); }

.qr-gen-options {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
}

.option-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    font-weight: 500;
}

.option-row select, .option-row input[type="color"] {
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: .3rem .5rem;
    font-size: .88rem;
    cursor: pointer;
}

.option-row input[type="color"] { padding: 0; width: 36px; height: 32px; cursor: pointer; }

.qr-gen-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.qr-canvas-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.qr-canvas-wrap canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ── FAQ & How-to ─────────────────────────────────── */
.faq-section {
    margin-top: 2.5rem;
    border-top: 1.5px solid var(--border);
    padding-top: 1.5rem;
}

.faq-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.how-to-steps {
    padding-left: 1.3rem;
    margin-bottom: 1.5rem;
}

.how-to-steps li {
    margin-bottom: .55rem;
    font-size: .93rem;
    line-height: 1.55;
}

.faq-list details {
    border-bottom: 1px solid var(--border);
    padding: .65rem 0;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .93rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-list summary::after { content: '+'; font-size: 1.1rem; color: var(--muted); }
.faq-list details[open] summary::after { content: '−'; }

.faq-list details p {
    margin: .6rem 0 0;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.6;
}

.related-tools-strip {
    margin-top: 2rem;
    border-top: 1.5px solid var(--border);
    padding-top: 1.25rem;
}

.related-tools-strip h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .85rem;
}

/* ── Blog Admin ───────────────────────────────────── */
.admin-form-section {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.admin-form-section h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 1.25rem; }

.blog-admin-form label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
}

.blog-admin-form input[type="text"],
.blog-admin-form input[type="url"],
.blog-admin-form textarea,
.blog-admin-form select {
    padding: .6rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .93rem;
    outline: none;
    background: var(--app-bg);
    color: var(--text);
    transition: border-color .18s;
}

.blog-admin-form input:focus,
.blog-admin-form textarea:focus,
.blog-admin-form select:focus { border-color: var(--primary); background: #fff; }

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: .5rem !important;
    cursor: pointer;
    font-weight: 500 !important;
}

.admin-articles-list { margin-top: 1.5rem; }

.badge-green {
    display: inline-block;
    background: rgba(84,194,118,.15);
    color: #1b7e3c;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 20px;
}

.badge-gray {
    display: inline-block;
    background: rgba(102,112,133,.12);
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 20px;
}

.small-btn { padding: .35rem .7rem !important; font-size: .82rem !important; }

/* ── 404 Page ─────────────────────────────────────── */
.error-404-page {
    text-align: center;
    padding: 3rem 1.5rem;
}

.error-404-art {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.e404-num {
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.e404-icon .icon {
    width: 64px;
    height: 64px;
    color: var(--muted);
    opacity: .7;
}

.error-404-page h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 .65rem;
}

.error-404-page p {
    color: var(--muted);
    margin: 0 0 1.5rem;
    max-width: 400px;
    margin-inline: auto;
}

.error-404-actions {
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

/* ── Lazy Loading ─────────────────────────────────── */
img[loading="lazy"] { transition: opacity .3s; }

/* ── Responsive tweaks for new features ──────────── */
@media (max-width: 640px) {
    .blog-grid { grid-template-columns: 1fr; }
    .single-article h1 { font-size: 1.4rem; }
    .article-cta-bar { flex-direction: column; }
    .e404-num { font-size: 3.5rem; }
    .e404-icon .icon { width: 44px; height: 44px; }
    .qr-gen-options { flex-direction: column; }
    .error-404-actions { flex-direction: column; align-items: center; }
}

/* ══════════════════════════════════════════════════
   AI Tools — Shared Styles
   ══════════════════════════════════════════════════ */

/* Workspace layout override for AI tools */
.ai-tool-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.5rem;
    align-items: start;
}

/* Notices */
.ai-notice {
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: .93rem;
    line-height: 1.6;
}
.ai-notice strong { display: block; margin-bottom: .25rem; }
.ai-notice a { color: var(--primary); text-decoration: underline; }
.ai-notice-warn  { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.ai-notice-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* Upload / Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--app-bg);
    margin-bottom: 1.25rem;
    position: relative;
}
.drop-zone:hover,
.drop-zone.drop-active { border-color: var(--primary); background: #fff5f6; }
.drop-input {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.drop-inner {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    pointer-events: none;
}
.drop-inner .icon { width: 36px; height: 36px; color: var(--primary); margin-bottom: .25rem; }
.drop-inner strong { font-size: 1rem; color: var(--text); }
.drop-inner span { font-size: .85rem; color: var(--muted); }
.drop-hint { font-size: .78rem !important; margin-top: .25rem; }
.drop-filename {
    margin-top: .75rem; font-size: .88rem; color: var(--primary); font-weight: 600;
    pointer-events: none;
}
.drop-preview {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    margin-top: .75rem; pointer-events: none;
}

/* AI Submit Button */
.ai-submit-btn { width: 100%; margin-top: .25rem; font-size: 1rem; min-height: 52px; }

/* Loading spinner */
.ai-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; padding: 2.5rem; color: var(--muted);
}
.ai-spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Options row */
.ai-options-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem;
}
.ai-option-label,
.field-label {
    display: flex; flex-direction: column; gap: .35rem;
    font-size: .88rem; font-weight: 600; color: var(--text);
}
.ai-option-label select,
.ai-option-label input,
.field-label select,
.field-label input,
.field-label textarea {
    padding: .6rem .85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .93rem;
    background: #fff;
    color: var(--text);
    transition: border-color .15s;
}
.field-label textarea { resize: vertical; min-height: 80px; }
.field-label select:focus,
.field-label input:focus,
.field-label textarea:focus,
.ai-option-label select:focus { outline: none; border-color: var(--primary); }
.required { color: var(--primary); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.stacked-form { display: flex; flex-direction: column; gap: 1rem; }

/* Result card */
.ai-result-card { display: flex; flex-direction: column; gap: 1.25rem; }
.ai-result-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; flex-wrap: wrap;
}
.ai-result-header h2 { margin: 0; font-size: 1.2rem; }
.result-meta { font-size: .85rem; color: var(--muted); margin-top: .2rem; }

/* Badges */
.badge-green {
    display: inline-block; padding: .15rem .55rem; border-radius: 20px;
    background: #d1fae5; color: #065f46; font-size: .78rem; font-weight: 700;
}
.badge-gray {
    display: inline-block; padding: .15rem .55rem; border-radius: 20px;
    background: #f3f4f6; color: var(--muted); font-size: .78rem;
}

/* Tags / Keywords */
.keywords-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }
.kw-badge {
    padding: .25rem .7rem; border-radius: 20px; font-size: .8rem; font-weight: 500;
    background: #ede9fe; color: #5b21b6;
}
.tag-item {
    display: inline-block; padding: .2rem .65rem; border-radius: 20px;
    background: #f3f4f6; color: var(--text); font-size: .8rem; font-weight: 500;
}
.tag-blue { background: #dbeafe; color: #1d4ed8; }

/* How It Works list */
.how-it-works { padding-left: 1.1rem; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.how-it-works li { font-size: .9rem; color: var(--muted); }

/* mt helpers */
.mt-2 { margin-top: 1rem; }

/* ── Resume Analyzer ─────────────────────────────── */
.resume-score-row {
    display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
    background: #fafafa; border: 1px solid var(--border);
    border-radius: 14px; padding: 1.5rem;
}
.resume-score-circle { position: relative; width: 120px; height: 120px; flex: 0 0 auto; }
.score-ring { width: 120px; height: 120px; }
.score-num {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-num strong { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.score-num span { font-size: .75rem; color: var(--muted); }
.score-grade { font-size: 2.5rem; font-weight: 900; line-height: 1; }
.score-summary { font-size: .9rem; color: var(--muted); margin: .5rem 0; max-width: 380px; }
.score-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.resume-sections {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem;
}
.resume-section-card {
    background: #fafafa; border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem 1.1rem;
}
.resume-section-card h3 { margin: 0 0 .65rem; font-size: .95rem; }
.resume-section-card ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.resume-section-card li { font-size: .87rem; color: var(--muted); }
.strengths { border-top: 3px solid var(--tool-green); }
.weaknesses { border-top: 3px solid var(--primary); }
.suggestions { border-top: 3px solid var(--accent); }
.keywords { border-top: 3px solid var(--tool-purple); grid-column: span 2; }
.sections-check { border-top: 3px solid var(--tool-blue); grid-column: span 2; }
.sections-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.sec-badge {
    padding: .2rem .65rem; border-radius: 20px; font-size: .78rem; font-weight: 600;
}
.sec-found { background: #d1fae5; color: #065f46; }
.sec-missing { background: #fee2e2; color: #991b1b; }

/* ── PDF Summarizer ──────────────────────────────── */
.topic-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.key-points { background: #f9fafb; border-radius: 10px; padding: 1rem; }
.key-points h3 { margin: 0 0 .5rem; font-size: .95rem; }
.key-points ul { margin: 0; padding-left: 1.2rem; }
.key-points li { font-size: .9rem; margin-bottom: .3rem; color: var(--text); }
.summary-body {
    font-size: .95rem; line-height: 1.75; color: var(--text);
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 1.1rem 1.25rem;
}

/* ── Chat With PDF ──────────────────────────────── */
.chat-container {
    display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
    background: #fff;
}
.chat-header {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1.1rem;
    background: #f9fafb; border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.chat-header .icon { color: var(--primary); width: 18px; height: 18px; }
.chat-messages {
    flex: 1; overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: .85rem;
    min-height: 320px; max-height: 450px;
}
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.msg-bubble {
    max-width: 80%; padding: .7rem 1rem;
    border-radius: 14px; font-size: .91rem; line-height: 1.6;
}
.chat-msg.user .msg-bubble {
    background: var(--primary); color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.assistant .msg-bubble {
    background: #f3f4f6; color: var(--text);
    border-bottom-left-radius: 4px;
}
.typing { display: flex; gap: 4px; align-items: center; padding: .85rem 1rem !important; }
.typing span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--muted); animation: typingDot 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.chat-input-row {
    display: flex; gap: .5rem; padding: .75rem 1rem;
    border-top: 1px solid var(--border); background: #f9fafb;
}
.chat-input-row input {
    flex: 1; padding: .6rem .9rem;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: .93rem; background: #fff;
}
.chat-input-row input:focus { outline: none; border-color: var(--primary); }
.chat-input-row .primary-button { min-height: 40px; padding: 0 1.25rem; font-size: .9rem; }

/* ── Image to Text / Translator ─────────────────── */
.ocr-textarea {
    width: 100%; padding: .85rem 1rem;
    border: 1px solid var(--border); border-radius: 10px;
    font-size: .91rem; line-height: 1.7; background: #f9fafb;
    resize: vertical; color: var(--text); font-family: inherit;
}
.translation-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.translation-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.trans-panel { display: flex; flex-direction: column; gap: .5rem; }
.trans-panel-header { display: flex; justify-content: space-between; align-items: center; }
.trans-panel-header strong { font-size: .9rem; }
.copy-btn-sm {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    padding: .2rem .5rem; font-size: .8rem; cursor: pointer; color: var(--muted);
    transition: border-color .15s;
}
.copy-btn-sm:hover { border-color: var(--primary); color: var(--primary); }

/* ── Cover Letter ────────────────────────────────── */
.cover-letter-output {
    font-size: .93rem; line-height: 1.85; color: var(--text);
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 1.5rem; white-space: pre-wrap; font-family: 'Georgia', serif;
    min-height: 200px;
}

/* ── Admin AI Settings panel ─────────────────────── */
.ai-settings-box {
    background: #f9fafb; border: 1px solid var(--border);
    border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
}
.ai-settings-box h3 { margin: 0 0 1rem; font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.ai-key-row { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; }
.ai-key-row input { font-family: monospace; letter-spacing: .5px; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    .ai-tool-workspace { grid-template-columns: 1fr; }
    .resume-sections { grid-template-columns: 1fr; }
    .keywords, .sections-check { grid-column: span 1; }
    .translation-panels { grid-template-columns: 1fr; }
    .form-row-2 { grid-template-columns: 1fr; }
    .ai-options-row { grid-template-columns: 1fr; }
    .resume-score-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
    .resume-score-row { padding: 1rem; }
    .chat-messages { min-height: 240px; }
}
