:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172d27;
  background: #f4f6f3;
  font-synthesis: none;
  --muted: #54675f;
  --line: #e4eae5;
  --accent: #185747;
  --pale: #e7f1eb;
}
* { box-sizing: border-box; }
body { margin: 0; }
.workspace {
  width: min(100% - 48px, 980px);
  margin: 52px auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}
.header h1 { margin: 10px 0 0; font-size: clamp(34px, 6vw, 54px); letter-spacing: -.065em; line-height: 1.12; }
.store { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .1em; font-size: 13px; }
.store span { width: 9px; height: 9px; border-radius: 50%; background: #38836f; }
.publication { display: grid; grid-template-columns: auto auto; gap: 5px 12px; align-items: center; text-align: right; }
.version-label, #published-at, #applies, #message { color: var(--muted); font-size: 13px; }
#published-at { grid-column: 1 / -1; }
#version { color: var(--accent); font-variant-numeric: tabular-nums; }
.card {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 36px #183b2610;
}
.toolbar, .footer { display: flex; gap: 14px; align-items: center; padding: 14px 20px; justify-content: space-between; flex-wrap: wrap; }
.switcher { display: inline-flex; gap: 4px; padding: 4px; background: #f2f5f2; border-radius: 12px; }
button { cursor: pointer; min-height: 42px; font: inherit; font-size: 14px; font-weight: 650; padding: 7px 14px; border: 1px solid #d6e1d9; border-radius: 9px; color: #173e32; background: #fff; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, input:focus-visible { outline: 2px solid #287761; outline-offset: 2px; }
.switcher button { border: 0; background: transparent; min-height: 38px; }
.switcher button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 4px #173e321a; }
.table-wrap { padding: 0 20px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
thead th { color: var(--muted); font-weight: 650; font-size: 13px; padding: 11px 2px; background: #f5f7f5; position: sticky; top: 0; }
th:first-child { width: 15%; text-align: left; padding-left: 14px; }
tbody th, tbody td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
tbody th { font-size: 14px; }
tbody td { text-align: center; }
input[type="number"] { appearance: textfield; display: inline-block; width: min(64px, 100%); min-height: 38px; border: 1px solid #d7e1da; background: #fff; border-radius: 8px; text-align: center; color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[type="number"]:invalid { border-color: #b84b36; }
.peak { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 38px; margin-left: 4px; padding: 0 5px; vertical-align: top; white-space: nowrap; font-size: 12px; color: var(--muted); cursor: pointer; border-radius: 8px; }
.peak:has(:checked) { color: #125542; background: var(--pale); }
.peak input { margin: 0; accent-color: var(--accent); }
#message { margin: 0; flex: 1; min-width: 120px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.text-button { border: 0; text-decoration: underline; }
dialog { width: min(100% - 32px, 520px); border: 1px solid var(--line); border-radius: 18px; padding: 24px; color: inherit; }
dialog::backdrop { background: #182b255e; }
dialog h2 { margin: 0 0 8px; }
dialog p { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
#changes { max-height: 45vh; overflow: auto; padding: 10px 12px 10px 30px; background: #f4f6f3; border-radius: 10px; }
#changes li { padding: 4px 0; font-size: 14px; }
#publish-error { color: #a13627; }
@media (max-width: 650px) {
  .workspace { width: calc(100% - 24px); margin: 26px auto; gap: 15px 8px; }
  .toolbar, .footer { padding-inline: 10px; }
  .table-wrap { padding-inline: 8px; }
  th:first-child { padding-left: 4px; width: 16%; }
  .peak { margin-left: 0; }
  .footer .actions { width: 100%; }
  thead th { font-size: 12px; }
}
.footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: #fff;
  border-top: 1px solid var(--line);
  border-radius: 0 0 18px 18px;
}
@media (max-width: 650px) {
  input[type="number"], .peak { min-height: 44px; }
}
.overall-goals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}
.overall-goals label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}
.overall-goals label span { white-space: nowrap; }
@media (max-width: 650px) {
  .overall-goals { grid-template-columns: 1fr; padding-inline: 10px; }
}
