:root {
  --cell-size: 24px;
  --green: #234b35;
  --green-dark: #183625;
  --soft: #eef2ee;
  --line: #d8ded4;
  --text: #203d25;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--soft);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
}

header {
  background: var(--green);
  color: #fff;
  padding: 12px 0;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: bold;
}

.element {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
}

.element small {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.78);
}

.element strong {
  font-size: 20px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.navlinks a {
  padding: 10px 12px;
  border-radius: 999px;
}

.navlinks a:hover,
.navlinks a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

main {
  padding: 12px 0 0;
}

.app-shell {
  padding-bottom: 20px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 12px;
  background: var(--green);
}

.tab-button {
  width: auto;
  min-height: 38px;
  padding: 9px 14px;
  margin: 0;
  border-radius: 10px;
  background: #ffffff22;
  color: #fff;
  border: 1px solid #ffffff33;
}

.tab-button.active,
.tab-button:hover {
  background: #fff;
  color: var(--green);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.designer-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
}

.panel {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 2px 10px #0001;
}

.inline-editor-panel {
  box-shadow: none;
  border: 1px solid var(--line);
  margin: 4px 0;
  background: #fff;
}

.editor-row td {
  background: #f8faf7;
  padding: 10px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-heading button {
  width: auto;
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-top: 8px;
  font-weight: bold;
}

input,
select,
button,
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  min-height: 44px;
  font: inherit;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

button {
  background: var(--green);
  color: #fff;
  font-weight: bold;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button.secondary {
  background: #f3f7f0;
  color: var(--green);
  border: 1px solid var(--line);
}

button.danger {
  background: #8a2c2c;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--green);
  font-weight: bold;
  background: #f8faf7;
}

.inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-actions button {
  width: auto;
  min-height: 34px;
  padding: 7px 10px;
  margin: 0;
  border-radius: 8px;
}

.muted {
  color: #5f7564;
  font-size: 0.92rem;
}

.hidden {
  display: none !important;
}

.status {
  min-height: 22px;
  margin-top: 8px;
  color: #2f6b43;
  font-weight: bold;
}

.color-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.plant-pick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.plant-picker {
  position: relative;
}

.plant-picker select {
  display: none;
}

.plant-picker-button {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  text-align: left;
  background: #f3f7f0;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: normal;
}

.plant-picker-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  flex: 0 0 auto;
}

.plant-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 22px #0002;
  padding: 4px;
  margin: 0;
  list-style: none;
}

.plant-picker-menu[hidden] {
  display: none;
}

.plant-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  border: 0;
  font-weight: normal;
  text-align: left;
}

.plant-picker-option:hover,
.plant-picker-option.active {
  background: #f3f7f0;
}

.swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.swatches span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.color-chip span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: inline-block;
}

#wall {
  display: grid;
  grid-template-columns: repeat(26, var(--cell-size));
  grid-template-rows: repeat(13, var(--cell-size));
  gap: 1px;
  background: #999;
  padding: 8px;
  width: auto;
  border-radius: 10px;
  justify-self: center;
}

.plant-list {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #f3f7f0;
  color: #203d25;
  font-size: 0.95rem;
  min-height: 72px;
}

.plant-swatch {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.plant-swatch span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.plant-legend {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: #f8faf7;
  color: #203d25;
  font-size: 0.95rem;
}

.plant-legend table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.plant-legend th,
.plant-legend td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #d8ded4;
}

.plant-legend th {
  font-weight: bold;
}

.plant-swatch-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border: 1px solid #0002;
  position: relative;
}

.cell .print-block {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  background-color: currentColor;
  opacity: 0.95;
}

.cell::after {
  content: attr(data-initial);
  display: none;
  position: absolute;
  inset: 0;
  font-size: 0.08in;
  line-height: var(--cell-size);
  text-align: center;
  color: #000;
}

.site-footer {
  padding: 20px 0 28px;
  text-align: center;
  color: #5f7564;
  font-size: 0.9rem;
}

.site-footer-content {
  display: grid;
  gap: 6px;
}

@media (max-width: 900px) {
  .designer-layout {
    grid-template-columns: 1fr;
  }

  .panel {
    width: 100%;
  }

  #wall {
    justify-self: center;
  }
}

@media (max-width: 700px) {
  :root {
    --cell-size: 18px;
  }

  .button-row,
  .color-row,
  .plant-pick-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-shell {
    justify-content: center;
  }

  .navlinks {
    justify-content: center;
  }
}

@media (max-width: 500px) {
  :root {
    --cell-size: 14px;
  }
}

@media print {
  :root {
    --cell-size: 0.26in;
  }

  body {
    background: #fff;
  }

  header,
  .site-footer,
  .tab-panel:not(#designerTab),
  #designerTab .panel:first-child,
  .tabs {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .wrap {
    width: auto;
    margin: 0;
  }

  .tab-panel {
    display: none !important;
  }

  #designerTab {
    display: block !important;
  }

  .designer-layout {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  .panel {
    box-shadow: none;
    border: none;
  }

  #wall {
    display: grid !important;
    width: auto;
    margin: 0;
    padding: 0;
    gap: 1px;
    background: #999 !important;
  }

  .plant-list,
  .button-row {
    display: none;
  }

  .cell {
    border: 1px solid #000;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    background-color: transparent !important;
    color: inherit !important;
  }

  .cell .print-block {
    display: block;
  }

  .cell::after {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.08in;
  }

  #legend {
    page-break-after: auto;
  }

  .plant-legend table {
    font-size: 10px;
  }
}
