/* Page shell: header, tab bar, main container. */
.frame {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
  padding-left: max(32px, env(safe-area-inset-left));
  padding-right: max(32px, env(safe-area-inset-right));
}

/* ---------- header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo-mark {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  background: var(--steel);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.logo-word { font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--charcoal); }
.logo-word small { font-weight: 500; color: var(--faint); font-size: 12px; margin-left: 2px; }

.hdr-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
}
.lang button {
  padding: 5px 10px;
  color: var(--muted);
  background: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
}
.lang button:disabled { background: var(--steel); color: #fff; cursor: default; filter: none; }
.lang form { margin: 0; }

.icon-link {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
}
.icon-link:hover { color: var(--charcoal); border-color: #c9d3dc; }
button.icon-link { font: inherit; cursor: pointer; }

.plan-switcher { margin: 0; }
.plan-switcher select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- tab bar ---------- */
.tabbar { background: #fff; border-bottom: 1px solid var(--line); }
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 12px 16px 11px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--charcoal); }
.tab.active { color: var(--charcoal); font-weight: 700; border-bottom-color: var(--accent); }

/* ---------- main ---------- */
main {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  flex: 1 0 auto; /* pushes .site-footer to the bottom on short pages, see base.css's body flex column */
  padding: 24px 32px 56px;
  padding-left: max(32px, env(safe-area-inset-left));
  padding-right: max(32px, env(safe-area-inset-right));
}

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--faint);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-divider { margin: 0 8px; color: var(--line); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }

.cols { display: grid; grid-template-columns: 60fr 40fr; gap: 20px; align-items: start; }

@media (max-width: 1000px) {
  .cols { grid-template-columns: 1fr; }
  .frame, main {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

@media (max-width: 640px) {
  /* padding-top/bottom only, not the `padding` shorthand: .hdr shares its
     element with .frame (`<div class="frame hdr">`), and a shorthand here
     would zero out .frame's horizontal safe-area padding (it sets all four
     sides, and this rule wins on source order at equal specificity) — that
     was gluing the header flush to the screen edges on phones. */
  .hdr { height: auto; min-height: 58px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; row-gap: 8px; }
  .logo-word small { display: none; }
  .hdr-right { gap: 8px; }
}
