/* #region zone:health.mono.shell — เมนู pill ด้านบน desktop และแถบลอยบนโทรศัพท์ */
html:root .app {
  display: block;
  min-height: 100dvh;
  background: var(--mono-bg);
}

html:root body.is-signed-in .app {
  display: block;
  grid-template-columns: none;
}

html:root .sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  width: 100%;
  height: auto;
  border: 0;
  background: color-mix(in srgb, var(--mono-bg) 92%, transparent);
  backdrop-filter: blur(18px);
}

html:root .side-inner {
  width: min(100%, 1536px);
  min-height: 76px;
  height: auto;
  margin: 0 auto;
  padding: 14px clamp(var(--sp-4), 3.4vw, 48px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
}

html:root .side-top {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  border: 0;
}

html:root .brand {
  gap: 10px;
  min-height: 44px;
  color: var(--mono-ink);
}

html:root .brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  filter: grayscale(1) contrast(1.35);
}

html:root .brand-text {
  font-size: 15px;
  font-weight: 650;
}

html:root .brand-text small {
  display: none;
}

html:root .sidebar .who {
  order: 4;
  width: auto;
  max-width: 210px;
  min-height: 44px;
  margin: 0;
  padding: 6px 14px 6px 6px;
  border: 0;
  border-radius: var(--u-radius-pill);
  background: var(--mono-card);
}

html:root .who-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--mono-ink);
  color: var(--mono-bg);
  font-size: 11px;
}

html:root .nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

html:root .nav ul {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: var(--sp-1);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-radius: var(--u-radius-pill);
  background: var(--mono-card);
  scrollbar-width: none;
}

html:root .nav li {
  flex: 0 0 auto;
}

html:root .nav .nav-item {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--u-radius-pill);
  color: var(--mono-muted);
  gap: 0;
  font-size: var(--u-text-sm);
  font-weight: 500;
}

html:root .nav .nav-item .icon {
  display: none;
}

html:root .nav .nav-item[aria-current='page'] {
  background: var(--mono-ink);
  color: var(--mono-bg);
}

html:root .side-foot {
  order: 3;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border: 0;
}

html:root .side-foot .nav-btn {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--mono-card);
}

html:root .side-foot .nav-label {
  display: none;
}

html:root .workspace {
  width: 100%;
  min-width: 0;
  margin: 0;
}

html:root #main {
  width: min(100%, 1536px);
  margin: 0 auto;
  padding: 30px clamp(var(--sp-4), 3.4vw, 48px) 72px;
}

html:root .privacy {
  width: min(calc(100% - 32px), 1440px);
  margin: var(--sp-3) auto 0;
  border: 0;
  border-radius: 20px;
  background: var(--mono-card);
}

html:root .profile-menu {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: mono-menu-in 150ms ease both;
}

html:root .profile-menu-title {
  padding: 10px var(--sp-3) 7px;
  color: var(--mono-muted);
}

html:root .profile-menu-item:hover,
html:root .profile-menu-item:focus-visible {
  background: var(--mono-card);
}

html:root .profile-menu-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mono-ink);
  color: var(--mono-bg);
  font-size: 11px;
}

html:root .profile-menu-avatar--add {
  background: var(--mono-card);
  color: var(--mono-ink);
  font-size: 18px;
}

html:root .profile-menu-name {
  flex: 1;
}

html:root .profile-menu-separator {
  height: 1px;
  margin: 6px var(--sp-2);
  background: var(--mono-faint);
}

@keyframes mono-menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1023px) and (min-width: 600px) {
  html:root .side-inner {
    flex-wrap: wrap;
  }

  html:root .nav {
    order: 5;
    flex-basis: 100%;
  }
}

@media (max-width: 599px) {
  html:root .sidebar {
    display: none !important;
  }

  html:root .topbar {
    position: static;
    height: auto;
    padding: var(--sp-5) var(--sp-4) 6px;
    border: 0;
    background: var(--mono-bg);
  }

  html:root .topbar .brand {
    display: inline-flex;
  }

  html:root .topbar-title {
    display: none;
  }

  html:root .topbar .who {
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mono-card);
  }

  html:root .topbar .who-name,
  html:root .topbar .who > .icon {
    display: none;
  }

  html:root #main {
    padding: var(--sp-1) var(--sp-4) var(--sp-5);
  }

  html:root body.is-signed-in .app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
  }

  html:root body.is-signed-in .workspace {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  html:root .tabbar {
    position: relative;
    inset: auto;
    flex: 0 0 58px;
    margin: 8px max(16px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
    height: 58px;
    padding: 0 68px 0 0;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  html:root .tabbar #tabbar-list {
    position: relative;
    height: 58px;
    padding: 7px;
    display: flex;
    justify-content: space-around;
    gap: var(--sp-2);
    border: 1px solid var(--mono-faint);
    border-radius: var(--u-radius-pill);
    background: var(--mono-glass);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(16px);
    pointer-events: auto;
  }

  html:root .tabbar #tabbar-list .nav-item {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  html:root .tabbar .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  html:root .tabbar li:has(.nav-item--record) {
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
  }

  html:root .tabbar #tabbar-list .nav-item--record {
    width: 58px;
    height: 58px;
    min-height: 58px;
    background: var(--mono-ink);
    color: var(--mono-bg);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  }

  html:root .tabbar .nav-item--record .icon {
    display: block;
    width: 28px;
    height: 28px;
  }

  html:root .tabbar #tabbar-list .nav-item::before {
    content: none;
  }

  html:root .tabbar .nav-item[aria-current='page']:not(.nav-item--record),
  html:root .tabbar #more-open.is-current {
    background: var(--mono-ink);
    color: var(--mono-bg);
  }
}
/* #endregion */

/* #region zone:health.mono.header-actions — ขนาดวงกลมและช่องไฟเดียวกันในเมนูเต็มและย่อ */
html:root .sidebar .side-foot {
  flex: 0 0 auto;
  width: auto;
  gap: var(--sp-2);
}
html:root .sidebar .who {
  height: 44px;
  padding-block: 5px;
  border: 1px solid var(--mono-faint);
}
html:root .nav-btn:not([data-who-open]) {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  gap: 0;
  border: 1px solid var(--mono-faint);
  border-radius: 50%;
  background: var(--mono-card);
  font-size: 0;
  line-height: 1;
}
html:root .nav-btn:not([data-who-open]) .nav-label {
  display: none;
}
html:root .nav-btn:not([data-who-open]) .icon {
  display: block;
  margin: 0;
}
html:root .more-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  gap: var(--sp-2);
  align-items: center;
}
html:root .profile-menu-hint {
  padding: var(--sp-2) var(--sp-3);
  color: var(--mono-muted);
  font-size: var(--u-text-xs);
}
/* #endregion */

/* #region zone:health.mono.action-labels — ปุ่มไอคอนไม่เหลือแถวข้อความที่มองไม่เห็น */
html:root .nav-btn:not([data-who-open]) > span:not([data-icon]) {
  display: none;
}
html:root .nav-btn:not([data-who-open]) > [data-icon] {
  display: grid;
  place-items: center;
}
/* #endregion */
