:root {
    --ink: #18251f;
    --ink-2: #526158;
    --ink-3: #849087;
    --paper: #f7f8f5;
    --white: #fff;
    --line: #dfe5df;
    --line-strong: #cbd5ce;
    --green: #1f7654;
    --green-dark: #155d41;
    --green-soft: #e7f4ed;
    --mint: #8fd4b3;
    --amber: #a96d17;
    --amber-soft: #fff4df;
    --red: #b54c4c;
    --red-soft: #fdeaea;
    --shadow: 0 18px 55px rgba(31, 58, 45, .08);
    --radius: 20px;
    --font: "DM Sans", system-ui, sans-serif;
    --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 3%, rgba(143, 212, 179, .13), transparent 28rem),
        linear-gradient(180deg, #fbfcfa 0, var(--paper) 32rem);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.file-input-fallback { position: fixed; width: 1px; height: 1px; left: -9999px; opacity: 0; pointer-events: none; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(203, 213, 206, .7);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: var(--green); color: #fff; box-shadow: 0 7px 18px rgba(31, 118, 84, .22); }
.brand-mark svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.model-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.72); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #38a976; box-shadow: 0 0 0 4px rgba(56,169,118,.12); }

main { padding: 72px 0 80px; }
.hero { max-width: 720px; text-align: center; margin: 0 auto 54px; }
.eyebrow, .step-label { margin: 0 0 12px; color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; }
.hero h1 { margin: 0; font-size: clamp(42px, 6vw, 70px); line-height: .99; letter-spacing: -.055em; font-weight: 600; }
.hero h1 span { color: var(--green); }
.hero-copy { max-width: 610px; margin: 25px auto 0; color: var(--ink-2); font-size: 17px; line-height: 1.6; }

.setup-card, .processing-card, .editor-card { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; margin-bottom: 26px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.step-label { margin-bottom: 7px; font-size: 10px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; place-items: center; cursor: pointer; transition: .18s ease; }
.icon-button:hover { border-color: var(--green); color: var(--green); transform: translateY(-1px); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.folder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.folder-picker { width: 100%; min-width: 0; display: flex; align-items: center; gap: 14px; text-align: left; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; cursor: pointer; transition: .18s ease; }
.folder-picker:hover { border-color: #a8c6b6; background: #f8fbf9; transform: translateY(-1px); }
.folder-picker.selected { border-color: #8dbca4; background: #f3faf6; }
.folder-picker.drag-over { border-color: var(--green); background: #e8f5ed; outline: 2px dashed var(--green); outline-offset: -2px; transform: scale(1.01); }
.folder-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.folder-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.input-icon { background: #edf3ff; color: #5275a9; }
.output-icon { background: var(--green-soft); color: var(--green); }
.folder-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.folder-copy strong { font-size: 14px; }
.folder-copy > span { overflow: hidden; color: var(--ink-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.folder-action { margin-left: auto; flex: 0 0 auto; color: var(--green); font-size: 12px; font-weight: 600; }

.quality-options { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.quality-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.quality-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.quality-heading .step-label { margin-bottom: 4px; }
.quality-heading > span { padding-top: 18px; color: var(--ink-3); font-size: 10px; }
.option-stack { display: grid; gap: 8px; }
.quality-option { position: relative; min-width: 0; display: flex; align-items: center; gap: 13px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; transition: .18s ease; }
.quality-option:hover { border-color: #a8c6b6; }
.quality-option > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.option-toggle { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: #ccd4cf; transition: .18s ease; }
.option-toggle::after { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.22); transition: .18s ease; }
.quality-option > input:checked + .option-toggle { background: var(--green); }
.quality-option > input:checked + .option-toggle::after { transform: translateX(16px); }
.quality-option > input:focus-visible + .option-toggle { outline: 3px solid rgba(31,118,84,.16); outline-offset: 2px; }
.fixed-option { cursor: default; background: #f7faf8; }
.fixed-check { flex: 0 0 auto; width: 38px; height: 22px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--green); font-size: 12px; font-weight: 700; }
.option-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.option-copy strong { font-size: 13px; }
.option-copy small { color: var(--ink-3); font-size: 11px; line-height: 1.45; }
.option-badge { margin-left: auto; flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: var(--ink-3); background: #eef1ee; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.option-badge.recommended { color: var(--green); background: var(--green-soft); }
.nested-option { margin-left: 30px; }
.nested-option::before { content: ""; position: absolute; left: -17px; top: -9px; bottom: 50%; width: 12px; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-bottom-left-radius: 7px; }
.quality-option.disabled { opacity: .48; cursor: not-allowed; background: #f6f7f5; }
.quality-note { margin: 12px 2px 0; color: var(--ink-3); font-size: 10px; line-height: 1.5; }

.settings-panel { margin-top: 16px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.field-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.key-row { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; overflow: hidden; }
.key-row:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,118,84,.09); }
.key-row input { flex: 1; min-width: 0; padding: 12px 14px; border: 0; outline: 0; background: transparent; font-family: var(--mono); font-size: 13px; }
.text-button { border: 0; background: transparent; padding: 12px 14px; color: var(--green); font-size: 12px; font-weight: 600; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--ink-2); font-size: 12px; }
.check-row input { accent-color: var(--green); }
.field-help { margin: 7px 0 0; color: var(--ink-3); font-size: 11px; }

.start-row { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.readiness { display: flex; align-items: center; gap: 9px; color: var(--ink-3); font-size: 12px; }
.readiness > span { width: 8px; height: 8px; border-radius: 50%; background: #c2cac4; }
.readiness.ready { color: var(--green); }
.readiness.ready > span { background: #38a976; }
.primary-button, .secondary-button { border: 0; border-radius: 11px; font-weight: 600; cursor: pointer; transition: .18s ease; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 230px; padding: 14px 18px; background: var(--green); color: #fff; box-shadow: 0 9px 22px rgba(31,118,84,.18); }
.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { background: #c8d1cb; box-shadow: none; cursor: not-allowed; }
.primary-button.compact { min-width: auto; padding: 11px 15px; font-size: 13px; }
.secondary-button { padding: 11px 15px; border: 1px solid var(--line-strong); background: #fff; font-size: 12px; }
.secondary-button:hover { border-color: var(--green); color: var(--green); }

.processing-heading, .editor-heading { margin-bottom: 23px; }
.processing-heading-actions { display: flex; align-items: center; gap: 10px; }
.pause-button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; border: 1px solid #c4d7cc; background: #ffffff; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .18s ease; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.pause-button:hover { background: #f4f8f5; border-color: var(--green); color: var(--green-dark); }
.pause-button.is-paused { background: var(--amber-soft); border-color: #f6d365; color: #92400e; animation: pausePulse 1.8s infinite ease-in-out; }
.pause-button.is-paused:hover { background: #fde68a; border-color: #f59e0b; }
@keyframes pausePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.35); }
}
.pause-icon { font-size: 11px; display: inline-block; }
.state-badge { padding: 7px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700; }
.state-badge.warn { background: var(--amber-soft); color: var(--amber); }
.state-badge.error { background: var(--red-soft); color: var(--red); }
.already-processed-banner { margin-top: 14px; padding: 14px 18px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.already-processed-banner .banner-content { display: flex; align-items: center; gap: 12px; }
.already-processed-banner .banner-icon { font-size: 20px; flex-shrink: 0; }
.already-processed-banner .banner-text strong { display: block; font-size: 13px; color: #1e3a8a; }
.already-processed-banner .banner-text p { margin: 2px 0 0; font-size: 12px; color: #3b82f6; }
.already-processed-banner .toggle-control { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #1e40af; cursor: pointer; white-space: nowrap; }
.already-processed-banner .toggle-control input { accent-color: var(--green); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.metric { padding: 17px 16px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { display: block; margin-bottom: 5px; color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.metric strong { font-family: var(--mono); font-size: 17px; font-weight: 500; }
.metric.highlight strong { color: var(--green); }
.progress-copy { display: flex; align-items: flex-end; justify-content: space-between; margin: 27px 1px 10px; }
.progress-copy > div { display: flex; flex-direction: column; gap: 4px; }
.progress-copy strong { font-size: 13px; }
.progress-copy span { color: var(--ink-3); font-size: 11px; }
#progress-percent { color: var(--green); font-family: var(--mono); }
.progress-track { height: 7px; border-radius: 999px; background: #edf0ed; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--mint)); border-radius: inherit; transition: width .3s ease; }

.workbench { margin-top: 25px; display: grid; grid-template-columns: 1fr 1fr .82fr; gap: 14px; }
.preview-card, .activity-card { min-width: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fbfcfa; }
.preview-label { height: 44px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.preview-label span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.preview-label small { min-width: 0; overflow: hidden; color: var(--ink-3); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.preview-frame { position: relative; height: 270px; display: grid; place-items: center; background: #e9ece8; overflow: hidden; }
.preview-frame.empty { color: #9ca59f; font-size: 12px; }
.preview-frame img, .preview-frame canvas { width: 100%; height: 100%; object-fit: contain; }
.activity-log { height: 270px; padding: 12px 14px; overflow: auto; font-family: var(--mono); font-size: 10px; line-height: 1.65; }
.log-entry { position: relative; padding-left: 15px; color: var(--ink-2); }
.log-entry::before { content: ""; position: absolute; left: 1px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: #a8b2ab; }
.log-entry.success::before { background: #38a976; }
.log-entry.warn::before { background: #d38d28; }
.log-entry.error::before { background: #c65858; }
.log-time { margin-right: 7px; color: #a0aaa3; }

.section-copy { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }
.questions-panel { margin-bottom: 22px; padding: 18px; border: 1px solid #bcd9c9; border-radius: 14px; background: #f3faf6; }
.questions-copy { display: flex; gap: 11px; align-items: flex-start; }
.spark { color: var(--green); font-size: 20px; }
.questions-copy strong { font-size: 14px; }
.questions-copy p { margin: 3px 0 0; color: var(--ink-2); font-size: 11px; }
.question-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; margin: 16px 0; }
.question-field label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 11px; }
.question-field input { width: 100%; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; background: #fff; font-size: 12px; }
.question-field input:focus { border-color: var(--green); }
.table-note { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; color: var(--ink-3); font-size: 11px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 910px; }
th { padding: 11px 10px; color: var(--ink-3); background: #f8faf7; font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .1em; }
td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { background: #fff; transition: background .15s ease; }
tbody tr.dragging { opacity: .5; background: var(--green-soft); }
tbody tr.drag-target { box-shadow: inset 0 2px var(--green); }
.drag-handle { color: #a6afa9; cursor: grab; font-size: 16px; user-select: none; }
.row-number { font-family: var(--mono); color: var(--ink-3); font-size: 11px; }
.photo-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.photo-cell img { width: 55px; height: 42px; border-radius: 6px; object-fit: cover; background: #e8ece8; }
.photo-cell input { width: 160px; }
td input, td textarea { width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 7px 8px; background: transparent; outline: 0; color: var(--ink); font-size: 11px; }
td input:focus, td textarea:focus { border-color: #accbb9; background: #fbfdfb; }
td textarea { min-width: 260px; min-height: 54px; resize: vertical; line-height: 1.4; }
.confidence { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.confidence.high { color: var(--green); background: var(--green-soft); }
.confidence.medium { color: var(--amber); background: var(--amber-soft); }
/* Pre-Scan & Cost Estimate */
.pre-scan-card { margin-top: 18px; padding: 18px 20px; border-radius: 14px; background: linear-gradient(135deg, #f3faf6 0%, #fdfefe 100%); border: 1px solid #cce5d7; box-shadow: 0 4px 18px rgba(40, 92, 77, 0.05); }
.pre-scan-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pre-scan-title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--green-dark); }
.pre-scan-icon { font-size: 14px; }
.pre-scan-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 12px; background: #ffffff; padding: 14px; border-radius: 11px; border: 1px solid #e2eee7; }
.pre-scan-stat { display: flex; flex-direction: column; gap: 4px; }
.pre-scan-stat span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.pre-scan-stat strong { font-size: 18px; font-weight: 700; color: var(--ink); }
.pre-scan-stat.highlight strong { color: var(--green); }
.pre-scan-detail { margin-top: 10px; font-size: 11px; color: var(--ink-3); }

/* Collapsible Workbench */
.workbench-collapsible { margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #ffffff; }
.workbench-toggle { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #f8faf8; border: none; border-bottom: 1px solid transparent; cursor: pointer; text-align: left; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink); transition: background .18s ease; }
.workbench-toggle:hover { background: #f0f4f1; }
.workbench-toggle[aria-expanded="true"] { border-bottom-color: var(--line); }
.toggle-icon { font-size: 10px; color: var(--green); transition: transform .2s ease; }
.workbench-toggle[aria-expanded="false"] .toggle-icon { transform: rotate(-90deg); }
.toggle-title { font-weight: 600; }
.toggle-hint { margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.workbench-collapsible .workbench { margin-top: 0; padding: 16px; border: none; border-radius: 0; background: transparent; }
.workbench-collapsed { display: none !important; }

/* Enhanced Preview Frames with correct aspect ratios */
.preview-frame { position: relative; min-height: 240px; max-height: 380px; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: #1a1e1b; overflow: hidden; }
.preview-frame.empty { background: #eef2ee; color: #9ca59f; }
.preview-frame img, .preview-frame canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.dimension-badge { position: absolute; bottom: 8px; right: 8px; padding: 3px 7px; border-radius: 6px; font-size: 10px; font-family: var(--mono); background: rgba(0,0,0,.68); color: #ffffff; backdrop-filter: blur(4px); pointer-events: none; }

/* Segmented View Switcher & Actions */
.editor-actions { display: flex; align-items: center; gap: 14px; }
.segmented-control { display: inline-flex; padding: 3px; background: #e9eee9; border-radius: 10px; border: 1px solid #dbe2db; }
.seg-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .16s ease; display: flex; align-items: center; gap: 6px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #ffffff; color: var(--green-dark); box-shadow: 0 2px 6px rgba(0,0,0,.08); }

/* Album Toolbar (Version Switcher - Optisch ausgeblendet) */
.album-toolbar { display: none !important; }

/* Album Grid */
.album-grid-container { min-height: 180px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.album-card { background: #ffffff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; display: flex; flex-direction: column; cursor: pointer; }
.album-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); border-color: #a4c9b8; }
.album-thumb-stage { position: relative; width: 100%; aspect-ratio: 4/3; background: #1b201d; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.album-thumb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; margin: auto; transition: transform .2s ease; }
.album-card:hover .album-thumb-stage img { transform: scale(1.02); }
.album-card.crop-failed { border: 2px dashed #e53e3e !important; background: rgba(229, 62, 62, 0.05); }
.album-card-dim { position: absolute; bottom: 8px; right: 8px; padding: 2px 6px; border-radius: 5px; font-size: 9px; font-family: var(--mono); background: rgba(0,0,0,.6); color: #e0e0e0; pointer-events: none; }
.album-card-body { padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.album-card-status-row { display: flex; align-items: center; justify-content: flex-start; margin-bottom: 2px; }
.album-card-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.3; border: 1px solid transparent; }
.album-card-badge.enhanced { background: #e6f7ef; color: #1a7448; border-color: #b7ebd1; }
.album-card-badge.in-progress { background: #ebf8ff; color: #2b6cb0; border-color: #bee3f8; animation: pulseStatus 2s infinite ease-in-out; }
.album-card-badge.failed { background: #fffaf0; color: #b7791f; border-color: #feebc8; }
.album-card-badge.failed-crop { background: #fff5f5 !important; color: #c53030 !important; border-color: #fed7d7 !important; font-weight: 700; }
.album-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.album-card-num { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.album-card-title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-card-date-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); }
.album-card-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid #eef2ee; margin-top: auto; }
.album-card-actions:empty { display: none; margin: 0; padding: 0; border: none; }
.card-action-btn { border: 1px solid #d4dfd8; background: #f7faf8; padding: 5px 10px; border-radius: 7px; font-size: 10px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .16s ease; }
.card-action-btn:hover { background: #eaf3ed; border-color: var(--green); color: var(--green-dark); }

/* Photo Modal / Lightbox */
.photo-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.photo-modal-backdrop { position: absolute; inset: 0; background: rgba(14, 20, 16, 0.72); backdrop-filter: blur(8px); }
.photo-modal-dialog { position: relative; z-index: 1; width: min(1060px, 100%); max-height: 92vh; background: #ffffff; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.photo-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.photo-modal-header h3 { font-size: 16px; margin: 0; }
.modal-meta { font-size: 11px; color: var(--ink-3); }
.photo-modal-body { display: grid; grid-template-columns: 1fr 340px; overflow: hidden; flex: 1; max-height: calc(92vh - 65px); }
.photo-compare-container { background: #121614; display: flex; flex-direction: column; padding: 18px; align-items: center; justify-content: center; position: relative; }
.compare-stage { position: relative; width: 100%; height: 100%; min-height: 380px; max-height: 520px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.compare-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.dimension-tag { position: absolute; bottom: 8px; right: 8px; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-family: var(--mono); background: rgba(0,0,0,.75); color: #fff; }
.compare-switch { margin-top: 14px; display: inline-flex; gap: 8px; padding: 4px; background: rgba(255,255,255,.1); border-radius: 9px; backdrop-filter: blur(4px); }
.compare-pill { border: none; background: transparent; padding: 6px 14px; border-radius: 7px; font-size: 11px; font-weight: 600; color: #d0ded6; cursor: pointer; transition: .16s ease; }
.compare-pill.active { background: #ffffff; color: var(--ink); }
.photo-modal-sidebar { padding: 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; background: #fbfdfc; border-left: 1px solid var(--line); }
.modal-field { display: flex; flex-direction: column; gap: 4px; }
.modal-field label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-2); letter-spacing: .04em; }
.modal-field input, .modal-field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 13px; background: #ffffff; }
.modal-field textarea { resize: vertical; }
.modal-status-box { padding: 10px 12px; border-radius: 8px; background: #f0f6f2; border: 1px solid #d3e5db; font-size: 11px; color: var(--ink-2); }
.full-width { width: 100%; justify-content: center; }

/* Confidence badges in Table */
.confidence.high { color: #1e7046; background: var(--green-soft); }
.confidence.medium { color: #9c6318; background: #fdf5e7; }
.confidence.low { color: var(--red); background: var(--red-soft); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 36px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; }
.toast { max-width: 380px; padding: 12px 16px; color: #fff; background: var(--ink); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.22); font-size: 12px; animation: toast-in .2s ease; }
.toast.error { background: #913f3f; }
.toast.success { background: var(--green-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 920px) {
    .workbench { grid-template-columns: 1fr 1fr; }
    .activity-card { grid-column: 1 / -1; }
    .activity-log { height: 180px; }
    .photo-modal-body { grid-template-columns: 1fr; max-height: calc(92vh - 60px); }
    .photo-modal-sidebar { border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
    .shell { width: min(100% - 24px, 1180px); }
    main { padding-top: 48px; }
    .hero { margin-bottom: 38px; }
    .hero-copy { font-size: 15px; }
    .setup-card, .processing-card, .editor-card { padding: 21px; border-radius: 16px; }
    .folder-grid, .question-fields, .pre-scan-grid { grid-template-columns: 1fr; }
    .quality-heading { flex-direction: column; gap: 2px; }
    .quality-heading > span { padding-top: 0; }
    .quality-option { align-items: flex-start; }
    .nested-option { margin-left: 18px; }
    .option-badge { display: none; }
    .start-row { align-items: stretch; flex-direction: column; }
    .primary-button { width: 100%; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .metric:nth-child(2) { border-right: 0; }
    .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .workbench { grid-template-columns: 1fr; }
    .activity-card { grid-column: auto; }
    .editor-heading { flex-direction: column; align-items: flex-start; }
    .editor-actions { width: 100%; flex-direction: column; align-items: stretch; }
    .album-toolbar { flex-direction: column; align-items: flex-start; }
    .toolbar-hint { margin-left: 0; }
    footer { flex-direction: column; }
}
