:root {
  color-scheme: light;
  --bg: oklch(97% 0.006 40);
  --surface: oklch(99% 0.003 40);
  --ink: oklch(27% 0.012 35);
  --muted: oklch(51% 0.016 35);
  --line: oklch(88% 0.011 40);
  --accent: oklch(53% 0.19 30);
  --soft: oklch(95% 0.024 35);
  --good: oklch(40% 0.085 160);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.65 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  min-height: 44px;
  cursor: pointer;
  border-radius: 7px;
  padding: 10px 17px;
  font-weight: 600;
  border: 1px solid transparent;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:hover:not(:disabled) {
  filter: brightness(0.96);
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.7px;
  margin: 8px 0 12px;
}
h2 {
  font-size: 19px;
  margin-bottom: 18px;
}
small,
.footnote {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
}
.primary {
  background: var(--accent);
  color: oklch(99% 0.003 40);
}
.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.quiet {
  color: var(--muted);
  background: transparent;
  padding: 6px 10px;
}
.danger,
.error {
  color: var(--accent);
}
.error {
  min-height: 24px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--surface);
  font-size: 23px;
  font-weight: 700;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.brand small {
  font-size: 11px;
  font-weight: 400;
  margin-top: 5px;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-form {
  width: 100%;
  max-width: 410px;
}
.login-form .eyebrow {
  margin-top: 25px;
}
.login-form label {
  margin-top: 28px;
}
.login-form button {
  width: 100%;
  margin: 18px 0 12px;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 226px;
  background: oklch(95.8% 0.01 40);
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 48px;
}
nav a {
  padding: 11px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 600;
}
nav a.active {
  color: var(--accent);
  background: var(--soft);
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
}
.sidebar-bottom button {
  margin-top: 20px;
  padding-left: 0;
}
main {
  margin-left: 226px;
  padding: 45px 5%;
  max-width: 1500px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.rule-row {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
}
.rule-name {
  font-weight: 650;
  font-size: 18px;
}
.rule-info {
  font-size: 13px;
  margin-top: 8px;
  color: var(--muted);
}
.rule-row .actions {
  align-self: center;
}
.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  margin-left: 10px;
  vertical-align: middle;
  color: var(--muted);
}
.badge.on {
  color: var(--good);
  border-color: oklch(83% 0.04 160);
  background: oklch(96% 0.015 160);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.empty {
  padding: 55px 20px;
  text-align: center;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.back {
  color: var(--muted);
  font-size: 13px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 28px;
  max-width: 900px;
}
.wide {
  grid-column: 1/-1;
}
.form-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.form-section > p {
  margin-bottom: 20px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
input:not([type="checkbox"]),
select {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
input::placeholder {
  color: var(--muted);
  font-weight: 400;
}
label small {
  font-weight: 400;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin: 0 8px 0 0;
}
.activation p {
  font-size: 13px;
  margin: 10px 0 0;
  max-width: 75ch;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 35px;
}
details {
  margin-top: 25px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 0;
}
details .fields {
  margin-top: 16px;
}
.notice {
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--soft);
  margin-bottom: 25px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.preview {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.preview-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.preview-item > a {
  font-weight: 600;
}
.preview-item p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.preview-item .result {
  color: var(--accent);
  font-size: 12px;
}
.preview-item .match {
  color: var(--good);
}
.section-title {
  margin-top: 35px;
}
.history-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.history-row small {
  overflow-wrap: anywhere;
}
footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 65px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
#bark-form label {
  max-width: 700px;
}
#bark-form .actions {
  margin-top: 20px;
}
#general-form button {
  margin-top: 22px;
}
.page {
  max-width: 1080px;
  overflow-wrap: anywhere;
}
.fields > *,
.rule-row > * {
  min-width: 0;
}
.back,
.check {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
summary {
  min-height: 44px;
}
input:not([type="checkbox"]),
select {
  font-size: 16px;
}
@media (max-width: 850px) {
  aside {
    position: static;
    width: auto;
    display: block;
    padding: 18px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 17px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  nav {
    margin: 20px 0 0;
    flex-direction: row;
    gap: 6px;
  }
  nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 13px;
    padding: 7px 8px;
  }
  .sidebar-bottom {
    position: absolute;
    right: 18px;
    top: 20px;
  }
  .sidebar-bottom p {
    display: none;
  }
  .sidebar-bottom button {
    margin: 0;
  }
  main {
    margin: 0;
    padding: 30px 22px;
  }
  .page-header {
    align-items: flex-start;
    margin-bottom: 25px;
  }
  h1 {
    font-size: 26px;
  }
  .rule-row {
    grid-template-columns: 1fr;
  }
  .rule-row .actions {
    justify-content: flex-start;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .fields {
    gap: 20px;
  }
  .page-header > .actions {
    max-width: 140px;
  }
  footer {
    margin-top: 35px;
  }
}
@media (max-width: 520px) {
  .fields {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .page-header {
    gap: 12px;
  }
  .page-header > button {
    padding: 9px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .login-form h1 {
    font-size: 29px;
  }
  .toolbar > span {
    font-size: 12px;
  }
  .rule-name {
    font-size: 17px;
  }
  .actions button {
    font-size: 13px;
  }
  .page-header .muted {
    font-size: 13px;
  }
}
