:root {
  --ink: #20362d;
  --green: #184c39;
  --muted: #68756d;
  --paper: #f7f8f3;
  --line: #dce2d8;
  --lime: #dceba1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 10px 17px;
  font-weight: 600;
  transition: background 0.15s;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled) {
  filter: brightness(0.95);
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #90aa48;
  outline-offset: 3px;
}
button.primary {
  background: var(--green);
  color: white;
}
.secondary {
  background: #e9eee5;
  color: var(--ink);
}
.quiet {
  background: transparent;
  color: var(--green);
}
.wide {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.topbar {
  height: 86px;
  border-bottom: 1px solid var(--line);
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--ink);
  text-decoration: none;
}
.brandmark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  background: var(--green);
  color: var(--lime);
  border-radius: 8px;
  font-size: 25px;
  font-style: italic;
}
.brand-detail {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 600;
  margin-left: 9px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 55px 32px 40px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(34px, 4.5vw, 48px);
  letter-spacing: -2px;
  line-height: 1.15;
  font-weight: 600;
  margin: 10px 0 15px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 16px;
}
p {
  color: var(--muted);
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 33px;
}
.page-heading button {
  white-space: nowrap;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: #edf1e5;
  border: 1px solid #dce5ce;
  border-radius: 8px;
  padding: 15px 20px;
  font-size: 12px;
}
.statusbar > span:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}
.statusbar b {
  padding: 0 7px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
}
.list-heading h2 span {
  font-size: 12px;
  background: #e8ece4;
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 6px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.order-note {
  margin: 3px 0 20px;
}
.rules {
  display: grid;
  gap: 14px;
}
.rule {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 23px 25px;
  display: grid;
  grid-template-columns: 35px 1fr auto;
  gap: 14px;
}
.rule.disabled {
  background: #f1f3ed;
}
.rule-number {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #85917d;
  padding-top: 6px;
}
.rule-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rule-title h3 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
.badge {
  font-size: 10px;
  border-radius: 4px;
  background: #e9f0df;
  color: #385d29;
  padding: 3px 7px;
  letter-spacing: 0.3px;
}
.disabled .badge {
  background: #e4e7e1;
  color: #707b6d;
}
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 14px 0 12px;
}
.metric {
  font-size: 14px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 2px;
}
.schedule {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.destinations {
  font-size: 12px;
  color: var(--green);
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.rule-actions {
  display: flex;
  align-items: flex-start;
  gap: 3px;
}
.rule-actions button {
  padding: 8px 11px;
}
.reorder {
  display: flex;
  gap: 1px;
  margin-top: 10px;
}
.reorder button {
  padding: 4px 9px;
  font-size: 12px;
  min-height: 36px;
  color: var(--muted);
}

.footnote {
  display: block;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 20px;
}
.login {
  max-width: 410px;
  margin: 35px auto;
}
.login h1 {
  font-size: 52px;
}
.login p {
  margin: 18px 0 25px;
}
.login form {
  margin-top: 35px;
}
.login .error {
  margin: 12px 0;
}

.empty {
  padding: 35px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}
.error {
  color: #a72c21;
  font-size: 13px;
}
.error:empty {
  display: none;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid #ced6c8;
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  margin-top: 7px;
  font-size: 16px;
  min-height: 48px;
}
input::placeholder {
  color: #8c9687;
}
label small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}
.check input {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.check.enabled-check {
  white-space: nowrap;
  margin-top: 23px;
}
.name-row {
  display: flex;
  gap: 20px;
}
.name-row > label:first-child {
  flex: 1;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
.editor-head h1 {
  font-size: 36px;
  margin: 0;
}

.editor-body {
  padding: 0;
}
.editor-footer {
  margin-top: 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.form-section {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 22px;
}
.section-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 15px;
}
.section-title > span {
  font-size: 10px;
  color: #708262;
  border: 1px solid var(--line);
  padding: 3px 5px;
  border-radius: 4px;
}
.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 17px;
}
.full {
  grid-column: 1/-1;
}
.form-section > .hint {
  margin: 8px 0 14px;
}
.window-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-top: 15px;
}
.window-row {
  display: grid;
  grid-template-columns: 1fr 1fr 44px;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;
}
.window-row button {
  background: #e9eee5;
  color: var(--muted);
  font-size: 20px;
  padding: 5px;
  min-height: 48px;
}
.window-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}
.group-options {
  display: grid;
  gap: 8px;
}
.group-options .check {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.group-options small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
#save-error {
  margin-top: 18px;
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 22px;
  border-radius: 8px;
  box-shadow: 0 8px 30px #0002;
  background: var(--ink);
  color: white;
  z-index: 5;
  max-width: 90%;
  width: max-content;
  font-size: 13px;
}

[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  .topbar {
    height: 69px;
    padding: 0 20px;
  }
  .brand-detail {
    display: none;
  }
  main {
    padding: 32px 18px;
  }
  .page-heading {
    display: block;
    margin-bottom: 24px;
  }
  h1 {
    font-size: 36px;
    letter-spacing: -1.4px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .page-heading button {
    margin-top: 22px;
    width: 100%;
  }
  .statusbar {
    padding: 13px;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
  }
  .list-heading {
    margin-top: 22px;
  }
  .rule {
    padding: 18px 15px;
    grid-template-columns: 22px 1fr;
    gap: 8px;
  }
  .rule-title h3 {
    font-size: 20px;
  }
  .rule-actions {
    grid-column: 2;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 6px;
  }
  .reorder {
    margin: 0;
  }
  .rule-actions > div {
    display: flex;
    gap: 5px;
  }
  .metrics {
    gap: 12px 22px;
  }
  .order-note {
    font-size: 11px;
  }

  .login {
    margin: 20px auto;
  }
  .login h1 {
    font-size: 48px;
  }

  .editor-footer {
    padding: 16px 0;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .editor-footer button {
    flex: 1;
  }
  .name-row {
    gap: 12px;
    flex-wrap: wrap;
  }
  .name-row > label:first-child {
    flex-basis: 100%;
  }
  .check.enabled-check {
    margin-top: 0;
  }
  .field-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .window-row {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  }
  .window-row input {
    font-size: 15px;
    padding: 10px 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.editor-page {
  max-width: 680px;
  margin: 0 auto;
}
.editor-head > button {
  padding-left: 0;
}
.password-field {
  position: relative;
  margin-top: 8px;
}
.password-field input {
  margin-top: 0;
  padding-right: 54px;
}
.password-toggle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
}
.password-toggle span,
.password-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}
#login-form > button[type="submit"] {
  margin-top: 20px;
}

.service-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.service-types legend {
  padding: 0 5px;
  font-size: 12px;
  font-weight: 600;
}
