:root {
  --panel: var(--paper-lift);
  --muted: var(--ink-soft);
  --line: var(--rule);
  --serif: Newsreader, Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, .file-button { cursor: pointer; }
button:disabled, input:disabled { cursor: default; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .24em; }
:focus-visible, .editor:has(#source-file:focus-visible) .file-button { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden, .file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

a:hover { color: var(--accent); }
.page-footer { display: flex; flex-wrap: wrap; gap: 18px; font-size: .875rem; font-weight: 600; }
.page-footer a { text-decoration: none; }
.page-footer span { margin-left: .25rem; color: var(--accent); }
.intro { display: flex; align-items: end; justify-content: space-between; column-gap: 24px; padding: 65px 0 31px; }
h1, h2, p { margin: 0; }
h1 { font: 490 clamp(62px, 9vw, 106px)/.84 var(--serif); letter-spacing: -.068em; margin: 0 0 14px -.045em; }
.intro div p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); }
.preview-link { font-size: .875rem; font-weight: 650; text-decoration: none; }
.preview-link span { margin-left: .25rem; color: var(--accent); }
.privacy { color: var(--muted); font-size: .875rem; line-height: 1.7; padding: 0 0 10px; scroll-margin-top: 20px; }
.privacy span { color: var(--sage); font-weight: 650; margin-right: 7px; }
.privacy span::before { content: ''; display: inline-block; background: var(--sage); width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: .12em; }

.connector-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; padding: 0; margin: 0 0 32px; background: var(--line); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.connector-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 12px 16px; min-height: 61px; background: var(--panel); scroll-margin-top: 16px; }
.connector-list li:target { background: #f2e7de; }
.connector-list img { display: block; object-fit: contain; }
.connector-list strong { font-weight: 650; }
.connector-list a { text-decoration: none; }
.workspace { display: grid; grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr); border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.workspace > section { padding: 28px; min-width: 0; }
.editor { border-right: 1px solid var(--line); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
h2 { font: 520 35px/.97 var(--serif); letter-spacing: -.04em; }
.file-button, .subtle, .primary { border-radius: 4px; font-size: .875rem; font-weight: 650; padding: .6rem .74rem; line-height: 1.15; }
.file-button, .subtle { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.file-button:hover, .subtle:hover { border-color: var(--accent); color: var(--accent); }
.primary { background: var(--accent); border: 1px solid var(--accent); color: #fffdf8; padding: .74rem .86rem; }
.primary:hover { background: #82331f; border-color: #82331f; }
.primary [aria-hidden] { margin-left: .35rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .6; }
fieldset > label { display: block; font-size: .875rem; font-weight: 650; margin-bottom: 6px; }
fieldset > label:not(:first-of-type) { margin-top: 15px; }
input:not([type=file]), textarea { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; width: 100%; padding: .67rem .75rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { display: block; resize: vertical; min-height: 120px; line-height: 1.5; }
.form-footer { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.actions { display: flex; gap: 6px; margin-left: auto; }
output, .result-count, .original-meta { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
output[data-over-limit], .error { color: var(--accent); }
.error { font-size: .875rem; margin-top: 10px; }
.result-count { min-height: 1.2em; margin: 13px 0 8px; }
.results { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.results:empty { display: none; }
.results li { border-bottom: 1px solid var(--line); }
.result { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; gap: 5px 12px; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 14px 10px; }
.result:hover { background: var(--paper); }
.result-name { font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.result-arrow { grid-area: 1 / 2 / span 2; align-self: center; color: var(--accent); font-size: 1.1rem; }
.result-preview { color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; font-size: .9rem; line-height: 1.4; }
.shelf-empty { color: var(--muted); font-size: .95rem; padding-top: 9px; }
.page-footer { padding: 22px 0 37px; }

dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 24px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
dialog::backdrop { background: rgb(33 30 24 / 42%); }
.original-header, .original-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.original-header { margin-bottom: 16px; }
.original-label { color: var(--accent); font-size: .875rem; font-weight: 650; }
dialog h2 { overflow-wrap: anywhere; }
.original-meta { margin: 6px 0 12px; }
dialog pre { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; background: var(--paper); border-left: 2px solid var(--line); margin: 0 0 16px; padding: 12px; }
#remove-source { color: var(--accent); }

@media (max-width: 740px) {
  .intro { padding-top: 44px; align-items: start; flex-direction: column; gap: 14px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace > section { padding: 19px; }
  .editor { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 540px) {
  .connector-list { grid-template-columns: minmax(0, 1fr); }
}
