:root {
  color-scheme: light;
  --ink: #18232b;
  --muted: #65737b;
  --line: #dce4e7;
  --soft: #f3f7f7;
  --accent: #087f78;
  --accent-dark: #05655f;
  --warm: #f5efe7;
  --danger: #b94141;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #eef3f2;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 48px;
  color: #fff;
  background: linear-gradient(120deg, #18383a, #0b706b);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(25, 55, 57, .16);
}

.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: #9edbd6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 12px; font-size: clamp(30px, 5vw, 52px); line-height: 1.03; letter-spacing: -.04em; }
.hero-copy { max-width: 650px; margin-bottom: 0; color: #d8efed; font-size: 17px; line-height: 1.55; }
.hero-mark { color: #9edbd6; font-size: 108px; font-weight: 200; line-height: .8; }

.notice {
  display: flex;
  gap: 16px;
  margin: 18px 0;
  padding: 17px 22px;
  color: #644f35;
  background: var(--warm);
  border: 1px solid #eadcca;
  border-radius: 14px;
  line-height: 1.5;
}
.notice strong { white-space: nowrap; }

.card { margin-top: 18px; padding: 30px; background: #fff; border: 1px solid #e2e9e9; border-radius: 18px; box-shadow: 0 8px 24px rgba(30, 56, 58, .05); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-kicker { color: var(--accent); }
h2 { margin-bottom: 8px; font-size: 28px; letter-spacing: -.03em; }
.section-description { margin-bottom: 28px; color: var(--muted); }

.rule-groups { display: grid; gap: 30px; }
.rule-group { min-width: 0; }
.rule-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.rule-group-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; }
.rule-group-title span { display: inline-grid; width: 26px; height: 26px; place-items: center; color: #fff; background: var(--accent); border-radius: 50%; font-size: 12px; }
.rule-group-note { margin: -2px 0 12px 36px; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.rules-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.rules-table th { padding: 12px 10px; color: var(--muted); background: var(--soft); font-size: 11px; font-weight: 750; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.rules-table td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.rules-table td:first-child { width: 36px; color: var(--muted); text-align: center; }
.rules-table input[type="number"] { width: 100%; min-width: 80px; padding: 9px 10px; color: var(--ink); background: #fff; border: 1px solid #cbd7da; border-radius: 7px; outline: none; }
.rules-table input[type="number"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8, 127, 120, .12); }
.rules-table input[aria-invalid="true"] { border-color: var(--danger); }
.checkbox-cell { width: 150px; }
.checkbox-label { display: flex; align-items: center; gap: 7px; color: #526168; font-size: 13px; white-space: nowrap; }
.checkbox-label input { accent-color: var(--accent); }
.remove-button { width: 30px; height: 30px; padding: 0; color: #748188; background: transparent; border: 0; border-radius: 50%; font-size: 20px; }
.remove-button:hover { color: var(--danger); background: #fff1f1; }
.group-actions { display: flex; gap: 14px; margin: 11px 0 0 36px; }

.button { border: 0; border-radius: 9px; font-weight: 750; transition: background .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { padding: 14px 22px; color: #fff; background: var(--accent); box-shadow: 0 7px 16px rgba(8, 127, 120, .2); }
.button-primary:hover { background: var(--accent-dark); }
.button-quiet, .button-secondary { padding: 10px 14px; color: var(--accent-dark); background: #e7f3f1; }
.button-quiet:hover, .button-secondary:hover { background: #d7ece9; }
.button-text { padding: 0; color: var(--accent); background: transparent; font-size: 13px; }
.button-text:hover { color: var(--accent-dark); }

.advanced-card { padding: 0 30px; }
details summary { display: flex; align-items: center; justify-content: space-between; padding: 23px 0; cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary strong { display: block; font-size: 17px; }
.summary-icon { color: var(--accent); font-size: 26px; font-weight: 300; }
details[open] .summary-icon { transform: rotate(45deg); }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0 0 24px; }
.help-grid p { margin-bottom: 0; padding: 14px; color: var(--muted); background: var(--soft); border-radius: 9px; font-size: 13px; line-height: 1.5; }
.help-grid b { color: var(--ink); }

.form-error { margin-top: 18px; padding: 13px 16px; color: var(--danger); background: #fff1f1; border: 1px solid #f2caca; border-radius: 10px; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 22px; }
.status { margin-right: auto; color: var(--muted); font-size: 13px; }

@media (max-width: 740px) {
  .app-shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .hero { padding: 30px 24px; border-radius: 18px; }
  .hero-mark { display: none; }
  .notice { display: block; }
  .notice strong { display: block; margin-bottom: 5px; }
  .card { padding: 22px 16px; }
  .section-heading { display: block; }
  .section-heading .button { margin-top: 15px; }
  .advanced-card { padding: 0 16px; }
  .help-grid { grid-template-columns: 1fr; }
  .actions { align-items: stretch; flex-direction: column-reverse; }
  .status { margin-right: 0; text-align: center; }
  .button-primary { width: 100%; }
}
