:root{
  --cream:#faf6f0;
  --cream-dark:#f0ebe3;
  --cream-deep:#e4dccf;
  --panel:#fffdf7;
  --ink:#2c2a26;
  --ink-light:#6b6760;
  --accent:#c8391d;
  --gold:#f5a800;
  --blue:#1a6fb0;
  --green:#2d6a4f;
  --highlight:#e07a5f;
  --success:#81b29a;
  --code-bg:#2c2a26;
  --code-text:#f0ebe3;
  --radius:14px;
  --radius-sm:8px;
  --shadow:6px 6px 0 rgba(44,42,38,.12);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:"DM Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--cream);
  color:var(--ink);
  line-height:1.5;
}

a{color:inherit}

.static-fallback{
  max-width:760px;
  margin:48px auto;
  padding:30px;
  background:var(--panel);
  border:2px solid var(--ink);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.static-fallback h1{
  margin:8px 0 12px;
  font-family:"Fraunces","DM Sans",system-ui,sans-serif;
  font-size:clamp(34px,7vw,64px);
  line-height:.95;
}

.static-fallback p{
  margin:0 0 12px;
  color:var(--ink-light);
  font-size:18px;
}

.static-fallback a{
  color:var(--accent);
  font-weight:800;
  text-decoration:none;
}

.static-fallback .tool-eyebrow{
  font:800 12px "DM Mono",ui-monospace,monospace;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--accent);
}

.tool-shell{
  max-width:1220px;
  margin:0 auto;
  padding:28px 24px 56px;
}

.tool-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:16px;
  padding-bottom:16px;
  border-bottom:2px solid var(--ink);
  font-size:14px;
}

/* Camp Press breadcrumb (injected by spine.js) */
.ccs-crumb{
  font:500 11.5px/1 "DM Mono",ui-monospace,monospace;
  color:var(--ink-light);
  margin:0 0 16px;
}
.ccs-crumb i{color:var(--cream-deep);font-style:normal;margin:0 5px}
.ccs-crumb a{color:inherit;text-decoration:none}
.ccs-crumb a:hover{color:var(--accent)}
.ccs-crumb b{color:var(--ink);font-weight:500}

.tool-topbar a{
  text-decoration:none;
  color:var(--ink-light);
}

.tool-topbar a:hover{color:var(--accent)}

.tool-topbar .brand-mark,
.top .brand-mark{
  color:var(--accent);
  font-family:"DM Mono",ui-monospace,monospace;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.tool-header{
  background:var(--panel);
  border:2px solid var(--ink);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:30px;
  margin-bottom:22px;
}

.tool-header-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}

.tool-pill{
  display:inline-flex;
  align-items:center;
  border-radius:6px;
  padding:5px 10px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  border:1.5px solid currentColor;
  background:#fff;
}

.tool-pill.session{color:var(--accent)}
.tool-pill.type{color:var(--blue)}

.tool-header h1{
  margin:0 0 10px;
  font-size:clamp(34px,5vw,58px);
  line-height:.98;
  letter-spacing:-.05em;
}

.tool-subtitle{
  margin:0;
  max-width:760px;
  color:var(--ink-light);
  font-size:18px;
}

.catalog-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font: 700 10.5px/1 "DM Mono", ui-monospace, monospace;
  letter-spacing: .04em;
  border: 1.5px solid;
}

.meta-pill--suit {
  background: var(--cream-dark, #efe6da);
  border-color: var(--line, #d8cdbf);
  color: var(--ink, #2c2a26);
}

.meta-pill--level {
  background: var(--gold-soft, #fef3d4);
  border-color: var(--gold, #f5a800);
  color: var(--ink, #2c2a26);
}

.meta-pill--pathway {
  background: transparent;
  border-color: var(--line, #d8cdbf);
  color: var(--ink-light, #5c5751);
}

.tool-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:18px;
}

.tool-tag{
  border-radius:5px;
  padding:5px 10px;
  background:#fff;
  color:var(--green);
  border:1.5px solid var(--green);
  font-size:12px;
  font-weight:600;
}

.tool-rhythm{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:0;
  margin-top:22px;
  overflow:hidden;
  border:2px solid var(--ink);
  border-radius:8px;
  background:#fff;
}

.tool-rhythm-card{
  min-height:96px;
  padding:14px;
  border-right:2px solid var(--ink);
  color:var(--ink-light);
  font-size:13px;
}

.tool-rhythm-card:last-child{border-right:none}

.tool-rhythm-card:nth-child(1){background:#fff7d7}
.tool-rhythm-card:nth-child(2){background:#eaf5ff}
.tool-rhythm-card:nth-child(3){background:#eef8f2}
.tool-rhythm-card:nth-child(4){background:#fceaf2}
.tool-rhythm-card:nth-child(5){background:#f5efff}

.tool-rhythm-card strong{
  display:block;
  margin-bottom:4px;
  color:var(--ink);
  font-size:13px;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.tool-layout{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(320px,.85fr);
  gap:22px;
}

.workspace-panel,
.stack-panel{
  display:grid;
  gap:18px;
}

.workspace-panel{
  align-self:start;
}

.card{
  background:var(--panel);
  border:2px solid var(--ink);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.card-inner{padding:22px}

.card-header{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:16px;
}

.card-header h2{
  margin:0 0 6px;
  font-size:22px;
  letter-spacing:-.02em;
}

.card-header p{
  margin:0;
  color:var(--ink-light);
  font-size:14px;
}

.canvas-frame{
  padding:18px;
  background:#fff;
  border:2px solid var(--ink);
  border-radius:var(--radius-sm);
}

#canvas-container{
  min-height:clamp(360px,52vh,560px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px;
}

#canvas-container canvas{
  display:block;
  max-width:100%;
  height:auto !important;
  border:2px solid var(--ink);
  border-radius:8px;
  box-shadow:4px 4px 0 rgba(44,42,38,.12);
  background:#fff;
}

.controls-grid{
  display:grid;
  gap:14px;
}

.control{
  display:grid;
  gap:6px;
}

.control label{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:14px;
  font-weight:600;
}

.control span{
  color:var(--ink-light);
  font-weight:500;
}

.control input[type="range"]{
  width:100%;
  accent-color:var(--accent);
}

.control select,
.control input[type="color"]{
  width:100%;
  border:1px solid var(--cream-deep);
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  font:inherit;
}

.control select{
  padding:10px 12px;
}

.control input[type="color"]{
  min-height:42px;
  padding:4px;
}

.button-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  padding:10px 16px;
  border:2px solid var(--ink);
  background:#fff;
  color:var(--ink);
  font:inherit;
  font-weight:700;
  cursor:pointer;
  box-shadow:3px 3px 0 rgba(44,42,38,.12);
}

.button.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

.button.ghost{
  color:var(--accent);
}

.button:hover{transform:translateY(-1px)}

.stat-list{
  display:grid;
  gap:10px;
}

.stat{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:10px 12px;
  border-radius:8px;
  background:#fff;
  border:1.5px solid var(--cream-deep);
}

.stat strong{
  font-size:13px;
  color:var(--ink-light);
}

.stat code{
  font-family:"DM Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:13px;
  color:var(--ink);
}

.code-panel{
  position:relative;
  background:var(--code-bg);
  color:var(--code-text);
  border-radius:8px;
  border:2px solid var(--ink);
  padding:18px;
  overflow:auto;
}

.code-panel pre{
  margin:0;
  white-space:pre-wrap;
  font-family:"DM Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:13px;
  line-height:1.6;
}

.code-panel[contenteditable="true"],
pre[contenteditable="true"]{
  outline:none;
  min-height:180px;
}

.copy-button{flex-shrink:0}

.lesson-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
}

.lesson-card{
  padding:16px;
  border-radius:8px;
  background:#fff;
  border:2px solid var(--cream-deep);
}

.lesson-card:nth-child(1){background:#fff7d7;border-color:#f0c94b}
.lesson-card:nth-child(2){background:#eaf5ff;border-color:#9ec7ec}
.lesson-card:nth-child(3){background:#eef8f2;border-color:#9bc9aa}
.lesson-card:nth-child(4){background:#fceaf2;border-color:#e5a8bf}
.lesson-card:nth-child(5){background:#f5efff;border-color:#cbb8ef}

.lesson-card h3{
  margin:0 0 6px;
  font-size:16px;
}

.lesson-card p{
  margin:0;
  color:var(--ink-light);
  font-size:14px;
}

.care-note{
  padding:16px;
  border-radius:8px;
  background:#fff7d7;
  border:2px solid var(--ink);
  box-shadow:3px 3px 0 rgba(44,42,38,.12);
}

.care-note h2{
  margin:0 0 8px;
  font-size:18px;
}

.care-note p{
  margin:0;
  color:var(--ink-light);
  font-size:14px;
}

/* try-next, related-*, teaching-note* → now in site-components.css */

.tool-footer{
  margin-top:24px;
  padding:14px 0 0;
  border-top:1px solid var(--cream-deep);
  text-align:center;
  font-size:12px;
  color:var(--ink-light);
}

@media(max-width:960px){
  .tool-layout{grid-template-columns:1fr}
  .tool-rhythm{grid-template-columns:repeat(2,1fr)}
  .tool-rhythm-card:nth-child(2n){border-right:none}
  .tool-rhythm-card:nth-child(n+3){border-top:2px solid var(--ink)}
}

@media(max-width:720px){
  .tool-shell{padding:20px 16px 48px}
  .tool-header,.card-inner{padding:20px}
  .card-header,.tool-topbar{display:block}
  .tool-topbar a{display:inline-block;margin-top:10px}
  .top{
    display:flex;
    flex-wrap:wrap;
    gap:10px 14px;
  }
  .top a{display:inline-block}
  #canvas-container{min-height:unset;height:auto}
  .tool-rhythm{grid-template-columns:1fr}
  .tool-rhythm-card,
  .tool-rhythm-card:nth-child(2n){border-right:none}
  .tool-rhythm-card:nth-child(n+2){border-top:2px solid var(--ink)}
}
