/* =========================
   Pretty Theme v1 (drop-in)
   Keeps existing class names
========================= */


:root{
  --bg: #f5f7fb;
  --text: #1c2430;
  --muted: #5c6b7a;
  --border: rgba(0,0,0,0.08);
  --brand: #4f7cff;
}



*{ box-sizing: border-box; }
html, 
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(79,124,255,0.10), transparent 60%),
    linear-gradient(180deg,#f8faff,#eef2f8);
  color: var(--text);
}

.}
body{
  overflow-x:hidden;

  margin:0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.35;
  background:
    radial-gradient(1100px 800px at 20% 10%, rgba(40, 70, 160, 0.28) 0%, rgba(7,10,17,0.0) 58%),
    radial-gradient(900px 650px at 80% 20%, rgba(120, 70, 255, 0.12) 0%, rgba(7,10,17,0.0) 55%),
    radial-gradient(800px 650px at 40% 90%, rgba(25, 190, 255, 0.06) 0%, rgba(7,10,17,0.0) 55%),
    linear-gradient(180deg, #05070d 0%, #070a11 60%, #05070d 100%);
}

.wrap{ width:100%; max-width:1200px; margin:16px auto; padding:0 16px; }

code{
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

/* =========================
   Header / Footer
========================= */
.site-header{
  position: sticky;
  top:0;
  z-index:50;
  background: rgba(7,10,17,0.60);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
}
.site-header .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand__mark{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.25), rgba(255,255,255,0.04)),
    linear-gradient(135deg, rgba(94,135,255,0.35), rgba(94,135,255,0.05));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-soft);
}
.brand__title{ font-weight: 820; letter-spacing: 0.2px; }
.brand__sub{ font-size: 12px; color: var(--muted); }

.site-footer{ padding: 24px 0 44px; color: var(--muted); font-size: 12px; }

/* =========================
   Layout
========================= */
.grid-12{ display:grid; grid-template-columns:repeat(12,1fr); gap:16px; padding:16px 0; }
.col{ grid-column: span 12; }
.col-12{ grid-column: span 12; }
 
@media (min-width: 1024px){
  .col-lg-8{ grid-column: span 8; }
  .col-lg-4{ grid-column: span 4; }
}
.col-lg-4{ padding-left:8px; } } .col-lg-4{ padding-left:6px; } }
  .col-lg-4{ grid-column: span 4; }
}

/* =========================
   Cards
========================= */
.card{
  border-radius: 6px;
  border:1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.card__header{
  padding: 14px 14px 10px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 15% 0%, rgba(94,135,255,0.14), rgba(0,0,0,0.0) 55%),
    rgba(255,255,255,0.03);
}
.card__title{
  font-weight: 840;
  letter-spacing: 0.2px;
}
.card__subtitle{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.card__body{ padding: 14px; }

/* =========================
   Buttons / Inputs
========================= */
.btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 740;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}
.btn:hover{
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background:
    radial-gradient(circle at 30% 0%, rgba(255,255,255,0.18), rgba(255,255,255,0.02) 58%),
    linear-gradient(135deg, rgba(94,135,255,0.40), rgba(94,135,255,0.15));
  border-color: rgba(94,135,255,0.55);
}
.btn-primary:hover{
  background:
    radial-gradient(circle at 30% 0%, rgba(255,255,255,0.22), rgba(255,255,255,0.02) 60%),
    linear-gradient(135deg, rgba(94,135,255,0.46), rgba(94,135,255,0.18));
  box-shadow: 0 10px 28px rgba(94,135,255,0.18), 0 14px 38px rgba(0,0,0,0.25);
}

.btn-ghost{
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.10);
  box-shadow: none;
}
.btn-sm{
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}


.input:focus{
  border-color: rgba(94,135,255,0.65);
  box-shadow: 0 0 0 3px rgba(94,135,255,0.18);
}

.field{ display:grid; gap:6px; }
.field__label{ color: var(--muted); font-size: 12px; }

.form-grid{ display:grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 520px){ .form-grid{ grid-template-columns: 1fr 1fr; } }

/* =========================
   Toggles / Segments
========================= */
.toggle{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.035);
  cursor:pointer;
  user-select:none;
  font-weight: 720;
  font-size: 13px;
}

/* Hide native checkbox but keep it accessible */
.toggle 

/* Build the switch using the span */
.toggle span{
  position:relative;
  padding-left: 54px; /* room for switch */
  line-height: 22px;
}

/* track */
.toggle span::before{
  content:"";
  position:absolute;
  left:0;
  top:50%;
  transform: translateY(-50%);
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

/* knob */
.toggle span::after{
  content:"";
  position:absolute;
  left: 3px;
  top:50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  transition: left 160ms ease, background 160ms ease;
}

/* checked state */
.toggle input:checked + span::before{
  background:
    radial-gradient(circle at 30% 0%, rgba(255,255,255,0.22), rgba(255,255,255,0.02) 60%),
    linear-gradient(135deg, rgba(94,135,255,0.55), rgba(94,135,255,0.20));
  border-color: rgba(94,135,255,0.55);
  box-shadow: 0 0 0 3px rgba(94,135,255,0.14), inset 0 1px 0 rgba(255,255,255,0.08);
}
.toggle input:checked + span::after{
  left: 23px;
  background: rgba(255,255,255,0.92);
}

/* focus ring */
.toggle input:focus-visible + span::before{
  outline: 3px solid rgba(94,135,255,0.45);
  outline-offset: 2px;
}

.toggle-sm{
  padding: 4px 8px;
  font-size: 12px;
}
.toggle-sm span{ padding-left: 48px; }
.toggle-sm span::before{ width: 40px; height: 22px; }
.toggle-sm span::after{ width: 16px; height: 16px; }
.toggle-sm input:checked + span::after{ left: 21px; }


.seg{ display:inline-flex; gap: 8px; align-items:center; }

.preset-top{ display:grid; gap:10px; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content:center; }

@media (min-width: 520px){ .preset-top{ grid-template-columns: 1fr 1fr 1fr; } }
 }

.divider{ height:1px; background: rgba(255,255,255,0.10); margin: 14px 0; }
.note{ margin-top: 10px; font-size: 12px; color: var(--muted); }
.hidden{ display:none !important; }

/* =========================
   Live Preview (prettier frame)
========================= */
.card__tools{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.preview{ display:grid; place-items:center; padding: 6px 0 10px; }
.board-outline{
  width: 100%;
  max-width: 680px;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.16);
  background:
    radial-gradient(circle at 30% 10%, rgba(255,255,255,0.10), rgba(255,255,255,0.02) 55%),
    rgba(0,0,0,0.22);
  overflow:hidden;
  position:relative;
  box-shadow: 0 18px 60px rgba(0,0,0,0.52);
}

.board-outline::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.0) 40%),
    radial-gradient(circle at 20% 10%, rgba(94,135,255,0.10), rgba(0,0,0,0.0) 55%);
  mix-blend-mode: overlay;
  opacity: 0.85;
}

.grid-layer, .cells-layer, .grain-layer, .overlay-layer{
  position:absolute;
  inset:0;
}

.grid-layer{
  opacity:0;
  pointer-events:none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 24px);
}
.board-outline.show-grid .grid-layer{ opacity:0.55; }

.grain-layer{
  pointer-events:none;
  opacity: 0.30;
  transform-origin:center;
  transform: rotate(var(--grain-rot));
  transition: transform 160ms ease;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.14) 0 2px,
      rgba(255,255,255,0.03) 2px 10px,
      rgba(0,0,0,0.00) 10px 18px
    );
  mix-blend-mode: overlay;
}

.overlay-layer{ pointer-events:none; }
.overlay-layer.mode-centerline::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, transparent 49.7%, rgba(255,255,255,0.26) 50%, transparent 50.3%);
}
.overlay-layer.mode-border::before{
  content:"";
  position:absolute;
  inset: 12px;
  border-radius: 14px;
  border: 2px dashed rgba(255,255,255,0.24);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
}

.cells-layer{
  display:flex;
  width:100%;
  height:100%;
}

/* long grain strips */
.strip{
  height:100%;
  border-right: 1px solid rgba(0,0,0,0.24);
  cursor:pointer;
  position:relative;
  outline:none;
  transition: filter 120ms ease;
}
.strip:last-child{ border-right:0; }
.strip::after{
  content:"";
  position:absolute;
  inset:0;
  box-shadow: inset 0 0 0 0 rgba(0,0,0,0.0);
  transition: box-shadow 140ms ease;
}
.strip.selected::after{
  box-shadow: inset 0 0 0 3px rgba(94,135,255,0.92);
}

/* end grain tiles */
.cells-layer.endgrain{
  display:grid;
  gap: 1px;
  background: rgba(0,0,0,0.28);
}
.tile{ cursor:pointer; transition: filter 120ms ease; }
.tile.selected{
  outline: 3px solid rgba(94,135,255,0.92);
  outline-offset: -2px;
}

/* hint */
.hint{
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  font-size: 12px;
}
.dot{
  width:10px;height:10px;border-radius:999px;
  background: rgba(94,135,255,0.95);
  box-shadow: 0 0 0 4px rgba(94,135,255,0.12);
}

/* =========================
   Wood Selector (more premium)
========================= */
.wood-groups{ display:grid; grid-template-columns: 1fr; gap:16px; min-width:0; }
/* Subtle wood group headers */
.wood-group__title{
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: rgba(0,0,0,0.55);
  margin-bottom: 10px;
}
.wood-list{ display:grid; gap:10px; grid-template-columns: 1fr; }



.wood{
  display:grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items:center;
  padding: 10px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  cursor:pointer;
  user-select:none;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.wood:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
}
.wood:active{ transform: translateY(1px); }
.wood.selected{
  border-color: rgba(94,135,255,0.55);
  background: rgba(94,135,255,0.12);
}
.swatch{
  width:18px;height:18px;border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.wood__name{ font-weight: 780; font-size: 13px; }

/* =========================
   Collapsible Sections
========================= */
.section-toggle{
  width:100%;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor:pointer;
  font-weight: 860;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.section-toggle:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}
.section-toggle__title{ font-weight: 860; }
.designs-panel.hidden{ display:none !important; }

.designs-toolbar{
  display:flex;
  justify-content:flex-end;
  margin: 10px 0 12px;
}

/* =========================
   Designs list (cleaner)
========================= */
.designs-list{
  display:grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 520px){ .designs-list{ grid-template-columns: 1fr 1fr; } }
 }

.design-card{
  display:grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  align-items:stretch;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.design-card:hover{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.16);
}
.design-btn{
  text-align:left;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
  color: var(--text);
  cursor:pointer;
  font-weight: 840;
  width:100%;
}
.design-btn:hover{ background: rgba(0,0,0,0.26); }
.design-btn.selected{
  border-color: rgba(94,135,255,0.62);
  background: rgba(94,135,255,0.14);
}
.design-btn small{
  display:block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 680;
}

.star-btn{
  width:48px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
  color: var(--text);
  cursor:pointer;
  font-weight: 950;
  font-size: 17px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.star-btn:hover{ background: rgba(0,0,0,0.26); }
.star-btn:active{ transform: translateY(1px); }
.star-btn.faved{
  border-color: rgba(230, 211, 79, 0.75);
  background: rgba(230, 211, 79, 0.14);
  color: rgba(255,255,255,0.96);
}

/* =========================
   Strip Editor
========================= */
.strip-editor-toggle{
  width:100%;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor:pointer;
  font-weight: 780;
}
.chev{
  width: 24px;
  height: 24px;
  display:grid;
  place-items:center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
}

.strip-actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  margin: 10px 0 12px;
}

.strip-list{ display:grid; gap: 10px; }
.strip-row{
  display:grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.strip-row.selected{
  border-color: rgba(94,135,255,0.55);
  background: rgba(94,135,255,0.12);
}
.strip-row__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.strip-row__title{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  font-weight: 780;
}
.strip-row__meta{
  color: var(--muted);
  font-size: 12px;
}
.strip-row__width{ display:grid; gap: 6px; }
.strip-row__width 

/* =========================
   Materials
========================= */
.materials{ display:grid; gap: 10px; }
.materials__grid{
  display:grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px){ .materials__grid{ grid-template-columns: 1fr 1fr 1fr; } }

.kpi{
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.kpi__label{ color: var(--muted); font-size: 12px; }
.kpi__value{ font-weight: 900; font-size: 18px; margin-top: 6px; }

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align:left;
  font-size: 13px;
}
.table th{
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 780;
}
.table tr:last-child td{ border-bottom: 0; }

.materials__actions{
  margin-top: 12px;
  display:flex;
  gap: 12px;
  align-items:center;
  flex-wrap:wrap;
}
.materials__hint{ color: var(--muted); font-size: 12px; }

/* =========================
   Accessibility polish
========================= */
:focus-visible{
  outline: 2px solid rgba(0,0,0,0.18);
  outline-offset: 2px;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
}


/* Light Theme Overrides */

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(79,124,255,0.10), transparent 60%),
    linear-gradient(180deg,#f8faff,#eef2f8);
  color: var(--text);
}

.card{
  border-radius: 6px;
  border:1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.card__header{
  background: #f8faff;
  border-bottom:1px solid var(--border);
}

.btn{
  border:1px solid var(--border);
  background:#ffffff;
  color:var(--text);
 border-radius: 6px; }

.btn:hover{
  background:#f0f4ff;
}

.btn-primary{
  background: linear-gradient(135deg,#4f7cff,#7aa0ff);
  color:#fff;
  border-color:#4f7cff;
}

.board-outline{
  background:#fdfdfd;
  border:1px solid rgba(0,0,0,0.08);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.table th{
  background:#f4f6fa;
  color:#445260;
}

.toggle span::before{
  background:#e3e8f2;
  border:1px solid rgba(0,0,0,0.08);
}

.toggle input:checked + span::before{
  background: linear-gradient(135deg,#4f7cff,#7aa0ff);
  border-color:#4f7cff;
}



/* Dimensions: 3-column layout on larger screens (mobile-first) */
.form-grid-3{
  grid-template-columns: 1fr;
}
@media (min-width: 520px){
  .form-grid-3{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px){
  .form-grid-3{ grid-template-columns: 1fr 1fr 1fr; }
}

/* Slider field */
.field--slider{
  grid-column: 1 / -1; /* slider spans full row in 3-col grid */
}
.field__row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
}
.field__value{
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}
.field__hint{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Range (matches input style) */
.range{ width:100%; }

/* WebKit */

/* Firefox */






/* Wood Selector: 3 columns (Light / Dark / Accent) on wide screens */
@media (min-width: 900px){
  .wood-groups{ display:grid; grid-template-columns: 1fr; gap:20px; }
}





/* Subtle wood group headers */
.wood-group__title{
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: rgba(0,0,0,0.55);
  margin-bottom: 10px;
}

/* Extra spacing between main columns on desktop */

  .col-lg-4{ padding-left: 10px; }
}

/* Extra breathing room on very large screens */
 }
}


/* 16px visual separation between main columns (does not affect spans) */





/* Wood Selector always 3 columns on tablet+ */

}



/* Wood group titles refined */
.wood-group__title{
  text-align: left;
  color: rgba(0,0,0,0.45);
}

/* Wood item text lighter + left aligned */
.wood{
  text-align: left;
  font-weight: 400;
 border-radius: 6px; }

.wood span{
  color: rgba(0,0,0,0.65);
}



/* Vertical spacing between major cards */
.card + .card{ margin-top: 16px;  border-radius: 6px; }

/* Extra breathing room specifically under Live Preview */
.card.live-preview{ margin-bottom: 16px; }



/* Form controls match 6px radius system */
input,
select,
textarea,








/* Form controls fully aligned with buttons */
input,
select,
textarea,
.input{
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.2;
  font-family: inherit;
}



/* Prevent grid overflow (fixes right-edge card break) */
.grid-12, .col, .card{ min-width: 0; }
.card{ overflow: hidden; }

/* Ensure form controls don't exceed container */
input, select, textarea, .input{ max-width: 100%; min-width: 0; }

/* Wood selector inner grid also needs min-width:0 */
.wood-groups, .wood-list, .wood{ min-width: 0; }


/* Restore Wood Selector 3-column layout */

@media (min-width: 768px){
  .wood-groups{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


.wood-group{
  min-width:0;
}



/* =========================
   Board Design (CSS-only)
   - Always visible (no collapse)
   - No favorites stars
   - No subtext
   - Single stacked list
========================= */

/* Always show designs panel even if JS toggles .hidden */
#designs-panel.hidden{ display:block; }

/* Hide collapse toggle control (button) if present */
#designs-toggle,
.designs-toggle,
.section-toggle{ display:none; }

/* Hide favorites star buttons if present */
.star-btn,
button.star-btn{ display:none; }

/* Remove small subtext under design name */
.design-card small{ display:none; }

/* Force single stacked list */
.designs-list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}



/* Board Design: presets under mode buttons (top 10), no collapse/favorites UI */
#designs-toggle, .designs-toggle, #toggle-fav-first, .toggle-fav-first, .designs-controls{ display:none; }
#designs-title{ display:none; }
.designs-wrap{ margin-top: 10px; }
.designs-list{
  display:flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.design-card small, .star-btn{ display:none; }



/* Design presets: hover + selected states */
.design-card{
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}
.design-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.14);
}
.design-card.is-selected{
  border-color: rgba(0,0,0,0.22);
  box-shadow: 0 8px 22px rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.01);
}
.design-btn{
  display:flex;
  align-items:center;
  gap: 10px;
  width: 100%;
  justify-content:flex-start;
}

/* Small preview thumbnail */
.design-thumb{
  width: 34px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.10);
  overflow:hidden;
  flex: 0 0 auto;
  background: rgba(0,0,0,0.02);
}
.design-thumb svg{
  width:100%;
  height:100%;
  display:block;
}

/* Smooth rotation + gentle board change animation */
.board-outline.is-changing .cells-layer{
  animation: boardFade 180ms ease-out;
}
@keyframes boardFade{
  from{ opacity: 0.70; }
  to{ opacity: 1; }
}

/* Material controls */
.materials__controls{
  display:flex;
  flex-wrap:wrap;
  gap: 12px 16px;
  align-items:flex-end;
  margin-bottom: 12px;
}
.field--inline .field__inline{
  display:flex;
  align-items:center;
  gap: 8px;
}
.input--sm{
  width: 90px;
}
.field__suffix{
  font-size: 12px;
  color: var(--muted);
}
.toggle-row{
  display:flex;
  align-items:center;
  gap: 10px;
  user-select:none;
}
.toggle-row__label{
  font-size: 13px;
  color: rgba(0,0,0,0.72);
  font-weight: 500;
}
.toggle-row__hint{
  font-size: 12px;
  color: var(--muted);
}



/* Image overlay controls (Custom only) */
.overlay-controls{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: grid;
  gap: 12px;
}
.overlay-controls__row{
  display:flex;
  gap: 12px;
  align-items: flex-end;
}
.overlay-controls__row .field{
  flex: 1 1 auto;
}
#overlay-clear{
  flex: 0 0 auto;
  height: 36px;
}

/* Overlay image layer */
.overlay-image{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: contain;
  pointer-events:none;
  opacity: 0.5;
  mix-blend-mode: multiply;
}



/* Draggable overlay wrapper */
.overlay-wrap{
  position:absolute;
  inset:0;
  pointer-events:none; /* wrapper itself is passive; image handles pointer */
}
.overlay-image{
  pointer-events:auto;
  cursor: grab;
}
.overlay-image:active{
  cursor: grabbing;
}

/* small meta row in overlay controls */
.overlay-controls__row--meta{
  justify-content: space-between;
  align-items: center;
}

/* Strip Editor (Custom > Long Grain): no wood column */
.strip-row__title{ gap: 8px; }

/* Custom end grain cubes control */
#custom-endgrain-cubes{
  max-width: 220px;
}

/* Board Design: three buttons (Long / End / Advanced) */
.preset-top{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  justify-content:center;
}
.preset-top .btn{ width:100%; justify-content:center; }
#btn-preset-custom{ display:none; }

/* End Grain custom size (shown only when Custom is selected) */
.endgrain-custom-size{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  align-items:flex-end;
}
.endgrain-custom-size .field__label{
  font-size: 12px;
  color: rgba(0,0,0,0.55);
}
.endgrain-custom-size .input{
  max-width: 120px;
}

.table td, .table th{ vertical-align: top; }
.table td{ white-space: nowrap; }
.table td:nth-child(1){ white-space: normal; }

/* Overlay controls relocated under Board Design */
.overlay-moved{ margin-top: 12px; }
.hidden{ display:none !important; }

#image-overlay-controls{ margin-top:12px; }

.app-error{
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
  font-size: 13px;
  color: rgba(0,0,0,0.75);
  white-space: pre-wrap;
}

.app-debug{
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.9);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(0,0,0,0.8);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  user-select: none;
}

.designs-sections{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.designs-section__title{
  font-size: 12px;
  color: rgba(0,0,0,0.65);
  margin-bottom: 8px;
}
.designs-section__grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Advanced designs grid (3 columns x 4 rows) */
.adv-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 520px){
  .adv-grid{ grid-template-columns: 1fr; }
}
.adv-tile{
  appearance:none;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.02);
  padding: 8px;
  cursor: pointer;
  text-align: center;
}
.adv-tile.is-selected{
  border-color: rgba(0,0,0,0.28);
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
}
.adv-thumb{
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0,0,0,0.06), rgba(0,0,0,0.02));
  overflow: hidden;
}
.adv-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.adv-name{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(0,0,0,0.75);
  line-height: 1.15;
}
@media (min-width: 820px){
  .designs-sections{ grid-template-columns: 1fr 1fr; }
}


/* =========================
   Mobile-first layout (mockup-style)
   ========================= */
:root{
  --page-pad: 14px;
  --card-gap: 14px;
  --tab-height: 44px;
}

.page{
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}

/* Header */
.app-header{
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 10px var(--page-pad);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.app-header__title{
  font-size: 15px;
  font-weight: 600;
  color: rgba(0,0,0,0.82);
  text-align: center;
}
.icon-btn{
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  color: rgba(0,0,0,0.75);
}
.icon-btn:active{ transform: translateY(1px); }

article[aria-label="Live Preview"]{ margin-top: 12px; }

/* Tabs */
.mobile-tabs{
  position: sticky;
  top: 60px;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 10px 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
}
.tab-btn{
  height: var(--tab-height);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.9);
  color: rgba(0,0,0,0.72);
  font-weight: 600;
}
.tab-btn.is-active{
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.14);
  color: rgba(0,0,0,0.82);
}

/* Panels */
.panel{ margin-top: var(--card-gap); }
.panel.is-hidden{ display:none; }

/* Touch sizing */
.card__header{ padding: 12px 14px; }
.card__body{ padding: 12px 14px; }
.btn, .input, select, .range{ min-height: 40px; }
.btn.btn-sm{ min-height: 34px; }

.form-grid-3{ grid-template-columns: 1fr; }
.wood-cols{ grid-template-columns: 1fr; gap: 12px; }
.designs-sections{ grid-template-columns: 1fr; }

/* =========================
   Desktop enhancement
   ========================= */
@media (min-width: 920px) {
  /* Board Design tabs: 3 across */
  .preset-top{display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px;}
  
  :root{ --page-pad: 18px; --card-gap: 16px; }
  .app-header{ display:none; }
  .mobile-tabs{ display:none; }

  .grid-12{
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
  }
  .col-8{ grid-column: span 8; }
  .col-4{ grid-column: span 4; }
  .col-12{ grid-column: span 12; }

  .panel{ margin-top: 0; }
  .panel.is-hidden{ display:block; }

  .page{ padding-top: 18px; }
  .form-grid-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wood-cols{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .designs-sections{ grid-template-columns: 1fr 1fr; }
}


/* Column helpers used by the mobile-first markup */
.col{ width: 100%; max-width: 100%; }
@media (min-width: 920px){
  .col{ grid-column: span 12; }
  .col-lg-4{ grid-column: span 4; }
  .col-lg-8{ grid-column: span 8; }
  .col-lg-12{ grid-column: span 12; }
}


/* Mobile collapsible sections */
.mobile-collapse__summary{
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: rgba(0,0,0,0.8);
}
.mobile-collapse__summary::-webkit-details-marker{ display:none; }

@media (min-width: 920px){
  details.mobile-collapse > summary{ display:none; }
}

/* Wood dropdowns shown on mobile */
.wood-selects{ display:none; gap: 12px; }
@media (max-width: 919px){
  
}

/* Materials mobile collapsible list */
.materials-mobile{ display:none; }
@media (max-width: 919px){
  .materials-mobile{ display:block; margin-top: 12px; }
  .materials .table{ display:none; }
}
.mat-wood{
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  margin-bottom: 10px;
  overflow: hidden;
}
.mat-wood__summary{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  cursor:pointer;
}
.mat-wood__summary .swatch{
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.08);
}
.mat-wood__name{
  font-weight: 600;
  color: rgba(0,0,0,0.82);
}
.mat-wood__meta{
  margin-left:auto;
  font-size: 12px;
  color: rgba(0,0,0,0.62);
}
.mat-wood__body{
  padding: 10px 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.mat-row{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: rgba(0,0,0,0.72);
  padding: 6px 0;
}


/* =====================================
   Mobile (<920px) behavior
   ===================================== */
@media (max-width: 919px){
  .grid-12{
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .panel{ margin-top: 0; }
  .panel.is-hidden{ display: block; }

  .col,
  .col-8,
  .col-4,
  .col-12,
  .col-lg-8,
  .col-lg-4{
    width: 100%;
    max-width: 100%;
    grid-column: auto;
  }

  #card-live-preview{ order: 1; }
  #card-dimensions{ order: 2; }
  #card-board-design{ order: 3; }
  #card-wood-selector{ order: 4; }
  #card-material-needs{ order: 5; }


  .materials-mobile{ display:block; margin-top: 12px; }
  .materials .table{ display:none; }

  .designs-section__grid{ display:grid; grid-template-columns: 1fr; gap: 10px; overflow: visible; }
  .design-card{ min-width: 0; }
}

@media (min-width: 920px){ }

.mobile-stack{
  display: flex;
  flex-direction: column;
  gap: 12px;
}


@media (max-width: 919px){
  .form-grid-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .form-grid-3{ grid-template-columns: 1fr; }
}


@media (max-width: 919px){
  .wood-cols{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 520px){
  .wood-cols{ grid-template-columns: 1fr; }
}

.field__label-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.field__value{
  font-size: 12px;
  color: rgba(0,0,0,0.62);
}
.field__hint{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(0,0,0,0.55);
}
.range{ width: 100%; }

/* Ensure sliders are full width */
.range{ width:100%; display:block; }
.field .range{ width:100%; }

/* Make certain fields span full width inside grids */
.field--full{ width: 100%; }
.form-grid-3 .field--full{ grid-column: 1 / -1; }
.field--full .range{ width: 100%; display:block; }

.range{ width:100%; display:block; }

.board-outline{ position: relative; overflow:hidden; }
/* main layer: no scale so it does not "zoom" */
/* underlay: scaled to cover so corners never show white */

.board-outline{ position: relative; overflow: hidden; }
.range{ width:100%; display:block; }

/* Bleed layer: only shows at corners, prevents white without making main feel zoomed */
.board-outline{ position: relative; overflow: hidden; }
.preview-bleed, 
/* ===== Preview rotation layers (clean) ===== */
.board-outline{
  position: relative;
  overflow: hidden;
}

/* Both layers fill the outline and rotate around center */
.preview-inner,
.preview-bleed{
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

/* Main preview: rotate only (no scale) so it never "zooms" */
.preview-inner{
  z-index: 2;
  transform: rotate(var(--layout-rot));
}

/* Bleed: scaled only to fill corners; stays behind main preview */
.preview-bleed{
  z-index: 1;
  transform: rotate(var(--layout-rot)) scale(1);
  pointer-events: none;
}

/* Keep the fixed outline above the bleed background */
.board-outline{
  background-clip: padding-box;
}

/* Preview rotation: rotate only (no scale) */
.preview-inner{
  transform-origin: 50% 50%;
  transform: rotate(var(--layout-rot));
}

/* Strip bleed: extend strip color beyond frame for rotation without scaling */
.strip{ position: relative; }
.strip::before{
  content:"";
  position:absolute;
  left:0; right:0;
  top: calc(-1 * var(--strip-bleed, 0px));
  bottom: calc(-1 * var(--strip-bleed, 0px));
  background: inherit;
  pointer-events:none;
}

/* ===== Rotation bleed (no zoom): extend pieces beyond outline ===== */
.board-outline{
  --piece-bleed-px: 140px; /* along piece axis */
  --edge-bleed-px: 90px;   /* perpendicular at outer edges */
}

/* Long-grain strips */
.strip{
  position: relative;
  overflow: visible;
}
/* Extend strip along its axis (top/bottom) so it stays long enough while rotating */
.strip::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top: calc(-1 * var(--piece-bleed-px));
  bottom: calc(-1 * var(--piece-bleed-px));
  background: inherit;
  z-index:-1;
}

/* Extra width at outer edges only */
.strip.edge-left::after,
.strip.edge-right::after{
  content:"";
  position:absolute;
  top: calc(-1 * var(--piece-bleed-px));
  bottom: calc(-1 * var(--piece-bleed-px));
  background: inherit;
  z-index:-1;
}
.strip.edge-left::after{
  left: calc(-1 * var(--edge-bleed-px));
  width: var(--edge-bleed-px);
}
.strip.edge-right::after{
  right: calc(-1 * var(--edge-bleed-px));
  width: var(--edge-bleed-px);
}

/* End-grain tiles: extend slightly so corners never show white */
.tile{
  position: relative;
  overflow: visible;
}
.tile::before{
  content:"";
  position:absolute;
  inset: calc(-1 * var(--piece-bleed-px) * 0.15);
  background: inherit;
  z-index:-1;
}

/* Click-only selection: no hover highlight */
.strip.is-selected,
.tile.is-selected{
  filter: brightness(0.96);
  outline: none;
}
.strip:hover,
.tile:hover{
  outline: none;
  filter: none;
}

/* ===== 6" bleed (visual) ===== */
.board-outline{
  --bleed-x: 0px; /* 6" in px along width */
  --bleed-y: 0px; /* 6" in px along length */
}

/* Long-grain strips: extend 6" beyond outline to avoid white corners when rotated */
.strip{ position: relative; overflow: visible; }
.strip::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top: calc(-1 * var(--bleed-y));
  bottom: calc(-1 * var(--bleed-y));
  background: inherit;
  z-index:-1;
}
.strip.edge-left::after,
.strip.edge-right::after{
  content:"";
  position:absolute;
  top: calc(-1 * var(--bleed-y));
  bottom: calc(-1 * var(--bleed-y));
  background: inherit;
  z-index:-1;
  width: var(--bleed-x);
}
.strip.edge-left::after{ left: calc(-1 * var(--bleed-x)); }
.strip.edge-right::after{ right: calc(-1 * var(--bleed-x)); }

/* End-grain bleed layer (pattern repeats beyond edges) */
.endgrain-bleed{
  position:absolute;
  z-index:0;
  pointer-events:none;
  display:none;
  gap:0;
  background:transparent;
  left:0;
  top:0;
}

#cells-layer{
  position:absolute;
  inset:0;
  z-index:1;
}
.endgrain-bleed .tile{ border-radius:0; }

/* Endgrain tiles: NO outlines / grid lines */
.cells-layer.endgrain{
  gap: 0;
  background: transparent;
}
.cells-layer.endgrain .tile{
  border: 0;
  outline: 0;
}

/* ===== Endgrain: stable rotation (no drift) ===== */
.cells-layer.endgrain{
  display: grid;
  gap: 0;
  background: transparent;
}
.cells-layer.endgrain .tile{
  border: 0;
  outline: 0;
}

/* Bleed layer uses same geometry as main; no scaling/offset hacks */
.endgrain-bleed{
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
  gap: 0;
  background: transparent;
}
#cells-layer{
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Endgrain tiles: no outlines */
.cells-layer.endgrain{ gap:0; background:transparent; }
.cells-layer.endgrain .tile{ border:0; outline:0; }

/* ===== Rotation refinements UI ===== */
.rot-tools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
}
.check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color: rgba(0,0,0,0.65);
}
.check input{ accent-color:#666; }
.rot-readouts{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-top:10px;
}
.rot-readout{
  border:1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  border-radius:6px;
  padding:10px;
}
.rot-k{ font-size:12px; color: rgba(0,0,0,0.55); margin-bottom:6px; }
.rot-v{ font-size:13px; font-weight:600; color: rgba(0,0,0,0.82); }
@media (max-width: 560px){
  .rot-readouts{ grid-template-columns: 1fr; }
  .rot-tools{ flex-direction: column; align-items: stretch; }
}

#endgrain-bleed-layer{ pointer-events:none; }


#grid-layer,
#cells-layer,
#grain-layer,
#overlay-layer{
  position:absolute;
  inset:0;
}

#endgrain-bleed-layer{
  position:absolute;
}



/* ===== Long-grain bleed panels (outside outline, no pattern shrink) ===== */
.lg-bleed{
  position:absolute;
  z-index: 0; /* behind strips */
  top: calc(-1 * var(--bleed-y, 0px));
  height: calc(100% + (2 * var(--bleed-y, 0px)));
  width: 0px; /* set by JS */
  display: none;
  pointer-events: none;
}
#lg-bleed-left{ left: calc(-1 * var(--bleed-x, 0px)); }
#lg-bleed-right{ right: calc(-1 * var(--bleed-x, 0px)); }

/* Keep main cells layer normal size (prevents shrink/crop of design) */
#cells-layer{ position:absolute; inset:0; z-index:1; }
#grain-layer, #grid-layer, #overlay-layer{ position:absolute; inset:0; z-index:2; }

.board-outline[data-mode="long"] .preview-bleed{ display:none; }


/* ===== Subtle Darken Selection Styling ===== */

/* Remove blue outlines / borders / shadows */
.strip.selected,
.cell.selected {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* Subtle darken when selected */
.strip.selected,
.cell.selected {
  filter: brightness(0.92);
}

/* Smooth transition */
.strip,
.cell {
  transition: filter 120ms ease;
}

/* Light hover feedback */
.strip:hover,
.cell:hover {
  filter: brightness(0.97);
}

/* Accessible but subtle focus */
.strip:focus,
.cell:focus {
  outline: none;
}

.strip:focus-visible,
.cell:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15);
}


/* Focus styling for preview pieces (no blue, no box outline) */
.strip:focus-visible,
.tile:focus-visible,
.cell:focus-visible{
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.14);
}

/* ===== Print sheet ===== */
.print-sheet{ display:none; }

@media print{
  body > *:not(#print-sheet){ display:none !important; }
  #print-sheet{ display:block !important; }
  body{ margin:0; background:#fff !important; }
  @page{ margin: 0.6in; }

  .ps{
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
    color:#111;
    font-size:12px;
    line-height:1.35;
  }
  .ps .page{ break-after: page; page-break-after: always; }
  .ps .page:last-child{ break-after:auto; page-break-after:auto; }

  .ps-header{ display:flex; justify-content:space-between; gap:16px; margin-bottom:10px; }
  .ps-brand{ font-weight:700; font-size:16px; letter-spacing:0.2px; }
  .ps-meta{ text-align:right; color:#333; font-size:11px; white-space:nowrap; }
  .ps-rule{ height:1px; background:rgba(0,0,0,0.12); margin:10px 0 12px; }
  .ps-title{ font-size:18px; font-weight:700; margin:0 0 2px; }
  .ps-sub{ color:#333; margin:0 0 10px; }

  .ps-callout{
    border:1px solid rgba(0,0,0,0.16);
    background: rgba(0,0,0,0.03);
    border-radius:8px;
    padding:10px 12px;
    margin:10px 0 14px;
  }
  .ps-callout .k{ font-size:11px; letter-spacing:0.06em; text-transform:uppercase; color:#444; margin-bottom:6px; }
  .ps-callout .v{ font-size:16px; font-weight:700; }
  .ps-note{ font-size:11px; color:#444; margin-top:6px; }

  .ps-h2{ font-size:12px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; margin:14px 0 8px; }

  table.ps-table{
    width:100%;
    border-collapse:collapse;
    border:1px solid rgba(0,0,0,0.14);
    border-radius:8px;
    overflow:hidden;
  }
  table.ps-table thead{ display: table-header-group; background: rgba(0,0,0,0.05); }
  table.ps-table th, table.ps-table td{
    padding:8px 10px;
    border-bottom:1px solid rgba(0,0,0,0.10);
    vertical-align:top;
  }
  table.ps-table th{ text-align:left; font-size:11px; color:#333; font-weight:700; }
  table.ps-table td{ font-size:12px; }
  table.ps-table tr:last-child td{ border-bottom:none; }

  .ps-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
  .ps-box{ border:1px solid rgba(0,0,0,0.14); border-radius:8px; padding:10px 12px; }
  .ps-box .row{ display:flex; justify-content:space-between; gap:12px; padding:3px 0; }
  .ps-box .row .k{ color:#333; }
  .ps-box .row .v{ font-weight:700; }

  .ps-steps{ margin:0; padding-left:18px; }
  .ps-steps li{ margin:4px 0; }
}

.logo {
  height: 28px;
  width: auto;
  display: block;
}

/* Retina optimization */
.logo {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
@media print {
  .ps-brand img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Inline SVG logo */
#brand-logo svg{
  height: 28px;
  width: auto;
  display:block;
}
@media print{
  .ps-brand svg{
    height: 22px;
    width: auto;
    display:block;
  }
}

@media print{
  .ps-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    color:#444;
    font-size:10px;
    margin: 0 0 10px;
  }
  .ps-footer__right{
    white-space:nowrap;
  }
}

/* Inline SVG logo (forced) */
#brand-logo svg,
.brand svg,
.site-header svg,
header svg{
  height: 28px;
  width: auto;
  display:block;
}
@media print{
  .ps-brand svg{ height: 22px; width:auto; display:block; }
}

@media print{ body *{ visibility:hidden !important; } #print-sheet, #print-sheet *{ visibility:visible !important; } #print-sheet{display:block !important; position:absolute; left:0; top:0; right:0;} }

/* ===== PDF view ===== */
body.pdf-view{
  margin:0;
  background:#f6f6f6;
}
body.pdf-view #print-sheet{
  display:block !important;
  max-width: 8.5in;
  margin: 24px auto;
  background:#fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  padding: 0.6in;
}
body.pdf-view .ps .page{
  break-after: auto;
  page-break-after: auto;
}
body.pdf-view .ps .page + .page{
  margin-top: 18px;
  border-top: 1px solid rgba(0,0,0,0.10);
  padding-top: 18px;
}
body.pdf-view .ps-toolbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246,246,246,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 10px 12px;
}
body.pdf-view .ps-toolbar__inner{
  max-width: 8.5in;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
body.pdf-view .ps-toolbar__title{
  font-weight:700;
  color:#111;
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body.pdf-view .ps-toolbar__actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
body.pdf-view .ps-toolbar button{
  border: 1px solid rgba(0,0,0,0.14);
  background:#fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  cursor:pointer;
}
body.pdf-view .ps-toolbar button:hover{
  background: rgba(0,0,0,0.03);
}


/* ===== Hybrid Premium PDF Styling ===== */

@media print {
  @page { margin: 0.75in; }

  .ps-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
  }

  .ps-sub {
    font-size: 13px;
    color: #444;
    margin-bottom: 18px;
  }

  .ps-callout {
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.025);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 18px 0 22px;
  }

  .ps-callout .v {
    font-size: 18px;
    font-weight: 800;
  }

  table.ps-table {
    border: none;
  }

  table.ps-table thead {
    background: rgba(0,0,0,0.06);
  }

  table.ps-table th {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #333;
  }

  table.ps-table td {
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }

  table.ps-table tr:nth-child(even) td {
    background: rgba(0,0,0,0.02);
  }

  .ps-footer {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 11px;
    color: #666;
    text-align: center;
  }
}

body.pdf-view .ps-title {
  font-size: 22px;
}

body.pdf-view .ps-footer {
  margin-top: 24px;
  font-size: 11px;
  color: #666;
  text-align: center;
}

/* Glue-up diagram */
.ps-diagram{
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  margin: 10px 0 16px;
}
.ps-diagram__title{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color:#333;
  margin: 0 0 10px;
}
.ps-stripbar{
  display:flex;
  width:100%;
  height: 44px;
  border-radius: 10px;
  overflow:hidden;
  border: 1px solid rgba(0,0,0,0.10);
}
.ps-strip{
  position: relative;
  height: 100%;
}
.ps-strip::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(0,0,0,0.06));
  pointer-events:none;
}
.ps-strip-labels{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
  color:#444;
  font-size:11px;
}
.ps-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  background: rgba(0,0,0,0.02);
}
.ps-swatch{
  width:10px;
  height:10px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.10);
}
.ps-flow{
  display:grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap:10px;
  align-items:center;
}
.ps-stepbox{
  border:1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding:10px 12px;
  background: rgba(0,0,0,0.02);
  min-height: 60px;
}
.ps-stepbox b{ display:block; margin-bottom:4px; }
.ps-arrow{
  color:#555;
  font-size:18px;
  line-height:1;
  padding: 0 4px;
}

/* Strict page control */
@media print {
  .ps .page {
    page-break-after: always;
    break-after: page;
  }
  .ps .page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  table, .ps-diagram, .ps-box, .ps-callout {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

.ps-project-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.ps-strip-diagram {
  display: flex;
  height: 60px;
  margin: 12px 0 20px;
  border-radius: 6px;
  overflow: hidden;
}
.ps-strip {
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  color:#222;
  font-weight:500;
}
.ps-glue-seq {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  margin:16px 0 24px;
}

/* Print margin balancing */
@media print {
  @page {
    size: Letter;
    margin: 0.75in 0.7in 0.8in 0.7in;
  }
  body {
    margin: 0;
  }
  .ps {
    max-width: 7.2in;
    margin: 0 auto;
  }
}

.ps-eg-meta {
  font-size: 12px;
  margin-bottom: 10px;
  color: #444;
}
.ps-eg-grid {
  display: grid;
  gap: 1px;
  background: #ddd;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}
.ps-eg-cell {
  background: #999;
  aspect-ratio: 1 / 1;
}



/* Shape tiles */
.shape-tiles{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
@media (min-width: 920px){
  .shape-tiles{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.shape-tile{
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
  cursor:pointer;
}
.shape-tile:hover{ background: rgba(0,0,0,0.02); }
.shape-tile.is-selected{ background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.18); }
.shape-icon{
  width: 56px;
  height: 36px;
  border: 1px solid rgba(0,0,0,0.16);
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
}
.shape-name{
  font-size: 12px;
  color: rgba(0,0,0,0.80);
}

/* Icons */
.shape-icon.round{ clip-path: circle(48% at 50% 50%); border-radius: 0; }
.shape-icon.oval{ clip-path: ellipse(48% 40% at 50% 50%); border-radius: 0; }

/* Apply shape to board outline (final trim only) */
#board-outline{ overflow:hidden; }
#board-outline[data-shape="rect"]{ clip-path: none; border-radius: 18px; }
#board-outline[data-shape="round"]{ clip-path: circle(50% at 50% 50%); border-radius: 0; }
#board-outline[data-shape="oval"]{ clip-path: ellipse(50% 50% at 50% 50%); border-radius: 0; }

/* Shape icon variants */
.shape-icon.square{ border-radius: 6px; }
.shape-icon.bread{ border-radius: 6px; transform: scaleX(1.15); }
.shape-icon.paddle{ clip-path: polygon(34% 0, 66% 0, 66% 18%, 84% 18%, 100% 50%, 84% 82%, 66% 82%, 66% 100%, 34% 100%, 34% 82%, 16% 82%, 0 50%, 16% 18%, 34% 18%); border-radius:0; }

/* Apply additional shapes to board outline */
#board-outline[data-shape="square"]{ clip-path: none; border-radius: 18px; }
#board-outline[data-shape="bread"]{ clip-path: none; border-radius: 18px; }

/* Paddle handle controls */
.paddle-controls.hidden{ display:none; }

/* Classic paddle silhouette (handle left) */
:root{
  --paddle-round: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20200%20100%22%20preserveAspectRatio%3D%22none%22%3E%0A%20%20%3Crect%20width%3D%22200%22%20height%3D%22100%22%20fill%3D%22black%22/%3E%0A%20%20%3Cpath%20fill%3D%22white%22%20d%3D%22%0A%20%20%20%20M84%2012%20H182%20Q196%2012%20196%2026%20V74%20Q196%2088%20182%2088%20H84%20Q70%2088%2070%2074%20V62%0A%20%20%20%20C70%2056%2066%2054%2062%2054%20H52%20C46%2054%2042%2056%2040%2060%20C38%2064%2036%2068%2032%2070%0A%20%20%20%20C26%2073%2020%2070%2018%2064%20C14%2056%2014%2044%2018%2036%20C20%2030%2026%2027%2032%2030%0A%20%20%20%20C36%2032%2038%2036%2040%2040%20C42%2044%2046%2046%2052%2046%20H62%20C66%2046%2070%2044%2070%2038%0A%20%20%20%20V26%20Q70%2012%2084%2012%20Z%0A%20%20%20%20M30%2050%20m-18%200%20a18%2018%200%201%200%2036%200%20a18%2018%200%201%200%20-36%200%0A%20%20%22/%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%2250%22%20r%3D%226.5%22%20fill%3D%22black%22/%3E%0A%3C/svg%3E");
  --paddle-slot:  url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20200%20100%22%20preserveAspectRatio%3D%22none%22%3E%0A%20%20%3Crect%20width%3D%22200%22%20height%3D%22100%22%20fill%3D%22black%22/%3E%0A%20%20%3Cpath%20fill%3D%22white%22%20d%3D%22%0A%20%20%20%20M84%2012%20H182%20Q196%2012%20196%2026%20V74%20Q196%2088%20182%2088%20H84%20Q70%2088%2070%2074%20V62%0A%20%20%20%20C70%2056%2066%2054%2062%2054%20H52%20C46%2054%2042%2056%2040%2060%20C38%2064%2036%2068%2032%2070%0A%20%20%20%20C26%2073%2020%2070%2018%2064%20C14%2056%2014%2044%2018%2036%20C20%2030%2026%2027%2032%2030%0A%20%20%20%20C36%2032%2038%2036%2040%2040%20C42%2044%2046%2046%2052%2046%20H62%20C66%2046%2070%2044%2070%2038%0A%20%20%20%20V26%20Q70%2012%2084%2012%20Z%0A%20%20%20%20M30%2050%20m-18%200%20a18%2018%200%201%200%2036%200%20a18%2018%200%201%200%20-36%200%0A%20%20%22/%3E%0A%20%20%3Crect%20x%3D%2222%22%20y%3D%2245%22%20width%3D%2216%22%20height%3D%2210%22%20rx%3D%225%22%20fill%3D%22black%22/%3E%0A%3C/svg%3E");
  --paddle-none:  url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20200%20100%22%20preserveAspectRatio%3D%22none%22%3E%0A%20%20%3Crect%20width%3D%22200%22%20height%3D%22100%22%20fill%3D%22black%22/%3E%0A%20%20%3Cpath%20fill%3D%22white%22%20d%3D%22%0A%20%20%20%20M84%2012%20H182%20Q196%2012%20196%2026%20V74%20Q196%2088%20182%2088%20H84%20Q70%2088%2070%2074%20V62%0A%20%20%20%20C70%2056%2066%2054%2062%2054%20H52%20C46%2054%2042%2056%2040%2060%20C38%2064%2036%2068%2032%2070%0A%20%20%20%20C26%2073%2020%2070%2018%2064%20C14%2056%2014%2044%2018%2036%20C20%2030%2026%2027%2032%2030%0A%20%20%20%20C36%2032%2038%2036%2040%2040%20C42%2044%2046%2046%2052%2046%20H62%20C66%2046%2070%2044%2070%2038%0A%20%20%20%20V26%20Q70%2012%2084%2012%20Z%0A%20%20%20%20M30%2050%20m-18%200%20a18%2018%200%201%200%2036%200%20a18%2018%200%201%200%20-36%200%0A%20%20%22/%3E%0A%3C/svg%3E");
}

#board-outline[data-shape="paddle"]{
  border-radius: 0;
  clip-path: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-image: var(--paddle-round);
  mask-image: var(--paddle-round);
}
#board-outline[data-shape="paddle"][data-handle="round"]{ -webkit-mask-image: var(--paddle-round); mask-image: var(--paddle-round); }
#board-outline[data-shape="paddle"][data-handle="slot"] { -webkit-mask-image: var(--paddle-slot);  mask-image: var(--paddle-slot); }
#board-outline[data-shape="paddle"][data-handle="none"] { -webkit-mask-image: var(--paddle-none);  mask-image: var(--paddle-none); }

/* Paddle tile icon uses same silhouette */
.shape-icon.paddle{
  -webkit-mask-image: var(--paddle-round);
  mask-image: var(--paddle-round);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  background: rgba(0,0,0,0.10);
  border-radius: 10px;
  clip-path: none;
}

/* Refined traced paddle silhouette */
:root{
  --paddle-round: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%201000%20500%22%20preserveAspectRatio%3D%22none%22%3E%0A%3Crect%20width%3D%221000%22%20height%3D%22500%22%20fill%3D%22black%22/%3E%0A%3Cpath%20fill%3D%22white%22%20d%3D%22%0AM420%2045%0AH940%0AQ975%2045%20975%2080%0AV420%0AQ975%20455%20940%20455%0AH420%0AQ360%20455%20330%20415%0AQ300%20375%20300%20325%0AH220%0AQ160%20325%20138%20350%0AQ112%20380%2080%20380%0AQ45%20380%2033%20345%0AQ22%20312%2022%20250%0AQ22%20188%2033%20155%0AQ45%20120%2080%20120%0AQ112%20120%20138%20150%0AQ160%20175%20220%20175%0AH300%0AQ300%20125%20330%2085%0AQ360%2045%20420%2045%0AZ%0AM110%20250%0Am-62%200%0Aa62%2062%200%201%200%20124%200%0Aa62%2062%200%201%200%20-124%200%0A%22/%3E%0A%3Ccircle%20cx%3D%22110%22%20cy%3D%22250%22%20r%3D%2226%22%20fill%3D%22black%22/%3E%0A%3C/svg%3E");
  --paddle-slot:  url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%201000%20500%22%20preserveAspectRatio%3D%22none%22%3E%0A%3Crect%20width%3D%221000%22%20height%3D%22500%22%20fill%3D%22black%22/%3E%0A%3Cpath%20fill%3D%22white%22%20d%3D%22%0AM420%2045%0AH940%0AQ975%2045%20975%2080%0AV420%0AQ975%20455%20940%20455%0AH420%0AQ360%20455%20330%20415%0AQ300%20375%20300%20325%0AH220%0AQ160%20325%20138%20350%0AQ112%20380%2080%20380%0AQ45%20380%2033%20345%0AQ22%20312%2022%20250%0AQ22%20188%2033%20155%0AQ45%20120%2080%20120%0AQ112%20120%20138%20150%0AQ160%20175%20220%20175%0AH300%0AQ300%20125%20330%2085%0AQ360%2045%20420%2045%0AZ%0AM110%20250%0Am-62%200%0Aa62%2062%200%201%200%20124%200%0Aa62%2062%200%201%200%20-124%200%0A%22/%3E%0A%3Crect%20x%3D%2268%22%20y%3D%22234%22%20width%3D%2284%22%20height%3D%2232%22%20rx%3D%2216%22%20fill%3D%22black%22/%3E%0A%3C/svg%3E");
  --paddle-none:  url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%201000%20500%22%20preserveAspectRatio%3D%22none%22%3E%0A%3Crect%20width%3D%221000%22%20height%3D%22500%22%20fill%3D%22black%22/%3E%0A%3Cpath%20fill%3D%22white%22%20d%3D%22%0AM420%2045%0AH940%0AQ975%2045%20975%2080%0AV420%0AQ975%20455%20940%20455%0AH420%0AQ360%20455%20330%20415%0AQ300%20375%20300%20325%0AH220%0AQ160%20325%20138%20350%0AQ112%20380%2080%20380%0AQ45%20380%2033%20345%0AQ22%20312%2022%20250%0AQ22%20188%2033%20155%0AQ45%20120%2080%20120%0AQ112%20120%20138%20150%0AQ160%20175%20220%20175%0AH300%0AQ300%20125%20330%2085%0AQ360%2045%20420%2045%0AZ%0AM110%20250%0Am-62%200%0Aa62%2062%200%201%200%20124%200%0Aa62%2062%200%201%200%20-124%200%0A%22/%3E%0A%0A%3C/svg%3E");
}




/* Paddle tile icon (inline SVG) — scoped so other shape icons keep working */
.shape-tiles .shape-icon--paddle-svg{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 28px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.shape-tiles .shape-icon--paddle-svg svg{
  width: 44px;
  height: 28px;
  display: block;
}


/* Overlay lock button state */
#overlay-lock.btn-ghost{
  background: rgba(0,0,0,0.02);
}
#overlay-lock.is-locked{
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.14);
}

/* Visible runtime error banner (helps debug deploy mismatches) */
.app-error-banner{
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #fff3f3;
  border: 1px solid rgba(0,0,0,0.10);
  color: rgba(0,0,0,0.80);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 6px;
  margin: 8px auto 0;
  max-width: 1200px;
}
.app-error-banner code{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* Paint mode toggle */
#paint-mode-toggle.btn-ghost{
  background: rgba(0,0,0,0.02);
}
#paint-mode-toggle.is-on{
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.14);
}

/* Segmented controls */
.segmented{display:flex;gap:6px;flex-wrap:wrap;}
.seg-btn{appearance:none;border:1px solid rgba(0,0,0,0.14);background:rgba(0,0,0,0.02);border-radius:6px;padding:8px 10px;font:inherit;cursor:pointer;}
.seg-btn[aria-pressed="true"]{background:rgba(0,0,0,0.07);border-color:rgba(0,0,0,0.22);}
.check{display:inline-flex;gap:8px;align-items:center;}
.check input{transform:translateY(1px);}

/* Hide removed rotation readouts (safety) */
#rot-readouts{display:none !important;}

#rot-extra, #rot-tiles{display:none !important;}
