/* Shared base styles */
nav {
  width: var(--sidebar-w);
  height: 100vh;
  padding: 64px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg);
  z-index: 30;
}

.nav-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
  flex-shrink: 0;
}

.nav-brand {
  text-decoration: none;
  color: inherit;
}

.nav-brand strong {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.writing-list {
  list-style: none;
  padding-left: 12px;
  margin-top: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-links a {
  display: inline-block;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--nav-size, 14px);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1), color 0.3s ease;
}

.nav-links li.active a,
.nav-links a:hover {
  color: var(--text, var(--text-primary));
  transform: translateX(12px);
}

.nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}

.nav-date {
  font-size: var(--nav-size, 14px);
  color: var(--text-secondary);
  white-space: nowrap;
}

.footer-clock {
  width: 18px;
  height: 18px;
  border: 1px solid #EDEDED;
  border-radius: 50%;
  position: relative;
}

.clock-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom;
  background: var(--text, var(--text-primary));
  border-radius: 1px;
}

.h {
  width: 1.2px;
  height: 4px;
}

.m {
  width: 1px;
  height: 6px;
}

.s {
  width: 0.8px;
  height: 7px;
  background: var(--accent);
}

.fm-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 200px;
  background: #FFFFFF;
  border: none;
  border-radius: 30px;
  padding: 6px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.fm-panel-songInfo {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.fm-title {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text, var(--text-primary));
}

.fm-artist {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  color: var(--text, var(--text-primary));
}

.fm-panel-playToggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding-left: 2px;
  outline: none;
}

.icon-play-orange {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid var(--accent);
}

.icon-stop-orange {
  width: 6px;
  height: 6px;
  background: var(--accent);
  display: none;
}

.playing .icon-play-orange {
  display: none;
}

.playing .icon-stop-orange {
  display: block;
}

.glass-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 50px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

#custom-tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--accent);
  color: #fff;
  width: 126px;
  padding: 6px 8px;
  border-radius: 25px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
  transform: translate(-50%, -140%);
}

.writing-list.nav-writing-list {
  list-style: none;
  padding-left: 12px;
  margin-top: 8px;
}

.writing-list.is-collapsed {
  display: none;
}

.writing-list.is-expanded {
  display: flex;
}

.writing-list-link {
  font-size: 13px;
  color: var(--text-secondary);
}

.writing-list-link.is-active {
  color: var(--text-primary, var(--text));
}

.mobile-menu-toggle,
.mobile-menu-panel {
  display: none;
}

@media (max-width: 767px) {
  body .layout-wrapper {
    display: block;
    min-height: 100vh;
    width: 100%;
  }

  body nav {
    width: 100%;
    height: auto;
    padding: 18px 20px;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 80;
    background: transparent;
    pointer-events: none;
  }

  body .nav-top {
    justify-content: flex-start;
    align-items: flex-end;
    gap: 0;
    pointer-events: auto;
  }

  body .nav-brand,
  body .nav-links {
    display: none;
  }

  body .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    bottom: 20px;
    left: 20px;
    min-width: 72px;
    min-height: 40px;
    padding: 10px 16px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--text, var(--text-primary));
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: auto;
    z-index: 90;
  }

  body .mobile-menu-toggle-icon {
    display: none;
    width: 10px;
    height: 10px;
    position: relative;
  }

  body .mobile-menu-toggle-icon::before,
  body .mobile-menu-toggle-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
  }

  body .mobile-menu-toggle-icon::before {
    transform: rotate(45deg);
  }

  body .mobile-menu-toggle-icon::after {
    transform: rotate(-45deg);
  }

  body nav.mobile-menu-open .mobile-menu-toggle-icon {
    display: block;
  }

  body .mobile-menu-panel {
    display: block;
    position: fixed;
    bottom: 72px;
    left: 20px;
    width: min(190px, calc(100vw - 40px));
    padding: 16px 22px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transform-origin: bottom left;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  body nav.mobile-menu-open .mobile-menu-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  body .mobile-menu-list,
  body .mobile-menu-sublist {
    list-style: none;
  }

  body .mobile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  body .mobile-menu-list a,
  body .mobile-menu-label,
  body .mobile-menu-disclosure {
    display: inline-block;
    color: var(--text-secondary);
    font: inherit;
    font-size: 16px;
    line-height: 1.2;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  body .mobile-menu-list li.active > a,
  body .mobile-menu-list li.active > .mobile-menu-label,
  body .mobile-menu-list li.active > .mobile-menu-disclosure,
  body .mobile-menu-sublist a.is-active,
  body .mobile-menu-disclosure:hover,
  body .mobile-menu-list a:hover {
    color: var(--text, var(--text-primary));
  }

  body .mobile-menu-sublist {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding-left: 14px;
  }

  body .mobile-menu-list li.is-expanded > .mobile-menu-sublist {
    display: flex;
  }

  body .mobile-menu-sublist a {
    font-size: 14px;
    line-height: 1.35;
  }

  body .nav-bottom {
    position: fixed;
    right: 20px;
    top: 18px;
    bottom: auto;
    left: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 10px;
    pointer-events: auto;
    z-index: 70;
  }

  body .nav-meta {
    min-height: 40px;
    padding: 6px 14px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  body .fm-panel {
    width: fit-content;
    max-width: min(72vw, 200px);
    border: none;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  body .fm-panel-songInfo {
    overflow: hidden;
    min-width: 0;
  }

  body .fm-artist {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body .scroll-container {
    margin-left: 0;
    width: 100%;
    height: 100vh;
  }

  body main {
    padding: 96px 20px 150px;
  }

  body .glass-header {
    left: 0;
    height: 78px;
    z-index: 20;
  }

}
