/* flows.css — reScribe 2.0 Tasks, Schedule and the Meetings create flows
 * (boards Tasks, TasksGrid, Schedule, NewSchedule, NewUpload, NewPaste).
 * Loaded after shell.css. Same rules as shell.css (pinned by the suite):
 * 2.0 token names only, no raw hex, no fixed phone-width px widths
 * (OPEN-QUESTIONS #24), no prefers-color-scheme, v2- prefixed classes.
 * Generic names this slice owns carry the v2-fl- prefix so they can never
 * collide with another 2.0 stylesheet.
 */

/* The legacy pull-to-refresh indicator (.ptr, app.css) positions itself
 * absolutely above its section. */
.v2-flows-root {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100%;
  width: 100%;
}

/* ---------- shared bits ---------- */
.v2-tasks__count {
  margin: 0 2px;
  font-size: 13.5px;
  color: var(--t-muted);
}
.v2-tasks__count b {
  color: var(--accent-ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.v2-fl-loading {
  margin: 8px 2px;
  font-size: 14px;
  color: var(--t-muted);
}
.v2-fl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 12px;
  text-align: center;
  color: var(--t-muted);
  font-size: 14px;
  line-height: 1.45;
}
.v2-fl-empty p {
  margin: 0;
  max-width: 22rem;
}
.v2-fl-empty__icon {
  color: var(--t-chevron);
  display: flex;
}
.v2-fl-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  color: var(--t-body);
  font-size: 14px;
}
.v2-fl-error p {
  margin: 0;
}
.v2-fl-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 14.5px;
  font-weight: 680;
}

/* ---------- tasks ---------- */
.v2-tasks__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.v2-tasks__body > .v2-label {
  margin-bottom: -8px;
}
.v2-tasks__toolbar {
  position: relative;
}
.v2-tasks__sortslot {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}
.v2-fl-menu {
  min-width: 12rem;
  padding: 6px;
  /* surface + row text: .v2-pop (shell.css) */
  display: flex;
  flex-direction: column;
}
.v2-fl-menu__head {
  margin: 4px 10px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--t-label);
}
.v2-fl-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--t-primary);
  font: inherit;
  text-align: left;
}
.v2-fl-menu__item.is-sel {
  color: var(--accent-ink);
  font-weight: 620;
}
.v2-fl-menu__check {
  display: flex;
  color: var(--accent-ink);
}

.v2-tbucket {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v2-tbucket .v2-label {
  margin-bottom: 6px;
}
.v2-trow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 54px;
  padding: 9px 0;
  box-sizing: border-box;
}
.v2-tbucket__rows .v2-trow + .v2-trow {
  border-top: 1px solid var(--strip-line);
}
.v2-trow__check {
  position: relative;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  flex: none;
  padding: 0;
  border-radius: 7px;
  border: 2px solid var(--t-dim);
  background: transparent;
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
/* 22px drawn, 44px hit */
.v2-trow__check::after {
  content: "";
  position: absolute;
  inset: -11px;
}
.v2-trow__check.is-urgent {
  border-color: var(--accent);
}
.v2-trow__check.is-done {
  border-color: var(--done);
  background: var(--done);
}
.v2-trow__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
}
.v2-trow__text {
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 520;
  color: var(--t-primary);
  overflow-wrap: anywhere;
}
.v2-trow.is-done .v2-trow__text {
  color: var(--t-dim);
  text-decoration: line-through;
}
.v2-trow__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  min-width: 0;
}
.v2-trow__owner {
  color: var(--t-muted);
  flex: none;
}
.v2-trow__memo {
  color: var(--t-placeholder);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.v2-trow__due {
  flex: none;
  margin-top: 1px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  background: var(--s-chip);
  color: var(--t-muted);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-trow__due.is-soon {
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--accent-ink);
}

/* By memo / Done: one raised card per memo (board TasksGrid) */
.v2-tgroup {
  display: flex;
  flex-direction: column;
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  border-radius: var(--r2-card);
  overflow: hidden;
}
.v2-tgroup__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--strip-line);
  background: none;
  font: inherit;
  text-align: left;
  color: var(--t-primary);
}
.v2-tgroup__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 680;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-tgroup__meta {
  flex: none;
  font-size: 11.5px;
  color: var(--t-muted);
  white-space: nowrap;
}
.v2-tgroup .v2-trow {
  padding: 9px 13px;
  min-height: 0;
}
.v2-tgroup .v2-trow + .v2-trow {
  border-top: 1px solid var(--strip-line);
}
.v2-tgroup .v2-trow__check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border-width: 1.5px;
}
.v2-tgroup .v2-trow__text {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
}

/* ---------- schedule ---------- */
.v2-sched__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.v2-sched__perm {
  margin: 0 2px;
}
.v2-slist {
  display: flex;
  flex-direction: column;
}
.v2-slist__month {
  margin: 14px 2px 2px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--t-label);
}
.v2-slist__month:first-child {
  margin-top: 0;
}
.v2-srow {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--strip-line);
}
.v2-srow:last-child {
  border-bottom: 0;
}
.v2-srow.is-past {
  opacity: 0.55;
}
.v2-srow__item {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--t-primary);
}
.v2-srow.is-anchor {
  gap: 14px;
  padding: 12px 0;
}
.v2-srow__date {
  width: 2.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex: none;
}
.v2-srow__dow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.6px;
  color: var(--t-label);
}
.v2-srow.is-today .v2-srow__dow {
  color: var(--accent-ink);
}
.v2-srow__num {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.v2-srow__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.v2-srow__title {
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.25px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.v2-srow__meta {
  font-size: 12.5px;
  color: var(--t-nav-off);
  font-variant-numeric: tabular-nums;
}
.v2-srow__none {
  font-size: 14px;
  color: var(--t-muted);
}
.v2-srow__rec {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 0;
  padding: 0;
  flex: none;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 10px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.v2-fl-addbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  border-radius: 25px;
  background: transparent;
  border: 1.5px dashed var(--accent-tint-line);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
}
.v2-fl-todaypill {
  position: fixed;
  /* below the pinned strip + search band (20 + 42 + 12px), Randy 2026-10-01 */
  top: calc(env(safe-area-inset-top, 0px) + var(--strip-h) + 84px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px 0 11px;
  border-radius: 17px;
  border: 1px solid var(--glass-nav-line);
  background: var(--glass-nav);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  box-shadow: var(--sh-raised);
  color: var(--accent-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.v2-fl-todaypill.is-shown {
  opacity: 1;
  pointer-events: auto;
}
.v2-fl-todaypill.is-up svg {
  transform: rotate(180deg);
}

/* ---------- pushed create flows (NewSchedule / NewUpload / NewPaste) ---------- */
.v2-flow {
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}
.v2-flow__head {
  /* Sticky like every top bar (shell.css .v2-head). */
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--rb-guard); /* bottom bounce keeps it drawn (shell.css) */
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 11px) 16px 12px;
  background: var(--s-page);
}
.v2-flow__cancel {
  height: 40px;
  padding: 0 15px 0 11px;
  border-radius: 20px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 620;
}
.v2-flow__primary {
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 14.5px;
  font-weight: 680;
  flex: none;
}
.v2-flow__primary:disabled {
  opacity: 0.45;
}
.v2-flow__intro {
  padding: 2px var(--pad-x) 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.v2-flow__h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: -0.75px;
  line-height: 1.18;
}
.v2-flow__sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--t-muted);
}
.v2-flow__body {
  padding: 0 var(--pad-x);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.v2-flow__caption {
  margin: -4px 2px 0;
}
.v2-fl-form__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 0;
  min-width: 0;
}
.v2-fl-form__label {
  font-size: 12px;
  font-weight: 640;
  color: var(--t-muted);
}
.v2-fl-form__row {
  display: flex;
  gap: 10px;
}
.v2-fl-form__input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  box-sizing: border-box;
  border-radius: 13px;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.v2-fl-form__input:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 1px;
}
/* Native date/time/select chrome follows the attribute theme (no media query). */
[data-theme="dark"] .v2-fl-form__input {
  color-scheme: dark;
}
.v2-fl-form__input::-webkit-date-and-time-value {
  text-align: left;
}
.v2-fl-form__selectwrap {
  position: relative;
  display: block;
}
.v2-fl-form__select {
  padding-right: 40px;
}
.v2-fl-form__chev {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--t-chevron);
  pointer-events: none;
}
.v2-fl-form__err {
  margin: -4px 2px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--danger);
}
.v2-flow__togglecard,
.v2-flow__recnow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px;
  box-sizing: border-box;
  border-radius: 15px;
  font: inherit;
  text-align: left;
  color: var(--t-primary);
  width: 100%;
}
.v2-flow__toggletext {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.v2-flow__togglelabel {
  font-size: 14.5px;
  font-weight: 620;
}
.v2-flow__togglesub {
  font-size: 11.5px;
  color: var(--t-placeholder);
  line-height: 1.35;
}
.v2-flow__orb {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-tint);
  color: var(--accent-ink);
}
.v2-flow__recnow .v2-flow__togglelabel {
  color: var(--accent-ink);
}
.v2-flow__delete {
  align-self: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 620;
  color: var(--accent-ink); /* a direct in-app delete is the skill's pink (decision 5) */
}

/* Upload */
.v2-fl-dropzone {
  min-height: 8rem;
  padding: 18px 16px;
  border-radius: var(--r2-bigcard);
  border: 1.5px dashed var(--accent-tint-line);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  color: var(--t-primary);
}
.v2-fl-dropzone:disabled {
  opacity: 0.55;
}
.v2-fl-dropzone__icon {
  display: flex;
  color: var(--accent-ink);
}
.v2-fl-dropzone__title {
  font-size: 14.5px;
  font-weight: 640;
}
.v2-fl-dropzone__fine {
  font-size: 11.5px;
  color: var(--t-placeholder);
}
.v2-upload__progress {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
}
.v2-upload__tile {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-line);
  color: var(--accent-ink);
}
.v2-upload__ptext {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.v2-upload__phase {
  font-size: 13.5px;
  font-weight: 620;
}
.v2-upload__elapsed {
  font-size: 11.5px;
  color: var(--t-placeholder);
  font-variant-numeric: tabular-nums;
}
.v2-upload__spin {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--s-track);
  border-top-color: var(--accent);
  animation: v2-fl-spin 0.9s linear infinite;
}
@keyframes v2-fl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Paste */
.v2-paste__field {
  min-height: 10rem;
  padding: 13px 14px;
  box-sizing: border-box;
  border-radius: 15px;
  width: 100%;
  resize: none;
  line-height: 1.5;
  color: var(--t-body);
  outline: none;
}
.v2-paste__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}
.v2-paste__count {
  font-size: 11.5px;
  color: var(--t-placeholder);
  font-variant-numeric: tabular-nums;
}
.v2-fl-pillbtn {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px 0 11px;
  border-radius: 17px;
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--t-nav);
  font: inherit;
  font-size: 13px;
  font-weight: 620;
}
.v2-fl-pillbtn::after {
  content: "";
  position: absolute;
  inset: -5px;
}

/* ---------- confirmation dialog: red is for confirmations (decision 5) ---------- */
.v2-fl-confirm {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.v2-fl-confirm__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(var(--scrim-blur));
  backdrop-filter: blur(var(--scrim-blur));
}
.v2-fl-confirm__box {
  position: relative;
  width: min(100%, 22rem);
  padding: 20px 18px 16px;
  border-radius: 20px;
  background: var(--s-panel);
  border: 1px solid var(--strip-line);
  box-shadow: var(--sh-nav);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v2-fl-confirm__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.v2-fl-confirm__body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--t-muted);
}
.v2-fl-confirm__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.v2-fl-confirm__btn {
  flex: 1 1 0;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--raised-line);
  background: var(--s-chip);
  box-shadow: var(--sh-raised);
  color: var(--t-primary);
  font: inherit;
  font-size: 15px;
  font-weight: 620;
}
.v2-fl-confirm__btn.is-danger {
  border-color: transparent;
  background: var(--danger);
  color: var(--on-accent);
}
