:root {
    color-scheme: light;
    --bg: #f5f5f3;
    --surface: #ffffff;
    --text: #171717;
    --muted: #66645f;
    --border: #d8d6d0;
    --border-strong: #aaa79f;
    --accent: #171717;
    --accent-text: #ffffff;
    --danger-bg: #fff4f2;
    --danger-border: #d8a199;
    --success-bg: #f0f7f1;
    --success-border: #9eb9a1;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
code { background: #ecebe7; padding: .1em .35em; border-radius: .3rem; }

.page-shell { width: min(100% - 32px, 960px); margin: 0 auto; padding: 48px 0 80px; }
.hero { padding-top: 8px; }
.eyebrow { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
h1 { max-width: 780px; margin: 0; font-size: clamp(2.2rem, 7vw, 4.8rem); line-height: .98; letter-spacing: -.045em; }
.lead { max-width: 760px; margin: 24px 0 32px; font-size: clamp(1.08rem, 2.4vw, 1.35rem); color: #353431; }

.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: clamp(18px, 4vw, 30px); box-shadow: 0 12px 35px rgba(0,0,0,.045); }
.drop-zone { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: clamp(28px, 7vw, 54px) 20px; text-align: center; transition: border-color .15s ease, background .15s ease; }
.drop-zone.is-dragging { border-color: var(--text); background: #f1f0ec; }
.drop-zone-copy { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.drop-zone-copy strong { font-size: 1.2rem; }
.muted { color: var(--muted); font-size: .92rem; }
#file-help { max-width: 630px; margin: 18px auto 0; }
.label { display: block; font-size: .87rem; color: var(--muted); margin-bottom: 6px; }

.button { min-height: 44px; border-radius: 10px; border: 1px solid var(--border-strong); padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.button-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.button-secondary { background: var(--surface); color: var(--text); }
.button-ghost { background: transparent; color: var(--text); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.button:focus-visible, .survey-option:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, label.button:focus-within { outline: 3px solid #6b86c8; outline-offset: 3px; }

.selected-file { margin-top: 18px; padding: 14px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); }
.selected-file > div { min-width: 0; }
#file-name { display: block; overflow-wrap: anywhere; }
.status { min-height: 1.5em; margin-top: 14px; }
.status.is-error, .status.is-no-text { padding: 12px 14px; border-radius: 10px; background: var(--danger-bg); border: 1px solid var(--danger-border); }
.status.is-loading { color: var(--muted); }
.status.is-success { padding: 12px 14px; border-radius: 10px; background: var(--success-bg); border: 1px solid var(--success-border); }

.result, .survey { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border); }
.result-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.result h2, .survey h2 { margin: 0 0 8px; font-size: 1.35rem; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--border-strong); border-radius: 12px; padding: 14px; background: #fbfbfa; color: var(--text); line-height: 1.5; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.survey > p { margin-top: 4px; color: var(--muted); }
.survey-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.survey-option { min-height: 54px; text-align: left; border: 1px solid var(--border); background: #fafaf8; border-radius: 10px; padding: 12px 14px; color: var(--text); }
.survey-option:hover { border-color: var(--border-strong); background: #f2f1ed; }
.survey-thanks { color: var(--text) !important; font-weight: 650; }

.content-section { padding: 46px 2px 0; max-width: 780px; }
.content-section h2 { margin: 0 0 12px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.025em; }
.content-section p { margin: 0 0 14px; color: #363532; }
.blog-back-link { color: inherit; text-decoration: none; text-underline-offset: 3px; }
.blog-back-link:hover, .blog-back-link:focus-visible { color: var(--text); text-decoration: underline; }
.context-link a, .related-all { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.related-card { display: flex; flex-direction: column; gap: 8px; min-height: 100%; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.related-card strong { font-size: 1rem; line-height: 1.35; }
.related-card span { color: var(--muted); font-size: .91rem; line-height: 1.5; }
.related-card:hover, .related-card:focus-visible { border-color: var(--border-strong); background: #fafaf8; transform: translateY(-1px); }
.related-all { display: inline-block; margin-top: 16px; font-weight: 650; }
.faq details { border-top: 1px solid var(--border); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { font-weight: 650; cursor: pointer; }
.faq details p { margin-top: 10px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

body.embed-mode { overflow-x: hidden; }
.embed-mode .page-shell { width: 100%; max-width: none; margin: 0; padding: 0; }
.embed-mode .hero { padding: 0; }
.embed-mode .eyebrow, .embed-mode h1, .embed-mode .lead { display: none; }

@media (max-width: 640px) {
    .page-shell { width: min(100% - 22px, 960px); padding-top: 28px; }
    .selected-file, .result-header { align-items: stretch; flex-direction: column; }
    .selected-file .button, .result-header .button { width: 100%; }
    .survey-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .result-actions .button { flex: 1 1 100%; }
}
