/* Login · Settings · Inbox — ported 1:1 from Noa's mock
   (hyperfocus_auth_inbox_mock.html). Reuses .btn and .av from app.css. */

/* ---- field ---- */
.field { text-align: left; }
.field + .field { margin-top: var(--space-3); }
.field label { display: block; font-size: 11px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.field .input-wrap { position: relative; display: flex; align-items: center; }
.field input { width: 100%; height: 40px; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0 12px; font-family: inherit; font-size: 13px; color: var(--text-primary); transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.field input::placeholder { color: var(--text-tertiary); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.field.err input { border-color: var(--danger); }
.field.err .help { color: var(--danger); }
.field .help { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }

/* ---- login ---- */
.login-stage { position: fixed; inset: 0; z-index: 70; background: radial-gradient(120% 130% at 50% -25%, rgba(124,108,240,0.13), transparent 55%), var(--bg-canvas); display: grid; place-items: center; padding: var(--space-12) var(--space-8); }
.login-card { width: 360px; max-width: calc(100vw - 32px); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-8) var(--space-6) var(--space-6); box-shadow: var(--elev-2); }
.login-lockup { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); }
.login-lockup svg { width: 44px; height: 44px; }
.login-lockup .wm { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; }
.login-head { text-align: center; margin-bottom: var(--space-6); }
.login-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; margin-bottom: 4px; }
.login-head p { font-size: 12px; color: var(--text-tertiary); }
.auth-error { display: flex; align-items: center; gap: var(--space-2); background: var(--danger-tint); border: 1px solid rgba(224,85,107,0.30); border-radius: var(--radius-md); padding: 9px var(--space-3); font-size: 12px; color: var(--danger); margin: var(--space-4) 0 0; }
.auth-error svg { width: 15px; height: 15px; flex: none; }
.login-card .btn-primary { width: 100%; height: 40px; margin-top: var(--space-4); }
.login-foot { text-align: center; font-size: 11px; color: var(--text-tertiary); margin-top: var(--space-6); }

/* ---- topbar icons + bell badge ---- */
.tb-icon { position: relative; width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.tb-icon:hover, .tb-icon.active { background: var(--bg-elevated); color: var(--text-primary); }
.tb-icon svg { width: 18px; height: 18px; }
/* chat entry chip — left of view-switch (Vercel-header labeled-pill anatomy) */
.chat-entry { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-full); background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); font-size: 12.5px; font-weight: 500; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.chat-entry::before { content: ''; position: absolute; inset: -6px 0; }   /* 44px vertical hit area */
.chat-entry svg { width: 16px; height: 16px; flex: none; }
.chat-entry:hover { background: var(--bg-elevated); color: var(--text-primary); }
.chat-entry.active { background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }
.chat-entry.active:hover { background: var(--accent-tint-strong); }
.chat-entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 5px; border-radius: var(--radius-full); background: var(--danger); color: #fff; font-family: var(--font-mono); font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--bg-base); }
.tb-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: var(--radius-full); }
.tb-user:hover { background: var(--bg-elevated); }
.tb-user .uname { font-size: 12.5px; color: var(--text-secondary); }

/* ---- settings view ---- */
.settings-host { height: calc(100vh - 52px); display: flex; flex-direction: column; }
.settings-scroll { flex: 1; overflow-y: auto; padding: var(--space-8) var(--space-8) 0; }
.settings-col { max-width: 640px; margin: 0 auto; }
.settings-col h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.4px; margin-bottom: 4px; }
.settings-col .page-sub { font-size: 12.5px; color: var(--text-secondary); margin-bottom: var(--space-8); }
.set-section { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }
.set-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.set-section-label { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--space-2); }
.srow { display: flex; align-items: center; min-height: 56px; padding: var(--space-2) var(--space-3); margin: 0 calc(-1 * var(--space-3)); border-radius: var(--radius-md); }
.srow .slabel { width: 160px; flex: none; font-size: 12.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 9px; }
.srow .svalue { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); font-size: 13px; color: var(--text-primary); }
.srow .svalue input { background: var(--bg-input); border: 1px solid var(--border-default); color: var(--text-primary); border-radius: var(--radius-md); height: 34px; padding: 0 10px; font-family: inherit; font-size: 13px; }
.srow .svalue input:focus { outline: none; border-color: var(--accent); }
.avatar-upload { display: flex; align-items: center; gap: var(--space-4); }
.upload-actions { display: flex; flex-direction: column; gap: 6px; }
.upload-actions .btn { height: 32px; padding: 0 12px; font-size: 12px; }
.rate-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--radius-full); background: var(--accent-tint); color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.save-bar { flex: none; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-8); background: var(--bg-base); border-top: 1px solid var(--border-subtle); }
.save-bar .spacer { flex: 1; }
.save-bar .save-note { font-size: 11.5px; color: var(--text-tertiary); }

/* ---- inbox dropdown panel ---- */
.inbox-overlay { position: fixed; inset: 0; z-index: 48; }
.inbox-panel { position: fixed; top: 56px; right: 16px; width: 420px; max-width: calc(100vw - 32px); max-height: calc(100vh - 80px); overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--elev-3); z-index: 49; animation: slideUp var(--dur-normal) var(--ease-out); }
.inbox-head { display: flex; align-items: center; gap: var(--space-2); height: 52px; padding: 0 var(--space-3) 0 var(--space-4); border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; background: var(--bg-surface); }
.inbox-head h3 { font-size: 15px; font-weight: 600; }
.inbox-head .count { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.inbox-head .spacer { flex: 1; }
.mark-all { font-family: inherit; font-size: 12px; font-weight: 500; height: 30px; padding: 0 10px; border-radius: var(--radius-md); background: transparent; border: none; color: var(--text-secondary); cursor: pointer; }
.mark-all:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nrow { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.nrow:last-child { border-bottom: none; }
.nrow:hover { background: var(--bg-elevated); }
.nrow.unread { background: var(--accent-tint); }
.ntype { width: 28px; height: 28px; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; }
.ntype svg { width: 15px; height: 15px; }
.ntype.assigned { background: var(--accent-tint); color: var(--accent); }
.ntype.mentioned { background: rgba(61,166,224,0.14); color: var(--cat-ops); }
.ntype.due { background: var(--warning-tint); color: var(--warning); }
.ntype.budget_breach { background: var(--danger-tint); color: var(--danger); }
.nbody { flex: 1; min-width: 0; }
.nbody .ntext { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.nbody .nmeta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; font-family: var(--font-mono); }
.ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.ndot.read { background: transparent; }
.inbox-empty { text-align: center; padding: 48px var(--space-6); }
.inbox-empty .ic-wrap { width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--bg-elevated); border: 1px solid var(--border-subtle); display: grid; place-items: center; margin: 0 auto var(--space-4); color: var(--text-tertiary); }
.inbox-empty .et { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.inbox-empty .es { font-size: 13px; color: var(--text-secondary); }

/* ---- saved-view chips (board head) ---- */
.sv-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.sv-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.sv-chip:hover { color: var(--text-primary); border-color: var(--border-default); }
.sv-chip.on { background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }
.sv-chip .cx { color: var(--text-tertiary); cursor: pointer; }
.sv-chip .cx:hover { color: var(--danger); }
.sv-chip.add { border-style: dashed; }

/* ============================ Category editor (Settings > Categories) ====== */
.set-section-helper {
  font-size: 12px; color: var(--text-secondary);
  margin: 0 0 var(--space-4); line-height: 1.5;
}
.cat-editor-list { display: flex; flex-direction: column; gap: 0; }
.cat-row {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 48px; padding: var(--space-1) var(--space-3);
  margin: 0 calc(-1 * var(--space-3));
  border-radius: var(--radius-md); position: relative;
  transition: background var(--dur-fast) var(--ease-out);
}
.cat-row:hover { background: var(--bg-surface); }
.cat-row-err .cat-name-input { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-tint); }

.cat-swatch-wrap { position: relative; flex: none; }
.cat-swatch-btn {
  width: 24px; height: 24px; flex: none;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255,255,255,0.14); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
[data-theme="light"] .cat-swatch-btn { border-color: rgba(0,0,0,0.14); }
.cat-swatch-btn:hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--accent); }
.cat-swatch-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-tint-strong); }
.cat-swatch-btn:active { transform: scale(0.95); }

.cat-name-input {
  flex: 1; min-width: 0; max-width: 280px; height: 36px; padding: 0 10px;
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--fs-body); font-weight: 500;
  color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.cat-name-input:hover { border-color: var(--border-default); }
.cat-name-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }

.cat-preview-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
  white-space: nowrap; flex: none; pointer-events: none;
  transition: background var(--dur-normal) var(--ease-out), color var(--dur-normal) var(--ease-out);
}
.cat-preview-pill .catdot { width: 7px; height: 7px; border-radius: var(--radius-full); background: currentColor; flex: none; }

.cat-reset-btn {
  width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.cat-reset-btn:hover { background: var(--bg-elevated); color: var(--text-secondary); }
.cat-reset-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.cat-reset-btn:active { background: var(--bg-pressed); }
.cat-reset-btn.is-default { opacity: 0.28; pointer-events: none; }

/* delete category — hover-reveal trash icon (mirrors .cat-reset-btn grammar) */
.cat-delete-btn { flex: none; width: 28px; height: 28px; border: none; background: transparent; color: var(--text-tertiary); border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.cat-row:hover .cat-delete-btn { opacity: 1; }
.cat-delete-btn:hover { background: var(--danger-tint); color: var(--danger); }
.cat-delete-btn:focus-visible { outline: 2px solid var(--danger); outline-offset: 1px; opacity: 1; }
.cat-delete-confirm { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.cdc-q { font-size: 11px; color: var(--text-secondary); }
.cdc-btn { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-default); background: var(--bg-input); color: var(--text-primary); cursor: pointer; font-family: inherit; }
.cdc-yes { background: var(--danger); border-color: var(--danger); color: #fff; }
.cdc-yes:hover { filter: brightness(1.08); }
.cdc-no:hover { background: var(--bg-elevated); }

/* + Add category row — same layout as a .cat-row, slightly muted until typed */
.cat-row-add { border-top: 1px dashed var(--border-subtle); margin-top: 6px; padding-top: 10px; }
.cat-row-add .cat-name-input { font-style: normal; }
.cat-row-add .cat-name-input::placeholder { color: var(--text-tertiary); }
.cat-add-swatch { display: inline-block; position: relative; cursor: pointer; }
.cat-add-color-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cat-add-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--text-inverse, #fff); font-family: inherit; font-size: 12px; font-weight: 500; border-radius: var(--radius-md); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.cat-add-btn svg { width: 12px; height: 12px; }
.cat-add-btn:hover:not(:disabled) { background: var(--accent-hover); }
.cat-add-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cat-editor-footer { display: flex; justify-content: flex-end; margin-top: var(--space-3); }
.cat-reset-all-link {
  font-size: 12px; color: var(--text-tertiary); background: none; border: none;
  padding: 2px 4px; cursor: pointer; border-radius: 4px;
  transition: color var(--dur-fast) var(--ease-out);
}
.cat-reset-all-link:hover { color: var(--danger); text-decoration: underline; }
.cat-reset-all-link:focus-visible { outline: 2px solid var(--accent); }

/* palette popover */
.cat-palette-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 100;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-3);
  box-shadow: var(--elev-3); width: 224px;
}
.pop-enter { transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.pop-enter-start { opacity: 0; transform: translateY(-4px); }
.pop-enter-end { opacity: 1; transform: translateY(0); }
.cat-preset-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cat-preset-swatch {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.cat-preset-swatch:hover { transform: scale(1.12); }
.cat-preset-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-preset-swatch:active { transform: scale(0.92); }
.cat-preset-swatch.is-selected { border-color: var(--text-primary); transform: scale(1.08); }
.cat-palette-sep { border-top: 1px solid var(--border-subtle); margin: var(--space-2) 0; }
.cat-palette-custom { display: flex; align-items: center; gap: var(--space-2); }
.cat-custom-label { font-size: 11px; color: var(--text-tertiary); flex: 1; }
.cat-native-trigger {
  display: flex; align-items: center; gap: 4px; cursor: pointer; color: var(--text-secondary);
  padding: 3px; border-radius: var(--radius-sm); position: relative;
  transition: background var(--dur-fast) var(--ease-out);
}
.cat-native-trigger:hover { background: var(--bg-pressed); color: var(--text-primary); }
.cat-native-trigger input[type="color"] { position: absolute; opacity: 0; width: 100%; height: 100%; left: 0; top: 0; cursor: pointer; }
.cat-native-swatch { width: 20px; height: 20px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.14); flex: none; display: block; }
[data-theme="light"] .cat-native-swatch { border-color: rgba(0,0,0,0.14); }
.cat-hex-display { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); user-select: all; }

@media (max-width: 768px) {
  .cat-preview-pill { display: none; }
  .cat-name-input { max-width: none; }
  .cat-swatch-btn { min-width: 32px; min-height: 32px; width: 32px; height: 32px; }
}
