:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f3;
  color: #202124;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}

.panel {
  background: #ffffff;
  border: 1px solid #dfe3dc;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(40, 48, 35, 0.08);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

#statusText {
  color: #606960;
  margin-top: 8px;
  line-height: 1.5;
}

.form {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.mode-switch {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 24px;
}

.mode-form {
  margin-top: 18px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 650;
}

.field span {
  font-size: 14px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid #c9cfc6;
  border-radius: 6px;
  padding: 0 12px;
  background: #fbfcfa;
  color: #202124;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #384238;
  font-size: 14px;
  font-weight: 650;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: #3468af;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(52, 104, 175, 0.22);
  border-color: #3468af;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  background: #eef1eb;
  border-radius: 8px;
}

.segmented.mode-switch {
  grid-template-columns: repeat(2, 1fr);
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 6px;
  color: #4b544b;
  cursor: pointer;
  user-select: none;
}

.segmented input:checked + span {
  background: #ffffff;
  color: #143b6e;
  box-shadow: 0 1px 6px rgba(30, 48, 70, 0.12);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

button {
  height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

#previewButton {
  background: #e6ece4;
  color: #213421;
}

#generateButton {
  background: #e45424;
  color: white;
}

#monthlyGenerateButton {
  background: #e45424;
  color: white;
}

.single-action {
  grid-template-columns: 1fr;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.busy {
  color: #3468af;
  font-weight: 700;
}

.message {
  min-height: 48px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f4f6f8;
  color: #4f5b66;
  line-height: 1.6;
}

.message.error {
  background: #fff1ec;
  color: #a33413;
}

.download {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.download a {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  background: #143b6e;
  color: white;
  text-decoration: none;
  font-weight: 700;
}

#outputCheck {
  color: #606960;
  font-size: 14px;
}

.warnings {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7de;
  color: #77530d;
  line-height: 1.55;
}

.preview {
  margin-top: 20px;
}

dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 14px;
  margin: 0;
}

dt {
  color: #4b544b;
  font-weight: 750;
}

dd {
  margin: 0;
  line-height: 1.65;
  color: #202124;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    margin: 16px auto;
  }

  dl {
    grid-template-columns: 1fr;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }
}
