:root {
    --ink: #1e2d2b;
    --muted: #737d78;
    --paper: #f6f5f1;
    --surface: #fffefa;
    --line: #e6e5de;
    --green: #25584c;
    --green-dark: #1d463d;
    --green-wash: #e8f0ec;
    --gold: #d8a958;
    --shadow: 0 16px 44px rgba(27, 42, 37, .055);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.55 'DM Sans', 'Segoe UI', sans-serif; }
a { color: var(--green); }
button, input, textarea { font: inherit; }

.site-header { height: 78px; padding: 0 max(32px, calc((100vw - 1160px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eae9e2; background: rgba(255, 254, 250, .83); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.03em; font-size: 17px; }
.brand-mark { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px 11px 11px 4px; background: var(--green); color: #fffefa; font: 600 19px 'Newsreader', Georgia, serif; }
.brand-subtitle { display: block; margin-top: 1px; color: #9a9f98; font-size: 8px; letter-spacing: .17em; font-weight: 600; }
.account-nav { display: flex; align-items: center; gap: 18px; }
.account-name { color: var(--muted); font-size: 13px; }
.settings-link { color: var(--green); text-decoration: none; font-size: 13px; font-weight: 600; }
.settings-link:hover, .back-link:hover { text-decoration: underline; }
.signout-link { color: var(--green); text-decoration: none; font-size: 13px; font-weight: 600; }
.signout-link:hover, .download-link:hover { text-decoration: underline; }
.page-shell { width: min(1160px, calc(100% - 48px)); min-height: calc(100vh - 138px); margin: 0 auto; padding: 56px 0 70px; }
.site-footer { padding: 22px 24px 28px; border-top: 1px solid #eae9e2; color: #929991; text-align: center; font-size: 12px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; letter-spacing: -.035em; }
h1 { margin-bottom: 8px; font-size: clamp(36px, 5vw, 49px); line-height: 1.05; }
h2 { margin: 2px 0 0; font-size: 25px; line-height: 1.18; }
.eyebrow { color: #78837c; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.lede { max-width: 620px; margin: 0; color: var(--muted); font-size: 15px; }
.edition-chip, .count-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 254, 250, .6); color: #6a766e; font-size: 10px; font-weight: 700; letter-spacing: .09em; }
.edition-dot, .status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #80a992; }
.workspace-grid { display: grid; grid-template-columns: minmax(290px, .86fr) minmax(420px, 1.34fr); align-items: start; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.upload-panel, .prompt-panel { padding: 24px; }
.panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.icon-badge { width: 39px; height: 39px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--green-wash); color: var(--green); font-size: 21px; }
.icon-badge-gold { background: #f8f0df; color: #b68436; font-size: 17px; }
.panel-copy { margin-bottom: 19px; color: var(--muted); font-size: 13px; }
.upload-form { display: grid; gap: 12px; }
.file-picker { position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 12px; overflow: hidden; border: 1px dashed #c8d3cb; border-radius: 11px; background: #fbfcf9; cursor: pointer; }
.file-picker:hover { border-color: var(--green); background: #f5f9f5; }
.file-picker-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; background: #edf2ed; color: var(--green); font-size: 21px; }
.file-picker strong, .file-picker small { display: block; }
.file-picker strong { font-size: 12px; }
.file-picker small { margin-top: 2px; color: #929b93; font-size: 10px; }
.file-picker input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.button { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { border-color: #d4e2d9; background: #eef4ef; color: var(--green); }
.button-secondary:hover { background: #e3eee7; }
.button-wide { width: 100%; }
.prompt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field { display: block; color: #58655d; font-size: 11px; font-weight: 600; }
.field-full { grid-column: 1 / -1; }
.text-input { width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid #e3e5dd; border-radius: 8px; outline: none; background: #fff; color: var(--ink); font-size: 12px; font-weight: 400; box-shadow: none; }
.text-input:focus { border-color: #85a794; box-shadow: 0 0 0 3px rgba(37, 88, 76, .08); }
.text-input::placeholder { color: #a0a79f; }
.textarea-small { min-height: 62px; resize: vertical; }
.prompt-output-wrap { margin-top: 17px; }
.prompt-output { resize: vertical; font: 11px/1.55 Consolas, 'Courier New', monospace; background: #fafbf8; }
.prompt-actions { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.copy-status { color: #61756a; font-size: 11px; }
.privacy-note { margin: 14px 0 0; color: #8b948c; font-size: 10px; }
.privacy-note span { color: var(--green); font-size: 13px; }
.documents-section { margin-top: 48px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.section-heading h2 { margin-top: 3px; }
.export-note { margin: -5px 0 13px; color: #89928a; font-size: 11px; }
.count-chip { padding: 6px 10px; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px dashed #d9dcd4; border-radius: 13px; background: rgba(255, 254, 250, .55); color: #879188; text-align: center; font-size: 12px; }
.empty-state strong { margin-top: 3px; color: #56645a; font-size: 13px; }
.empty-icon { margin-bottom: 4px; color: #7d9b87; font-size: 22px; }
.document-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.document-row { display: grid; grid-template-columns: 40px minmax(150px, 1fr) auto minmax(230px, auto); align-items: center; gap: 15px; padding: 15px 18px; }
.document-row + .document-row { border-top: 1px solid #eeeee8; }
.document-file-icon { width: 37px; height: 39px; display: grid; place-items: center; border: 1px solid #dbe4dd; border-radius: 7px; background: #f2f6f2; color: var(--green); font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.document-main { min-width: 0; }
.document-main h3 { margin: 0 0 3px; overflow: hidden; font-family: 'Newsreader', Georgia, serif; font-size: 17px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.document-main p { margin: 0; overflow: hidden; color: #89928a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.meta-divider { padding: 0 4px; }
.document-stats { display: flex; gap: 10px; color: #6e7d72; font-size: 10px; white-space: nowrap; }
.document-stats span + span { padding-left: 10px; border-left: 1px solid #e6e8e2; }
.download-link { color: var(--green); text-decoration: none; font-size: 11px; font-weight: 700; white-space: nowrap; }
.export-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.export-button { padding: 5px 8px; border: 1px solid #dce6df; border-radius: 6px; background: #f7faf7; color: var(--green); text-decoration: none; font-size: 10px; font-weight: 700; white-space: nowrap; }
.export-button:hover { border-color: #abc4b3; background: #edf4ee; }
.message { margin-bottom: 18px; padding: 11px 14px; border: 1px solid #d2e4d5; border-radius: 8px; background: #eff7ef; color: #365941; font-size: 12px; cursor: pointer; }
.message.error { border-color: #edd3ce; background: #fbf0ee; color: #834b43; }
.message.hidden { display: none; }
.login-wrap { width: min(440px, 100%); margin: 35px auto 0; }
.login-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: #748078; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.login-wrap h1 { margin-bottom: 7px; font-size: 43px; }
.login-wrap .lede { font-size: 13px; }
.login-panel { margin-top: 24px; padding: 24px; }
.stacked-form { display: grid; gap: 16px; }
.stacked-form .field { font-size: 12px; }
.stacked-form .text-input { min-height: 43px; font-size: 13px; }
.quiet-note { margin: 14px 0; color: #929a93; text-align: center; font-size: 11px; }
.styles-welcome { align-items: center; }
.back-link { color: var(--green); text-decoration: none; font-size: 12px; font-weight: 700; white-space: nowrap; }
.style-panel { padding: 26px; }
.style-panel-intro { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; }
.style-panel-intro h2 { margin: 2px 0 5px; }
.style-panel-intro .panel-copy { margin: 0; }
.style-form { display: grid; gap: 22px; }
.style-field { display: grid; gap: 6px; }
.style-label { color: #58655d; font-size: 11px; font-weight: 700; }
.style-input, .style-select { width: 100%; min-height: 42px; margin: 0; padding: 9px 11px; border: 1px solid #e3e5dd; border-radius: 8px; outline: none; background: #fff; color: var(--ink); font: 13px 'DM Sans', 'Segoe UI', sans-serif; box-shadow: none; }
.style-input:focus, .style-select:focus { border-color: #85a794; box-shadow: 0 0 0 3px rgba(37, 88, 76, .08); }
.style-name-field { max-width: 470px; }
.style-help { color: #89928a; font-size: 10px; font-weight: 400; line-height: 1.45; }
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.asset-section { padding-top: 22px; border-top: 1px solid var(--line); }
.asset-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.asset-heading h2 { margin-top: 4px; font-size: 22px; }
.asset-heading + .panel-copy { margin-bottom: 13px; }
.asset-badge { padding: 6px 9px; border-radius: 999px; background: #eef4ef; color: var(--green); font-size: 9px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.asset-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.asset-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px; }
.asset-row + .asset-row { border-top: 1px solid #eeeee8; }
.asset-copy { display: grid; gap: 3px; }
.asset-copy strong { color: #44534a; font-size: 12px; }
.asset-copy small { max-width: 520px; color: #89928a; font-size: 10px; }
.asset-current { color: #587661; font-size: 10px; font-weight: 600; }
.asset-default { color: #919a92; font-weight: 400; }
.asset-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.asset-file-label { display: inline-flex; align-items: center; justify-content: center; min-height: 33px; position: relative; overflow: hidden; padding: 0 10px; border: 1px solid #d4e2d9; border-radius: 7px; background: #f7faf7; color: var(--green); font-size: 10px; font-weight: 700; cursor: pointer; }
.asset-file-label:hover { background: #edf4ee; }
.asset-file-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.asset-limit { color: #929a93; font-size: 9px; white-space: nowrap; }
.asset-reset { display: inline-flex; align-items: center; gap: 4px; color: #647168; font-size: 10px; white-space: nowrap; }
.asset-reset input { margin: 0; }
.style-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 4px; }
.style-actions p { max-width: 520px; margin: 0; color: #89928a; font-size: 10px; }
.style-tip { margin-top: 15px; padding: 13px 15px; border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; background: #fbf7ee; color: #777564; font-size: 11px; }
.style-tip strong { color: #625b43; }

@media (max-width: 780px) {
    .site-header { height: 68px; padding: 0 20px; }
    .page-shell { width: min(100% - 32px, 600px); padding-top: 37px; }
    .welcome-row { align-items: flex-start; flex-direction: column; gap: 15px; }
    .workspace-grid { grid-template-columns: 1fr; }
    .documents-section { margin-top: 36px; }
    .document-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
    .export-actions { grid-column: 2 / -1; justify-content: flex-start; }
}
@media (max-width: 560px) {
    .account-name { display: none; }
    .settings-link { font-size: 11px; }
    .prompt-fields { grid-template-columns: 1fr; }
    .field-full { grid-column: auto; }
    .document-row { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 13px; }
    .document-stats { grid-column: 2; grid-row: 2; margin-top: -4px; }
    .export-actions { grid-column: 2; grid-row: 3; justify-content: flex-start; }
    .document-main h3 { font-size: 15px; }
    .document-main p { max-width: 210px; }
    .edition-chip { margin-top: -3px; }
    .style-panel { padding: 18px; }
    .style-grid { grid-template-columns: 1fr; }
    .asset-row { align-items: flex-start; flex-direction: column; gap: 10px; }
    .asset-controls { justify-content: flex-start; }
    .style-actions { align-items: stretch; flex-direction: column; }
    .style-actions .button { width: 100%; }
    .asset-heading { align-items: flex-start; flex-direction: column; }
}
