@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --primary-soft: #eaf2ff;
  --success: #198754;
  --success-soft: #e7f5ee;
  --warning: #ffc107;
  --warning-soft: #fff7da;
  --danger: #dc3545;
  --danger-soft: #fdebed;
  --dark: #212529;
  --body: #f8f9fa;
  --surface: #ffffff;
  --surface-soft: #f1f3f5;
  --text: #212529;
  --muted: #6c757d;
  --border: #e3e6e9;
  --shadow: 0 12px 34px rgba(33, 37, 41, 0.07);
  --shadow-small: 0 6px 18px rgba(33, 37, 41, 0.07);
  --card-radius: 20px;
  --modal-radius: 25px;
  --pill-radius: 999px;
  --input-height: 3.25rem;
  --font: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

html.dark {
  --body: #17191c;
  --surface: #222529;
  --surface-soft: #2b2f33;
  --text: #f1f3f5;
  --muted: #adb5bd;
  --border: #3a3f44;
  --primary-soft: #1d3557;
  --success-soft: #173d2d;
  --warning-soft: #493c10;
  --danger-soft: #4b2329;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  --shadow-small: 0 6px 18px rgba(0, 0, 0, 0.18);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-family: var(--font); background: var(--body); color: var(--text); }
body { min-height: 100dvh; margin: 0; background: var(--body); color: var(--text); font-size: 1rem; letter-spacing: -0.01em; }
body, button, input, textarea, select { font-family: var(--font); }
button, a { touch-action: manipulation; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.24);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); margin: 0; }
.span-all { grid-column: 1 / -1; }

/* Gemeinsame Navigation */
.navbar-taskly, .auth-navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(33, 37, 41, 0.07);
  backdrop-filter: blur(14px);
}
.dark .navbar-taskly { background: rgba(34, 37, 41, 0.95); border-color: var(--border); }
.navbar-container { width: min(1320px, calc(100% - 40px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; color: var(--text); font-size: 1.03rem; font-weight: 650; letter-spacing: 0.01em; }
.brand:hover { color: var(--text); }
.brand-logo, .auth-logo {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(13, 110, 253, 0.25);
}
.brand-logo { width: 40px; height: 40px; border-radius: 50%; font-size: 1.05rem; }
.navbar-collapse { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.nav-pills { display: flex; align-items: center; gap: 3px; margin: 0 auto; }
.nav-pill { display: inline-flex; align-items: center; gap: 8px; padding: 0.56rem 0.84rem; border-radius: var(--pill-radius); color: var(--text); font-size: 0.9rem; font-weight: 500; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease; }
.nav-pill:hover { color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.nav-pill.active { color: #fff; background: var(--dark); }
.dark .nav-pill.active { color: var(--dark); background: #f1f3f5; }
.navbar-toggle, .navbar-close { display: none; border: 0; background: var(--surface-soft); color: var(--text); width: 42px; height: 42px; border-radius: 50%; cursor: pointer; }
.user-menu { position: relative; flex: 0 0 auto; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-button { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 5px 12px 5px 5px; background: var(--surface-soft); border: 1px solid transparent; border-radius: var(--pill-radius); color: var(--text); cursor: pointer; }
.user-button:hover { border-color: var(--border); }
.user-button img, .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar { display: grid; place-items: center; color: #fff; background: #2e7d68; font-weight: 700; border: 2px solid rgba(255, 255, 255, 0.55); }
.avatar.small { width: 34px; height: 34px; }
.avatar.huge { width: 88px; height: 88px; font-size: 1.7rem; }
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 550; }
.user-button > i { color: var(--muted); font-size: 0.68rem; transition: transform 0.15s ease; }
.user-menu[open] .user-button > i { transform: rotate(180deg); }
.user-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.user-dropdown-head { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.user-dropdown-head small { color: var(--muted); }
.user-dropdown a, .user-dropdown button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 11px; padding: 10px 11px; color: var(--text); background: transparent; text-align: left; font-size: 0.9rem; cursor: pointer; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--surface-soft); }
.user-dropdown form { padding-top: 5px; margin-top: 5px; border-top: 1px solid var(--border); }
.user-dropdown form button { color: var(--danger); }
.nav-backdrop { display: none; }

/* Seitenrahmen und Überschriften */
.page-container { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; min-height: 54px; margin-bottom: 30px; }
.page-heading h1 { margin: 0; font-size: 1.75rem; font-weight: 560; letter-spacing: -0.035em; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 0.78rem; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 36px; }
.welcome h2 { margin: 7px 0 9px; font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 520; letter-spacing: -0.05em; }
.welcome p:last-child { margin: 0; color: var(--muted); }
.eyebrow { margin: 0; color: var(--primary); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.quick-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.quick-actions form { margin: 0; }

/* Buttons und Formulare */
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0.58rem 1rem; border: 1px solid transparent; border-radius: var(--pill-radius); font-size: 0.88rem; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease; }
.button:active { transform: translateY(1px); }
.button.primary { color: #fff; background: var(--primary); }
.button.primary:hover { color: #fff; background: var(--primary-hover); }
.button.dark { color: #fff; background: var(--dark); }
.button.dark:hover { color: #fff; background: #101214; }
.button.secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.secondary:hover { color: var(--text); background: var(--surface-soft); }
.button.danger { color: #fff; background: var(--danger); }
.button.compact { min-height: 34px; padding: 0.42rem 0.72rem; font-size: 0.76rem; }
.button.full { width: 100%; }
.text-button { border: 0; padding: 4px 0; color: var(--primary); background: transparent; cursor: pointer; }
.danger-text { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.narrow { width: min(420px, 100%); margin: 24px auto 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: flex; flex-direction: column; gap: 7px; color: var(--text); font-size: 0.86rem; font-weight: 500; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; min-height: var(--input-height); padding: 0.72rem 1rem; border: 1px solid #ced4da; border-radius: 15px; color: var(--text); background: var(--surface); font-size: 0.95rem; box-shadow: none; }
textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12); }
.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--primary); }
.input-action, .password-field { position: relative; display: flex; align-items: center; }
.input-action input, .password-field input { flex: 1; padding-right: 48px; }
.password-toggle { position: absolute; right: 9px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Karten, Listen und Status */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-radius); box-shadow: var(--shadow-small); }
.panel-head { min-height: 72px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0 0 5px; font-size: 1rem; font-weight: 600; }
.panel-head p { margin: 0; color: var(--muted); font-size: 0.78rem; }
.panel-head a { font-size: 0.8rem; font-weight: 600; }
.empty { padding: 24px; color: var(--muted); font-size: 0.86rem; }
.empty.large { min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; text-align: center; }
.empty.large strong { color: var(--text); font-size: 1.12rem; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; padding: 15px 18px; border: 1px solid #bad4ff; border-radius: 16px; color: #084298; background: var(--primary-soft); }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.task-list, .link-list { padding: 7px 22px 14px; }
.task-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.task-row:last-child, .link-list a:last-child { border-bottom: 0; }
.task-row > div, .link-list a { display: flex; flex-direction: column; gap: 4px; }
.task-row small, .link-list small { color: var(--muted); }
.priority { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.priority.high { background: var(--danger); }
.priority.low { background: var(--primary); }
.badge { display: inline-flex; align-items: center; width: max-content; padding: 0.42rem 0.68rem; border-radius: 0.5rem; color: var(--muted); background: var(--surface-soft); font-size: 0.72rem; font-weight: 550; }
.badge.success { color: var(--success); background: var(--success-soft); }
.link-list a { padding: 13px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.activity-list { padding: 10px 22px 16px; }
.activity-list > div { display: flex; gap: 10px; }
.activity-dot { width: 7px; height: 7px; margin-top: 17px; border-radius: 50%; background: var(--primary); }
.activity-list p { margin: 10px 0; font-size: 0.8rem; }
.activity-list small { display: block; margin-top: 4px; color: var(--muted); }
.shortcut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 22px; }
.shortcut-grid a { padding: 22px 10px; border-radius: 16px; color: var(--text); background: var(--surface-soft); text-align: center; font-weight: 600; }

/* Aufgaben */
.toolbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.table-panel { overflow: hidden; }
.todo-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 20px; background: var(--body); }
.todo-board > section { min-width: 0; }
.column-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 14px; }
.column-head h3 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.column-head span { min-width: 28px; padding: 5px 8px; border-radius: var(--pill-radius); background: var(--surface-soft); text-align: center; font-size: 0.72rem; }
.todo-column { display: flex; flex-direction: column; gap: 13px; }
.todo-card { overflow: hidden; padding: 18px; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--surface); box-shadow: var(--shadow-small); }
.todo-card.due-today { border: 2px solid var(--primary); }
.todo-card.overdue { border: 2px solid var(--danger); }
.task-status-band { display: flex; align-items: center; gap: 7px; margin: -18px -18px 17px; padding: 10px 15px; color: #fff; background: var(--primary); font-size: 0.76rem; font-weight: 600; }
.task-status-band.overdue { background: var(--danger); }
.todo-card:hover { border-color: #b7cdf0; transform: translateY(-1px); }
.todo-card-top { display: flex; align-items: center; justify-content: space-between; }
.todo-card h4 { margin: 14px 0 7px; font-size: 1rem; font-weight: 600; }
.todo-card p { margin: 0 0 14px; color: var(--muted); font-size: 0.86rem; line-height: 1.55; }
.todo-card small { color: var(--muted); }
.priority-label { padding: 0.35rem 0.6rem; border-radius: 0.5rem; color: var(--text); background: var(--surface-soft); font-size: 0.7rem; font-weight: 550; }
.priority-label.high { color: #fff; background: var(--danger); }
.priority-label.low { color: #fff; background: #6c757d; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--text); background: var(--surface-soft); cursor: pointer; }
.icon-button.small { width: 30px; height: 30px; }

/* Dialoge */
dialog { width: min(570px, calc(100vw - 24px)); max-width: none; padding: 0; border: 0; border-radius: var(--modal-radius); color: var(--text); background: transparent; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28); }
dialog::backdrop { background: rgba(20, 23, 25, 0.58); backdrop-filter: blur(3px); }
.dialog-card { padding: 25px; border: 1px solid var(--border); border-radius: var(--modal-radius); background: var(--surface); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-head h3 { margin: 0; font-size: 1.14rem; font-weight: 560; }
.dialog-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 22px; }

/* Notizen */
.notes-layout { min-height: calc(100dvh - 205px); display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; }
.notes-list { overflow: auto; padding: 13px; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--surface); box-shadow: var(--shadow-small); }
.note-link { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; padding: 14px; border-radius: 15px; color: var(--text); }
.note-link:hover, .note-link.active { color: var(--text); background: var(--primary-soft); }
.note-link span, .note-link small { overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.note-editor { overflow: hidden; }
.editor-toolbar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.72rem; }
.note-form { height: calc(100% - 52px); display: flex; flex-direction: column; }
.note-title { min-height: auto; padding: 26px 30px 12px; border: 0; border-radius: 0; background: transparent; font-size: 1.65rem; font-weight: 600; }
.note-content { flex: 1; min-height: 360px; padding: 12px 30px; border: 0; border-radius: 0; background: transparent; }
.note-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px; padding: 16px 30px; border-top: 1px solid var(--border); }
.error-text { color: var(--danger); }

/* Wiki */
.article-list > a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 20px; align-items: center; gap: 15px; padding: 18px 22px; border-bottom: 1px solid var(--border); color: var(--text); }
.article-list > a:last-child { border-bottom: 0; }
.article-list > a > div { display: flex; flex-direction: column; gap: 4px; }
.article-list small { color: var(--muted); }
.document-icon, .vault-site-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 1.1rem; }
.wiki-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 20px; }
.editor-panel { padding: 26px; }
.wiki-title { min-height: auto; margin-bottom: 20px; padding: 8px 0 19px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; font-size: 1.85rem; font-weight: 600; }
.wiki-content { min-height: 440px; font-family: ui-monospace, Consolas, monospace; }
.revisions { overflow: hidden; }
.revision { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.revision:last-child { border-bottom: 0; }
.revision div { display: flex; flex-direction: column; gap: 3px; }
.revision small { color: var(--muted); }
.wiki-article { max-width: 920px; margin: 0 auto; padding: clamp(26px, 5vw, 64px); }
.wiki-article header { padding-bottom: 25px; border-bottom: 1px solid var(--border); }
.wiki-article header h1 { margin: 17px 0 10px; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 560; letter-spacing: -0.05em; }
.wiki-article header p { color: var(--muted); }
.markdown-body { padding-top: 25px; font-size: 1rem; line-height: 1.75; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.5em 0 0.5em; font-weight: 600; letter-spacing: -0.03em; }
.markdown-body code { padding: 2px 6px; border-radius: 6px; background: var(--surface-soft); }

/* Tabellen und Einstellungen */
.data-table { overflow-x: auto; }
.data-row { min-width: 850px; display: grid; grid-template-columns: minmax(230px, 1.5fr) 160px 140px 160px 100px; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.data-row:last-child { border-bottom: 0; }
.data-row.header { color: var(--muted); background: var(--surface-soft); font-size: 0.72rem; font-weight: 600; }
.person { display: flex; align-items: center; gap: 11px; }
.person > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.person small { color: var(--muted); }
.logs .data-row { min-width: 720px; grid-template-columns: 160px minmax(180px, 1fr) minmax(220px, 1.5fr) 140px; }
.logs code { width: max-content; padding: 5px 8px; border-radius: 7px; color: #084298; background: var(--primary-soft); }
.filter-form { display: flex; gap: 9px; }
.filter-form input { min-width: 260px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-card { padding-bottom: 22px; }
.settings-card > form { padding: 22px; }
.avatar-settings { display: flex; align-items: center; gap: 25px; padding: 26px; }
.avatar-settings img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.avatar-settings form { display: flex; gap: 9px; flex-wrap: wrap; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 15px; }

/* Tresor */
.vault-locked { min-height: 470px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 42px; text-align: center; }
.vault-locked h2 { margin: 19px 0 8px; font-size: 1.65rem; font-weight: 560; }
.vault-locked > p { max-width: 490px; margin: 0; color: var(--muted); line-height: 1.6; }
.vault-icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-size: 1.7rem; box-shadow: 0 9px 24px rgba(13, 110, 253, 0.25); }
.vault-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.vault-card { padding: 20px; }
.vault-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.vault-card-head > div { display: flex; flex-direction: column; gap: 4px; }
.vault-card h3 { margin: 0; font-size: 1rem; }
.vault-card small { color: var(--muted); }
.secret-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.78rem; }
.secret-row > span { color: var(--muted); }
.secret-row code { overflow: hidden; text-overflow: ellipsis; }
.vault-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.skeleton { width: 220px; height: 16px; border-radius: var(--pill-radius); background: var(--surface-soft); animation: pulse 1.5s infinite; }
.skeleton.wide { width: 72px; height: 72px; border-radius: 50%; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* Meldungen und Statusseiten */
.alert { margin-bottom: 17px; padding: 13px 16px; border: 1px solid transparent; border-radius: 15px; font-size: 0.85rem; }
.alert.error { color: #842029; background: var(--danger-soft); border-color: #f1aeb5; }
.alert.success { color: #0f5132; background: var(--success-soft); border-color: #a3cfbb; }
.alert.warning { color: #664d03; background: var(--warning-soft); border-color: #ffecb5; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(390px, calc(100vw - 32px)); padding: 13px 17px; border-radius: 14px; color: #fff; background: var(--dark); box-shadow: var(--shadow); opacity: 0; transform: translateY(25px); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--danger); }
.state-page { min-height: 58dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.state-page > span { color: #bfd4f8; font-size: 4rem; font-weight: 700; }
.state-page h2 { margin: 0; font-size: 1.8rem; font-weight: 560; }
.state-page p { color: var(--muted); }

/* Anmeldung */
.auth-page { background: var(--body); }
.auth-navbar { position: fixed; width: 100%; display: flex; align-items: center; padding: 0 max(24px, calc((100vw - 1240px) / 2)); }
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 110px 20px 52px; }
.auth-card { width: min(440px, 100%); padding: 34px; border: 0; border-radius: var(--card-radius); background: var(--surface); box-shadow: var(--shadow); }
.auth-heading { margin-bottom: 28px; text-align: center; }
.auth-logo { width: 80px; height: 80px; margin: 0 auto 24px; border-radius: 50%; font-size: 1.9rem; }
.auth-heading h1, .form-head h2 { margin: 0 0 10px; font-size: 1.7rem; font-weight: 520; letter-spacing: -0.035em; }
.auth-heading p, .form-head > p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
.form-head { margin-bottom: 26px; text-align: center; }
.form-head .eyebrow { margin-bottom: 8px; }
.auth-form input { border-radius: var(--pill-radius); }
.auth-card input, .auth-card select { border-radius: var(--pill-radius); }
.auth-card .stack > .button { width: 100%; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 0.82rem; }
.login-options a { white-space: nowrap; }
.form-row { display: flex; justify-content: flex-end; font-size: 0.82rem; }
.form-switch { margin: 23px 0 0; color: var(--muted); text-align: center; font-size: 0.85rem; }

@media (max-width: 1080px) {
  .navbar-toggle { display: grid; place-items: center; margin-left: auto; }
  .navbar-collapse { display: none; position: fixed; top: 84px; left: 20px; right: 20px; max-height: calc(100dvh - 104px); overflow: auto; padding: 22px; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--surface); box-shadow: 0 24px 65px rgba(0, 0, 0, 0.18); }
  .nav-open .navbar-collapse { display: flex; align-items: stretch; flex-direction: column; }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(20, 23, 25, 0.46); }
  .nav-pills { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; }
  .nav-pill { padding: 0.8rem 1rem; }
  .user-menu { width: 100%; }
  .user-button { width: 100%; }
  .user-dropdown { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .navbar-close { display: grid; place-items: center; position: absolute; top: 12px; right: 12px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .span-7, .span-5 { grid-column: auto; }
  .wiki-layout { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .page-container { width: min(100% - 28px, 1240px); padding-top: 28px; }
  .welcome { align-items: flex-start; flex-direction: column; margin-bottom: 28px; }
  .todo-board { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 1fr; min-height: auto; }
  .notes-list { max-height: 300px; }
  .note-editor { min-height: 520px; }
  .wiki-layout, .settings-grid, .vault-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .settings-card.span-all { grid-column: auto; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .article-list > a { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .article-list > a > span:last-child { display: none; }
}

@media (max-width: 560px) {
  .navbar-container { width: calc(100% - 28px); }
  .navbar-collapse { left: 12px; right: 12px; padding: 18px; }
  .nav-pills { grid-template-columns: 1fr; }
  .user-name { max-width: 180px; }
  .page-heading { margin-bottom: 22px; }
  .welcome h2 { font-size: 2rem; }
  .quick-actions, .quick-actions > *, .quick-actions .button { width: 100%; }
  .form-grid, .note-meta { grid-template-columns: 1fr; }
  .dialog-card { padding: 20px; }
  .dialog-actions .button { flex: 1; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .avatar-settings, .avatar-settings form { align-items: flex-start; flex-direction: column; }
  .filter-form { width: 100%; flex-direction: column; }
  .filter-form input { min-width: 0; }
  .secret-row { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .secret-row .copy-pass { grid-column: 3; }
  .vault-card-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .auth-navbar { padding: 0 20px; }
  .auth-shell { padding-inline: 14px; }
  .auth-card { padding: 28px 22px; }
  .login-options { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@supports not (backdrop-filter: blur(1px)) {
  .navbar-taskly, .auth-navbar { background: var(--surface); }
}
