.tsgmr-app {
  --tsgmr-primary: #126f62;
  --tsgmr-primary-dark: #0b554b;
  --tsgmr-border: #d7dfdd;
  --tsgmr-muted: #5d6967;
  --tsgmr-danger: #a52727;
  --tsgmr-warning: #8a5700;
  max-width: 820px;
  margin: 1.5rem auto;
  color: #17211f;
  color-scheme: light;
  font-size: 16px;
  line-height: 1.5;
}

.tsgmr-app *,
.tsgmr-app *::before,
.tsgmr-app *::after { box-sizing: border-box; }

.tsgmr-intro,
.tsgmr-form {
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--tsgmr-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(21, 54, 49, .07);
}

.tsgmr-intro { margin-bottom: 1rem; }
.tsgmr-app .tsgmr-intro h2 {
  margin: 0 0 .55rem;
  color: #17211f !important;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.25;
}
.tsgmr-app .tsgmr-intro p { margin: 0; color: var(--tsgmr-muted) !important; }

.tsgmr-form__row { margin-bottom: 1rem; }
.tsgmr-app .tsgmr-form label {
  display: block;
  margin-bottom: .4rem;
  color: #17211f !important;
  font-weight: 600;
  line-height: 1.45;
}
.tsgmr-form input[type="text"],
.tsgmr-form input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: .65rem .8rem;
  border: 1px solid #aebbb8;
  border-radius: 8px;
  background: #fff;
  color: #17211f !important;
  -webkit-text-fill-color: #17211f !important;
  caret-color: #17211f;
  font: inherit;
  font-size: 16px;
}

.tsgmr-app .tsgmr-form input:-webkit-autofill,
.tsgmr-app .tsgmr-form input:-webkit-autofill:hover,
.tsgmr-app .tsgmr-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #17211f !important;
  caret-color: #17211f !important;
  transition: background-color 9999s ease-out 0s;
}

.tsgmr-app .tsgmr-form input::placeholder { color: #687673; opacity: 1; }

.tsgmr-form input:focus {
  outline: 3px solid rgba(18, 111, 98, .18);
  border-color: var(--tsgmr-primary);
}

.tsgmr-apartment-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) auto;
  gap: .75rem;
  align-items: end;
}

.tsgmr-button {
  min-height: 46px;
  padding: .65rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tsgmr-button:disabled { opacity: .6; cursor: wait; }
.tsgmr-button--primary { background: var(--tsgmr-primary); color: #fff; }
.tsgmr-button--primary:hover { background: var(--tsgmr-primary-dark); }
.tsgmr-button--secondary { border-color: var(--tsgmr-primary); background: #fff; color: var(--tsgmr-primary-dark); }

.tsgmr-lookup-status,
.tsgmr-submit-status { min-height: 1.5em; margin: .5rem 0 1rem; }
.tsgmr-app .is-error { color: var(--tsgmr-danger); }
.tsgmr-app .is-warning { color: var(--tsgmr-warning); }
.tsgmr-app .is-success { color: #17683d; }

.tsgmr-meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.tsgmr-meter {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--tsgmr-border);
  border-radius: 10px;
  background: #f9fbfa;
}

.tsgmr-meter[hidden], .tsgmr-meters[hidden] { display: none !important; }
.tsgmr-meter.is-warning { border-color: #d39b3e; background: #fff9ed; color: inherit; }
.tsgmr-meter.is-error { border-color: #d48080; background: #fff4f4; color: inherit; }
.tsgmr-meter.is-expired { border-color: #d55252; background: #fff1f1; color: #7f2020; }
.tsgmr-meter.is-expired input:disabled { border-color: #dea2a2; background: #f6dddd; color: #7f4a4a !important; -webkit-text-fill-color: #7f4a4a !important; cursor: not-allowed; }
.tsgmr-app .tsgmr-meter__heading { margin-bottom: .35rem; color: #17211f !important; font-weight: 750; }
.tsgmr-app .tsgmr-meter.is-resource-cold .tsgmr-meter__heading { color: #145f9b !important; }
.tsgmr-app .tsgmr-meter.is-resource-hot .tsgmr-meter__heading { color: #9b2850 !important; }
.tsgmr-app .tsgmr-meter.is-resource-electricity .tsgmr-meter__heading { color: #9a4800 !important; }
.tsgmr-app .tsgmr-meter__number { margin-bottom: .45rem; color: #283431 !important; font-size: .94em; font-weight: 650; overflow-wrap: anywhere; }
.tsgmr-app .tsgmr-meter__previous { margin-bottom: .75rem; color: var(--tsgmr-muted) !important; }
.tsgmr-app .tsgmr-meter.is-expired .tsgmr-meter__heading,
.tsgmr-app .tsgmr-meter.is-expired .tsgmr-meter__number,
.tsgmr-app .tsgmr-meter.is-expired .tsgmr-meter__previous { color: #852d2d !important; }
.tsgmr-meter__delta { min-height: 1.4em; margin-top: .5rem; font-weight: 700; }
.tsgmr-meter__message { margin-top: .35rem; color: var(--tsgmr-warning); font-size: .94em; }
.tsgmr-meter.is-error .tsgmr-meter__message { color: var(--tsgmr-danger); }
.tsgmr-meter.is-expired .tsgmr-meter__message { color: #a52727; }
.tsgmr-app .tsgmr-meter__message a { color: inherit !important; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

.tsgmr-consents { margin: 1.3rem 0; }
.tsgmr-app .tsgmr-consents label { display: flex; gap: .55rem; align-items: flex-start; color: #17211f !important; font-weight: 400; }
.tsgmr-app .tsgmr-consents label span { min-width: 0; overflow-wrap: anywhere; }
.tsgmr-consents input { margin-top: .3rem; flex: 0 0 auto; }
.tsgmr-app .tsgmr-consents a { color: #0b6258 !important; text-decoration: underline; text-underline-offset: 2px; }
.tsgmr-honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.tsgmr-captcha { min-height: 100px; margin: 1rem 0; }

.tsgmr-notice {
  max-width: 820px;
  margin: 1rem auto;
  padding: 1rem 1.2rem;
  border-radius: 10px;
}
.tsgmr-notice--closed { border: 1px solid #c9d2d0; background: #f4f7f6; color: #17211f !important; }
.tsgmr-notice--preview { margin-bottom: 1rem; border: 1px solid #d39b3e; background: #fff9ed; color: #3f310f !important; }

@media (max-width: 640px) {
  .tsgmr-apartment-row, .tsgmr-meters { grid-template-columns: 1fr; }
  .tsgmr-button { width: 100%; }
  .tsgmr-app { width: 100%; margin: 1rem auto; }
  .tsgmr-intro, .tsgmr-form { padding: 1rem; border-radius: 10px; }
  .tsgmr-meter { padding: .9rem; }
  .tsgmr-meter__message, .tsgmr-meter__number { overflow-wrap: anywhere; word-break: normal; }
}
