:root {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-deep: #05070a;
  --surface: rgba(14, 18, 26, 0.84);
  --surface-solid: #0f131b;
  --surface-raised: #131925;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f6f7fb;
  --text-soft: #c9cfda;
  --muted: #8993a4;
  --muted-2: #5f6878;
  --accent: #9c8cff;
  --accent-bright: #b9adff;
  --accent-rgb: 156, 140, 255;
  --success: #68d7ad;
  --success-rgb: 104, 215, 173;
  --danger: #ff767e;
  --warning: #ffc56d;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --sidebar-width: 258px;
  --topbar-height: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 25% -10%, rgba(88, 71, 160, 0.14), transparent 34rem),
    linear-gradient(180deg, #080a0f 0%, #07090d 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

button:not(:disabled),
a,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input,
textarea,
select {
  outline: none;
}

textarea {
  resize: vertical;
}

svg {
  display: block;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  background: rgba(var(--accent-rgb), 0.34);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  min-height: 44px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.21);
  background-clip: padding-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(125%);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

#ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.36;
}

.ambient-orb {
  position: absolute;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.08;
  animation: orbFloat 18s var(--ease) infinite alternate;
}

.ambient-orb-a {
  top: -12rem;
  right: 5%;
  background: #8874ff;
}

.ambient-orb-b {
  bottom: -18rem;
  left: 15%;
  background: #45a8bd;
  animation-delay: -7s;
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.pointer-glow {
  position: absolute;
  left: var(--pointer-x, 50%);
  top: var(--pointer-y, 35%);
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06), transparent 67%);
  transform: translate(-50%, -50%);
  transition: left 90ms linear, top 90ms linear;
}

@keyframes orbFloat {
  from { transform: translate3d(-2rem, -1rem, 0) scale(0.94); }
  to { transform: translate3d(4rem, 3rem, 0) scale(1.08); }
}

.toast-region {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(17, 22, 31, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
  pointer-events: auto;
  animation: toastIn 420ms var(--ease) both;
}

.toast.is-leaving {
  animation: toastOut 260ms ease both;
}

.toast-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-bright);
}

.toast-success .toast-icon {
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success);
}

.toast-error .toast-icon {
  background: rgba(255, 118, 126, 0.12);
  color: var(--danger);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 13px;
  font-weight: 650;
}

.toast span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.toast-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

@keyframes toastIn {
  from { opacity: 0; transform: translate3d(18px, -8px, 0) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translate3d(20px, 0, 0) scale(0.97); }
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.icon-button:active {
  transform: scale(0.94);
}

.primary-button,
.secondary-button,
.delete-button,
.topbar-new {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition:
    transform 180ms var(--ease),
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.primary-button {
  padding: 0 17px;
  background: var(--text);
  color: #0a0c11;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.12);
}

.primary-button:active,
.secondary-button:active,
.delete-button:active,
.topbar-new:active {
  transform: translateY(0) scale(0.97);
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
}

.text-button {
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.text-button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

kbd {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-bottom-color: rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
}

/* Sign in */
.auth-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  align-content: center;
  justify-items: center;
  padding: 56px 22px 38px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 34px;
  color: var(--text);
  animation: authRise 700ms var(--ease) both;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: inset 0 0 20px rgba(var(--accent-rgb), 0.04);
}

.brand-mark span {
  display: block;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
}

.brand-mark span:nth-child(1) { height: 8px; opacity: 0.65; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: 0.78; }

.brand-wordmark {
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.04em;
}

.auth-card {
  width: min(500px, 100%);
  padding: 42px;
  border-radius: 26px;
  animation: authRise 780ms 80ms var(--ease) both;
}

.auth-kicker,
.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.auth-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(var(--success-rgb), 0.08);
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 54px);
  font-weight: 640;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.auth-copy {
  max-width: 390px;
  margin: 21px 0 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 620;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 52px;
  padding: 0 50px 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 6, 10, 0.55);
  color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.password-field input::placeholder {
  color: var(--muted-2);
}

.password-field input:focus {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: rgba(5, 7, 11, 0.8);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.password-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
}

.auth-submit {
  width: 100%;
  height: 50px;
  margin-top: 13px;
}

.auth-submit svg {
  width: 18px;
  height: 18px;
  transition: transform 180ms var(--ease);
}

.auth-submit:hover svg {
  transform: translateX(3px);
}

.auth-submit.is-loading span {
  opacity: 0.62;
}

.auth-submit.is-loading svg {
  animation: spin 800ms linear infinite;
}

.form-message {
  min-height: 21px;
  margin: 10px 1px 0;
  color: var(--danger);
  font-size: 12px;
}

.form-message.is-info {
  color: var(--warning);
}

.auth-footnote {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 23px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.55;
}

.auth-footnote svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.auth-footer {
  margin: 30px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.06em;
  animation: authRise 700ms 160ms var(--ease) both;
}

@keyframes authRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Main shell */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 22px 17px 16px;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(26px) saturate(125%);
  -webkit-backdrop-filter: blur(26px) saturate(125%);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 26px;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark-small {
  width: 32px;
  height: 32px;
  padding: 6px;
  border-radius: 10px;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.sidebar-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-close,
.mobile-menu {
  display: none;
}

.primary-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: grid;
  min-height: 46px;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 0 11px 0 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.nav-item.is-active {
  border-color: rgba(var(--accent-rgb), 0.13);
  background: rgba(var(--accent-rgb), 0.085);
  color: var(--text);
}

.nav-item.is-active::before {
  position: absolute;
  left: -18px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.5);
}

.nav-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.nav-label {
  font-size: 13px;
  font-weight: 560;
}

.nav-count {
  min-width: 23px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.nav-item.is-active .nav-count {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-bright);
}

.sidebar-section {
  margin-top: 31px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 10px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.category-nav {
  display: grid;
  gap: 2px;
}

.category-nav-button {
  display: grid;
  min-height: 37px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.category-nav-button:hover,
.category-nav-button.is-active {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.category-nav-button.is-active {
  background: rgba(var(--category-rgb), 0.08);
}

.category-nav-button .category-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px rgba(var(--category-rgb), 0.08);
}

.category-nav-button span:nth-child(2) {
  font-size: 12px;
}

.category-nav-button small {
  color: var(--muted-2);
  font-size: 10px;
}

.sidebar-spacer {
  flex: 1;
  min-height: 30px;
}

.shortcut-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 3px 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.shortcut-card-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent-bright);
}

.shortcut-card-icon svg {
  width: 15px;
  height: 15px;
}

.shortcut-card strong,
.shortcut-card span {
  display: block;
}

.shortcut-card strong {
  font-size: 11px;
  font-weight: 650;
}

.shortcut-card span {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sync-status {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 7px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background 160ms ease;
}

.sync-status:hover {
  background: rgba(255, 255, 255, 0.035);
}

.sync-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(var(--success-rgb), 0.07);
}

.sync-status.is-syncing .sync-indicator {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
  animation: pulse 1.2s ease infinite;
}

.sync-status.is-offline .sync-indicator,
.sync-status.is-error .sync-indicator {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 118, 126, 0.08);
}

.sync-copy strong,
.sync-copy small {
  display: block;
}

.sync-copy strong {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 620;
}

.sync-copy small {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
}

.sync-refresh {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.sync-status.is-syncing .sync-refresh {
  animation: spin 800ms linear infinite;
}

@keyframes pulse {
  50% { opacity: 0.42; }
}

.sidebar-scrim {
  display: none;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  min-height: var(--topbar-height);
  grid-template-columns: minmax(260px, 620px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(8, 10, 15, 0.72);
  backdrop-filter: blur(24px) saturate(125%);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
}

.global-search {
  position: relative;
  display: flex;
  width: min(100%, 620px);
  height: 42px;
  align-items: center;
}

.global-search > svg {
  position: absolute;
  left: 13px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  height: 42px;
  padding: 0 77px 0 41px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.032);
  color: var(--text);
  font-size: 13px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.global-search input::placeholder {
  color: var(--muted-2);
}

.global-search input:focus {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(255, 255, 255, 0.048);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.055);
}

.search-shortcut {
  position: absolute;
  right: 11px;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 39px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.search-clear svg {
  width: 13px;
  height: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.topbar-new {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.085);
  color: var(--accent-bright);
  font-size: 12px;
}

.topbar-new:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.13);
}

.topbar-new svg {
  width: 15px;
  height: 15px;
}

.settings-wrap {
  position: relative;
}

.avatar-button {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #1d2230, #11151d);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.02em;
  transition: transform 180ms var(--ease), border-color 180ms ease;
}

.avatar-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.avatar-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--success);
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: 220px;
  padding: 8px;
  border-radius: 15px;
  transform-origin: top right;
  animation: menuIn 220ms var(--ease) both;
}

.settings-header {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.settings-header strong,
.settings-header span {
  display: block;
}

.settings-header strong {
  font-size: 12px;
}

.settings-header span {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.settings-menu > button {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  text-align: left;
}

.settings-menu > button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.settings-menu > button svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.settings-divider {
  height: 1px;
  margin: 6px 5px;
  background: var(--line);
}

.settings-menu > .danger-menu-item:hover {
  background: rgba(255, 118, 126, 0.07);
  color: var(--danger);
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.main-content {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 55px 44px 90px;
}

.view-panel {
  animation: viewIn 420ms var(--ease) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-intro,
.archive-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 29px;
}

.page-intro h1,
.archive-intro h1 {
  margin: 9px 0 5px;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.page-intro p,
.archive-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-stats {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
}

.mini-stats > div {
  min-width: 88px;
  padding: 0 16px;
  text-align: center;
}

.mini-stats > div + div {
  border-left: 1px solid var(--line);
}

.mini-stats strong,
.mini-stats span {
  display: block;
}

.mini-stats strong {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.mini-stats span {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Capture */
.capture-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: 20px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.26);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms var(--ease);
}

.capture-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.75), transparent);
  content: "";
  opacity: 0.6;
}

.capture-card:focus-within {
  border-color: rgba(var(--accent-rgb), 0.25);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), 0 0 0 4px rgba(var(--accent-rgb), 0.03);
  transform: translateY(-1px);
}

.capture-main {
  display: grid;
  min-height: 99px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 15px;
  padding: 22px 22px 18px;
}

.capture-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-top: 1px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--accent-bright);
}

.capture-icon svg {
  width: 17px;
  height: 17px;
}

.capture-inputs {
  min-width: 0;
}

.capture-inputs input,
.capture-inputs textarea {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.capture-inputs input {
  height: 34px;
  color: var(--text);
  font-size: 17px;
  font-weight: 570;
  letter-spacing: -0.025em;
}

.capture-inputs textarea {
  min-height: 26px;
  max-height: 150px;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
  resize: none;
}

.capture-inputs input::placeholder {
  color: #727c8d;
}

.capture-inputs textarea::placeholder {
  color: var(--muted-2);
}

.capture-submit {
  min-width: 82px;
  height: 41px;
  margin-top: 0;
}

.capture-submit svg {
  display: none;
  width: 16px;
  height: 16px;
}

.capture-options {
  display: flex;
  min-height: 57px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 17px 11px 21px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.category-picker {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  border: 0;
  margin: 0;
}

.category-option {
  position: relative;
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.category-option:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.category-option:has(input:checked) {
  border-color: rgba(var(--category-rgb), 0.19);
  background: rgba(var(--category-rgb), 0.085);
  color: var(--text-soft);
}

.category-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-dot {
  display: block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgb(var(--category-rgb));
}

.category-education { --category-rgb: 116, 139, 255; }
.category-creation { --category-rgb: 173, 127, 255; }
.category-culinary { --category-rgb: 247, 180, 92; }
.category-music { --category-rgb: 243, 113, 169; }
.category-school { --category-rgb: 91, 204, 219; }
.category-else { --category-rgb: 151, 160, 176; }

.capture-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.compact-field {
  position: relative;
  display: flex;
  height: 33px;
  align-items: center;
  gap: 5px;
  padding: 0 7px 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-2);
  font-size: 9px;
}

.compact-field:hover,
.compact-field:focus-within {
  border-color: var(--line-strong);
}

.compact-field select,
.compact-field input {
  max-width: 91px;
  height: 30px;
  padding: 0 18px 0 2px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 10px;
}

.compact-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%), linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 7px) 13px, calc(100% - 3px) 13px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
}

.date-field input {
  max-width: 110px;
  padding-right: 0;
}

::-webkit-calendar-picker-indicator {
  filter: invert(0.65);
  opacity: 0.55;
}

.pin-field {
  position: relative;
}

.pin-field input {
  position: absolute;
  opacity: 0;
}

.pin-control {
  display: flex;
  height: 33px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.pin-control svg {
  width: 12px;
  height: 12px;
}

.pin-field input:checked + .pin-control {
  border-color: rgba(var(--accent-rgb), 0.23);
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent-bright);
}

/* Collection */
.collection-section {
  margin-top: 33px;
}

.collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.filter-scroll {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.filter-chip.is-active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.filter-chip:not(.all-filter).is-active {
  border-color: rgba(var(--category-rgb), 0.18);
  background: rgba(var(--category-rgb), 0.08);
}

.filter-chip small {
  color: var(--muted-2);
  font-size: 9px;
}

.toolbar-selects {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.toolbar-select select {
  height: 34px;
  min-width: 135px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.025);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%), linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  color: var(--muted);
  font-size: 10px;
}

.toolbar-select select:hover,
.toolbar-select select:focus {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.collection-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 2px 14px;
}

.collection-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.collection-heading p {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 10px;
}

.idea-list {
  display: grid;
  gap: 9px;
}

.idea-card {
  --category-rgb: 151, 160, 176;
  position: relative;
  display: grid;
  min-height: 106px;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(14, 18, 26, 0.62);
  box-shadow: 0 9px 30px rgba(0, 0, 0, 0.12);
  transition:
    transform 220ms var(--ease),
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
  animation: cardIn 420ms var(--delay, 0ms) var(--ease) both;
}

.idea-card:hover {
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.145);
  background: rgba(17, 22, 31, 0.78);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.21);
  transform: translateY(-2px);
}

.idea-card.is-pinned {
  border-color: rgba(var(--accent-rgb), 0.13);
}

.idea-card.is-overdue:not(.is-completed) {
  border-color: rgba(255, 118, 126, 0.16);
}

.idea-accent {
  height: 100%;
  background: rgba(var(--category-rgb), 0.7);
  opacity: 0.9;
}

.idea-content {
  min-width: 0;
  padding: 16px 15px 14px 17px;
}

.idea-topline {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 19px;
}

.idea-category,
.idea-priority,
.idea-due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.idea-category {
  color: rgb(var(--category-rgb));
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.idea-category .category-dot {
  width: 5px;
  height: 5px;
}

.idea-priority {
  color: var(--muted-2);
  font-size: 9px;
}

.idea-priority.priority-high {
  color: var(--warning);
}

.idea-priority.priority-low {
  opacity: 0.72;
}

.idea-pin {
  color: var(--accent-bright);
}

.idea-pin svg {
  width: 11px;
  height: 11px;
}

.idea-card h3 {
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 610;
  letter-spacing: -0.025em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-description {
  display: -webkit-box;
  overflow: hidden;
  max-width: 780px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.idea-description.is-empty {
  color: var(--muted-2);
  font-style: italic;
  opacity: 0.65;
}

.idea-meta-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 9px;
}

.idea-meta-row > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.idea-meta-row svg {
  width: 11px;
  height: 11px;
}

.idea-due.is-overdue {
  color: var(--danger);
}

.idea-due.is-soon {
  color: var(--warning);
}

.idea-actions {
  display: flex;
  width: 202px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 15px 14px 15px 0;
}

.status-select-wrap {
  position: relative;
}

.card-status {
  height: 32px;
  max-width: 105px;
  padding: 0 25px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.03);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%), linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 11px) 13px, calc(100% - 7px) 13px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  color: var(--text-soft);
  font-size: 9px;
  transition: border-color 160ms ease, background 160ms ease;
}

.card-status:hover,
.card-status:focus {
  border-color: var(--line-strong);
  background-color: rgba(255, 255, 255, 0.055);
}

.card-action {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.card-action:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.card-action:active {
  transform: scale(0.92);
}

.card-action svg {
  width: 15px;
  height: 15px;
}

.complete-action:hover {
  border-color: rgba(var(--success-rgb), 0.2);
  background: rgba(var(--success-rgb), 0.08);
  color: var(--success);
}

.restore-action:hover {
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-bright);
}

.idea-card.is-completed {
  opacity: 0.84;
}

.idea-card.is-completed:hover {
  opacity: 1;
}

.idea-card.is-completed h3 {
  color: var(--text-soft);
}

.idea-card.is-completed .idea-accent {
  background: rgba(var(--success-rgb), 0.58);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.992); }
  to { opacity: 1; transform: none; }
}

.empty-state,
.loading-state {
  display: grid;
  min-height: 250px;
  place-items: center;
  padding: 40px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.012);
  text-align: center;
}

.empty-state-icon,
.loading-state-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.empty-state-icon svg,
.loading-state-icon svg {
  width: 19px;
  height: 19px;
}

.loading-state-icon svg {
  animation: spin 900ms linear infinite;
}

.empty-state h3,
.loading-state h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 620;
}

.empty-state p,
.loading-state p {
  max-width: 360px;
  margin: 6px auto 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.55;
}

.empty-state .secondary-button {
  min-height: 36px;
  margin-top: 15px;
  font-size: 10px;
}

/* Archive */
.archive-intro {
  align-items: center;
}

.archive-intro .secondary-button svg {
  width: 15px;
  height: 15px;
}

.archive-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 17px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
}

.archive-mark {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(var(--success-rgb), 0.14);
  border-radius: 12px;
  background: rgba(var(--success-rgb), 0.075);
  color: var(--success);
}

.archive-mark svg {
  width: 18px;
  height: 18px;
}

.archive-summary strong,
.archive-summary span {
  display: block;
}

.archive-summary strong {
  font-size: 12px;
}

.archive-summary span {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.archive-heading {
  margin-top: 31px;
}

/* Editor */
.idea-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(14, 18, 26, 0.98);
  box-shadow: 0 40px 130px rgba(0, 0, 0, 0.62);
  color: var(--text);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 200ms ease, transform 250ms var(--ease), overlay 250ms ease allow-discrete, display 250ms ease allow-discrete;
}

.idea-dialog[open] {
  opacity: 1;
  transform: none;
}

@starting-style {
  .idea-dialog[open] {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.idea-dialog::backdrop {
  background: rgba(2, 4, 7, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 240ms ease, overlay 250ms ease allow-discrete, display 250ms ease allow-discrete;
}

.idea-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .idea-dialog[open]::backdrop { opacity: 0; }
}

.idea-dialog form {
  display: flex;
  max-height: inherit;
  flex-direction: column;
}

.dialog-header,
.dialog-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
}

.dialog-header {
  min-height: 83px;
  padding: 19px 22px 17px 25px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 5px 0 0;
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -0.035em;
}

.dialog-body {
  overflow-y: auto;
  padding: 23px 25px 25px;
}

.field-label,
.dialog-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

.dialog-title-input,
.dialog-body > textarea,
.dialog-field input,
.dialog-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.dialog-title-input:focus,
.dialog-body > textarea:focus,
.dialog-field input:focus,
.dialog-field select:focus {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.05);
}

.dialog-title-input {
  height: 46px;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 570;
}

.dialog-body > textarea {
  min-height: 130px;
  margin-bottom: 20px;
  padding: 12px 13px;
  font-size: 12px;
  line-height: 1.6;
}

.dialog-body > .field-label:not(:first-of-type) {
  margin-top: 18px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.dialog-field input,
.dialog-field select {
  height: 43px;
  padding: 0 11px;
  font-size: 11px;
}

.dialog-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%), linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 15px) 18px, calc(100% - 11px) 18px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
}

.dialog-pin {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.dialog-pin input {
  position: absolute;
  opacity: 0;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 21px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 180ms ease, border-color 180ms ease;
}

.toggle-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 220ms var(--ease), background 180ms ease;
}

.dialog-pin input:checked + .toggle-switch {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.21);
}

.dialog-pin input:checked + .toggle-switch span {
  background: var(--accent-bright);
  transform: translateX(15px);
}

.dialog-pin strong,
.dialog-pin small {
  display: block;
}

.dialog-pin strong {
  font-size: 11px;
}

.dialog-pin small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.metadata-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.metadata-card > div {
  min-width: 0;
  padding: 11px 12px;
  background: rgba(11, 14, 20, 0.96);
}

.metadata-card span,
.metadata-card strong {
  display: block;
}

.metadata-card span {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metadata-card strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-footer {
  min-height: 72px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: rgba(6, 8, 12, 0.32);
}

.dialog-footer-actions {
  display: flex;
  gap: 8px;
}

.delete-button {
  min-height: 41px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.delete-button:hover,
.delete-button.is-confirming {
  background: rgba(255, 118, 126, 0.08);
  color: var(--danger);
}

.delete-button svg {
  width: 14px;
  height: 14px;
}

.dialog-footer .primary-button,
.dialog-footer .secondary-button {
  min-height: 41px;
  font-size: 11px;
}

.mobile-bottom-nav {
  display: none;
}

/* Responsive */
@media (max-width: 1100px) {
  .capture-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .capture-meta {
    width: 100%;
    flex-wrap: wrap;
  }

  .category-picker {
    width: 100%;
  }
}

@media (max-width: 920px) {
  :root {
    --sidebar-width: 246px;
  }

  .sidebar {
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.44);
    transform: translateX(-105%);
    transition: transform 300ms var(--ease);
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(3, 5, 8, 0.64);
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
  }

  body.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    grid-template-columns: auto minmax(200px, 1fr) auto;
    gap: 12px;
    padding: 0 22px;
  }

  .main-content {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 67px;
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .topbar {
    gap: 8px;
    padding: 0 14px;
  }

  .global-search input {
    padding-right: 42px;
  }

  .search-shortcut {
    display: none;
  }

  .search-clear {
    right: 7px;
  }

  .topbar-new {
    display: none;
  }

  .main-content {
    padding: 34px 16px 44px;
  }

  .page-intro,
  .archive-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 22px;
  }

  .page-intro h1,
  .archive-intro h1 {
    font-size: clamp(31px, 9vw, 42px);
  }

  .mini-stats {
    width: 100%;
  }

  .mini-stats > div {
    min-width: 0;
    flex: 1;
  }

  .capture-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    padding: 18px 15px 15px;
  }

  .capture-icon {
    width: 34px;
    height: 34px;
  }

  .capture-inputs input {
    font-size: 15px;
  }

  .capture-submit {
    min-width: 41px;
    width: 41px;
    padding: 0;
  }

  .capture-submit span {
    display: none;
  }

  .capture-submit svg {
    display: block;
  }

  .capture-options {
    padding: 10px 12px 13px;
  }

  .category-picker {
    flex-wrap: nowrap;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .category-picker::-webkit-scrollbar {
    display: none;
  }

  .category-option {
    flex: 0 0 auto;
  }

  .compact-field span,
  .pin-control span {
    display: none;
  }

  .compact-field {
    flex: 1 1 105px;
    justify-content: center;
  }

  .compact-field select,
  .compact-field input {
    max-width: none;
    width: 100%;
  }

  .pin-field {
    flex: 0 0 auto;
  }

  .pin-control {
    width: 34px;
    justify-content: center;
    padding: 0;
  }

  .collection-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-selects {
    width: 100%;
  }

  .toolbar-select {
    flex: 1;
  }

  .toolbar-select select {
    width: 100%;
    min-width: 0;
  }

  .idea-card {
    min-height: 0;
    grid-template-columns: 4px minmax(0, 1fr);
  }

  .idea-content {
    padding: 15px 14px 10px;
  }

  .idea-card h3 {
    white-space: normal;
  }

  .idea-actions {
    grid-column: 2;
    width: auto;
    justify-content: flex-start;
    padding: 0 14px 13px;
  }

  .card-status {
    max-width: 125px;
  }

  .archive-intro .secondary-button {
    align-self: stretch;
  }

  .archive-summary {
    padding: 15px;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 12px;
    bottom: calc(11px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 34;
    display: grid;
    height: 59px;
    grid-template-columns: 1fr 58px 1fr;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(13, 17, 24, 0.92);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    display: flex;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 9px;
  }

  .mobile-bottom-nav a.is-active {
    color: var(--text);
  }

  .mobile-bottom-nav a svg {
    width: 16px;
    height: 16px;
  }

  .mobile-bottom-nav button {
    width: 48px;
    height: 48px;
    min-height: 48px;
    margin: 0 auto;
    border-radius: 15px;
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 10px 24px rgba(255, 255, 255, 0.08);
  }

  .mobile-bottom-nav button svg {
    width: 20px;
    height: 20px;
  }

  .idea-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 19px;
  }

  .dialog-header {
    min-height: 73px;
    padding: 15px 15px 14px 18px;
  }

  .dialog-body {
    padding: 19px 18px 20px;
  }

  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .metadata-card {
    grid-template-columns: 1fr;
  }

  .dialog-footer {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 8px;
    padding: 12px 14px;
  }

  .dialog-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
  }

  .delete-button {
    width: 100%;
  }
}

@media (max-width: 470px) {
  .auth-card {
    padding: 31px 23px;
  }

  .auth-card h1 {
    font-size: 39px;
  }

  .auth-footer {
    text-align: center;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 10px;
  }

  .mobile-menu,
  .avatar-button {
    width: 36px;
    height: 36px;
  }

  .global-search input {
    height: 39px;
    padding-left: 35px;
    font-size: 11px;
  }

  .global-search > svg {
    left: 11px;
    width: 15px;
    height: 15px;
  }

  .page-intro h1,
  .archive-intro h1 {
    font-size: 34px;
  }

  .mini-stats > div {
    padding: 0 9px;
  }

  .capture-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .capture-icon {
    display: none;
  }

  .capture-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
  }

  .compact-field {
    min-width: 0;
    padding: 0 5px;
  }

  .compact-field select,
  .compact-field input {
    padding-left: 0;
    font-size: 9px;
  }

  .idea-actions {
    gap: 4px;
  }

  .status-select-wrap {
    flex: 1;
  }

  .card-status {
    width: 100%;
    max-width: none;
  }

  .archive-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #ambient-canvas,
  .ambient-orb,
  .pointer-glow {
    display: none;
  }
}
