/* GROWING IN CHRIST (grow/grow.js): the window, in the shared frame (nav/ui.css). Begin: the goals as cards to choose, the
   time a day, and Build my path. The path: today's step big, what's coming as rows put in order by dragging, what's done
   folded; Add steps beside it on a wide screen, over it on a phone. A kind of step known by its icon's color. */
.gr { position: fixed; inset: 0; z-index: 2147483000; background: var(--bg); color: var(--ink); overflow: hidden; opacity: 0; transition: opacity 0.18s ease; }
.gr[hidden] { display: none; }
.gr.open { opacity: 1; }
.gr-box { position: absolute; inset: 0; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }
.gr .ui-head { padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 8px calc(14px + env(safe-area-inset-left)); }
.gr-top { flex: none; border-bottom: 1px solid var(--rule); background: var(--bg); }
.gr-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.gr-col { max-width: 640px; margin: 0 auto; padding: 20px calc(16px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
.gr-h { margin: 6px 0 10px; font: italic 600 clamp(26px, 6.6vw, 32px)/1.15 Georgia, "Times New Roman", serif; }
.gr-lede { margin: 0 0 18px; font: 17.5px/1.55 Georgia, "Times New Roman", serif; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); }
.gr-sec { display: block; margin: 24px 0 10px; }
.gr-warn { margin: 16px 0 0; font: 14px/1.45 var(--sans); color: var(--muted); }
.gr-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.gr-acts .ui-btn, .gr-tacts .ui-btn { min-height: 46px; padding: 0 22px; font-size: 15.5px; }
/* (the other way to begin, as plain to see as Build my path, an equal choice, without being a second gold button: outlined
   in gold. From the owner: "make the button 'I'll build it myself' stand out more") */
.gr .ui-btn.gr-self { display: inline-flex; align-items: center; gap: 7px; border: 2px solid var(--gold); background: var(--bg-raised); color: color-mix(in srgb, var(--gold) 78%, var(--ink)); font-weight: 800; }
.gr .ui-btn.gr-self svg { width: 18px; height: 18px; stroke-width: 2.4; }
.gr .ui-btn.gr-self:not(:disabled):hover { background: color-mix(in srgb, var(--gold) 10%, var(--bg-raised)); }

/* begin: the goals */
.gr-goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gr-goal { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--rule); border-radius: 14px; background: var(--bg-raised); color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.gr-goal i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--rule); border-radius: 7px; color: transparent; }
.gr-goal i svg { width: 14px; height: 14px; stroke-width: 3; }
.gr-goal.is-on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--bg-raised)); }
.gr-goal.is-on i { border-color: var(--gold); background: var(--gold); color: #fff; }
.gr-goal span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gr-goal b { font: 600 16px/1.25 Georgia, "Times New Roman", serif; }
.gr-goal small { font: 12.5px/1.35 var(--sans); color: var(--muted); }
@media (max-width: 400px) { .gr-goals { grid-template-columns: 1fr; } }

/* the path */
.gr-bar { height: 6px; margin: 8px 0 16px; border-radius: 6px; background: var(--rule); overflow: hidden; }
.gr-bar i { display: block; height: 100%; border-radius: 6px; background: var(--door-live, #3E7A4C); transition: width 0.3s ease; }
.gr-today { padding: 20px; border: 1px solid var(--rule); border-top: 4px solid var(--gold); border-radius: 18px; background: var(--bg-raised); }
.gr-tk { font: 800 11px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.gr-today h2 { margin: 6px 0 6px; font: italic 600 25px/1.2 Georgia, "Times New Roman", serif; }
.gr-today p { margin: 0 0 16px; font: 16.5px/1.5 Georgia, "Times New Roman", serif; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); }
.gr-tacts { display: flex; flex-wrap: wrap; gap: 10px; }
.gr-how { display: block; margin-top: 12px; font: 13px var(--sans); color: var(--muted); }
.gr-plist { margin-top: 0; }
.gr-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 6px 11px 4px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.gr-row > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gr-row b { overflow: hidden; font: 700 14.5px/1.25 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.gr-row small { font: 12.5px var(--sans); color: var(--muted); }
.gr-plist .rbx-in, .gr-done .rbx-in { gap: 4px; padding-left: 4px; }
.gr .rbx-in > .ui-grip:first-child + * { flex: 1; }
.gr-tick { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-right: 6px; padding: 0; border: 2px solid var(--rule); border-radius: 50%; background: none; color: transparent; cursor: pointer; }
.gr-tick svg { width: 15px; height: 15px; stroke-width: 3; }
.gr-tick.is-on { border-color: var(--door-live, #3E7A4C); background: var(--door-live, #3E7A4C); color: #fff; }
.gr-done { margin-top: 18px; }
.gr-done li .gr-row b { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.gr-libbtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 18px; min-height: 46px; }
.gr-libbtn svg { width: 18px; height: 18px; }
/* a kind of step, by its icon's color */
.gr .ui-row-ic.gr-k-read, .gr .ui-row-ic.gr-k-study { --c: var(--door-bible, #A6773A); }
.gr .ui-row-ic.gr-k-card { --c: var(--door-study, #46596B); }
.gr .ui-row-ic.gr-k-mem, .gr .ui-row-ic.gr-k-plan { --c: #8A6A2E; }
.gr .ui-row-ic.gr-k-pray, .gr .ui-row-ic.gr-k-dev, .gr .ui-row-ic.gr-k-life { --c: var(--door-live, #3E7A4C); }
.gr .ui-row-ic.gr-k-hear { --c: var(--door-people, #6C4A73); }

/* add steps: the goals, and every step not on the path */
.gr-mygoals { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; align-items: center; }
.gr-gtag { padding: 5px 10px; border-radius: 8px; background: color-mix(in srgb, var(--gold) 12%, var(--bg-raised)); font: 800 10.5px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--gold) 80%, var(--ink)); }
.gr-lgrp { margin-top: 10px; }
.gr-lgrp summary small { margin-left: 4px; color: var(--muted); font-weight: 600; }
.gr-lrow { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.gr-lrow > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gr-lrow b { font: 700 14px/1.3 var(--sans); }
.gr-lrow small { font: 12px var(--sans); color: var(--muted); }
.gr-lrow.is-lifted { opacity: 0.35; }
.gr-add { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--bg); color: var(--gold); cursor: pointer; }
.gr-add svg { width: 17px; height: 17px; }
.gr-add:hover { border-color: var(--gold); }
.gr-ghost { position: fixed; z-index: 2147483600; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--gold); border-radius: 12px; background: var(--bg-raised); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22); pointer-events: none; transform: rotate(-1deg); font-family: var(--sans); }
.gr-ghost > span { display: flex; flex-direction: column; } .gr-ghost b { font-size: 14px; } .gr-ghost small { font-size: 12px; color: var(--muted); } .gr-ghost .gr-add { display: none; }
/* (where it will go, as it's dragged over the path: a gold line above that step, or under the last) */
.gr .gr-drop { box-shadow: inset 0 3px 0 var(--gold); }
.gr .gr-drop.is-after { box-shadow: inset 0 -3px 0 var(--gold); }
.gr-today.gr-drop.is-after { box-shadow: 0 3px 0 var(--gold); }
/* its toast, at the foot of the window */
.gr-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 2147483400; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; }
.gr-toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.gr-toast button { flex: none; padding: 0; border: 0; background: none; color: var(--gold); font: 800 14px var(--sans); cursor: pointer; }
/* on a phone, Add steps over the path */
.gr-side.is-sheet { position: fixed; inset: auto 0 0 0; z-index: 3; max-height: 82%; overflow-y: auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); border-radius: 20px 20px 0 0; background: var(--bg); box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.18); }
.gr-shead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; background: var(--bg); }
.gr-shead b { font: italic 600 22px Georgia, "Times New Roman", serif; }
.gr.is-lib .gr-box::after { content: ''; position: fixed; inset: 0; z-index: 2; background: rgba(0, 0, 0, 0.25); }

/* a wide screen: the path and the steps to add side by side, the goals three across. From the owner: "Desktop versions
   should always take advantage of the screen size in a way that complements the content" */
@media (min-width: 900px) {
  .gr-box { max-width: 1160px; }
  .gr-col { max-width: 1080px; padding-top: 28px; }
  .gr-begin { max-width: 900px; }
  .gr-begin .gr-h, .gr-begin .gr-lede, .gr-begin > .ui-label { text-align: center; display: block; }
  .gr-goals { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .gr-goal { flex-direction: column; gap: 12px; min-height: 120px; padding: 18px; }
  .gr-begin .gr-sec { text-align: center; }
  .gr-begin .gr-pace { display: flex; width: max-content; margin: 0 auto; }
  .gr-begin .gr-acts { justify-content: center; margin-top: 30px; }
  .gr-pathv { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 34px; align-items: start; }
  .gr-side { position: sticky; top: 0; max-height: calc(100vh - 140px); overflow-y: auto; padding: 0 4px 20px 0; }
  .gr-today { padding: 26px 28px; }
  .gr-today h2 { font-size: 30px; }
}
