/* ============================================================
   IMGBUG — EDITORIAL DESIGN SYSTEM & IMAGE WORKSPACE STYLESHEET
   Swiss-inspired editorial typography + precision creative software UI
   ============================================================ */

@font-face {
    font-family: "Sofia Pro";
    src: url("../fonts/SofiaPro-Light.woff2") format("woff2"),
         url("../fonts/SofiaPro-Light.woff") format("woff");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sofia Pro";
    src: url("../fonts/SofiaPro.woff2") format("woff2"),
         url("../fonts/SofiaPro.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sofia Pro";
    src: url("../fonts/SofiaPro-SemiBold.woff2") format("woff2"),
         url("../fonts/SofiaPro-SemiBold.woff") format("woff");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-primary: #F8F7F2;
    --bg-secondary: #F1F0EA;
    --text-primary: #252525;
    --text-secondary: #77756F;
    --border: #E6E4DD;
    --border-strong: #D5D2C8;
    --accent: #E56A4A;
    --accent-hover: #CC5536;
    --accent-text: #B84224;
    --success: #34856A;
    --error: #C84E4E;
    --white: #FFFFFF;
    --radius-sm: 4px;
    --radius-md: 8px;
    --font-sans: "Sofia Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --container-max: 1366px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: var(--white);
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

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

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 10000;
    padding: 10px 16px;
    background: var(--text-primary);
    color: var(--white);
    font-size: 13px;
}
.skip-link:focus {
    left: 12px;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   TYPOGRAPHY & EDITORIAL HELPERS
   ============================================================ */

.editorial-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.editorial-eyebrow i {
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--accent);
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 400;
    color: var(--text-primary);
}

h1 em, h2 em {
    font-style: normal;
    color: var(--accent-text);
}

/* Buttons */
.btn-accent,
.btn-outline,
.btn-editorial-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}
.btn-accent:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-outline {
    background: var(--white);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--text-primary);
    background: var(--bg-secondary);
}

.btn-editorial-dark {
    width: 100%;
    justify-content: space-between;
    padding: 15px 18px;
    border-radius: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
}
.btn-editorial-dark:hover {
    background: var(--accent);
    color: var(--white);
}

.btn-sm {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px;
}

.btn-xs {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

/* ============================================================
   GLOBAL HEADER & DROPDOWN NAVIGATION
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(248, 247, 242, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.brand-logo img {
    display: block;
    height: 32px;
    width: auto;
}

.brand-tagline {
    padding-left: 14px;
    border-left: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 13px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-item.has-dropdown > a::after {
    content: "";
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.nav-item:hover > a,
.nav-item:focus-within > a {
    color: var(--accent-text);
}

.nav-item.has-dropdown:hover > a::after,
.nav-item.has-dropdown:focus-within > a::after {
    transform: translateY(1px) rotate(225deg);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 248px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: 0 14px 36px rgba(37, 37, 37, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 950;
}

.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown li {
    border-bottom: 1px solid var(--bg-secondary);
}

.nav-dropdown li:last-child {
    border-bottom: 0;
}

.nav-dropdown a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    transition: background-color 0.15s ease, padding-left 0.15s ease, color 0.15s ease;
}

.nav-dropdown a:hover,
.nav-dropdown a:focus-visible {
    background: var(--bg-primary);
    color: var(--accent-text);
    padding-left: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-link {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.header-link:hover {
    color: var(--text-primary);
}

.btn-header-cta {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.btn-header-cta:hover {
    background: var(--accent);
    color: var(--white);
}

.mobile-menu-trigger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
}
.mobile-menu-trigger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
}

/* Mobile Drawer */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(37, 37, 37, 0.5);
    z-index: 980;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 390px;
    height: 100dvh;
    background: url("../img/dots.png") repeat left top #252525;
    color: var(--bg-primary);
    z-index: 990;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 22px 24px 32px;
}

.mobile-drawer.is-open {
    transform: translateX(0);
}

.mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(248, 247, 242, 0.14);
}

.mobile-drawer-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(248, 247, 242, 0.3);
    border-radius: 50%;
    background: transparent;
    color: var(--bg-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.mobile-drawer-nav {
    margin-top: 16px;
}

.mobile-nav-group {
    border-bottom: 1px solid rgba(248, 247, 242, 0.14);
}

.mobile-nav-group summary {
    padding: 14px 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mobile-nav-group summary::-webkit-details-marker {
    display: none;
}
.mobile-nav-group summary::after {
    content: "+";
    color: var(--accent);
    font-size: 18px;
}
.mobile-nav-group[open] summary::after {
    content: "−";
}

.mobile-nav-group ul {
    list-style: none;
    margin: 0 0 14px;
    padding: 0 0 0 14px;
    border-left: 2px solid var(--accent);
}

.mobile-nav-group li a {
    display: block;
    padding: 7px 0;
    font-size: 13.5px;
    color: rgba(248, 247, 242, 0.85);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}
.mobile-nav-links a {
    font-size: 14px;
    color: var(--bg-primary);
    padding: 6px 0;
}

/* ============================================================
   HERO & TOOL HERO
   ============================================================ */

.hero-editorial {
    padding: 52px 0 36px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 48px;
    align-items: end;
}

.hero-editorial h1 {
    font-size: clamp(38px, 4.8vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    max-width: 720px;
}

.hero-supporting p {
    margin: 0 0 22px;
    color: var(--text-secondary);
    font-size: 16.5px;
    line-height: 1.75;
    max-width: 480px;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.trust-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.trust-pills span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.trust-pills span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

/* Tool Page Hero */
.tool-hero {
    padding: 36px 0 28px;
    border-bottom: 1px solid var(--border);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.breadcrumbs a:hover {
    color: var(--text-primary);
}

.tool-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 40px;
    align-items: end;
}

.tool-hero h1 {
    font-size: clamp(32px, 3.8vw, 50px);
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.tool-hero-lead p {
    margin: 0 0 16px;
    color: var(--text-secondary);
    font-size: 15.5px;
    line-height: 1.75;
}

/* ============================================================
   UNIFIED IMAGE WORKSPACE
   ============================================================ */

.workspace-section {
    padding: 32px 0 40px;
}

.workspace-shell {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Dropzone */
.ws-dropzone {
    padding: 24px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.ws-dropzone.is-dragover {
    background: #FDF1ED;
    outline: 2px dashed var(--accent);
    outline-offset: -8px;
}

.ws-dropzone-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.ws-dropzone-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-text);
    flex-shrink: 0;
}

.ws-dropzone-copy {
    flex: 1;
    min-width: 240px;
}

.ws-dropzone-copy h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 3px;
}

.ws-dropzone-copy p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

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

/* Workspace Tabs */
.ws-tabs-bar {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    padding: 0 16px;
    gap: 4px;
}

.ws-tab {
    position: relative;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s ease;
}

.ws-tab::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.ws-tab:hover {
    color: var(--text-primary);
}

.ws-tab.is-active {
    color: var(--text-primary);
}

.ws-tab.is-active::after {
    transform: scaleX(1);
}

/* Workspace Two-Column Grid */
.ws-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
    min-height: 460px;
}

.ws-main-col {
    padding: 20px 24px 28px;
    border-right: 1px solid var(--border);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ws-settings-col {
    padding: 20px 24px 28px;
    background: #FCFCFA;
    min-width: 0;
}

/* Queue Toolbar & Empty State */
.ws-queue-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ws-queue-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ws-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ws-queue-meta {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.ws-queue-btns {
    display: flex;
    gap: 8px;
}

.ws-empty-state {
    padding: 44px 28px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    text-align: center;
}

.ws-empty-kicker {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent-text);
    margin-bottom: 8px;
}

.ws-empty-state h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.ws-empty-state p {
    margin: 0 auto;
    max-width: 480px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

/* Queue Cards */
.ws-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 310px;
    overflow-y: auto;
    padding-right: 4px;
}

.ws-q-item {
    display: grid;
    grid-template-columns: auto 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ws-q-item:hover {
    border-color: var(--border-strong);
}

.ws-q-item.is-active {
    border-color: var(--accent);
    background: #FFF9F7;
}

.ws-q-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

.ws-q-info {
    min-width: 0;
}

.ws-q-name {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-q-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.ws-q-status {
    font-weight: 600;
}
.ws-q-status.is-done { color: var(--success); }
.ws-q-status.is-error { color: var(--error); }
.ws-q-status.is-working { color: var(--accent-text); }

.ws-q-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ws-icon-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--white);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ws-icon-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Stage Viewport & Before/After Comparison */
.ws-stage-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    overflow: hidden;
}

.ws-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    flex-wrap: wrap;
}

.ws-stage-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent-text);
}

.ws-stage-title {
    font-size: 14.5px;
    font-weight: 600;
    word-break: break-word;
}

.ws-stage-controls {
    display: flex;
    gap: 6px;
}

.ws-viewport {
    position: relative;
    min-height: 280px;
    max-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    background-image:
        linear-gradient(45deg, #ECEAE2 25%, transparent 25%),
        linear-gradient(-45deg, #ECEAE2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ECEAE2 75%),
        linear-gradient(-45deg, transparent 75%, #ECEAE2 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.ws-preview-wrap img {
    max-height: 390px;
    width: auto;
    display: block;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.ws-viewport.is-zoomed .ws-preview-wrap img {
    max-height: none;
    max-width: none;
}

.ws-cropper-wrap {
    width: 100%;
    height: 360px;
    background: #1E1E1E;
}
.ws-cropper-wrap img {
    display: block;
    max-width: 100%;
}

/* Before/After Comparison */
.ws-compare-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ws-compare-box {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    user-select: none;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
}

.ws-compare-img {
    display: block;
    max-height: 360px;
    width: auto;
    max-width: 100%;
}

.ws-compare-before-clip {
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
}

.ws-compare-before-clip .ws-compare-img {
    max-width: none;
    height: 100%;
    width: auto;
}

.ws-compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--white);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.ws-compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.ws-compare-tag {
    position: absolute;
    bottom: 10px;
    padding: 3px 8px;
    background: rgba(37, 37, 37, 0.78);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    border-radius: 2px;
}
.ws-tag-left { left: 10px; }
.ws-tag-right { right: 10px; }

.ws-compare-range {
    width: min(360px, 100%);
    accent-color: var(--accent);
}

.ws-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    background: var(--white);
}

.ws-stat {
    padding: 10px 14px;
    border-right: 1px solid var(--border);
}
.ws-stat:last-child { border-right: 0; }
.ws-stat span {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}
.ws-stat strong {
    font-size: 13px;
    font-weight: 600;
}

/* Progress & Results */
.ws-progress-card,
.ws-results-bar,
.ws-history-card {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

.ws-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ws-progress-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-progress-track {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.ws-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.ws-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #EFF7F4;
    border-color: #C7E0D7;
}

.ws-results-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--success);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ws-results-summary p {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
}

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

.ws-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.ws-history-head h4 {
    font-size: 14px;
    font-weight: 600;
}

.ws-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ws-history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: var(--white);
    border: 1px solid var(--border);
    font-size: 12.5px;
}

/* ============================================================
   RIGHT SETTINGS PANEL CONTROLS
   ============================================================ */

.ws-panel-head {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ws-panel-kicker {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent-text);
    margin-bottom: 4px;
}

.ws-panel-head h3 {
    font-size: 20px;
    font-weight: 600;
}

.ws-field {
    margin-bottom: 16px;
}

.ws-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.ws-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.ws-field-row label {
    margin-bottom: 0;
}

.ws-val-pill {
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
}

.ws-field input[type="text"],
.ws-field input[type="number"],
.ws-field input[type="email"],
.ws-field select,
.ws-field textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-primary);
    font-size: 13.5px;
}

.ws-field input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.ws-field input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
}

.ws-range-hints {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.ws-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
}

.ws-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ws-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ws-chip {
    padding: 5px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: var(--white);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.ws-chip:hover,
.ws-chip.is-active {
    border-color: var(--accent);
    background: #FDF1ED;
    color: var(--accent-text);
}

.ws-segmented {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.ws-seg-btn {
    padding: 7px 10px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.ws-seg-btn.is-active {
    background: var(--white);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ws-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.ws-subtab {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--white);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.ws-subtab.is-active {
    border-color: var(--text-primary);
    background: var(--text-primary);
    color: var(--white);
}

.ws-toggle,
.ws-step-toggle {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 12px;
    font-size: 13px;
    cursor: pointer;
}
.ws-toggle input,
.ws-step-toggle input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.ws-help {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.ws-help-inline {
    font-size: 12px;
    color: var(--text-secondary);
}

.ws-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-live-readout {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    margin-bottom: 14px;
}

.ws-notice {
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.ws-notice.is-warning {
    border-left-color: #B45309;
    background: #FEF7EC;
}
.ws-notice.is-success {
    border-left-color: var(--success);
    background: #EFF7F4;
}

.ws-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.ws-panel-actions {
    margin-top: 18px;
}

.ws-rule {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

.ws-step-config {
    margin: -4px 0 14px 24px;
}

/* Metadata, Inspector & Color Swatches */
.ws-meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin-bottom: 12px;
}
.ws-meta-table th,
.ws-meta-table td {
    text-align: left;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    word-break: break-word;
}
.ws-meta-table th {
    width: 40%;
    color: var(--text-secondary);
    font-weight: 600;
}

.ws-swatch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.ws-swatch-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    text-align: left;
}
.ws-swatch-card:hover {
    border-color: var(--text-primary);
}
.ws-swatch-chip {
    width: 28px;
    height: 28px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}
.ws-swatch-meta strong {
    display: block;
    font-size: 12.5px;
}
.ws-swatch-meta span {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================================
   EDITORIAL HOMEPAGE & TOOL LANDING BANDS
   ============================================================ */

.editorial-band {
    padding: 72px 0;
    border-top: 1px solid var(--border);
}

.band-secondary {
    background: var(--bg-secondary);
}

.section-head-split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.section-head-split h2 {
    font-size: clamp(28px, 3.4vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.section-head-split p {
    max-width: 420px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.editorial-text-link {
    font-size: 13.5px;
    font-weight: 600;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--accent);
    color: var(--text-primary);
}
.editorial-text-link:hover {
    color: var(--accent-text);
}

/* Hairline Editorial Tool Grid */
.tools-editorial-grid,
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    background: var(--white);
}

.tool-grid-card {
    display: flex;
    flex-direction: column;
    padding: 26px 24px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.tool-grid-card:hover {
    background: var(--bg-primary);
}

.tool-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tool-card-num {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.tool-card-cat {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.tool-grid-card h3 {
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 10px;
}

.tool-grid-card p {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.tool-card-arrow {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Three Pillars & Steps */
.three-col-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.editorial-card {
    padding: 28px 24px;
    background: var(--white);
    border: 1px solid var(--border);
}

.editorial-card-num {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent-text);
    margin-bottom: 12px;
}

.editorial-card h3 {
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 10px;
}

.editorial-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14.5px;
}

/* Presets Matrix */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.preset-tile {
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.preset-tile:hover {
    border-color: var(--accent);
}
.preset-tile small {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--accent-text);
    text-transform: uppercase;
}
.preset-tile strong {
    font-size: 15px;
}
.preset-tile span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Tool Documentation Grid */
.tool-docs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.doc-card {
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--border);
}

.doc-index {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent-text);
    margin-bottom: 10px;
}

.doc-card h2 {
    font-size: 23px;
    font-weight: 600;
    margin-bottom: 14px;
}

.doc-steps,
.doc-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.75;
}

.doc-steps li,
.doc-list li {
    margin-bottom: 8px;
}

.doc-limitation {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

/* FAQ Accordion */
.faq-split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 64px;
    align-items: start;
}

.faq-intro h2 {
    font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.faq-intro p {
    color: var(--text-secondary);
    max-width: 380px;
}

.faq-list {
    border-top: 1px solid var(--border-strong);
}

.faq-item {
    border-bottom: 1px solid var(--border-strong);
}

.faq-item summary {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 24px;
    gap: 14px;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-num {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-text);
}

.faq-q {
    font-size: 16px;
    font-weight: 600;
}

.faq-plus {
    position: relative;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
}

.faq-plus::before,
.faq-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 1.5px;
    background: var(--text-primary);
    transform: translate(-50%, -50%);
}
.faq-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}
.faq-item[open] .faq-plus {
    background: var(--text-primary);
    border-color: var(--text-primary);
}
.faq-item[open] .faq-plus::before,
.faq-item[open] .faq-plus::after {
    background: var(--white);
}
.faq-item[open] .faq-plus::after {
    transform: translate(-50%, -50%) rotate(0);
}

.faq-a {
    padding: 0 32px 20px 46px;
    color: var(--text-secondary);
    font-size: 14.5px;
}
.faq-a p {
    margin: 0;
}

/* ============================================================
   ADSENSE POLICY-COMPLIANT PLACEMENTS
   ============================================================ */

.ad-slot-container {
    margin: 28px auto;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    text-align: center;
    overflow: hidden;
}

.ad-slot-label {
    display: block;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ============================================================
   EDITORIAL FOOTER
   ============================================================ */

.site-footer {
    background: url("../img/dots.png") repeat left top #252525;
    color: var(--bg-primary);
    margin-top: 40px;
}

.site-footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(290px, 0.7fr);
    align-items: center;
    gap: 48px;
    padding: 68px 0;
    border-bottom: 1px solid rgba(248, 247, 242, 0.16);
    overflow: hidden;
}

.footer-kicker {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 18px;
}

.footer-hero h2 {
    color: var(--bg-primary);
    font-size: clamp(42px, 5.5vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.footer-hero h2 em {
    color: var(--accent);
}

.footer-hero-copy > p {
    max-width: 440px;
    margin: 20px 0 0;
    color: rgba(248, 247, 242, 0.75);
    font-size: 14.5px;
}

.footer-cta-card {
    position: relative;
    z-index: 2;
    padding: 28px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.footer-card-index,
.footer-small-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--accent-text);
    margin-bottom: 12px;
}

.footer-cta-card > p {
    font-size: 20px;
    line-height: 1.35;
    margin: 0 0 18px;
}

.footer-card-rule {
    height: 1px;
    background: var(--border-strong);
    margin: 22px 0 18px;
}

.footer-privacy-note {
    margin: 0;
    font-size: 13px !important;
    color: var(--text-secondary);
}

.footer-watermark {
    position: absolute;
    right: 28%;
    bottom: -90px;
    font-size: 380px;
    line-height: 0.9;
    color: rgba(248, 247, 242, 0.035);
    pointer-events: none;
    user-select: none;
}

.footer-nav-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 1fr;
    gap: 36px;
    padding: 52px 0;
    border-bottom: 1px solid rgba(248, 247, 242, 0.16);
}

.footer-nav-brand p {
    margin: 14px 0 0;
    font-size: 13px;
    color: rgba(248, 247, 242, 0.7);
    max-width: 240px;
}

.footer-nav-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-nav-heading {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 6px;
}

.footer-nav-col a {
    font-size: 13px;
    color: rgba(248, 247, 242, 0.85);
    transition: color 0.15s ease;
}
.footer-nav-col a:hover {
    color: var(--white);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 0;
    font-size: 12px;
    color: rgba(248, 247, 242, 0.65);
}

.footer-bottom p {
    margin: 0;
}

/* ============================================================
   UTILITIES: TOASTS, BACK TO TOP, CONTACT & LEGAL PAGES
   ============================================================ */

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--text-primary);
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    z-index: 850;
}

.toast-region {
    position: fixed;
    right: 20px;
    bottom: 74px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 995;
    max-width: 340px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--text-primary);
    color: var(--white);
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.toast.is-success { background: var(--success); }
.toast.is-error { background: var(--error); }

.legal-shell {
    max-width: 820px;
    padding: 56px 24px;
    margin: 0 auto;
}
.legal-shell h1 {
    font-size: clamp(34px, 4vw, 48px);
    margin-bottom: 16px;
}
.legal-shell h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 28px 0 10px;
}
.legal-shell p, .legal-shell li {
    color: var(--text-secondary);
    line-height: 1.8;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 44px;
    padding: 56px 0;
}

.contact-card {
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS (1280, 1024, 768, 430, 390, 360)
   ============================================================ */

@media (max-width: 1120px) {
    .brand-tagline {
        display: none;
    }
    .ws-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .ws-main-col {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 960px) {
    .main-nav,
    .header-link,
    .btn-header-cta {
        display: none;
    }
    .mobile-menu-trigger {
        display: flex;
    }
    .hero-grid,
    .tool-hero-grid,
    .faq-split,
    .footer-hero,
    .contact-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    .tools-editorial-grid,
    .related-grid,
    .three-col-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .presets-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .footer-nav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .container,
    .site-header-inner,
    .site-footer-inner {
        padding: 0 16px;
    }
    .ws-dropzone,
    .ws-main-col,
    .ws-settings-col {
        padding: 16px;
    }
    .tools-editorial-grid,
    .related-grid,
    .three-col-grid,
    .tool-docs-grid,
    .presets-grid,
    .ws-stats-strip,
    .ws-two-col {
        grid-template-columns: minmax(0, 1fr);
    }
    .ws-stat {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .ws-stat:last-child {
        border-bottom: 0;
    }
    .ws-q-item {
        grid-template-columns: auto 40px minmax(0, 1fr);
    }
    .ws-q-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
    .footer-nav-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
