/* ASCENDOJO CARPE DIEM — reskin of kr1ptx-tools/Carpediem onto the
   shell's own glass/Dojo tokens (tokens.css, app.css), same approach as
   oracle.css / strategy-lab.css / calendar.css / tracker.css: layout &
   behavior only, color/radius/type/motion come from shared design
   tokens. KR1O's widget here is DELIBERATELY different from tracker.css's
   version (bottom-left, crossfading images, no repeating auto-cycle) —
   same character, same 3 shared avatar assets, different presentation,
   matching how differently the two original tools built it. */

.cd-page {
  max-width: 720px;
}

.cd-clock {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--shell-ink-faint);
  margin-top: 6px;
}

.cd-view {
  margin-top: 20px;
}

.cd-card {
  margin-bottom: 0;
}
.cd-card__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}
.cd-card__head strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--shell-ink);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cd-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--shell-ink-faint);
}

.cd-field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dojo-accent);
  margin-bottom: 10px;
}

/* ── Dash ── */
.cd-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.cd-stat-box {
  background: var(--shell-bg-raised);
  border: 1px solid var(--shell-border);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: center;
}
.cd-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shell-ink-faint);
  margin-bottom: 6px;
}
.cd-stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--shell-ink);
}
.cd-mini-goal {
  background: var(--shell-bg-raised);
  border: 1px solid var(--shell-border);
  border-radius: var(--r-md);
  padding: 18px;
}
.cd-mini-goal__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dojo-accent);
  font-weight: 700;
}
.cd-mini-goal__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--shell-ink);
  margin-top: 8px;
  word-break: break-word;
}
.cd-progress-track {
  height: 4px;
  background: var(--shell-border);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 16px;
}
.cd-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--dojo-accent);
  transition: width 1s ease;
}

/* ── Task list (TASKS tab) ── */
.cd-sublabel {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--dojo-accent);
  margin-bottom: 10px;
}
.cd-sublabel--muted {
  color: var(--shell-ink-faint);
  margin-top: 32px;
}
.cd-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.cd-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--shell-bg-raised);
  border: 1px solid var(--shell-border);
  border-left: 3px solid var(--dojo-accent);
  border-radius: var(--r-sm);
  transition: opacity 0.2s ease;
}
.cd-task-row.is-done {
  border-left-color: var(--accent-green);
  opacity: 0.55;
}
.cd-task-row__text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--shell-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-task-row.is-done .cd-task-row__text {
  text-decoration: line-through;
  color: var(--shell-ink-faint);
}
.cd-task-row__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cd-task-row__actions button {
  background: none;
  border: none;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-mono);
}
.cd-task-row__actions button[data-action="toggle-task"] {
  color: var(--accent-green);
}
.cd-task-row__actions button[data-action="delete-task"] {
  color: var(--state-danger);
}
.cd-task-toast {
  text-align: center;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--accent-green);
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.cd-task-standby {
  padding: 14px;
  background: var(--shell-bg-raised);
  border: 1px dashed var(--shell-border-strong);
  border-radius: var(--r-sm);
  color: var(--shell-ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

.cd-timer-block {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--shell-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.cd-timer-display {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--shell-ink);
  line-height: 1;
}
.cd-timer-caption {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--shell-ink-faint);
}
.cd-timer-block .btn {
  width: 100%;
}

/* ── MIND tab / scratch canvas ── */
.cd-scratch-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  background: #000;
  border: 1px solid var(--shell-border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  touch-action: none;
}
.cd-scratch-quote {
  text-align: center;
  padding: 30px;
  z-index: 1;
}
.cd-scratch-quote h2 {
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--shell-ink);
}
.cd-scratch-quote p {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--shell-ink-faint);
  margin-top: 8px;
}
#cdScratchCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* ── KR1O widget — bottom-left, one-shot spawn timer, 3-image crossfade,
   deliberately different from tracker.css's bottom-right repeating
   version. ── */
.cd-kr1o {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  pointer-events: none;
}
.cd-kr1o-body {
  pointer-events: auto;
  position: relative;
  width: 84px;
  height: 100px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.cd-kr1o-body:hover {
  transform: scale(1.05) translateY(-3px);
}
.cd-kr1o-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}
.cd-kr1o-info {
  position: absolute;
  top: -12px;
  right: -6px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--shell-ink);
  background: var(--shell-bg-raised);
  border: 1px solid var(--shell-border-strong);
  border-radius: var(--r-sm);
  padding: 2px 7px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cd-kr1o-info:hover {
  border-color: var(--dojo-accent);
  color: var(--dojo-accent);
}

.cd-kr1o-bubble {
  pointer-events: auto;
  width: 280px;
  max-width: calc(100vw - 140px);
  background: var(--shell-bg-raised);
  border: 1px solid var(--shell-border-strong);
  border-radius: var(--r-md) var(--r-md) var(--r-md) 0;
  padding: 18px;
  box-shadow: var(--glass-inner-glow), var(--shadow-lg);
  position: relative;
  transform-origin: left bottom;
  opacity: 0;
  transform: scale(0.85) translateX(-12px);
  visibility: hidden;
  transition: 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.2);
}
.cd-kr1o.cd-bubble-active .cd-kr1o-bubble {
  opacity: 1;
  transform: scale(1) translateX(0);
  visibility: visible;
}
.cd-kr1o-shutdown {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--shell-ink-faint);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease;
}
.cd-kr1o-shutdown:hover {
  color: var(--shell-ink);
}
.cd-kr1o-name {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dojo-accent);
  margin-bottom: 6px;
}
.cd-kr1o-message {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--shell-ink);
  margin-bottom: 5px;
}
.cd-kr1o-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--shell-ink-dim);
}
.cd-kr1o--urgent .cd-kr1o-bubble {
  border-color: var(--state-danger);
  box-shadow: 0 10px 30px -10px rgba(224, 96, 90, 0.35);
}
.cd-kr1o--urgent .cd-kr1o-name {
  color: var(--state-danger);
}
.cd-kr1o--success .cd-kr1o-bubble {
  border-color: var(--accent-green);
  box-shadow: 0 10px 30px -10px rgba(52, 211, 153, 0.35);
}
.cd-kr1o--success .cd-kr1o-name {
  color: var(--accent-green);
}

/* ── Tutorial modal — local fixed overlay, same technique as
   oracle.css's .oracle-overlay/.oracle-modal. ── */
.cd-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(3, 3, 3, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cd-overlay.show {
  display: flex;
}
.cd-tutorial-card {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--shell-bg-raised);
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--r-xl);
  padding: 30px 24px;
  text-align: center;
  box-shadow: var(--glass-inner-glow), var(--shadow-lg);
}
.cd-tutorial-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin: 0 auto 20px;
}
.cd-tut-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--shell-ink);
  margin-bottom: 10px;
}
.cd-tut-text {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--shell-ink-dim);
  margin-bottom: 22px;
  min-height: 70px;
}
.cd-tut-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.cd-tut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--shell-border-strong);
  transition: background-color 0.2s ease;
}
.cd-tut-dot.active {
  background: var(--shell-ink);
}
.cd-tut-actions {
  display: flex;
  gap: 10px;
}
.cd-tut-actions .btn {
  flex: 1;
}

/* ── Mobile ── */
@media (max-width: 560px) {
  .cd-kr1o {
    bottom: 16px;
    left: 16px;
    gap: 10px;
  }
  .cd-kr1o-body {
    width: 64px;
    height: 78px;
  }
  .cd-kr1o-bubble {
    width: 230px;
    padding: 14px;
  }
  .cd-stats-grid {
    gap: 8px;
  }
  .cd-timer-display {
    font-size: 28px;
  }
}
