/* Top navigation, shell layout, iframe container, and shell overlay styles belong here. */

:root { --site-header-height: 69px; }

.site-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: grid;
  height: var(--site-header-height);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-brand-button {
  display: grid;
  width: 128px;
  height: 48px;
  margin-left: 24px;
  padding: 8px 4px;
  place-items: center;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  cursor: pointer;
}

.site-brand-button:hover { background: var(--bg-soft); }
.site-brand-button img { display: block; width: 120px; height: 32px; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.site-nav .btn-text {
  min-width: auto;
  padding-inline: 12px;
  white-space: nowrap;
}

.site-nav .btn-text[aria-current="true"] {
  background: var(--bg-soft);
  color: var(--ink);
}

.site-header .site-header-action {
  justify-self: end;
  margin-right: 24px;
}

.site-header .site-menu-button { display: none; justify-self: end; margin-right: 12px; }

.site-main {
  position: fixed;
  inset: var(--site-header-height) 0 0;
  height: auto;
  overflow: hidden;
}

.site-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

.tm-panel.cooperation-panel { max-width: 720px; }
.cooperation-panel .tm-body { gap: 16px; }
.cooperation-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.tm-error-message { min-height: 18px; margin: 0; color: var(--state-danger); font-size: 12px; line-height: 18px; }

@media (max-width: 959px) {
  .site-header { grid-template-columns: 1fr auto auto; }
  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 12px;
    display: none;
    width: min(280px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--paper);
    box-shadow: var(--component-dialog-shadow);
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav.is-open { display: flex; }
  .site-nav .btn-text { justify-content: flex-start; }
  .site-header .site-menu-button { display: inline-grid; }
}

@media (max-width: 599px) {
  .site-brand-button { width: 112px; margin-left: 8px; }
  .site-brand-button img { width: 105px; height: auto; }
  .site-header-action { display: none; }
}
