:root {
  --bg: #f4f1ea;
  --paper: #fffcf8;
  --ink: #1c2430;
  --muted: #5d6672;
  --line: #e4ddd2;
  --pine: #0e6b52;
  --pine-dark: #0c5c44;
  --danger: #8d2f2f;
  --warn: #8a5a12;
  --warn-bg: #f8efd8;
  --ok: #0e6b52;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--pine); }
button, .button {
  font: inherit;
  background: var(--pine);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover { background: var(--pine-dark); }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.shell { min-height: 100vh; }
.side {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 16px 20px 8px;
}
.brand { color: var(--ink); font-weight: 700; font-size: 22px; text-decoration: none; }
.brand em { color: var(--pine); font-style: normal; }
.brand-note { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.side nav { display: flex; gap: 8px; overflow: auto; }
.side nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.side nav a[aria-current="page"] { background: var(--pine); color: white; }
.side-foot { display: flex; gap: 16px; align-items: center; margin-top: 10px; font-size: 14px; }
.side-foot button { background: transparent; color: var(--muted); padding: 0; }
main { padding: 24px 20px 48px; max-width: 1080px; }
.page-head.split { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.page-head.split .button { flex: 0 0 auto; text-decoration: none; }
.page-head h1 { margin: 0 0 4px; font-size: 32px; }
.page-head p { margin: 0; color: var(--muted); }
.cards, .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.cards article, .stats article, .panel, .list article, .summary, .usage {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.cards article, .stats article { padding: 16px; }
.cards span, .stats span, .summary span, .usage span { display: block; color: var(--muted); font-size: 14px; }
.cards strong, .stats strong { display: block; font-size: 28px; line-height: 1.2; }
.cards small { color: var(--muted); }
.panel { padding: 18px; margin: 12px 0 22px; }
.fields { display: grid; gap: 12px; }
.fields label { display: grid; gap: 4px; font-weight: 700; }
.fields input, .fields select {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.fields .check { grid-template-columns: 1fr auto; align-items: center; }
.fields button { justify-self: start; }
.links { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 8px; }
.switch span {
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.calm { color: var(--muted); }
.notice {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--ink);
  text-decoration: none;
}
.notice em { color: var(--pine); font-style: normal; font-weight: 700; }
.list { display: grid; gap: 10px; }
.list article, .usage { padding: 16px; }
.list h2 { margin: 0 0 4px; font-size: 20px; }
.list p { margin: 0; color: var(--muted); }
.summary {
  display: grid;
  gap: 16px;
  padding: 20px;
  margin-top: 22px;
}
.summary > div strong { font-size: 34px; }
.summary li strong { font-size: 20px; }
.summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.summary li { display: flex; justify-content: space-between; gap: 12px; }
.meter { height: 8px; border-radius: 99px; background: #e7efe9; margin-top: 10px; overflow: hidden; }
.meter span { display: block; height: 100%; width: min(var(--share), 100%); background: var(--pine); }
.limit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 16px 0;
}
.limit-form label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.limit-form input {
  font: inherit;
  width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.limit-form label span { font-weight: 400; color: var(--muted); }
.error { color: var(--danger); width: 100%; }
.warn {
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn);
}
.switch { display: flex; gap: 8px; margin: 8px 0 14px; }
.switch a {
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}
.switch a[aria-current="page"],
.switch a[aria-current="true"] { background: var(--pine); color: white; border-color: var(--pine); }
.search-row { display: flex; gap: 8px; align-items: end; margin: 18px 0; }
.search-row label { display: grid; gap: 4px; font-weight: 700; flex: 1; }
.search-row input {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.place-photo { width: 180px; height: 120px; object-fit: cover; border-radius: 10px; background: #efeae2; }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 4px; font-weight: 700; }
.stack label.check { display: flex; align-items: center; gap: 8px; }
.stack label.check input { width: auto; }
.stack input, .stack select, .stack textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.stack textarea { min-height: 140px; }
.lang-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px;
}
.lang-card.is-focus { border-color: var(--pine); background: #f3faf7; }
.lang-card textarea { width: 100%; min-height: 90px; }
.stack ul, .fields ul { list-style: none; margin: 0; padding: 0; font-weight: 400; }
.stack li, .fields li { margin: 4px 0; }
fieldset.option-block { border: 0; margin: 4px 0 0; padding: 0; min-width: 0; }
fieldset.option-block legend,
.option-heading { font-weight: 650; padding: 0; margin: 0 0 8px; }
.option-rows { max-width: 520px; margin: 0 0 4px; }
.stack label.option-row,
.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(28, 36, 48, 0.03);
  font-weight: 450;
}
.option-rows > .option-row:first-child { border-top: 1px solid var(--line); }
.option-row span { min-width: 0; font-weight: 450; }
.option-row input,
.stack label.option-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
.fields textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  min-height: 120px;
}
.errorlist { color: var(--danger); list-style: none; margin: 0; padding: 0; font-weight: 400; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.row-actions button, a.quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
}
a.quiet { display: inline-block; text-decoration: none; }
.row-actions label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.row-actions input[type="number"] {
  width: 88px;
  font: inherit;
  font-weight: 400;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.danger-button { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.cover-pick { margin: 8px 0 16px; }
.cover-pick h2 { margin: 0 0 6px; font-size: 18px; }
.help { color: var(--muted); font-size: 13px; font-weight: 400; }
.cover-current { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.cover-current img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; background: #efeae2; }
.cover-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.cover-grid[hidden], .cover-current[hidden], [data-cover-empty][hidden] { display: none; }
.cover-thumb {
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-weight: 400;
}
.cover-thumb.is-selected { border-color: var(--pine); }
.cover-thumb img { display: block; width: 100%; height: 90px; object-fit: cover; border-radius: 8px; background: #efeae2; }
.cover-thumb span { display: block; font-size: 12px; padding: 4px 2px 2px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.photo img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; background: #efeae2; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7efe9;
  color: var(--pine);
  font-size: 13px;
}
.chart {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 180px;
  margin-top: 8px;
}
.chart-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; }
.chart-bar { width: 100%; max-width: 28px; background: var(--pine); border-radius: 6px 6px 2px 2px; min-height: 0; }
.chart-col span { height: 18px; font-size: 11px; color: var(--muted); }
.usage { display: grid; gap: 2px; text-decoration: none; color: inherit; }
.usage strong { font-size: 18px; }
.usage em { font-style: normal; font-weight: 700; }
.tone-ok em { color: var(--ok); }
.tone-high em { color: #b86a12; }
.tone-limit em { color: var(--danger); }
.tone-limit { box-shadow: inset 4px 0 0 #c45b4a; }
.tone-high { box-shadow: inset 4px 0 0 #e0a15a; }
.tone-ok { box-shadow: inset 4px 0 0 #7dba9a; }
.login {
  width: min(420px, calc(100% - 32px));
  margin: 10vh auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  gap: 12px;
}
.login h1 { margin: 0; }
.login h1 em { color: var(--pine); font-style: normal; }
.login p { margin: 0; color: var(--muted); }
.login label { display: grid; gap: 6px; }
.login input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sheet { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet form { margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.guest-qr, .pay-qr { width: 180px; height: auto; background: white; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .side { border-bottom: 0; border-right: 1px solid var(--line); padding: 28px 18px; }
  .side nav { display: grid; }
  .side nav a { border-radius: 12px; }
  .side-foot { display: grid; margin-top: 28px; }
  main { padding: 36px 40px 64px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .wide, .fields h2, .fields .error, .fields button, .fields p.wide { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .summary { grid-template-columns: 1.2fr 1fr; align-items: center; }
}
.product-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 8px; }
.product-photo { width: min(240px, 100%); height: auto; border-radius: 12px; }
.flag-preview { width: 48px; height: 32px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); vertical-align: middle; }
.icon-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.icon-choice i { width: 1.4em; color: var(--pine); font-size: 20px; text-align: center; }
.icon-choice select, .icon-choice button { font: inherit; }
