:root {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --brand-navy: #1e3a5f;
    --brand-navy-dark: #152a45;
    --cta-blue: #2563eb;
    --cta-blue-hover: #1d4ed8;
    --accent-crimson: #e11d48;
    --safety-green: #059669;
    --safety-bg: #ecfdf5;
    --safety-border: #a7f3d0;

    --cat-split-bg: #eff6ff;
    --cat-split-fg: #2563eb;
    --cat-booklet-bg: #f5f3ff;
    --cat-booklet-fg: #7c3aed;
    --cat-flatten-bg: #fff1f2;
    --cat-flatten-fg: #e11d48;
    --cat-pages-bg: #ecfdf5;
    --cat-pages-fg: #059669;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--cta-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-logo:hover {
    text-decoration: none;
}

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

.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    font-weight: 500;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--brand-navy);
    font-weight: 600;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--bg-subtle);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
}

.lang-switch:hover {
    background: #e2e8f0;
    text-decoration: none;
}

.lang-select {
    padding: 5px 26px 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background-color: var(--bg-subtle);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23475569' d='M5 6L0 0h10z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 9px center;
}

.lang-select:hover {
    background-color: #e2e8f0;
}

/* Main Layout */
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.container-wide {
    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 28px;
}

.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--safety-bg);
    color: var(--safety-green);
    border: 1px solid var(--safety-border);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    color: var(--brand-navy);
    margin: 0 0 10px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
}

/* Tool Hub Grid (iLovePDF-inspired) */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

@media (max-width: 960px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
    text-decoration: none;
}

.tool-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.tool-card-icon.split { background: var(--cat-split-bg); color: var(--cat-split-fg); }
.tool-card-icon.booklet { background: var(--cat-booklet-bg); color: var(--cat-booklet-fg); }
.tool-card-icon.flatten { background: var(--cat-flatten-bg); color: var(--cat-flatten-fg); }
.tool-card-icon.pages { background: var(--cat-pages-bg); color: var(--cat-pages-fg); }

.tool-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.tool-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.tool-card-cta {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cta-blue);
}

/* Tool Workspace Card */
.workspace-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 36px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 18px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--brand-navy);
}

/* Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border-strong);
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--cta-blue);
    background: #eff6ff;
}

.file-drop-zone.has-file {
    border-color: var(--safety-green);
    background: var(--safety-bg);
}

.file-icon {
    font-size: 40px;
    margin-bottom: 10px;
    line-height: 1;
}

.file-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.file-subtext {
    font-size: 13px;
    color: var(--text-muted);
}

.file-name {
    margin-top: 10px;
    color: var(--safety-green);
    font-weight: 700;
    font-size: 14px;
    word-break: break-all;
}

.file-input {
    display: none;
}

/* Options */
.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.option-item:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--cta-blue);
    cursor: pointer;
}

.option-item label {
    cursor: pointer;
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.option-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 2px;
}

.select-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23475569' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.select-input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    border-color: var(--cta-blue);
}

/* Primary Button */
.btn-container {
    text-align: center;
    margin-top: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--cta-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--cta-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* Progress & Log */
.progress-container {
    display: none;
    margin-top: 20px;
}

.progress-container.show {
    display: block;
}

.progress-bar-bg {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--cta-blue) 0%, #3b82f6 100%);
    height: 100%;
    width: 0%;
    transition: width 0.25s ease;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.log-details {
    margin-top: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-base);
}

.log-details summary {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.log-container {
    border-top: 1px solid var(--border-color);
    background: #0f172a;
    color: #cbd5e1;
    padding: 12px 14px;
    max-height: 160px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.log-container:empty::before {
    content: "—";
    color: #64748b;
}

.log-entry {
    margin-bottom: 4px;
}

.log-entry.success {
    color: #4ade80;
}

.log-entry.error {
    color: #f87171;
}

/* Info / SEO Sections */
.info-section {
    margin-top: 44px;
}

.info-section h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--brand-navy);
    margin: 0 0 18px;
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.step-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.step-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
}

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

.usecase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.usecase-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.usecase-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0 0 8px;
}

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

.safety-banner {
    background: var(--safety-bg);
    border: 1px solid var(--safety-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.safety-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.safety-banner h3 {
    margin: 0 0 6px;
    font-size: 17px;
    color: #065f46;
}

.safety-banner p {
    margin: 0;
    font-size: 14px;
    color: #047857;
}

/* FAQ Accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item summary {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

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

.faq-item summary::after {
    content: "+";
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 600;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-answer {
    padding: 0 20px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-top: 1px solid var(--bg-subtle);
    padding-top: 12px;
}

/* Static Legal/Doc Pages */
.doc-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.doc-card h1 {
    font-size: 26px;
    color: var(--brand-navy);
    margin: 0 0 16px;
}

.doc-card h2 {
    font-size: 18px;
    color: var(--brand-navy);
    margin: 26px 0 10px;
}

.doc-card p,
.doc-card li {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 28px 20px;
    margin-top: 48px;
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links a {
    color: var(--text-secondary);
}

@media (max-width: 720px) {
    .header-nav {
        gap: 12px;
        font-size: 13px;
    }

    .header-nav .hide-mobile {
        display: none;
    }

    .tool-grid,
    .steps-grid,
    .usecase-grid {
        grid-template-columns: 1fr;
    }

    .workspace-card {
        padding: 18px;
    }

    .btn {
        width: 100%;
    }

    .safety-banner {
        flex-direction: column;
    }
}

/* Crop Preview UI */
.crop-preview-card {
    margin-top: 16px;
}

.crop-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.crop-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.crop-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #e2e8f0;
    touch-action: none;
    user-select: none;
    cursor: crosshair;
}

.crop-stage-wrap {
    text-align: center;
}

.crop-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.crop-selection {
    position: absolute;
    border: 2px solid var(--cta-blue);
    background: rgba(37, 99, 235, 0.12);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
    pointer-events: none;
}

.crop-margins-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.crop-margin-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.crop-margin-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .crop-margins-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Merge File List */
.merge-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.merge-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.merge-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.merge-file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.text-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
}

.text-input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    border-color: var(--cta-blue);
}


