* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f6f2;
  color: #18221b;
  font:
    16px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #d39120;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #377e50;
  outline-offset: 2px;
}
button:disabled,
input:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.top {
  background: #183b2a;
  color: #fff;
  padding: 16px max(18px, calc((100vw - 1040px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: white;
  text-decoration: none;
}
.brand small {
  color: #bddf94;
  font-size: 16px;
  font-weight: 500;
}
.version {
  font-size: 12px;
  letter-spacing: 1px;
  color: #c7d9ca;
}
.nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  background: #fff;
  border-bottom: 1px solid #dce6dc;
  padding: 4px 10px;
}
.nav button {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  color: #516156;
  font-weight: 650;
}
.nav button.on {
  color: #185d32;
  border-bottom-color: #387e4b;
}
.wrap {
  max-width: 1080px;
  margin: auto;
  padding: 30px 20px 70px;
}
.ey {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: #577360;
  font-weight: 750;
}
h1 {
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: -1.5px;
  line-height: 1.2;
  margin: 12px 0;
}
h2 {
  font-size: 21px;
  line-height: 1.3;
}
h3 {
  font-size: 20px;
  line-height: 1.3;
  margin: 12px 0 6px;
  overflow-wrap: anywhere;
}
p {
  margin: 8px 0;
}
.muted {
  color: #5c6d61;
}
.testnote {
  font-size: 14px;
  padding: 12px 16px;
  background: #e6eddf;
  border-radius: 10px;
  color: #465843;
  margin: 20px 0;
}
#notice:empty,
#form-error:empty {
  display: none;
}
#notice {
  padding: 12px 16px;
  background: #ddedda;
  border-left: 4px solid #387e4b;
  border-radius: 8px;
}
.stats,
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.stats button,
.card {
  background: #fff;
  border: 1px solid #dce6dc;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 3px 12px #26482d08;
}
.stats button {
  text-align: left;
  color: #48654f;
}
.stats strong {
  display: block;
  color: #183b2a;
  font-size: 32px;
}
.section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 16px;
}
.section h2 {
  margin: 0;
}
.primary,
.secondary,
.danger {
  border-radius: 9px;
  padding: 10px 13px;
  font-weight: 650;
  border: 1px solid transparent;
  line-height: 1.4;
}
.primary {
  background: #28643f;
  color: #fff;
}
.primary:hover {
  background: #194a2c;
}
.secondary {
  background: #fff;
  border-color: #bacabc;
  color: #275538;
}
.secondary:hover {
  background: #eef5e9;
}
.danger {
  background: #fff;
  color: #923e30;
  border-color: #ead2cb;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.badge {
  background: #e8f4e7;
  border-radius: 99px;
  padding: 5px 9px;
  font-size: 13px;
  color: #346243;
}
.amber {
  background: #fff0cf;
  color: #805a1b;
}
.machine-symbol {
  font-size: 30px;
}
.reading {
  border-top: 1px solid #e5ece2;
  border-bottom: 1px solid #e5ece2;
  margin: 20px 0 14px;
  padding: 14px 0;
}
.reading strong {
  display: block;
  font-size: 30px;
}
.reading small {
  font-size: 17px;
  font-weight: 500;
}
.reading span {
  display: block;
  font-size: 14px;
  color: #627565;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.actions button {
  flex: 1 1 auto;
  font-size: 14px;
}
.actions button:first-child {
  flex-basis: 100%;
}
.empty {
  padding: 30px;
  border: 1px dashed #b6c9b8;
  border-radius: 14px;
  grid-column: 1/-1;
  color: #596c5b;
  text-align: center;
}
.part {
  background: #f0f5e8;
  padding: 10px;
  border-radius: 8px;
}
.filter {
  max-width: 360px;
  margin-bottom: 20px;
}
.filters {
  display: flex;
  align-items: end;
  gap: 18px;
  margin: 18px 0 22px;
}
.grow {
  flex: 1;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
}
.check input {
  width: 22px;
  height: 22px;
}
.history-title {
  margin-top: 35px;
}
.movement {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid #e6ece3;
}
.movement:last-child {
  border-bottom: 0;
}
.movement p {
  font-size: 14px;
  color: #607264;
}
.movement strong {
  white-space: nowrap;
}
label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #b9cabc;
  background: #fff;
  color: #18221b;
  border-radius: 9px;
  min-height: 46px;
  font-size: 16px;
}
textarea {
  resize: vertical;
}
dialog {
  width: min(580px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid #c7d7c6;
  border-radius: 18px;
  color: #18221b;
  box-shadow: 0 25px 90px #102f3150;
}
dialog::backdrop {
  background: #112d2370;
  backdrop-filter: blur(3px);
}
.dialog-head {
  padding: 24px 24px 8px;
}
.dialog-head h2 {
  margin: 0 0 8px;
}
.dialog-head p {
  font-size: 14px;
}
#fields {
  padding: 16px 24px;
  display: grid;
  gap: 18px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid #d1ddca;
  border-radius: 12px;
  min-width: 0;
}
legend {
  font-size: 14px;
  font-weight: 700;
  color: #40634a;
  padding: 0 6px;
}
#available {
  font-size: 14px;
}
.dialog-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e5ece2;
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
#form-error {
  margin: 0 24px 16px;
  color: #942b20;
  background: #ffebe4;
  border-radius: 8px;
  padding: 12px;
}
.service-card {
  align-self: start;
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media (max-width: 800px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .version {
    font-size: 10px;
  }
  .nav {
    gap: 0;
  }
  .nav button {
    padding: 12px 10px;
    flex: 1;
    font-size: 14px;
  }
  .wrap {
    padding: 24px 16px 45px;
  }
  .stats {
    gap: 8px;
  }
  .stats button {
    padding: 12px;
    font-size: 13px;
  }
  .stats strong {
    font-size: 27px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .section {
    align-items: start;
  }
  .section h2 {
    font-size: 19px;
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .card {
    padding: 18px;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .dialog-head {
    padding: 20px 18px 8px;
  }
  #fields {
    padding: 14px 18px;
  }
  .dialog-actions {
    padding: 14px 18px;
  }
  .movement {
    align-items: start;
  }
  .movement strong {
    font-size: 14px;
  }
}
