html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  transition: background var(--transition-fast), color var(--transition-fast);
}

body {
  display: flex;
  justify-content: center;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.view-root {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-lg) calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-2xl));
  -webkit-overflow-scrolling: touch;
}

.app-shell.no-tabbar .view-root {
  padding-bottom: calc(var(--safe-bottom) + var(--space-2xl));
}

.tab-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  display: flex;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 40;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.tab-item svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.tab-item.active {
  color: var(--color-accent);
}

.fab {
  position: fixed;
  left: 50%;
  transform: translateX(calc(-50% + (var(--app-max-width) / 2) - var(--fab-size) / 2 - var(--space-lg)));
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-md));
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-fab-text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 41;
}

.fab svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2.2;
}

@media (max-width: 500px) {
  .fab {
    transform: none;
    right: calc(var(--space-lg) + var(--safe-right));
    left: auto;
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.month-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.month-switcher button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-secondary);
}

.month-switcher button:active {
  background: var(--color-surface-alt);
}

.month-switcher .month-label {
  font-size: var(--font-size-md);
  font-weight: 600;
  min-width: 96px;
  text-align: center;
}
