/* ============================================================
   styles.css — visual design for the Focus app

   Inspiration: Opal — calm, rewarding, modern.
   All colours are defined as CSS variables at the top so you
   can retheme the whole app by changing just a few values.
============================================================ */


/* ------------------------------------------------------------
   1. RESET
   Wipe default browser padding/margins so we start clean.
------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ------------------------------------------------------------
   2. DESIGN TOKENS
   Think of these as named swatches for the whole app.
------------------------------------------------------------ */
:root {
  --bg:        #F3F0EA;   /* Warm off-white page background     */
  --surface:   #FFFFFF;   /* White card / panel background      */

  --green:     #4A7C6B;   /* Sage-green — the main accent       */
  --green-dk:  #365A4D;   /* Darker green for hover states      */
  --green-lt:  #E6F0EC;   /* Very light green tint              */

  --text:      #1C2220;   /* Near-black body text               */
  --muted:     #7A8C85;   /* Softer grey for secondary labels   */

  --gold:      #D4A843;   /* Warm gold for streak & celebration */

  --warn:      #D97B3A;   /* Orange — first give-up click       */
  --danger:    #C0614A;   /* Red — second give-up click         */

  --border:    #E3DED5;
  --shadow:    0 2px 16px rgba(0, 0, 0, 0.07);
  --radius:    18px;
  --radius-sm: 12px;
}


/* ------------------------------------------------------------
   3. BASE LAYOUT
   Body is a flex container that horizontally centres the
   content. On wide screens this keeps the app phone-shaped.
------------------------------------------------------------ */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* Each "page" is a .screen — only one is visible at a time */
.screen {
  width: 100%;
  max-width: 460px;
  padding: 0 16px 72px;
}

/* JavaScript uses this class to hide/show elements */
.hidden {
  display: none !important;
}

/* ------------------------------------------------------------
   SCREEN TRANSITIONS
   When a screen is revealed, showScreen() adds .screen-entering.
   The keyframe fades in while nudging up 10px — enough to feel
   alive, not enough to feel like motion. 240ms ease-out keeps it
   snappy. transform + opacity are GPU-composited so no layout
   work happens during the animation.
   The reduced-motion media query skips all motion for users who
   prefer it (accessibility setting in OS/browser).
------------------------------------------------------------ */
@keyframes screen-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-entering {
  animation: screen-enter 240ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Skip the animation entirely for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .screen-entering {
    animation: none;
  }
}


/* ------------------------------------------------------------
   4. HOME HEADER
   Logo placeholder + tagline at the top of the home screen.
   The TBD box is intentionally placeholder-styled — dashed
   border signals "logo goes here" without looking broken.
------------------------------------------------------------ */
.home-header {
  text-align: center;
  padding: 36px 0 28px;
}

/* The placeholder box — dashed outline, muted label, clear intent */
.logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px dashed var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

.home-tagline {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.5;
}

/* Personalised goal message — sits between the header and the profile card.
   Slightly warmer than the generic tagline so it feels like a direct note to the user. */
.goal-message {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--green-dk);
  margin: -8px 0 18px;
  line-height: 1.55;
  padding: 0 16px;
}


/* ------------------------------------------------------------
   5. CARDS
   White rounded panels used throughout the home screen.
------------------------------------------------------------ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ------------------------------------------------------------
   STREAK DISPLAY — flame icon + number + label in profile card
------------------------------------------------------------ */

/* Outer wrapper: pushed to far right of the profile flex row */
.streak-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Thin vertical separator between the pencil button and the streak */
.streak-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* Inner row: icon + number + word, all sharing one color */
.streak-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted); /* icon inherits via currentColor, text inherits directly */
}

/* The flame SVG — sized to match the number's cap-height */
.streak-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.streak-num {
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.streak-word {
  font-size: 11px;
  font-weight: 400;
}


/* ------------------------------------------------------------
   6. DURATION BUTTONS
   The three side-by-side buttons for picking session length.
------------------------------------------------------------ */
.duration-buttons {
  display: flex;
  gap: 10px;
}

.dur-btn {
  flex: 1;
  padding: 15px 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dur-btn:hover,
.dur-btn:focus-visible {
  border-color: var(--green);
  background: var(--green-lt);
  color: var(--green-dk);
  outline: none;
}


/* ------------------------------------------------------------
   6b. MODE PICKER
   Two side-by-side options above the duration buttons:
   "Distractions" (limited sites only) and "Everything" (whole browser).
   Active option gets the green border and tint, matching dur-btn hover style.
------------------------------------------------------------ */
.mode-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 11px 13px;
  font-family: inherit;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.mode-btn:hover { border-color: var(--green); }
.mode-btn--active {
  border-color: var(--green);
  background: var(--green-lt);
}
.mode-btn-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.mode-btn--active .mode-btn-title { color: var(--green-dk); }
.mode-btn-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 3px;
}


/* ------------------------------------------------------------
   7. CUSTOM DURATION INPUT
   Appears below the buttons when "Custom" is clicked.
------------------------------------------------------------ */
.custom-area {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.custom-input {
  flex: 1;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.custom-input:focus {
  border-color: var(--green);
}

/* app.js adds this class briefly to flag invalid input */
.custom-input.error {
  border-color: var(--danger);
}

.custom-start-btn {
  padding: 13px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.custom-start-btn:hover {
  background: var(--green-dk);
}


/* ------------------------------------------------------------
   9. FOCUS SCREEN
   Fills the viewport and centres everything vertically.
------------------------------------------------------------ */
#focus-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;            /* override .screen's padding */
}

.focus-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 40px 24px;
}

.focus-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* "Distractions are blocked until 2:35 PM" banner */
.focus-status-msg {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green-dk);
  background: var(--green-lt);
  border-radius: 20px;
  padding: 5px 14px;
  margin: 0 0 18px;
  /* Empty by default — the element collapses when JS hasn't set text yet */
  min-height: 0;
}

/* --- SVG progress ring ----------------------------------- */
.ring-container {
  position: relative;
  width: 240px;
  height: 240px;
  margin-bottom: 36px;
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Faint grey background circle */
.ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

/*
  Animated green arc.

  How the SVG ring trick works:
    stroke-dasharray sets the total length of the dashes.
    We set it to exactly the circle's circumference (2 × π × 96 ≈ 603).
    stroke-dashoffset shifts where the dash starts.
      offset = 0   → full green ring  (session just started)
      offset = 603 → empty ring       (time is up)
    JavaScript increases the offset every second to "eat" the ring.

  rotate(-90deg) makes the arc start at the 12-o'clock position
  instead of the default 3-o'clock.
*/
.ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 603.19;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1s linear;
}

/* Timer digits sit in the exact centre of the ring */
.timer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text);
  /* tabular-nums stops digits from shifting sideways as they change */
  font-variant-numeric: tabular-nums;
}

/* --- Encouragement copy --------------------------------- */
.encouragement {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  max-width: 260px;
  margin-bottom: 52px;
}

/* --- Give-up button ------------------------------------- */
.give-up-btn {
  padding: 12px 32px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.give-up-btn:hover {
  border-color: var(--muted);
  color: var(--text);
}

/* First click — orange "are you sure?" state */
.give-up-btn.warn {
  border-color: var(--warn);
  color: var(--warn);
  background: #FFF5EE;
}

/* Cooldown state — button is disabled, looks inert so the user knows it's locked */
.give-up-btn.cooldown,
.give-up-btn.cooldown:hover {
  border-color: var(--border);
  color: var(--border);
  background: transparent;
  cursor: default;
  pointer-events: none;
}

/* Explanation shown after the user requests an early end.
   Sits between the encouragement line and the give-up button. */
.focus-cooldown-msg {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--green-lt);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  margin: 0 0 16px;
  text-align: center;
  line-height: 1.5;
  max-width: 300px;
}


/* --- Focus kill switch ---------------------------------- */
/* A small emergency-exit section below the end-session button.
   1 use per week; instantly ends the focus session. */
.focus-ks-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 300px;
}
.focus-ks-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 5px;
}
.focus-ks-status {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0 0 12px;
  text-align: center;
  line-height: 1.45;
}
.focus-ks-btn {
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--warn);
  background: transparent;
  border: 1.5px solid var(--warn);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}
.focus-ks-btn:hover:not(:disabled) { background: #FFF5EE; }
.focus-ks-btn:disabled {
  color: var(--muted);
  border-color: var(--border);
  cursor: default;
  opacity: 0.75;
}


/* ------------------------------------------------------------
   10. CELEBRATION OVERLAY
   Fixed overlay that covers the screen when time runs out.
   Tap anywhere to dismiss early.
------------------------------------------------------------ */
.celebration {
  position: fixed;
  inset: 0;
  background: rgba(243, 240, 234, 0.90);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  cursor: pointer;
  animation: fade-in 0.35s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* The white card that pops up inside the overlay */
.celebration-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 44px 32px;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.13);
  max-width: 320px;
  width: 90%;
  pointer-events: none;   /* Clicks pass through to the overlay */
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* The ✓ icon that spins in */
.check-icon {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 14px;
  display: block;
  animation: spin-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes spin-in {
  from { transform: scale(0) rotate(-120deg); }
  to   { transform: scale(1) rotate(0deg);   }
}

.celebration-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.celebration-body {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.celebration-streak {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}


/* ------------------------------------------------------------
   11. RESPONSIVE TWEAKS
   On very small phones, scale down a little so nothing clips.
------------------------------------------------------------ */
@media (max-width: 380px) {
  .streak-number   { font-size: 4.5rem; }
  .timer           { font-size: 2.8rem; }
  .ring-container  { width: 200px; height: 200px; }
}


/* ------------------------------------------------------------
   12. DISTRACTION SUMMARY CARD (on home screen)
   A small row showing the count and a "Manage →" pill button.
------------------------------------------------------------ */
.distraction-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.distraction-count {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Pill-shaped "Manage →" button — muted green, not loud */
.manage-btn {
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-lt);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;   /* stops the label from wrapping on small screens */
  transition: background 0.15s;
}

.manage-btn:hover {
  background: #d0e8df;
}


/* ------------------------------------------------------------
   13. DISTRACTIONS SCREEN — nav and header
------------------------------------------------------------ */
.dist-nav {
  padding: 20px 0 4px;
}

/* "← Back" looks like a text link, not a button */
.back-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

.back-btn:hover {
  color: var(--green-dk);
}

.dist-header {
  padding: 14px 0 22px;
}

.dist-heading {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.2;
}

.dist-subtext {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}



/* ------------------------------------------------------------
   14. DISTRACTION TOGGLE LIST
   Each row: emoji on the left, name in the middle,
   a circle toggle on the right.
------------------------------------------------------------ */
.distractions-list {
  list-style: none;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  /* overflow:hidden clips the rows to the card's rounded corners */
  overflow: hidden;
}

/*
  Each row is now a two-part column:
    1. .dist-row-main  — the clickable toggle area (emoji + name + circle)
    2. .dist-budget-picker — the time-limit buttons, only visible when selected

  We keep the outer <li> as a flex column so the two parts stack vertically.
*/
.distraction-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

.distraction-row:last-child {
  border-bottom: none;
}

/* The top part: tapping this toggles the selection */
.dist-row-main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}

.dist-row-main:hover {
  background: #f7f4ef;
}

/* When selected, the top part turns green-tinted */
.distraction-row.selected .dist-row-main {
  background: var(--green-lt);
}

.distraction-row.selected .dist-row-main:hover {
  background: #d8ece4;
}

/* Icon column on the left — now holds an inline SVG */
.dist-emoji {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The SVG icon itself — currentColor picks up the 'color' property */
.dist-emoji svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex-shrink: 0;
  display: block;
}

/* Simple Icons CDN images (e.g. TikTok) — match the Lucide SVG sizing exactly */
.dist-emoji img {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

/* When the row is selected, tint the icon green too */
.distraction-row.selected .dist-emoji svg {
  color: var(--green);
}

/* The app name — takes up all available space */
.dist-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

/*
  The circle on the right of each row.

  Unselected → empty grey ring (just a border, no fill).
  Selected   → solid green circle with a white checkmark.

  The checkmark is drawn using CSS only — no image or icon font.
  We use a ::after pseudo-element (a fake extra element that exists
  only in CSS) and draw two sides of a rotated rectangle to make
  a tick shape.
*/
.dist-toggle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;         /* needed so ::after can be positioned inside */
  transition: all 0.15s ease;
}

/* Fill the circle green when the row is selected */
.distraction-row.selected .dist-toggle {
  background: var(--green);
  border-color: var(--green);
}

/* Draw the white checkmark with a rotated L-shape.
   We anchor to the circle's center with left/top 50%,
   then translate back so the shape is visually centred. */
.distraction-row.selected .dist-toggle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 10px;
  border: 2.5px solid white;
  border-top: none;
  border-left: none;
  transform: translate(-50%, -60%) rotate(45deg);
}

/* Small trash icon on the right of each distraction row.
   Unobtrusive at rest; turns red on hover as a clear warning. */
.dist-delete-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, opacity 0.15s;
  opacity: 0.5;
  margin-left: -6px; /* close the gap between the checkmark and this button */
}
.dist-delete-btn:hover {
  color: var(--danger);
  opacity: 1;
}
.dist-delete-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}


/* ------------------------------------------------------------
   15. DONE BUTTON
   Full-width green button at the bottom of the distractions screen.
------------------------------------------------------------ */
.done-btn {
  display: block;
  width: 100%;
  padding: 17px;
  margin-top: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.done-btn:hover {
  background: var(--green-dk);
}


/* ------------------------------------------------------------
   16. TIME BUDGET PICKER
   Appears below each selected distraction row.
   Lets the user choose how long per day they allow that app.
------------------------------------------------------------ */

/* The container sits directly below .dist-row-main */
.dist-budget-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 18px 14px;
  /* Slightly deeper green tint to visually distinguish it from the main row */
  background: #d8ece4;
  border-top: 1px solid #c0dccf;
}

/* Small pill buttons: 30 min, 1 hr, 2 hrs, Custom */
.budget-btn {
  padding: 6px 13px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-dk);
  background: white;
  border: 1.5px solid #bdd9cc;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s;
}

.budget-btn:hover {
  border-color: var(--green);
}

/* The currently chosen budget option — filled solid green */
.budget-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* The custom-minutes input — appears when "Custom" is tapped */
.budget-custom-area {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.budget-custom-input {
  width: 110px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: white;
  border: 1.5px solid #bdd9cc;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.budget-custom-input:focus {
  border-color: var(--green);
}

/* Small helper label next to the custom input ("min/day") */
.budget-custom-label {
  font-size: 0.8rem;
  color: var(--green-dk);
  font-weight: 500;
}


/* ------------------------------------------------------------
   16b. BUDGET INPUT — number field + minutes/hours dropdown
   Shows: [  30  ] [ minutes ▾ ] per day
------------------------------------------------------------ */
.budget-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The number input — compact, no browser spin arrows */
.budget-num-input {
  width: 72px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: white;
  border: 1.5px solid #bdd9cc;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield; /* Firefox: hide spin buttons */
}
/* Chrome/Safari: hide spin buttons */
.budget-num-input::-webkit-outer-spin-button,
.budget-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.budget-num-input:focus {
  border-color: var(--green);
}

/* The unit dropdown — styled to match the number input.
   appearance:none removes the OS-default look; we draw our own arrow via SVG. */
.budget-unit-select {
  padding: 7px 26px 7px 10px; /* right padding leaves room for the arrow */
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dk);
  background-color: white;
  /* Small downward-pointing triangle arrow, coloured to match --green-dk */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23365A4D'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 9px 5px;
  border: 1.5px solid #bdd9cc;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.budget-unit-select:hover,
.budget-unit-select:focus {
  border-color: var(--green);
}

/* "per day" label to the right of the dropdown */
.budget-per-day {
  font-size: 0.82rem;
  color: var(--green-dk);
  font-weight: 500;
  white-space: nowrap;
}


/* ------------------------------------------------------------
   17. HOME SCREEN BUDGET SUMMARY
   The condensed budget line under the app count.
   e.g. "YouTube: 1 hr/day · Instagram: 30 min/day"
------------------------------------------------------------ */
.budget-summary {
  font-size: 0.82rem;
  color: var(--green-dk);
  font-weight: 500;
  margin-top: 5px;
  line-height: 1.5;
}

/* "Blocking not set up" status text in the Device card */
.setup-status {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}


/* ------------------------------------------------------------
   18. SETUP / BLOCKING SCREEN
   Numbered instruction steps for installing the extension.
------------------------------------------------------------ */

/* Card that wraps all the steps — tighter padding than a default card */
.setup-steps-card {
  padding: 4px 24px;
}

.setup-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

/* Remove the divider after the last step */
.setup-step--last {
  border-bottom: none;
}

/* Numbered green circle on the left of each step */
.step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;    /* prevent shrinking on narrow phones */
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-text {
  flex: 1;
}

.step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* "Coming soon" note that fades in below the extension button */
.coming-soon {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
  font-style: italic;
}


/* ------------------------------------------------------------
   19. DOWNTIME SCREEN
   Scheduled blocking windows (e.g. "Sleep — 10 PM to 7 AM").
------------------------------------------------------------ */

/* "X downtime windows set" summary text on the home screen */
.downtime-status {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* Card-style list of existing windows */
.downtime-list {
  list-style: none;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}

/* Empty-state message when no windows exist */
.downtime-empty {
  padding: 22px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Each individual window row */
.downtime-window-row {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.downtime-window-row:last-child {
  border-bottom: none;
}

/* Top row of a window: name on the left, × button on the right */
.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.window-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Small × delete button — muted until hovered */
.window-delete-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s;
}

.window-delete-btn:hover {
  color: var(--danger);
}

/* Second row of a window: "10:00 PM – 7:00 AM  ·  Every day" */
.window-detail {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Add window section ─────────────────────────────────── */

/* Dashed green button that opens the form */
.add-window-btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-lt);
  border: 2px dashed var(--green);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.add-window-btn:hover {
  background: #d0e8df;
}

/* The form container — stacks all fields vertically with spacing */
.add-window-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* A single labelled field (label above, input below) */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Uppercase small label used above each input */
.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

/* Two form-fields side by side (used for From/To times) */
.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-field {
  flex: 1; /* each side takes equal width */
}

/* Text input for the window name */
.form-text-input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.form-text-input:focus {
  border-color: var(--green);
}

/* app.js briefly adds .error when the name is blank */
.form-text-input.error {
  border-color: var(--danger);
}

/* Time picker inputs (native browser time wheel) */
.time-input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.time-input:focus {
  border-color: var(--green);
}

/* "Every day", "Weekdays", "Weekends" pill buttons */
.day-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.day-quick-btn {
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-dk);
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s;
}

.day-quick-btn:hover {
  border-color: var(--green);
  background: var(--green-lt);
}

/* Row of 7 individual day circles: S M T W T F S */
.day-picker-row {
  display: flex;
  gap: 6px;
}

/* Each circle — unselected state */
.day-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.12s;
  padding: 0;
}

.day-btn:hover {
  border-color: var(--green);
  background: var(--green-lt);
}

/* Selected day circle — filled green */
.day-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* Brief orange flash on the day row when no days selected on save */
.day-picker-row.error-flash .day-btn:not(.active) {
  border-color: var(--warn);
}

/* Save and cancel row at the bottom of the form */
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

/* Cancel button — subtle outline, no fill */
.cancel-btn {
  padding: 13px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.cancel-btn:hover {
  border-color: var(--muted);
  color: var(--text);
}


/* ==========================================================
   20. DISTRACTIONS LIST — LOADING & ERROR STATES
   Shown inside #distractions-list while Supabase is fetching,
   or if the fetch fails.
   ========================================================== */

/* Save / error toast notification
   Floats above all screens, fades in when .show is added, fades out when removed.
   We intentionally avoid the app's .hidden class (display:none) here
   because opacity + pointer-events gives us a smooth CSS transition. */
.save-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;    /* hidden toasts shouldn't eat clicks */
  transition: opacity 0.25s;
  z-index: 200;            /* above screens and overlay */
}
.save-toast.show  { opacity: 1; }
.save-toast.error { background: var(--danger); }

/* "Loading your sites…" placeholder */
.dist-loading {
  list-style: none;
  padding: 32px 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Friendly error message when the fetch fails */
.dist-fetch-error {
  list-style: none;
  padding: 32px 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--danger);
}

/* ── Pending loosening change note ─────────────────────────────
   Sits between the toggle row and the budget picker.
   Shown when a loosening change (raise limit / turn off / delete)
   is scheduled but the cooldown hasn't elapsed yet.
──────────────────────────────────────────────────────────────── */
.dist-pending-note {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--green-lt);
  padding: 6px 18px 8px;
  line-height: 1.5;
  border-top: 1px solid #c0dccf;
}

/* The ticking countdown inside the note — bold green, tabular digits */
.dist-pending-countdown {
  font-weight: 700;
  color: var(--green-dk);
  font-variant-numeric: tabular-nums;
}

/* Lock a row that has a pending change so it can't be clicked again */
.distraction-row.has-pending .dist-row-main {
  pointer-events: none;
  opacity: 0.65;
}
.distraction-row.has-pending .dist-delete-btn {
  pointer-events: none;
  opacity: 0.3;
}


/* ==========================================================
   21. HOME SCREEN — goal message + top bar
   ========================================================== */

/* Personalized encouraging line shown under the streak number */
.goal-message {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 6px;
  font-style: italic;
  letter-spacing: 0.01em;
}

.home-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 0 8px;
}

.logout-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--text); }


/* ==========================================================
   21b. PROFILE CARD
   Avatar, display name, email, and an inline edit panel.
   ========================================================== */

/* View row: [avatar]  [name / email]  [pencil]
   The whole row is a click target that opens the analytics screen. */
.profile-view {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  margin: -6px;   /* expand the hit area slightly without shifting layout */
  padding: 6px;
}
.profile-view:hover { background: var(--bg); }

/* Uploaded avatar photo */
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;          /* never squish/stretch the photo */
  border: 2px solid var(--border);
  display: block;
  flex-shrink: 0;
}

/* Fallback: a coloured circle showing the user's first initial */
.profile-avatar-initial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg);           /* cream — matches the page background */
  border: 2px solid var(--border); /* subtle ring, same as the photo avatar */
  color: var(--green);             /* the SVG stroke inherits this */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}
/* Size the person silhouette SVG inside the circle */
.profile-avatar-initial svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* Text column — takes remaining space, truncates if too long */
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-display-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Italic muted style when no name has been set yet */
.profile-display-name.no-name {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}
.profile-email {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Small pencil icon button in the top-right corner */
.profile-edit-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.profile-edit-btn:hover { color: var(--text); background: var(--bg); }
.profile-edit-btn svg   { width: 16px; height: 16px; display: block; }

/* Edit panel — separated by a hairline from the view row */
.profile-edit-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Each labelled field (name input, photo upload) */
.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Row that holds the "Choose photo" button + the selected filename */
.profile-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* The upload label looks like a secondary button */
.profile-upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-dk);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
  user-select: none;
}
.profile-upload-btn:hover { border-color: var(--green); }

/* Selected filename displayed next to the button */
.profile-file-name {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Save + Cancel row */
.profile-edit-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
/* Let the Save button grow to fill the row */
.profile-edit-actions .auth-submit-btn { flex: 1; }


/* ==========================================================
   21c. ANALYTICS SCREEN
   7-day bar chart + summary stats.
   ========================================================== */

/* Screen heading */
.analytics-header {
  padding: 8px 0 18px;
}
.analytics-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.analytics-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* Two side-by-side summary boxes: total time + daily average */
.analytics-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.analytics-stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.analytics-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--green-dk);
  line-height: 1;
  margin-bottom: 6px;
}
.analytics-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Status text shown while loading or on error */
.analytics-status {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  padding: 28px 0 12px;
  margin: 0;
}
.analytics-error { color: var(--danger); }

/* ── Bar chart ─────────────────────────────────────────────
   .chart-bars   — fixed-height flex row, bars grow from the bottom
   .chart-col    — one column per day
   .chart-value  — the label above each bar ("1h 20m")
   .chart-bar    — the actual coloured bar
   .chart-days   — row of day-name labels below the bars
   .chart-day-label — "Mon", "Tue", etc.
────────────────────────────────────────────────────────── */
.chart-bars {
  height: 130px;
  display: flex;
  align-items: flex-end; /* bars all share the same baseline */
  gap: 6px;
}

/* One column per day — stacks value-label then bar from the bottom */
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* push contents to the bottom */
  height: 100%;
}

/* Value label that sits just above the bar */
.chart-value {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
  text-align: center;
  line-height: 1.2;
  min-height: 12px; /* keeps alignment even when zero */
}

/* Bar container — flex column so segments stack; overflow:hidden clips to rounded corners */
.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Stacked segments: distracting (orange) on top, productive (green) on bottom.
   flex value is set inline proportional to minutes, so segments fill the bar correctly. */
.chart-bar-segment--productive  { background: var(--green); }
.chart-bar-segment--distracting { background: var(--warn);  }

/* Today: subtly darken the productive segment to match the existing today accent */
.chart-bar--today .chart-bar-segment--productive { background: var(--green-dk); }

/* A day with zero usage — empty container with a tiny neutral stub */
.chart-bar--zero {
  background: var(--border);
  height: 3px !important;
  border-radius: 2px;
}

/* Row of day-name labels directly below the bars */
.chart-days {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.chart-day-label {
  flex: 1;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Highlight the current day's label */
.chart-day-label--today {
  color: var(--green-dk);
}

/* ── Bar chart hover tooltip ───────────────────────────────
   Single shared element, moved by JS on mousemove.
   position:fixed so it's never clipped by overflow:hidden parents. */
.chart-tooltip {
  position: fixed;
  z-index: 9000;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  padding: 10px 13px;
  pointer-events: none; /* don't trigger mouseleave on the bar */
  min-width: 170px;
}

.ct-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  line-height: 1;
}
.ct-row + .ct-row { margin-top: 8px; }

/* Colored square matching the segment color */
.ct-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.ct-dot--prod { background: var(--green); }
.ct-dot--dist { background: var(--warn);  }

.ct-label {
  flex: 1;
  color: var(--muted);
  font-weight: 500;
}
.ct-value {
  color: var(--text);
  font-weight: 700;
}
.ct-pct {
  color: var(--muted);
  font-size: 11px;
  min-width: 30px;
  text-align: right;
}


/* ── Top sites this week ───────────────────────────────────
   A ranked list below the bar chart. Each site gets a name,
   a formatted time, and a horizontal fill bar.
────────────────────────────────────────────────────────── */

/* Extra top padding so the heading doesn't feel cramped */
.top-sites-card {
  margin-top: 12px;
}

.top-sites-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 14px;
}

/* One site per row */
.top-site-row {
  margin-bottom: 14px;
}
/* Remove bottom margin on the last row so the card padding does the work */
.top-site-row:last-child {
  margin-bottom: 0;
}

/* Site name + time on one line */
.top-site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.top-site-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  /* Clip very long domain names instead of wrapping */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-site-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-dk);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Full-width track behind the fill bar */
.top-site-bar-track {
  width: 100%;
  height: 6px;
  background: var(--green-lt);
  border-radius: 3px;
  overflow: hidden;
}

/* The green fill — width set inline by JS as a percentage */
.top-site-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  min-width: 4px; /* always visible even for tiny values */
}

/* Friendly message when the user has no data yet */
.top-sites-empty {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  padding: 12px 0 4px;
  line-height: 1.5;
}

/* ── Category-colored bars ─────────────────────────────── */
/* Productive sites: green (same palette as the rest of the app) */
.top-site-bar-fill--productive  { background: var(--green); }
.top-site-bar-track--productive { background: var(--green-lt); }

/* Distracting sites: warm orange */
.top-site-bar-fill--distracting  { background: var(--warn); }
.top-site-bar-track--distracting { background: #fde8d5; }

/* ── Clickable rows ────────────────────────────────────── */
.top-site-row--clickable { cursor: pointer; }

/* ── Category tip pill ─────────────────────────────────── */
/* Hidden until hover; slides in gently */
.top-site-tip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;  /* don't block clicks on the row */
}
.top-site-row--clickable:hover .top-site-tip { opacity: 1; }

.top-site-tip--productive  { color: var(--green-dk); background: var(--green-lt); }
.top-site-tip--distracting { color: #8a3a22;         background: #fde8d5; }

/* ── Productive / Distracting summary line ─────────────── */
.top-sites-summary {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 4px;
  line-height: 1.5;
}

/* Small italic hint below the summary */
.top-sites-hint {
  font-size: 0.7rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 14px;
  opacity: 0.75;
}


/* ── Time-of-day insight card ───────────────────────────── */
.peak-card { padding: 14px 18px; }
.peak-text {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}


/* ==========================================================
   22. AUTH SCREEN — Login and Sign-up forms
   ========================================================== */

/* Full-height centred wrapper — the single card sits in the middle */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
  gap: 28px;
}

/* App name + tagline above the form card */
.auth-logo-area {
  text-align: center;
}
.auth-app-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--green);
}
.auth-tagline {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 4px;
}

/* White card that holds the form */
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

/* Text inputs inside the auth form */
.auth-input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.auth-input:focus {
  border-color: var(--green);
}

/* --- Password show/hide toggle -------------------------------- */

/* Wrapper makes it possible to position the button inside the field */
.pw-wrap {
  position: relative;
}

/* Give the input extra right-side room so typed text never slides
   under the eye button */
.pw-wrap .auth-input {
  padding-right: 44px;
}

/* The eye button sits flush at the right edge, vertically centred */
.pw-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s;
  line-height: 0; /* removes any extra height from inline-block default */
}

.pw-toggle:hover {
  color: var(--text);
}

/* Both SVG icons share this size */
.pw-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* The slashed-eye icon hides by default — password starts hidden,
   so we show the plain-eye icon first (click = "reveal") */
.pw-icon--hide {
  display: none;
}

/* ── OTP verification card ───────────────────────────────────────────────── */

/* "We sent a verification code to your@email.com" */
.otp-sent-to {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin: -4px 0 0;
}
.otp-sent-to strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;  /* long email addresses don't overflow the card */
}

/* Code entry field — same height and weight as the other auth inputs.
   No letter-spacing on the placeholder so it reads cleanly.
   Once the user starts typing, subtle spacing separates the digits. */
.otp-input {
  text-align: center;
}
/* :not(:placeholder-shown) means "the field has content" — CSS detects this
   without any JS. Only then do we space the digits out slightly. */
.otp-input:not(:placeholder-shown) {
  letter-spacing: 0.22em;
  padding-left: 0.22em; /* balance: letter-spacing adds a gap after the last digit too */
}

/* Row holding the resend button */
.otp-actions {
  display: flex;
  justify-content: center;
  font-size: 0.875rem;
}

/* While counting down, the button is disabled — show it as plain muted text,
   not a clickable link, so the user knows it's not interactive yet. */
.otp-actions .auth-link-btn:disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
  font-weight: 500;
}

/* Red error / blue info message underneath inputs */
.auth-error {
  font-size: 0.875rem;
  color: var(--danger);
  margin: -4px 0 0;
  line-height: 1.4;
}
/* .auth-info turns the error slot blue for "check your email" messages */
.auth-info {
  color: #2563EB;
}

/* Primary action button (Log in / Create account) */
.auth-submit-btn {
  width: 100%;
  padding: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 2px;
}
.auth-submit-btn:hover:not(:disabled) { background: var(--green-dk); }
.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* "No account? Sign up free" link-style text below the button */
.auth-switch {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* Inline text-style button for toggling between the two forms */
.auth-link-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-link-btn:hover { color: var(--green-dk); }


/* ==========================================================
   23. ONBOARDING SURVEY
   ========================================================== */

/* Outer wrapper — scrollable if content is tall */
.ob-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Progress bar area */
.ob-progress-area {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ob-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ob-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.35s ease;
  width: 25%; /* starts at step 1 of 4 */
}
.ob-progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Each step container */
.ob-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Big question heading */
.ob-heading {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}

/* Smaller explanatory text */
.ob-subtext {
  font-size: 0.9rem;
  color: var(--muted);
  margin: -8px 0 0;
  line-height: 1.5;
}

/* Step 1: pill buttons arranged in a 3-column grid */
.ob-apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Each app pill button */
.ob-app-btn {
  padding: 10px 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.ob-app-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.ob-app-btn.active {
  background: var(--green-lt);
  border-color: var(--green);
  color: var(--green);
}

/* Steps 2-4: vertical list of option cards */
.ob-option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob-option-btn {
  width: 100%;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.ob-option-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.ob-option-btn.active {
  background: var(--green-lt);
  border-color: var(--green);
  color: var(--green);
}

/* Small italic note shown below the option buttons — used for extra context */
.ob-note {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 14px 0 0;
  padding: 10px 14px;
  background: var(--green-lt);
  border-radius: var(--radius-sm);
}
.ob-note em {
  font-style: normal;
  font-weight: 700;
  color: var(--green-dk);
}

/* Navigation row at the bottom */
.ob-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

/* Primary "Next →" / "Finish →" button */
.ob-next-btn {
  width: 100%;
  padding: 15px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.ob-next-btn:hover { background: var(--green-dk); }

/* "Skip for now" text link */
.ob-skip-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ob-skip-btn:hover { color: var(--text); }

/* Name input on onboarding step 7 — matches the rest of the app's text fields */
.ob-name-input {
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  box-sizing: border-box;
  margin-top: 18px;
  transition: border-color 0.15s;
}
.ob-name-input:focus {
  border-color: var(--green);
}

.ob-incognito-steps {
  margin-top: 20px;
}
.ob-incognito-list {
  padding-left: 22px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-incognito-list li {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}
.ob-open-ext-btn {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  background: transparent;
  border: 1.5px solid var(--green);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ob-open-ext-btn:hover {
  background: var(--green);
  color: #fff;
}


/* ============================================================
   KILL SWITCH CARD
   Emergency unlock — lives in the analytics / profile screen.
   Uses warm warning tones (--warn) to signal "use sparingly."
   ============================================================ */

.ks-card {
  margin-top: 12px;
  border: 1.5px solid #f0d5bc;
  background: #fdf7f1;
}

.ks-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ks-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warn);
}

.ks-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--warn);
  background: #fde8d5;
  border-radius: 20px;
  padding: 2px 8px;
  letter-spacing: 0.03em;
}

.ks-status {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 14px;
}

.ks-time-left {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.ks-reset-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.ks-active-notice {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--warn);
  margin: 0 0 4px;
}

.ks-countdown-line {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.ks-countdown {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--warn);
}

.ks-btn {
  width: 100%;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--warn);
  background: transparent;
  border: 2px solid var(--warn);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}
.ks-btn:hover:not(:disabled) {
  background: var(--warn);
  color: #fff;
}
.ks-btn:disabled {
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
  cursor: default;
}

/* ── Incognito-access gate — full-screen overlay ─────────── */
/* Solid warm-cream background covers everything behind it.   */
/* Non-dismissible — the user must enable incognito access.   */

#incognito-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.igo-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  text-align: center;
}

/* SVG lock icon — inherits var(--green) via color */
.igo-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--green);
}

.igo-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 14px;
}

.igo-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 24px;
}

.igo-steps {
  text-align: left;
  list-style: decimal;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 24px;
}

.igo-steps li + li {
  margin-top: 12px;
}

/* Key action words inside steps are accented in sage green */
.igo-steps strong {
  color: var(--green);
  font-weight: 600;
}

.igo-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}
