/* Home — quiet editorial layout with a little character */
.home{width:min(100% - 40px,660px);margin-inline:auto;padding:64px 0 44px;transition:width .2s ease}
.home:has(.workspace-layout.notes-open){width:min(100% - 48px,1120px)}
.home-intro{padding:0 0 32px}
.home-intro>.eyebrow,.eyebrow{font-size:.7rem;letter-spacing:.085em;text-transform:uppercase;color:var(--mute);font-weight:500}
.home-intro>.eyebrow{margin:0 0 20px}
.home-intro h1{font-size:clamp(2.65rem,7.3vw,4.1rem);line-height:1.02;letter-spacing:-.065em;font-weight:500;margin:0;max-width:620px}
.home-intro h1 .l2{font-weight:800}
.home-intro h1 .run-block{display:inline-block;background:var(--ink);color:var(--bg);font-weight:900;text-transform:uppercase;letter-spacing:-.03em;padding:.02em .14em .0em;border-radius:.16em;line-height:1.02;margin-left:.04em}
.home-deck{font-size:1.02rem;line-height:1.7;color:var(--mute);max-width:440px;margin:20px 0 22px}
.home-meta{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:22px;color:var(--mute);font-size:.73rem}
.home-meta span:before{content:"·";margin-right:7px;color:var(--acc)}
.home-section{padding:18px 0 12px;border-top:1px solid var(--line)}
.section-top{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:18px}.section-top-links{justify-content:flex-end}
.section-top .eyebrow{margin:0 0 8px}
.section-top h2{font-size:1.18rem;line-height:1.35;font-weight:500;letter-spacing:-.035em;margin:0;color:var(--ink)}
.section-link{flex:none;color:var(--mute);font-size:.76rem;text-decoration:none}
.section-link:hover{color:var(--acc)}
.home-tools{display:block}
.home-tools .tool{min-height:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;padding:15px 0;border-radius:0;background:transparent;border-bottom:1px solid var(--line);text-decoration:none;color:var(--ink)}
@media(hover:hover){.home-tools .tool:hover{transform:none;color:var(--mute)}}
.tool-symbol{display:none}
.home-tools .tool-copy{min-width:0}
.home-tools .tool .eyebrow{font-size:.62rem;margin:0 0 3px;color:var(--mute);letter-spacing:.08em}
.home-tools .tool-title{font-size:.87rem;font-weight:500;line-height:1.4;margin:0;color:var(--ink)}
.home-tools .tool p{font-size:.76rem;line-height:1.5;color:var(--mute);margin:4px 0 0}
.home-tools .tool .go{display:none}.home-tools .tool .tool-chevron{display:inline-block;font-size:1rem;line-height:1;color:#999;margin:4px 2px 0;transition:transform .22s ease,color .22s ease}.home-tools .tool[aria-expanded="true"] .tool-chevron{transform:rotate(180deg);color:var(--ink)}
.home-tools .tool .big,.home-tools .tool .bars{display:none}
.home-posts .post{padding:15px 0;gap:16px;border-top:1px solid var(--line)}
.home-posts .post:first-child{border-top:1px solid var(--line)}
.home-posts .post h3{font-size:.92rem;font-weight:500;line-height:1.4;letter-spacing:-.02em;margin:5px 0;text-decoration:none}
.home-posts .post p{font-size:.79rem;line-height:1.55;margin:0;max-width:440px}
.home-posts .post .eyebrow{font-size:.63rem;letter-spacing:.07em}
.home-posts .post .th{width:64px;height:64px;border-radius:6px;object-fit:cover}
.home-footer{display:flex;flex-wrap:wrap;gap:8px 16px;justify-content:space-between;border-top:1px solid var(--line);padding-top:16px;margin-top:38px;font-size:.72rem;color:var(--mute)}
.home-footer a{color:var(--ink);text-decoration:none}
@media(max-width:560px){.home:has(.workspace-layout.notes-open){width:calc(100% - 32px)}.home{padding-top:42px}.home-intro{padding-bottom:32px}.home-intro h1{font-size:clamp(2.5rem,12vw,3.5rem)}.home-deck{font-size:.95rem}.home-tools{grid-template-columns:1fr}.home-tools .tool{padding:13px 0}.section-top h2{font-size:1.08rem}.home-footer{justify-content:flex-start}.home-footer span:last-child{width:100%}}

@media(prefers-reduced-motion:reduce){.home-tools .tool .tool-chevron{transition:none}}

/* Inline tools on the landing page */
.home-tools .tool[aria-expanded="true"]{color:var(--ink)}
.home-tools .tool[aria-expanded="true"] .tool-mark{background:var(--ink);color:var(--bg)}

.inline-tool{grid-column:1/-1;margin:0;padding:18px 0 24px;border-bottom:1px solid var(--line);animation:inline-tool-in .2s ease-out}
.inline-tool[hidden]{display:none}
.inline-tool-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:10px}
.inline-tool-head .eyebrow{margin:0 0 4px;font-size:.62rem}
.inline-tool-head h3{font-size:1.1rem;letter-spacing:-.03em;font-weight:500;margin:0}
.inline-tool-actions{display:flex;align-items:center;gap:8px}
.send-to-notes{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--ink);font:inherit;font-size:.76rem;padding:8px 12px;cursor:pointer}
.send-to-notes:hover{background:var(--ink);color:var(--bg)}
.inline-tool-close{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--mute);font:inherit;font-size:.76rem;padding:8px 12px;cursor:pointer}
.inline-tool-close:hover{color:var(--ink);border-color:var(--mute)}
.inline-tool iframe{display:block;width:100%;height:420px;border:0;border-radius:0;background:transparent;overflow:hidden}
@keyframes inline-tool-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:560px){.inline-tool{padding:16px 0 20px}.inline-tool iframe{height:420px}}
@media(prefers-reduced-motion:reduce){.inline-tool{animation:none}}

/* Persistent tools + notes workspace */
.workspace-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.workspace-heading .eyebrow{margin:0 0 5px;font-size:.62rem}
.workspace-heading h2{font-size:1.15rem;line-height:1.35;font-weight:500;letter-spacing:-.035em;margin:0;color:var(--ink)}
.notes-toggle{display:inline-flex;align-items:center;gap:9px;white-space:nowrap;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--ink);font:inherit;font-size:.77rem;padding:9px 13px;cursor:pointer;transition:background .16s ease,color .16s ease,border-color .16s ease}
.notes-toggle:hover,.notes-toggle[aria-expanded="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.notes-indicator{font-size:.5rem;color:var(--acc)}
.notes-toggle[aria-expanded="true"] .notes-indicator{color:inherit}
.workspace-layout{display:block}
.workspace-layout.notes-open{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.9fr);align-items:start;gap:34px}
.tools-column{min-width:0}
.notes-panel{min-width:0;padding:0 0 8px;animation:inline-tool-in .2s ease-out;position:sticky;top:20px}
.notes-panel[hidden]{display:none}
.notes-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.notes-caption{font-size:.63rem;letter-spacing:.09em;color:var(--mute);margin:0}
.notes-subtitle{font-size:.77rem;line-height:1.5;color:var(--mute);margin:6px 0 0}
.notes-close{flex:none;border:0;background:transparent;color:var(--mute);font-size:1.4rem;line-height:1;padding:0 2px;cursor:pointer}
.notes-close:hover{color:var(--ink)}
.notes-import,.notes-download{border:1px solid var(--line);background:transparent;color:var(--ink);font:inherit;font-size:.75rem;border-radius:999px;padding:8px 12px;cursor:pointer}
.notes-import:hover,.notes-download:hover{background:var(--ink);color:var(--bg)}
#notes-editor{display:block;width:100%;min-height:340px;resize:vertical;border:1px solid var(--line);border-radius:6px;background:transparent;color:var(--ink);font:400 .86rem/1.75 ui-monospace,SFMono-Regular,Menlo,monospace;padding:14px;outline:none}
#notes-editor:focus{border-color:var(--mute)}
.notes-footer{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin-top:12px}
#notes-status,.notes-help{font-size:.72rem;color:var(--mute)}
.notes-downloads{display:flex;align-items:center;gap:8px;flex-wrap:wrap;width:100%}
.notes-downloads label{font-size:.72rem;color:var(--mute)}
#notes-format{min-width:0;flex:1;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--ink);font:inherit;font-size:.74rem;padding:8px 10px}
.notes-panel>.notes-import{margin-top:14px}
.notes-help{line-height:1.6;margin:10px 0 0}
@media(max-width:760px){
 .workspace-layout.notes-open{grid-template-columns:minmax(0,1fr);gap:30px}
 .notes-panel{position:static;border-top:1px solid var(--line);padding-top:20px}
 #notes-editor{min-height:220px}
}
@media(max-width:560px){
 .workspace-heading{align-items:flex-start}
 .inline-tool-actions{gap:6px}
 .send-to-notes,.inline-tool-close{font-size:.7rem;padding:7px 9px}
 .workspace-heading h2{font-size:1.08rem}
 .notes-toggle{font-size:.73rem;padding:8px 10px}
 .workspace-layout.notes-open{gap:24px}
 .notes-downloads{align-items:stretch}
}
@media(prefers-reduced-motion:reduce){.notes-toggle,.notes-panel{transition:none;animation:none}}

/* Workspace refinements: generous split layout and usable note formatting */
.home:has(.workspace-layout.notes-open){width:min(calc(100% - 64px),1440px)}
.workspace-layout.notes-open{grid-template-columns:minmax(0,1.12fr) minmax(380px,.88fr);gap:clamp(36px,5vw,76px)}
.workspace-layout.notes-open .tools-column{min-width:0}
.workspace-layout.notes-open .notes-panel{min-width:0}
.inline-tool-head{align-items:center}
.inline-tool-actions{flex-shrink:0}
.send-to-notes{gap:7px;border-color:var(--acc);background:var(--acc);color:var(--bg);font-weight:500;box-shadow:0 2px 8px #0000000a}
.send-to-notes:hover{filter:brightness(.94);background:var(--acc);color:var(--bg)}
.notes-toolbar{padding-bottom:14px;border-bottom:1px solid var(--line)}
.notes-caption{font-weight:600;letter-spacing:.12em}
#notes-editor{min-height:420px;resize:vertical;border-radius:0;border:1px solid var(--line);border-top:0;padding:18px;background:color-mix(in srgb,var(--bg) 96%,var(--ink));font:400 .88rem/1.85 ui-monospace,SFMono-Regular,Menlo,monospace;tab-size:2}
.notes-formatbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:10px;border:1px solid var(--line);border-bottom:0;background:color-mix(in srgb,var(--bg) 92%,var(--ink))}
.notes-formatbar button{border:1px solid transparent;border-radius:4px;background:transparent;color:var(--mute);font:500 .72rem/1.2 Inter,sans-serif;padding:7px 9px;cursor:pointer}
.notes-formatbar button:hover{border-color:var(--line);color:var(--ink);background:var(--bg)}
.notes-formatbar button strong,.notes-formatbar button em{font-size:.82rem}
.notes-footer{padding-top:2px}
#notes-status{line-height:1.4}
.notes-downloads{padding-top:10px;border-top:1px solid var(--line)}
.notes-import{display:inline-flex;align-items:center;gap:7px}
@media(max-width:1000px){
 .home:has(.workspace-layout.notes-open){width:calc(100% - 48px)}
 .workspace-layout.notes-open{grid-template-columns:minmax(0,1fr) minmax(320px,.9fr);gap:28px}
}
@media(max-width:760px){
 .home:has(.workspace-layout.notes-open){width:calc(100% - 32px)}
 .workspace-layout.notes-open{grid-template-columns:minmax(0,1fr);gap:26px}
 .notes-panel{position:static;border-top:1px solid var(--line);padding-top:22px}
 #notes-editor{min-height:280px}
}
@media(max-width:560px){
 .inline-tool-head{align-items:flex-start;flex-wrap:wrap}
 .send-to-notes{font-size:.72rem;padding:8px 11px}
 .notes-formatbar{gap:3px;padding:7px}
 .notes-formatbar button{padding:7px}
}


/* Keep notes and tool actions consistent with the site's quiet editorial style */
.send-to-notes{
  display:inline-flex;
  align-items:center;
  gap:7px;
  border:1px solid var(--line);
  border-radius:999px;
  background:transparent;
  color:var(--ink);
  box-shadow:none;
  font:inherit;
  font-size:.75rem;
  font-weight:400;
  padding:7px 11px;
  cursor:pointer;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}
.send-to-notes:hover{
  background:var(--ink);
  color:var(--bg);
  border-color:var(--ink);
  filter:none;
}
.send-to-notes:focus-visible,
.notes-formatbar button:focus-visible,
.notes-import:focus-visible,
.notes-download:focus-visible,
#notes-format:focus-visible{
  outline:2px solid var(--ink);
  outline-offset:3px;
}
.notes-panel{
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
}
.notes-toolbar{
  padding:0 0 12px;
  margin-bottom:14px;
  border-bottom:1px solid var(--line);
}
.notes-caption{
  color:var(--mute);
  font-size:.62rem;
  font-weight:500;
  letter-spacing:.085em;
}
.notes-subtitle{font-size:.76rem;margin-top:5px}
.notes-formatbar{
  display:flex;
  align-items:center;
  gap:3px;
  flex-wrap:wrap;
  padding:6px 0;
  border:0;
  border-bottom:1px solid var(--line);
  background:transparent;
}
.notes-formatbar button{
  min-width:30px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:var(--mute);
  font:400 .73rem/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
  padding:6px 9px;
  cursor:pointer;
}
.notes-formatbar button:hover{
  background:var(--line);
  color:var(--ink);
  border-color:transparent;
}
#notes-editor{
  min-height:400px;
  padding:14px 0;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  background:transparent;
  color:var(--ink);
  font:400 .86rem/1.8 Inter,ui-sans-serif,system-ui,sans-serif;
  outline:none;
  resize:vertical;
}
#notes-editor:focus{border-bottom-color:var(--ink)}
.notes-footer{gap:10px;margin-top:12px}
.notes-downloads{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.notes-downloads label{font-size:.72rem;color:var(--mute)}
#notes-format{
  min-width:0;
  flex:1;
  border:1px solid var(--line);
  border-radius:999px;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-size:.73rem;
  padding:7px 10px;
}
.notes-import,.notes-download{
  border:1px solid var(--line);
  border-radius:999px;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-size:.73rem;
  padding:7px 11px;
  cursor:pointer;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}
.notes-import:hover,.notes-download:hover{
  background:var(--ink);
  color:var(--bg);
  border-color:var(--ink);
}
.notes-help{font-size:.7rem;line-height:1.55;color:var(--mute)}
@media(max-width:760px){
  .notes-panel{border-top:1px solid var(--line);padding-top:20px}
  #notes-editor{min-height:260px}
}
@media(prefers-reduced-motion:reduce){
  .send-to-notes,.notes-import,.notes-download{transition:none}
}


/* Rich-text notes editor */
#notes-editor.notes-editor{
  display:block;
  width:100%;
  min-height:400px;
  padding:14px 0;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  background:transparent;
  color:var(--ink);
  font:400 .86rem/1.8 Inter,ui-sans-serif,system-ui,sans-serif;
  outline:none;
  overflow-wrap:anywhere;
  white-space:normal;
}
#notes-editor.notes-editor:focus{border-bottom-color:var(--ink)}
#notes-editor.notes-editor:empty:before{content:attr(data-placeholder);color:var(--mute);pointer-events:none}
#notes-editor.notes-editor h1,#notes-editor.notes-editor h2,#notes-editor.notes-editor h3{font-weight:500;letter-spacing:-.035em;line-height:1.35;margin:1.1em 0 .45em}
#notes-editor.notes-editor h2{font-size:1.12rem}
#notes-editor.notes-editor h3{font-size:.98rem}
#notes-editor.notes-editor p{margin:.55em 0}
#notes-editor.notes-editor ul,#notes-editor.notes-editor ol{padding-left:1.5rem;margin:.55em 0}
#notes-editor.notes-editor li{padding-left:.2rem;margin:.2em 0}
#notes-editor.notes-editor hr{border:0;border-top:1px solid var(--line);margin:1.1em 0}
#notes-editor.notes-editor code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.9em}
@media(max-width:760px){#notes-editor.notes-editor{min-height:260px}}


/* Mobile: prevent horizontal drift between the tool list and notes */
html,body{max-width:100%;overflow-x:clip}
.home,.home:has(.workspace-layout.notes-open){max-width:100%}
.workspace-layout,.workspace-layout.notes-open,.tools-column,.notes-panel,.inline-tool{min-width:0;max-width:100%}
.inline-tool iframe{width:100%;max-width:100%;display:block}
#notes-editor.notes-editor{max-width:100%;overflow-wrap:anywhere;word-break:normal}
@media(max-width:760px){
  .home:has(.workspace-layout.notes-open){width:calc(100% - 32px)}
  .workspace-layout.notes-open{display:flex;flex-direction:column;gap:24px}
  .tools-column,.notes-panel{width:100%;min-width:0}
  .notes-panel{position:static}
  .inline-tool{width:100%;overflow:hidden}
  .inline-tool iframe{height:460px}
  .notes-downloads{width:100%;min-width:0}
  #notes-format{max-width:100%}
}
@media(max-width:380px){
  .home,.home:has(.workspace-layout.notes-open){width:calc(100% - 24px)}
  .workspace-heading{gap:8px}
  .notes-toggle{gap:6px;padding:8px;font-size:.7rem}
  .inline-tool-head{gap:10px}
  .send-to-notes{max-width:100%;white-space:normal}
  .notes-formatbar button{padding-inline:6px}
}


/* Prevent iOS Safari from zooming when the notes editor receives focus */
@media (max-width: 760px) {
  #notes-editor { font-size: 16px !important; }
}

/* Small directional arrow motion on the notes toggle */
.notes-toggle{gap:9px}
.notes-toggle .notes-arrow{width:15px;height:15px;flex:none;transition:transform .3s ease}
.notes-toggle:hover .notes-arrow{transform:translateX(4px)}
.notes-toggle[aria-expanded="true"] .notes-arrow{transform:rotate(180deg)}
.notes-toggle[aria-expanded="true"]:hover .notes-arrow{transform:rotate(180deg) translateX(4px)}
@media(prefers-reduced-motion:reduce){.notes-toggle .notes-arrow{transition:none}}

.workspace-controls{display:flex;align-items:center;gap:8px;flex:none}
.theme-toggle{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--mute);font:inherit;font-size:.75rem;padding:9px 11px;cursor:pointer;transition:background .16s ease,color .16s ease,border-color .16s ease}
.theme-toggle:hover{border-color:var(--mute);color:var(--ink)}
.theme-toggle span{font-size:.9rem;line-height:1}
.workspace-heading{flex-wrap:wrap}
@media(max-width:560px){.workspace-controls{gap:6px}.theme-toggle{font-size:.7rem;padding:8px 9px;gap:5px}}
.home-tools .tool{transition:padding-left .18s ease,color .18s ease,border-color .18s ease}
.home-tools .tool .tool-chevron{transition:transform .2s ease,color .2s ease}
/* Hover effects only where a real pointer exists. On touch screens :hover sticks after a tap, which left a closed tool indented and blue. */
@media(hover:hover){
  .home-tools .tool:hover{padding-left:5px;color:var(--ink)}
  .home-tools .tool:hover .tool-title{color:var(--acc)}
  .home-tools .tool:hover .tool-chevron{transform:translateX(2px);color:var(--acc)}
  .home-tools .tool[aria-expanded="true"]:hover .tool-chevron{transform:rotate(180deg) translateX(-2px)}
}
/* The open tool keeps its indent while open and returns to normal when closed */
.home-tools .tool[aria-expanded="true"]{padding-left:5px}
@media(prefers-reduced-motion:reduce){.theme-toggle,.home-tools .tool,.home-tools .tool .tool-chevron{transition:none}}

/* Keep the theme control in the top-right corner of the page. */
.home-intro{position:relative;padding-top:42px}
.theme-toggle{position:absolute;top:0;right:0}
@media(max-width:560px){.home-intro{padding-top:42px}}


/* Dark-mode actions use the same neutral treatment as the black controls in light mode. */
:root[data-theme="dark"] .send-to-notes{border-color:#e7e7e9;background:#e7e7e9;color:#17181b}
:root[data-theme="dark"] .send-to-notes:hover{background:#d7d8dc;border-color:#d7d8dc;color:#17181b}
:root[data-theme="dark"] .notes-toggle:hover,
:root[data-theme="dark"] .notes-toggle[aria-expanded="true"]{background:#e7e7e9;color:#17181b;border-color:#e7e7e9}
:root[data-theme="dark"] .notes-import:hover,
:root[data-theme="dark"] .notes-download:hover{background:#e7e7e9;color:#17181b}

/* "Show more tools" toggle under the tool list */
.home-tools .tool[hidden]{display:none}
.more-tools{display:inline-flex;align-items:center;gap:6px;margin:12px 0 0;padding:8px 0;border:0;background:none;color:var(--mute);font:inherit;font-size:.8rem;font-weight:500;cursor:pointer;transition:color .15s}
.more-tools::after{content:"↓";font-size:.95rem;line-height:1}
.more-tools[aria-expanded="true"]::after{content:"↑"}
.more-tools:hover{color:var(--ink)}
.more-tools:focus-visible{outline:2px solid var(--acc);outline-offset:3px;border-radius:4px}
/* First visit: hold the list for a moment until we know which tools are switched on */
.tv-pending .home-tools{visibility:hidden}
