:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f4;
  color: #17211c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.landing,
.app-frame {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.landing {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.hero {
  max-width: 760px;
  padding: 64px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #4b6f5d;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 4.5vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  color: #3b463f;
  font-size: 1.12rem;
  line-height: 1.6;
}

.legal {
  align-items: start;
}

.legal .hero {
  max-width: 900px;
}

.legal h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.legal h2 {
  margin-top: 28px;
}

.install,
.actions,
.toolbar form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid #cbd7cf;
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: #17211c;
}

textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

.install input {
  width: min(360px, 100%);
}

button,
.button,
.secondary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: #14714f;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.secondary {
  background: #1f2d26;
}

.app-frame {
  padding: 32px 0 56px;
}

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

.topbar h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.status,
.toolbar,
.panel,
.metric {
  border: 1px solid #d9e2dc;
  border-radius: 8px;
  background: #ffffff;
}

.status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
}

.status.ok strong {
  color: #14714f;
}

.status.locked strong {
  color: #9b3d29;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: #5d685f;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  margin-bottom: 14px;
}

.billing {
  margin-bottom: 14px;
}

.notice {
  margin: 8px 0 0;
  color: #14714f;
  font-weight: 700;
}

.notice.danger {
  color: #9b3d29;
}

.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.plan {
  display: grid;
  gap: 8px;
  border: 1px solid #d9e2dc;
  border-radius: 8px;
  padding: 12px;
}

.plan.selected {
  border-color: #14714f;
  background: #eef8f2;
}

.plan input {
  width: 18px;
  min-height: 18px;
}

.plan span {
  color: #5d685f;
  font-size: 0.9rem;
}

.plan button {
  width: 100%;
}

.settings {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px auto auto;
  gap: 10px;
  align-items: center;
  padding: 0 18px 18px;
}

.settings label {
  display: grid;
  gap: 6px;
  color: #3b463f;
  font-weight: 800;
}

.settings .check {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: #17211c;
}

.settings .check input {
  min-height: 18px;
}

.toolbar {
  margin-bottom: 14px;
  padding: 14px 16px;
}

.toolbar label {
  font-weight: 800;
}

.toolbar input {
  width: 96px;
}

.panel {
  overflow: hidden;
}

.panel-heading {
  padding: 18px 18px 0;
}

.panel-heading h2 {
  margin-bottom: 4px;
}

.panel-heading p {
  color: #5d685f;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 18px;
  border-top: 1px solid #edf1ee;
  text-align: left;
  vertical-align: top;
}

th {
  color: #5d685f;
  font-size: 0.82rem;
  text-transform: uppercase;
}

td span {
  display: block;
  margin-top: 4px;
  color: #6f7972;
  font-size: 0.92rem;
}

.row-actions {
  min-width: 260px;
}

.row-actions a {
  display: inline-flex;
  margin: 0 10px 8px 0;
  color: #14714f;
  font-weight: 800;
}

.inline-form {
  display: inline-flex;
  margin: 0 10px 8px 0;
}

.inline-form button {
  min-height: 32px;
  padding: 0 10px;
}

details {
  max-width: 340px;
  color: #5d685f;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 8px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pill,
.risk {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-weight: 800;
}

.pill.pending,
.risk.medium {
  background: #fff3cd;
  color: #775600;
}

.pill.confirmed,
.risk.low {
  background: #dff3e8;
  color: #126342;
}

.pill.cancelled,
.pill.auto_cancelled,
.risk.high {
  background: #f8d7da;
  color: #842029;
}

.pill.needs_edit {
  background: #d8ebff;
  color: #084a82;
}

.pill.over_limit {
  background: #ebe3ff;
  color: #4c2784;
}

@media (max-width: 720px) {
  .topbar,
  .status {
    align-items: stretch;
    flex-direction: column;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .metrics,
  .grid,
  .plans,
  .filters {
    grid-template-columns: 1fr;
  }
}
