/* The joinery workbench uses Al Ethq's existing Tajawal fonts and site header. */
.ws-hero {
  --ws-ink: #243a30;
  --ws-muted: #655f53;
  --ws-paper: #fbfaf6;
  --ws-line: #ded9cd;
  --ws-bronze: #856039;
  background: #f5f1e9;
  color: #302e26;
  padding: clamp(20px, 2.3vw, 38px) 0 0;
}
.ws-hero *, .ws-hero *::before, .ws-hero *::after { box-sizing: border-box; }
.ws-hero [hidden] { display: none !important; }
.ws-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-bottom: 20px; }
.ws-intro .eyebrow { font-size: 12px; color: #785a36; margin: 0 0 5px; }
.ws-intro h1 { margin: 0; color: var(--ws-ink); font-size: clamp(32px, 3.5vw, 54px); font-weight: 800; line-height: 1.24; }
.ws-intro h1 em { font-style: normal; color: var(--ws-bronze); }
.ws-intro-copy { max-width: 365px; }
.ws-intro-copy p { font-size: 15px; line-height: 1.63; margin: 0 0 3px; color: var(--ws-muted); }
.ws-intro-copy a, .ws-under a { display: inline-flex; align-items: center; gap: 8px; color: #72522f; font-size: 12px; font-weight: 700; }
.ws-intro-copy a:hover, .ws-under a:hover { text-decoration: underline; }
.ws-workspace {
  display: grid; grid-template-columns: clamp(312px, 27vw, 392px) minmax(0, 1fr);
  border: 1px solid #d3cebf; border-radius: 18px; overflow: hidden; background: var(--ws-paper);
  box-shadow: 0 12px 38px #342b1d0e; scroll-margin-top: calc(var(--header-height, 85px) + 10px);
}
.ws-workspace :is(button,input,select) { font-family: inherit; }
.ws-workspace button { cursor: pointer; }
.ws-workspace button:disabled { opacity: .45; cursor: default; }
.ws-workspace :is(a,button,input,select,[tabindex="0"]):focus-visible { outline: 3px solid #a67136; outline-offset: 2px; }
.ws-workspace button svg {
  display: inline-block; width: 19px; height: 19px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linejoin: round; stroke-linecap: round;
}
.ws-controls { display: flex; flex-direction: column; align-items: stretch; min-width: 0; border-inline-end: 1px solid #d3cebf; }
.ws-control-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 20px 22px 11px; }
.ws-control-head h2 { margin: 0; color: var(--ws-ink); font-size: 25px; font-weight: 800; line-height: 1.4; }
.ws-unit { color: #6f6657; font-size: 11px; }
.ws-tabs { display: grid; grid-template-columns: 1fr 1.28fr 1fr; margin: 0 22px 5px; border-bottom: 1px solid var(--ws-line); }
.ws-tabs button { border: 0; border-bottom: 2px solid transparent; color: #655e51; background: transparent; font-size: 14px; min-height: 44px; padding: 6px 2px; }
.ws-tabs button[aria-selected="true"] { border-color: var(--ws-ink); color: var(--ws-ink); font-weight: 800; }
.ws-options { padding: 21px 22px 9px; }
.ws-type-buttons, .ws-segments { display: flex; gap: 6px; }
.ws-type-buttons { margin-bottom: 19px; }
.ws-type-buttons button, .ws-segments button {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  border: 1px solid #d8d2c6; border-radius: 8px; padding: 5px 6px; color: #5b5549; background: #fffefa; font-size: 13px;
}
.ws-type-buttons button[aria-pressed="true"], .ws-segments button[aria-pressed="true"] {
  color: #263e32; border-color: #788776; background: #e9ede3; font-weight: 700;
}
.ws-dimension { margin-bottom: 13px; }
.ws-dimension > label, .ws-field-label, .ws-select-row label {
  display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #3a3b30; font-size: 14px; font-weight: 700;
}
.ws-dimension > label > span { font-size: 11px; font-weight: 500; color: #746c60; }
.ws-dimension > div { display: grid; grid-template-columns: 54px auto minmax(0,1fr); align-items: center; gap: 8px; }
.ws-dimension > div > span { font-size: 12px; color: #6d675b; }
.ws-dimension input[type="text"], .ws-select-row select {
  border: 1px solid #cec9bb; border-radius: 6px; color: var(--ws-ink); background: white;
  font-weight: 700; padding: 5px; height: 38px; min-height: 38px;
}
.ws-dimension input[type="text"] { width: 100%; text-align: center; direction: ltr; font: 600 15px/1.2 Arial, sans-serif; }
.ws-workspace input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 26px; min-height: 26px; margin: 0; padding: 0;
  border: 0; direction: ltr; cursor: pointer; border-radius: 4px; background: transparent; accent-color: #586d59;
}
.ws-workspace input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 5px; background: linear-gradient(to right, #637966 var(--ws-fill,50%), #d8d5c9 var(--ws-fill,50%));
}
.ws-workspace input[type="range"]::-moz-range-track { height: 4px; background: #d6d5ca; border-radius: 5px; }
.ws-workspace input[type="range"]::-moz-range-progress { background: #637966; height: 4px; }
.ws-workspace input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; margin-top: -6.5px; border: 2px solid #fdfaf1;
  border-radius: 50%; background: #3c5645; box-shadow: 0 0 0 1px #63765e, 0 1px 3px #2a342b28;
}
.ws-workspace input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid white; border-radius: 50%; background: #3c5645; }
.ws-select-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--ws-line); padding-top: 10px; }
.ws-select-row select { width: 99px; padding-inline: 8px; font-size: 13px; }
.ws-small-note { margin: 11px 0 0; font-size: 11px; line-height: 1.75; color: var(--ws-muted); }
.ws-field-label { margin: 0 0 9px; }
.ws-swatch { display: block; width: 100%; height: 39px; border: 1px solid #0002; border-radius: 4px; margin-bottom: 4px; }
.ws-swatches { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-bottom: 18px; }
.ws-swatches button { min-width: 0; padding: 4px; border: 1px solid #ddd7cc; border-radius: 7px; background: #fffdfa; color: #5b5245; font-size: 11px; line-height: 1.6; }
.ws-swatches button[aria-pressed="true"] { border-color: #48624e; box-shadow: 0 0 0 1px #48624e; color: #304c38; font-weight: 700; }
.ws-oak { background: repeating-linear-gradient(94deg,transparent 0 3px,#502d131b 4px,transparent 7px 11px),linear-gradient(110deg,#d1b08a,#b8936e 52%,#cba984); }
.ws-walnut { background: repeating-linear-gradient(95deg,#0000 0 3px,#29170c38 4px,transparent 7px 12px),linear-gradient(115deg,#8e6347,#704a36 55%,#895f45); }
.ws-ivory { background: linear-gradient(120deg,#f0eadb,#dfd4bf); }
.ws-white { background: linear-gradient(120deg,#fdfbf3,#eae8df); }
.ws-greige { background: linear-gradient(120deg,#c0b5a6,#a99e91); }
.ws-sage { background: linear-gradient(120deg,#abb09a,#8b937d); }
.ws-navy { background: linear-gradient(120deg,#4b6375,#304457); }
.ws-charcoal { background: linear-gradient(120deg,#5b5f58,#3a3d3b); }
.ws-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 15px 0 0; min-height: 40px; cursor: pointer; color: #45493e; font-size: 14px; font-weight: 700; }
.ws-toggle small { display: block; color: var(--ws-muted); font-size: 11px; font-weight: 400; }
.ws-toggle input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.ws-toggle i { width: 35px; height: 21px; border-radius: 22px; background: #d0cbbf; position: relative; flex-shrink: 0; }
.ws-toggle i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .16s; }
.ws-toggle input:checked+i { background: #516b55; }
.ws-toggle input:checked+i::after { transform: translateX(-14px); }
.ws-toggle input:focus-visible+i { outline: 3px solid #a67136; outline-offset: 2px; }
.ws-layouts { display: grid; gap: 6px; margin-bottom: 14px; }
.ws-layouts button { display: flex; align-items: center; gap: 13px; text-align: start; border: 1px solid #d9d4c8; border-radius: 7px; background: #fdfcf8; color: #4e5146; padding: 7px 11px; }
.ws-layouts button[aria-pressed="true"] { border-color: #7b8c76; background: #edf0e7; }
.ws-layouts b, .ws-layouts small { display: block; }
.ws-layouts b { font-size: 14px; }
.ws-layouts small { font-size: 11px; color: #6c685c; }
.ws-radio { margin-inline-start: auto; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #999e8f; }
.ws-layouts button[aria-pressed="true"] .ws-radio { background: #456149; box-shadow: inset 0 0 0 3px #edf0e7; }
.ws-layout-drawing { display: flex; width: 32px; height: 33px; border: 1px solid #7e876e; }
.ws-layout-drawing i { flex: 1; border-inline-end: 1px solid #98a08c; background: linear-gradient(transparent 20%,#95a08b 21% 25%,transparent 26%); }
.ws-layout-drawing i:last-child { border: 0; }
.ws-layout-drawing.shelves i, .ws-layout-drawing.balanced i:nth-child(2) { background: repeating-linear-gradient(transparent 0 7px,#95a08b 7px 8px); }
.ws-submit { margin-top: auto; padding: 9px 22px 11px; }
.ws-primary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 57px; border-radius: 8px; background: #2e4838; color: #fdfbf2; padding: 9px 14px; transition: background .16s; }
.ws-primary:hover { background: #3c5b45; }
.ws-primary > span { font-size: 15px; font-weight: 700; }
.ws-primary small { display: block; font-size: 11px; font-weight: 400; color: #e0e6d9; }
.ws-primary img { width: 23px; height: 23px; }
.ws-primary[aria-disabled="true"] { opacity: .62; }
.ws-submit > button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; width: 100%; border: 0; background: transparent; color: #654f37; font-size: 12px; padding: 5px 0 0; }
.ws-submit > button img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: center top; }
.ws-error { margin: 0; padding: 0 22px; color: #933b24; font-size: 12px; line-height: 1.8; }
.ws-error:empty { display: none; }
.ws-dimension input[aria-invalid="true"] { border-color: #ac472b; }
.ws-under { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 11px 3px 19px; }
.ws-under p { font-size: 12px; line-height: 1.7; color: #655d50; margin: 0; }

@media (max-width: 960px) {
  .ws-hero .wrap { width: calc(100% - 36px); }
  .ws-workspace { grid-template-columns: 288px minmax(0,1fr); }
  .ws-options, .ws-submit, .ws-control-head { padding-inline: 16px; }
  .ws-tabs { margin-inline: 16px; }
  .ws-intro-copy { max-width: 300px; }
}
@media (max-width: 760px) {
  .ws-hero .wrap { width: calc(100% - 22px); }
  .ws-hero { padding-top: 15px; }
  .ws-intro { display: block; padding: 0 5px 12px; }
  .ws-intro .eyebrow { font-size: 11px; margin-bottom: 3px; }
  .ws-intro h1 { font-size: clamp(32px,7vw,42px); line-height: 1.3; }
  .ws-intro-copy { max-width: none; }
  .ws-intro-copy p { font-size: 13px; line-height: 1.6; margin: 4px 0 0; }
  .ws-intro-copy a { display: none; }
  .ws-workspace { grid-template-columns: minmax(0,1fr); border-radius: 13px; }
  .ws-controls { border-inline-end: 0; border-top: 1px solid var(--ws-line); }
  .ws-visual { grid-row: 1; }
  .ws-control-head, .ws-submit, .ws-options { padding-inline: 18px; }
  .ws-control-head { padding-top: 15px; } .ws-tabs { margin-inline: 18px; }
  .ws-options { padding-top: 14px; }
  .ws-dimension input[type="text"] { font-size: 16px; height: 44px; }
  .ws-type-buttons button, .ws-segments button, .ws-select-row select, .ws-submit>button { min-height: 44px; }
  .ws-small-note { font-size: 12px; }
  .ws-under { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-workspace *, .ws-workspace *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
