/* Shared color tokens. Each page sets its own theme (paper, ink, accent); these are the same everywhere. */
:root{
  --warn-bg:#FFF1D6; --warn-ink:#6B4A00; --bird-bg:#FFF8F3;
  --sh-sm:0 1px 3px rgba(30,20,20,.1); --sh-md:0 4px 14px rgba(30,20,20,.08); --sh-lift:0 6px 16px rgba(30,20,20,.18);
  --r-sm:12px; --r-md:16px; --r-lg:20px; --r-xl:22px;
  --sh-pop:0 10px 30px rgba(30,20,20,.2); --sh-modal:0 16px 44px rgba(30,20,20,.28); --scrim:rgba(25,18,22,.5);
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){ --warn-bg:#3D3218; --warn-ink:#F6DD9C; } }
:root[data-theme="dark"]{ --warn-bg:#3D3218; --warn-ink:#F6DD9C; }
/* Made by Caroline: styles shared by every page. Pages set the colors (--panel, --ink, --plum, --on-accent, --grid, --muted). */
.wakemsg{margin:-2px 0 8px;font-size:.82rem;color:var(--muted);max-width:60ch}
.wakemsg:empty{display:none}
/* overlay tour */
.mbc-tour-scrim{position:fixed;inset:0;z-index:90;background:transparent}
.mbc-tour-scrim.center{background:var(--scrim)}
.mbc-tour-spot{position:fixed;z-index:91;border-radius:var(--r-lg);box-shadow:0 0 0 3px var(--plum),0 0 0 9999px var(--scrim);pointer-events:none}
.mbc-tour-spot[hidden]{display:none}
.mbc-tour-pop{position:fixed;z-index:92;width:min(340px,calc(100vw - 24px));background:var(--panel);color:var(--ink);border:1px solid var(--grid);border-radius:var(--r-lg);padding:14px 16px 12px;box-shadow:var(--sh-modal)}
.mbc-tour-count{margin:0 0 2px;font-size:.78rem;color:var(--muted)}
.mbc-tour-pop h3{font-size:1.1rem;color:var(--plum);margin:0 28px 6px 0}
.mbc-tour-x{position:absolute;top:8px;right:8px;width:32px;height:32px;border:0;border-radius:50%;background:var(--plum-soft);color:var(--plum);font:inherit;font-size:1.1rem;font-weight:700;line-height:1;cursor:pointer}
.mbc-tour-x:focus-visible{outline:3px solid var(--plum);outline-offset:2px}
@media (prefers-reduced-motion:no-preference){.mbc-tour-spot{transition:top .25s ease,left .25s ease,width .25s ease,height .25s ease}}
.mbc-tour-text{margin:0 0 12px;font-size:.95rem;line-height:1.5}
.mbc-tour-foot{display:flex;align-items:center;gap:8px}
.mbc-tour-skip{margin-right:auto;min-height:40px;border:0;background:transparent;color:var(--muted);font:inherit;font-size:.9rem;font-weight:700;padding:0 4px;text-decoration:underline;cursor:pointer}
.mbc-tour-foot button[hidden]{display:none}
.mbc-tour-foot button:focus-visible{outline:3px solid var(--plum);outline-offset:2px}
/* Updates and Sources at the bottom of each builder, folded up until tapped */
.footnotes{max-width:880px;margin:32px auto 0;display:grid;gap:10px}
.sources{border:1px solid var(--grid);border-radius:var(--r-md);background:var(--panel);color:var(--ink);font-size:.9rem;line-height:1.5}
.sources summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:50px;padding:0 18px;cursor:pointer;font-family:Fredoka,"Arial Rounded MT Bold","Trebuchet MS",sans-serif;font-weight:600;font-size:1.05rem;color:var(--plum)}
.sources summary::-webkit-details-marker{display:none}
.sources summary::after{content:"+";font-size:1.3rem;line-height:1}
.sources[open] summary::after{content:"\2212"}
.sources summary:focus-visible{outline:3px solid var(--plum);outline-offset:2px;border-radius:var(--r-md)}
.sources ul{margin:0;padding:0 18px 16px 36px}
.sources ul.upd{list-style:none;padding-left:18px}
.sources ul ul{padding:2px 0 6px 1.1em;list-style:disc}
.sources li{margin-bottom:4px}
.sources a{color:inherit;text-decoration:underline}
.sources .upd-date{color:var(--muted);font-size:.85rem}

/* Buttons, shared by every page: outline by default; .solid for the main action, .quiet for Back / Not now,
   .small for tight spots, .block to fill the width */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 18px;border-radius:999px;border:1.5px solid var(--plum);background:transparent;color:var(--plum);font:inherit;font-size:.95rem;font-weight:700;line-height:1.2;cursor:pointer;touch-action:manipulation;text-decoration:none}
.btn.solid{background:var(--plum);color:var(--on-accent)}
.btn.quiet{border-color:var(--grid);color:var(--muted)}
.btn.small{min-height:38px;padding:0 14px;font-size:.88rem}
.btn.block{display:flex;width:100%}
.btn[hidden]{display:none}
.btn:focus-visible{outline:3px solid var(--plum);outline-offset:2px}
.btn:disabled,.btn[disabled]{opacity:.5;cursor:default}
@media (prefers-reduced-motion:no-preference){.btn{transition:background-color .15s ease,border-color .15s ease}}

/* Tabs: a pill under the header on wider screens, a bar along the bottom on phones. Pages may set --tabs-w on .tabs. */
.tabs{display:flex;gap:4px;position:sticky;top:calc(10px + env(safe-area-inset-top,0px));z-index:10;max-width:var(--tabs-w,600px);margin:0 auto 24px;padding:5px;background:var(--panel);border:1px solid var(--grid);border-radius:999px;box-shadow:var(--sh-md)}
.tabs button{flex:1;min-height:42px;padding:0 2px;border:0;border-radius:999px;background:transparent;color:var(--muted);font:inherit;font-size:.98rem;cursor:pointer;touch-action:manipulation}
.tabs button[aria-selected="true"]{background:var(--plum-soft);color:var(--plum);font-weight:700}
.tabs button:focus-visible{outline:3px solid var(--plum);outline-offset:2px}
@media (max-width:900px){
  .tabs{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;top:auto;max-width:none;margin:0;border:0;border-top:1px solid var(--grid);border-radius:0;box-shadow:none;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px))}
  .tabs button{min-height:52px;font-size:.9rem}
}

/* Pop-up notes ("Open this profile?", "Shared pattern loaded", "New version ready"): bottom of the screen,
   above the phone tab bar; .top for the new-version note. Buttons inside are .btn. */
.mbc-toast{position:fixed;z-index:86;left:50%;bottom:calc(18px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:min(420px,calc(100vw - 24px));padding:12px 16px;border-radius:var(--r-lg);background:var(--panel);color:var(--ink);border:1.5px solid var(--plum);box-shadow:var(--sh-pop);font-size:.92rem}
.mbc-toast.top{top:calc(14px + env(safe-area-inset-top,0px));bottom:auto;z-index:87}
.mbc-toast p{margin:0 0 10px}
.mbc-toast div{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
@media (max-width:900px){ .mbc-toast:not(.top){bottom:calc(84px + env(safe-area-inset-bottom,0px))} }

/* The bird window on the Pattern tab: a round bird button you can drag; tap it for a little chart window.
   Pages set where it starts (left/top or right/bottom) and what goes inside. */
.mbc-mini{position:fixed;z-index:30;width:min(330px,calc(100vw - 24px));background:var(--panel);border:1px solid var(--grid);border-radius:var(--r-lg);box-shadow:var(--sh-pop);overflow:hidden}
body:not([data-view="pattern"]) .mbc-mini{display:none}
.mbc-mini-head{display:flex;align-items:center;gap:8px;padding:6px 6px 6px 14px;background:var(--plum-soft);cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.mbc-mini.dragging .mbc-mini-head{cursor:grabbing}
.mbc-mini-head:focus-visible{outline:3px solid var(--plum);outline-offset:2px}
.mbc-mini-title{flex:1;font-family:Fredoka,"Arial Rounded MT Bold","Trebuchet MS",sans-serif;font-weight:600;color:var(--plum)}
.mbc-mini-btn{width:36px;height:36px;border:0;border-radius:50%;background:var(--panel);color:var(--plum);font:inherit;font-size:1.2rem;font-weight:700;line-height:1;cursor:pointer;touch-action:manipulation}
.mbc-mini-body{padding:10px 12px 12px;max-height:46vh;overflow:auto}
.mbc-mini-bird{display:none;width:44px;height:auto;margin:0}
.mbc-mini.min{width:auto;background:transparent;border:0;box-shadow:none;overflow:visible;border-radius:50%}
.mbc-mini.min .mbc-mini-body{display:none}
.mbc-mini.min .mbc-mini-head{width:64px;height:64px;box-sizing:border-box;justify-content:center;padding:0;border-radius:50%;background:var(--bird-bg);border:2px solid var(--grid);box-shadow:var(--sh-lift);cursor:pointer}
.mbc-mini.min .mbc-mini-title,.mbc-mini.min .mbc-mini-btn{display:none}
.mbc-mini.min .mbc-mini-bird{display:block}
@media (prefers-reduced-motion:no-preference){
  .mbc-mini.min .mbc-mini-bird{animation:mbcbob 2.6s ease-in-out infinite}
  .mbc-mini.min.dragging .mbc-mini-bird{animation:none;transform:scale(1.08)}
  @keyframes mbcbob{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-3px) rotate(-4deg)}}
}

/* Builder page title, and the labels on each group of settings */
header.top h1{font-size:clamp(1.6rem,4vw,2.3rem);font-weight:600;color:var(--plum)}
legend{display:block;padding:0;margin-bottom:10px;font-family:Fredoka,"Arial Rounded MT Bold","Trebuchet MS",sans-serif;font-weight:600;font-size:1.1rem;line-height:1.25;color:var(--plum)}

/* Pick-one strip for short choices (Auto / Narrow / Standard / Wide); option cards are for choices with a description */
.seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;padding:4px;border:1px solid var(--grid);border-radius:999px;background:var(--paper)}
.seg button{min-height:40px;padding:0 10px;font:inherit;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:999px;border:0;background:transparent;color:var(--muted);cursor:pointer;touch-action:manipulation}
.seg button[aria-pressed="true"]{background:var(--plum);color:var(--on-accent);font-weight:700;box-shadow:var(--sh-sm)}
.seg button:focus-visible{outline:3px solid var(--plum);outline-offset:2px}
@media (max-width:380px){ .seg button{font-size:.85rem;padding:0 6px} }

/* Header bits shared by the builders: the link back to All projects, and the Tour button */
.allproj{display:inline-flex;align-items:center;gap:.3em;min-height:28px;font-size:.88rem;font-weight:700;color:var(--plum);text-decoration:none}
.allproj:hover{text-decoration:underline}
.allproj:focus-visible{outline:3px solid var(--plum);outline-offset:2px;border-radius:8px}
.tourchip{display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:.85rem;min-height:36px;padding:0 10px 0 6px;border-radius:999px;border:0;background:transparent;color:var(--muted);cursor:pointer;touch-action:manipulation}
.tourchip::before{content:"\25B8";display:grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1.5px solid currentColor;font-size:.8rem;line-height:1;padding-left:1px}
.tourchip:hover{color:var(--plum)}
.tourchip:focus-visible{outline:3px solid var(--plum);outline-offset:2px}

/* Show / Hide on a step that's checked Done (it folds up) */
.expbtn{display:none;border:1px solid var(--grid);background:var(--plum-soft);color:var(--plum);border-radius:999px;padding:4px 12px;min-height:32px;font:inherit;font-size:.8rem;font-weight:700;cursor:pointer;touch-action:manipulation}
.done .expbtn{display:inline-block}
.expbtn:focus-visible{outline:3px solid var(--plum);outline-offset:2px}

/* Easy read: a dyslexia-friendly font (OpenDyslexic if installed, otherwise Lexend), bigger text, roomier spacing and
   stronger contrast for knitting in dim light. Nothing moves. Turned on with an .a11ychip button. */
.a11ychip{display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:.85rem;min-height:36px;padding:0 10px 0 6px;border-radius:999px;border:0;background:transparent;color:var(--muted);cursor:pointer;touch-action:manipulation}
.a11ychip::before{content:"Aa";display:grid;place-items:center;min-width:24px;height:20px;padding:0 3px;border-radius:999px;border:1.5px solid currentColor;font-weight:700;font-size:.68rem}
.a11ychip:hover{color:var(--plum)}
.a11ychip[aria-pressed="true"]{color:var(--plum);background:var(--plum-soft)}
.a11ychip:focus-visible{outline:3px solid var(--plum);outline-offset:2px}
body.easyread{--easy-font:"OpenDyslexic","OpenDyslexic3","Lexend","Atkinson Hyperlegible",Verdana,sans-serif;--muted:var(--ink);--grid:color-mix(in srgb,var(--ink) 35%,var(--paper));
  font-size:21px;line-height:1.75;letter-spacing:.03em;word-spacing:.14em;background-image:none}
@media (max-width:900px){ body.easyread{font-size:20px} }
body.easyread :is(h1,h2,h3,legend,p,li,label,span,b,small,summary,figcaption,button,select,input,textarea,dt,dd,.clock,.bo-name,.mini-title,.sc,.term,.gtip,div){font-family:var(--easy-font)}
body.easyread :is(em,i,.note){font-style:normal}
body.easyread :is(.note,.sub,.hint,.wthint){font-size:.95em}
body.easyread :is(small){font-size:.9em}
body.easyread :is(.panel,.step,.ctr,.tracker,.opt,.seg,.mbc-toast){border-width:2px}
body.easyread,body.easyread *,body.easyread *::before,body.easyread *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
.whatsnew ul{margin:0 0 10px;padding-left:1.2em;max-height:40vh;overflow:auto}
.whatsnew li{margin:0 0 4px;font-size:.9rem}

/* My note on a step (saved with your progress, and printed in the PDF) */
.stepnote{margin-top:10px}
.stepnote summary{display:inline-flex;align-items:center;gap:6px;min-height:32px;cursor:pointer;list-style:none;color:var(--plum);font-weight:700;font-size:.9rem}
.stepnote summary::-webkit-details-marker{display:none}
.stepnote summary::before{content:"✎";font-size:1rem}
.stepnote summary:focus-visible{outline:3px solid var(--plum);outline-offset:2px;border-radius:8px}
.stepnote textarea{display:block;width:100%;min-height:64px;margin-top:6px;padding:8px 10px;border:1px solid var(--grid);border-radius:var(--r-sm);background:var(--panel);color:var(--ink);font:inherit;font-size:16px;line-height:1.45;resize:vertical}

/* Accessibility baseline (WCAG 2.1 AA): every focusable thing shows a focus ring (pages can restyle it), and the
   small header chips, toggles and Add a note are at least 44px tall to tap */
:where(button,a[href],input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--plum);outline-offset:2px}
.tourchip,.a11ychip,.begchip,.stepnote summary{min-height:44px}
.seg button,.donechk{min-height:44px}
.askcue::before,.mbc-mini-btn::before,.mini-btn::before{content:"";position:absolute;inset:-8px}
.mbc-mini-btn,.mini-btn{position:relative}
