/* nsl-paper.css — "Paper" theme (4th Theme Studio option).
   Additive: loads right after nsl-app.css and only ever applies under
   <html data-theme="paper"> (set by nsl-theme-settings.js), so Dark /
   Forest / Aurora are untouched.
   Part 1 sets the --t-* palette (everything variable-driven just
   follows). Part 2 is generated: every hardcoded white-tint / dark-card
   surface in nsl-app.css mapped to a paper equivalent. Part 3 is
   hand-written fixes (Focus view layers, clocks, modals, cafe). */

/* ── 1. PALETTE ─────────────────────────────────────────── */
html[data-theme="paper"] {
  color-scheme: light;
  --t-bg:#f3ecdc;
  --t-bg2:#ebe2cd;
  --t-surface:rgba(255,252,243,0.62);
  --t-surface-hover:rgba(255,252,243,0.92);
  --t-border:rgba(90,65,30,0.15);
  --t-border-strong:rgba(90,65,30,0.30);
  --t-accent:#94572b;
  --t-accent2:#b7773f;
  --t-text:#2c2418;
  --t-muted:rgba(44,36,24,0.62);
  --t-muted2:rgba(44,36,24,0.42);
  --ring-break:#3f8f64; --ring-long:#7a5cb0; --ring-sixty:#b9810f; --ring-deep:#6f55c4;
  --p-t1:rgba(90,65,30,0.045);
  --p-t2:rgba(90,65,30,0.075);
  --p-t3:rgba(90,65,30,0.11);
  --p-card:rgba(250,244,230,0.94);
  --p-scrim:rgba(90,65,30,0.30);
}
html[data-theme="paper"] select { color-scheme: light; }
html[data-theme="paper"] #view-hub {
  --rose:#b0566f; --teal:#2f8a96; --lavender:#7a68c0; --green:#3f8f64;
  --shadow-card:0 2px 14px rgba(90,65,30,0.12);
  --shadow-warm:0 8px 30px rgba(120,80,30,0.12);
}
/* faint dotted-journal texture (pure CSS, so it is CSP-safe) */
html[data-theme="paper"] body {
  background-image: radial-gradient(rgba(120,90,40,0.10) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ── 2. GENERATED SURFACE MAPPINGS ──────────────────────── */
/* ---- generated: hardcoded white/dark surfaces -> paper tints ---- */
html[data-theme="paper"] #view-hub .hm-cell,
html[data-theme="paper"] #view-hub .todo-input,
html[data-theme="paper"] #view-hub .todo-item,
html[data-theme="paper"] #view-hub .reminder-item,
html[data-theme="paper"] #view-hub .goal-adj,
html[data-theme="paper"] #view-hub .goal-status-badge.st-new,
html[data-theme="paper"] #view-hub .plan-limit-note,
html[data-theme="paper"] #view-hub .chip,
html[data-theme="paper"] #view-hub .habit-item,
html[data-theme="paper"] #view-hub .habit-card,
html[data-theme="paper"] #view-hub .mood-bar-dot,
html[data-theme="paper"] #view-hub .setting-item,
html[data-theme="paper"] #view-hub .modal-input,
html[data-theme="paper"] #view-hub .live-badge.idle,
html[data-theme="paper"] #view-hub .mobile-stat-pill,
html[data-theme="paper"] #view-hub .mobile-xp-row,
html[data-theme="paper"] #view-hub .mobile-session-pill,
html[data-theme="paper"] #view-hub .drawer-item,
html[data-theme="paper"] #cafe-playlists-card .cpl-row,
html[data-theme="paper"] #view-hub .ycal-cell,
html[data-theme="paper"] #view-cafe-setup .field-input,
html[data-theme="paper"] #view-cafe-setup .chip,
html[data-theme="paper"] #view-cafe-room .btn,
html[data-theme="paper"] #view-cafe-room .cafe-pub-stats-item,
html[data-theme="paper"] #view-cafe-room .cafe-pub-chat-form input,
html[data-theme="paper"] #view-cafe-room .cafe-summary-check,
html[data-theme="paper"] #view-cafe-room .field-input,
html[data-theme="paper"] #view-cafe-room .chip,
html[data-theme="paper"] #view-cafe-room .gk-checklist-remove,
html[data-theme="paper"] #view-cafe-room .cafe-lbn-btn:hover,
html[data-theme="paper"] .cafe-block-check-item,
html[data-theme="paper"] .cafe-block-action-btn,
html[data-theme="paper"] .cafe-jam-add-row input,
html[data-theme="paper"] .cafe-jam-queue-item,
html[data-theme="paper"] .cafe-jam-queue-item:hover{background:var(--p-t1)}
html[data-theme="paper"] #view-hub .xp-bar-track,
html[data-theme="paper"] #view-hub .goal-bar-track,
html[data-theme="paper"] #view-hub .goal-cat-badge,
html[data-theme="paper"] #view-cafe-room .cafe-pub-stats-toggle,
html[data-theme="paper"] #view-cafe-room .cafe-summary-toggle,
html[data-theme="paper"] #view-cafe-room .desk-progress-track,
html[data-theme="paper"] .cafe-block-progress-track,
html[data-theme="paper"] .bg-swatch,
html[data-theme="paper"] .bg-swatch-custom{background:var(--p-t2)}
html[data-theme="paper"] #view-cafe-setup .switch,
html[data-theme="paper"] #view-cafe-room .cafe-pub-stats-toggle:hover,
html[data-theme="paper"] #view-cafe-room .cafe-summary-toggle:hover,
html[data-theme="paper"] #view-cafe-room .desk-avatar,
html[data-theme="paper"] #view-cafe-room .cafe-lsc-elapsed-track{background:var(--p-t3)}
html[data-theme="paper"] #view-hub .timer-ring-bg{stroke:var(--p-t2)}
html[data-theme="paper"] #view-cafe-room .cafe-lsc-ring-bg{stroke:var(--p-t3)}
html[data-theme="paper"] #view-cafe-setup .btn,
html[data-theme="paper"] #view-cafe-setup .setup-card,
html[data-theme="paper"] #view-cafe-setup .active-rooms-card,
html[data-theme="paper"] #view-cafe-setup .join-code-card,
html[data-theme="paper"] #view-cafe-room .cafe-public-stats-card,
html[data-theme="paper"] #view-cafe-room .cafe-summary-card,
html[data-theme="paper"] #view-cafe-room .desk-task-tooltip,
html[data-theme="paper"] #view-cafe-room .modal-box,
html[data-theme="paper"] #view-cafe-room .gk-modal-footer,
html[data-theme="paper"] #view-cafe-room .cafe-seat-fallback,
html[data-theme="paper"] #view-cafe-room .cafe-seat-card,
html[data-theme="paper"] #view-cafe-room .cafe-seat-scene-overflow-note,
html[data-theme="paper"] #view-cafe-room .cafe-lounge-stats-card,
html[data-theme="paper"] #view-cafe-room .cafe-lounge-header-card,
html[data-theme="paper"] #view-cafe-room .cafe-lounge-bottom-nav,
html[data-theme="paper"] .cafe-float-card,
html[data-theme="paper"] #view-cafe-room .cafe-toast{background:var(--p-card)}
html[data-theme="paper"] #view-cafe-setup .active-room-join-btn:hover,
html[data-theme="paper"] #view-cafe-setup .join-code-row button:hover,
html[data-theme="paper"] #view-cafe-setup .btn-primary,
html[data-theme="paper"] #view-cafe-room .btn-primary,
html[data-theme="paper"] #view-cafe-room .cafe-pub-chat-send-btn,
html[data-theme="paper"] #view-cafe-room .desk-go-to-work-btn:hover,
html[data-theme="paper"] #view-cafe-room .cafe-lsc-jam-btn-main,
html[data-theme="paper"] #view-cafe-room .cafe-lsc-jam-btn-main:hover,
html[data-theme="paper"] .cafe-block-complete-btn,
html[data-theme="paper"] .cafe-block-action-btn.active:not(.cafe-block-break-btn),
html[data-theme="paper"] .cafe-block-break-btn.active{color:#fdf6e6}

/* ── 3. HAND-WRITTEN FIXES ──────────────────────────────── */

/* Focus view: backgrounds are NOT hidden any more — Paper offers its own
   light set (LIGHT_SKY_FOLDERS in nsl-main.js). Only the dark vignette goes,
   and the dark-only Scenery folder is hidden (Worlds show the LIGHT_WORLDS set). */
html[data-theme="paper"] #vignette { display: none !important; }
html[data-theme="paper"] #os-folder-sec,
html[data-theme="paper"] #os-grid-sec { display: none !important; }
html[data-theme="paper"] #deep-spotlight {
  background: radial-gradient(ellipse 500px 500px at 50% 50%, transparent 28%, rgba(243,236,220,0.97) 72%);
}
html[data-theme="paper"] body.deep-work-active { animation: none; background-color: var(--t-bg); }
html[data-theme="paper"] body.deep-mode { background-color: var(--t-bg); }
html[data-theme="paper"] .companion-sprite { filter: drop-shadow(0 6px 10px rgba(90,65,30,0.25)); }

/* Clocks */
html[data-theme="paper"] .flip-clock-box { box-shadow: 0 6px 20px rgba(90,65,30,0.14); }
html[data-theme="paper"] .flip-digit-face {
  background: linear-gradient(180deg,#fcf7e9,#efe5cd);
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 4px 10px rgba(90,65,30,0.18);
}
html[data-theme="paper"] .flip-digit::after { background: rgba(90,65,30,0.28); }
html[data-theme="paper"] .orbit-box {
  background: radial-gradient(120% 120% at 50% 0%, rgba(252,247,233,0.95) 0%, rgba(243,235,215,0.95) 55%, rgba(235,225,200,0.95) 100%);
  box-shadow: 0 12px 34px rgba(90,65,30,0.16), inset 0 1px 0 rgba(255,255,255,0.7);
}
html[data-theme="paper"] .orbit-bar-shape {
  border-color: rgba(70,50,25,0.75);
  animation-name: orbitBarSpinPaper;
}
@keyframes orbitBarSpinPaper {
  0%,100% { transform: translate(-50%,-50%) rotate(var(--rot,0deg)) translateY(-98px) rotateY(89deg); border-color: rgba(70,50,25,0.75); }
  50%     { transform: translate(-50%,-50%) rotate(var(--rot,0deg)) translateY(-98px) rotateY(0deg);  border-color: rgba(148,87,43,0.95); }
}

/* Overlays, drawers, tooltips, toasts */
html[data-theme="paper"] #view-hub .modal-overlay,
html[data-theme="paper"] #view-hub .more-drawer-backdrop,
html[data-theme="paper"] #env-drawer-backdrop,
html[data-theme="paper"] #leaderboard-drawer-backdrop,
html[data-theme="paper"] #view-cafe-room .modal-overlay { background: rgba(60,45,25,0.38); }
html[data-theme="paper"] #leaderboard-drawer,
html[data-theme="paper"] #env-hint-card,
html[data-theme="paper"] #env-hint-arrow,
html[data-theme="paper"] #view-hub .toast { background: #f8f1df; color: var(--t-text); }
html[data-theme="paper"] #view-hub .nav-btn .tooltip { background: #2c2418; color: #f6eddb; }
html[data-theme="paper"] #view-hub .modal { box-shadow: 0 18px 50px rgba(60,45,25,0.28); }

/* Cafe Room / Setup: dark scrims over photos become light paper */
html[data-theme="paper"] .rs-bg-scrim,
html[data-theme="paper"] .cafe-room-bg-scrim,
html[data-theme="paper"] .cafe-block-overlay::before {
  background: linear-gradient(180deg, rgba(243,236,220,0.70) 0%, rgba(243,236,220,0.35) 35%, rgba(243,236,220,0.75) 100%);
}
html[data-theme="paper"] #view-cafe-room::before,
html[data-theme="paper"] #view-cafe-room .cafe-seat-scene::before { background: none; }
html[data-theme="paper"] .cafe-block-overlay { background-color: var(--t-bg); }
html[data-theme="paper"] .cafe-float-card { background: rgba(250,244,230,0.82); }
html[data-theme="paper"] #view-cafe-room .desk-card { background: rgba(255,250,238,0.75); }
html[data-theme="paper"] #view-cafe-room .cafe-seat-fallback { border-color: rgba(90,65,30,0.30); color: var(--t-text); }


/* ── 4. BOLDER TEXT ─────────────────────────────────────── */
html[data-theme="paper"] body { font-weight: 500; }
html[data-theme="paper"] { --t-muted: rgba(44,36,24,0.74); --t-muted2: rgba(44,36,24,0.56); }
html[data-theme="paper"] [style*="font-weight:300"], html[data-theme="paper"] [style*="font-weight: 300"], html[data-theme="paper"] [style*="font-weight:400"], html[data-theme="paper"] [style*="font-weight: 400"] { font-weight: 500 !important; }
html[data-theme="paper"] html,
html[data-theme="paper"] body,
html[data-theme="paper"] .sbar-val,
html[data-theme="paper"] .flip-sep,
html[data-theme="paper"] #timer-display,
html[data-theme="paper"] #xp-flash,
html[data-theme="paper"] .duration-val,
html[data-theme="paper"] .duration-mode-val,
html[data-theme="paper"] .streak-mini-val,
html[data-theme="paper"] .music-url-row input,
html[data-theme="paper"] #view-hub .view-header h2,
html[data-theme="paper"] #view-hub .streak-big,
html[data-theme="paper"] #view-hub .stat-val,
html[data-theme="paper"] #view-hub .tsw-time,
html[data-theme="paper"] #view-hub .mobile-stat-pill-val,
html[data-theme="paper"] .brand-name,
html[data-theme="paper"] .field input,
html[data-theme="paper"] .login-btn-primary,
html[data-theme="paper"] .gate-title,
html[data-theme="paper"] #view-cafe-room .cafe-title .topic{font-weight:500}
html[data-theme="paper"] .flip-digit,
html[data-theme="paper"] .music-tab-btn,
html[data-theme="paper"] #view-hub .topbar-left h1,
html[data-theme="paper"] #view-hub .card-title,
html[data-theme="paper"] #view-hub .streak-num,
html[data-theme="paper"] #view-hub .streak-stat-val,
html[data-theme="paper"] #view-hub .xp-val,
html[data-theme="paper"] #view-hub .goal-pct,
html[data-theme="paper"] #view-hub .timer-btn,
html[data-theme="paper"] .lb-you,
html[data-theme="paper"] #view-hub .mobile-hero-greeting,
html[data-theme="paper"] #view-hub .mobile-xp-label-row span:last-child{font-weight:600}
html[data-theme="paper"] #view-hub .sidebar-avatar,
html[data-theme="paper"] #view-hub .focus-link-btn,
html[data-theme="paper"] #view-hub .priority-tag,
html[data-theme="paper"] #view-hub .btn-primary,
html[data-theme="paper"] .lb-drawer-head h3,
html[data-theme="paper"] .lb-avatar,
html[data-theme="paper"] .lb-name,
html[data-theme="paper"] .lb-badge,
html[data-theme="paper"] .lb-xp,
html[data-theme="paper"] .lb-footer-link,
html[data-theme="paper"] #view-hub .badge-slot-title,
html[data-theme="paper"] #view-hub .mobile-hero-avatar,
html[data-theme="paper"] #cafe-playlists-card .cpl-name,
html[data-theme="paper"] #view-hub .ycal-cell.today,
html[data-theme="paper"] #view-cafe-setup .btn,
html[data-theme="paper"] #view-cafe-setup .active-room-topic,
html[data-theme="paper"] #view-cafe-room .btn,
html[data-theme="paper"] #view-cafe-room .cafe-lbn-btn,
html[data-theme="paper"] .cafe-block-status-pill,
html[data-theme="paper"] .cafe-jam-now-playing .meta .title,
html[data-theme="paper"] .cafe-radio-title{font-weight:700}

/* ── 5. FOCUS: see-through cards instead of solid blocks ─── */
html[data-theme="paper"] .float-card,
html[data-theme="paper"] .float-card:hover {
  background: color-mix(in srgb, var(--t-bg) 16%, transparent);
  border-color: color-mix(in srgb, var(--t-accent) 18%, transparent);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  box-shadow: 0 4px 18px rgba(90,65,30,0.10);
}
html[data-theme="paper"] #bottom-panel { background: color-mix(in srgb, var(--t-bg) 14%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html[data-theme="paper"] .bp-col { border-right-color: color-mix(in srgb, var(--t-accent) 12%, transparent); }
html[data-theme="paper"] .flip-clock-box { background: color-mix(in srgb, var(--t-bg) 22%, transparent); box-shadow: none; }
html[data-theme="paper"] .flip-digit-face { background: linear-gradient(180deg, rgba(252,247,233,0.72), rgba(239,229,205,0.62)); }
html[data-theme="paper"] .orbit-box { background: color-mix(in srgb, var(--t-bg) 30%, transparent); box-shadow: none; }
html[data-theme="paper"] .float-card-head, html[data-theme="paper"] .bp-col-head { font-weight: 700; color: var(--t-muted); }

/* ── 6. FOCUS: black text on the world/background pills ─── */
html[data-theme="paper"] .world-ambient-suggest,
html[data-theme="paper"] .world-ambient-suggest:hover {
  color: #000; font-weight: 700;
  border-color: rgba(0,0,0,0.45);
  background: rgba(60,40,18,0.08);
}
html[data-theme="paper"] .world-ambient-suggest { transition: background-color .22s ease, border-color .22s ease; }
html[data-theme="paper"] .world-ambient-suggest:hover { background: rgba(60,40,18,0.20); border-color: #000; }

/* ── 7. WORKSPACE: darker, bolder button hover ─────────── */
/* No font-weight change on hover (that re-flows the label and makes the
   button jump in size). "Bolder" is faked with a hairline text-stroke, which
   adds no width, and everything eases in smoothly. */
html[data-theme="paper"] #view-hub :is(.pill-btn, .focus-link-btn, .goal-adj, .chip, .mood-btn, .timer-btn, .preset-btn, .tsw-go-btn, .tsw-dismiss-btn, .drawer-item, .btn-ghost, .todo-del, .btn-primary, .nav-btn) {
  transition: background-color .22s ease, border-color .22s ease, color .22s ease, box-shadow .22s ease, -webkit-text-stroke-color .22s ease, transform .22s ease;
  -webkit-text-stroke: 0.35px transparent;
}
html[data-theme="paper"] #view-hub :is(.pill-btn, .focus-link-btn, .goal-adj, .chip, .mood-btn, .timer-btn, .preset-btn, .tsw-go-btn, .tsw-dismiss-btn, .drawer-item, .btn-ghost, .todo-del):hover {
  background: #45311d;
  border-color: #45311d;
  color: #fdf6e6;
  -webkit-text-stroke-color: #fdf6e6;
  box-shadow: 0 3px 10px rgba(60,40,18,0.28);
}
html[data-theme="paper"] #view-hub .nav-btn:hover { background: #45311d; color: #fdf6e6; }
html[data-theme="paper"] #view-hub .btn-primary:hover { background: #5e3414; color: #fff8ea; -webkit-text-stroke-color: #fff8ea; filter: none; }

/* ── 8. UI HINTS / POPUPS: readable on paper ───────────── */
html[data-theme="paper"] #env-hint-card,
html[data-theme="paper"] #env-hint-arrow { background: #f8f1df !important; border-color: rgba(90,65,30,0.35) !important; }
html[data-theme="paper"] #env-hint-card { box-shadow: 0 10px 30px rgba(60,40,18,0.22) !important; }
html[data-theme="paper"] .env-hint-text { color: #2c2418; font-weight: 600; }
html[data-theme="paper"] #env-hint-dismiss { color: #2c2418; border-color: rgba(60,40,18,0.45); font-weight: 600; }
html[data-theme="paper"] #env-hint-dismiss:hover { background: #45311d; border-color: #45311d; color: #fdf6e6; }
html[data-theme="paper"] #quote-popup-card,
html[data-theme="paper"] #settings-hint-card { background: #f8f1df !important; color: #2c2418 !important; border-color: rgba(90,65,30,0.35) !important; box-shadow: 0 12px 36px rgba(60,40,18,0.24) !important; }
html[data-theme="paper"] #quote-popup-card div,
html[data-theme="paper"] #settings-hint-card div { color: #2c2418; }
html[data-theme="paper"] #quote-popup-author { color: rgba(44,36,24,0.7) !important; }
html[data-theme="paper"] #quote-popup-dismiss { color: #2c2418 !important; border-color: rgba(60,40,18,0.45) !important; font-weight: 600; }
html[data-theme="paper"] #quote-popup-dismiss:hover { background: #45311d; color: #fdf6e6 !important; }
html[data-theme="paper"] #quote-popup-pin { background: #5e3414 !important; color: #fdf6e6 !important; font-weight: 600; }

/* ── 9. LOGIN PAGE: light version ──────────────────────── */
html[data-theme="paper"] #login-vignette { background: radial-gradient(ellipse 85% 75% at 50% 50%, transparent 30%, rgba(120,90,45,0.20) 100%); }
html[data-theme="paper"] .login-card,
html[data-theme="paper"] #device-blocked {
  background: rgba(255,252,243,0.80);
  border-color: rgba(90,65,30,0.25);
  box-shadow: 0 24px 64px rgba(90,65,30,0.20), 0 0 0 1px rgba(255,255,255,0.6) inset;
}
html[data-theme="paper"] .login-btn-primary { background: #5e3414; border-color: #5e3414; color: #fdf6e6; font-weight: 600; }
html[data-theme="paper"] .login-btn-primary:hover { background: #45311d; border-color: #45311d; box-shadow: 0 8px 22px rgba(60,40,18,0.30); }
html[data-theme="paper"] .btn-test-link { color: #2f5b8a; background: rgba(60,110,170,0.10); border-color: rgba(60,110,170,0.45); }
html[data-theme="paper"] .login-footer { color: var(--t-muted); }
html[data-theme="paper"] .login-footer span { color: var(--t-accent); }

/* ── 10. CALENDAR: today's date reads dark on paper ────── */
html[data-theme="paper"] #view-hub .ycal-cell.today {
  background: color-mix(in srgb, var(--t-accent) 20%, #fbf5e6);
  border-color: var(--t-accent);
  color: #17110a;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(90,65,30,0.20);
}