/* Injection stylesheet for public/light-tools.html. All primary rules are scoped to the two new sections. */
#light-calculator.lc-section {
  padding-block: 110px;
  background: linear-gradient(180deg, #eef0e9 0%, var(--paper) 76%);
  color: var(--ink);
}

#light-calculator .lc-heading {
  margin-bottom: 48px;
}

#light-calculator .lc-heading .eyebrow,
#color-theme .eyebrow {
  margin: 0 0 16px;
  color: #718463;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
}

#light-calculator .lc-heading h2 {
  margin: 0;
}

#light-calculator .lc-heading h2 em {
  color: #718463;
}

#light-calculator .lc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(330px, .72fr);
  align-items: start;
  gap: clamp(28px, 6vw, 94px);
}

#light-calculator .lc-form {
  min-width: 0;
}

#light-calculator .lc-form-intro {
  display: grid;
  grid-template-columns: minmax(115px, .26fr) 1fr;
  gap: 30px;
  align-items: start;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

#light-calculator .lc-form-intro .eyebrow {
  margin: 4px 0 0;
  color: #6c7d5c;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .13em;
}

#light-calculator .lc-form-intro p:last-child {
  max-width: 565px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

#light-calculator .lc-error {
  margin: 22px 0 0;
  padding: 13px 15px;
  border-left: 3px solid #7b362b;
  background: #f3e9e3;
  color: #522d26;
  font-size: 12px;
  line-height: 1.55;
}

#light-calculator .lc-fieldset {
  min-width: 0;
  margin: 0;
  padding: 30px 0 0;
  border: 0;
}

#light-calculator .lc-fieldset + .lc-fieldset {
  margin-top: 7px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

#light-calculator .lc-fieldset legend {
  padding: 0 0 19px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.02em;
}

#light-calculator .lc-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px 22px;
}

#light-calculator .lc-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#light-calculator .lc-label {
  display: flex;
  gap: 5px;
  align-items: baseline;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

#light-calculator .lc-label > span {
  color: var(--muted);
  font-weight: 400;
}

#light-calculator .lc-number-control {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 5px 13px 5px 15px;
  border: 1px solid var(--line);
  background: #ffffff91;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#light-calculator .lc-number-control:focus-within {
  border-color: #718463;
  background: #fff;
  box-shadow: 0 0 0 3px #c9cfbc8c;
}

#light-calculator .lc-number-control input {
  width: 100%;
  min-width: 0;
  padding: 5px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.1;
}

#light-calculator .lc-number-control > span {
  flex: 0 0 auto;
  color: #66735c;
  font-size: 10px;
  letter-spacing: .04em;
}

#light-calculator .lc-field small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .02em;
}

#light-calculator .lc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 34px;
}

#light-calculator .lc-primary-action {
  min-width: min(100%, 238px);
  margin: 0;
}

#light-calculator .lc-quiet-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #899582;
  background: transparent;
  color: #485442;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.5;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}

#light-calculator .lc-quiet-button:hover,
#color-theme .lc-quiet-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

#light-calculator .lc-summary {
  position: sticky;
  top: 110px;
  overflow: hidden;
  background: var(--dark);
  color: #eef2e8;
}

#light-calculator .lc-summary-top {
  padding: 37px 37px 27px;
}

#light-calculator .lc-summary .eyebrow {
  margin: 0 0 17px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
}

#light-calculator .lc-summary h3 {
  max-width: 265px;
  margin: 0;
  color: #f5f6f0;
  font-family: var(--display);
  font-size: clamp(29px, 3vw, 39px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.05;
}

#light-calculator .lc-summary-top > p:last-child {
  max-width: 285px;
  margin: 19px 0 0;
  color: #c3cbb9;
  font-size: 11px;
  line-height: 1.75;
}

#light-calculator .lc-results {
  margin: 0 23px;
  padding: 23px 14px 18px;
  border-top: 1px solid #53604e;
  border-bottom: 1px solid #53604e;
}

#light-calculator .lc-results dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}

#light-calculator .lc-results dl > div {
  min-height: 77px;
  padding: 14px 12px 12px;
  border-top: 1px solid #465141;
}

#light-calculator .lc-results dl > div:nth-child(-n + 2) {
  border-top: 0;
}

#light-calculator .lc-results dl > div:nth-child(odd) {
  border-right: 1px solid #465141;
}

#light-calculator .lc-results .lc-result-primary {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  min-height: 116px;
  padding-top: 8px;
  border-right: 0;
}

#light-calculator .lc-results dt {
  margin-bottom: 7px;
  color: #c5cdbb;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.3;
  text-transform: uppercase;
}

#light-calculator .lc-results dd {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

#light-calculator .lc-results output {
  color: #fbfcf8;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1;
}

#light-calculator .lc-result-primary output {
  font-size: clamp(50px, 5vw, 69px);
}

#light-calculator .lc-results dd > span {
  color: #bdc7b3;
  font-size: 9px;
  letter-spacing: .04em;
}

#light-calculator .lc-result-primary dd > span {
  padding-bottom: 6px;
  font-size: 10px;
}

#light-calculator .lc-status {
  min-height: 42px;
  margin: 0;
  padding: 17px 37px 0;
  color: #c4cdb9;
  font-size: 10px;
  line-height: 1.55;
}

#light-calculator .lc-brief-button {
  width: calc(100% - 74px);
  margin: 20px 37px 37px;
  padding: 14px 16px;
  background: var(--accent);
  color: var(--dark);
  font-size: 10px;
}

#light-calculator .lc-brief-button:hover {
  background: #e1e5d7;
}

#light-calculator .lc-method {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#light-calculator .lc-method summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  list-style: none;
}

#light-calculator .lc-method summary::-webkit-details-marker,
#color-theme .theme-panel summary::-webkit-details-marker {
  display: none;
}

#light-calculator .lc-method summary > span {
  color: #65735a;
  font-size: 18px;
  font-weight: 400;
  transition: transform .2s ease;
}

#light-calculator .lc-method[open] summary > span,
#color-theme .theme-panel[open] .theme-summary-action {
  transform: rotate(45deg);
}

#light-calculator .lc-method-content {
  display: grid;
  grid-template-columns: .7fr 1fr 1.2fr;
  gap: 30px;
  padding: 7px 0 27px;
}

#light-calculator .lc-method-content p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

#light-calculator .lc-method-content .lc-formula {
  color: #526147;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.02em;
}

#light-calculator .lc-method-content .lc-caveat {
  color: #5d4f42;
}

#light-calculator .lc-caveat strong {
  color: var(--ink);
}

#light-calculator :is(button, input, summary):focus-visible,
#color-theme :is(button, input, summary):focus-visible {
  outline: 2px solid #617153;
  outline-offset: 3px;
}

#color-theme.theme-section {
  padding-block: 0 82px;
  background: var(--paper);
  color: var(--ink);
}

#color-theme .theme-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#color-theme .theme-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 24px 0;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

#color-theme .theme-panel summary .eyebrow {
  display: block;
  margin-bottom: 6px;
}

#color-theme .theme-panel summary strong {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.03em;
}

#color-theme .theme-summary-action {
  color: #65735a;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  transition: transform .2s ease;
}

#color-theme .theme-panel-content {
  display: grid;
  grid-template-columns: minmax(210px, .66fr) minmax(350px, 1.25fr) minmax(235px, .78fr);
  gap: 34px;
  padding: 8px 0 32px;
}

#color-theme .theme-intro > p {
  max-width: 270px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

#color-theme .theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

#color-theme .theme-preset {
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: #556251;
  font: inherit;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

#color-theme .theme-preset[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

#color-theme .theme-colours {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#color-theme .theme-colour-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 59px;
  padding: 10px 12px 10px 15px;
  border: 1px solid var(--line);
  background: #ffffff75;
}

#color-theme .theme-colour-field > span {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}

#color-theme .theme-colour-field small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
}

#color-theme .theme-colour-field input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
}

#color-theme .theme-colour-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

#color-theme .theme-colour-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}

#color-theme .theme-actions {
  display: flex;
  gap: 17px;
  margin-top: 17px;
}

#color-theme .theme-notes {
  padding-left: 27px;
  border-left: 1px solid var(--line);
}

#color-theme .theme-contrast {
  display: block;
  color: #526147;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

#color-theme .theme-notes p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

#color-theme .theme-notes #theme-status {
  color: var(--ink);
  font-size: 10px;
}

#color-theme .theme-notes #theme-accessibility-note {
  color: #766657;
}

/* These conditional surface adjustments are inert until the tool sets html[data-lys-theme]. */
html[data-lys-theme] body,
html[data-lys-theme] .site-header,
html[data-lys-theme] .privacy-header,
html[data-lys-theme] .site-header nav {
  background-color: var(--paper);
  color: var(--ink);
}

html[data-lys-theme] .site-header,
html[data-lys-theme] .privacy-header {
  border-color: var(--line);
}

html[data-lys-theme] .button-dark {
  background-color: var(--ink);
}

html[data-lys-theme] .button-light {
  background-color: var(--paper);
  color: var(--ink);
}

@media (max-width: 900px) {
  #light-calculator.lc-section {
    padding-block: 80px;
  }

  #light-calculator .lc-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  #light-calculator .lc-summary {
    position: static;
    max-width: 640px;
  }

  #light-calculator .lc-method-content {
    grid-template-columns: 1fr 1fr;
  }

  #light-calculator .lc-method-content .lc-caveat {
    grid-column: span 2;
  }

  #color-theme.theme-section {
    padding-bottom: 64px;
  }

  #color-theme .theme-panel-content {
    grid-template-columns: 1fr 1.25fr;
  }

  #color-theme .theme-notes {
    grid-column: span 2;
    padding: 20px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 600px) {
  #light-calculator.lc-section {
    padding-block: 65px;
  }

  #light-calculator .lc-heading {
    margin-bottom: 35px;
  }

  #light-calculator .lc-form-intro {
    display: block;
    padding-bottom: 21px;
  }

  #light-calculator .lc-form-intro .eyebrow {
    margin-bottom: 13px;
  }

  #light-calculator .lc-fieldset {
    padding-top: 25px;
  }

  #light-calculator .lc-field-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  #light-calculator .lc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 29px;
  }

  #light-calculator .lc-primary-action {
    grid-column: span 2;
    width: 100%;
  }

  #light-calculator .lc-summary-top {
    padding: 30px 25px 22px;
  }

  #light-calculator .lc-results {
    margin: 0 12px;
    padding-inline: 8px;
  }

  #light-calculator .lc-results dl > div {
    padding-inline: 10px;
  }

  #light-calculator .lc-results output {
    font-size: 21px;
  }

  #light-calculator .lc-result-primary output {
    font-size: 53px;
  }

  #light-calculator .lc-status {
    padding: 15px 25px 0;
  }

  #light-calculator .lc-brief-button {
    width: calc(100% - 50px);
    margin: 18px 25px 25px;
  }

  #light-calculator .lc-method {
    margin-top: 45px;
  }

  #light-calculator .lc-method-content {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-bottom: 23px;
  }

  #light-calculator .lc-method-content .lc-caveat {
    grid-column: auto;
  }

  #color-theme.theme-section {
    padding-bottom: 50px;
  }

  #color-theme .theme-panel > summary {
    padding-block: 20px;
  }

  #color-theme .theme-panel summary strong {
    font-size: 21px;
  }

  #color-theme .theme-panel-content {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  #color-theme .theme-intro > p {
    max-width: none;
  }

  #color-theme .theme-notes {
    grid-column: auto;
  }

  #color-theme .theme-colours {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #light-calculator .lc-number-control,
  #light-calculator .lc-quiet-button,
  #light-calculator .lc-method summary > span,
  #color-theme .theme-summary-action,
  #color-theme .theme-preset {
    transition: none;
  }
}

/* The parent controller supplies --theme-on-dark only for active custom themes. */
html[data-lys-theme] #light-calculator .lc-summary,
html[data-lys-theme] #light-calculator .lc-summary h3,
html[data-lys-theme] #light-calculator .lc-results output {
  color: var(--theme-on-dark);
}

#color-theme .lc-quiet-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}
#light-calculator button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
#color-theme #theme-contrast[data-level="warning"] {
  color: #9b3326;
}
html[data-lys-theme] #light-calculator .lc-summary :is(dt,dd > span,.lc-status,.lc-summary-top > p:last-child) {
  color: var(--theme-on-dark);
  opacity: .8;
}
html[data-lys-theme] #light-calculator .section-kicker,
html[data-lys-theme] #color-theme .theme-preset:not([aria-pressed="true"]) {
  color: var(--ink);
}
