/* «Декор, приносящий прибыль»: the calculator, the top lists and the tables above the hub.
   Panels, fields and tables come from site.css (.zg-bonus, .zg-profit-*), the result grid
   from territory.css rules repeated here (.zg-terr-list). */
.zg-decor h2:not(:first-child) { margin-top: 30px; }
.zg-decor h3 { margin: 24px 0 8px; font: bold 20px/1.3 Georgia, "Times New Roman", serif; }
.zg-decor-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 0; }
.zg-decor-form[hidden], .zg-decor-form [hidden] { display: none; }
.zg-decor-pick { grid-column: span 2; }
.zg-decor-add { display: flex; align-items: flex-end; }
.zg-site .zg-decor-add button, .zg-site .zg-decor-remove {
  min-height: 48px; padding: 10px 22px; border: 2px solid #3d5d29; border-radius: 9px;
  color: #fffcef; background: var(--zg-button-fill); box-shadow: var(--zg-button-shadow); font-size: 15px; font-weight: 600;
}
.zg-site .zg-decor-add button { width: 100%; }
.zg-site .zg-decor-add button:hover { background: var(--zg-green-dark); }
.zg-site .zg-decor-add button:disabled { opacity: .55; cursor: default; }
.zg-site .zg-decor-none { margin: 6px 0 0; color: #8a4b12; font-size: 14px; }
.zg-site .zg-decor-list { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.zg-site .zg-decor-list:empty { display: none; }
.zg-decor-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name count remove" "gives gives gives"; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid #eadfbe; border-radius: 10px; background: #fffef9; }
.zg-decor-name { grid-area: name; font-weight: 700; }
.zg-decor-count { grid-area: count; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.zg-site .zg-decor-count input { width: 84px; min-height: 40px; padding: 6px 10px; border: 2px solid #c3b17e; border-radius: 8px; color: var(--zg-ink); background: #fffef9; font-size: 16px; }
.zg-decor-gives { grid-area: gives; color: var(--zg-muted); font-size: 14px; }
.zg-site .zg-decor-remove { grid-area: remove; min-height: 40px; padding: 6px 12px; border-color: #c3b17e; color: var(--zg-ink); background: #f4ecd0; box-shadow: none; font-size: 14px; }
.zg-site .zg-decor-remove:hover { background: #eadfbe; }
.zg-site .zg-decor-result { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--zg-line); border-radius: 10px; background: #fffef9; }
.zg-decor-result p { margin: 0 0 8px; }
.zg-decor-result p:last-child { margin-bottom: 0; }
.zg-site .zg-decor-answer { font: bold 20px/1.3 Georgia, "Times New Roman", serif; }
.zg-site .zg-decor-hint { color: var(--zg-muted); }
.zg-site .zg-terr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.zg-terr-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid #eadfbe; border-radius: 8px; background: var(--zg-paper); }
.zg-terr-list strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.zg-site .zg-terr-gap { color: #8a4b12; }
.zg-site .zg-decor-extras { margin: 0 0 10px; padding-left: 20px; }
.zg-decor-tops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.zg-decor-top { padding: 12px 14px; border: 1px solid #eadfbe; border-radius: 10px; background: #fffef9; }
.zg-decor .zg-decor-top h3 { margin: 0 0 8px; font-size: 17px; }
.zg-decor-top ol { margin: 0; padding-left: 22px; font-size: 14px; line-height: 1.45; }
.zg-decor-top li { margin: 0 0 4px; }
.zg-decor-top li span { color: var(--zg-muted); white-space: nowrap; }
.zg-site .zg-decor-sections { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.zg-decor-sections a { padding: 6px 10px; border: 1px solid #d9c690; border-radius: 999px; background: #fffef9; font-size: 14px; }
.zg-decor .zg-profit-scroll { margin-top: 8px; }
/* The archive stylesheet turns every table of an archive page into a scrolling block;
   these tables scroll inside their own frame instead. */
.zg-archive #content .zg-decor table { display: table; width: 100% !important; margin: 0; overflow: visible; }
.zg-profit-table.zg-decor-table { min-width: 0; }
.zg-decor-table td { white-space: normal; }
.zg-decor-table td small { display: block; margin-top: 3px; color: var(--zg-muted); font-size: 12px; }
.zg-decor-table td:last-child { min-width: 120px; }
.zg-decor-table td.zg-decor-none { color: var(--zg-muted); }
.zg-decor-table tbody th { min-width: 140px; }

@media (max-width: 760px) {
  .zg-decor-form, .zg-decor-tops { grid-template-columns: minmax(0, 1fr); }
  .zg-decor-pick { grid-column: auto; }
}
/* A phone has no room for three columns: every decor becomes a short card. */
@media (max-width: 520px) {
  .zg-archive #content .zg-decor table.zg-decor-table, .zg-decor-table :is(tbody, tr, th, td) { display: block; width: auto !important; }
  .zg-decor-table thead { display: none; }
  .zg-decor-table tr { padding: 8px 10px; border-top: 1px solid #eadfbe; }
  .zg-decor-table tbody tr:first-child { border-top: 0; }
  .zg-decor-table :is(tbody th, td) { position: static; min-width: 0; padding: 2px 0; border: 0; background: none; }
  .zg-decor-table td:last-child { min-width: 0; font-weight: 600; }
  .zg-decor-table td:last-child::before { content: "За сутки: "; color: var(--zg-muted); font-weight: 400; }
  .zg-decor-table td:last-child br { display: none; }
  .zg-decor-table td:last-child small { display: inline; margin: 0 0 0 6px; font-weight: 400; }
}
@media (max-width: 420px) {
  .zg-site .zg-decor-result { padding: 12px; }
}
