:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #5f6368;
  --line: #e5e8ea;
  --accent: #1a64a6;
  --accent-soft: #e8f1f8;
  --price: #1a64a6;
  --marker: #1a64a6;
  --sidebar: minmax(260px, 22vw);
  --chat: minmax(280px, 22vw);
  --radius: 14px;
  --shadow: 0 1px 6px rgba(32, 33, 36, 0.12);
  --shadow-hover: 0 2px 10px rgba(32, 33, 36, 0.18);
  --panel-title-size: 1rem;
  --panel-title-weight: 700;
  font-family: "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%;
  background: var(--bg); color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }

.top {
  width: 100%;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 48px 16px 40px;
}
.search-hero {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #fff;
  border: 1px solid #dfe1e5;
  border-radius: 28px;
  padding: 8px 10px 8px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.search-box:hover, .search-box:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}
.search-icon {
  color: #9aa0a6;
  display: flex;
  flex-shrink: 0;
}
.search-box input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  padding: 12px 4px;
  font-size: 1.05rem;
  color: var(--ink);
}
.search-box input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-btn {
  flex-shrink: 0;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 22px;
  padding: 11px 24px;
  cursor: pointer;
  font-weight: 650;
}
.search-btn:hover { filter: brightness(1.06); }

.layout {
  width: 100%;
  margin: 0;
  padding: 12px 12px 28px;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--chat);
  gap: 12px;
  align-items: start;
}
.sidebar, .content, .chat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  font-size: var(--panel-title-size);
  font-weight: var(--panel-title-weight);
  line-height: 1.3;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.panel-title .icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}
.panel-title .icon svg { width: 22px; height: 22px; display: block; }
.chat-panel-title {
  justify-content: space-between;
  gap: 12px;
}
.chat-panel-title .panel-title-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.chat-clear-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.chat-clear-btn svg { width: 20px; height: 20px; display: block; }
.chat-clear-btn:hover {
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
}
.chat-clear-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chat-topic-hint {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f3f7fb;
  color: var(--ink);
  font-size: .82rem;
  line-height: 1.4;
}
.chat-topic-hint[hidden] { display: none !important; }
.chat-topic-hint p { margin: 0; flex: 1; min-width: 0; color: var(--muted); }
.chat-topic-clear {
  flex-shrink: 0;
  border: 1px solid #c5d6e6;
  background: #fff;
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.chat-topic-clear:hover {
  border-color: var(--accent);
  background: #eef5fb;
}
.content > .panel-title {
  padding: 14px 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.nav-list { list-style: none; margin: 0; padding: 8px 0 14px; }
.nav-item { position: relative; }
.nav-item > button.linkish {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  cursor: pointer; padding: 7px 34px 7px 28px; color: var(--ink);
  font-size: .88rem; line-height: 1.35;
  position: relative;
}
.nav-item > button.linkish::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c5d0d4;
  transform: translateY(-50%);
}
.nav-item.is-active > button.linkish::before,
.nav-item.is-open > button.linkish::before {
  background: var(--marker);
  box-shadow: 0 0 0 3px rgba(26, 100, 166, 0.18);
}
.nav-item > button.linkish:hover { background: var(--accent-soft); }
.nav-item.is-active > button.linkish {
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.nav-item > .nav-list {
  display: none;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 2px solid #e2ecee;
}
.nav-item.is-open > .nav-list { display: block; }
.nav-item > .nav-list .linkish::before {
  width: 6px; height: 6px; background: #a8b8be;
}
.nav-toggle {
  position: absolute; right: 4px; top: 4px; width: 28px; height: 28px;
  border: 0; background: transparent; cursor: pointer;
}
.nav-toggle::before {
  content: ""; display: block; width: 8px; height: 8px; margin: 9px auto 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
}
.nav-item.is-open > .nav-toggle::before { transform: rotate(45deg); margin-top: 7px; }

.content { padding: 0 0 28px; min-height: 50vh; }
.content .panel-title { margin-bottom: 0; }
.content .content-body { padding: 16px 22px 8px; }
.meta { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; margin-top: 6px; }
.price-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.price-table th, .price-table td {
  border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top;
}
.price-table th { background: #eef4f9; color: #234049; font-weight: 700; }
.price-table tr:hover td { background: #f7fafc; }
.price-table td.price { white-space: nowrap; font-weight: 700; color: var(--price); text-align: right; }
.price-table td.qty { text-align: right; }
.price-table tr.is-hidden { display: none; }
.price-table tr.is-hit td { background: #e8f1f8; }
/* Desktop: keep code columns, hide mobile-only labels/controls */
.code-info, .code-popover, .th-short { display: none; }
.th-full { display: inline; }
.section-links { padding-left: 18px; margin: 0; }
.section-links li { margin: 6px 0; }
.section-links button {
  border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-align: left;
}
.empty {
  padding: 28px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); text-align: center; margin-top: 8px;
}
.result-section { margin: 22px 0 8px; font-size: 1.05rem; }
.result-section button {
  border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-weight: 700; padding: 0;
}
.cards { display: grid; gap: 12px; }
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.card .code { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.card-main .title {
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.card-main .price {
  font-weight: 750;
  color: var(--price);
  white-space: nowrap;
  font-size: 1.05rem;
  text-align: right;
}
.btn-section {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 650;
  font-size: .88rem;
}
.btn-section:hover { background: var(--accent); color: #fff; }
.btn-section svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Home hub (replaces duplicated nav list) */
.home-hero {
  text-align: center;
  padding: 28px 12px 8px;
}
.home-hero .home-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.3;
}
.home-hero p {
  margin: 0 auto 18px;
  max-width: 34em;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}
.home-visual {
  margin: 4px auto 22px;
  width: min(260px, 68vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, #d7e7f5 0%, #b8d0e8 55%, #9bbfda 100%);
  box-shadow: 0 10px 28px rgba(26, 100, 166, 0.14);
}
.home-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) brightness(1.06) contrast(0.92);
  opacity: 0.92;
}
.home-stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.home-stat {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .88rem;
  font-weight: 650;
}
.home-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.home-hint {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: .88rem;
}
.home-hint:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.home-tip {
  margin: 20px auto 0;
  max-width: 36em;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.chat {
  position: sticky;
  top: 12px;
  align-self: start;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}
.chat-log { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 12px; }
.bubble {
  border-radius: 14px; padding: 12px 14px; font-size: .9rem; line-height: 1.45;
  max-width: 100%;
}
.bubble.user {
  background: #1a64a6;
  color: #fff;
  justify-self: end;
  max-width: 92%;
  white-space: pre-wrap;
  box-shadow: 0 2px 8px rgba(26, 100, 166, 0.22);
}
.bubble.assistant {
  background: #fff;
  border: 1px solid #d7e3ef;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(26, 100, 166, 0.06);
}
.bubble.assistant .chat-lead {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .88rem;
}
.bubble.assistant.is-typing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--muted);
}
.typing-label {
  font-size: .86rem;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7a9bb8;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chat-svc {
  border: 1px solid #e2ebf3;
  background: #f7fafc;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 8px;
}
.chat-svc:last-of-type { margin-bottom: 0; }
.chat-svc .chat-svc-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.chat-svc .chat-svc-title {
  font-weight: 650;
  font-size: .88rem;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.chat-svc .chat-svc-price {
  color: var(--accent);
  font-weight: 750;
  white-space: nowrap;
  font-size: .95rem;
}
.chat-svc .chat-svc-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: .75rem;
}
.chat-disclaimer,
.advisor-disclaimer {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7e8;
  border: 1px solid #f0d7a4;
  color: #5a4520;
  font-size: .82rem;
  line-height: 1.4;
}
.advisor-lead {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.4;
  font-weight: 650;
}
.content-body .advisor-disclaimer {
  margin-top: 16px;
  margin-bottom: 8px;
}
.chat-disclaimer a {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.chat-disclaimer a:hover { text-decoration: underline; }
.chat-form {
  border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px;
}
.chat-form textarea {
  width: 100%; min-height: 72px; resize: vertical; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.chat-form button {
  border: 0; background: var(--accent); color: #fff; border-radius: 10px;
  padding: 11px 14px; cursor: pointer; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.chat-form button svg { width: 18px; height: 18px; flex-shrink: 0; }

.mobile-tabs { display: none; }

@media (max-width: 1100px) {
  .top {
    padding: 18px 12px 14px;
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .search-hero { max-width: 100%; }
  .search-box { padding: 4px 6px 4px 14px; }
  .search-box input[type="search"] { font-size: 1rem; padding: 10px 4px; }
  .search-btn { padding: 10px 16px; }

  .layout {
    grid-template-columns: 1fr;
    padding: 8px 8px calc(72px + env(safe-area-inset-bottom, 0px));
    gap: 0;
    min-height: calc(100vh - 90px);
  }
  .sidebar, .content, .chat {
    display: none;
    border-radius: 12px;
    min-height: calc(100vh - 160px);
  }
  .layout.is-nav .sidebar,
  .layout.is-main .content,
  .layout.is-chat .chat {
    display: flex;
    flex-direction: column;
  }
  .layout.is-main .content { display: block; }

  .sidebar, .chat {
    position: relative;
    top: auto;
    max-height: none;
    overflow: auto;
  }
  .chat { max-height: calc(100vh - 160px); }
  .content .content-body { padding: 12px 10px 8px; }
  .table-wrap { overflow: visible; margin: 0 -2px; }
  .price-table {
    font-size: .86rem;
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }
  .price-table th, .price-table td {
    padding: 10px 8px;
    vertical-align: middle;
  }
  .price-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .price-table .col-code { display: none !important; }
  .price-table .th-full { display: none; }
  .price-table .th-short { display: inline; }
  .price-table .col-name {
    width: auto;
    position: relative;
  }
  .price-table .col-value,
  .price-table td.price {
    width: 4.75rem;
    padding-left: 6px;
    padding-right: 6px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .price-table th.col-value {
    text-align: right;
  }
  .name-cell {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }
  .col-name { position: relative; }
  .code-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 800;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    cursor: pointer;
    line-height: 1;
    padding: 0;
  }
  .col-name .name-text {
    display: block;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .code-popover {
    display: block;
    position: absolute;
    left: 8px;
    right: 8px;
    top: calc(100% - 4px);
    z-index: 20;
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(26, 100, 166, 0.16);
    padding: 10px 12px;
    font-size: .8rem;
  }
  .code-popover div {
    display: grid;
    gap: 2px;
    margin-bottom: 8px;
  }
  .code-popover div:last-child { margin-bottom: 0; }
  .code-popover span {
    color: var(--muted);
    font-size: .72rem;
  }
  .code-popover strong {
    color: var(--ink);
    font-weight: 700;
    word-break: break-word;
  }
  .card-main { flex-direction: column; gap: 8px; }
  .card-main .price { text-align: left; }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(26, 100, 166, 0.08);
  }
  .mobile-tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    font-size: .72rem;
    font-weight: 650;
    cursor: pointer;
    border-radius: 10px;
  }
  .mobile-tab svg { width: 22px; height: 22px; }
  .mobile-tab.is-active {
    color: var(--accent);
    background: var(--accent-soft);
  }
}
