/* #region zone:health.style.shell — เมนูซ้าย (ขยาย/ย่อ/แท็บเล็ต) แถบล่างมือถือ แผ่นเพิ่มเติม แบนเนอร์ความเป็นส่วนตัว */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
}
body.is-signed-in .app {
  grid-template-columns: var(--side-w) minmax(0, 1fr);
}
.workspace {
  min-width: 0;
  container: workspace / inline-size;
}
/* ---------- sidebar ---------- */
/* The sidebar cell stretches the whole page height (its background and border run to the bottom);
   the content inside stays pinned to the viewport. */
.sidebar {
  position: relative;
  z-index: 8;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.side-inner {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  height: 100dvh;
  padding: var(--sp-4) var(--sp-3);
}
.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: var(--target);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: var(--target);
  min-height: var(--target);
  padding-inline: var(--sp-1);
  border-radius: var(--r-control);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.brand-text {
  display: grid;
  line-height: 1.25;
}
.brand-text small {
  font-size: var(--u-text-sm);
  font-weight: 500;
  color: var(--muted);
}
.logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
}
.who {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 52px;
  padding: var(--sp-2) var(--sp-3);
  border-color: var(--line);
  background: var(--panel2);
  color: var(--text);
  text-align: left;
}
.who:hover {
  background: var(--hover);
}
.who-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--acc-soft);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
}
.who-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who .icon {
  color: var(--muted);
}
.nav {
  flex: 1;
  min-height: 0;
}
.nav ul,
.more-list,
#tabbar-list {
  display: grid;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-item,
.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: var(--target);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  text-align: left;
}
.nav-item:hover,
.nav-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.nav-item[aria-current='page'] {
  background: var(--acc-soft);
  color: var(--accent-text);
  font-weight: 700;
}
.side-foot {
  display: grid;
  gap: var(--sp-1);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
[data-tip] {
  position: relative;
}
@media (max-height: 700px) {
  .side-inner {
    overflow-y: auto;
  }
}
/* ---------- privacy banner ---------- */
.privacy {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: min(calc(var(--page-w) - 2 * var(--sp-8)), calc(100% - 2 * var(--sp-8)));
  margin: var(--sp-4) auto 0;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border-radius: var(--r-inner);
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: var(--u-body);
  font-weight: 600;
  line-height: 1.5;
}
.privacy p {
  flex: 1;
  margin: 0;
}
.privacy .icon-btn {
  color: inherit;
}
.privacy .icon-btn:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: inherit;
}
.notice {
  display: grid;
  justify-items: start;
  gap: var(--sp-3);
}
.notice h2,
.notice ul {
  margin: 0;
}
.notice ul {
  padding-left: var(--sp-5);
  display: grid;
  gap: var(--sp-2);
}
.notice-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--warn-soft);
  color: var(--warn-text);
}
/* ---------- main column ---------- */
main {
  max-width: var(--page-w);
  padding: var(--sp-8);
  margin-inline: auto;
}
body:not(.is-signed-in) main {
  padding-top: var(--sp-8);
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.page-head-text {
  min-width: 0;
}
.page-head p {
  margin: 0;
}
.page-title {
  margin-bottom: var(--sp-1);
}
.page-title:focus {
  outline: none;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
.tz-note {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
/* ---------- phone: top bar, bottom bar, "เพิ่มเติม" sheet ---------- */
.topbar,
.tabbar {
  display: none;
}
@media (max-width: 599px) {
  body.is-signed-in .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-1) var(--sp-4);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .who--compact {
    width: auto;
    max-width: 48%;
    min-height: var(--target);
    padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
    border-radius: var(--r-pill);
  }
  .who--compact .who-avatar {
    width: 30px;
    height: 30px;
  }
  .who--compact .who-name {
    display: block;
    flex: 0 1 auto;
    font-size: 14px;
  }
  .who--compact .icon {
    display: none;
  }
  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 9;
    display: block;
    padding: 0 var(--sp-2) env(safe-area-inset-bottom, 0px);
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
  #tabbar-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }
  #tabbar-list .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 60px;
    padding: var(--sp-2) 0;
    font-size: 12.5px;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-align: center;
  }
  #tabbar-list .nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #tabbar-list .nav-item[aria-current='page'],
  #tabbar-list .nav-item.is-current {
    background: transparent;
    color: var(--accent-text);
  }
  #tabbar-list .nav-item[aria-current='page']::before,
  #tabbar-list .nav-item.is-current::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28%;
    right: 28%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
  }
  main {
    padding: var(--sp-5) var(--sp-4) calc(84px + env(safe-area-inset-bottom, 0px));
  }
  body:not(.is-signed-in) main {
    padding-bottom: var(--sp-6);
  }
  .privacy {
    width: calc(100% - 2 * var(--sp-4));
    margin-top: var(--sp-3);
    font-size: 14px;
  }
}
.sheet {
  width: min(520px, calc(100% - 32px));
}
.more-list {
  margin-bottom: var(--sp-3);
}
.more-foot {
  display: grid;
  gap: var(--sp-1);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
@media (max-width: 599px) {
  .sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: var(--r-card) var(--r-card) 0 0;
    border-bottom: 0;
    padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
    animation: sheet-in var(--dur-slow) var(--ease-out);
  }
  .sheet .nav-item,
  .sheet .nav-btn {
    min-height: 52px;
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
@media (max-width: 640px) {
  main {
    padding-inline: var(--sp-4);
  }
}
/* #endregion */
