:root {
  --primary-color: #0064A0;
  --primary-hover: #005286;
  --accent-color: #0064A0;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-tint: #f8fafb;
  --surface-muted: #eef3f6;
  --border: #e2e8ef;
  --border-strong: #cfdae2;
  --text: #1a2a33;
  --text-muted: #56707c;
  --text-subtle: #8a9ba5;
  --chip-bg: #eaf2f8;
  --chip-fg: #0f3850;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.05);
  --radius: 8px;
}

/* Match the main site's body bg: dotted SVG pattern on #f5f7f9 */
body.journal-body {
  margin: 0;
  background: var(--bg) url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230064a0' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--text);
  font-size: 15px;
}

/* --- Top bar -------------------------------------------------------- */

.journal-top {
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid rgba(0, 100, 160, 0.12);
}
.journal-top-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}
.journal-top .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.journal-top .back-link .bi-lambda { font-size: 1rem; }
.journal-top .back-link:hover {
  background: rgba(0, 100, 160, 0.06);
  color: var(--primary-color);
}
.journal-top .journal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.05rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border);
}
.journal-top .journal-brand i { font-size: 1.05rem; }
.journal-top-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.autosave-dot {
  color: var(--text-subtle);
  font-size: 1rem;
  transition: color 0.15s ease, transform 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: 0 0.2rem;
}
.autosave-dot.saving { color: #d29b36; animation: pulse 1s ease infinite; }
.autosave-dot.saved  { color: #2a8f4e; }
.autosave-dot.error  { color: #c0392b; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.tool-btn { padding: 0.28rem 0.65rem; }
.tool-btn.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.tool-btn.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}
.tool-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 1rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tool-link:hover {
  background: rgba(0, 100, 160, 0.07);
  color: var(--primary-color);
}
/* Button element styled as a tool-link (for actions without an href). */
.tool-btn-link {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

/* --- Shell ---------------------------------------------------------- */

.journal-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}
.journal-main { display: flex; flex-direction: column; }

.journal-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
}
.journal-footer-inner {
  display: flex;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Sidebar -------------------------------------------------------- */

.journal-sidebar {
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  min-height: calc(100vh - 140px);
}
.sidebar-inner { padding: 1rem 0.75rem; }
.sidebar-heading {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 0 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-item {
  border-radius: 6px;
  margin-bottom: 0.15rem;
}
.sidebar-item.active {
  background: rgba(0, 100, 160, 0.08);
  box-shadow: inset 3px 0 0 var(--primary-color);
}
.sidebar-link {
  display: block;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
}
.sidebar-link:hover {
  background: rgba(0, 100, 160, 0.04);
}
.sidebar-title {
  font-weight: 500;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-sub {
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-top: 0.1rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sidebar-tag, .sidebar-client, .sidebar-date {
  white-space: nowrap;
}
.sidebar-tag { color: var(--primary-color); }
.sidebar-empty {
  color: var(--text-subtle);
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  font-style: italic;
}

/* --- Editor --------------------------------------------------------- */

.journal-editor-col {
  padding: 1.25rem 1.5rem 2rem;
  background: linear-gradient(to bottom, #fff 0%, #fdfefe 400px, #ecf0f1 100%);
  min-height: calc(100vh - 140px);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.03);
}
.journal-entry-form { max-width: 900px; margin: 0 auto; }

.entry-frontmatter {
  margin-bottom: 1rem;
}
.title-input {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.4rem 0.1rem;
  margin-bottom: 0.8rem;
  font-size: 1.7rem;
  font-weight: 500;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.title-input:focus {
  outline: none;
  border-bottom-color: var(--primary-color);
  background: transparent;
  box-shadow: none;
}
.title-input::placeholder { color: var(--text-subtle); font-weight: 400; }

.chip-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  flex-wrap: wrap;
}
.chip-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 62px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0;
}
.chip-input {
  flex: 0 1 160px;
  height: 31px;
  font-size: 0.85rem;
  padding: 0.15rem 0.5rem;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.chip-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 100, 160, 0.1);
  background: #fff;
}
select.chip-input { padding: 0.1rem 1.5rem 0.1rem 0.75rem; }

.autocomplete { position: relative; }
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 2px;
}
.suggestion-list { list-style: none; margin: 0; padding: 0.25rem 0; }
.suggestion-item {
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
}
.suggestion-item:hover, .suggestion-item.active {
  background: rgba(0, 100, 160, 0.08);
  color: var(--primary-color);
}

.tag-field {
  flex: 1;
  min-height: 31px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.2rem 0.5rem;
  background: var(--surface-tint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  position: relative;
}
.tag-field:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 100, 160, 0.1);
  background: #fff;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--chip-bg);
  color: var(--chip-fg);
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.4;
}
.tag-remove {
  background: transparent;
  border: 0;
  color: var(--chip-fg);
  padding: 0 0.1rem;
  line-height: 1;
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 0.55;
}
.tag-remove:hover { opacity: 1; color: #c0392b; }
.tag-entry {
  border: 0;
  outline: none;
  flex: 1;
  min-width: 100px;
  font-size: 0.85rem;
  background: transparent;
}

/* --- EasyMDE overrides --------------------------------------------- */

.EasyMDEContainer { margin-top: 0.75rem; }
.EasyMDEContainer .CodeMirror {
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 50vh;
  padding: 0.5rem 0.5rem;
  background: #fff;
  color: var(--text);
}
.EasyMDEContainer .CodeMirror-focused { box-shadow: 0 0 0 3px rgba(0, 100, 160, 0.1); border-color: var(--primary-color); }
.editor-toolbar {
  border: 1px solid var(--border);
  border-bottom: 0;
  background: var(--surface-tint);
  border-radius: 8px 8px 0 0;
}
.editor-toolbar + .CodeMirror { border-radius: 0 0 8px 8px; }
.editor-preview, .editor-preview-side {
  background: var(--surface-tint);
  color: var(--text);
}
.editor-statusbar {
  color: var(--text-subtle);
  font-size: 0.72rem;
}

/* --- Entry actions --------------------------------------------------- */

.entry-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding: 0.25rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.entry-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.entry-meta code {
  background: var(--surface-muted);
  color: var(--text-muted);
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.action-buttons { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.history-panel {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-tint);
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: 0; }
.history-view { color: var(--primary-color); text-decoration: none; font-size: 0.8rem; }
.history-view:hover { text-decoration: underline; }

/* --- View mode (rendered markdown) --------------------------------- */

/* .journal-view is the 900px wrapper — matches .journal-entry-form in
   edit mode, so the entry-actions + history panel align to the same
   horizontal margins as the content. */
.journal-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 0 1.25rem;
}
.view-article {
  display: block;
}
.view-head {
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.view-title {
  font-size: 1.8rem;
  font-weight: 500;
  margin: 0 0 0.6rem;
  color: var(--text);
  line-height: 1.25;
}
.view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.view-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
.view-body > :first-child { margin-top: 0; }
.view-body > :last-child  { margin-bottom: 0; }
.view-body h1, .view-body h2, .view-body h3,
.view-body h4, .view-body h5, .view-body h6 {
  color: var(--text);
  font-weight: 500;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.view-body h1 { font-size: 1.5rem; }
.view-body h2 { font-size: 1.25rem; }
.view-body h3 { font-size: 1.1rem; }
.view-body h4, .view-body h5, .view-body h6 { font-size: 1rem; }
.view-body p { margin: 0 0 0.9rem; }
.view-body ul, .view-body ol { margin: 0 0 0.9rem 1.25rem; padding: 0; }
.view-body li { margin-bottom: 0.25rem; }
.view-body li > p { margin-bottom: 0.4rem; }
.view-body a {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
.view-body a:hover { color: var(--primary-hover); }
.view-body code {
  background: var(--surface-muted);
  color: var(--chip-fg);
  padding: 0.08em 0.35em;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.view-body pre {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 0.9rem;
}
.view-body pre code {
  background: transparent;
  padding: 0;
  font-size: 0.88rem;
}
.view-body blockquote {
  margin: 0 0 0.9rem;
  padding: 0.2rem 1rem;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}
.view-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.view-body table {
  border-collapse: collapse;
  margin: 0 0 0.9rem;
}
.view-body th, .view-body td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  text-align: left;
}
.view-body th {
  background: var(--surface-tint);
  font-weight: 500;
}
.view-body input[type="checkbox"] {
  margin-right: 0.4rem;
  accent-color: var(--primary-color);
}

/* --- Search --------------------------------------------------------- */

.search-page {
  padding: 1.5rem 1.5rem 2.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.search-h {
  font-size: 1.4rem;
  margin: 0 0 1rem;
  color: var(--primary-color);
  font-weight: 500;
}
.search-form { margin-bottom: 1.5rem; }
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.75rem;
}
.filter-group { display: flex; flex-direction: column; gap: 0.2rem; }
.filter-group label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}
.search-tags {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.tag-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.3rem;
}
.tag-toggle, .people-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-toggle:hover, .people-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.tag-toggle.active, .people-toggle.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.search-actions { margin-top: 1rem; }

.search-results { margin-top: 1rem; }
.search-hit {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-color);
  border-radius: 6px;
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.7);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.search-hit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.hit-head { display: flex; justify-content: space-between; align-items: center; }
.hit-title { font-weight: 500; color: var(--text); }
.hit-date { font-size: 0.72rem; color: var(--text-subtle); }
.hit-sub {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
}
.chip-tag { background: #eef5fa; color: var(--primary-color); }
.chip-person { background: #f0eef7; color: #5b408a; }
.chip-project { background: #fff4df; color: #8a5e00; }
.chip-client { background: #e8f0f5; color: #18313f; }
.chip-type { background: #e1efe4; color: #2a6042; }

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-subtle);
}
.empty-state i { font-size: 1.5rem; }

/* --- Settings ------------------------------------------------------- */

.settings-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
}
.settings-page h1 {
  font-size: 1.4rem;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.settings-section {
  margin-bottom: 2rem;
  padding: 1.1rem 1.25rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.settings-section h2 {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.settings-kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.2rem;
  margin: 0;
}
.settings-kv dt { color: var(--text-subtle); font-size: 0.85rem; }
.settings-kv dd { margin: 0; font-size: 0.9rem; }

.trash-list { }
.trash-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.trash-item:last-child { border-bottom: 0; }
.trash-title { font-weight: 500; }

/* Passkey list in Settings */
.passkey-list { }
.passkey-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.passkey-row:last-child { border-bottom: 0; }
.passkey-label {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.passkey-badge-current {
  font-size: 0.7rem;
  font-weight: 400;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: #e4f4ea;
  color: #2a6042;
  border: 1px solid #c5e6d1;
}
.passkey-meta code {
  background: var(--surface-muted);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* One-time reveal blocks (reg code, recovery codes) */
.reveal-block {
  padding: 1rem;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.reg-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
}
.reg-code-box code {
  font-size: 1.9rem;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--primary-color);
  background: transparent;
  padding: 0;
}
.recovery-codes-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}

/* --- Responsive ----------------------------------------------------- */

@media (max-width: 991px) {
  .journal-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    min-height: 0;
  }
  .sidebar-inner { max-height: 260px; overflow-y: auto; }
  .journal-editor-col { padding: 1rem; min-height: auto; }
  .chip-row { flex-wrap: wrap; }
}

@media (max-width: 575px) {
  .journal-top .back-text { display: none; }
  .journal-top .journal-brand span { display: none; }
  .journal-top .back-link .bi-lambda,
  .journal-top .journal-brand i {
    font-size: 1.15rem;
  }
  .title-input { font-size: 1.4rem; }
  .chip-label { min-width: 40px; font-size: 0.65rem; }
  .search-filters { flex-direction: column; align-items: stretch; }
  .view-title { font-size: 1.45rem; }
  .view-body { font-size: 14.5px; }
}

/* --- Session expiry guards (banner + modal) ------------------------ */

.session-banner {
  position: sticky;
  top: 45px;
  z-index: 1025;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff5dc;
  border: 1px solid #f0d28c;
  border-radius: 6px;
  color: #6b4a00;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  animation: session-banner-in 0.2s ease-out;
}
.session-banner.urgent {
  background: #fbe1dc;
  border-color: #e8a396;
  color: #7b1d0e;
}
.session-banner-text { flex: 1; }
@keyframes session-banner-in {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.session-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 20, 28, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.session-modal-card {
  max-width: 400px;
  width: 100%;
  padding: 1.75rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.session-modal-card h2 {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--primary-color);
  margin: 0 0 0.6rem;
}
.session-modal-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Restore-unsaved-changes banner (separate from session banner) */
.restore-banner {
  position: sticky;
  top: 45px;
  z-index: 1024;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #e2f3fa;
  border: 1px solid #bedde8;
  border-radius: 6px;
  color: #0e4a72;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}
.restore-banner .btn-group { display: flex; gap: 0.4rem; }

/* --- Auth pages (login / register / recovery) ---------------------- */

.auth-shell {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  max-width: 440px;
  width: 100%;
  padding: 2rem 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  color: var(--primary-color);
}
.auth-brand i { font-size: 1.45rem; }
.auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0;
}
.auth-lede {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
}
.auth-form { margin-bottom: 1rem; }
.auth-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 100, 160, 0.12);
}
.auth-status {
  margin-top: 0.8rem;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
}
.auth-status-info  { background: #e8f2fa; color: #0e4a72; border: 1px solid #cee2f1; }
.auth-status-ok    { background: #e4f4ea; color: #2a6042; border: 1px solid #c5e6d1; }
.auth-status-error { background: #f9e5e3; color: #842029; border: 1px solid #f1c2c0; }
.auth-foot {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-subtle);
}
.auth-link {
  color: var(--primary-color);
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-dot { margin: 0 0.35rem; color: var(--text-subtle); }

/* --- Misc ----------------------------------------------------------- */

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
