.nr-work {
  container-type: inline-size;
  color: var(--ink, #263b32);
  font-family: var(--body-font);
  --nr-forest: #324a3a;
  --nr-unit: clamp(17px, 3.62cqw, 52px);
  --nr-thickness: clamp(9px, 1.1cqw, 16px);
}
.nr-work *, .nr-work *::before, .nr-work *::after { box-sizing: border-box; }
.nr-directions {
  max-width: 68ch;
  margin: 0 0 1.05rem;
  color: #495749;
  font-size: 1rem;
  line-height: 1.55;
}
.nr-work h3 { color: #354634; font: 600 1rem/1.4 var(--body-font); letter-spacing: -.01em; margin: 0 0 .6rem; }
.nr-mat {
  position: relative;
  min-width: 0;
  border: 1px solid #c4b999;
  border-radius: 12px;
  background-color: #e5ddc5;
  background-image:
    repeating-linear-gradient(0deg, rgb(96 80 47 / 7%) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(255 255 249 / 25%) 0 1px, transparent 1px 3px),
    linear-gradient(108deg, #eee7d3, #e5dbc2);
  box-shadow: inset 0 0 7px rgb(104 88 52 / 8%), 0 3px 8px rgb(72 55 27 / 7%);
}
.nr-mat::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px dashed #b9ab8c;
  border-radius: 7px;
  pointer-events: none;
  opacity: .82;
}
.nr-rod {
  display: inline-flex;
  flex-shrink: 0;
  position: relative;
  width: calc(var(--nr-unit) * var(--nr-n));
  height: var(--nr-thickness);
  overflow: hidden;
  vertical-align: middle;
  border-radius: 1.8px;
  box-shadow: 0 1px 0 rgb(63 34 21 / 55%), 1px 3px 3px rgb(75 59 31 / 21%);
  pointer-events: none;
}
.nr-rod i {
  display: block;
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  background-color: #e6381e;
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 21%) 0%, rgb(255 255 255 / 14%) 21%, rgb(255 255 255 / 0%) 33%, rgb(75 22 0 / 4%) 66%, rgb(67 28 11 / 30%) 100%);
}
.nr-rod i:nth-child(even) { background-color: #137fb3; }
.nr-rod::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgb(66 40 18 / 12%);
  box-shadow: inset 0 1px 0 rgb(255 254 220 / 23%);
  background: url('assets/maple.webp') center / 290px 100%;
  mix-blend-mode: soft-light;
  opacity: .25;
}
.nr-piece {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  appearance: none;
  text-align: left;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  background: transparent;
  min-height: 38px;
  color: inherit;
  cursor: grab;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.nr-grip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-start;
  min-height: 32px;
  touch-action: none;
}
.nr-range {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 0 0 14px; color: var(--nr-forest);
}
.nr-range > span { margin-right: 4px; font-size: .9375rem; font-weight: 600; }
.nr-range .nr-range-choice { font-size: .875rem; min-height: 40px; padding: .45rem .85rem; }
.nr-range-choice[aria-pressed="true"] { color: #fffdf6; background: var(--nr-forest); border-color: var(--nr-forest); }
.nr-piece:active { cursor: grabbing; }
.nr-piece:focus-visible, .nr-control:focus-visible, .nr-numeral:focus-visible {
  outline: 3px solid #81521f;
  outline-offset: 3px;
}
.nr-work button { font-family: inherit; }
.nr-order-mat {
  --nr-unit: clamp(15px, 6.7cqw, 72px);
  --nr-thickness: clamp(10px, 1.54cqw, 18px);
  padding: 23px 22px;
}
.nr-order-stack {
  position: relative;
  width: min(100%, calc(var(--nr-unit) * 10 + 28px));
  margin-inline: auto;
}
.nr-order-stack::before {
  content: '';
  position: absolute;
  left: 7px;
  inset-block: 0;
  width: 1px;
  background: #aa9f84;
  pointer-events: none;
}
.nr-order-row {
  display: flex;
  width: 100%;
  min-height: 34px;
  padding-inline-start: 8px;
  position: relative;
}
.nr-order-row.nr-selected, .nr-order-row.nr-over { background: rgb(101 116 77 / 13%); }
.nr-order-row.nr-selected { box-shadow: inset 0 0 0 1px #7a856a; }
.nr-arithmetic { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.nr-add-mat { display: grid; align-items: center; padding: clamp(22px, 3cqw, 42px); min-height: 215px; }
.nr-reference, .nr-lane { display: flex; align-items: center; justify-content: flex-start; position: relative; }
.nr-reference, .nr-lane, .nr-aside-slot { min-height: 48px; }
.nr-mat-area > h3:not(:first-child) { margin-top: 1.65rem; }
.nr-lane { isolation: isolate; width: 100%; border-block-end: 1px dashed #a29c80; }
.nr-start-mark { position: absolute; inset-block: 5px -1px; inset-inline-start: -1px; width: 1px; background: #9e9677; pointer-events: none; }
.nr-joined { padding: 0; min-height: 46px; position: relative; }
.nr-joined + .nr-joined .nr-rod, .nr-fixed + .nr-joined .nr-rod { border-inline-start: 1px solid rgb(30 24 14 / 47%); }
.nr-shelf {
  border: 1px solid #cab89a;
  border-radius: 12px;
  padding: 20px clamp(15px, 2.3cqw, 34px);
  background: linear-gradient(105deg, rgb(255 247 223 / 88%), rgb(239 224 190 / 80%)), url('assets/maple.webp') center / cover;
  box-shadow: inset 0 0 0 4px rgb(243 230 200 / 40%);
  min-width: 0;
}
.nr-shelf-slots { display: grid; }
.nr-shelf-slot { display: flex; align-items: center; min-height: 36px; border-bottom: 1px solid rgb(118 89 47 / 12%); }
.nr-shelf-piece { width: 100%; min-height: 36px; padding: 0; }
.nr-shelf-rest {
  display: block;
  width: calc(var(--nr-unit) * var(--nr-n));
  height: var(--nr-thickness);
  border-radius: 2px;
  border: 1px dashed #b4a487;
}
.nr-sub-shelf { display: flex; flex-direction: column; justify-content: center; }
.nr-aside-slot {
  display: flex; align-items: center; justify-content: flex-start;
  border: 1px dashed #aa9672;
  border-radius: 5px;
  padding-inline: 6px;
  margin-bottom: 1.5rem;
}
.nr-numerals { display: flex; flex-wrap: wrap; gap: 8px; }
.nr-numeral {
  width: 42px; min-height: 45px;
  padding: 0;
  border: 1px solid #a99670;
  border-radius: 3px;
  background: #fffaf0;
  color: #324934;
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: 0 2px 2px rgb(88 65 30 / 14%);
  cursor: pointer;
}
.nr-numeral:disabled { opacity: .6; cursor: default; }
.nr-numeral.nr-selected { color: #fff; border-color: var(--nr-forest); background: var(--nr-forest); }
.nr-over { box-shadow: inset 0 0 0 2px #738460; background-color: rgb(99 129 86 / 9%); }
.nr-drag-source .nr-rod { opacity: .43; }
.nr-ghost { position: fixed; z-index: 10000; pointer-events: none; box-shadow: 1px 7px 6px rgb(52 41 22 / 27%); transform: rotate(-1deg); }
.nr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 16px 0 0; }
.nr-control {
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.3;
  padding: .65rem 1.05rem;
  min-height: 44px;
  border: 1px solid #b3b7a7;
  border-radius: 25px;
  background: #fcfaf3;
  color: var(--nr-forest);
  cursor: pointer;
}
.nr-control.nr-primary { border-color: var(--nr-forest); color: #fffdf6; background: var(--nr-forest); }
.nr-control.nr-quiet { text-decoration: underline; text-underline-offset: 3px; background: transparent; border-color: transparent; }
.nr-feedback { color: #4d594a; font-size: 1rem; line-height: 1.5; margin: .6rem 0 0; }
.nr-feedback:empty { margin: 0; }
.nr-feedback.nr-done { color: #2e5132; font-weight: 600; }
@media (hover: hover) {
  .nr-piece:hover .nr-rod { filter: brightness(1.055); }
  .nr-control:hover { border-color: #5b7056; }
  .nr-primary:hover { background: #253c2d; }
  .nr-numeral:not(:disabled):hover { border-color: #3f5a3c; }
}
@container (max-width: 700px) {
  .nr-arithmetic { grid-template-columns: 1fr; gap: 12px; --nr-unit: min(7.8cqw, 44px); --nr-thickness: clamp(10px, 2.35cqw, 15px); }
  .nr-add-mat { min-height: 185px; padding: 22px; }
  .nr-mat-area > h3:not(:first-child) { margin-top: .65rem; }
  .nr-shelf { padding: 15px 22px; }
  .nr-shelf-slot, .nr-shelf-piece { min-height: 36px; }
  .nr-order-mat { --nr-unit: min(7.9cqw, 48px); padding: 18px 14px; }
  .nr-order-row { min-height: 34px; }
}
@container (max-width: 365px) {
  .nr-arithmetic { --nr-unit: 7.35cqw; }
  .nr-order-mat { --nr-unit: 7.4cqw; }
  .nr-add-mat, .nr-shelf { padding-inline: 16px; }
  .nr-control { padding-inline: .78rem; }
}

.nr-rod.nr-solid i {
  background-color: #cb2533;
  background-image: linear-gradient(to bottom, rgb(255 206 198 / 43%), rgb(255 164 152 / 24%) 18%, transparent 32%, rgb(86 6 22 / 7%) 69%, rgb(70 4 17 / 45%));
}
.nr-solid::after { opacity: .16; }
.nr-compare-mat { padding-block: clamp(25px, 4cqw, 52px); }
.nr-compare-row { min-height: 58px; cursor: pointer; }
.nr-compare-row .nr-grip { touch-action: pan-y; }
.nr-gap-mat { display: flex; align-items: center; padding: 23px clamp(16px, 2.3cqw, 32px); }
.nr-gap-stack { width: 100%; }
.nr-fixed-row, .nr-gap-row { position: relative; display: flex; align-items: center; min-height: 33px; padding-left: 8px; }
.nr-gap-row { outline: 1px dashed #a49a7c; outline-offset: -1px; border-radius: 3px; background: rgb(255 251 232 / 24%); }
.nr-gap-piece { min-height: 33px; }
.nr-gap-shelf { display: flex; flex-direction: column; justify-content: center; }
.nr-gap-shelf .nr-shelf-slot, .nr-gap-shelf .nr-shelf-piece { min-height: 45px; }
