/* =========================================================================
   App shell (Coursera-style): white top header aligned to the 1280px page
   container, page content below, and a bottom tab bar on phones.
   ========================================================================= */

.cz-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.app-shell { display: block; min-height: 100vh; }
.main-content { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main-content-inner { flex: 1; }

/* ---------- Header ---------- */
.cz-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border-default);
}
.cz-header__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.cz-logo { display: flex; align-items: center; flex-shrink: 0; }
.cz-logo img { height: 26px; width: auto; display: block; }

.cz-search { position: relative; flex: 1; max-width: 560px; }
.cz-search input {
  width: 100%; height: 44px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: #fff;
  padding: 0 56px 0 20px; font-size: 15px; color: var(--ink-900); outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.cz-search input::placeholder { color: var(--ink-500); }
.cz-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.cz-search__btn {
  position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
}
.cz-search__btn:hover { background: var(--primary-hover); }
.cz-search .search-results { top: calc(100% + 8px); }

.cz-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.cz-link { font-size: 15px; font-weight: 600; color: var(--primary); padding: 8px 10px; border-radius: var(--radius-control); }
.cz-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.cz-btn-outline {
  display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: var(--radius-control);
  border: 1px solid var(--primary); color: var(--primary); font-size: 15px; font-weight: 700; background: #fff;
}
.cz-btn-outline:hover { background: var(--primary-soft); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--ink-700);
  position: relative; transition: background var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn__dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral-500); border: 2px solid #fff; }

.topbar__profile {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  border-radius: var(--radius-pill); border: none; background: transparent; color: var(--ink-900);
}
.topbar__profile:hover { background: var(--primary-soft); }
.topbar__profile img { width: 36px; height: 36px; border-radius: 50%; }
.topbar__profile-meta { text-align: left; line-height: 1.2; }
.topbar__profile-meta strong { font-size: 14px; display: block; }
.topbar__profile-meta span { font-size: 13px; color: var(--ink-500); }

.profile-menu { width: 280px; }
.profile-menu__section { padding: 6px; }
.profile-menu__label { font-size: 13px; font-weight: 600; color: var(--ink-500); padding: 8px 10px 4px; }

.menu-toggle { display: none; }

/* ---------- Page ---------- */
.page { width: 100%; max-width: var(--container); margin: 0 auto; padding: 32px var(--gutter) 72px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.3px; }
.page-header p { color: var(--ink-700); font-size: 16px; margin-top: 6px; }

.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-500); margin-bottom: 12px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--primary); }
.breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }
.breadcrumbs .current { color: var(--ink-700); }

/* ---------- Footer ---------- */
.cz-footer { border-top: 1px solid var(--border-default); background: var(--ink-50); margin-top: auto; }
.cz-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 20px; font-size: 13px; color: var(--ink-500); }
.cz-footer__inner img { height: 22px; width: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cz-search { display: none; }
  .topbar__profile-meta { display: none; }
}
@media (max-width: 640px) {
  .cz-logo img { height: 22px; }
  .page { padding: 20px var(--gutter) 96px; }
}
