/* The tool pages (write, present, themes): the shared-note page's look, plus an editor, a drop
   zone and a theme maker. Nothing here talks to a server: everything happens in the page. */
nav.top { display: flex; flex-wrap: wrap; gap: 0.5em 1.4em; margin: 0 0 2rem; font: 14px/1.6 -apple-system, system-ui, sans-serif; }
nav.top a { color: var(--soft); text-decoration: none; }
nav.top a:hover, nav.top a[aria-current] { color: var(--text); }
h1.tool { font-size: 1.5rem; margin: 0 0 0.4rem; }
p.lead { color: var(--soft); margin: 0 0 1.5rem; font: 15px/1.6 -apple-system, system-ui, sans-serif; }
main.wide { max-width: 44rem; }

/* The editor: a textarea you type in, over a copy of the same text with the Markdown styled, as
   Urth's editor shows it. The two share font, size, padding and wrapping, so they line up. */
.editor { position: relative; border: 1px solid var(--faint); border-radius: 12px; background: color-mix(in srgb, var(--text) 3%, var(--bg)); }
.editor:focus-within { border-color: var(--accent); }
.editor pre.hl, .editor textarea { margin: 0; padding: 1.1rem 1.2rem; font: 17px/1.7 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; tab-size: 4; }
.editor pre.hl { position: absolute; inset: 0; color: var(--text); pointer-events: none; overflow: hidden; background: none; border-radius: 12px; }
.editor textarea { position: relative; display: block; width: 100%; min-height: 16rem; max-height: 70vh; border: 0; outline: 0; resize: none; background: transparent; color: transparent; caret-color: var(--accent); overflow-y: auto; }
.editor textarea::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.editor textarea::placeholder { color: var(--soft); }
.hl .m { color: var(--soft); }
.hl .h { font-weight: 700; }
.hl .b { font-weight: 700; }
.hl .i { font-style: italic; }
.hl .s { text-decoration: line-through; color: var(--soft); }
.hl .k { background: color-mix(in srgb, var(--highlight) 55%, transparent); border-radius: 3px; }
.hl .c { color: color-mix(in srgb, var(--link) 70%, var(--text)); }
.hl .l { color: var(--link); }
.hl .t { color: var(--link); background: color-mix(in srgb, var(--link) 14%, transparent); border-radius: 4px; }
.hl .d { color: var(--accent); }
.hl .q { color: var(--soft); }
.hl .f { color: var(--soft); }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75em 1em; margin-top: 1rem; }
.status { font: 14px/1.6 -apple-system, system-ui, sans-serif; color: var(--soft); margin: 0.8rem 0 0; }
.status.warn { color: #d08a3a; }
#linkfield { display: block; width: 100%; margin-top: 0.8rem; padding: 0.5em 0.75em; border: 1px solid var(--faint); border-radius: 8px; background: none; color: var(--text); font: 13px/1.5 ui-monospace, Menlo, monospace; }

.editor.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* Themes page. */
.themegrid { display: flex; flex-direction: column; gap: 1.1em; margin: 0.6rem 0 0; }
.themegrid .themegroup > p { margin: 0 0 0.45em; font: 14px/1.6 -apple-system, system-ui, sans-serif; }
.themegrid .cards { display: flex; flex-wrap: wrap; gap: 0.75em; }
.themegrid .swatch { width: 10.5em; font-size: 13px; }
.themegrid .swatch .card { font-size: 13px; padding: 0.7em 0.85em; }
.themegrid .swatch .card { cursor: default; }
.suggested { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 0.6rem; }
.suggested .theme { border: 1px solid var(--faint); border-radius: 12px; padding: 1rem; }
.suggested .theme .about { font: 14px/1.5 -apple-system, system-ui, sans-serif; color: var(--soft); margin: 0.5rem 0 0.8rem; }
.sample { border-radius: 12px; padding: 1rem 1.2rem; font: 14px/1.6 ui-monospace, Menlo, monospace; border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.sample h1 { font-size: 1.2em; margin: 0 0 0.5em; }
.sample p, .sample ul { margin: 0 0 0.5em; }
.sample .tag { color: var(--link); background: color-mix(in srgb, var(--link) 14%, transparent); }
.maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
@media (max-width: 40rem) { .maker { grid-template-columns: 1fr; } }
.maker label { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.6em; font: 15px/1.6 -apple-system, system-ui, sans-serif; padding: 0.45em 0; border-bottom: 1px solid var(--faint); }
.maker label span.use { color: var(--soft); font-size: 0.85em; display: block; }
.maker input[type=color] { width: 2.6em; height: 1.9em; border: 1px solid var(--faint); border-radius: 6px; padding: 0.1em; background: none; }
.maker input[type=text] { width: 7.2em; font: 14px ui-monospace, Menlo, monospace; text-align: right; padding: 0.3em 0.5em; border: 1px solid var(--faint); border-radius: 8px; background: none; color: var(--text); }
.maker input.name { width: 100%; font: inherit; padding: 0.4em 0.6em; border: 1px solid var(--faint); border-radius: 8px; background: none; color: var(--text); margin-bottom: 0.6rem; }
.maker .preview { position: sticky; top: 1rem; }
.startfrom { font: 14px/1.5 -apple-system, system-ui, sans-serif; color: var(--soft); margin: 1.4rem 0 0.3rem; }
#pastecode { width: 100%; margin-top: 0; padding: 0.4em 0.6em; border: 1px solid var(--faint); border-radius: 8px; background: none; color: var(--text); font: 13px ui-monospace, Menlo, monospace; }
.maker .preview .sample { min-height: 12rem; }

/* Save as PDF: the browser's own print, with only the note on the page. */
#printout { display: none; }
@media print {
  body > main > :not(#printout) { display: none !important; }
  /* As Urth's own PDF export: the system sans, black on white, no marks, nothing of the editor. */
  body { background: #fff; color: #111; font: 12pt/1.6 -apple-system, system-ui, "Helvetica Neue", sans-serif; }
  main { max-width: none; padding: 0; }
  #printout { display: block; max-width: 36em; margin: 0 auto; }
  #printout .mark { display: none; }
  #printout h1, #printout h2, #printout h3 { color: #111; font-weight: 650; line-height: 1.25; margin: 1.5em 0 0.45em; }
  #printout h1 { font-size: 1.6em; margin-top: 0.2em; } #printout h2 { font-size: 1.25em; } #printout h3 { font-size: 1.1em; }
  #printout p, #printout ul, #printout ol, #printout blockquote, #printout pre, #printout .table { margin: 0 0 0.85em; }
  #printout li { margin: 0.2em 0; } #printout li::marker { color: #111; }
  #printout .box { color: #111; } #printout li.done > .text { color: #666; }
  #printout a, #printout .wiki, #printout .tag { color: #111; text-decoration: none; border: 0; background: none; }
  #printout .tag { color: #666; }
  #printout code, #printout pre { font: 0.92em/1.5 ui-monospace, Menlo, monospace; } #printout pre { background: #f3f3f3; border: 1px solid #ddd; }
  #printout blockquote { border-left: 3px solid #999; color: #444; }
  #printout mark { background: #f3e39a; }
  #printout table { font-size: 0.95em; border-color: #ccc; } #printout th, #printout td { border-color: #ddd; }
  @page { margin: 0.75in; }
}
