/* Auth screens remain full screen */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.auth-screen.hidden { display: none !important; }

/* Auth / login screens */
.auth-background {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--accent) 18%, transparent) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 40%),
    var(--bg);
  padding: 1rem;
}
.auth-surface {
  width: 100%;
  max-width: 420px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 60px color-mix(in srgb, #000 20%, transparent);
  text-align: center;
  backdrop-filter: blur(8px);
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.auth-logo {
  height: 2.25rem;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.auth-brand-text {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--ui-font);
}
.auth-brand-name {
  font-family: var(--memo-font);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.auth-brand-divider { color: var(--muted); font-weight: 500; }
.auth-brand-product {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}
.auth-title {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.auth-lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1.75rem;
}
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
}
.auth-actions.compact-actions {
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}
.auth-actions.compact-actions .secondary {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}
.auth-actions.compact-actions .auth-primary-btn {
  width: auto;
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
}
.auth-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: #fff;
  color: #1f1f1f;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.auth-primary-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}
.auth-btn-icon { height: 1.25rem; width: 1.25rem; flex-shrink: 0; }
.auth-footnote {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 1.5rem 0 0;
  line-height: 1.4;
}

.auth-surface.compact {
  max-width: 420px;
  padding: 1.75rem 1.5rem 1.5rem;
}
.auth-surface.compact.tight {
  max-width: 380px;
  padding: 1.25rem 1.25rem 1rem;
}
.auth-form.compact .auth-title {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}
.auth-form.compact .auth-lead {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.auth-form.compact.tight .auth-title {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.auth-form.compact.tight .auth-lead {
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}
.auth-form.compact .compact-fields {
  display: grid;
  gap: 0.55rem;
  text-align: left;
}
.auth-form.compact .compact-fields.tight-fields {
  gap: 0.35rem;
}
.auth-form.compact label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: -0.25rem;
}
.auth-form.compact.tight label {
  font-size: 0.78rem;
  margin-bottom: -0.3rem;
}
.auth-form.compact input,
.auth-form.compact select {
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  border-radius: 8px;
}
.auth-form.compact.tight input,
.auth-form.compact.tight select {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Legacy login styles kept for any remaining references */
.login-view-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}
.login-card.panel {
  text-align: center;
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
}
.login-brand {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  line-height: 1;
  display: flex;
  justify-content: center;
}
.login-logo { height: 4rem; width: auto; }
.login-card h1 {
  margin: 0 0 0.15rem;
  font-size: 2rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.login-subtitle {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}
.google-login-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: filter 0.15s;
}
.google-login-btn:hover { filter: brightness(1.1); }
.login-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1.5rem;
}

/* User menu in header */
.user-menu {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding-top: 0.65rem;
  border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 0.15rem;
  cursor: pointer;
}
.user-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-menu {
  position: absolute;
  left: calc(100% + 0.55rem);
  bottom: -0.25rem;
  z-index: 1000;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 0.35rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.avatar-menu-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.35rem 0.65rem 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}
.avatar-menu-info strong {
  font-size: 0.85rem;
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-menu-info span {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-menu-logout {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}
.avatar-menu-logout:hover {
  background: var(--panel-2);
  color: var(--danger);
}
.user-menu-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
}
.user-menu-text > span {
  font-size: 0.88rem;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--muted);
  text-decoration: none;
}
.logout-btn:hover { color: var(--danger); }

footer { display: none; }
footer small { font-size: 0.75rem; opacity: 0.8; font-style: italic; }

#settings-view h1,
#settings-view h2,
#settings-view h3,
#settings-view h4,
#settings-view .settings-tab,
.users-section-title {
  font-family: var(--ui-font);
}

#settings-view h2 {
  font-family: var(--memo-font);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

#settings-view h3 {
  font-family: var(--memo-font);
  font-size: 1.05rem;
  font-weight: 650;
  margin: 1.25rem 0 0.5rem;
}

#settings-view h4 {
  font-family: var(--memo-font);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
}

#settings-view label {
  font-size: 0.85rem;
  font-weight: 600;
}

.settings-layout { display: flex; gap: 1.5rem; min-height: 0; height: 100%; }

.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 220px;
  max-width: 260px;
  padding: 0.25rem;
}

.settings-sidebar-title {
  font-family: var(--ui-font);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0.9rem 0.2rem;
  margin: 0;
}

.settings-nav-item {
  text-align: left;
  padding: 0.8rem 1rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-nav-item:hover {
  background: var(--panel);
  color: var(--text);
}

.settings-nav-item.active {
  background: var(--panel);
  color: var(--accent);
  border-color: var(--line);
  font-weight: 700;
}

.settings-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  font-size: 0.98rem;
  padding-right: 0.5rem;
}

.settings-tab-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-tab-panel.hidden { display: none; }

.settings-content .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

