@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* theme: light */
:root {
  color-scheme: light;
  --ink: #143d2f;
  --deep: #0d2a20;
  --link: #2c6a54;
  --white: #ffffff;
  --heading: #143d2f;
  --header-bg: #ffffff;
  --header-fg: #143d2f;
  --header-sub: #4b5563;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --line: #e5e7eb;
  --line-strong: #e5e7eb;
  --fg: #1f2937;
  --body: #374151;
  --muted: #4b5563;
  --primary: #143d2f;
  --primary-fg: #ffffff;
  --focus: #143d2f;
  --header-focus: #143d2f;
  --control-border: #6b7280;
  --err: #991b1b;
  --err-bg: #fef2f2;
  --warn: #92400e;
  --warn-bg: #fffbeb;
  --info: #1f2937;
  --info-bg: #f3f4f6;
  --ok: #143d2f;
  --ok-bg: #f3f4f6;
  --font-ui: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; background: #ffffff; }
html { overflow-x: clip; }
body {
  background: #ffffff;
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: clip;
}
main, .wrap, .editor, .preview, .panel, .top { background: #ffffff; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.top :focus-visible { outline-color: var(--header-focus); }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg, video { max-width: 100%; }

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(-160%);
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 20;
}
.skip:focus { transform: none; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header-bg);
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.top-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
  max-width: 1500px;
  margin: 0 auto;
}
.brand { min-width: 0; }
.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--header-fg);
}
.brand p {
  margin: 2px 0 0;
  color: var(--header-sub);
  font-size: 13px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.menu { position: relative; }
.menu > summary {
  list-style: none;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 220px;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 17, 19, 0.08);
}
.menu-panel button {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--fg);
  font-weight: 600;
  min-height: 40px;
  padding: 8px 10px;
  cursor: pointer;
}
.menu-panel button:hover { background: var(--surface-2); }
#examplesMenu .menu-panel { left: 0; right: auto; }
#fileMenu .menu-panel { right: 0; left: auto; }
.menu-panel { max-width: calc(100vw - 24px); }

.btn {
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--fg);
  border-radius: 6px;
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.btn.primary:hover { background: var(--deep); border-color: var(--deep); filter: none; }
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  min-height: 36px;
  min-width: 36px;
}
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }

select.inp, input.inp, textarea.inp {
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--fg);
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 0;
  min-height: 34px;
  font-size: 14px;
  width: 100%;
}
textarea.inp { resize: vertical; line-height: 1.4; }
select.inp { width: auto; max-width: 100%; }
.color-input { height: 40px; padding: 4px; width: 100%; }
::placeholder { color: var(--muted); opacity: 1; }

.banner-wrap { max-width: 1500px; margin: 0 auto; padding: 12px 16px 0; }
.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--link);
  border-radius: 8px;
  padding: 12px 14px;
}
.banner p { margin: 0; max-width: 78ch; color: var(--body); }

.wrap {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  display: grid;
  grid-template-columns: minmax(340px, 560px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.editor, .preview, .panel, .paperwrap, .win { min-width: 0; max-width: 100%; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.panel > h2, .panel summary, .panel-head h2, .panel-more > summary {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--heading);
  margin: 0;
  padding: 12px 14px;
}
.panel-more > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  border-top: 1px solid var(--line);
}
.panel-more > summary::-webkit-details-marker { display: none; }
.panel-more > summary::after {
  content: "Show";
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--link);
  font-size: 14px;
}
.panel-more[open] > summary::after { content: "Hide"; }
.panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}
.panel summary::-webkit-details-marker { display: none; }
.panel summary::after {
  content: "Show";
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--link);
  font-size: 14px;
}
details[open] > summary::after { content: "Hide"; }
.h2-note { font-weight: 500; text-transform: none; letter-spacing: 0; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
}
.panel-head h2 { padding: 0; }
.fold {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.fold:hover { background: var(--surface-2); }
.fold h2 { padding: 0; }
.fold-word {
  margin-left: auto;
  color: var(--link);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.chev {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -4px;
}
.fold[aria-expanded="false"] .chev {
  transform: rotate(-45deg);
  margin-top: 0;
}
.pbody { padding: 0 14px 14px; display: grid; gap: 12px; }
.help-body p, .help-body li { color: var(--body); margin: 0; }
.help-body { gap: 8px; }
.help-body ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; }
.help-body code, .hint code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-2);
  padding: 0 4px;
  border-radius: 3px;
}
.field { display: grid; gap: 4px; }
.field > span:first-child { font-size: 13px; color: var(--fg); font-weight: 600; }
.field-help { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks-col { align-content: end; gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 32px; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--link); }

.editor { display: grid; gap: 10px; }
.winlist { display: grid; gap: 6px; padding: 0 8px 8px; }
.win {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
  background: var(--surface);
}
.win.accent { border-left-width: 3px; border-left-style: solid; }
.win.flash { box-shadow: 0 0 0 3px var(--link); }
.win-head.single {
  display: grid;
  grid-template-columns: minmax(8.5rem, 12rem) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.sw { width: 12px; height: 12px; border-radius: 3px; }
.win-tools { display: flex; flex-wrap: wrap; gap: 2px; }
.cov-head {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}
.win-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.win-toggle:hover { background: var(--surface-2); }
.win-toggle .fold-word { font-size: 13px; }
.win-sum {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.cov-title { font-size: 14px; font-weight: 700; color: var(--fg); white-space: nowrap; }
.cov-sum {
  margin-right: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.days {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}
.days label, .trow-times label {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.days input, .days select, .trow-times input, .covgrid input, .mono {
  font-family: var(--font-mono);
  font-size: 15px;
  width: 100%;
}
.field select.inp, .field > input.inp, .field > textarea.inp { width: 100%; }
.trow-top .btn { flex: 0 0 auto; }
.hint { font-size: 13px; color: var(--body); padding: 0 14px 10px; margin: 0; }
.cov-hint { margin: 0; font-size: 13px; color: var(--body); }

.covgrid {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) minmax(3.4rem, 4.8rem) minmax(3.4rem, 4.8rem) 2.75rem;
  gap: 6px;
  align-items: center;
}
.covhead { font-size: 12px; color: var(--muted); font-weight: 600; }
.covrows { display: grid; gap: 3px; }
.covdot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.covadd { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.crow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  padding: 1px 0 1px 6px;
  border-left: 3px solid transparent;
}
.crow .kind { width: 10.5rem; flex: 0 0 auto; }
.crow .nm { flex: 1 1 4.5rem; min-width: 0; width: auto; }
.crow .time {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.crow .time input { width: 4.2rem; }
.crow .btn { flex: 0 0 auto; }
.cens { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.cens-title { font-size: 13.5px; font-weight: 700; }
.cens-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: center; }

.preview { display: grid; gap: 14px; position: sticky; top: 84px; }
#review { display: grid; gap: 14px; min-width: 0; }
.paperwrap { overflow-x: auto; padding: 8px 12px; background: transparent; }
.paper {
  background: #ffffff;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  width: 85%;
  min-width: 544px;
  margin-inline: auto;
}
.paper svg { display: block; width: 100%; height: auto; }
.paper svg [data-i] { cursor: pointer; }
.exportbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 4px 12px 12px;
  background: var(--surface);
}
.exportbar .lbl { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.exportbar select.inp { width: auto; }

.checks { display: grid; gap: 6px; padding: 0 14px 14px; }
.chk {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fg);
}
.chk[data-i] { cursor: pointer; }
.chk .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 1px;
  background: transparent;
}
.chk code { font-family: var(--font-mono); font-size: 13px; }
.chk.err { background: var(--err-bg); }
.chk.err .tag { color: var(--err); border: 1px solid var(--err); }
.chk.warn { background: var(--warn-bg); }
.chk.warn .tag { color: var(--warn); border: 1px solid var(--warn); }
.chk.info { background: var(--info-bg); }
.chk.info .tag { color: var(--info); border: 1px solid var(--info); }
.chk.ok { background: var(--ok-bg); }
.chk.ok .tag { color: var(--ok); border: 1px solid var(--ok); }
.chk b { font-weight: 700; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }

.methods { padding: 0 14px 14px; }
.methods p { margin: 0; max-width: 75ch; font-size: 15px; line-height: 1.6; color: var(--body); white-space: pre-wrap; }

footer {
  max-width: 1500px;
  margin: 0 auto;
  padding: 4px 16px 32px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 8px;
}
footer p { margin: 0; max-width: 110ch; }
footer b { color: var(--fg); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  max-width: calc(100% - 32px);
  z-index: 30;
}
.toast.show { opacity: 1; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .top { position: static; }
  .preview { position: static; }
}
@media (max-width: 700px) {
  .btn, .top .btn, select.inp, input.inp, textarea.inp, .panel summary { min-height: 44px; font-size: 16px; }
  .btn.ghost { min-width: 44px; min-height: 44px; }
  .check { min-height: 44px; }
  .row2, .cens-opts, .days { grid-template-columns: 1fr 1fr; }
  .win-head.single { grid-template-columns: minmax(0, 1fr); }
  .win-toggle { min-height: 44px; }
  .crow .nm { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
