/* Shared public styles for multi-page header */
.container {
  width: 90%;
  margin: 0 auto;
}

.top-nav-wrap {
  width: 100%;
  margin: 0;
  padding: 0;
}

.top-notice {
  width: 100%;
  background: #071734;
  color: #d8e2ff;
  font-size: 12px;
}

.top-notice-inner {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-notice a {
  color: #ffffff;
  text-decoration: none;
}

.top-nav-bar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e8ecf4;
}

.top-nav {
  width: 100%;
  min-height: 78px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 24px;
  font-weight: 800;
  color: #113173;
  min-width: 106px;
}

.brand--has-logo {
  display: inline-flex;
  align-items: center;
  min-width: 106px;
  line-height: 1;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 146px;
  height: 46px;
  object-fit: contain;
}

.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.search-wrap input {
  width: 100%;
  border: 0;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.search-btn {
  border: 0;
  padding: 0 20px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a {
  text-decoration: none;
  color: #3d455c;
  font-size: 14px;
  font-weight: 500;
}

.nav-links .primary {
  color: #fff;
  background: #ff8a21;
  padding: 9px 14px;
  border-radius: 999px;
}

.muted {
  color: #6f778b;
  font-size: 14px;
}

.btn-ghost {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #d5dceb;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.btn-ghost:hover {
  border-color: #b9c6e8;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links-col a {
  color: #5a6789;
  text-decoration: none;
  font-size: 14px;
}

.footer-links-col a:hover {
  text-decoration: underline;
}

.nav-user-name {
  font-size: 13px;
  color: #3d455c;
  margin-right: 8px;
}

.nav-links .js-logout {
  font-size: 13px;
  color: #ff6b35;
}

.nav-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #d9e4f8;
  border-radius: 12px;
  background: #f7faff;
  color: #113173;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.nav-mobile-toggle:hover {
  border-color: #b8caef;
  background: #eef4ff;
}

.nav-mobile-toggle:active {
  transform: scale(0.97);
}

.nav-mobile-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-mobile-layer {
  display: none;
}

@media (max-width: 700px) {
  .top-notice-inner {
    min-height: 28px;
    font-size: 11px;
  }

  .top-nav {
    flex-wrap: wrap;
    min-height: auto;
    padding: 10px 0;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }
}

.g-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f4c81, #1ca2a8);
  color: #fff;
  box-shadow: 0 18px 48px rgba(10, 37, 64, 0.28);
  cursor: pointer;
  z-index: 1200;
}

.g-chat-launcher svg {
  display: block;
  margin: 0 auto;
}

.g-chat-launcher:hover {
  transform: translateY(-2px);
}

.g-chat-launcher:active {
  transform: translateY(0);
}

.g-chat-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff6b35;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 107, 53, 0.35);
}

.g-chat-badge[hidden] {
  display: none;
}

.g-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: min(960px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 132px));
  background: #fff;
  border: 1px solid #dbe3f1;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(7, 23, 52, 0.2);
  overflow: hidden;
  z-index: 1199;
  display: none;
}

.g-chat-panel.is-open {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.g-chat-sidebar {
  background: linear-gradient(180deg, #f7fbff, #eef6fb);
  border-right: 1px solid #dbe3f1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.g-chat-side-head,
.g-chat-main-head {
  padding: 18px 20px;
  border-bottom: 1px solid #dbe3f1;
}

.g-chat-side-head,
.g-chat-main-handle {
  cursor: grab;
  touch-action: none;
}

.g-chat-main-handle {
  min-width: 0;
}

.g-chat-panel.is-dragging .g-chat-side-head,
.g-chat-panel.is-dragging .g-chat-main-handle {
  cursor: grabbing;
}

.g-chat-panel.is-dragging,
.g-chat-panel.is-dragging * {
  user-select: none;
}

.g-chat-side-title,
.g-chat-main-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #10284e;
}

.g-chat-side-sub,
.g-chat-main-sub {
  margin: 6px 0 0;
  color: #657289;
  font-size: 13px;
  line-height: 1.5;
}

.g-chat-thread-search {
  padding: 14px 18px;
  border-bottom: 1px solid #dbe3f1;
}

.g-chat-thread-search input {
  width: 100%;
  border: 1px solid #d3ddeb;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  outline: none;
}

.g-chat-thread-list {
  flex: 1;
  overflow: auto;
  padding: 10px 10px 14px;
}

.g-chat-thread-item {
  width: 100%;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.g-chat-thread-item:hover {
  border-color: #c7d6ef;
  box-shadow: 0 10px 24px rgba(17, 49, 115, 0.08);
}

.g-chat-thread-item.is-active {
  border-color: #88b0e6;
  background: #f1f7ff;
}

.g-chat-thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 26px;
}

.g-chat-thread-name {
  font-size: 14px;
  font-weight: 700;
  color: #10284e;
}

.g-chat-thread-time {
  font-size: 12px;
  color: #7c8698;
  white-space: nowrap;
}

.g-chat-thread-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: #eef4ff;
  color: #5f6f89;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.g-chat-thread-product {
  margin-top: 6px;
  color: #1f5fa3;
  font-size: 12px;
}

.g-chat-thread-preview {
  margin-top: 8px;
  color: #5d6678;
  font-size: 13px;
  line-height: 1.5;
}

.g-chat-thread-badges {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.g-chat-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.g-chat-pill--warn {
  background: #fff1ec;
  color: #db5b2a;
}

.g-chat-pill--soft {
  background: #edf5ff;
  color: #2f6ebb;
}

.g-chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.g-chat-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.g-chat-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.g-chat-lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid #d6e0ef;
  border-radius: 999px;
  background: #f4f8ff;
}

.g-chat-lang-toggle button {
  min-width: 54px;
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: #5f6f89;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.g-chat-lang-toggle button.is-active {
  background: #fff;
  color: #10284e;
  box-shadow: 0 1px 2px rgba(16, 40, 78, 0.12);
}

.g-chat-link-btn,
.g-chat-ghost-btn,
.g-chat-send-btn,
.g-chat-login-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  word-break: keep-all;
  flex: 0 0 auto;
  cursor: pointer;
}

.g-chat-link-btn {
  background: #edf5ff;
  color: #235e99;
}

.g-chat-ghost-btn {
  background: #fff;
  color: #465269;
  border: 1px solid #d6e0ef;
}

.g-chat-send-btn,
.g-chat-login-btn {
  background: linear-gradient(135deg, #0f4c81, #1ca2a8);
  color: #fff;
}

.g-chat-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 18px 8px;
}

.g-chat-empty,
.g-chat-login {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: #607086;
}

.g-chat-empty-card,
.g-chat-login-card {
  max-width: 360px;
}

.g-chat-empty-card h3,
.g-chat-login-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: #10284e;
}

.g-chat-empty-card p,
.g-chat-login-card p {
  margin: 0 0 18px;
  line-height: 1.7;
}

.g-chat-message {
  display: flex;
  margin-bottom: 14px;
}

.g-chat-message.is-me {
  justify-content: flex-end;
}

.g-chat-bubble-wrap {
  max-width: min(72%, 560px);
}

.g-chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #7d8697;
  font-size: 12px;
}

.g-chat-message.is-me .g-chat-meta {
  justify-content: flex-end;
}

.g-chat-bubble {
  background: #fff;
  border: 1px solid #d6e0ef;
  border-radius: 18px 18px 18px 6px;
  padding: 12px 14px;
  color: #1e293b;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.g-chat-message.is-me .g-chat-bubble {
  background: linear-gradient(135deg, #0f4c81, #1ca2a8);
  border-color: transparent;
  color: #fff;
  border-radius: 18px 18px 6px 18px;
}

.g-chat-composer {
  border-top: 1px solid #dbe3f1;
  padding: 14px 18px 18px;
  background: #fff;
}

.g-chat-composer textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid #d3ddeb;
  border-radius: 16px;
  padding: 14px;
  font: inherit;
  outline: none;
}

.g-chat-emoji-picker {
  position: relative;
  width: fit-content;
  margin-top: 2px;
}

.g-chat-emoji-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #d3ddeb;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.g-chat-emoji-toggle:hover {
  border-color: #7ab8d4;
  box-shadow: 0 8px 16px rgba(16, 40, 78, 0.09);
  transform: translateY(-1px);
}

.g-chat-emoji-toggle:focus-visible {
  outline: 2px solid rgba(28, 162, 168, 0.35);
  outline-offset: 1px;
}

.g-chat-emoji-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: min(280px, calc(100vw - 48px));
  padding: 4px;
  border: 1px solid #d3ddeb;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  box-shadow: 0 10px 24px rgba(16, 40, 78, 0.14);
  overflow-x: auto;
}

.g-chat-emoji-panel[hidden] {
  display: none;
}

.g-chat-emoji-btn {
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.g-chat-emoji-btn:hover {
  background: rgba(28, 162, 168, 0.12);
  transform: translateY(-1px);
}

.g-chat-emoji-btn:focus-visible {
  outline: 2px solid rgba(28, 162, 168, 0.35);
  outline-offset: 1px;
}

.g-chat-composer-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.g-chat-tip {
  color: #6e7d92;
  font-size: 12px;
}

.g-chat-status {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  color: #6e7d92;
}

.g-chat-status.is-error {
  color: #c2410c;
}

.g-chat-status.is-ok {
  color: #0f766e;
}

@media (max-width: 900px) {
  .g-chat-panel {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    height: calc(100vh - 108px);
    border-radius: 18px;
  }

  .g-chat-panel.is-open {
    grid-template-columns: 1fr;
  }

  .g-chat-sidebar {
    display: none;
  }

  .g-chat-main-head {
    padding-right: 14px;
  }

  .g-chat-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .g-chat-launcher {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .g-chat-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .g-chat-bubble-wrap {
    max-width: 88%;
  }
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .container {
    width: min(92%, 1280px);
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .search-wrap {
    min-width: 0;
  }

  .nav-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .top-notice-inner {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    gap: 12px;
    padding: 8px 0;
  }

  .top-nav {
    position: relative;
    gap: 12px;
  }

  .brand {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
  }

  .nav-mobile-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .search-wrap {
    order: 4;
    width: 100%;
  }

  .nav-links {
    order: 3;
    display: block;
    width: 100%;
  }

  .nav-links > a:not(.primary),
  .nav-links > span {
    display: none;
  }

  .nav-links > a,
  .nav-links > span {
    min-width: 0;
  }

  .nav-links > a,
  .nav-links > span > a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    width: 100%;
    padding: 0 10px;
    border-radius: 12px;
    background: #f5f8ff;
    border: 1px solid #e3ebfb;
    text-align: center;
    white-space: nowrap;
  }

  .nav-links .primary,
  .nav-links > span:last-child > a.primary {
    display: flex;
    min-height: 46px;
    border: 0;
  }

  .nav-mobile-layer {
    position: absolute;
    top: 54px;
    right: 0;
    z-index: 30;
    width: min(272px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid #dbe5f6;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 44px rgba(7, 23, 52, 0.16);
    backdrop-filter: blur(10px);
  }

  .top-nav.is-mobile-nav-open .nav-mobile-layer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-mobile-layer-item {
    min-width: 0;
  }

  .nav-mobile-layer-item-auth {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-mobile-layer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    width: 100%;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #e3ebfb;
    background: #f5f8ff;
    color: #3d455c;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
  }

  .search-wrap {
    margin-top: 2px;
  }

  .search-wrap input {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .top-nav {
    gap: 10px;
  }

  .nav-links > a,
  .nav-links > span > a {
    min-height: 38px;
    font-size: 14px;
  }

  .nav-links .primary,
  .nav-links > span:last-child > a.primary {
    min-height: 44px;
  }

  .nav-mobile-layer {
    width: min(240px, calc(100vw - 24px));
    padding: 10px;
  }

  .top-nav.is-mobile-nav-open .nav-mobile-layer,
  .nav-mobile-layer-item-auth {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - 24px);
  }

  .top-notice-inner {
    min-height: 32px;
  }

  .top-notice-inner .js-public-welcome,
  .top-notice-inner a {
    white-space: nowrap;
  }

  .search-wrap input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .search-btn {
    padding: 0 14px;
    font-size: 13px;
  }

  .nav-links a {
    font-size: 13px;
  }
}
