.lb-resistor-app {
  --lb-navy: #18202f;
  --lb-text: #263238;
  --lb-muted: #66706f;
  --lb-page: #e3e6e1;
  --lb-paper: #f8f8f5;
  --lb-white: #ffffff;
  --lb-gold: #c7ad5b;
  --lb-gold-pale: #eae2cc;
  --lb-line: #d7dad4;
  width: 100%;
  max-width: 100%;
  margin: 24px auto;
  overflow: hidden;
  color: var(--lb-text);
  background: var(--lb-paper);
  border: 1px solid var(--lb-line);
  border-radius: 4px;
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  box-shadow: 0 3px 12px rgba(25, 35, 40, .08);
}
.lb-resistor-app * { box-sizing: border-box; }
.lb-resistor-app button,
.lb-resistor-app select { font: inherit; }

.lb-head {
  position: relative;
  padding: 30px 34px 27px;
  background: rgba(248, 248, 245, .96);
  border-bottom: 3px solid var(--lb-gold-pale);
}
.lb-head::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 34px;
  width: 72px;
  height: 3px;
  background: var(--lb-gold);
}
.lb-kicker,
.lb-result-kicker {
  margin: 0 0 7px;
  color: #88742d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}
.lb-head h1,
.lb-head .lb-title {
  margin: 0;
  color: var(--lb-navy);
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
}
.lb-head > p:last-child {
  margin: 10px 0 0;
  color: var(--lb-muted);
  font-size: 14px;
  line-height: 1.75;
}

.lb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: 1px;
  background: var(--lb-line);
}
.lb-controls,
.lb-result {
  min-width: 0;
  padding: 32px 34px;
  background: var(--lb-white);
}
.lb-result { background: var(--lb-paper); }
.lb-controls h2,
.lb-result h2 {
  margin: 0 0 22px;
  padding: 5px 0 7px 10px;
  color: var(--lb-navy);
  border-bottom: 1px solid var(--lb-gold-pale);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
}
.lb-controls h2 span {
  margin-right: 8px;
  color: #8f7625;
  font-size: 12px;
  font-weight: 700;
}
.lb-fields { max-width: 340px; }
.lb-fields label > span,
.lb-fields legend,
.lb-band-field > span {
  display: block;
  margin: 0 0 8px;
  color: #53605f;
  font-size: 12px;
  font-weight: 700;
}
.lb-fields fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.lb-resistor-app select {
  width: 100%;
  min-height: 44px;
  padding: 9px 32px 9px 12px;
  color: var(--lb-text);
  background: var(--lb-white);
  border: 1px solid #cfd3ce;
  border-radius: 3px;
  cursor: pointer;
}
.lb-resistor-app select:hover { border-color: #aeb5ae; }
.lb-resistor-app select:focus,
.lb-resistor-app button:focus-visible {
  outline: 3px solid rgba(199, 173, 91, .28);
  outline-offset: 2px;
}
.lb-segments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid #cfd3ce;
  border-radius: 3px;
}
.lb-segments button {
  min-height: 43px;
  padding: 0;
  color: #4f5b5a;
  background: #f8f8f5;
  border: 0;
  border-right: 1px solid #cfd3ce;
  font-size: 12px;
  cursor: pointer;
}
.lb-segments button:last-child { border-right: 0; }
.lb-segments button:hover { background: #eff1ed; }
.lb-segments button[aria-pressed="true"] {
  color: #fff;
  background: var(--lb-navy);
  box-shadow: inset 0 -3px var(--lb-gold);
  font-weight: 700;
}
.lb-controls hr {
  height: 1px;
  margin: 28px 0;
  background: var(--lb-line);
  border: 0;
}
.lb-help {
  margin: -14px 0 20px;
  color: var(--lb-muted);
  font-size: 12px;
  line-height: 1.65;
}
.lb-band-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 12px;
}
.lb-band-field small {
  color: #929b98;
  font-weight: 400;
}
.lb-color-select { position: relative; }
.lb-color-dot {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.lb-color-select select { padding-left: 33px; }
.lb-band-field.is-invalid > span { color: #a43e35; }
.lb-band-field.is-invalid select {
  color: #962a23;
  background: #fff4f1;
  border-color: #c85d51;
}

.lb-result-kicker {
  margin-bottom: 6px;
  color: #88742d;
}
.lb-result h2 { margin-bottom: 0; }
.lb-resistor-stage {
  min-height: 218px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 27px;
  margin: 20px 0;
  padding: 24px 18px;
  background: var(--lb-page);
  border: 1px solid #d4d8d1;
  border-radius: 3px;
}
.lb-resistor {
  width: 100%;
  max-width: 390px;
  display: flex;
  align-items: center;
}
.lb-lead {
  flex: 1;
  height: 3px;
  background: linear-gradient(#9ba2a0, #d6dad7, #8e9694);
}
.lb-body {
  position: relative;
  width: 220px;
  height: 52px;
  padding: 0 34px;
  display: flex;
  justify-content: center;
  gap: 12px;
  background: #d8bd88;
  border: 1px solid rgba(105, 75, 35, .25);
  border-radius: 12px;
  box-shadow: inset 0 8px 10px rgba(255,255,255,.25), inset 0 -10px 14px rgba(80,52,20,.18), 0 8px 15px rgba(25,35,40,.16);
}
.lb-body::before,
.lb-body::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  width: 54px;
  height: 76px;
  background: #d8bd88;
  border: 1px solid rgba(105, 75, 35, .22);
  transform: translateY(-50%);
  box-shadow: inset 0 8px 10px rgba(255,255,255,.22), inset 0 -10px 14px rgba(80,52,20,.16);
}
.lb-body::before {
  left: -8px;
  border-radius: 48% 28% 28% 48% / 42% 34% 34% 42%;
}
.lb-body::after {
  right: -8px;
  border-radius: 28% 48% 48% 28% / 34% 42% 42% 34%;
}
.lb-band {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 100%;
  box-shadow: inset 2px 0 rgba(255,255,255,.13), inset -2px 0 rgba(0,0,0,.1);
}
.lb-band:last-child { margin-left: auto; }
.lb-reverse {
  padding: 9px 17px;
  color: var(--lb-navy);
  background: var(--lb-white);
  border: 1px solid #bfc5bf;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(25, 35, 40, .07);
}
.lb-reverse:hover {
  color: #fff;
  background: var(--lb-navy);
  border-color: var(--lb-navy);
  box-shadow: inset 0 -3px var(--lb-gold);
}
.lb-value-box {
  padding: 20px 22px;
  background: var(--lb-white);
  border: 1px solid var(--lb-line);
  border-left: 5px solid var(--lb-gold);
}
.lb-value-box > span {
  color: var(--lb-muted);
  font-size: 11px;
  font-weight: 700;
}
.lb-value-box > strong {
  display: block;
  margin: 4px 0 15px;
  color: var(--lb-navy);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(36px, 5vw, 49px);
  font-weight: 700;
  line-height: 1.2;
}
.lb-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.lb-metrics p {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0;
}
.lb-metrics small {
  color: var(--lb-muted);
  font-size: 10px;
}
.lb-metrics b {
  color: #7e6720;
  font-size: 15px;
  font-weight: 700;
}
.lb-error {
  margin: 14px 0 0;
  padding: 11px 13px;
  color: #7f251f;
  background: #fff0ec;
  border: 1px solid #e0a097;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.7;
}
.lb-color-summary {
  margin: 14px 0 0;
  color: var(--lb-muted);
  font-size: 11px;
  line-height: 1.7;
}
.lb-tip {
  display: flex;
  gap: 17px;
  padding: 24px 34px;
  background: #f2f3ef;
  border-top: 1px solid var(--lb-line);
}
.lb-tip > b {
  color: #816a20;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}
.lb-tip p {
  margin: -4px 0 0;
  color: var(--lb-muted);
  font-size: 12px;
  line-height: 1.8;
}
.lb-tip strong {
  color: var(--lb-navy);
  font-size: 14px;
}
.lb-resistor-app noscript {
  display: block;
  padding: 18px 34px;
  color: #7f251f;
  background: #fff0ec;
}

@media (max-width: 820px) {
  .lb-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lb-resistor-app {
    margin: 18px 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .lb-head { padding: 27px 20px 24px; }
  .lb-head::after { left: 20px; }
  .lb-controls,
  .lb-result { padding: 26px 20px; }
  .lb-band-fields { grid-template-columns: 1fr 1fr; }
  .lb-resistor-stage { padding-right: 8px; padding-left: 8px; }
  .lb-body {
    width: 190px;
    padding: 0 29px;
    gap: 9px;
  }
  .lb-tip { padding: 23px 20px; }
}
