/* Tasks theme: light blue.
   Loaded after styles.css. Remove it with: sudo bash install-theme-blue.sh revert */

:root {
  color-scheme: light;
  /* new tokens */
  --lane: #E8EEF4; --sidebar: #FFFFFF; --line-strong: #C5D1DC;
  --accent: #63B7F3; --accent-hover: #4EA7EA; --accent-ink: #0A2540;
  --accent-text: #1566AB; --accent-tint: #E4F2FD; --accent-ring: rgba(99,183,243,.45);
  --dot: #4EA7EA; --float-shadow: 0 6px 18px rgba(15,32,48,.16);
  /* the original tokens, remapped so everything that already uses them recolors */
  --paper: #F3F6F9; --surface: #FFFFFF; --ink: #14202B; --inkmuted: #5B6B7B; --line: #DCE4EC;
  --pine: #1566AB; --pinedark: #0F4F88; --pinetint: #E4F2FD;
  /* line icons (used as masks so they take the text color) */
  --ic-note: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z%27%2F%3E%3Cpolyline%20points%3D%2714%202%2014%208%2020%208%27%2F%3E%3Cline%20x1%3D%2716%27%20y1%3D%2713%27%20x2%3D%278%27%20y2%3D%2713%27%2F%3E%3Cline%20x1%3D%2716%27%20y1%3D%2717%27%20x2%3D%278%27%20y2%3D%2717%27%2F%3E%3C%2Fsvg%3E");
  --ic-star: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolygon%20points%3D%2712%202%2015.09%208.26%2022%209.27%2017%2014.14%2018.18%2021.02%2012%2017.77%205.82%2021.02%207%2014.14%202%209.27%208.91%208.26%2012%202%27%2F%3E%3C%2Fsvg%3E");
  --ic-star-fill: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolygon%20fill%3D%27black%27%20points%3D%2712%202%2015.09%208.26%2022%209.27%2017%2014.14%2018.18%2021.02%2012%2017.77%205.82%2021.02%207%2014.14%202%209.27%208.91%208.26%2012%202%27%2F%3E%3C%2Fsvg%3E");
  --ic-clock: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%2710%27%2F%3E%3Cpolyline%20points%3D%2712%206%2012%2012%2016%2014%27%2F%3E%3C%2Fsvg%3E");
  --ic-trash: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%273%206%205%206%2021%206%27%2F%3E%3Cpath%20d%3D%27M19%206l-1%2014a2%202%200%200%201-2%202H8a2%202%200%200%201-2-2L5%206%27%2F%3E%3Cpath%20d%3D%27M10%2011v6%27%2F%3E%3Cpath%20d%3D%27M14%2011v6%27%2F%3E%3Cpath%20d%3D%27M9%206V4a1%201%200%200%201%201-1h4a1%201%200%200%201%201%201v2%27%2F%3E%3C%2Fsvg%3E");
  --ic-check: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%2720%206%209%2017%204%2012%27%2F%3E%3C%2Fsvg%3E");
  --ic-x: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.25%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cline%20x1%3D%2718%27%20y1%3D%276%27%20x2%3D%276%27%20y2%3D%2718%27%2F%3E%3Cline%20x1%3D%276%27%20y1%3D%276%27%20x2%3D%2718%27%20y2%3D%2718%27%2F%3E%3C%2Fsvg%3E");
  --ic-eye: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M1%2012s4-8%2011-8%2011%208%2011%208-4%208-11%208-11-8-11-8z%27%2F%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%273%27%2F%3E%3C%2Fsvg%3E");
  --ic-eye-off: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M17.94%2017.94A10.07%2010.07%200%200%201%2012%2020c-7%200-11-8-11-8a18.45%2018.45%200%200%201%205.06-5.94M9.9%204.24A9.12%209.12%200%200%201%2012%204c7%200%2011%208%2011%208a18.5%2018.5%200%200%201-2.16%203.19m-6.72-1.07a3%203%200%201%201-4.24-4.24%27%2F%3E%3Cline%20x1%3D%271%27%20y1%3D%271%27%20x2%3D%2723%27%20y2%3D%2723%27%2F%3E%3C%2Fsvg%3E");
  --ic-grip: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%270%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cg%20fill%3D%27black%27%20stroke%3D%27none%27%3E%3Ccircle%20cx%3D%279%27%20cy%3D%276%27%20r%3D%271.7%27%2F%3E%3Ccircle%20cx%3D%2715%27%20cy%3D%276%27%20r%3D%271.7%27%2F%3E%3Ccircle%20cx%3D%279%27%20cy%3D%2712%27%20r%3D%271.7%27%2F%3E%3Ccircle%20cx%3D%2715%27%20cy%3D%2712%27%20r%3D%271.7%27%2F%3E%3Ccircle%20cx%3D%279%27%20cy%3D%2718%27%20r%3D%271.7%27%2F%3E%3Ccircle%20cx%3D%2715%27%20cy%3D%2718%27%20r%3D%271.7%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --lane: #131D29; --sidebar: #121B26; --line-strong: #33475C;
  --accent: #6DBDF5; --accent-hover: #88CBF8; --accent-ink: #06243A;
  --accent-text: #7DC6F8; --accent-tint: rgba(109,189,245,.14); --accent-ring: rgba(109,189,245,.4);
  --dot: #6DBDF5; --float-shadow: 0 6px 18px rgba(0,0,0,.5);
  --paper: #0F1620; --surface: #192534; --ink: #E6EDF4; --inkmuted: #93A3B4; --line: #243445;
  --pine: #7DC6F8; --pinedark: #88CBF8; --pinetint: rgba(109,189,245,.14);
}

/* ---------- Base ---------- */
body { font-family: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif; line-height: 1.45; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-hover); }
input::placeholder, textarea::placeholder { color: var(--inkmuted); }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], textarea, select {
  border-color: var(--line-strong); border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-hover); box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---------- Sidebar ---------- */
.sidebar { background: var(--sidebar); }
.navbtn:hover, .themebtn:hover, .projrow:hover { background: var(--paper); }
.navbtn:hover { color: var(--ink); }
.navbtn.active { background: var(--accent-tint); color: var(--accent-text); font-weight: 600; }
.navlabel { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; opacity: 1; }
.projrow.active { background: var(--accent-tint); }
.projrow.active .projmain { color: var(--accent-text); font-weight: 600; }
.projeye:hover { background: var(--line); }
.steplink[data-share] { color: var(--inkmuted); font-weight: 500; }
.steplink[data-share]:hover { color: var(--accent-text); }
/* existing projects were saved with the old green; show them in the new blue */
.projdot[style*="1F5B4C" i] { background: var(--dot) !important; }

/* the "no project" lane has no dot; give it a quiet ring so every lane title lines up */
.kcolhead:not(:has(.projdot)):not(:has(.stlanename))::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.plusdot, .authcard button.primary, .submitbtn { background: var(--accent); color: var(--accent-ink); }
.plusdot:hover, .authcard button.primary:hover, .submitbtn:hover { background: var(--accent-hover); }
.authcard button.primary, .submitbtn { border-radius: 10px; font-weight: 600; }
.morebtn { border-color: var(--line-strong); border-radius: 10px; }
.morebtn:hover, .smallbtn:hover { border-color: var(--accent-hover); color: var(--accent-text); }
.smallbtn { border-color: var(--line-strong); }
.steplink { font-size: 12px; font-weight: 500; }

/* ---------- Lanes and cards ---------- */
.kcolumn { background: var(--lane); border-color: var(--line); border-radius: 14px; }
.kcolumn input.kcoladd { background: transparent; border-style: dashed; }
.kcolumn input.kcoladd:focus { background: var(--surface); border-style: solid; }
.taskrow:hover { border-color: var(--line-strong); }
.check { position: relative; border: 1.5px solid var(--line-strong); }
.check:hover { border-color: var(--accent-hover); background: var(--accent-tint); }
.check:hover::after {
  content: ""; position: absolute; inset: 3px; background: var(--accent-text); opacity: .75;
  -webkit-mask: var(--ic-check) center / contain no-repeat; mask: var(--ic-check) center / contain no-repeat;
}
.rightnow, .statcard.amber { background: var(--ambertint); border-color: rgba(232,163,61,.45); }
.rightnow { border-radius: 14px; }
/* starred tasks show a small amber star even when the actions are hidden */
.taskrow:has(.iconbtn.starred) .ttitle::after { content: "\2605"; margin-left: 6px; font-size: 12px; color: var(--amber); }

/* progress and step dots */
[style*="background:var(--pine)"] { background: var(--accent-hover) !important; }
.steptrail span[style*="rgba(31,91,76"] { background: var(--accent) !important; opacity: .55; }
.stepfullrow .dot { border-width: 1.5px; border-color: var(--line-strong); }
.stepfullrow .dot.done { background: var(--accent); border-color: var(--accent); }
.stepfullrow .dot.active { border-color: var(--accent-text); }
.stepfullrow .dot.active:hover { background: var(--accent-tint); }

/* ---------- Lists, tables, dialogs ---------- */
.histdate, .usertable th { text-transform: none; letter-spacing: 0; }
.histdate { font-size: 12px; }
.modal-overlay { background: rgba(10,24,38,.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal-card { border-radius: 16px; box-shadow: 0 24px 60px rgba(8,20,32,.3); }
.fieldblock { border-radius: 10px; }
/* the app's ".modal-card input { width: 100% }" also stretched checkboxes and radios, shoving their labels aside */
.modal-card input[type=checkbox], .modal-card input[type=radio],
.fieldblock input[type=checkbox], .fieldblock input[type=radio] { width: auto; margin: 0; flex-shrink: 0; }

/* ---------- Mouse devices only (the phone layout is left exactly as it is) ---------- */
@media (hover: hover) and (pointer: fine) {
  /* actions float above the card's top edge, so titles keep the full card width */
  .tcontent, .kcolumn .tcontent { padding-right: 0; }
  .tactions {
    top: -17px; right: 10px; z-index: 2; gap: 1px; padding: 1px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--float-shadow);
  }
  .tactions .iconbtn { width: 22px; height: 22px; font-size: 0; line-height: 0; color: var(--inkmuted); }
  .tactions .iconbtn::before {
    content: ""; display: block; width: 14px; height: 14px; background: currentColor;
    -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  }
  .tactions [data-edit-notes] { --ic: var(--ic-note); }
  .tactions [data-star] { --ic: var(--ic-star); }
  .tactions [data-star].starred { --ic: var(--ic-star-fill); color: var(--amber); }
  .tactions [data-snooze] { --ic: var(--ic-clock); }
  .tactions [data-delete-task] { --ic: var(--ic-trash); }
  .tactions .iconbtn:hover { background: var(--paper); color: var(--ink); }
  .tactions [data-star].starred:hover { color: var(--amber); }
  .tactions [data-delete-task]:hover { color: var(--danger); }
  /* drag grips become a fixed-size icon that sits over the dot / card edge instead of reserving width */
  .projrow, .kcolhead { position: relative; }
  .sidebar-draghandle, .colgriphandle, .taskrow .draghandle {
    position: absolute; top: 50%; transform: translateY(-50%); margin: 0; padding: 0;
    width: 14px; height: 14px; font-size: 0; line-height: 0; color: var(--inkmuted); z-index: 1;
  }
  .sidebar-draghandle::before, .colgriphandle::before, .taskrow .draghandle::before {
    content: ""; display: block; width: 100%; height: 100%; background: currentColor;
    -webkit-mask: var(--ic-grip) center / contain no-repeat; mask: var(--ic-grip) center / contain no-repeat;
  }
  .sidebar-draghandle { left: 6px; background: var(--paper); border-radius: 4px; }
  .projrow.active .sidebar-draghandle { background: var(--accent-tint); }
  .colgriphandle { left: 2px; background: var(--lane); }
  .taskrow .draghandle { left: 4px; top: 14px; transform: none; width: 12px; height: 12px; }
  .kcolumn .taskrow { padding-left: 18px; }

  /* sidebar eye: line icons instead of emoji */
  .projeye { --ic: var(--ic-eye); width: 28px; height: 28px; padding: 0; font-size: 0; line-height: 0; display: inline-flex; align-items: center; justify-content: center; }
  .projrow.hiddencat .projeye { --ic: var(--ic-eye-off); }
  .projeye::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }

  /* list-mode step rows: quiet line icons that appear on hover and overlay the row (no reserved width) */
  .stepfullrow { position: relative; }
  .stepfullrow [data-edit-step-notes], .stepfullrow [data-delete-step] {
    position: absolute; top: 50%; transform: translateY(-50%); margin: 0 !important; width: 20px; height: 20px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0; line-height: 0; text-decoration: none;
    background: var(--surface); border-radius: 5px; color: var(--inkmuted) !important; opacity: 0;
  }
  .stepfullrow [data-delete-step] { right: 0; --ic: var(--ic-x); }
  .stepfullrow [data-edit-step-notes] { right: 22px; --ic: var(--ic-note); }
  .stepfullrow [data-edit-step-notes]::before, .stepfullrow [data-delete-step]::before {
    content: ""; width: 13px; height: 13px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  }
  .stepfullrow:hover [data-edit-step-notes], .stepfullrow:hover [data-delete-step],
  .stepfullrow:focus-within [data-edit-step-notes], .stepfullrow:focus-within [data-delete-step] { opacity: 1; }
  .stepfullrow [data-edit-step-notes]:hover { color: var(--accent-text) !important; }
  .stepfullrow [data-delete-step]:hover { color: var(--danger) !important; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  /* pinned to the window, so a long task list can't push the bottom buttons (Add project, Import, Light mode,
     Sign out) off the page; if the project list itself gets long, the sidebar scrolls inside itself */
  .sidebar { width: 252px; position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
