* {
    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: space-between;
    gap: 24px;
    position: relative;
    margin-bottom: 10px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.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: 320px;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(0, 560px);
    align-items: center;
    padding: 48px 56px;
    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;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-height: 260px;
}

.hero-banner-img {
    width: 100%;
    height: 280px;
    max-width: 560px;
    object-fit: cover;
    object-position: 62% center;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(16, 24, 40, 0.28);
    display: block;
    transition: transform 300ms ease;
}

.hero-banner-img:hover {
    transform: translateY(-4px) scale(1.01);
}

.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);
}

/* Old upload widget input — hidden, JS handles clicks */
.drop-zone > input[type="file"]:not(.drop-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%;
    pointer-events: auto !important;  /* Must override .drop-zone input rule */
    z-index: 2;
}
.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; }
}

/* Modern local OCR, translator, and QR tools */
.tool-modern-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-drop-zone {
    min-height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-drop-zone:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(239, 51, 72, .1);
}

.drop-preview img,
.qr-preview-wrap img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
}

.tool-control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.tool-result-card {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.tool-actions-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}

.tool-alert {
    border-radius: 10px;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    font-size: .92rem;
    line-height: 1.55;
}

.tool-alert-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

.tool-alert-warning {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.tool-alert-success {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.qr-tool-wrapper {
    width: 100%;
    max-width: 680px;
}

.qr-gen-preview {
    align-items: stretch;
}

.qr-canvas-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.qr-code-output {
    display: flex;
    justify-content: center;
}

.qr-code-output canvas,
.qr-code-output img {
    width: min(100%, 420px) !important;
    height: auto !important;
    margin-inline: auto;
    display: block;
}

.qr-pro-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 1.5rem;
    align-items: start;
}

.qr-pro-controls {
    min-width: 0;
}

.qr-pro-preview {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.qr-type-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.qr-type-panel.active {
    display: flex;
}

.qr-pro-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.qr-pro-section h2 {
    margin: 0;
    font-size: 1rem;
}

.qr-check {
    align-self: end;
    min-height: 40px;
}

.qr-download-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .65rem;
}

.qr-empty-state {
    min-height: 320px;
    width: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #f9fafb;
    text-align: center;
    padding: 1rem;
}

.qr-code-output svg {
    width: min(100%, 420px);
    height: auto;
    display: block;
    margin-inline: auto;
}

/* Image Tools section and pages */
.image-tools-section {
    display: grid;
    grid-template-columns: minmax(240px, .42fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: stretch;
    margin-bottom: 2.25rem;
}

.image-tools-copy {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.35rem;
    background: linear-gradient(180deg, #ffffff, #f9fafb);
}

.image-tools-copy h2 {
    margin: .7rem 0 .65rem;
    font-size: 1.35rem;
    line-height: 1.2;
}

.image-tools-copy p {
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
}

.image-tools-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .85rem;
}

.image-tools-directory {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.image-tool-card {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.image-tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(239, 51, 72, .35);
    box-shadow: 0 16px 34px rgba(17, 24, 39, .08);
}

.image-tool-card .tool-icon {
    width: 38px;
    height: 38px;
}

.image-tool-card strong {
    font-size: .95rem;
}

.image-tool-card p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
}

.image-tool-title {
    margin-bottom: 1.25rem;
}

.image-tool-hero {
    align-items: center;
}

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

.image-local-app {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-drop-zone {
    min-height: 220px;
}

.image-options-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-option {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
}

.image-check {
    align-self: end;
    min-height: 40px;
}

.image-results {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.image-result-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .85rem;
    background: #fff;
}

.image-result-preview,
.image-thumb {
    width: 96px;
    height: 72px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f9fafb;
    object-fit: contain;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: .78rem;
}

.image-result-meta {
    min-width: 0;
}

.image-result-meta strong,
.image-result-meta p {
    overflow-wrap: anywhere;
}

.image-result-meta p {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: .86rem;
}

.image-base64-output {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.color-picker-card {
    grid-template-columns: minmax(0, 1fr);
}

.color-picker-canvas {
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: crosshair;
    background: #fff;
}

.picked-color-row {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin-top: .7rem;
}

.picked-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
}

.picked-color-row code {
    font-size: .85rem;
    white-space: normal;
}

/* Blog linked tools admin and article cards */
.linked-tools-admin {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
}

.linked-tools-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.linked-tools-head h3 {
    margin: 0 0 .25rem;
    font-size: 1rem;
}

.linked-tools-head p {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.5;
}

.linked-tool-search {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .9rem;
    font-weight: 600;
    font-size: .88rem;
}

.linked-tool-search input {
    padding: .65rem .85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.linked-tool-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin-bottom: .9rem;
}

.linked-tool-suggestions .kw-badge {
    border: 0;
    cursor: pointer;
}

.linked-tool-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .65rem;
    max-height: 430px;
    overflow: auto;
    padding-right: .25rem;
}

.linked-tool-option {
    display: grid !important;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: .65rem !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .75rem;
    background: #f9fafb;
    cursor: pointer;
}

.linked-tool-option:hover {
    border-color: rgba(239, 51, 72, .35);
    background: #fff;
}

.linked-tool-option small {
    display: block;
    color: var(--muted);
    line-height: 1.35;
    font-weight: 400;
    margin-top: .2rem;
}

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

.article-related-tools h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.article-related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: .85rem;
}

.article-related-tool-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
    text-decoration: none;
    color: var(--text);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.article-related-tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(239, 51, 72, .35);
    box-shadow: 0 14px 30px rgba(17, 24, 39, .08);
}

.article-related-tool-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: .9rem;
}

.article-related-tool-card .outline-button {
    justify-content: center;
    margin-top: auto;
}

@media (max-width: 980px) {
    .qr-pro-layout {
        grid-template-columns: 1fr;
    }

    .qr-pro-preview {
        position: static;
    }

    .image-tools-section,
    .image-tool-workspace {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 520px) {
    .qr-download-row {
        grid-template-columns: 1fr;
    }

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

    .image-result-card {
        grid-template-columns: 1fr;
    }

    .image-result-preview,
    .image-thumb {
        width: 100%;
        height: 180px;
    }
}

@media (max-width: 720px) {
    .tool-control-grid {
        grid-template-columns: 1fr;
    }

    .tool-actions-row,
    .qr-result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-actions-row > *,
    .qr-result-actions > * {
        width: 100%;
        justify-content: center;
    }
}
/* ── Full-Image Hero Section — Professional ───────────────────── */
.hero-full-section {
    position: relative;
    margin-bottom: 28px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(16, 24, 40, 0.04),
        0 20px 48px rgba(16, 24, 40, 0.11);
    border: 1px solid rgba(200, 210, 235, 0.5);
}

.hero-full-img-wrap {
    display: block;
    width: 100%;
    line-height: 0;
}

/* ✅ Image at full natural dimensions — no cropping */
.hero-full-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

/* Floating action bar overlaid at the bottom of the image */
.hero-full-actions {
    position: absolute;
    bottom: 20px;
    left: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow:
        0 8px 24px rgba(16, 24, 40, 0.14),
        0 2px 6px rgba(16, 24, 40, 0.06);
}

.hero-full-actions .primary-button {
    min-height: 42px;
    min-width: 160px;
    font-size: 15px;
    padding: 0 22px;
    background: linear-gradient(135deg, var(--primary), #f53b4d);
    color: #fff;
    box-shadow: 0 6px 18px rgba(239, 51, 72, 0.30);
    border-radius: 8px;
}

.hero-full-actions .outline-button {
    min-height: 42px;
    min-width: 140px;
    padding: 0 20px;
    border: 1.5px solid rgba(16, 24, 40, 0.18);
    border-radius: 8px;
    background: transparent;
    color: #344054;
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.hero-full-actions .outline-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(239, 51, 72, 0.05);
}

/* Dark mode adjustments */
.dark-mode .hero-full-section {
    border-color: rgba(60, 70, 100, 0.5);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.dark-mode .hero-full-actions {
    background: rgba(22, 27, 39, 0.88);
    border-color: rgba(60, 70, 100, 0.7);
}

.dark-mode .hero-full-actions .outline-button {
    border-color: rgba(200, 210, 235, 0.25);
    color: #C8CEDF;
}

@media (max-width: 720px) {
    .hero-full-actions {
        left: 50%;
        transform: translateX(-50%);
        bottom: 14px;
        white-space: nowrap;
        gap: 8px;
        padding: 8px 14px;
    }

    .hero-full-actions .primary-button,
    .hero-full-actions .outline-button {
        min-width: unset;
        min-height: 38px;
        font-size: 14px;
        padding: 0 16px;
    }
}

@media (max-width: 460px) {
    .hero-full-actions {
        flex-direction: column;
        left: 16px;
        right: 16px;
        transform: none;
        bottom: 12px;
    }

    .hero-full-actions .primary-button,
    .hero-full-actions .outline-button {
        width: 100%;
        justify-content: center;
    }
}

/* ── Hero Banner Image — Responsive ───────────────────────────── */
@media (max-width: 1100px) {
    .hero-panel {
        grid-template-columns: minmax(300px, 1fr) minmax(0, 460px);
        padding: 40px 44px;
    }

    .hero-banner-img {
        height: 240px;
    }
}

@media (max-width: 860px) {
    .hero-panel {
        grid-template-columns: 1fr;
        min-height: unset;
        padding: 44px 36px;
    }

    .hero-art {
        display: none;
    }

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

@media (max-width: 600px) {
    .hero-panel {
        padding: 36px 24px;
    }

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

    .hero-copy p {
        font-size: 15px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 14px;
    }

    .white-button,
    .ghost-button {
        min-width: unset;
        width: 100%;
    }
}

/* ══════════════════════════════════════════════
   DARK MODE TOGGLE BUTTON
══════════════════════════════════════════════ */
.dark-toggle {
    font-size: 18px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: #F2F4F7;
    border: 1px solid #E4E7EC;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dark-toggle:hover {
    transform: scale(1.12);
    background: #E9EAEF;
}

/* Show moon in light mode, hide sun */
.dark-toggle .dark-icon  { display: inline; }
.dark-toggle .light-icon { display: none;   }

/* Show sun in dark mode, hide moon */
.dark-mode .dark-toggle .dark-icon  { display: none;   }
.dark-mode .dark-toggle .light-icon { display: inline; }

.dark-mode .dark-toggle {
    background: #2A2D3A;
    border-color: #3D4155;
}

/* ══════════════════════════════════════════════
   GLOBAL TRANSITION FOR SMOOTH DARK MODE SWITCH
══════════════════════════════════════════════ */
html {
    transition:
        background-color 320ms ease,
        color 320ms ease;
}

*, *::before, *::after {
    transition:
        background-color 300ms ease,
        color 280ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease;
}

/* ══════════════════════════════════════════════
   DARK MODE — CSS VARIABLE OVERRIDES
══════════════════════════════════════════════ */
html.dark-mode {
    --app-bg:      #0F1117;
    --sidebar-bg:  #161B27;
    --text:        #F0F2F8;
    --muted:       #8A93A8;
    --border:      #2C3045;
}

/* ══════════════════════════════════════════════
   DARK MODE — COMPONENT STYLES
══════════════════════════════════════════════ */

/* Body */
.dark-mode body {
    background: var(--app-bg);
    color: var(--text);
}

/* Sidebar */
.dark-mode .sidebar {
    background: var(--sidebar-bg);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.4);
}

.dark-mode .side-link {
    color: #8A93A8;
}

.dark-mode .side-link.active {
    background: rgba(239, 51, 72, 0.15);
    color: #ff6b7a;
}

.dark-mode .nav-divider {
    color: #4B5674;
}

.dark-mode .nav-divider::after {
    background: #252A3D;
}

/* Topbar */
.dark-mode .topbar {
    border-color: var(--border);
}

.dark-mode .icon-button,
.dark-mode .icon-action {
    color: #8A93A8;
}

.dark-mode .icon-button:hover {
    background: #1E2235;
}

/* Cards */
.dark-mode .tool-card {
    background: #161B27;
    border-color: #252A3D;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.dark-mode .tool-card:hover {
    border-color: rgba(239, 51, 72, 0.4);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.dark-mode .tool-card strong {
    color: #E8EBF5;
}

.dark-mode .tool-card p {
    color: #8A93A8;
}

/* Documents table */
.dark-mode .documents-table {
    background: #161B27;
    border-color: #252A3D;
}

.dark-mode .table-row {
    border-color: #252A3D;
    color: #8A93A8;
}

.dark-mode .doc-name {
    color: #C8CEDF;
}

.dark-mode .table-head {
    background: #1A1F2F;
    color: #6B7492;
}

/* Floating menus */
.dark-mode .floating-menu,
.dark-mode .row-menu {
    background: #1E2235;
    border-color: #2C3045;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.dark-mode .floating-menu a,
.dark-mode .row-menu a,
.dark-mode .row-menu button {
    color: #C8CEDF;
}

.dark-mode .floating-menu a:hover,
.dark-mode .row-menu a:hover,
.dark-mode .row-menu button:hover {
    background: #252A3D;
}

/* Modal */
.dark-mode .modal-backdrop {
    background: rgba(0, 0, 0, 0.75);
}

.dark-mode .modal-card {
    background: #161B27;
    border-color: #252A3D;
    color: #E8EBF5;
}

.dark-mode .drop-zone {
    background: #1A1F2F;
    border-color: #3D4155;
}

/* Forms & inputs */
.dark-mode input,
.dark-mode select,
.dark-mode textarea {
    background: #1A1F2F;
    color: #E8EBF5;
    border-color: #3D4155;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: #4B5674;
}

/* Section headings */
.dark-mode .section-heading h2 {
    color: #E8EBF5;
}

.dark-mode .section-heading a {
    color: #8A93A8;
}

.dark-mode .section-heading a:hover {
    color: #ff7a87;
}

/* Hero full image section */
.dark-mode .hero-full-actions {
    background: #161B27;
    border-color: #252A3D;
}

/* Blog cards */
.dark-mode .blog-card {
    background: #161B27;
    border-color: #252A3D;
}

.dark-mode .blog-card h3 {
    color: #E8EBF5;
}

.dark-mode .blog-card p {
    color: #8A93A8;
}

/* Admin shell */
.dark-mode .admin-main,
.dark-mode .admin-shell {
    background: var(--app-bg);
    color: var(--text);
}

.dark-mode .admin-sidebar {
    background: var(--sidebar-bg);
    border-color: #252A3D;
}

.dark-mode .admin-card,
.dark-mode .admin-card.compact-card {
    background: #161B27;
    border-color: #252A3D;
    color: #E8EBF5;
}

/* Footer */
.dark-mode .site-footer {
    background: #0D1020;
    border-color: #252A3D;
    color: #6B7492;
}

/* Image tools */
.dark-mode .image-tool-card {
    background: #161B27;
    border-color: #252A3D;
}

/* Buttons */
.dark-mode .outline-button {
    border-color: #3D4155;
    color: #C8CEDF;
}

.dark-mode .outline-button:hover {
    border-color: var(--primary);
    color: #ff7a87;
    background: rgba(239, 51, 72, 0.08);
}

/* Page titles */
.dark-mode .page-title h1,
.dark-mode .welcome h1 {
    color: #F0F2F8;
}

.dark-mode .page-title p,
.dark-mode .welcome p {
    color: #8A93A8;
}

/* Empty states */
.dark-mode .empty-state {
    color: #4B5674;
}

/* Scrollbar (webkit) */
.dark-mode ::-webkit-scrollbar-track {
    background: #161B27;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #2C3045;
    border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #3D4155;
}

/* ── Screen Reader / SEO Only ─────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Tool SEO Content Section ─────────────────────────────────── */
.tool-seo-content {
    max-width: 820px;
    margin: 2.5rem auto 2rem;
    padding: 2rem 2rem 1.5rem;
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    line-height: 1.75;
    color: var(--text);
}
.tool-seo-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.tool-seo-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text);
}
.tool-seo-content p {
    color: var(--muted);
    margin-bottom: 1rem;
}
.tool-seo-content ul {
    padding-left: 1.4rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.tool-seo-content ul li {
    margin-bottom: 0.35rem;
}
.faq-list dt {
    font-weight: 600;
    color: var(--text);
    margin-top: 1rem;
}
.faq-list dd {
    color: var(--muted);
    margin-left: 0;
    margin-top: 0.2rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary);
}
.dark-mode .tool-seo-content {
    background: #1a1f2e;
    border-color: #2d3348;
}

/* ── How It Works Section ─────────────────────────────────────── */
.how-it-works {
    padding: 1.5rem 1.5rem 0.5rem;
    max-width: 900px;
    margin: 0 auto;
}
.how-steps {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.how-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1rem;
}
.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.how-step h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    color: var(--text);
}
.how-step p {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
}
.dark-mode .how-step {
    background: #1a1f2e;
    border-color: #2d3348;
}
@media (max-width: 600px) {
    .how-steps { flex-direction: column; }
    .how-step { min-width: unset; }
}
