:root {
    color-scheme: light;
    --paper: #faf9f6;
    --surface: #ffffff;
    --ink: #292b30;
    --muted: #74757c;
    --border: #dedfdf;
    --accent: #504d9a;
    --accent-dark: #3e3b7f;
    --secret: #ede5b9;
    --danger: #9b3434;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: var(--paper);
    color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary, [contenteditable] { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #807cc4; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
.site-header, main, .site-footer { width: min(100% - 64px, 960px); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding-block: 31px; border-bottom: 1px solid var(--border); }
.wordmark { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 27px; font-weight: 700; letter-spacing: -1.8px; color: var(--ink); text-decoration: none; line-height: 1; }
.wordmark span { color: var(--accent); }
.site-tagline { color: var(--muted); font-size: 13px; }
main { min-height: calc(100vh - 220px); padding-block: 52px 30px; }
.page-intro { margin-bottom: 28px; max-width: 710px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 1.8px; margin-bottom: 12px; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 560; line-height: 1.2; letter-spacing: -1.5px; margin-bottom: 13px; }
.page-intro > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 15px; }
.editor-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 3px 10px #292b3003; }
.format-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 55px; padding: 8px 17px; border-bottom: 1px solid #ebebeb; }
.format-toolbar button { border: 0; border-radius: 5px; background: transparent; padding: 4px 10px; min-width: 34px; min-height: 34px; color: #62636b; font-size: 13px; }
.format-toolbar button:hover { color: var(--ink); background: #f0f0f5; }
.toolbar-small { font-size: 10px; }
.toolbar-divider { width: 1px; height: 18px; background: var(--border); margin-inline: 6px; }
.toolbar-note { margin-left: auto; color: #85858b; font-size: 11px; }
#source { display: block; width: 100%; min-height: 355px; resize: vertical; padding: 26px 29px; border: 0; border-radius: 0; outline-offset: -4px; color: var(--ink); background: var(--surface); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 15px; line-height: 1.85; tab-size: 4; }
#source::placeholder { color: #a1a1a7; }
.editor-meta { display: flex; justify-content: space-between; gap: 15px; color: #8a8a90; padding: 13px 22px; border-top: 1px solid #f1f1f1; font-size: 11px; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }
.action-row p { margin: 0; }
.button { display: inline-flex; gap: 15px; align-items: center; justify-content: center; min-height: 43px; padding: 10px 17px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 13px; font-weight: 550; line-height: 1.5; text-decoration: none; text-align: center; }
.button:hover:not(:disabled) { border-color: #babac7; background: #f4f3f8; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.subtle { background: transparent; border-color: transparent; color: #63636b; padding-inline: 5px; }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.quiet, .field-help { color: var(--muted); font-size: 12px; }
.field-help { display: block; margin-top: 8px; margin-bottom: 0; line-height: 1.65; }
.status, .notice { background: #efeff8; border: 1px solid #dcdbea; border-radius: 7px; padding: 13px 17px; font-size: 14px; margin-bottom: 25px; overflow-wrap: anywhere; }
.status.error, .notice.error { background: #fbefed; border-color: #efcfca; color: #883d35; }
.over-limit { color: var(--danger); }
.selection-toolbar { display: flex; align-items: center; gap: 17px; }
.selection-mark { position: fixed; z-index: 10; max-width: calc(100vw - 16px); box-shadow: 0 4px 14px #292b3026; user-select: none; }
#selection-help { margin-bottom: 12px; }
.source-preview { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 14px; line-height: 1.9; tab-size: 4; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 24px 28px; min-height: 250px; max-height: 600px; overflow: auto; margin: 0; }
.source-preview.compact { min-height: 60px; max-height: 300px; padding: 17px 20px; }
.source-preview mark { color: inherit; background: var(--secret); padding: 2px 0; box-shadow: inset 0 -1px #baa451; }
.source-preview::selection, .source-preview *::selection { background: #b8b7e4; color: #24223f; }
.selection-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 23px; }
.selection-list:empty { margin: 0 0 23px; }
.selection-list li { display: flex; align-items: center; gap: 10px; max-width: 100%; border-radius: 5px; background: #f0eddf; padding: 4px 10px; font-size: 12px; }
.selection-list li > span { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.remove-selection { border: 0; border-left: 1px solid #d7d2bd; padding: 3px 0 3px 10px; color: #746945; background: transparent; font-size: 11px; }
.remove-selection:hover { text-decoration: underline; }
.selection-tip { background: #efeff8; border: 1px solid #dcdbea; border-radius: 7px; padding: 15px 18px; margin-bottom: 23px; font-size: 13px; overflow-wrap: anywhere; }
.selection-tip p { margin-bottom: 8px; }
.selection-tip p:last-child { margin-bottom: 0; }
.selection-tip code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.selection-tip-example { display: block; margin-bottom: 10px; }
.selection-tip-example mark { color: var(--ink); background: var(--secret); padding: 2px 0; box-shadow: inset 0 -1px #baa451; }
.stored-preview summary { cursor: pointer; color: #66656d; font-size: 13px; margin-bottom: 10px; }
.publish-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; border-top: 1px solid var(--border); padding-top: 23px; margin-top: 26px; }
.summary-label { display: block; color: var(--muted); font-size: 12px; }
#url-estimate { display: block; font-size: 19px; font-weight: 550; letter-spacing: -.3px; margin-top: 3px; }
.privacy-note { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0; }
.publish-summary .field-help { font-size: 11px; }
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 25px 27px; margin-bottom: 20px; }
.result-card label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.label-note { font-weight: 400; font-size: 12px; margin-left: 10px; color: var(--muted); }
.copy-row { display: flex; align-items: stretch; gap: 10px; }
.copy-row input { width: 100%; min-width: 0; background: #fafafa; border: 1px solid var(--border); border-radius: 5px; padding: 9px 12px; color: #54545c; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.copy-row button { flex-shrink: 0; }
.text-link { display: inline-block; margin-top: 16px; font-size: 13px; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.deletion-card { background: transparent; }
.viewer-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.viewer-heading .eyebrow { margin: 0; }
.viewer-actions { display: flex; gap: 12px; align-items: center; }
.remembered-documents { border-top: 1px solid var(--border); margin-top: 46px; padding-top: 29px; }
.remembered-heading h2 { font-size: 21px; font-weight: 550; letter-spacing: -.4px; margin-bottom: 5px; }
.remembered-heading p { margin-bottom: 20px; }
.remembered-list { list-style: none; margin: 0; padding: 0; }
.remembered-list li { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 17px; border-bottom: 1px solid var(--border); }
.remembered-list li:last-child { border-bottom: 0; }
.remembered-list li > div { min-width: 0; }
.remembered-title { font-size: 15px; font-weight: 550; text-decoration: none; overflow-wrap: anywhere; }
.remembered-title:hover { text-decoration: underline; }
.remembered-list p { margin: 4px 0 0; }
.remembered-list .button { flex-shrink: 0; }
.document-content { overflow-wrap: anywhere; font-size: 16px; line-height: 1.85; padding: 30px 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; min-height: 180px; }
.document-content > :last-child { margin-bottom: 0; }
.document-content h1 { font-size: 32px; margin-top: 12px; }
.document-content h2 { font-size: 25px; }
.document-content h3 { font-size: 20px; }
.document-content h2, .document-content h3, .document-content h4 { margin-top: 1.3em; margin-bottom: .5em; line-height: 1.4; }
.document-content p, .document-content ul, .document-content ol, .document-content blockquote { margin-bottom: 1em; }
.document-content pre { white-space: pre; overflow: auto; border-radius: 5px; background: #f6f5f9; padding: 15px 19px; line-height: 1.65; }
.document-content code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; background: #f4f3f8; padding: 2px 5px; border-radius: 3px; }
.document-content pre code { background: transparent; padding: 0; }
.document-content blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid #cecce0; color: #74717e; }
.document-content .source-preview { white-space: pre-wrap; background: transparent; border: 0; padding: 0; max-height: none; }
.preserve-whitespace { white-space: pre-wrap; }
.site-footer { border-top: 1px solid var(--border); margin-top: 26px; padding-block: 21px 25px; color: #929197; font-size: 11px; display: flex; justify-content: space-between; gap: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.confirmation { max-width: 630px; }
.confirmation .button { margin-top: 12px; }
.button.danger { color: white; background: var(--danger); border-color: var(--danger); }
.message-page { max-width: 670px; }
.message-page > .brand { display: inline-block; color: var(--ink); font-family: ui-monospace, Consolas, monospace; font-size: 25px; font-weight: 700; text-decoration: none; margin-bottom: 40px; }
.message-page h1 { margin-bottom: 20px; }
.message-page form { margin-top: 25px; }
.message-page .button { margin-right: 10px; }

@media (max-width: 680px) {
    .site-header, main, .site-footer { width: calc(100% - 32px); }
    .site-header { padding-block: 24px; }
    .site-tagline { font-size: 11px; }
    main { padding-top: 34px; }
    h1 { letter-spacing: -1px; }
    .page-intro { margin-bottom: 24px; }
    .page-intro > p:last-child { font-size: 14px; }
    .format-toolbar { gap: 0; padding-inline: 8px; }
    .format-toolbar button { min-height: 38px; padding-inline: 9px; }
    .toolbar-note { display: none; }
    #source { min-height: 340px; padding: 19px 18px; font-size: 16px; }
    .editor-meta { padding-inline: 16px; font-size: 10px; }
    .action-row { align-items: stretch; flex-wrap: wrap; gap: 16px; }
    #editor-panel .action-row { flex-direction: column; }
    #editor-panel .action-row .quiet { text-align: center; order: 2; }
    .button { min-height: 45px; }
    .publish-summary { grid-template-columns: 1fr; gap: 18px; }
    .source-preview { padding: 18px; font-size: 14px; }
    .result-card { padding: 20px 17px; }
    .copy-row { flex-wrap: wrap; }
    .copy-row input { flex-basis: 100%; font-size: 16px; }
    .copy-row .button { width: 100%; }
    .label-note { display: block; margin-left: 0; margin-top: 2px; }
    .document-content { padding: 23px 20px; }
    .document-content h1 { font-size: 28px; }
    .viewer-actions { gap: 7px; }
    .site-footer { font-size: 10px; gap: 15px; }
}

@media (prefers-reduced-motion: no-preference) {
    .button, .format-toolbar button { transition: background-color .12s, border-color .12s; }
}
