/* ============================================================================
   SURYA — Design System
   Google-style: minimal, clean, professional. No glassmorphism / neon / heavy
   gradients. Light + Dark themes via [data-theme] on <html>.
   ========================================================================== */

/* ----------------------------- Theme tokens ------------------------------ */
:root,
:root[data-theme="light"] {
  --bg:            #ffffff;
  --bg-elev:       #ffffff;
  --bg-sunken:     #f1f3f4;
  --surface:       #ffffff;
  --surface-2:     #f8f9fa;
  --border:        #dadce0;
  --border-soft:   #e8eaed;
  --text:          #202124;
  --text-soft:     #5f6368;
  --text-faint:    #80868b;
  --primary:       #1a73e8;
  --primary-hover: #1b66c9;
  --primary-soft:  #e8f0fe;
  --danger:        #d93025;
  --danger-soft:   #fce8e6;
  --warn:          #f29900;
  --success:       #188038;
  --shadow-1: 0 1px 2px rgba(60,64,67,.10), 0 1px 3px rgba(60,64,67,.08);
  --shadow-2: 0 1px 3px rgba(60,64,67,.12), 0 4px 8px rgba(60,64,67,.10);
  --shadow-3: 0 4px 12px rgba(60,64,67,.15), 0 8px 24px rgba(60,64,67,.12);
  --radius:    8px;
  --radius-lg: 16px;
  --sidebar-w: 256px;
}

:root[data-theme="dark"] {
  --bg:            #202124;
  --bg-elev:       #292a2d;
  --bg-sunken:     #171717;
  --surface:       #292a2d;
  --surface-2:     #303134;
  --border:        #3c4043;
  --border-soft:   #303134;
  --text:          #e8eaed;
  --text-soft:     #9aa0a6;
  --text-faint:    #80868b;
  --primary:       #8ab4f8;
  --primary-hover: #aecbfa;
  --primary-soft:  #283142;
  --danger:        #f28b82;
  --danger-soft:   #3a2422;
  --warn:          #fdd663;
  --success:       #81c995;
  --shadow-1: 0 1px 2px rgba(0,0,0,.30), 0 1px 3px rgba(0,0,0,.25);
  --shadow-2: 0 1px 3px rgba(0,0,0,.40), 0 4px 8px rgba(0,0,0,.30);
  --shadow-3: 0 4px 12px rgba(0,0,0,.50), 0 8px 24px rgba(0,0,0,.40);
}

/* ------------------------------- Reset ----------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--text); }
img { display: block; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ------------------------------ Buttons ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border: 1px solid transparent; border-radius: 20px;
  font-size: 14px; font-weight: 500; background: var(--surface-2); color: var(--text);
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { background: var(--bg-sunken); }
.btn-primary { background: var(--primary); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #202124; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-1); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: transparent; color: var(--text-soft); font-size: 18px;
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; padding: 8px; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------- Screens --------------------------------- */
.screen { position: fixed; inset: 0; z-index: 50; }

/* Splash */
.splash {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: var(--bg);
}
.splash-logo { width: 72px; height: 72px; border-radius: 18px; }
.splash-name { font-size: 24px; font-weight: 600; letter-spacing: 4px; }
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth screens */
.auth-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; background: var(--bg-sunken); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 36px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.auth-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 6px; }
.auth-title { font-size: 22px; font-weight: 600; letter-spacing: 2px; }
.auth-sub { font-size: 14px; color: var(--text-soft); margin-bottom: 18px; text-align: center; }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field-label { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.field input, .input {
  height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; }
.auth-hint { font-size: 13px; color: var(--text-soft); margin-top: 12px; }
.auth-footer { font-size: 12px; color: var(--text-faint); }

/* PIN */
.pin-card { gap: 4px; }
.pin-dots { display: flex; gap: 14px; margin: 14px 0 4px; }
.pin-dots span {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); transition: .15s;
}
.pin-dots span.filled { background: var(--primary); border-color: var(--primary); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; margin: 18px 0 6px; }
.pin-pad button {
  height: 64px; border-radius: 50%; border: 1px solid var(--border-soft);
  background: var(--surface-2); font-size: 22px; font-weight: 500; color: var(--text);
  transition: background .12s, transform .06s;
}
.pin-pad button:active { transform: scale(.94); }
.pin-pad button:hover { background: var(--bg-sunken); }
.pin-pad .pin-ghost { background: transparent; border-color: transparent; font-size: 18px; color: var(--text-soft); }

/* ------------------------------ App layout ------------------------------- */
.app { display: flex; height: 100%; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-elev);
  border-right: 1px solid var(--border-soft); display: flex; flex-direction: column;
  z-index: 30; transition: transform .25s ease;
}
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.sidebar-logo { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-brand { font-size: 20px; font-weight: 600; letter-spacing: 2px; flex: 1; }
.sidebar-collapse { display: none; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px;
  border-radius: 0 22px 22px 0; color: var(--text-soft); font-size: 14px; font-weight: 500;
  margin: 2px 0; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-ico { font-size: 18px; width: 22px; text-align: center; }
.nav-sep { height: 1px; background: var(--border-soft); margin: 8px 6px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border-soft); }
.sidebar-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; opacity: 0;
  pointer-events: none; transition: opacity .25s;
}
.sidebar-scrim.show { opacity: 1; pointer-events: auto; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Topbar */
.topbar {
  height: 64px; flex-shrink: 0; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; border-bottom: 1px solid var(--border-soft); background: var(--bg-elev);
}
#menu-btn { display: none; }
.searchbar {
  flex: 1; max-width: 640px; display: flex; align-items: center; gap: 10px; height: 44px;
  padding: 0 14px; background: var(--surface-2); border: 1px solid transparent; border-radius: 24px;
  transition: background .15s, box-shadow .15s, border-color .15s; cursor: text;
}
.searchbar:focus-within { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-1); }
.searchbar input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; }
.search-ico { color: var(--text-soft); font-size: 16px; }
.search-kbd, kbd {
  font-size: 11px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 5px;
  padding: 2px 6px; font-family: inherit;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.save-indicator { font-size: 12px; color: var(--text-soft); min-width: 60px; text-align: right; }
.save-indicator.saving { color: var(--warn); }
.save-indicator.saved { color: var(--success); }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: none; padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* Content */
.content { flex: 1; overflow-y: auto; padding: 28px; scroll-behavior: smooth; }
@media (max-width: 600px) { .content { padding: 16px; } }

/* Bottom nav (mobile) */
.bottom-nav { display: none; }

/* ------------------------------ Shared UI -------------------------------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 500; }
.page-sub { color: var(--text-soft); font-size: 14px; }
.spacer { flex: 1; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1); padding: 18px;
}
.section-title { font-size: 13px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }

/* Empty states */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 64px 24px; color: var(--text-soft); text-align: center;
}
.empty .empty-ico { font-size: 48px; opacity: .6; }
.empty h3 { font-weight: 500; color: var(--text); }

/* Chips / pills */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border-soft);
  font-size: 13px; color: var(--text-soft);
}
.chip.active { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* Quick actions (Home) */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.quick-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border-soft); box-shadow: var(--shadow-1);
  transition: transform .12s, box-shadow .15s;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.quick-card .qa-ico { font-size: 28px; }
.quick-card .qa-title { font-weight: 500; }
.quick-card .qa-sub { font-size: 12px; color: var(--text-soft); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 22px; }

/* List rows */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--radius);
  transition: background .12s; cursor: pointer;
}
.row:hover { background: var(--surface-2); }
.row .row-ico { font-size: 20px; width: 28px; text-align: center; }
.row .row-main { flex: 1; min-width: 0; }
.row .row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .row-sub { font-size: 12px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .row-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.row:hover .row-actions { opacity: 1; }

/* Notes grid (Keep) */
.masonry { columns: 4 240px; column-gap: 16px; }
@media (max-width: 1100px) { .masonry { columns: 3 240px; } }
@media (max-width: 800px)  { .masonry { columns: 2 180px; } }
@media (max-width: 520px)  { .masonry { columns: 1; } }
.note-card {
  break-inside: avoid; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; background: var(--surface); transition: box-shadow .15s, transform .1s; cursor: pointer;
  position: relative;
}
.note-card:hover { box-shadow: var(--shadow-2); }
.note-card .nc-title { font-weight: 600; margin-bottom: 6px; word-break: break-word; }
.note-card .nc-body { font-size: 14px; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: hidden; }
.note-card .nc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.note-card .nc-tag { font-size: 11px; background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 10px; }
:root[data-theme="dark"] .note-card .nc-tag { background: rgba(255,255,255,.1); }
.note-card .nc-foot { display: flex; align-items: center; gap: 2px; margin-top: 10px; opacity: 0; transition: opacity .12s; }
.note-card:hover .nc-foot { opacity: 1; }
.note-card .nc-pin { position: absolute; top: 8px; right: 8px; font-size: 14px; }
.list-view .masonry, .masonry.list-view { columns: 1; }

/* Files grid */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.file-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-soft); box-shadow: var(--shadow-1);
  cursor: pointer; transition: box-shadow .15s, border-color .15s; position: relative;
}
.file-card:hover { box-shadow: var(--shadow-2); }
.file-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.file-thumb { height: 90px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 34px; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11px; color: var(--text-soft); }
.file-star { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .12s; }
.file-card:hover .file-star { opacity: 1; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-soft); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.dropzone.dragover { outline: 2px dashed var(--primary); outline-offset: -8px; background: var(--primary-soft); border-radius: var(--radius-lg); }

/* Editor (documents) */
.editor-wrap { max-width: 820px; margin: 0 auto; }
.doc-toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 8px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 24px;
  box-shadow: var(--shadow-1); margin-bottom: 18px;
}
.doc-toolbar button, .tbtn {
  min-width: 34px; height: 34px; padding: 0 8px; border: none; border-radius: 17px;
  background: transparent; color: var(--text); font-size: 14px;
}
.doc-toolbar button:hover, .tbtn:hover { background: var(--surface-2); }
.doc-toolbar .sep { width: 1px; height: 22px; background: var(--border-soft); margin: 0 4px; }
.doc-title-input {
  width: 100%; border: none; outline: none; background: transparent; font-size: 30px; font-weight: 500;
  margin-bottom: 8px; color: var(--text);
}
.doc-editor {
  min-height: 60vh; outline: none; font-size: 16px; line-height: 1.7; padding: 8px 0 80px;
}
.doc-editor:empty:before { content: attr(data-placeholder); color: var(--text-faint); }
.doc-editor h1 { font-size: 28px; margin: 18px 0 8px; }
.doc-editor h2 { font-size: 22px; margin: 16px 0 6px; }
.doc-editor h3 { font-size: 18px; margin: 14px 0 6px; }
.doc-editor ul, .doc-editor ol { padding-left: 26px; margin: 8px 0; }
.doc-editor table { border-collapse: collapse; margin: 12px 0; }
.doc-editor td, .doc-editor th { border: 1px solid var(--border); padding: 6px 10px; min-width: 60px; }
.doc-editor a { color: var(--primary); text-decoration: underline; }
.doc-meta { font-size: 12px; color: var(--text-soft); display: flex; gap: 16px; margin-bottom: 10px; }
.focus-mode .topbar, .focus-mode .sidebar { display: none; }

/* Canvas */
.canvas-stage { position: relative; height: calc(100vh - 64px - 56px); background: var(--surface-2); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-soft); }
#draw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.canvas-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 24px; box-shadow: var(--shadow-1); margin-bottom: 12px; }
.canvas-tools .tbtn.active { background: var(--primary-soft); color: var(--primary); }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--primary); }

/* Tables (settings/profile) */
.kv { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.kv:last-child { border-bottom: none; }
.kv .kv-label { font-weight: 500; }
.kv .kv-sub { font-size: 12px; color: var(--text-soft); }

/* Toggle switch */
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 22px; transition: .2s; }
.switch .track:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-1); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track:before { transform: translateX(18px); }

/* Storage bar */
.storage-bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.storage-fill { height: 100%; background: var(--primary); transition: width .4s; }
.storage-fill.warn { background: var(--warn); }
.storage-fill.crit { background: var(--danger); }
.storage-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-soft); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

/* Stats grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 14px; }
.stat { background: var(--surface-2); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat .stat-num { font-size: 26px; font-weight: 600; }
.stat .stat-label { font-size: 12px; color: var(--text-soft); }

/* ------------------------------ Overlay / Modal -------------------------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(0,0,0,.45); }
.search-modal { width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); overflow: hidden; }
.search-modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.search-modal-head input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; }
.search-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-empty { padding: 32px; text-align: center; color: var(--text-soft); }
.search-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); padding: 10px 12px 4px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal {
  width: 100%; max-width: 480px; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column; max-height: 90vh;
}
.modal.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { font-size: 18px; font-weight: 500; flex: 1; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border-soft); }
.modal-preview { display: flex; align-items: center; justify-content: center; background: var(--bg-sunken); min-height: 200px; max-height: 70vh; overflow: auto; }
.modal-preview img, .modal-preview video { max-width: 100%; max-height: 70vh; }
.modal-preview pre { width: 100%; margin: 0; padding: 18px; overflow: auto; font-family: "SF Mono", Consolas, monospace; font-size: 13px; line-height: 1.6; }

/* Toast */
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #323232; color: #fff; padding: 12px 20px; border-radius: var(--radius); font-size: 14px;
  box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 14px; animation: toast-in .25s; max-width: 90vw;
}
.toast button { background: none; border: none; color: var(--primary); font-weight: 600; }
:root[data-theme="dark"] .toast { background: #e8eaed; color: #202124; }
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }

/* Color swatches for notes */
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.color-dot.active { box-shadow: 0 0 0 2px var(--primary); }

/* Utility */
.textarea { width: 100%; min-height: 120px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); resize: vertical; outline: none; line-height: 1.6; }
.textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--text-soft); }
.danger-text { color: var(--danger); }
.right { margin-left: auto; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }

/* ------------------------------ Responsive ------------------------------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); box-shadow: var(--shadow-3);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-collapse { display: inline-flex; }
  #menu-btn { display: inline-flex; }
  .search-kbd { display: none; }
}
@media (max-width: 700px) {
  .bottom-nav {
    display: flex; height: 56px; flex-shrink: 0; border-top: 1px solid var(--border-soft);
    background: var(--bg-elev);
  }
  .bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--text-soft); font-size: 0;
  }
  .bn-item span { font-size: 20px; }
  .bn-item i { font-size: 10px; font-style: normal; }
  .bn-item.active { color: var(--primary); }
  .content { padding-bottom: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
}
