/* ==========================================================================
   Here — Apple Notes Canvas Landing Page
   Full macOS Notes replica. Plain. Simple. Elegant.
   ========================================================================== */

:root {
  --bg-white: #FFFFFF;
  --bg-sidebar: #F2F2F7;
  --bg-toolbar: #F8F8FA;
  --bg-hover: rgba(0, 0, 0, 0.04);

  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #8E8E93;
  --text-quaternary: #AEAEB2;

  --accent: #007AFF;
  --accent-hover: #0071E3;
  --green: #34C759;

  --border: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.06);

  --shadow-window: 0 24px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-popup: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;

  --curve: cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode {
  --bg-white: #1C1C1E;
  --bg-sidebar: #252528;
  --bg-toolbar: #2D2D30;
  --bg-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #F5F5F7;
  --text-secondary: #A1A1A6;
  --text-tertiary: #8E8E93;
  --text-quaternary: #636366;

  --accent: #0A84FF;
  --accent-hover: #409CFF;

  --border: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.06);

  --shadow-window: 0 28px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: #141416;
}

body.dark-mode.revealed {
  background: #000000;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font);
  color: var(--text-primary);
  background: #E8E8ED;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8E8ED;
}

body.revealed {
  overflow-y: auto;
  display: block;
  background: var(--bg-white);
}

::selection {
  background: rgba(0, 122, 255, 0.25);
  color: var(--text-primary);
}

.user-select-text {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

/* ==========================================================================
   THE NOTES APP WINDOW
   ========================================================================== */

.notes-app {
  width: 95vw;
  max-width: 1200px;
  height: 88vh;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-window);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.8s var(--curve), opacity 0.8s var(--curve);
}

.notes-app.transitioning {
  transform: scale(0.94) translateY(-30px);
  opacity: 0;
  pointer-events: none;
}

/* Titlebar */
.notes-titlebar {
  height: 38px;
  min-height: 38px;
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  user-select: none;
  -webkit-app-region: drag;
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 60px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s var(--curve), opacity 0.15s;
}

.dot:hover {
  transform: scale(1.18);
}

.dot-close { background: #FF5F57; }
.dot-minimize { background: #FEBC2E; }
.dot-zoom { background: #28C840; }

.titlebar-center {
  display: flex;
  align-items: center;
  gap: 6px;
}

.titlebar-icon {
  flex-shrink: 0;
}

.titlebar-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
}

.titlebar-spacer {
  width: 60px;
}

/* Toolbar */
.notes-toolbar {
  height: 36px;
  min-height: 36px;
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  user-select: none;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 2px;
}

.toolbar-btn {
  width: 30px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.1s, transform 0.15s;
}

.toolbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toolbar-separator {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.toolbar-right {
  display: flex;
  align-items: center;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-tertiary);
  min-width: 140px;
  cursor: pointer;
  transition: all 0.15s;
}

.toolbar-search:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-secondary);
}

body.dark-mode .toolbar-search:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.banter-nudge {
  animation: banterNudge 0.25s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes banterNudge {
  0% { transform: scale(1); }
  45% { transform: scale(0.88); }
  100% { transform: scale(1); }
}

/* Three-Column Body */
.notes-body {
  flex: 1;
  display: grid;
  grid-template-columns: 180px 250px 1fr;
  min-height: 0;
}

/* Column 1: Sidebar */
.notes-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 0;
  overflow-y: auto;
  user-select: none;
}

.sidebar-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  padding: 0 16px;
  margin-bottom: 8px;
}

.sidebar-section {
  flex: 1;
}

.sidebar-group {
  margin-top: 2px;
}

.sidebar-group-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 16px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 32px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: 6px;
  margin: 1px 8px;
  cursor: default;
  transition: background 0.1s;
}

.sidebar-item.active {
  background: var(--accent);
  color: #FFFFFF;
}

.sidebar-item.active svg path {
  fill: #FFFFFF;
}

.sidebar-item-label {
  flex: 1;
  font-weight: 500;
}

.sidebar-item-count {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}

.sidebar-item.dimmed {
  opacity: 0.5;
}

.sidebar-bottom {
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* Column 2: Note List */
.notes-list {
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  user-select: none;
}

.note-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s, opacity 0.3s var(--curve);
}

.note-item:hover:not(.locked):not(.ambient) {
  background: rgba(0, 0, 0, 0.03);
}

.note-item.active {
  background: var(--accent);
}

.note-item.active .note-item-title,
.note-item.active .note-item-time,
.note-item.active .note-item-preview {
  color: #FFFFFF;
}

.note-item.locked {
  opacity: 0.35;
  cursor: default;
}

.note-item.ambient {
  opacity: 0.3;
  cursor: default;
}

.note-item.completed .note-item-title::after {
  content: " ✓";
  color: var(--green);
  font-size: 11px;
}

.note-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.1px;
}

.note-item-row2 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-item-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.note-item-preview {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column 3: Note Content */
.notes-content {
  background: var(--bg-white);
  overflow-y: auto;
  position: relative;
}

.note-panel {
  display: none;
  padding: 24px 40px 60px;
  animation: noteFadeIn 0.2s ease-out forwards;
}

.note-panel.active {
  display: block;
}

@keyframes noteFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.note-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 20px;
}

.note-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.note-body {
  line-height: 1.65;
}

.note-quote {
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.5;
  display: block;
}

.note-body-sub {
  font-size: 15px;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 4px;
  margin-bottom: 16px;
}

.note-link {
  font-size: 16px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 122, 255, 0.3);
  text-underline-offset: 3px;
  margin-bottom: 4px;
  display: block;
  word-break: break-all;
}

.note-hint {
  font-size: 13px;
  color: #8E8E93;
  font-style: italic;
  margin-top: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  display: inline-block;
  user-select: none;
  transition: color 0.15s ease;
}

.note-hint:hover {
  color: var(--accent);
}

.note-image-wrapper {
  position: relative;
  max-width: 480px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  border: 2.5px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.15s var(--curve);
  outline: none;
}

.note-image-wrapper:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.note-image-wrapper.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.3), 0 4px 16px rgba(0, 0, 0, 0.12);
}

.image-action-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 30, 34, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 980px;
  padding: 5px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.18s var(--curve);
  z-index: 4;
}

.note-image-wrapper:hover .image-action-pill,
.note-image-wrapper.selected .image-action-pill,
.note-image-wrapper:focus .image-action-pill {
  opacity: 1;
  transform: translateY(0);
}

.image-action-pill:hover {
  background: var(--accent);
  border-color: transparent;
}

.image-copied-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(30, 30, 34, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 980px;
  opacity: 0;
  transform: translateY(-4px) scale(0.95);
  transition: all 0.2s var(--curve);
  pointer-events: none;
  z-index: 5;
}

.image-copied-badge.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.note-image {
  width: 100%;
  display: block;
}

.note-body-hint {
  font-size: 15px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

/* First-Principles Paste Zone (Pure Apple Notes - Zero Cards) */
.note-paste-zone {
  min-height: 120px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.note-paste-zone .pasted-item {
  animation: notePastedIn 0.25s ease-out forwards;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

@keyframes notePastedIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.raw-note-text {
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

.raw-note-sub {
  font-size: 15px;
  color: var(--text-tertiary);
  font-style: italic;
  display: block;
  margin-top: 4px;
}

.raw-note-link {
  margin: 0;
}

.raw-note-link a {
  font-size: 16px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 122, 255, 0.3);
  text-underline-offset: 3px;
  font-weight: 500;
}

.raw-note-image {
  max-width: 480px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.raw-note-image img {
  width: 100%;
  display: block;
}

/* Blinking cursor */
.note-cursor {
  font-size: 17px;
  font-weight: 300;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  display: inline-block;
  margin-top: 8px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Green check on completed notes */
.note-item.completed:not(.active) .note-item-title {
  color: var(--text-primary);
}

/* ==========================================================================
   POST-REVEAL SECTIONS (Cinematic Staggered Cascade)
   ========================================================================== */

.reveal-wrapper {
  display: none;
  opacity: 0;
}

body.revealed .reveal-wrapper {
  display: block;
  opacity: 1;
}

body.revealed .notes-app {
  display: none;
}

body.revealed .reveal-headline {
  animation: heroCascadeUp 0.8s 0.1s var(--curve) both;
}

body.revealed .reveal-sub {
  animation: heroCascadeUp 0.8s 0.25s var(--curve) both;
}

body.revealed .reveal-download {
  animation: heroCascadeUp 0.8s 0.4s var(--curve) both;
}

body.revealed .haiku-line:nth-child(1) {
  animation: heroCascadeUp 0.7s 0.6s var(--curve) both;
}
body.revealed .haiku-line:nth-child(2) {
  animation: heroCascadeUp 0.7s 0.75s var(--curve) both;
}
body.revealed .haiku-line:nth-child(3) {
  animation: heroCascadeUp 0.7s 0.9s var(--curve) both;
}
body.revealed .haiku-line:nth-child(4) {
  animation: heroCascadeUp 0.7s 1.05s var(--curve) both;
}

body.revealed .reveal-faq {
  animation: heroCascadeUp 0.8s 1.2s var(--curve) both;
}

@keyframes heroCascadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero */
.reveal-hero {
  padding: 140px 24px 80px;
  text-align: center;
}

.reveal-container {
  max-width: 680px;
  margin: 0 auto;
}

.reveal-container-narrow {
  max-width: 560px;
  margin: 0 auto;
}

.reveal-headline {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.06;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.reveal-sub {
  font-size: 19px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  letter-spacing: -0.2px;
}

.reveal-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #1D1D1F;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 980px;
  text-decoration: none;
  transition: all 0.2s var(--curve);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.reveal-download svg {
  stroke: currentColor;
}

.reveal-download:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

body.dark-mode .reveal-download {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.14);
}

body.dark-mode .reveal-download svg {
  stroke: #000000;
}

body.dark-mode .reveal-download:hover {
  background: #E5E5EA;
  color: #000000;
  box-shadow: 0 8px 28px rgba(255, 255, 255, 0.22);
}

/* The Haiku */
.reveal-haiku {
  padding: 80px 24px 100px;
  text-align: center;
}

.haiku-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.haiku-line {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: lowercase;
  color: var(--text-primary);
}

.haiku-line.subtle {
  font-weight: 400;
  font-size: 17px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-top: 6px;
}

.haiku-line.on-mac {
  font-weight: 500;
  font-size: 15px;
  color: var(--text-tertiary);
  letter-spacing: 1.5px;
  margin-top: 14px;
}

/* FAQ */
.reveal-faq {
  padding: 60px 24px 80px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  cursor: pointer;
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-q {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--text-tertiary);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item[open] .faq-q::after {
  content: "−";
}

.faq-a {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Footer */
.reveal-footer {
  text-align: center;
  padding: 40px 24px;
  font-size: 13px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   OVERLAYS
   ========================================================================== */

/* Cutie Modal */
.cutie-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--curve);
}

.cutie-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.cutie-dialog {
  width: 92%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
  border: 0.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 22px 22px 18px;
  text-align: center;
  transform: scale(0.94);
  transition: transform 0.2s var(--curve);
}

.cutie-backdrop.visible .cutie-dialog {
  transform: scale(1);
}

.cutie-dialog.shake {
  animation: dialogShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes dialogShake {
  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); }
}

.cutie-app-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cutie-icon-img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}

.dialog-content-block {
  margin: 14px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: rgba(0, 0, 0, 0.03);
  padding: 10px 14px;
  border-radius: 8px;
}

.dialog-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  font-family: var(--font);
  white-space: nowrap;
}

.dialog-tag {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: lowercase;
  flex-shrink: 0;
  width: 44px;
}

.dialog-tag.accent {
  color: var(--accent);
}

.dialog-phrase {
  color: var(--text-primary);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.dialog-phrase.highlight {
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-primary);
  white-space: nowrap;
}

.dialog-question {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: lowercase;
  margin: 8px 0 14px;
  letter-spacing: -0.1px;
}

.cutie-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cutie-btn {
  width: 105px;
  padding: 6px 14px;
  height: 30px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  text-transform: lowercase;
  cursor: pointer;
  transition: all 0.1s;
}

.cutie-no {
  background: rgba(0, 0, 0, 0.05);
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.cutie-no:hover {
  background: rgba(0, 0, 0, 0.09);
}

.cutie-yes {
  background: var(--accent);
  border: none;
  color: #FFFFFF;
}

.cutie-yes:hover {
  background: var(--accent-hover);
}

/* Dark mode dialog overrides */
body.dark-mode .cutie-dialog {
  background: rgba(38, 38, 42, 0.88);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode .dialog-content-block {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .dialog-phrase {
  color: #F5F5F7;
}

body.dark-mode .dialog-question {
  color: #A1A1A6;
}

body.dark-mode .cutie-no {
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  color: #F5F5F7;
}

body.dark-mode .cutie-no:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Side Theme Toggle Button */
.side-theme-toggle {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 999999;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 980px;
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.2s var(--curve);
  user-select: none;
}

.side-theme-toggle:hover {
  transform: scale(1.03);
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.2);
}

.side-theme-label {
  text-transform: lowercase;
  letter-spacing: -0.1px;
}

body.dark-mode .side-theme-toggle {
  background: rgba(40, 40, 44, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  color: #A1A1A6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .side-theme-toggle:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

body.dark-mode .sun-icon { display: block; }
body.dark-mode .moon-icon { display: none; }

/* Virtual Here Popup */
.here-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  background: rgba(30, 30, 34, 0.94);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: var(--shadow-popup);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.94);
  transform-origin: top left;
  transition: opacity 0.12s var(--curve), transform 0.12s var(--curve);
  overflow: hidden;
}

.here-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-label {
  font-size: 11px;
  font-weight: 600;
  color: #8E8E93;
}

.popup-filters {
  display: flex;
  gap: 2px;
}

.popup-filter {
  font-size: 10px;
  font-weight: 500;
  color: #8E8E93;
  padding: 2px 7px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.1s;
}

.popup-filter.active {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.popup-items {
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.08s;
}

.popup-row:hover {
  background: rgba(0, 122, 255, 0.4);
}

.popup-row-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
}

.popup-row-icon.type-text { background: rgba(142, 142, 147, 0.15); color: #8E8E93; }
.popup-row-icon.type-link { background: rgba(0, 122, 255, 0.2); color: #0A84FF; }
.popup-row-icon.type-image { background: rgba(191, 90, 242, 0.2); color: #BF5AF2; }

.popup-row-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.popup-row-text {
  flex: 1;
  font-size: 11px;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.popup-row-domain {
  font-size: 10px;
  font-weight: 600;
  color: #0A84FF;
}

.popup-row-time {
  font-size: 9px;
  color: #636366;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  z-index: 999999;
  background: rgba(29, 29, 31, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 980px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  top: -9999px;
  left: -9999px;
  transform: translateY(6px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

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

body.dark-mode .toast {
  background: rgba(40, 40, 44, 0.94);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  color: #F5F5F7;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .notes-app {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: none;
  }

  .notes-body {
    grid-template-columns: 1fr;
  }

  .notes-sidebar,
  .notes-list {
    display: none;
  }

  .notes-content {
    border: none;
  }

  .note-panel {
    padding: 20px 20px 40px;
  }

  .note-title {
    font-size: 24px;
  }

  .reveal-headline {
    font-size: 36px;
    letter-spacing: -1.2px;
  }

  .reveal-sub {
    font-size: 16px;
  }

  .haiku-line {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .haiku-line.subtle {
    font-size: 14px;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .notes-body {
    grid-template-columns: 240px 1fr;
  }

  .notes-sidebar {
    display: none;
  }
}

@media (max-width: 420px) {
  .cutie-dialog {
    padding: 18px 14px 16px;
    width: 96%;
  }
  .dialog-content-block {
    padding: 8px 10px;
  }
  .dialog-line {
    font-size: 11px;
    gap: 5px;
  }
  .dialog-tag {
    width: 38px;
    font-size: 10px;
  }
}
