/* style.css: all styling for the planner. Sections: tokens, layout, controls, plan and tasks, forms, themes, responsive. */
@import url('fonts/fonts.css');

:root {
  --paper: #f5f7fb;
  --card: #fbfcfe;
  --ink: #0b1424;
  --muted: #475571;
  --line: #dce3ee;
  --accent: #1d4fd8;
  --accent-ink: #fff;
  --accent-soft: #e9effd;
  --band: #0a1731;
  --band-strip: #0f2040;
  --band-ink: #eef3fb;
  --band-dim: #a3b3cf;
  --band-accent: #86b4ff;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;
  --s6: 96px;
}
* {
  box-sizing: border-box;
}
:root {
  color-scheme: light;
  --accent-hover: #1843b5;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0b1424;
  --card: #111e33;
  --ink: #eef3fb;
  --muted: #a3b3cf;
  --line: #2b3b55;
  --accent: #86b4ff;
  --accent-ink: #0b1424;
  --accent-soft: #182c4b;
  --accent-hover: #a9caff;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 24px;
}
.theme-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--band-dim);
}
.theme-control select {
  width: auto;
  min-height: 48px;
  background: var(--band-strip);
  color: var(--band-ink);
  border-color: var(--band-dim);
  font-size: 14px;
  padding: 10px;
}
.masthead select:focus-visible {
  outline-color: var(--band-accent);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    17px/1.65 Figtree,
    Arial,
    sans-serif;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
.masthead {
  background: var(--band);
  color: var(--band-ink);
}
header {
  max-width: 1136px;
  margin: auto;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.brand {
  font:
    700 28px/1.2 'Bricolage Grotesque',
    Arial,
    sans-serif;
  letter-spacing: -0.03em;
  color: var(--band-ink);
  text-decoration: none;
}
.brand-dot {
  color: var(--band-accent);
  font: inherit;
}
.brand span {
  font:
    400 14px/1.4 Figtree,
    Arial,
    sans-serif;
  letter-spacing: 0;
  color: var(--band-dim);
  margin-left: 12px;
}
.demo,
.eyebrow {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
}
.demo {
  color: var(--band-dim);
  text-align: right;
}
.intro {
  max-width: 1136px;
  margin: auto;
  padding: 64px 28px;
}
.intro .eyebrow {
  color: var(--band-accent);
  margin: 0 0 24px;
}
.intro > p:last-child {
  font-size: 19px;
  line-height: 1.65;
  color: var(--band-dim);
  max-width: 62ch;
  margin: 24px 0 0;
}
h1,
h2,
h3 {
  font-family: 'Bricolage Grotesque', Arial, sans-serif;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 800;
  margin: 0;
  max-width: 20ch;
}
h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 24px;
}
h3 {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
  margin: 0 0 8px;
}
main {
  max-width: 1136px;
  margin: auto;
  padding: 0 28px 40px;
}
nav {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
button {
  font:
    600 15px/1.4 Figtree,
    Arial,
    sans-serif;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: 3px;
  min-height: 48px;
  color: var(--ink);
}
button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 20px 0;
  min-height: 64px;
  color: var(--muted);
}
nav button.active {
  border-color: var(--accent);
  color: var(--accent);
}
nav button:hover {
  color: var(--accent);
}
:where(button, input, select, textarea, a):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.masthead a:focus-visible {
  outline-color: var(--band-accent);
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  align-self: end;
}
.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}
.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
  padding: 0 0 32px;
}
.stat strong {
  font:
    700 40px/1.15 'Bricolage Grotesque',
    Arial,
    sans-serif;
  letter-spacing: -0.03em;
  display: block;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 14px;
  color: var(--muted);
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  gap: 64px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title h2 {
  margin: 0;
}
.section-title + p {
  margin-top: 0;
}
.muted {
  color: var(--muted);
  line-height: 1.65;
}
.slot {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.slot:first-child {
  border-top: 1px solid var(--line);
}
.slot time {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.slot p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 15px;
}
.slot.fixed {
  padding: 16px 0;
}
.slot.fixed h3 {
  color: var(--muted);
  font-weight: 600;
}
.slot label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.slot input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}
.priority {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}
.priority p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  margin: 8px 0 0;
}
small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  display: block;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 24px 0 40px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}
input,
select,
textarea {
  font:
    400 16px/1.5 Figtree,
    Arial,
    sans-serif;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  width: 100%;
  min-width: 0;
  min-height: 48px;
}
textarea {
  padding: 16px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type='checkbox'] {
  accent-color: var(--accent);
}
.task-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 90px auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}
.task-row input[type='checkbox'] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
}
.task-row p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}
.task-row.done h3 {
  color: var(--muted);
}
/* Clone the line on each wrapped fragment of the title. */
.task-row.done .task-title {
  background: linear-gradient(currentColor, currentColor) left 55% / 100% 1.5px no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.task-row label {
  font-size: 12px;
  color: var(--muted);
}
.task-row label input {
  padding: 8px;
  margin-top: 8px;
}
#notice:not(:empty) {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px 24px;
  margin-bottom: 32px;
  line-height: 1.65;
}
.view > section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 40px;
  margin-bottom: 40px;
}
.view > p {
  max-width: 70ch;
}
#google-client-id {
  margin-top: 8px;
}
#google-status,
#bulk-status,
#estimate-status {
  font-size: 15px;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 860px) {
  .columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand span {
    display: none;
  }
  aside {
    border-top: 1px solid var(--line);
    padding-top: 32px;
  }
  .intro {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}
@media (max-width: 520px) {
  header {
    padding: 20px;
    gap: 16px;
  }
  .brand {
    font-size: 26px;
  }
  .demo {
    font-size: 10px;
    max-width: 120px;
  }
  .header-tools {
    gap: 12px;
  }
  .header-tools .demo {
    display: none;
  }
  .intro {
    padding: 40px 20px;
  }
  .intro > p:last-child {
    font-size: 17px;
  }
  .intro .eyebrow {
    font-size: 10px;
    margin-bottom: 24px;
  }
  main {
    padding: 0 20px 32px;
  }
  nav {
    gap: 24px;
    margin-bottom: 32px;
  }
  nav button {
    font-size: 14px;
    min-height: 60px;
    padding: 18px 0;
  }
  .summary {
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
  }
  .stat strong {
    font-size: 28px;
  }
  .stat:last-child strong {
    font-size: 22px;
    white-space: nowrap;
  }
  .stat span {
    font-size: 12px;
    line-height: 1.4;
    display: block;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .slot {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 12px;
  }
  .slot time {
    font-size: 12px;
  }
  h2 {
    font-size: 25px;
  }
  h3 {
    font-size: 19px;
  }
  .section-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .section-title button {
    padding: 10px 14px;
  }
  .task-row {
    grid-template-columns: 24px minmax(0, 1fr) 76px;
    gap: 12px;
  }
  .task-row button {
    grid-column: 2/4;
    justify-self: start;
  }
  #notice:not(:empty) {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 21px;
  }
  .theme-control {
    gap: 6px;
  }
  .header-tools {
    flex-shrink: 0;
  }
}
.policy {
  max-width: 70ch;
  padding-top: var(--s4);
}
.policy h2 {
  margin-top: var(--s4);
}
.policy h2:first-child {
  margin-top: 0;
}
.policy li {
  margin-bottom: var(--s1);
}
footer a {
  white-space: nowrap;
}

/* ---- Credit line: "Made with a small heart by Built by Vir" ---- */
.credit {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.credit .heart {
  width: 13px;
  height: 13px;
  margin: 0 2px;
  vertical-align: -2px;
  fill: #e5484d;
}
.credit a {
  font-weight: 600;
}
@keyframes heartbeat {
  0%,
  60%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.22);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.14);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .credit .heart {
    animation: heartbeat 2.4s ease-in-out infinite;
    transform-origin: center;
  }
}

/* ---- Reordering the plan (Today screen) ---- */
.title-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#order-panel {
  margin-bottom: 20px;
}
.order-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.order-row.dragging {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0.95;
}
.order-info {
  min-width: 0;
}
.order-info strong,
.order-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-info span {
  font-size: 13px;
  color: var(--muted);
}
.drag-handle {
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  cursor: grab;
  touch-action: none;
  border: 0;
  background: transparent;
}
.drag-handle svg {
  width: 22px;
  height: 22px;
  fill: var(--muted);
}
.order-arrows {
  display: flex;
  gap: 6px;
}
.order-arrows button {
  min-height: 40px;
  min-width: 40px;
  padding: 0;
}

/* ---- Moving blocks on the timeline, and adding breaks ---- */
.slot-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.slot-remove {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}
.slot.dragging {
  position: relative;
  z-index: 2;
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
}
.slot.block h3 {
  color: var(--accent);
}
#block-panel {
  margin-bottom: 20px;
}
#block-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--accent);
}

/* ---- Feedback form ---- */
#feedback {
  margin-top: 40px;
}
.form-grid .wide {
  grid-column: 1 / -1;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The original holds its place while the floating card follows the finger. */
.drag-placeholder {
  visibility: hidden;
}
.drag-preview {
  box-sizing: border-box;
}

/* ---- Plans and referrals (Account) ---- */
.plan-cards {
  display: grid;
  gap: var(--s2);
  margin-top: var(--s2);
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--s2);
  background: var(--card);
}
.plan-card h4 {
  margin: 0 0 4px;
  font-size: 18px;
}
.plan-card h4 span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.ref-link {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--s2) 0 8px;
}
.ref-link input {
  flex: 1 1 220px;
  min-width: 0;
}
.ref-link button {
  flex: 0 0 auto;
}
@media (max-width: 520px) {
  .ref-link button {
    flex: 1 1 100%;
  }
}

/* ---- Motion (all of it off when the visitor asks for reduced motion) ---- */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}
.confetti-layer i {
  position: absolute;
  display: block;
  border-radius: 2px;
  will-change: transform, opacity;
}
@keyframes web-view-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes slot-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes landed {
  0% {
    transform: scale(1.04);
    background: var(--accent-soft);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  }
  100% {
    transform: none;
    box-shadow: none;
  }
}
@keyframes task-strike {
  from {
    background-size: 0% 1.5px;
  }
  to {
    background-size: 100% 1.5px;
  }
}
@keyframes check-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.45);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes done-flash {
  0% {
    background: var(--accent-soft);
  }
  100% {
    background: transparent;
  }
}
@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes shine {
  to {
    transform: translateX(260%) skewX(-20deg);
  }
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.app-mode) .view:not([hidden]) {
    animation: web-view-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  html:not(.app-mode) #timeline.stagger .slot {
    animation: slot-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 50ms);
  }
  .slot.landed {
    animation: landed 0.7s cubic-bezier(0.3, 1.5, 0.5, 1);
  }
  .task-row.just-done {
    animation: done-flash 1.6s ease-out;
  }
  .task-row.just-done .task-title {
    animation: task-strike 1s ease-in-out both;
  }
  .task-row.just-done input[type='checkbox'] {
    animation: check-pop 1s cubic-bezier(0.3, 1.7, 0.5, 1);
  }
  #block-panel:not([hidden]),
  #order-panel:not([hidden]) {
    animation: drop-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .priority,
  .task-row {
    transition:
      transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
      box-shadow 0.25s ease;
  }
  @media (hover: hover) {
    .priority:hover,
    .task-row:hover {
      transform: translateY(-2px);
    }
  }
  button:not(:disabled):active {
    transform: scale(0.96);
  }
  button {
    transition:
      transform 0.15s cubic-bezier(0.3, 1.4, 0.5, 1),
      background-color 0.2s ease,
      border-color 0.2s ease;
  }
  .primary {
    position: relative;
    overflow: hidden;
  }
  .primary::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
  }
  @media (hover: hover) {
    .primary:hover::after {
      animation: shine 0.8s ease;
    }
  }
}

/* ---- Feedback button (bottom-left) and its sheet ---- */
.fb-fab {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(10, 23, 49, 0.18);
}
.fb-fab svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.fb-open .fb-fab {
  visibility: hidden;
}
.fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  background: rgba(5, 12, 28, 0);
  transition: background 0.25s ease;
}
.fb-overlay.show {
  background: rgba(5, 12, 28, 0.5);
}
.fb-sheet {
  width: min(420px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transform: translateY(24px);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    opacity 0.2s ease;
}
.fb-overlay.show .fb-sheet {
  transform: none;
  opacity: 1;
}
.fb-grab {
  display: none;
}
.fb-sheet h2 {
  margin: 0 0 12px;
  font-size: 22px;
}
.fb-kinds {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--accent-soft);
  margin-bottom: 12px;
}
.fb-kinds button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.fb-kinds button.on {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.16);
}
.fb-hint {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
}
#fb-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}
.fb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.fb-actions {
  display: flex;
  gap: 8px;
}
.fb-actions button {
  flex: 1;
  min-height: 44px;
}
.fb-status {
  margin: 12px 0 0;
  min-height: 1.4em;
  font-size: 14px;
}
@media (max-width: 520px) {
  .fb-overlay {
    padding: 0;
  }
  .fb-sheet {
    width: 100%;
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .fb-grab {
    display: block;
    width: 38px;
    height: 5px;
    margin: -8px auto 14px;
    border-radius: 3px;
    background: var(--line);
  }
}
@media print {
  .fb-fab,
  .fb-overlay {
    display: none;
  }
}

/* The button slips out of the way while you scroll down, and returns when you scroll up. */
.fb-fab {
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s ease;
}
.fb-fab.fb-away {
  transform: translateY(90px);
  opacity: 0;
  pointer-events: none;
}
