* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f6f7f3;
  color: #1d2925;
  font:
    14px Arial,
    sans-serif;
}
header {
  background: #162d26;
  color: white;
  padding: 24px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  gap: 17px;
  align-items: center;
  font-size: 12px;
  letter-spacing: 1.8px;
  line-height: 1.8;
}
.mark {
  font-size: 34px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -2px;
  border-right: 1px solid #64776e;
  padding-right: 20px;
}
.brand small {
  font-size: 9px;
  color: #c0d0c6;
}
.edition {
  font-size: 11px;
  letter-spacing: 2px;
  color: #b8c8bc;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 50px 5%;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #657b60;
}
h1 {
  font:
    46px Georgia,
    serif;
  letter-spacing: -1.8px;
  margin: 14px 0;
}
.sub {
  color: #69756d;
  max-width: 620px;
  line-height: 1.7;
}
.stat {
  min-width: 170px;
  border-left: 1px solid #cfd8ce;
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat strong {
  font:
    56px Georgia,
    serif;
}
.stat span {
  font-size: 12px;
  color: #69756d;
}
.controls {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr 1fr 0.7fr 1.2fr;
  gap: 14px;
  background: white;
  padding: 22px;
  border: 1px solid #dce2d9;
  border-radius: 9px;
}
label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  color: #6a766d;
}
input,
select {
  width: 100%;
  margin-top: 9px;
  padding: 12px 10px;
  border: 1px solid #d9dfd5;
  border-radius: 4px;
  background: #fafbf8;
  font: 13px Arial;
  color: #21392e;
}
input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid #62825a;
  outline-offset: 2px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 26px 0 16px;
}
.toolbar > div {
  display: flex;
  gap: 7px;
}
button {
  font: 12px Arial;
  cursor: pointer;
  background: white;
  color: #35493e;
  border: 1px solid #d5ded3;
  border-radius: 5px;
  padding: 10px 14px;
}
button.active {
  background: #264b3b;
  color: white;
  border-color: #264b3b;
}
#count {
  font-size: 12px;
  color: #68766d;
}
.catalog {
  overflow: auto;
  background: white;
  border: 1px solid #dce2d9;
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
  text-align: left;
}
th {
  font-size: 10px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #657568;
  padding: 17px 14px;
  background: #edf1e9;
  white-space: nowrap;
}
td {
  padding: 17px 14px;
  border-top: 1px solid #edf0e9;
  vertical-align: middle;
  font-size: 12px;
  line-height: 1.65;
}
td:first-child {
  font-family: monospace;
  color: #587047;
  font-size: 13px;
  max-width: 150px;
  overflow-wrap: anywhere;
}
.product {
  display: flex;
  gap: 15px;
  align-items: center;
  min-width: 260px;
}
.product img {
  width: 76px;
  height: 60px;
  object-fit: contain;
  background: #f8f9f5;
  border: 1px solid #eff1eb;
  border-radius: 4px;
}
.open-detail {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.detail-thumb {
  flex: none;
  line-height: 0;
}
.detail-thumb:hover img {
  border-color: #9fb0c0;
}
.detail-name:hover strong,
.detail-name:focus-visible strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.product strong {
  font-size: 13px;
  display: block;
  font-weight: 600;
}
.product small {
  display: block;
  color: #7c867e;
  font-size: 10px;
  margin-top: 3px;
}
td .muted {
  color: #8d968d;
}
tr:hover {
  background: #fafcf7;
}
.open {
  padding: 8px 10px;
  white-space: nowrap;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 25px;
}
.pagination span {
  font-size: 12px;
  color: #6e786c;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
.notes {
  margin-top: 30px;
  border-top: 1px solid #d6dfd2;
  padding-top: 25px;
  color: #74806f;
  font-size: 12px;
  line-height: 1.8;
  max-width: 1050px;
}
.notes h2 {
  font-size: 14px;
  color: #344b38;
}
.notes a {
  color: #365b42;
  margin-right: 22px;
}
footer {
  padding: 25px 5%;
  background: #162d26;
  color: #d3ddd1;
  font-size: 10px;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
}
dialog {
  border: 0;
  border-radius: 12px;
  width: min(920px, 94vw);
  max-height: 90vh;
  padding: 36px;
  color: #20382c;
  background: #fafbf8;
}
dialog::backdrop {
  background: #0a1c17b8;
}
#close {
  position: absolute;
  right: 15px;
  top: 12px;
  font-size: 24px;
  border: 0;
  background: none;
}
dialog h2 {
  font: 30px Georgia;
  margin: 12px 0;
}
dialog .sku {
  font-family: monospace;
  color: #657c53;
}
.gallery {
  display: flex;
  overflow: auto;
  gap: 12px;
  margin: 25px 0;
}
.gallery img {
  width: 240px;
  height: 180px;
  object-fit: contain;
  background: white;
  border: 1px solid #e0e6dc;
}
.specgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #dce4d6;
  border: 1px solid #dce4d6;
  margin: 20px 0;
}
.specgrid div {
  background: #f6f8f0;
  padding: 14px;
}
.specgrid small {
  display: block;
  font-size: 10px;
  color: #74816c;
  margin-bottom: 7px;
}
.description {
  white-space: pre-line;
  line-height: 1.8;
  font-size: 13px;
}
dialog table {
  min-width: 0;
  font-size: 12px;
}
dialog a {
  color: #365d3e;
}
#empty {
  padding: 40px;
  text-align: center;
}
@media (max-width: 800px) {
  main {
    padding: 28px 4%;
  }
  h1 {
    font-size: 35px;
  }
  .stat {
    display: none;
  }
  .controls {
    grid-template-columns: 1fr 1fr;
    padding: 15px;
  }
  .search {
    grid-column: 1/-1;
  }
  .intro {
    margin-bottom: 25px;
  }
  .edition {
    display: none;
  }
  .toolbar {
    gap: 12px;
    align-items: flex-start;
  }
  .toolbar button {
    padding: 9px;
  }
  footer {
    gap: 20px;
  }
  .specgrid {
    grid-template-columns: 1fr 1fr;
  }
  dialog {
    padding: 25px;
  }
  .brand {
    font-size: 10px;
  }
}

.guide-section {
  margin: 25px 0;
  padding: 20px;
  background: #edf2e7;
  border: 1px solid #d2ddc8;
  border-radius: 7px;
}
.guide-section p {
  font-size: 12px;
  line-height: 1.7;
}
.guide-layout {
  margin: 20px 0;
}
.guide-layout h4 {
  font-size: 14px;
  margin-bottom: 10px;
}
.guide-layout h4 small {
  display: block;
  font-size: 11px;
  color: #6d7b64;
  font-weight: 400;
  margin-top: 7px;
}
.guide-table {
  overflow: auto;
}
.guide-table table {
  min-width: max-content;
  width: auto;
  background: white;
}
.guide-table th,
.guide-table td {
  padding: 10px 13px;
  white-space: nowrap;
  text-align: center;
}

.layout-status {
  font-weight: 600;
  color: #375b35;
}
.planner {
  border-top: 1px solid #cad8bd;
  margin-top: 25px;
  padding-top: 18px;
}
.planner summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.planner-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 20px 0;
}
.planner-fields input {
  background: white;
}
.planner button {
  background: #244b38;
  color: white;
}
.planner input {
  letter-spacing: 0;
  text-transform: none;
}
#planResult {
  margin-top: 20px;
}
@media (max-width: 600px) {
  .planner-fields {
    grid-template-columns: 1fr;
  }
}

.app-actions {
  display: flex;
  gap: 10px;
}
.app-actions button {
  background: #29483b;
  border-color: #6f8875;
  color: white;
}
.app-info {
  display: flex;
  justify-content: space-between;
  color: #6b7d62;
  font-size: 11px;
  gap: 15px;
  margin-bottom: 20px;
}
.dialog-close {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  background: transparent;
  font-size: 24px;
}
#installHelp p {
  line-height: 1.8;
}
#appMessage:empty {
  display: none;
}
#appMessage {
  background: #e4eedc;
  padding: 12px;
  color: #355a31;
  border-radius: 5px;
  font-size: 13px;
}
header {
  padding-top: max(24px, env(safe-area-inset-top));
}
footer {
  padding-bottom: max(25px, env(safe-area-inset-bottom));
}
@media (max-width: 700px) {
  header {
    align-items: flex-start;
    gap: 15px;
    flex-wrap: wrap;
    padding-left: 4%;
    padding-right: 4%;
  }
  .brand {
    flex: 1;
  }
  .app-actions {
    width: 100%;
  }
  .app-actions button {
    flex: 1;
    padding: 12px;
  }
  .catalog table {
    min-width: 0;
  }
  .catalog thead {
    display: none;
  }
  .catalog tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 15px;
    gap: 9px;
    border-bottom: 1px solid #dde5d8;
  }
  .catalog td {
    border: 0;
    padding: 0;
    min-width: 0;
    font-size: 12px;
  }
  .catalog td:first-child {
    max-width: none;
    grid-column: 1/-1;
    font-weight: bold;
  }
  .catalog td:first-child:before {
    content: "SKU # ";
    color: #6f7f67;
    font-weight: normal;
  }
  .catalog td:nth-child(2) {
    grid-column: 1/-1;
    margin-bottom: 6px;
  }
  .product {
    min-width: 0;
  }
  .product img {
    width: 90px;
    height: 65px;
  }
  .catalog td:nth-child(3):before {
    content: "Length: ";
    color: #788671;
  }
  .catalog td:nth-child(6):before {
    content: "Pieces: ";
    color: #788671;
  }
  .catalog td:nth-child(7) {
    color: #687c59;
  }
  .catalog td:last-child {
    grid-column: 1/-1;
  }
  .catalog .open {
    width: 100%;
    padding: 12px;
  }
  .toolbar {
    align-items: center;
    flex-wrap: wrap;
  }
  .intro h1 {
    font-size: 34px;
  }
}

.stock-notice {
  padding: 13px 16px;
  background: #eaf1e2;
  border: 1px solid #d6e2c8;
  border-radius: 6px;
  color: #526b43;
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 20px;
}
.stock-notice.stock-stale {
  background: #fff7e9;
  border-color: #e9d5b4;
  color: #81683e;
}
.stock-detail-date {
  font-size: 11px;
  color: #6e7e65;
  line-height: 1.7;
}

/* NFC storefront identity: original wordmark and water background. */
body {
  background: #f4f5f6;
  color: #172c3e;
}
header {
  background: #a5a7a8;
  border-bottom: 1px solid #8e9397;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.brand-logo {
  display: block;
  width: 360px;
  max-width: 70vw;
  height: auto;
  object-fit: contain;
}
.brand-caption {
  font-size: 9px;
  letter-spacing: 2px;
  color: #152e44;
}
.app-actions button {
  background: #112d46;
  border-color: #112d46;
}
.intro {
  background: #132d47 url("./brand/nfc-water-background.jpg") center 65% / cover;
  color: white;
  border-radius: 10px;
  padding: 36px;
  margin-top: 24px;
  min-height: 230px;
}
.intro .eyebrow,
.intro .sub,
.intro .stat span {
  color: #e3edf5;
}
.intro .stat {
  border-color: #96afc3;
}
.intro h1 {
  color: white;
}
footer {
  background: #132d47 url("./brand/nfc-water-background.jpg") center 80% / cover;
  color: #e3edf5;
}
.notes {
  color: #566674;
}
.notes h2,
.notes a {
  color: #173f60;
}
button.active {
  background: #173f60;
  border-color: #173f60;
}
th {
  background: #edf1f5;
  color: #3f5b70;
}
@media (max-width: 700px) {
  .brand-logo {
    width: 300px;
    max-width: 90vw;
  }
  .intro {
    padding: 24px 20px;
    min-height: 220px;
  }
  .brand-caption {
    font-size: 8px;
  }
}

.community-section {
  margin: 25px 0;
  padding: 20px;
  background: #f0f4f7;
  border: 1px solid #d3dfe8;
  border-radius: 7px;
}
.community-section p {
  font-size: 12px;
  line-height: 1.7;
}
.community-references {
  padding-left: 20px;
}
.community-references li {
  padding: 10px 0;
}
.community-references small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #526879;
}
.community-search {
  display: inline-block;
  margin: 8px 0;
  font-weight: 600;
  font-size: 12px;
}
.community-note,
.community-empty {
  color: #586b79;
}

.community-measurements {
  margin: 18px 0;
  border: 1px solid #cad8e3;
  border-radius: 5px;
  background: white;
  padding: 14px;
}
.community-measurements summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #173f60;
}
.community-measurements .guide-table {
  margin-top: 16px;
}
.community-measurements .guide-table th,
.community-measurements .guide-table td {
  font-size: 11px;
  text-align: left;
}

.purchase-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #e8f1f8;
  border: 1px solid #b6cddf;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}
.purchase-panel small {
  display: block;
  color: #526c80;
  font-size: 11px;
}
.purchase-panel strong {
  display: block;
  font-size: 28px;
  color: #123c5d;
  margin: 7px 0;
}
.purchase-panel p {
  font-size: 11px;
  color: #526c80;
  margin: 0;
  line-height: 1.6;
}
a.buy-link {
  display: inline-block;
  background: #124e77;
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 5px;
  padding: 13px 17px;
  text-align: center;
}
.row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 125px;
}
.row-actions .buy-link {
  font-size: 11px;
  padding: 10px;
}
.catalog-price {
  white-space: nowrap;
  font-weight: 600;
  color: #173f60;
}
@media (max-width: 700px) {
  .purchase-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .purchase-panel .buy-link {
    width: 100%;
    padding: 15px;
  }
  .catalog td:nth-child(8):before {
    content: "Price: ";
    font-weight: 400;
    color: #788671;
  }
  .catalog td:nth-child(8) {
    grid-column: 1/-1;
  }
  .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .row-actions .buy-link {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.new-blank-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #165a3a;
  background: #e0f3e7;
  border: 1px solid #aad7b9;
  border-radius: 4px;
  padding: 2px 6px;
  margin: 5px 0;
}
