.backup-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }
/* App shell: sidebar, main column, mobile top bar and bottom tabs. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; border-bottom: 1px solid var(--line); }
/* The yente logo; the same file is the favicon, so swapping web/icons/logo.svg changes both. */
.brand-mark { display: block; width: 34px; height: 34px; flex-shrink: 0; }
.app-name { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
.brand-date { font-size: var(--fs-xs); color: var(--text-3); }
.nav-label { padding: 12px 12px 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); letter-spacing: .04em; }
.area-switch { display: grid; gap: 6px; margin-top: 16px; padding: 0 4px; }
.area-switch .segments { display: flex; width: 100%; }
.area-switch .segments button { flex: 1; min-height: 28px; padding: 3px 6px; font-size: var(--fs-xs); }
.area-hint { font-size: var(--fs-xs); padding-left: 2px; }
.nav { display: grid; gap: 3px; }
.nav a {
  position: relative;
  height: 40px;
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 12px;
  color: var(--text-2);
  border-radius: 10px;
  font-size: var(--fs-md);
  font-weight: 500;
  text-decoration: none;
}
.nav a .icon { color: var(--text-3); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--highlight-soft); color: var(--highlight); font-weight: 600; }
.nav a.active .icon { color: var(--highlight); }
.nav a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 3px;
  height: 20px;
  transform: translateY(-50%);
  background: var(--highlight);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px var(--glow);
}
.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: center;
  line-height: 20px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.nav a.active .nav-count { background: var(--highlight); color: var(--on-accent); box-shadow: 0 0 10px var(--glow); }
.nav-count.hot { background: var(--danger-soft); color: var(--danger); }
.overdue-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.sidebar footer { margin-top: auto; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar footer > * { justify-content: flex-start; }
.data-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.data-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.data-link .backup-dot { margin-left: auto; }
.data-link.active { background: var(--highlight-soft); color: var(--highlight); font-weight: 600; text-decoration: none; }
.theme-button { height: 36px; padding: 0 12px; gap: 10px; font-weight: 400; color: var(--text-2); }
.main { margin-left: var(--sidebar-w); padding: 14px 20px 24px; min-height: 100dvh; }
.page { max-width: none; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px var(--gap); margin-bottom: 14px; flex-wrap: wrap; }
.subtitle { margin-top: 2px; color: var(--text-2); font-size: var(--fs-sm); }
.mobile-top, .mobile-area, .bottom-nav { display: none; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(100%, 380px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.login-card h1 { margin-bottom: 24px; }
@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 12px 14px calc(80px + env(safe-area-inset-bottom)); min-height: calc(100dvh - 52px); }
  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px 8px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--sidebar);
  }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; flex-shrink: 0; }
  .mobile-brand .brand-mark { width: 28px; height: 28px; }
  .mobile-area {
    display: block;
    position: sticky;
    top: 53px;
    z-index: 3;
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--sidebar);
  }
  .mobile-area .area-switch { margin: 0; padding: 0; }
  .mobile-area .area-hint { display: none; }
  .mobile-top .actions { gap: 4px; }
  .mobile-menu {
    position: absolute;
    z-index: 5;
    right: 12px;
    top: 50px;
    padding: 8px;
    display: grid;
    gap: 2px;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
  }
  .mobile-menu a { padding: 8px 10px; color: var(--text); }
  .mobile-menu .backup-dot { display: inline-block; margin-left: 6px; vertical-align: middle; }
  .bottom-nav {
    display: flex;
    position: fixed;
    z-index: 4;
    inset: auto 0 0;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .bottom-nav a {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: var(--fs-xs);
    gap: 2px;
    text-decoration: none;
  }
  .bottom-nav a.active { color: var(--highlight); font-weight: 650; }
  .bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 18px;
    height: 3px;
    transform: translateX(-50%);
    background: var(--highlight);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 10px var(--glow);
  }
  .bottom-nav .icon { font-size: 21px; }
  .bottom-nav .overdue-dot { position: absolute; top: 9px; right: calc(50% - 16px); }
  .page-header { margin-bottom: 10px; align-items: center; }
  h1 { font-size: 22px; }
}

/* Boot skeleton shown in index.html until the first data load finishes. */
@keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton, .skeleton-nav span {
  display: block;
  border-radius: var(--radius-lg);
  background-color: var(--neutral-soft);
  background-image: linear-gradient(90deg, var(--neutral-soft), var(--skeleton-shine), var(--neutral-soft));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
}
.skeleton-nav { display: grid; gap: 10px; padding: 24px 6px; }
.skeleton-nav span { height: 30px; border-radius: 10px; }
.skeleton-title { width: 180px; height: 34px; margin-bottom: 26px; }
.skeleton-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.skeleton-card { height: 420px; }
.skeleton-card.side { height: 260px; }
@media (max-width: 899px) { .boot .sidebar { display: none; } .skeleton-grid { grid-template-columns: 1fr; } .skeleton-card.side { display: none; } }
.capture-trigger {
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  margin-top: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.capture-trigger:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); border-color: var(--accent-hover); }

@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.main > * { animation: page-in .2s var(--ease); }
@supports (backdrop-filter: blur(1px)) {
  dialog::backdrop { backdrop-filter: blur(4px); }
  .palette { background: var(--glass); backdrop-filter: blur(20px) saturate(1.4); border: 1px solid var(--glass-border); }
  .mobile-top, .mobile-area, .bottom-nav { background: var(--glass-bar); backdrop-filter: blur(16px) saturate(1.3); }
}

@media (max-width: 899px) {
  .mobile-top.notes-hidden, .mobile-area.notes-hidden { display: none; }
}
