:root { font: 16px/1.5 system-ui, sans-serif; color: #20221c; background: #f5f6f2; }
* { box-sizing: border-box; }
body { margin: 0; }
header { background: #151714; display: flex; justify-content: space-between; align-items: center; color: #fff; padding: 12px max(18px,calc((100% - 800px)/2)); }
header a { color: inherit; }
.brand img { display: block; width: 116px; height: auto; border-radius: 5px; background: #fff; }
main { width: min(800px, calc(100% - 32px)); margin: 34px auto; }
h1,h2,h3 { margin: 0 0 8px; line-height: 1.22; }
main > p { margin-top: 0; color: #52574d; }
.editor { margin: 18px 0; padding: clamp(15px,4vw,26px); border: 1px solid #d6dbd0; border-radius: 12px; background: white; }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
label { display: block; font-weight: 650; margin-top: 10px; }
input,textarea,button { font: inherit; }
input,textarea { width: 100%; padding: 9px; border: 1px solid #a7af9f; border-radius: 6px; color: inherit; background: #fff; }
textarea { resize: vertical; }
.measurements { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-bottom: 10px; }
img { max-width: 100%; }
.editor img { display: block; background: #edf0e9; border-radius: 7px; object-fit: contain; margin-block: 8px; }
button { margin: 12px 6px 0 0; min-height: 44px; padding: 8px 14px; background: #a3c236; border: 1px solid #809d25; border-radius: 7px; font-weight: 700; color: #151714; cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
button.secondary { background: white; }
:focus-visible { outline: 3px solid #58710e; outline-offset: 2px; }
#review { margin-top: 12px; padding: 12px; border: 1px solid #a7af9f; border-radius: 8px; }
#preview-text { white-space: pre-wrap; }
#status { margin-bottom: 0; }
#status:empty { display: none; }
[hidden] { display: none !important; }
select { font: inherit; width: 100%; padding: 9px; border: 1px solid #a7af9f; border-radius: 6px; background: #fff; color: inherit; }
.editor-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 12px; }
.editor h3 { margin-top: 20px; }
.editor summary { cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 19px; height: 19px; margin: 0; }
.variant-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(130px,auto); align-items: center; gap: 5px 12px; margin-bottom: 7px; }
#catalog-status { margin-bottom: 0; color: #52574d; }
#catalog-status:empty { display: none; }
#history { padding-inline-start: 22px; }
#history li + li { margin-top: 10px; }
@media (max-width: 540px) {
  .editor-grid, .variant-row { grid-template-columns: 1fr; }
  .measurements { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.family-actions { display: flex; flex-wrap: wrap; }
.family-sessions { margin: 0; padding: 0; list-style: none; }
.family-sessions li { padding: 10px 0; border-top: 1px solid #d6dbd0; }
.family-sessions li > p { margin: 0; overflow-wrap: anywhere; }
.family-sessions button { margin-top: 6px; }
.access-code { font-family: ui-monospace, monospace; letter-spacing: .045em; }
#family-new-password { width: min(100%, 27ch); }
#family-secret { margin-top: 14px; padding: 14px; border: 1px solid #a7af9f; border-radius: 8px; }
#family-secret p { margin-top: 0; }
#family-status:empty { display: none; }
#family-signout { margin: 0; }

.panel-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.panel-nav a {
  padding: 7px 12px;
  border: 1px solid #bdc6b7;
  border-radius: 7px;
  background: white;
  color: #2c3428;
  font-weight: 650;
  text-decoration: none;
}
.panel-nav a[aria-current="page"] { border-color: #809d25; background: #e7efcc; }
.stats-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.stats-toolbar label, .stats-toolbar button { margin: 0; }
.stats-toolbar select { min-width: 10rem; }
.stats-note { color: #4e5849; font-size: .9rem; }
.stats-tiles, .stats-grid { display: grid; gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.stats-tiles { grid-template-columns: repeat(4,minmax(0,1fr)); }
.stats-tiles > div { padding: 12px; border: 1px solid #dbe1d4; border-radius: 8px; background: #f5f7f0; }
.stats-tiles dt { font-size: .9rem; font-weight: 600; }
.stats-tiles dd { margin: 3px 0 0; font-size: clamp(1.4rem,4vw,1.85rem); font-weight: 750; color: #35471d; }
.stats-scroll { overflow: auto; max-height: 22rem; border: 1px solid #dbe1d4; border-radius: 8px; }
.stats-table { border-collapse: collapse; width: 100%; text-align: left; font-size: .9rem; }
.stats-products { min-width: 350px; }
.stats-table th, .stats-table td { padding: 8px 10px; border-bottom: 1px solid #e4e8df; }
.stats-table thead th { position: sticky; top: 0; background: #f5f7f0; }
.stats-table th[scope="row"] { font-weight: 550; }
.stats-table td:not(:first-child), .stats-table th[scope="col"]:not(:first-child) { text-align: right; }
.stats-table meter { display: block; width: min(100%, 7rem); margin-left: auto; }
.stats-sort { margin: 0 0 8px; width: min(100%, 16rem); font-size: .9rem; }
.stats-list { margin: 0; }
.stats-list > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid #e4e8df; }
.stats-list dd { margin: 0; font-weight: 650; }
@media (max-width: 650px) {
  .stats-tiles { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 470px) {
  .stats-grid { grid-template-columns: 1fr; gap: 0; }
}
