/* ==========================================================================
   Quote of the Day - slim single strip above the hero
   ========================================================================== */
.quote-strip {
  padding: 20px 0 0 0;
}

.quote-strip-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  max-width: 720px;
}

.quote-text {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.45;
  color: var(--text-primary);
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quote-author {
  font-size: 12px;
  color: var(--text-tertiary);
}

.shuffle-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: var(--hairline-border);
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.shuffle-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.shuffle-btn:active {
  transform: scale(0.96);
}

.shuffle-btn .icon-svg {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}

.shuffle-btn.spin .icon-svg {
  animation: shuffleSpin 0.15s var(--ease-apple);
}

@keyframes shuffleSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .shuffle-btn:hover {
  border-color: rgba(0, 0, 0, 0.25);
}



/* ==========================================================================
   Credits Modal + Footer Credit Line
   ========================================================================== */
.credits-body {
  gap: 12px;
}

.credits-logo {
  width: 200px;
  max-width: 100%;
  margin: 0 auto;
}
.credits-logo svg {
  width: 64px;
  height: 64px;
}
.credits-logo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.credits-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 2px;
}
.credits-thanks {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
  text-align: center;
  margin-bottom: 8px;
}
.credits-thanks b { font-weight: 700; }
.credits-proof { font-size: 12px; color: var(--text-secondary); text-align: center; margin-bottom: 8px; }

.credits-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.made-with {
  font-size: 12px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Pixelated Minecraft-style heart */
.pixel-heart {
  width: 14px;
  height: 12px;
  display: inline-block;
  image-rendering: pixelated;
}

.footer-made {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.footer-credits-row {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.footer-credits-row .footer-link-btn {
  padding: 12px 26px;
}

.footer-year-widget {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: var(--hairline-divider);
}

/* Cookie rickroll */
.cookie-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 14px;
  text-decoration: none;
}

.pixel-cookie {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  transition: transform var(--transition-fast);
}

.cookie-row:hover .pixel-cookie {
  transform: rotate(-12deg) scale(1.1);
}

.cookie-text {
  font-family: "Caveat", cursive;
  font-size: 17px;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.cookie-row:hover .cookie-text {
  color: var(--text-secondary);
}

.footer-year-pct {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.footer-year-track {
  width: min(320px, 80%);
  height: 4px;
  border-radius: 2px;
  background: #27272a;
  overflow: hidden;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .footer-year-track {
  background: #e5e5ea;
}

.footer-year-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--accent-blue);
  transition: width 0.15s var(--ease-apple);
}

.footer-year-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Tempting Credits button */
.footer-link-btn.tempting {
  position: relative;
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.footer-link-btn.tempting::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  margin-right: 8px;
  vertical-align: 1px;
}

.footer-link-btn.tempting:hover {
  color: var(--accent-blue);
}



/* ==========================================================================
   Notes Modal
   ========================================================================== */
.notes-area {
  min-height: 90px;
  font-family: var(--font-system);
}

/* Keep-style composer */
.keep-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #18181b;
  border: var(--hairline-border);
  border-radius: 10px;
  padding: 14px;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .keep-composer {
  background: #f5f5f7;
}

.keep-composer input[type="text"] {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 2px 0;
}

.keep-composer input[type="text"]::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Note subject picker */
.keep-scope-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.keep-scope-select {
  flex: 1;
  min-width: 0;
  background: transparent;
  border-style: dashed;
}
.keep-scope-select:focus { background: var(--bg-primary); }

.keep-add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.keep-add-row input[type="text"] {
  flex: 1;
  background: var(--bg-primary);
  border: var(--hairline-border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
}

/* Keep-style cards */
.keep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 560px) {
  .keep-grid {
    grid-template-columns: 1fr;
  }
}

.keep-card {
  background: #18181b;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  min-width: 0;
}

.keep-card:hover {
  background: #202027;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .keep-card {
  background: #f5f5f7;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .keep-card:hover {
  background: #ececef;
}

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

.keep-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keep-card-body {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

.keep-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 20px 0;
}

/* Keep motion: enter, leave, tab fade, composer glow */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* Swoosh: horizontal slide with a soft overshoot, for switching notes */
@keyframes noteSwoosh {
  from { opacity: 0; transform: translateX(56px); }
  60% { opacity: 1; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

.keep-card {
  transition: border-color var(--transition-fast), opacity 0.15s ease, transform 0.15s ease;
}

.keep-card.fresh {
  animation: cardIn 0.15s var(--ease-apple);
}

.keep-card.leaving {
  opacity: 0;
  transform: scale(0.96);
}

#notesTabPane,
#todoTabPane {
  animation: paneIn 0.15s var(--ease-apple);
}

.keep-composer {
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.keep-composer:focus-within {
  border-color: var(--hairline-border-hover);
}

/* Formatting toolbar */
.fmt-bar { display: flex; align-items: center; gap: 4px; }
.fmt-btn {
  min-width: 28px; height: 26px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-secondary);
  border: var(--hairline-border); border-radius: 7px;
  font-size: 12px; cursor: pointer;
}
.fmt-btn:hover { color: var(--text-primary); border-color: var(--accent-blue); }
.fmt-sep { width: 1px; height: 16px; background: var(--hairline-divider); margin: 0 4px; }

/* Composer image + reminder */
.keep-img-prev { display: flex; align-items: flex-start; gap: 8px; }
.keep-img-prev img { max-width: 100%; max-height: 160px; border-radius: 8px; border: var(--hairline-border); }
.keep-remind-row { display: flex; align-items: center; gap: 10px; position: relative; flex-wrap: wrap; }
#keepRemindChip { cursor: pointer; }
.remind-pop {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 50;
  background: var(--bg-surface); border: var(--hairline-border); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 240px;
}
.remind-pop .apple-input { width: 100%; font-size: 12px; }
.remind-pop-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Editable note body */
#keepBody { white-space: pre-wrap; word-break: break-word; }
#keepBody:focus { outline: none; }
#keepBody:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  font-weight: 400;
  pointer-events: none;
}

/* Card extras: image, chips, actions */
.keep-card-img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 8px; border: var(--hairline-border); }
.keep-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.keep-card-actions { display: flex; gap: 2px; margin-left: auto; }
.keep-card-actions .btn-card-glyph { width: 24px; height: 24px; }
.keep-card-body strong { color: var(--text-primary); }
.note-reader-body strong { color: var(--text-primary); }

/* Trash */
.trash-meta { font-size: 12px; color: var(--text-tertiary); font-family: var(--font-mono); }
.trash-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Note reader modal */
.note-reader { gap: 14px; }
.note-reader-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.note-reader-body { font-size: 14px; line-height: 1.6; color: var(--text-secondary); white-space: pre-line; }
#noteModalImg { width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; border: var(--hairline-border); }
.note-reader-actions { flex-wrap: wrap; }
.modal-surface.note-full {
  max-width: none; width: calc(100vw - 32px); height: calc(100vh - 32px); max-height: none;
}
.modal-surface.note-full .note-reader-body { flex: 1; overflow-y: auto; }

/* History rows */
.hist-row { padding: 10px 0; border-bottom: var(--hairline-divider); }
.hist-row:last-child { border-bottom: none; }
.hist-when { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.hist-snippet { font-size: 12px; color: var(--text-secondary); white-space: pre-line; margin: 4px 0 8px 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Smooth tab + card motion */
.keep-grid.play .keep-card { animation: noteSwoosh 0.15s var(--ease-apple) both; }

/* Swoosh the todo + trash lists on tab switch, and the reader on note jump */
#todoTabPane.pane-swap #todoList { animation: noteSwoosh 0.15s var(--ease-apple); }
#trashTabPane.pane-swap #trashList { animation: noteSwoosh 0.15s var(--ease-apple); }
#noteModalBody.swoosh-in { animation: noteSwoosh 0.15s var(--ease-apple); }

/* Directional pane slides: moving right slides in from the right, and vv. */
@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(56px); }
  to { opacity: 1; transform: none; }
}
@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-56px); }
  to { opacity: 1; transform: none; }
}
#notesTabPane.slide-r, #todoTabPane.slide-r, #trashTabPane.slide-r { animation: slideFromRight 0.15s var(--ease-apple); }
#notesTabPane.slide-l, #todoTabPane.slide-l, #trashTabPane.slide-l { animation: slideFromLeft 0.15s var(--ease-apple); }
@media (prefers-reduced-motion: reduce) {
  #todoTabPane.pane-swap #todoList,
  #trashTabPane.pane-swap #trashList,
  #noteModalBody.swoosh-in,
  .keep-grid.play .keep-card,
  #notesTabPane.slide-r, #todoTabPane.slide-r, #trashTabPane.slide-r,
  #notesTabPane.slide-l, #todoTabPane.slide-l, #trashTabPane.slide-l { animation: none; }
}
.pane-swap { animation: paneIn 0.15s var(--ease-apple); }

/* Notes board section */
section[id] {
  scroll-margin-top: 64px;
}

.notes-board {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notes-board .keep-tabs {
  align-self: center;
}

.keep-card {
  cursor: grab;
}

.keep-card.dragging,
.todo-row.dragging {
  opacity: 0.9;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

/* Stable reorder: kill keyframe animations while dragging (FLIP transitions
   below need the transform channel free), but keep transitions alive. */
.keep-grid.is-reordering .keep-card,
.todo-list.is-reordering .todo-row {
  animation: none !important;
}

.keep-grid.is-reordering .keep-card:not(.dragging),
.todo-list.is-reordering .todo-row:not(.dragging) {
  opacity: 1;
}

.keep-card, .todo-row {
  user-select: none;
  -webkit-user-select: none;
}

.keep-card.dragging {
  cursor: grabbing;
}

.todo-row {
  cursor: grab;
}

.todo-quick-add {
  margin-top: 0;
}

.todo-progress {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin: 12px 0 8px 0;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #18181b;
  border-radius: 10px;
  padding: 12px 16px;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .todo-row {
  background: #f5f5f7;
}

.todo-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .todo-circle {
  border-color: rgba(0, 0, 0, 0.3);
}

.todo-circle:hover {
  border-color: var(--accent-blue);
  transform: scale(1.08);
}

.todo-circle.done {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.todo-circle svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.todo-circle.done svg {
  opacity: 1;
  transform: scale(1);
}

.todo-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-text.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
  opacity: 0.6;
}

/* ==========================================================================
   Credits Social Links
   ========================================================================== */
.credit-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.credit-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: #18181b;
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.credit-link:hover {
  background: #202027;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .credit-link {
  background: #f5f5f7;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .credit-link:hover {
  background: #ececef;
}

.credit-link-icon {
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.credit-link-icon .icon-svg {
  width: 18px;
  height: 18px;
}

.brand-yt svg {
  fill: #FF0033;
}

.brand-gh svg {
  fill: var(--text-primary);
}

.brand-dc svg {
  fill: #5865F2;
}

.brand-mail {
  color: var(--text-secondary);
}

.credit-link-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.credit-link-label {
  font-weight: 600;
}

.credit-link-handle {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.credit-link-go {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ==========================================================================
   Calendar - Google-Calendar-style month grid + agenda
   ========================================================================== */
.cal-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.cal-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-month-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 150px;
  text-align: center;
}

.cal-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .cal-layout {
    grid-template-columns: 1fr;
  }
}

.cal-month-card,
.cal-agenda-card {
  background: var(--bg-surface);
  border: var(--hairline-border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-align: center;
  padding-bottom: 4px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  background: transparent;
  border: var(--hairline-border);
  border-radius: 10px;
  min-height: 92px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  text-align: left;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  min-width: 0;
  overflow: hidden;
}

.cal-day:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.02);
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .cal-day:hover,
[data-theme="indie"] .cal-day:hover,
[data-theme="moss"] .cal-day:hover,
[data-theme="marigold"] .cal-day:hover,
[data-theme="marigold-blind"] .cal-day:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.02);
}

.cal-day-out {
  opacity: 0.38;
}

.cal-day-selected {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.cal-day-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.cal-day-today .cal-day-num {
  background: var(--accent-blue);
  color: #ffffff;
}

[data-theme="ghost"] .cal-day-today .cal-day-num {
  color: #000000;
}

.cal-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow: hidden;
}

.cal-chip {
  font-size: 10px;
  line-height: 1.3;
  padding: 1px 5px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  border: none;
  cursor: pointer;
  font-family: inherit;
  max-width: 100%;
}

.cal-chip-event {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
  font-weight: 600;
}

.cal-chip-deadline {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
  font-weight: 500;
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .cal-chip-deadline,
[data-theme="indie"] .cal-chip-deadline,
[data-theme="moss"] .cal-chip-deadline {
  color: #c22e28;
}

.cal-chip-deadline.done {
  background: rgba(127, 127, 133, 0.15);
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.cal-chip-due {
  background: rgba(255, 159, 10, 0.14);
  color: #e07f00;
  font-weight: 600;
}

.cal-chip-capsule {
  background: rgba(48, 209, 88, 0.14);
  color: #1faa4b;
  font-weight: 600;
}

.cal-more {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  padding: 0 6px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
}

.cal-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.cal-agenda-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 24px 0;
}

.cal-agenda-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  text-align: left;
  width: 100%;
  transition: background-color var(--transition-fast);
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .cal-agenda-row,
[data-theme="indie"] .cal-agenda-row,
[data-theme="moss"] .cal-agenda-row {
  background: rgba(0, 0, 0, 0.03);
}

.cal-agenda-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cal-agenda-time {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  flex-shrink: 0;
  min-width: 44px;
}

.cal-agenda-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cal-agenda-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-agenda-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-agenda-tag {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.cal-agenda-tag.event {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
}

.cal-agenda-tag.deadline {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
}

.cal-agenda-tag.due {
  background: rgba(255, 159, 10, 0.14);
  color: #e07f00;
}

.cal-agenda-tag.capsule {
  background: rgba(48, 209, 88, 0.14);
  color: #1faa4b;
}

.cal-agenda-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  margin: 0;
}

@media (max-width: 560px) {
  .cal-day {
    min-height: 56px;
    padding: 4px;
    border-radius: 8px;
  }
  .cal-day-num {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  .cal-chip {
    font-size: 0;
    height: 6px;
    width: 6px;
    border-radius: 50%;
    padding: 0;
    align-self: flex-start;
    margin-left: 4px;
  }
  .cal-chips {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .cal-more {
    font-size: 9px;
    padding: 0 2px;
  }
  .cal-month-title {
    min-width: 120px;
    font-size: 14px;
  }
}

/* Late override: the shared light calendar rule above would otherwise beat
   the Colorblind Light chip color on equal specificity */
html[data-theme="colorblind-light"] .cal-chip-deadline {
  color: #b33a00;
  background: rgba(179, 58, 0, 0.08);
}

/* Knowledge graph: constellation canvas + toolbar */
.graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.graph-toolbar .apple-input { flex: 1; min-width: 160px; }
.graph-toolbar + .graph-toolbar { margin-top: 8px; }
.topic-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 8px;
  box-shadow: var(--shadow-card);
}
.topic-panel-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topic-panel-top .apple-input { flex: 1; min-width: 0; font-weight: 600; }
.topic-panel-dot { width: 12px; height: 12px; margin-right: 0; }
.topic-panel-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.topic-panel-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex: none;
}
.pill-btn-danger {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.35);
}
.pill-btn-danger:hover {
  background: rgba(255, 69, 58, 0.22);
  border-color: rgba(255, 69, 58, 0.55);
}
.topic-path {
  flex: 1;
  min-width: 120px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.graph-wrap {
  position: relative;
  border: var(--hairline-border);
  border-radius: var(--radius-card);
  background: #0d0d0d;
  overflow: hidden;
  margin-top: 10px;
}
/* Obsidian-style vignette: subtle depth at the canvas edges */
.graph-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}
#graphCanvas {
  display: block;
  width: 100%;
  height: 460px;
  cursor: grab;
  touch-action: none;
}
#graphCanvas.graph-drag { cursor: grabbing; }
@media (max-width: 640px) { #graphCanvas { height: 340px; } }
.topic-list-wrap { margin-top: 10px; }
.topic-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.topic-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 600; padding: 6px 8px; border-bottom: var(--hairline-divider); }
.topic-table td { padding: 7px 8px; border-bottom: var(--hairline-divider); vertical-align: top; }
.topic-table tbody tr { cursor: pointer; }
.topic-table tbody tr:hover { background: var(--accent-blue-subtle); }
.topic-table tbody tr.selected { background: var(--accent-blue-subtle); }
.topic-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; flex: none; box-shadow: 0 0 0 1px rgba(127,127,133,0.45); }
.topic-cell { display: flex; align-items: center; min-width: 0; }
.topic-cell span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-sub { color: var(--text-secondary); }
.topic-num { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.topic-detail { margin-top: 8px; border-radius: var(--radius-card); padding: 16px; background: var(--bg-surface); box-shadow: var(--shadow-card); }
.topic-detail .topic-path { margin: 2px 0 10px; }
.topic-detail .apple-textarea { min-height: 76px; margin-top: 4px; }
.topic-detail .pill-btn { margin-top: 8px; }
.topic-readme .pill-btn { margin-top: 10px; }
.btn-quiet { background: transparent; border: none; color: var(--text-tertiary); font-family: inherit; font-size: 11.5px; font-weight: 500; padding: 4px 6px; margin-top: 8px; cursor: pointer; border-radius: 6px; }
.btn-quiet:hover { color: var(--text-secondary); background: var(--bg-surface-subtle); }
.readme-body { font-size: 13.5px; line-height: 1.65; color: var(--text-primary); word-break: break-word; }
.readme-body p { margin: 0 0 8px; }
.readme-body p:last-child { margin-bottom: 0; }
.readme-empty { color: var(--text-tertiary); }
.readme-body code.readme-code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-surface-subtle); border: var(--hairline-border); border-radius: 6px; padding: 1px 5px; }
.readme-codeblock { font-family: var(--font-mono); font-size: 12px; line-height: 1.55; background: var(--bg-surface-subtle); border: var(--hairline-border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; margin: 0 0 8px; }
.readme-codeblock code { font-family: inherit; }
.readme-body .tk-kw { color: #3b8fd9; }
.readme-body .tk-str { color: #c2703d; }
.readme-body .tk-com { color: #6a9955; font-style: italic; }
.readme-body .tk-num { color: #4c9a52; }
.readme-body .tk-fn { color: #8a7a00; }
.topic-edit-actions { display: flex; gap: 8px; }
.topic-subhead { margin-top: 12px; }
.topic-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.topic-chips .chip-btn { display: inline-flex; align-items: center; gap: 6px; }
.topic-arrow { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 11px; width: 20px; flex: none; padding: 0; line-height: 1; }
.topic-arrow:hover { color: var(--text-primary); }
.branch-tabs { display: flex; align-items: flex-end; gap: 4px; margin-top: 10px; overflow-x: auto; }
.branch-tab { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-surface-subtle); border: var(--hairline-border); border-bottom: none; border-radius: 10px 10px 0 0; padding: 6px 12px; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.branch-tab.active { background: var(--bg-surface); color: var(--text-primary); }
.branch-tab .x { border: none; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 12px; padding: 0 0 0 2px; line-height: 1; }
.branch-tab .x:hover { color: var(--text-primary); }
.branch-add { border: var(--hairline-border); border-bottom: none; background: transparent; border-radius: 10px 10px 0 0; color: var(--text-secondary); cursor: pointer; font-size: 13px; padding: 5px 12px; }
.branch-add:hover { color: var(--text-primary); background: var(--bg-surface-subtle); }
.topic-color-input { width: 32px; height: 28px; padding: 2px; border: var(--hairline-border); border-radius: 8px; background: var(--bg-surface); cursor: pointer; flex: none; }
.shake { animation: topicShake 0.15s var(--ease-apple); border-color: #ff453a !important; }
@keyframes topicShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.calc-card { margin-top: 16px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.calc-grid .pill-btn { margin-top: 8px; }
.calc-grid .cal-agenda-hint:last-child { margin-top: 8px; }
@media (max-width: 720px) { .calc-grid { grid-template-columns: 1fr; } }
.settings-stack { display: grid; gap: 10px; }
.settings-stack .pill-btn { margin-top: 6px; }
.settings-modal-surface { max-width: 440px; }
.settings-modal-surface .modal-form { padding: 16px; gap: 10px; max-height: 78vh; overflow-y: auto; }
.settings-modal-surface .modal-header { padding: 14px 18px; }
#settingsModal .apple-card { padding: 16px; }
#settingsModal .modal-title { font-size: 14px; }
#settingsModal .card-title { font-size: 12.5px; }
#settingsModal .theme-group-grid { grid-template-columns: repeat(3, 1fr); }
#settingsModal .theme-group { padding: 2px 2px 6px; }
#settingsModal .theme-option { font-size: 11px; padding: 6px 7px; gap: 7px; }
#settingsModal .cal-agenda-hint { font-size: 12px; }
.drive-steps { margin: 2px 0 2px 18px; font-size: 12px; color: var(--text-secondary); display: grid; gap: 4px; }
.drive-steps .mono { font-family: var(--font-mono); font-size: 12px; }
.region-list { max-height: 190px; overflow-y: auto; display: grid; gap: 2px; margin-top: 6px; }
.region-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; background: transparent; border: none; border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; color: var(--text-primary); cursor: pointer; text-align: left; }
.region-row:hover { background: var(--accent-blue-subtle); }
.region-row.selected { color: var(--accent-blue); }
.mood-row { display: flex; gap: 6px; }
.mood-btn { background: var(--bg-surface-subtle); border: var(--hairline-border); border-radius: var(--radius-sm); font-size: 20px; padding: 6px 10px; cursor: pointer; line-height: 1; }
.mood-btn.active { border-color: var(--accent-blue); background: var(--accent-blue-subtle); }
.journal-list-card { margin-top: 16px; }
.btn-entries-toggle {
  font-size: 14px;
  padding: 10px 22px;
  align-self: flex-start;
  margin: 4px 0 10px 0;
}
.win-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.win-add-row .apple-input {
  flex: 1;
  min-width: 0;
}
.win-add-row .pill-btn {
  flex: none;
}
#winList {
  margin-top: 10px;
}
#winList:empty {
  display: none;
}
.todo-wrap { display: flex; flex-direction: column; }
.todo-subs { margin: 2px 0 6px 30px; display: grid; gap: 4px; }
.todo-sub-row { display: flex; align-items: center; gap: 8px; }
.todo-circle.sub { width: 18px; height: 18px; flex: none; }
.todo-text.sub { font-size: 13px; }
.todo-text.sub.done { text-decoration: line-through; opacity: 0.55; }
.todo-sub-row .sub-input { flex: 1; min-width: 0; padding: 6px 10px; font-size: 13px; }
.todo-exp { flex: none; }
.rate-badge { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--accent-blue-subtle); color: var(--accent-blue); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.journal-row-title { font-weight: 600; }
.journal-row-sub { font-size: 12px; color: var(--text-tertiary); font-family: var(--font-mono); }
.acc-rows { margin-top: 10px; }
.acc-input { width: 100%; height: 34px; }
#quotesList { margin-top: 8px; }
.quote-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: var(--hairline-divider); }
.quote-row:last-child { border-bottom: none; }
.quote-row-text { flex: 1; min-width: 0; }
.settings-danger { border-color: rgba(255, 69, 58, 0.4); }
.storage-rows { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 10px; }
.charts-card { margin-top: 16px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.fin-chart { display: block; width: 100%; height: 180px; }
@media (max-width: 720px) { .charts-grid { grid-template-columns: 1fr; } }
.greet-title { font-family: "EB Garamond", Georgia, serif; font-weight: 500; font-size: clamp(28px, 6vw, 40px); line-height: 1.15; letter-spacing: 0; }
.greet-sub { font-size: 13px; color: var(--text-secondary); }
.quote-card { position: relative; text-align: center; padding: 26px 56px 22px 26px; max-width: 640px; margin: 0 auto; }
.quote-card .shuffle-btn { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.quote-card .quote-text {
  font-family: "EB Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: 0;
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.quote-card .quote-author {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* Minecraft-style advancement toasts + hidden advancement screen */
.adv-toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 10001; display: flex; flex-direction: column; gap: 8px; }
.adv-toast { display: flex; gap: 8px; align-items: center; width: 300px; max-width: calc(100vw - 32px); background: #212121; border: 2px solid #555; outline: 2px solid #000; padding: 8px 12px; cursor: pointer; animation: advSlideIn 0.15s var(--ease-apple); }
.adv-toast.leaving { opacity: 0; transform: translateX(20px); transition: opacity 0.15s, transform 0.15s; }
@keyframes advSlideIn { from { transform: translateX(110%); } to { transform: none; } }
.adv-toast-icon { font-size: 26px; line-height: 1; }
.adv-toast-head { color: #ffff54; font-size: 12px; font-weight: 600; }
.adv-toast-name { color: #fff; font-size: 13px; font-weight: 600; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.adv-card { background: var(--bg-surface); border: var(--hairline-border); border-radius: var(--radius-md); padding: 16px; text-align: center; box-shadow: var(--shadow-card); }
.adv-card.locked { opacity: 0.55; }
.adv-icon { font-size: 26px; }
.adv-card.locked .adv-icon { filter: brightness(0); opacity: 0.7; }
.adv-name { font-weight: 700; margin-top: 6px; }
.adv-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
/* Boarding pass: always-black ticket, theme-independent like the graph canvas */
.boarding-card { margin-top: 16px; background: #0c0c10; border: 1px solid rgba(255,255,255,0.12); color: #f5f5f7; box-shadow: var(--shadow-pop); overflow: hidden; }
.bp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 12px; }
.bp-end { display: flex; flex-direction: column; min-width: 0; }
.bp-end.right { text-align: right; }
.bp-code { font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: -0.02em; }
.bp-city { font-size: 12px; color: #a1a1a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.bp-plane { width: 44px; height: 26px; fill: #f5f5f7; }
.bp-status { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-blue); }
.bp-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; border-top: 1px dashed rgba(255,255,255,0.18); padding-top: 12px; }
.bp-meta .spec-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #8e8e96; }
.bp-val { font-size: 13px; font-weight: 600; }
.bp-barcode { height: 44px; margin-top: 12px; background: repeating-linear-gradient(90deg, #f5f5f7 0 2px, transparent 2px 5px, #f5f5f7 5px 6px, transparent 6px 10px); }
.bp-brand { margin-top: 6px; font-size: 10px; letter-spacing: 0.18em; color: #8e8e96; text-align: center; }
.tour-card { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 900; width: min(420px, calc(100vw - 32px)); background: var(--bg-surface); border: var(--hairline-border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); padding: 14px 16px; }
.tour-text { font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.tour-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tour-count { font-size: 12px; color: var(--text-tertiary); font-family: var(--font-mono); }
@media (max-width: 768px) { .tour-card { bottom: 68px; } }
.bp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.bp-foot .bp-brand { margin-top: 0; text-align: left; }
@media (max-width: 560px) { .bp-code { font-size: 26px; } .bp-meta { grid-template-columns: repeat(2, 1fr); } }
.graph-tip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-surface-subtle);
  border: var(--hairline-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

