     :root {
        --bg: #0b0e13;
        --panel: #141922;
        --line: #2a3341;
        --muted: #9ba9bb;
        --text: #f4f7fc;
        --red: #ed3446;
        --green: #62dfac;
      }
      * {
        box-sizing: border-box;
      }
      body {
        margin: 0;
        min-height: 100vh;
        background:
          radial-gradient(ellipse at 90% 0%, #301522 0, transparent 45%),
          var(--bg);
        color: var(--text);
        font:
          16px/1.5 system-ui,
          -apple-system,
          BlinkMacSystemFont,
          "Segoe UI",
          sans-serif;
      }
      button,
      input {
        font: inherit;
      }
      button {
        cursor: pointer;
      }
      button:focus-visible,
      input:focus-visible {
        outline: 3px solid #ff8895;
        outline-offset: 4px;
      }
      [hidden] {
        display: none !important;
      }
      .wrap {
        max-width: 1040px;
        margin: auto;
        padding: 28px 24px 56px;
      }
      header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--line);
        padding-bottom: 24px;
        gap: 16px;
      }
      
      .header-logo{
            width:510px;
        }
      .brand {
        font-size: 24px;
        font-weight: 900;
        letter-spacing: -1px;
      }
      .brand span {
        color: var(--red);
      }
      .header-note {
        font-size: 12px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 2px;
      }
      .intro {
        text-align: center;
      }
      .eyebrow {
        color: var(--red);
        font-size: 12px;
        font-weight: 750;
        letter-spacing: 3px;
        text-transform: uppercase;
        text-align:center;
      }
      h1 {
        font-size: clamp(30px, 5vw, 48px);
        line-height: 1.15;
        letter-spacing: -1.5px;
        margin: 12px 0 16px;
      }
      .intro p {
        color: var(--muted);
        margin: 0;
      }
      .search-panel {
        background: var(--panel);
        padding: 22px;
        border: 1px solid var(--line);
        border-radius: 18px;
      }
      label {
        display: block;
        margin-bottom: 10px;
        font-size: 14px;
        font-weight: 650;
      }
      .search-row {
        display: flex;
        gap: 10px;
      }
      input {
        width: 100%;
        min-width: 0;
        border: 1px solid #3b4656;
        background: #0d1119;
        border-radius: 10px;
        padding: 15px;
        color: var(--text);
      }
      .primary {
        background: var(--red);
        border: 0;
        color: white;
        border-radius: 10px;
        padding: 12px 26px;
        font-weight: 750;
      }
      .hint {
        font-size: 12px;
        color: var(--muted);
        margin: 10px 0 0;
      }
      .message {
        min-height: 25px;
        font-size: 14px;
        color: var(--muted);
        margin: 18px 2px;
      }
      .message.error {
        color: #ff9aa5;
      }
      .results {
        display: grid;
        gap: 10px;
      }
      .result {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: left;
        padding: 15px;
        border: 1px solid var(--line);
        background: var(--panel);
        border-radius: 12px;
        color: var(--text);
        width: 100%;
      }
      .result:hover {
        border-color: var(--red);
        background: #1c202b;
      }
      .thumb {
        width: 64px;
        height: 64px;
        border-radius: 9px;
        background: #242b36;
        object-fit: contain;
        flex-shrink: 0;
      }
      .placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #a2adba;
        font-size: 12px;
      }
      .result-copy {
        flex: 1;
        min-width: 0;
      }
      .result-name {
        font-size: 15px;
        font-weight: 650;
        overflow-wrap: anywhere;
      }
      .item-code {
        color: var(--muted);
        font-size: 12px;
        overflow-wrap: anywhere;
        margin-top: 5px;
      }
      .result-availability {
        display: flex;
        gap: 6px 12px;
        flex-wrap: wrap;
        margin-top: 8px;
        font-size: 12px;
        color: var(--muted);
      }
      .small-stock {
        color: var(--green);
      }
      .arrow {
        color: var(--red);
        font-size: 23px;
      }
      .detail {
        margin-top: 24px;
        border: 1px solid var(--line);
        background: var(--panel);
        border-radius: 18px;
        overflow: hidden;
      }
      .product {
        display: flex;
        gap: 26px;
        padding: 28px;
        align-items: center;
      }
      .product-image {
        width: 180px;
        height: 180px;
        background: #202733;
        border-radius: 12px;
        object-fit: contain;
        flex-shrink: 0;
      }
      .product h2 {
        font-size: 24px;
        line-height: 1.3;
        margin: 8px 0;
        overflow-wrap: anywhere;
      }
      .group {
        font-size: 12px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 2px;
      }
      .branches {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
        padding: 0 28px 28px;
      }
      .branch {
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 20px;
        background: #0f141d;
      }
      .branch-name {
        font-weight: 650;
        margin-bottom: 12px;
      }
      .badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border-radius: 99px;
        font-size: 13px;
        padding: 6px 10px;
        background: #25303d;
        color: #bdc8d6;
      }
      .badge.in {
        color: var(--green);
        background: #123c30;
      }
      .badge.out {
        color: #ff9ca6;
        background: #3c202a;
      }
      .dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: currentColor;
      }
      .detail-footer {
        border-top: 1px solid var(--line);
        padding: 14px 28px;
        color: var(--muted);
        font-size: 12px;
        display: flex;
        justify-content: space-between;
        gap: 16px;
        align-items: center;
      }
      .refresh {
        border: 1px solid var(--line);
        border-radius: 8px;
        color: var(--text);
        background: transparent;
        padding: 6px 12px;
      }
      .refresh:disabled {
        opacity: 0.5;
        cursor: wait;
      }
      .empty {
        margin-top: 24px;
        border: 1px dashed var(--line);
        border-radius: 16px;
        text-align: center;
        padding: 38px 20px;
        color: var(--muted);
      }
      .empty strong {
        display: block;
        color: var(--text);
        margin-bottom: 7px;
      }
      footer {
        color: var(--muted);
        font-size: 12px;
        margin-top: 30px;
        text-align: center;
      }
      
              .search-row {
          display: flex;
          align-items: stretch;
          gap: 10px;
        }
        
        .search-row input {
          flex: 1;
          min-width: 0;
        }
        
        #groupFilter {
          flex: 0 0 190px;
          min-width: 0;
          padding: 12px;
          border: 1px solid #3b4656;
          border-radius: 10px;
          background: #0d1119;
          color: #f4f7fc;
          font: inherit;
          cursor: pointer;
        }
        
        #groupFilter:focus-visible {
          outline: 3px solid #ff8895;
          outline-offset: 3px;
        }
        
        @media (max-width: 640px) {
          .search-row {
            flex-wrap: wrap;
          }
        
          #groupFilter {
            flex: 0 0 100%;
          }
        
          .search-row input {
            flex: 1 1 0;
          }
        }
      @media (max-width: 640px) {
        .wrap {
          padding: 22px 16px;
        }
        .header-logo{
            width:310px;
        }
        .header-note {
          display: none;
        }
        .intro {
          margin-top: 36px;
        }
        .search-panel {
          padding: 16px;
        }
        .search-row {
          gap: 8px;
        }
        .primary {
          padding: 12px 16px;
        }
        .product {
          padding: 20px;
          gap: 18px;
          align-items: flex-start;
        }
        .product-image {
          width: 90px;
          height: 90px;
        }
        .product h2 {
          font-size: 18px;
        }
        .branches {
          grid-template-columns: 1fr;
          padding: 0 20px 20px;
          gap: 10px;
        }
        .branch {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 16px;
          gap: 10px;
        }
        .branch-name {
          margin: 0;
        }
        .detail-footer {
          padding: 14px 20px;
        }
        .thumb {
          width: 48px;
          height: 48px;
        }
      }
      
/* Top-right navigation and touch-friendly mobile layout. */
.page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--red);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  touch-action: manipulation;
}
.back-button:hover {
  background: var(--red);
}
.back-button:active {
  background: #c92536;
}
.product > div {
  min-width: 0;
}
@media (max-width: 640px) {
  .wrap {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }
  .page-actions {
    margin-bottom: 24px;
  }
  .back-button {
    min-width: 88px;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .intro {
    margin-top: 0;
  }
  .eyebrow {
    letter-spacing: 1.5px;
  }
  #groupFilter,
  .search-row input,
  .primary,
  .refresh {
    min-height: 44px;
  }
}
@media (max-width: 480px) {
  .search-row {
    flex-direction: column;
  }
  #groupFilter,
  .search-row input {
    flex: 0 0 auto;
    width: 100%;
  }
  .primary {
    width: 100%;
  }
  .detail-footer {
    flex-wrap: wrap;
  }
}
