:root {
  --research-text: #363700;
  --research-surface: #ffffff;
  --research-subtle: #f4f4ed;
  --research-border: #d8d8c6;
  --research-accent: #363700;
  --research-accent-text: #ffffff;
  --research-muted: #62634a;
  --research-focus: #39746a;
}

.research-links { margin-bottom: 18px; }
.research-links li { margin-bottom: 7px; }
#sisalto :is(h1, h2, h3, h4, h5, h6),
#sivupalkki :is(h1, h2, h3, h4, h5, h6) {
  line-height: 1.3;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 22px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
#sisalto > :is(h1, h2, h3, h4, h5, h6):first-child,
#sivupalkki > :is(h1, h2, h3, h4, h5, h6):first-child {
  margin-top: 0;
}
#sisalto h2 span { margin-top: 4px; }
#sisalto p, #sivupalkki p {
  line-height: 1.6;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 14px;
}
#sisalto :is(h1, h2, h3, h4, h5, h6) + :is(ul, ol, dl),
#sivupalkki :is(h1, h2, h3, h4, h5, h6) + :is(ul, ol, dl) {
  padding-top: 0;
}
#sivupalkki li { line-height: 1.6; }
#sivupalkki a { overflow-wrap: anywhere; }
.tuplat a { white-space: normal; }
#sisalto .tuplat li { line-height: 1.6; margin-bottom: 8px; }
#sisalto p, #sisalto dd, #sisalto td, #sisalto a { overflow-wrap: anywhere; }
.research-table-wrap { max-width: 100%; overflow-x: auto; margin: 14px 1%; }
.research-table { border-collapse: collapse; width: 100%; font-size: 1em; text-align: left; }
.research-table th { background: var(--research-subtle); font-weight: bold; }
.research-table th, .research-table td { padding: 10px 8px; border-bottom: 1px solid var(--research-border); vertical-align: top; line-height: 1.5; }
.research-table small { display: block; margin-top: 4px; color: var(--research-muted); font-size: .9em; }
.research-table td:not(:first-child) { min-width: 75px; }
.source-note { color: var(--research-muted); font-size: .92em; line-height: 1.6; }
.verification-date { color: var(--research-muted); border-bottom: 1px solid var(--research-border); }
#sisalto .verification-date { padding-bottom: 12px; margin-bottom: 14px; }
.verified-facts dl { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 5px 12px; }
.verified-facts dd { min-width: 0; }
.location-map { width: 98%; max-width: 100%; border: 1px solid var(--research-border); margin: 12px 1% 0; height: 300px; background: var(--research-subtle); }
.metal-calculator { margin: 18px 1%; padding: 18px 14px; border: 1px solid var(--research-border); border-radius: 4px; background: var(--research-surface); color: var(--research-text); }
.metal-calculator h3:first-child { padding-top: 0; margin-top: 0; }
.calculator-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; margin: 18px 0 8px; }
.calculator-fields label { float: none; display: block; width: auto; padding: 0 0 7px; font-weight: bold; }
.calculator-fields input, .calculator-fields select { width: 100%; min-width: 0; max-width: none; box-sizing: border-box; border: 1px solid var(--research-border); border-radius: 3px; background: var(--research-surface); color: var(--research-text); height: 44px; }
.calculator-fields input:focus-visible, .calculator-fields select:focus-visible { outline: 2px solid var(--research-focus); outline-offset: 2px; }
.calculator-fields select:disabled { opacity: 1; background: var(--research-subtle); }
.valuation-result { margin: 12px 0; padding: 16px; background: var(--research-subtle); border-left: 3px solid var(--research-accent); min-height: 69px; }
.valuation-result span { display: block; }
.valuation-result output { font-size: 2.1em; font-weight: bold; display: block; margin-top: 8px; }

@media (max-width: 740px) {
  #ylaosa ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  #ylaosa ul a { height: 48px; padding: 0 6px; display: flex; align-items: center; justify-content: center; font-size: .8em; }
  #ylaosa form { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
  #ylaosa form input { margin: 0; }
  #ylaosa form button { font-size: 1em; }
  #sisalto { min-width: 0; }
  .tuplat a { padding: 0; }
  .metal-calculator { padding: 14px 10px; }
  .research-table { font-size: .95em; }
  .research-table th, .research-table td { padding: 8px 5px; }
  .location-map { height: 270px; }
}
@media (max-width: 640px) {
  #sivupalkki { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--research-border); }
}
@media (max-width: 400px) {
  .calculator-fields { gap: 10px; }
  .verified-facts dl { grid-template-columns: 90px minmax(0,1fr); gap: 6px; }
  .valuation-result output { font-size: 1.85em; }
}