/* Global typography and content bounds. Loaded last on every page. */
:root {
  --page-gutter: clamp(20px, 6vw, 96px);
  --page-width: calc(100% - (var(--page-gutter) * 2));
  --type-title-size: clamp(40px, 3.62vw, 52px);
  --type-medium-size: clamp(26px, 2.3vw, 33px);
  --type-text-size: 17px;
  --type-title-color: #123b2f;
  --type-medium-color: #183b30;
  --type-text-color: #66746f;
  --type-font: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --space-section: clamp(56px, 6vw, 86px);
  --space-card: clamp(24px, 3vw, 40px);
  --shell-radius-outer: 32px;
  --shell-radius-inner: 24px;
  --shell-radius-control: 18px;
  --site-footer-deep: #123d29;
  --site-footer-deeper: #0d2f20;
  --site-footer-text: rgba(247, 252, 248, 0.86);
}

html,
body {
  overflow-x: clip;
}

body {
  font-family: var(--type-font);
  font-size: var(--type-text-size);
  line-height: 1.9;
}

/* Reset legacy one-off sizes before assigning the three canonical levels. */
body :where(p, a, button, input, textarea, select, label, li, small, time, summary, dt, dd, figcaption, h2, h3, h4, strong),
body span:not(h1 span):not(h2 span):not(.brand-mark):not(.upload-icon):not(.community-media-picker-icon):not(.profile-avatar-choice > span) {
  font-size: var(--type-text-size) !important;
}

/* Page-level titles follow the Explore atlas heading exactly. */
h1,
.hero-copy h1,
.section-head h1,
.section-head h2,
.page-hero h1,
.community-view-heading h1,
.profile-center-hero h1,
.auth-intro h1,
.doc-card > h1,
.beginner-guide > h2,
.learning-roadmap .roadmap-intro h2 {
  margin-top: 0 !important;
  color: var(--type-title-color) !important;
  font-family: var(--type-font) !important;
  font-size: var(--type-title-size) !important;
  font-weight: 800 !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
}

/* Panel and card headings follow the connected-device heading. */
.device-title,
.auth-card h2,
.result-card h3,
.atlas-detail h3,
.device-action-grid h2,
.device-timeline h2,
.profile-login-state h2,
.profile-panel-heading h2,
.post-detail-head h2,
.community-empty-state h2,
.learning-roadmap .road-step-card > strong,
.learning-roadmap .road-index,
.brand > span:not(.brand-mark):not(.brand-user),
.live-card > strong,
.device-stat-card > strong,
.community-person-card > strong,
.confidence-ring > span {
  color: var(--type-medium-color) !important;
  font-family: var(--type-font) !important;
  font-size: var(--type-medium-size) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
}

#homeObservationDate {
  color: #fff !important;
}

.community-publish-aside h2,
.community-mini-note-list .community-note-info h2 {
  color: var(--type-text-color) !important;
  font-family: var(--type-font) !important;
  font-size: var(--type-text-size) !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
}

/* Body copy uses the home introduction as the single baseline. */
p,
li,
label,
input,
textarea,
select,
button,
.link-btn,
.nav a,
.community-rail-link,
.community-view-heading > span,
.road-description,
.road-entry,
.device-sync-status,
.device-stat-card,
.profile-center-hero span {
  font-family: var(--type-font);
  font-size: var(--type-text-size);
  letter-spacing: 0;
}

p,
li,
.community-view-heading > span,
.road-description,
.device-sync-status,
.profile-center-hero span {
  color: var(--type-text-color);
  line-height: 1.9;
}

.eyebrow,
small,
.community-note-meta,
.road-label {
  font-family: var(--type-font);
  font-size: var(--type-text-size) !important;
  letter-spacing: 0 !important;
  line-height: 1.5;
}

/* Dark photographic surfaces keep the same type metrics with readable color. */
.hero .hero-copy h1,
.hero .hero-copy h1 span {
  color: #fff !important;
}

.hero .hero-copy p,
.hero .hero-copy .eyebrow,
.live-card,
.live-card span,
.live-card small {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Every working surface shares the roadmap card's left and right boundary. */
.glass-topbar,
.app-page-v2,
.community-workspace,
.profile-center,
.device-section,
footer {
  width: var(--page-width) !important;
  max-width: none !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.auth-page,
.doc-page {
  padding-right: var(--page-gutter) !important;
  padding-left: var(--page-gutter) !important;
}

.hero {
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: var(--page-gutter) !important;
  padding-left: var(--page-gutter) !important;
}

.learning-roadmap {
  padding-right: var(--page-gutter) !important;
  padding-left: var(--page-gutter) !important;
}

.learning-roadmap .roadmap-content {
  width: 100% !important;
  max-width: none !important;
}

.app-page-v2 > .split-section,
.app-page-v2 > .atlas-section,
.device-section {
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.community-publish-layout {
  grid-template-columns: minmax(0, 760px) minmax(230px, 280px);
  justify-content: center;
  width: min(1120px, 100%);
  margin-right: auto;
  margin-left: auto;
}

body[data-community-view="publish"] .community-workspace {
  margin-top: 24px;
}

body[data-community-view="publish"] .community-rail {
  margin-bottom: 20px;
}

body[data-community-view="publish"] .community-view-heading {
  margin-bottom: 16px;
}

@media (min-width: 921px) and (min-height: 700px) {
  #identify {
    padding-top: clamp(24px, 3.2vh, 34px);
    padding-bottom: clamp(24px, 3.2vh, 34px);
  }

  #identify .section-head {
    margin-bottom: clamp(14px, 2vh, 20px);
  }

  #identify .section-head .eyebrow {
    margin-bottom: 10px;
  }

  #identify .section-head h2 {
    margin-bottom: 12px !important;
  }

  #identify .section-head p:not(.eyebrow) {
    line-height: 1.6;
  }

  #identify .identify-grid {
    gap: 24px;
  }

  #identify .upload-zone,
  #identify .result-card {
    height: clamp(420px, calc(100svh - 270px), 560px);
    min-height: 0;
    max-height: 560px;
  }

  #identify .upload-zone {
    padding: 24px;
  }

  #identify .result-card {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 22px 26px;
    overflow: hidden;
  }

  #identify .confidence-ring {
    width: 72px;
    height: 72px;
  }

  #identify .result-card dl {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 6px;
    overflow: hidden;
  }

  #identify .result-card dl > div {
    padding: 9px 13px;
  }

  #identify .result-card .candidate-panel {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #identify .result-card dl > div:last-child {
    grid-column: 3;
    grid-row: 1;
  }

  #identify .candidate-list {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 4px;
  }

  #identify .candidate-list li {
    min-width: 0;
    padding: 3px 8px;
    border-top: 0;
    border-left: 1px solid rgba(73, 112, 92, 0.09);
  }

  #identify .candidate-list li:first-child {
    padding-top: 3px;
    border-left: 0;
  }

  #identify .candidate-empty {
    grid-column: 1 / -1;
  }

  #identify .candidate-row,
  #identify .candidate-open {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 3px;
  }

  #identify .candidate-open > span:last-child {
    display: flex;
    gap: 6px;
    min-width: 0;
    text-align: left;
  }

  #identify .candidate-list small,
  #identify .candidate-list em {
    display: none;
  }

  #identify .candidate-atlas {
    justify-self: start;
  }

  #identify #modelDetail {
    -webkit-line-clamp: 2;
  }

  #identify .observation-message,
  #identify .recognition-actions {
    grid-column: 1 / -1;
  }

  #identify .recognition-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .community-publish-layout {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* Normalize repeated vertical spacing without changing component structure. */
.app-page-v2 > section,
.profile-center > section,
.profile-center > div,
.community-workspace > section {
  margin-right: 0;
  margin-left: 0;
}

.app-page-v2 > section + section {
  margin-top: var(--space-section);
}

.section-head > h1,
.section-head > h2,
.page-hero > h1,
.community-view-heading > h1,
.profile-center-hero h1,
.auth-intro h1,
.doc-card > h1 {
  margin-bottom: 20px !important;
}

.section-head > p:not(.eyebrow),
.page-hero > p:not(.eyebrow),
.community-view-heading > span {
  max-width: 760px;
  margin-top: 0;
}

@media (max-width: 900px) {
  :root {
    --page-gutter: 20px;
    --type-title-size: 34px;
    --type-medium-size: 26px;
    --space-section: 48px;
  }

  .glass-topbar {
    width: calc(100% - 24px) !important;
  }

  .hero {
    padding-right: var(--page-gutter) !important;
    padding-left: var(--page-gutter) !important;
  }
}

@media (max-width: 420px) {
  :root {
    --type-title-size: 32px;
    --type-medium-size: 24px;
    --type-text-size: 16px;
  }
}

/* Compact atlas carousel: title, search, and the carousel bottom fit one viewport. */
#atlas {
  padding-top: clamp(26px, 3.5vh, 38px);
  padding-bottom: clamp(26px, 3.5vh, 38px);
}

#atlas .section-head {
  margin-bottom: 14px;
}

#atlas .section-head > .eyebrow {
  margin-bottom: 10px;
}

#atlas .section-head > h2 {
  margin-bottom: 12px !important;
}

#atlas .section-head > p:not(.eyebrow) {
  line-height: 1.55;
}

#atlas .search-row {
  margin-bottom: 14px;
}

#atlas .search-row input {
  padding: 12px 16px;
}

#atlas .atlas-summary {
  margin: 0 0 10px;
  line-height: 1.45;
}

#atlas .bird-grid.is-marquee {
  min-height: 0;
  padding-top: 2px;
  padding-bottom: 6px;
}

#atlas .bird-grid.is-marquee .bird-card {
  display: flex;
  flex-direction: column;
  width: 340px;
  min-height: 510px;
  flex-basis: 340px;
  border-radius: 18px;
}

#atlas .bird-grid.is-marquee .bird-photo {
  flex: 0 0 130px;
  height: 130px;
}

#atlas .bird-grid.is-marquee .bird-card > div:last-child {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px 14px 14px;
}

#atlas .bird-grid.is-marquee .bird-card h3 {
  margin-bottom: 4px;
}

#atlas .bird-grid.is-marquee .bird-card > div > p {
  margin: 0 0 5px;
  line-height: 1.4;
}

#atlas .bird-grid.is-marquee .bird-card > div > p:first-of-type {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

#atlas .bird-grid.is-marquee .bird-card > div > p:nth-of-type(2),
#atlas .bird-grid.is-marquee .bird-clue {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

#atlas .bird-grid.is-marquee .bird-clue {
  padding: 6px 8px;
  border-radius: 8px;
}

#atlas .bird-grid.is-marquee .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

#atlas .bird-grid.is-marquee .tag-row span {
  padding: 4px 7px;
}

#atlas .bird-grid.is-marquee .atlas-card-actions {
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

#atlas .bird-grid.is-marquee .source-link,
#atlas .bird-grid.is-marquee .atlas-open {
  min-height: 32px;
  margin-top: 0;
}

.beginner-guide {
  border-radius: 24px;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

.beginner-guide:hover,
.beginner-guide:focus-within {
  transform: none !important;
  box-shadow: 0 18px 56px rgba(17, 47, 36, 0.09) !important;
}

/* Denser device console with more information per row. */
.device-page {
  gap: 16px !important;
  padding-bottom: 52px;
}

.device-page > section + section {
  margin-top: 0 !important;
}

.device-page > .page-hero {
  padding-top: 34px;
  padding-bottom: 16px;
}

.device-dashboard {
  gap: 14px;
}

.device-manager-panel,
.device-visual-panel,
.device-action-grid > article,
.device-timeline,
.device-metric-grid > .device-stat-card {
  border-radius: 16px;
}

.device-manager-panel {
  gap: 10px;
  padding: 22px 24px;
}

.device-visual-panel {
  gap: 10px;
  min-height: 0;
  padding: 16px 22px;
}

.device-visual-panel .device-glasses {
  width: min(360px, 82%);
  max-height: 138px;
}

.device-metric-grid,
.device-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.device-metric-grid > .device-stat-card {
  gap: 5px;
  padding: 16px 18px;
}

.device-action-grid > article {
  padding: 17px 18px;
}

.device-action-grid h2 {
  margin: 5px 0 7px;
  color: var(--type-medium-color) !important;
  font-size: var(--type-text-size) !important;
  line-height: 1.4 !important;
}

.device-action-grid p {
  margin-top: 0;
  line-height: 1.55;
}

.device-timeline {
  padding: 20px 22px;
}

.device-timeline .section-head {
  align-items: center;
}

.device-timeline ol {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.device-timeline li {
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(73, 112, 92, 0.1);
  border-radius: 10px;
  background: rgba(246, 251, 248, 0.72);
}

@media (max-width: 1100px) {
  .device-metric-grid,
  .device-action-grid,
  .device-timeline ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #atlas .bird-grid.is-marquee .bird-card {
    width: min(290px, calc(100vw - 64px));
    min-height: 465px;
    flex-basis: min(290px, calc(100vw - 64px));
  }

  #atlas .bird-grid.is-marquee .bird-photo {
    flex-basis: 150px;
    height: 150px;
  }

  .device-metric-grid,
  .device-action-grid,
  .device-timeline ol {
    grid-template-columns: 1fr;
  }
}

/* Final geometry pass: one card radius and content aligned to the shared gutters. */
:root {
  --unified-radius: 22px;
  --radius-xl: var(--unified-radius);
  --radius-lg: var(--unified-radius);
  --radius-md: var(--unified-radius);
  --radius-sm: var(--unified-radius);
}

body :where(
  article,
  dialog,
  form,
  button,
  input,
  textarea,
  select,
  footer,
  .topbar,
  .hero,
  .live-card,
  .road-step-card,
  .device-section,
  .device-panel,
  .glasses-card,
  .device-stat-card,
  .community-rail,
  .community-publish-aside,
  .community-message,
  .profile-center-hero,
  .profile-login-state,
  .profile-settings-panel,
  .auth-intro,
  .auth-card,
  .doc-card,
  .upload-zone,
  .result-card,
  .atlas-detail,
  .beginner-guide,
  .tag-row span,
  .road-label
) {
  border-radius: var(--unified-radius) !important;
}

.brand-mark,
.profile-avatar,
.profile-avatar-choice > span {
  border-radius: 50% !important;
}

body[data-page="home"] .hero {
  width: var(--page-width) !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: clamp(28px, 4vw, 64px) !important;
  padding-left: clamp(28px, 4vw, 64px) !important;
  border-radius: 40px !important;
  overflow: hidden;
}

.device-standalone-page {
  width: 100%;
  min-height: calc(100svh - 120px);
  padding: clamp(48px, 7vw, 96px) 0 80px;
}

.device-standalone-page .device-section {
  width: var(--page-width) !important;
  margin: 0 auto !important;
}

/* Device page: preserve the compact feature set while giving every label breathing room. */
body[data-page="device"] .device-section-v2 {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: clamp(18px, 2vw, 30px);
  align-items: stretch;
  padding: clamp(20px, 2.4vw, 34px) !important;
  border: 1px solid rgba(29, 105, 57, 0.2);
  background: rgba(247, 252, 248, 0.7);
  box-shadow: 0 28px 70px rgba(18, 77, 42, 0.09);
}

body[data-page="device"] .device-panel,
body[data-page="device"] .glasses-card {
  min-width: 0;
  padding: clamp(28px, 3.2vw, 48px) !important;
  border: 1px solid rgba(29, 105, 57, 0.2) !important;
  background: rgba(255, 255, 255, 0.86) !important;
}

body[data-page="device"] .device-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

body[data-page="device"] .device-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-bottom: 18px;
}

body[data-page="device"] .device-panel-heading .eyebrow,
body[data-page="device"] .device-visual-heading .eyebrow {
  margin: 0;
}

body[data-page="device"] .device-panel-badge {
  padding: 8px 12px;
  border: 1px solid rgba(29, 105, 57, 0.16);
  border-radius: var(--unified-radius);
  color: var(--green-deep);
  background: rgba(225, 241, 229, 0.78);
  font-size: 13px;
  font-weight: 700;
}

body[data-page="device"] .device-title {
  max-width: 680px;
  margin: 0 0 16px;
}

body[data-page="device"] .device-description {
  max-width: 650px;
  margin: 0 0 26px;
}

body[data-page="device"] .device-panel .device-action {
  margin: 0;
}

body[data-page="device"] .device-stats {
  width: 100%;
  gap: 12px;
  margin-top: 28px;
}

body[data-page="device"] .device-stat-card {
  display: flex;
  min-width: 0;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px !important;
  border: 1px solid rgba(29, 105, 57, 0.16) !important;
  background: rgba(241, 249, 243, 0.86) !important;
}

body[data-page="device"] .device-stat-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

body[data-page="device"] .device-stat-card strong {
  overflow-wrap: anywhere;
}

body[data-page="device"] .glasses-card {
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 20px;
  overflow: hidden;
}

body[data-page="device"] .device-visual-heading h2 {
  margin: 8px 0 0;
}

body[data-page="device"] .device-glasses {
  width: min(100%, 430px);
  max-height: 230px;
  margin: auto;
  object-fit: contain;
}

body[data-page="device"] .device-sync-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid rgba(29, 105, 57, 0.14);
}

body[data-page="device"] .device-sync-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #8ca196;
  box-shadow: 0 0 0 5px rgba(140, 161, 150, 0.13);
}

body[data-page="device"] .device-sync-status {
  margin: 0;
}

/* The homepage keeps a compact overview; detailed tools live on the device page. */
body[data-page="home"] .home-device-overview {
  width: var(--page-width) !important;
  margin: clamp(56px, 8vw, 108px) auto 0 !important;
  padding: clamp(22px, 3vw, 38px) !important;
  border: 1px solid rgba(29, 105, 57, 0.18);
  background: rgba(247, 252, 248, 0.72);
  box-shadow: 0 26px 64px rgba(18, 77, 42, 0.08);
}

body[data-page="home"] .home-device-overview .device-panel,
body[data-page="home"] .home-device-overview .glasses-card {
  min-width: 0;
  padding: clamp(26px, 3.2vw, 46px) !important;
  border: 1px solid rgba(29, 105, 57, 0.18) !important;
  background: rgba(255, 255, 255, 0.86) !important;
}

body[data-page="home"] .home-device-overview .device-title {
  margin: 10px 0 16px;
}

body[data-page="home"] .home-device-overview .home-device-link {
  margin-top: 8px;
}

body[data-page="home"] .home-device-overview .device-stats {
  gap: 12px;
  margin-top: 26px;
}

body[data-page="home"] .home-device-overview .device-stat-card {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px !important;
  border: 1px solid rgba(29, 105, 57, 0.15) !important;
  background: rgba(241, 249, 243, 0.86) !important;
}

body[data-page="home"] .home-device-overview .device-stat-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

body[data-page="home"] .home-device-overview .glasses-card {
  display: grid;
  place-items: center;
  gap: 16px;
}

body[data-page="home"] .home-device-overview .device-glasses {
  width: min(100%, 390px);
  max-height: 220px;
  object-fit: contain;
}

body[data-page="home"] .home-device-overview .device-sync-status {
  margin: 0;
}

body[data-page="device"] .device-tools-page {
  width: var(--page-width);
  margin: 0 auto;
  padding: clamp(42px, 6vw, 86px) 0 80px;
}

body[data-page="device"] .device-tools-page .page-hero {
  max-width: 820px;
  padding: 0 0 clamp(28px, 4vw, 52px);
}

body[data-page="device"] .device-tools-page .page-hero h1 {
  margin-bottom: 14px;
}

body[data-page="device"] .device-manager-panel,
body[data-page="device"] .device-visual-panel,
body[data-page="device"] .device-action-grid > article,
body[data-page="device"] .device-timeline {
  border-color: rgba(29, 105, 57, 0.2) !important;
}

body[data-page="device"] .device-manager-panel {
  align-content: start;
}

body[data-page="device"] .device-visual-panel {
  grid-template-rows: auto minmax(170px, 1fr) auto;
  place-items: stretch;
  text-align: left;
}

body[data-page="device"] .device-visual-panel > div:first-child {
  width: 100%;
}

body[data-page="device"] .device-visual-panel h2 {
  margin: 8px 0 0;
}

body[data-page="device"] .device-visual-panel .device-glasses {
  width: min(100%, 420px);
  max-height: 240px;
  margin: auto;
  object-fit: contain;
}

body[data-page="device"] .device-visual-panel .device-sync-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid rgba(29, 105, 57, 0.14);
}

body[data-page="device"] .device-visual-panel .device-sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8ca196;
  box-shadow: 0 0 0 5px rgba(140, 161, 150, 0.13);
}

body[data-page="device"] .device-visual-panel .device-sync-status {
  margin: 0;
}

body[data-page="device"] .device-action-grid > article {
  display: flex;
  min-height: 242px;
  flex-direction: column;
  align-items: flex-start;
}

body[data-page="device"] .device-action-grid > article .secondary-btn {
  margin-top: auto;
}

body[data-page="device"] .device-timeline h2 {
  margin: 8px 0 12px;
}

body[data-page="device"] .device-tool-message {
  min-height: 26px;
  margin: 0;
  color: var(--green-deep);
  font-weight: 700;
}

body[data-community-view="publish"] .community-publish-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 20px;
  width: 100%;
  max-width: none;
  margin: 0;
}

body[data-community-view="publish"] .community-publish-aside {
  width: 100%;
  padding: 20px;
}

body[data-community-view="publish"] .community-mini-note-list {
  gap: 14px;
}

body[data-community-view="publish"] .community-mini-note-list .community-note-card {
  grid-template-columns: 118px minmax(0, 1fr);
}

body[data-community-view="publish"] .community-mini-note-list .community-note-media,
body[data-community-view="publish"] .community-mini-note-list .community-text-cover {
  width: 118px;
  min-height: 118px;
}

body[data-community-view="publish"] .community-mini-note-list .community-note-info > p,
body[data-community-view="publish"] .community-mini-note-list .community-text-cover p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-community-view="publish"] .community-mini-note-list .community-note-info {
  align-content: start;
  padding: 12px 14px;
}

#identify .result-card {
  grid-template-columns: minmax(0, 1fr);
}

#identify .result-card > div:not(.recognition-actions),
#identify .result-card dl,
#identify .result-card .observation-message,
#identify .result-card .recognition-actions {
  grid-column: 1;
}

/* The atlas image owns exactly the upper half; dense spacing keeps all copy visible below. */
#atlas .bird-grid.is-marquee .bird-card {
  height: 510px;
  min-height: 510px;
  max-height: 510px;
}

#atlas .bird-grid.is-marquee .bird-photo {
  flex: 0 0 50%;
  height: 50%;
}

#atlas .bird-grid.is-marquee .bird-card > div:last-child {
  min-height: 0;
  padding: 7px 11px 9px;
}

#atlas .bird-grid.is-marquee .bird-card h3 {
  margin: 0 0 2px;
  line-height: 1.2;
}

#atlas .bird-grid.is-marquee .bird-card > div > p {
  margin: 0 0 2px;
  line-height: 1.2;
}

#atlas .bird-grid.is-marquee .bird-clue {
  padding: 3px 6px;
  line-height: 1.2;
}

#atlas .bird-grid.is-marquee .tag-row {
  gap: 3px;
  margin-top: 2px;
}

#atlas .bird-grid.is-marquee .tag-row span {
  padding: 2px 5px;
  line-height: 1.2;
}

#atlas .bird-grid.is-marquee .atlas-card-actions {
  min-height: 26px;
  padding-top: 2px;
}

#atlas .bird-grid.is-marquee .source-link,
#atlas .bird-grid.is-marquee .atlas-open {
  min-height: 26px;
  line-height: 1.2;
}

@media (max-width: 1100px) {
  body[data-page="device"] .device-section-v2,
  body[data-page="device"] .device-dashboard {
    grid-template-columns: 1fr;
  }

  body[data-community-view="publish"] .community-publish-layout {
    grid-template-columns: 1fr;
  }

  body[data-community-view="publish"] .community-publish-aside {
    position: static;
  }
}

@media (max-width: 700px) {
  body[data-page="home"] .hero {
    width: calc(100% - 40px) !important;
    padding-right: 20px !important;
    padding-left: 20px !important;
    border-radius: 32px !important;
  }

  .device-standalone-page {
    padding-top: 36px;
  }

  body[data-page="device"] .device-section-v2 {
    padding: 14px !important;
  }

  body[data-page="device"] .device-panel,
  body[data-page="device"] .glasses-card {
    padding: 24px !important;
  }

  body[data-page="home"] .home-device-overview {
    grid-template-columns: 1fr;
    padding: 14px !important;
  }

  body[data-page="home"] .home-device-overview .device-panel,
  body[data-page="home"] .home-device-overview .glasses-card {
    padding: 24px !important;
  }

  body[data-page="home"] .home-device-overview .device-stats {
    grid-template-columns: 1fr;
  }

  body[data-page="device"] .device-tools-page {
    padding-top: 36px;
  }

  body[data-page="device"] .device-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="device"] .device-stats {
    grid-template-columns: 1fr;
  }

  body[data-page="device"] .device-stat-card {
    min-height: 90px;
  }

  #atlas .bird-grid.is-marquee .bird-card {
    height: 487px;
    min-height: 487px;
    max-height: 487px;
  }
}

/* Lowest visual layer: soft green light pools and slow contour-like ripples. */
body,
body[data-page="community"] {
  background-color: #edf6ef;
  background-image:
    radial-gradient(circle, rgba(55, 145, 82, 0.14) 0%, rgba(74, 164, 101, 0.08) 24%, rgba(74, 164, 101, 0.025) 46%, transparent 68%),
    radial-gradient(circle, rgba(89, 177, 111, 0.12) 0%, rgba(89, 177, 111, 0.055) 30%, rgba(89, 177, 111, 0.018) 50%, transparent 70%),
    radial-gradient(circle, rgba(36, 126, 67, 0.09) 0%, rgba(36, 126, 67, 0.025) 46%, transparent 70%),
    repeating-radial-gradient(ellipse at 50% 112%, transparent 0 50px, rgba(42, 132, 72, 0.012) 53px, rgba(42, 132, 72, 0.032) 58px, rgba(42, 132, 72, 0.012) 64px, transparent 69px 118px),
    linear-gradient(180deg, #f4faf6 0%, #edf6ef 48%, #f5faf6 100%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 72vmax 72vmax, 62vmax 62vmax, 48vmax 48vmax, 138% 76%, 100% 100%;
  background-position: -18vmax -24vmax, calc(100% + 20vmax) 30%, 24% calc(100% + 18vmax), 50% 108%, center;
  background-attachment: fixed;
  animation: birdora-background-drift 24s ease-in-out infinite alternate;
}

.hero-intro span {
  display: block;
}

@keyframes birdora-background-drift {
  from {
    background-position: -18vmax -24vmax, calc(100% + 20vmax) 30%, 24% calc(100% + 18vmax), 50% 108%, center;
  }
  to {
    background-position: -13vmax -19vmax, calc(100% + 15vmax) 36%, 31% calc(100% + 14vmax), 54% 102%, center;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

/* Green illustrations from Pictures decorate open margins without affecting layout. */
main {
  position: relative;
  isolation: isolate;
}

main::before,
main::after {
  content: "";
  position: absolute;
  z-index: 0;
  display: block;
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  mix-blend-mode: multiply;
  filter: saturate(0.72);
}

main::before {
  top: clamp(220px, 24vh, 360px);
  right: 0;
  width: clamp(120px, 14vw, 230px);
  height: clamp(250px, 34vw, 470px);
  background-image: url("./Pictures/flower/3.jpeg");
  opacity: 0.13;
  transform: rotate(5deg) translateX(24%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
}

main::after {
  bottom: clamp(40px, 8vh, 120px);
  left: 0;
  width: clamp(160px, 18vw, 290px);
  aspect-ratio: 1;
  background-image: url("./Pictures/flower/5.jpg");
  opacity: 0.09;
  transform: rotate(-8deg) translateX(-28%);
  -webkit-mask-image: radial-gradient(circle, #000 42%, transparent 76%);
  mask-image: radial-gradient(circle, #000 42%, transparent 76%);
}

main > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 700px) {
  main::before {
    right: -28px;
    width: 112px;
    height: 260px;
    opacity: 0.1;
  }

  main::after {
    width: 150px;
    opacity: 0.07;
  }
}

/* Accessibility baseline for the compact controls used across route pages. */

.glass-topbar .ghost-btn,
.glass-topbar .link-btn,
#atlas .bird-grid.is-marquee .atlas-card-actions,
#atlas .bird-grid.is-marquee .source-link,
#atlas .bird-grid.is-marquee .atlas-open {
  min-height: 44px !important;
}

.community-note-meta button {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 8px;
}

.community-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #d5e1d7;
  border-radius: 6px;
  color: #18241c;
  background: #fbfdfb;
}

.community-field select:focus {
  outline: 3px solid rgba(36, 113, 60, 0.16);
  border-color: #2b7a45;
}

/* Community uses the global Birdora tokens with explicit role-based hierarchy. */

body[data-page="community"] {
  --community-type-body: var(--type-text-size);
  --community-type-support: calc(var(--type-text-size) - 2px);
  --community-type-meta: calc(var(--type-text-size) - 3px);
  --community-surface-radius: var(--unified-radius);
}

body[data-page="community"] .community-workspace {
  margin-top: 44px;
}

body[data-page="community"] .community-rail {
  margin-bottom: 28px;
}

body[data-page="community"] .community-rail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--community-surface-radius);
  font-size: var(--community-type-support) !important;
  line-height: 1.25;
}

body[data-page="community"] .community-view-heading {
  gap: 8px;
  margin-bottom: 28px;
}

body[data-page="community"] .community-view-heading > p {
  font-size: var(--community-type-support) !important;
  line-height: 1.35;
}

body[data-page="community"] .community-view-heading > span {
  font-size: var(--community-type-body) !important;
  line-height: 1.7;
}

body[data-page="community"] :where(
  .community-person-card,
  .community-empty-state,
  .community-media-picker,
  .community-message-list,
  .community-report-panel select,
  .community-report-panel textarea
) {
  border-radius: var(--community-surface-radius) !important;
}

body[data-page="community"] .community-note-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-page="community"] .community-note-info h2 {
  color: #17221b !important;
  font-size: var(--community-type-body) !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
}

body[data-page="community"] .community-text-cover p {
  color: #263b2d !important;
  font-size: calc(var(--community-type-body) - 1px) !important;
  font-weight: 600 !important;
  line-height: 1.55 !important;
}

body[data-page="community"] .community-note-info > p {
  font-size: calc(var(--community-type-body) - 1px) !important;
  font-weight: 400;
  line-height: 1.65;
}

body[data-page="community"] .community-text-cover > span,
body[data-page="community"] .community-field > span,
body[data-page="community"] .community-media-picker > strong {
  font-size: var(--community-type-support) !important;
  font-weight: 800;
  line-height: 1.4;
}

body[data-page="community"] .community-note-meta,
body[data-page="community"] .community-note-meta > span,
body[data-page="community"] .community-note-meta > button,
body[data-page="community"] .community-media-picker > small,
body[data-page="community"] .community-message-type,
body[data-page="community"] .community-message time,
body[data-page="community"] .community-report-panel summary {
  font-size: var(--community-type-meta) !important;
  line-height: 1.4;
}

body[data-page="community"] .community-note-meta > button {
  font-weight: 700;
}

body[data-page="community"] .community-publish-aside-head h2 {
  color: var(--type-medium-color) !important;
  font-size: calc(var(--community-type-body) + 3px) !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}

body[data-page="community"] .community-mini-note-list .community-note-info h2 {
  color: #17221b !important;
  font-size: var(--community-type-support) !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
}

body[data-page="community"] .community-person-card > span:first-of-type {
  color: #344b3c;
  font-size: var(--community-type-support) !important;
  font-weight: 800;
  line-height: 1.4;
}

body[data-page="community"] .community-person-card > span:last-of-type {
  font-size: var(--community-type-meta) !important;
  line-height: 1.5;
}

body[data-page="community"] .community-person-card {
  width: min(620px, 100%);
}

body[data-page="community"] .community-message-list {
  overflow: hidden;
  border: 1px solid #dce8df;
  background: rgba(255, 255, 255, 0.76);
}

body[data-page="community"] .community-message {
  border-radius: 0 !important;
  padding-inline: 20px;
}

body[data-page="community"] .community-message:last-child {
  border-bottom: 0;
}

@media (max-width: 1180px) {
  body[data-page="community"] .community-note-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body[data-page="community"] .community-workspace {
    margin-top: 28px;
  }

  body[data-page="community"] .community-rail {
    margin-bottom: 24px;
  }

  body[data-page="community"] .community-view-heading {
    margin-bottom: 24px;
  }

  body[data-page="community"] .community-note-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="community"] .community-person-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 12px;
  }

  body[data-page="community"] .community-person-card > strong {
    align-self: center;
    grid-row: 1 / span 2;
  }

  body[data-page="community"] .community-person-card .secondary-btn {
    grid-column: 1 / -1;
    margin: 12px 0 0;
    width: 100%;
  }
}

/* Author note management: reusable for the upcoming community detail surface. */
body[data-page="community"] .community-note-owner-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid #edf2ee;
}

body[data-page="community"] .community-note-owner-tools > span {
  margin-right: auto;
  color: #5d7165;
  font-size: var(--community-type-meta) !important;
  line-height: 1.4;
}

body[data-page="community"] .community-note-owner-tools button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #1f6f4b;
  font-size: var(--community-type-meta) !important;
  font-weight: 800;
  line-height: 1.4;
  padding: 6px 4px;
}

body[data-page="community"] .community-note-owner-tools button[data-workspace-post-delete] {
  color: #b42318;
}

.community-note-editor {
  width: min(720px, calc(100vw - 32px));
  max-width: 720px;
  max-height: min(860px, calc(100dvh - 32px));
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(31, 111, 75, 0.18);
  border-radius: 22px;
  background: #fff;
  color: #10231d;
  box-shadow: 0 30px 90px rgba(16, 35, 29, 0.24);
}

.community-note-editor::backdrop {
  background: rgba(9, 20, 16, 0.62);
  backdrop-filter: blur(10px);
}

.community-note-editor-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
  margin: 0;
}

.community-note-editor-head,
.community-note-editor-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.96);
}

.community-note-editor-head {
  justify-content: space-between;
  border-bottom: 1px solid #e5eee7;
}

.community-note-editor-head p,
.community-note-editor-head h2 {
  margin: 0;
}

.community-note-editor-head p {
  color: #1f6f4b;
  font-weight: 800;
}

.community-note-editor-head h2 {
  color: #183b30;
  font-size: var(--type-medium-size) !important;
  line-height: 1.25;
}

.community-note-editor-close {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #dbe8de;
  border-radius: 50%;
  background: #edf7f1;
  color: #183b30;
  font-size: 26px !important;
  line-height: 1;
}

.community-note-editor-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

.community-note-editor-body .community-field-wide,
.community-note-editor-media,
.community-note-editor-body .community-composer-message {
  grid-column: 1 / -1;
}

.community-note-editor-body :where(input, textarea, select) {
  width: 100%;
}

.community-note-editor-body textarea {
  min-height: 150px;
  resize: vertical;
}

.community-note-editor-media {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dce8df;
  border-radius: 16px;
  background: #f7fbf8;
}

.community-note-editor-media > div:first-child {
  display: grid;
  gap: 4px;
}

.community-note-editor-media > div:first-child > span {
  color: #66746f;
}

.community-note-editor-preview {
  display: grid;
  min-height: 96px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #edf7f1;
  color: #66746f;
}

.community-note-editor-preview :where(img, video) {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.community-note-editor-picker,
.community-note-editor-remove {
  display: flex;
  align-items: center;
  gap: 10px;
}

.community-note-editor-picker {
  justify-content: space-between;
  flex-wrap: wrap;
}

.community-note-editor-picker input {
  width: min(100%, 360px);
}

.community-note-editor-remove input {
  width: 18px;
  height: 18px;
}

.community-note-editor-actions {
  justify-content: flex-end;
  border-top: 1px solid #e5eee7;
}

@media (max-width: 640px) {
  .community-note-editor {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .community-note-editor-head,
  .community-note-editor-actions,
  .community-note-editor-body {
    padding: 16px;
  }

  .community-note-editor-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-note-editor-body .community-field-wide,
  .community-note-editor-media,
  .community-note-editor-body .community-composer-message {
    grid-column: auto;
  }

  .community-note-editor-actions > button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  body[data-page="community"] .community-note-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Community notes grow with their content while keeping uploaded media proportionate. */
body[data-page="community"] .community-note-grid.is-masonry {
  --community-note-card-gap: 18px;
  grid-auto-rows: 8px;
  column-gap: var(--community-note-card-gap);
  row-gap: 0;
  align-items: start;
}

body[data-page="community"] .community-note-grid.is-masonry > .community-note-card {
  grid-row-end: span var(--community-note-row-span, 1);
  margin-bottom: var(--community-note-card-gap);
}

body[data-page="community"] .community-note-media {
  height: auto;
  aspect-ratio: var(--community-media-ratio, 4 / 5);
  object-fit: cover;
  object-position: center;
}

body[data-page="community"] .community-note-media[data-community-media-shape="landscape"] {
  background: #e4efe6;
}

body[data-page="community"] .community-text-cover {
  min-height: 168px;
  aspect-ratio: auto;
  justify-content: flex-start;
  gap: 18px;
}

body[data-page="community"] .community-text-cover p {
  display: -webkit-box;
  margin-top: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
}

body[data-page="community"] .community-note-info h2 {
  -webkit-line-clamp: 3;
}

body[data-page="community"] .community-note-info > p {
  -webkit-line-clamp: 7;
}

body[data-community-view="publish"] .community-mini-note-list .community-note-media,
body[data-community-view="publish"] .community-mini-note-list .community-text-cover {
  height: 118px;
  aspect-ratio: 1;
}

@media (max-width: 720px) {
  body[data-page="community"] .community-note-grid.is-masonry {
    --community-note-card-gap: 12px;
  }

  body[data-page="community"] .community-text-cover {
    min-height: 150px;
    padding: 18px;
  }
}

/* Site-wide UI review: concentric navigation, flatter homepage hierarchy, and a true page footer. */
body[data-page="home"] {
  --home-radius-outer: 32px;
  --home-radius-inner: 24px;
  --home-radius-control: 18px;
}

.glass-topbar {
  border-radius: var(--shell-radius-outer) !important;
  overflow: hidden;
}

.glass-topbar .brand-mark {
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(145deg, #1f7a50, #165c2a) !important;
  box-shadow: 0 8px 20px rgba(22, 92, 42, 0.18);
}

.glass-topbar .nav {
  gap: clamp(6px, 1.1vw, 16px);
  padding: 5px 6px;
  border: 1px solid rgba(29, 105, 57, 0.1);
  border-radius: var(--shell-radius-inner);
  background: rgba(250, 253, 250, 0.72);
}

.glass-topbar .nav a {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(14px, 1.35vw, 22px);
  border-radius: var(--shell-radius-control);
}

.glass-topbar .nav a[aria-current="page"] {
  color: #165c2a;
  background: rgba(220, 239, 229, 0.92);
}

.glass-topbar .nav a[aria-current="page"]::after {
  left: 50%;
  right: auto;
  bottom: 4px;
  width: clamp(20px, 42%, 34px);
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
}

body[data-page="home"] .home-device-overview {
  gap: clamp(20px, 2.4vw, 32px);
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: var(--home-radius-outer) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="home"] .home-device-overview .device-panel,
body[data-page="home"] .home-device-overview .glasses-card {
  border-radius: var(--home-radius-inner) !important;
  box-shadow: 0 18px 44px rgba(18, 77, 42, 0.08) !important;
}

body[data-page="home"] .home-device-overview .device-stats {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(29, 105, 57, 0.12);
  border-radius: var(--home-radius-control);
  background: rgba(241, 249, 243, 0.8);
}

body[data-page="home"] .home-device-overview .device-stat-card {
  min-height: 96px;
  padding: 16px 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

body[data-page="home"] .home-device-overview .device-stat-card + .device-stat-card {
  border-left: 1px solid rgba(29, 105, 57, 0.12) !important;
}

body[data-page="home"] .home-device-overview .device-stat-card:hover {
  background: rgba(220, 239, 229, 0.52) !important;
  box-shadow: none !important;
  transform: none !important;
}

.home-footer {
  width: 100% !important;
  margin: clamp(32px, 4vw, 56px) 0 0 !important;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  color: var(--site-footer-text);
  background: linear-gradient(135deg, var(--site-footer-deep), var(--site-footer-deeper));
  box-shadow: none;
}

.home-footer-inner {
  display: flex;
  width: var(--page-width);
  min-height: 128px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 auto;
  padding: 30px 0;
}

.home-footer-signature {
  display: grid;
  gap: 4px;
}

.home-footer-signature strong {
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.home-footer-signature span {
  color: var(--site-footer-text);
}

.home-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--shell-radius-inner);
  background: rgba(255, 255, 255, 0.07);
}

.home-footer-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: var(--shell-radius-control);
  color: #f7fcf8;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.home-footer-nav a:hover,
.home-footer-nav a:focus-visible {
  color: #123d29;
  background: #dcefe5;
}

.home-footer-nav a:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.86);
  outline-offset: 3px;
}

@media (max-width: 960px) {
  .glass-topbar {
    align-items: center;
    flex-wrap: wrap;
  }

  .glass-topbar .nav {
    display: flex;
    flex: 1 0 100%;
    gap: 4px;
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .glass-topbar .nav a {
    flex: 1 0 auto;
    padding-inline: 12px;
  }

  .glass-topbar .nav::-webkit-scrollbar {
    display: none;
  }

  body[data-page="home"] .home-device-overview .device-stat-card {
    min-height: 80px;
  }

  body[data-page="home"] .home-device-overview .device-stat-card + .device-stat-card {
    border-top: 1px solid rgba(29, 105, 57, 0.12) !important;
    border-left: 0 !important;
  }

  .home-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-footer-nav {
    width: 100%;
  }
}

@media (max-width: 720px) {
  body[data-page="home"] {
    --home-radius-outer: 26px;
    --home-radius-inner: 20px;
    --home-radius-control: 15px;
  }

  .glass-topbar {
    --shell-radius-outer: 26px;
    --shell-radius-inner: 20px;
    --shell-radius-control: 15px;
    width: calc(100% - 20px) !important;
    border-radius: var(--shell-radius-outer) !important;
  }

  .glass-topbar .brand-mark {
    width: 38px;
    height: 38px;
  }

  .glass-topbar .nav {
    justify-content: space-between;
    padding: 4px;
    border-radius: var(--shell-radius-inner);
  }

  .glass-topbar .nav a {
    min-width: 44px;
    min-height: 44px;
    flex: 1 0 auto;
    padding-inline: 9px;
    border-radius: var(--shell-radius-control);
  }

  .glass-topbar .nav a[aria-current="page"]::after {
    bottom: 4px;
    width: 20px;
    height: 2px;
  }

  body[data-page="home"] .home-device-overview {
    gap: 18px;
  }

  body[data-page="home"] .home-device-overview .device-panel,
  body[data-page="home"] .home-device-overview .glasses-card {
    border-radius: var(--home-radius-inner) !important;
  }

  .home-footer {
    margin-top: 24px !important;
  }

  .home-footer-inner {
    min-height: 0;
    gap: 22px;
    padding: 28px 0 34px;
  }

  .home-footer-nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-footer-nav a {
    padding-inline: 8px;
  }
}

@media (max-width: 560px) {
  body[data-page="home"] .home-device-overview .device-stats {
    border-radius: var(--home-radius-control);
  }
}

@media (max-width: 360px) {
  .glass-topbar .nav {
    gap: 2px;
  }

  .glass-topbar .nav a {
    min-width: 0;
    flex: 1 1 0;
    padding-inline: 4px;
    font-size: 0.82rem;
  }
}
