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

  body { background: #faf9f7; min-height: 100vh; font-family: 'Inter', sans-serif; color: #1c1917; }

  .ts-container { max-width: 800px; margin: 0 auto; padding: 70px 20px 100px; }

  /* ── BACK LINK ── */
  .back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: #a8a29e; text-decoration: none; margin-bottom: 28px;
    transition: color 0.15s;
  }
  .back-link:hover { color: #78716c; }

  /* ── TRACKER HEADER ── */
  .ts-header {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 32px; flex-wrap: wrap;
  }
  .ts-icon {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; flex-shrink: 0;
    background: <?php echo $light_bg; ?>;
  }
  .ts-title-wrap { flex: 1; min-width: 0; }
  .ts-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 400; color: #1c1917; margin-bottom: 4px;
  }
  .ts-meta { font-size: 12px; color: #a8a29e; letter-spacing: 0.05em; }

  /* ── STAT CARDS ── */
  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 24px; }
  .stat-card {
    background: white; border: 1px solid #f5f5f4;
    border-radius: 16px; padding: 14px 16px;
  }
  .stat-val { font-size: 22px; font-weight: 600; color: #1c1917; line-height: 1; margin-bottom: 4px; }
  .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #a8a29e; }

  /* ── CHART ── */
  .chart-card {
    background: white; border: 1px solid #f5f5f4;
    border-radius: 20px; padding: 20px; margin-bottom: 20px;
  }
  .chart-title { font-size: 13px; font-weight: 600; color: #78716c; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.08em; }
  .chart-wrap { height: 180px; position: relative; }
  canvas { width: 100% !important; height: 100% !important; }

  /* ── ENTRY FORM ── */
  .entry-card {
    background: white; border: 1px solid #f5f5f4;
    border-radius: 20px; padding: 20px; margin-bottom: 20px;
  }
  .entry-card h3 { font-size: 14px; font-weight: 600; color: #1c1917; margin-bottom: 16px; }

  .form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
  .form-group { flex: 1; min-width: 0; }
  .form-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #78716c; margin-bottom: 5px; }
  .form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #e7e5e4; border-radius: 12px;
    font-size: 14px; font-family: 'Inter', sans-serif;
    color: #1c1917; background: white; outline: none;
    transition: border-color 0.15s;
  }
  .form-input:focus, .form-select:focus, .form-textarea:focus { border-color: <?php echo $accent; ?>; }
  .form-textarea { resize: vertical; min-height: 64px; }

  /* Mood selector */
  .mood-row { display: flex; gap: 10px; justify-content: center; margin: 8px 0 12px; }
  .mood-btn {
    font-size: 28px; background: transparent; border: 2px solid transparent;
    border-radius: 12px; padding: 8px 12px; cursor: pointer;
    transition: all 0.15s; line-height: 1;
  }
  .mood-btn:hover { background: #f5f5f4; }
  .mood-btn.selected { border-color: <?php echo $accent; ?>; background: <?php echo $light_bg; ?>; }

  /* Checklist items */
  .checklist-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .check-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 12px;
    border: 1.5px solid #e7e5e4; cursor: pointer;
    transition: all 0.15s; font-size: 14px; color: #1c1917;
    user-select: none;
  }
  .check-item:hover { border-color: <?php echo $accent; ?>; }
  .check-item.done { border-color: <?php echo $accent; ?>; background: <?php echo $light_bg; ?>; }
  .check-box {
    width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
    border: 2px solid #d6d3d1; display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: all 0.15s; background: white;
  }
  .check-item.done .check-box {
    background: <?php echo $accent; ?>;
    border-color: <?php echo $accent; ?>;
    color: white;
  }

  /* Timer input */
  .timer-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .timer-or { text-align: center; padding: 8px; color: #a8a29e; font-size: 13px; }

  .submit-btn {
    width: 100%; padding: 12px;
    background: <?php echo $accent; ?>;
    color: white; border: none; border-radius: 12px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: opacity 0.15s; font-family: 'Inter', sans-serif;
  }
  .submit-btn:hover { opacity: 0.9; }

  /* ── ENTRY HISTORY ── */
  .history-card {
    background: white; border: 1px solid #f5f5f4;
    border-radius: 20px; padding: 20px;
  }
  .history-card h3 { font-size: 14px; font-weight: 600; color: #1c1917; margin-bottom: 16px; }

  .entry-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid #f5f5f4;
    font-size: 14px;
  }
  .entry-row:last-child { border-bottom: none; }
  .entry-date { font-size: 12px; color: #a8a29e; width: 70px; flex-shrink: 0; }
  .entry-val { font-weight: 600; color: #1c1917; flex: 1; }
  .entry-note { font-size: 12px; color: #a8a29e; flex: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .entry-delete-btn {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid transparent; background: transparent;
    cursor: pointer; font-size: 13px; flex-shrink: 0; color: #d6d3d1;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; opacity: 0;
  }
  .entry-row:hover .entry-delete-btn { opacity: 1; }
  .entry-delete-btn:hover { background: #fee2e2; border-color: #fecaca; color: #dc2626; }

  .load-more-btn {
    width: 100%; padding: 10px;
    background: transparent; border: 1.5px solid #e7e5e4;
    border-radius: 12px; font-size: 13px; font-weight: 500;
    color: #78716c; cursor: pointer; margin-top: 12px;
    transition: background 0.15s;
  }
  .load-more-btn:hover { background: #fafaf9; }

  /* ── TOAST & GOAL PROGRESS ── */
  .goal-bar-wrap { margin-bottom: 20px; }
  .goal-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: #a8a29e; margin-bottom: 6px; }
  .goal-bar { height: 6px; background: #f5f5f4; border-radius: 3px; overflow: hidden; }
  .goal-fill { height: 100%; background: <?php echo $accent; ?>; border-radius: 3px; transition: width 0.4s; }

  .toast {
    position: fixed; bottom: 28px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1c1917; color: white;
    padding: 10px 20px; border-radius: 50px;
    font-size: 13px; font-weight: 500;
    opacity: 0; transition: all 0.3s;
    z-index: 99999; white-space: nowrap; pointer-events: none;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  @media (max-width: 600px) {
    .ts-container { padding: 60px 16px 100px; }
    .timer-inputs { grid-template-columns: 1fr; }
    .mood-btn { padding: 6px 8px; font-size: 24px; }
  }
