@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Linear Dark Aesthetic Colors */
  --bg-primary: #08090a;
  --bg-secondary: #0f1012;
  --bg-card: #131417;
  --bg-card-hover: #191b20;
  --bg-elevated: #1f2128;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: #5e6ad2;
  
  --text-main: #f4f4f6;
  --text-muted: #8a8f98;
  --text-dim: #555861;
  
  --primary: #5e6ad2;
  --primary-hover: #4f5ac4;
  --primary-glow: rgba(94, 106, 210, 0.3);
  --primary-subtle: rgba(94, 106, 210, 0.12);
  
  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.12);
  --danger: #f43f5e;
  --danger-subtle: rgba(244, 63, 94, 0.12);
  
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* APP SHELL */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* HEADER */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px 18px;
  background-color: rgba(8, 9, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-icon {
  display: flex;
  align-items: center;
  color: var(--primary);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

/* LIVE STATUS BADGE */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: var(--success-subtle);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.01em;
}

.live-badge.disconnected {
  background: var(--danger-subtle);
  border-color: rgba(244, 63, 94, 0.25);
  color: var(--danger);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-glow 2.2s infinite;
}

.live-badge.disconnected .live-dot {
  background-color: var(--danger);
  box-shadow: none;
  animation: none;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 10px var(--success); }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 36px;
  gap: 6px;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  gap: 6px;
}

.btn-ghost:hover, .btn-ghost:active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover, .btn-icon:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-danger {
  color: var(--text-muted);
}
.btn-danger:hover, .btn-danger:active {
  color: var(--danger);
  background: var(--danger-subtle);
  border-color: rgba(244, 63, 94, 0.3);
}

/* SEARCH BAR */
.search-bar-wrap {
  padding: 16px 18px 8px 18px;
}

.search-input-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
  width: 18px;
  height: 18px;
  transition: color 0.15s ease;
}

#search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 14px;
  min-height: 46px;
  outline: none;
  transition: all 0.2s ease;
}

#search-input::placeholder {
  color: var(--text-dim);
}

#search-input:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-card-hover);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input-inner:focus-within .search-icon {
  color: var(--primary);
}

/* VIEWS */
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view.hidden {
  display: none !important;
}

/* NOTES LIST GRID */
.notes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px 90px 18px;
}

.note-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.note-card:hover, .note-card:active {
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.note-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.note-card-date {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.note-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.note-filename {
  font-size: 11px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}

.task-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-progress-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-subtle);
}

.task-progress-badge.done {
  background: var(--success-subtle);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--success);
}

.progress-mini-bar {
  width: 44px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.progress-mini-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.task-progress-badge.done + .progress-mini-bar .progress-mini-fill,
.task-progress-wrap:has(.done) .progress-mini-fill {
  background-color: var(--success);
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  color: var(--text-dim);
  margin-bottom: 4px;
}

.empty-state h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* WSKAŹNIK EKRANÓW W NAGŁÓWKU */
.screen-indicator-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}

.screen-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  display: inline-block;
}

.screen-dot.active {
  width: 20px;
  border-radius: 4px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* POZIOMY KONTENER GESTÓW SWIPE (3 EKRANY) */
.swipe-viewport {
  flex: 1;
  width: 100%;
  height: calc(100% - 64px);
  overflow: hidden;
  position: relative;
  touch-action: pan-y pinch-zoom;
  display: flex;
  flex-direction: column;
}

.swipe-track {
  display: flex;
  width: 300%;
  height: 100%;
  will-change: transform;
  transform: translateX(0%);
}

.swipe-screen {
  width: 33.333333%;
  flex: 0 0 33.333333%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* NAGŁÓWEK DLA EKRANÓW ZADAŃ I MARKDOWN */
.note-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(8, 9, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 12px;
  min-height: 52px;
  flex-shrink: 0;
}

.note-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.screen-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(94, 106, 210, 0.25);
  white-space: nowrap;
}

.screen-badge .lucide {
  width: 13px;
  height: 13px;
}

.note-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.note-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.save-badge {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}

/* WIDOK ZADAŃ (EKRAN 1) */
.tasks-content-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px;
  padding-bottom: max(96px, env(safe-area-inset-bottom));
  gap: 16px;
}

/* PŁYWAJĄCY PASEK SZYBKIEGO DODAWANIA ZADANIA */
.floating-task-bar {
  position: sticky;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  margin-top: auto;
  z-index: 30;
  pointer-events: none;
}

.floating-task-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  background: rgba(19, 20, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-task-inner:focus-within {
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 0 2px var(--primary-glow);
  background: rgba(22, 24, 28, 0.98);
}

.floating-icon {
  color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

#new-task-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  padding: 8px 4px;
}

#new-task-input::placeholder {
  color: var(--text-dim);
}

.btn-floating-send {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-floating-send:active {
  transform: scale(0.92);
}

.btn-floating-send:hover {
  background: var(--primary-hover);
}

.btn-floating-send .lucide {
  width: 16px;
  height: 16px;
}

/* WIDOK EDYTORA RAW MARKDOWN (EKRAN 2) */
.raw-content-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 18px 24px 18px;
  gap: 12px;
  min-height: 0;
}

.markdown-toolbar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  flex-shrink: 0;
}

.tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tool-btn:hover, .tool-btn:active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

#raw-editor {
  flex: 1;
  min-height: 380px;
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color 0.15s ease;
}

#raw-editor:focus {
  border-color: var(--border-focus);
}

/* MARKDOWN BODY */
.markdown-body {
  font-size: 15px;
  line-height: 1.6;
  color: #d1d5db;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: #fff;
  margin: 20px 0 10px 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.markdown-body h1 {
  font-size: 22px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}
.markdown-body h2 { font-size: 18px; }
.markdown-body h3 { font-size: 16px; }

.markdown-body p {
  margin-bottom: 12px;
}

.markdown-body ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 16px;
}

.markdown-body li {
  margin-bottom: 6px;
}

/* INTERACTIVE TASKS */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.task-item:hover, .task-item:active {
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.task-item.completed {
  opacity: 0.55;
  background-color: rgba(19, 20, 23, 0.4);
  border-color: var(--border-subtle);
}

.task-checkbox-custom {
  width: 22px;
  height: 22px;
  min-width: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 1px;
  background-color: transparent;
}

.task-item:hover .task-checkbox-custom {
  border-color: var(--text-muted);
}

.task-item.completed .task-checkbox-custom {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.task-checkbox-custom::after {
  content: "";
  display: none;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.task-item.completed .task-checkbox-custom::after,
.task-item.status-verified .task-checkbox-custom::after {
  display: block;
}

/* Status: Done (in progress/ready for review) */
.task-item.status-done {
  background-color: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
}

.task-item.status-done .task-checkbox-custom {
  background-color: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.task-item.status-done .task-checkbox-custom::after {
  display: block;
  content: "";
  width: 6px;
  height: 6px;
  background: #ffffff;
  border: none;
  border-radius: 2px;
  transform: none;
  margin-bottom: 0;
}

/* Status: Verified (confirmed by user) */
.task-item.status-verified {
  background-color: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
  opacity: 0.85;
}

.task-item.status-verified .task-checkbox-custom {
  background-color: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.task-item.status-verified .task-label {
  text-decoration: line-through;
  color: var(--text-dim);
}

/* Task Status Badges */
.task-badge-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-left: 8px;
}

.badge-todo {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-done {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Task Notes / Revision Box */
.task-notes-box {
  margin-top: -2px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.task-notes-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.task-notes-icon {
  color: #f59e0b;
  flex-shrink: 0;
}

.task-notes-text {
  color: #fef3c7;
  line-height: 1.45;
  word-break: break-word;
}

/* RAW MARKDOWN EDITOR */
.markdown-toolbar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tool-btn:hover, .tool-btn:active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

#raw-editor {
  flex: 1;
  min-height: 380px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

#raw-editor:focus {
  border-color: var(--border-focus);
}

/* MODALS & PIN KEYPAD */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 5, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.pin-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pin-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-subtle);
  border: 1px solid rgba(94, 106, 210, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
}

.pin-brand-icon {
  width: 26px;
  height: 26px;
}

.pin-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.pin-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin: 6px 0 24px 0;
}

/* 4 PIN Dots Indicator */
.pin-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  min-height: 24px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background-color: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  transform: scale(1.18);
}

/* Shake animation on error */
.pin-dots.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.pin-dots.error .pin-dot {
  background-color: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 12px var(--danger-subtle);
}

@keyframes shake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Keypad Grid */
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 270px;
}

.keypad-btn {
  height: 64px;
  width: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.keypad-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.keypad-btn:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.92);
}

.keypad-btn.keypad-empty {
  visibility: hidden;
  pointer-events: none;
}

.keypad-btn.keypad-action {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.keypad-btn.keypad-action:hover, .keypad-btn.keypad-action:active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.keypad-btn.keypad-action .lucide {
  width: 24px;
  height: 24px;
}

/* Modals input for new note */
#new-note-title {
  width: 100%;
  padding: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  margin-bottom: 20px;
  transition: border-color 0.15s ease;
}

#new-note-title:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.error-msg {
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

/* Lucide Icon defaults */
.lucide {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 2px;
  width: 1.15rem;
  height: 1.15rem;
}

/* TASK WITH AGENT PROMPT */
.task-item.has-prompt {
  border-left: 3.5px solid #8b5cf6;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-card) 60%);
  border-color: rgba(139, 92, 246, 0.28);
}

.task-item.has-prompt:hover,
.task-item.has-prompt:active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.14) 0%, var(--bg-card-hover) 60%);
  border-color: rgba(139, 92, 246, 0.45);
}

.task-item.has-prompt.completed {
  border-left-color: rgba(139, 92, 246, 0.4);
  background: rgba(19, 20, 23, 0.4);
}

.prompt-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-left: 8px;
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
}

.prompt-badge-pill:hover {
  background: rgba(139, 92, 246, 0.28);
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-1px);
}

.prompt-badge-pill svg,
.prompt-badge-pill i {
  width: 12px;
  height: 12px;
}

/* PROMPT MODAL STYLES */
.prompt-modal-box {
  background: var(--bg-card);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(139, 92, 246, 0.12);
  animation: promptModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes promptModalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.prompt-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 16, 18, 0.6);
  gap: 12px;
}

.prompt-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.prompt-ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 3px 9px;
  border-radius: 9999px;
  width: fit-content;
}

.prompt-ready-pill svg,
.prompt-ready-pill i {
  width: 13px;
  height: 13px;
}

.prompt-task-title {
  font-size: 16px;
  font-weight: 600;
  color: #f4f4f6;
  line-height: 1.35;
  margin: 0;
  word-break: break-word;
}

.prompt-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prompt-meta-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.prompt-meta-hint svg,
.prompt-meta-hint i {
  color: #8b5cf6;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.prompt-markdown-content {
  font-size: 13.5px;
  line-height: 1.6;
  color: #e2e8f0;
}

.prompt-markdown-content h1,
.prompt-markdown-content h2,
.prompt-markdown-content h3,
.prompt-markdown-content h4 {
  color: #fff;
  margin-top: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.prompt-markdown-content h1 { font-size: 17px; }
.prompt-markdown-content h2 { font-size: 15px; }
.prompt-markdown-content h3 { font-size: 14px; }

.prompt-markdown-content pre {
  background: #090a0d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  font-size: 12px;
  margin: 10px 0;
}

.prompt-markdown-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prompt-markdown-content ul,
.prompt-markdown-content ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.prompt-markdown-content li {
  margin-bottom: 4px;
}

.prompt-edit-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.prompt-edit-textarea {
  width: 100%;
  min-height: 280px;
  padding: 14px;
  background: #090a0d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

.prompt-edit-textarea:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.prompt-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 16, 18, 0.7);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: #1e1e24;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.2);
  border-radius: 9999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: #0f1c18;
  color: #34d399;
}

.toast-info {
  border-color: rgba(139, 92, 246, 0.4);
  background: #181424;
  color: #c4b5fd;
}


/* === JSON TASK SYSTEM ENHANCEMENTS === */
.note-desc-banner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-content-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.task-title-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: break-word;
  letter-spacing: -0.01em;
}

.task-item.status-verified .task-title-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

.task-meta-indicators {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.indicator-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.indicator-status.badge-todo {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.28);
}
.indicator-status.badge-todo .status-dot {
  background-color: #94a3b8;
}

.indicator-status.badge-done {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.38);
}
.indicator-status.badge-done .status-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

.indicator-status.badge-verified {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.38);
}
.indicator-status.badge-verified .status-dot {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

.indicator-prompt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.12);
  transition: all 0.15s ease;
}

.indicator-prompt svg,
.indicator-prompt i {
  width: 12px;
  height: 12px;
  color: #a78bfa;
}

.indicator-prompt:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.55);
}

.prompt-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.task-modal-input,
.task-modal-select,
.task-modal-textarea {
  width: 100%;
  background: #090a0d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 13.5px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.task-modal-input:focus,
.task-modal-select:focus,
.task-modal-textarea:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.task-modal-select {
  cursor: pointer;
}

.prompt-no-spec {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.prompt-no-spec .lucide {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-dim);
}
