:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #142f29;
  background: #f4f7f6;
  font-size: 15px;
  --border: #dbe6e1;
  --muted: #51665d;
  --accent: #126648;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem max(1rem, 4vw); background: #12352b; color: white; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.2rem; font-weight: 650; }
h2 { font-size: 1.18rem; }
h3 { font-size: 1rem; margin-top: 1.3rem; }
.topbar .quiet { margin-left: 1rem; }
main { max-width: 1480px; margin: 0 auto; padding: 1.6rem clamp(0.8rem, 3vw, 2.5rem) 3rem; }
.workspace { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); align-items: start; gap: 1.15rem; }
#configuration-dialog { width: min(66rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 0; border: 0; border-radius: 0.7rem; color: inherit; overflow: auto; }
#configuration-dialog::backdrop { background: rgb(20 47 41 / 45%); }
.main-column, .row-set, #campaign-list { display: grid; gap: 0.85rem; }
.panel { background: white; padding: 1.15rem; border: 1px solid var(--border); border-radius: 0.7rem; min-width: 0; }
.login { max-width: 26rem; margin: 12vh auto 0; }
.login form, .sidebar, .control, #configuration { display: grid; gap: 0.85rem; }
.login form { margin-top: 1rem; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; }
.subdued { color: var(--muted); margin-top: 0.3rem; }
.feedback { color: #71350e; background: #fff5df; border: 1px solid #eccfad; border-radius: 0.5rem; padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.feedback[data-tone="good"] { color: #14553c; background: #effaf2; border-color: #bfddc7; }
button, input, select { font: inherit; }
button { background: var(--accent); color: white; border: 1px solid transparent; border-radius: 0.45rem; padding: 0.47rem 0.8rem; min-height: 2.4rem; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button:disabled { cursor: default; opacity: 0.52; }
button.quiet { background: white; color: #215344; border-color: var(--border); }
button.danger { background: #9c342e; }
label { display: grid; gap: 0.34rem; color: #244337; font-size: 0.88rem; align-content: start; }
input:not([type="checkbox"]), select { background: white; min-width: 0; width: 100%; min-height: 2.4rem; padding: 0.4rem 0.55rem; color: #142f29; border: 1px solid #b8cec4; border-radius: 0.4rem; }
label.check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.4rem; }
input[type="checkbox"] { accent-color: var(--accent); }
.weekdays, .buttons { display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; }
.field-grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); align-items: end; }
fieldset { border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.8rem; min-width: 0; }
legend { font-weight: 620; padding: 0 0.3rem; }
.row { padding: 0.75rem; background: #f6faf8; border: 1px solid var(--border); border-radius: 0.45rem; }
.row-set + button { margin-top: 0.6rem; }
#configuration, .control, .filters { margin-top: 0.85rem; }
.campaign-tile { display: grid; gap: 0.25rem; text-align: left; background: #f1f7f4; border-color: var(--border); color: #1d4134; width: 100%; }
.campaign-tile[aria-pressed="true"] { background: #d9ede3; border-color: #8ebba3; }
.campaign-tile small { color: var(--muted); }
.indicators { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); border: 1px solid var(--border); }
.indicators > div { padding: 0.6rem; border: 1px solid #f3f7f4; }
.indicators dt { color: var(--muted); font-size: 0.82rem; }
.indicators dd { margin: 0.27rem 0 0; font-weight: 630; }
.table-scroll { overflow-x: auto; margin-top: 0.6rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
td, th { padding: 0.58rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f4f8f6; color: #335145; }
td small { display: block; color: var(--muted); margin-top: 0.2rem; }
.table-pages, .table-page-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.table-pages { margin-top: 0.6rem; }
.table-page-nav { color: var(--muted); }
.virtual-flyers-panel { max-width: 66rem; margin-inline: auto; }
.virtual-flyers-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.75rem; margin: 1rem 0 0.65rem; }
.virtual-flyers-tools label { flex: 1; max-width: 24rem; }
.virtual-flyers-panel .feedback { margin-bottom: 0.65rem; }
.virtual-flyers-table { table-layout: fixed; }
.virtual-flyers-table th:first-child { width: 30%; }
.virtual-flyers-table th:last-child { width: 11rem; }
.virtual-flyers-table td { vertical-align: middle; overflow-wrap: anywhere; }
.virtual-flyer-key { color: var(--muted); font-variant-numeric: tabular-nums; }
.virtual-flyer-row-error { color: #71350e; margin-top: 0.32rem; font-size: 0.82rem; }
.virtual-flyers-pages { justify-content: space-between; color: var(--muted); }
.virtual-flyers-table .buttons { gap: 0.3rem; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #578f73; outline-offset: 2px; }
@media (max-width: 520px) {
  .virtual-flyers-table th:first-child { width: 27%; }
  .virtual-flyers-table th:last-child { width: 6rem; }
}
@media (max-width: 720px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
