/* ============================================================================
   ROTEIRINHOS
   A working screen first: a green header that says where the trip stands, a
   row (or column) of dates to jump around, and the day's plan on a clean
   surface. The road-trip world shows up in four places only: Overpass for
   dates and times (it comes from road-sign lettering), the highway-sign
   green, the yellow road running down the timeline, and the red arrow that
   walks along it with the clock. That road and arrow are the signature.
   Loaded only on the Roteirinhos pages.
   ========================================================================== */

.rt {
  --rt-paper:     #fbfbf9;   /* the plan's surface */
  --rt-paper-2:   #ffffff;   /* inputs, raised bits */
  --rt-ground:    #eef0ec;   /* second neutral: rails, quiet fills */
  --rt-ink:       #17211d;
  --rt-ink-soft:  #48544e;
  --rt-faint:     #66716b;
  --rt-rule:      rgba(23, 33, 29, .1);
  --rt-rule-2:    rgba(23, 33, 29, .18);
  --rt-road:      #f2b705;
  --rt-road-edge: #17211d;
  --rt-done:      #b9c0bc;
  --rt-sign:      #0b6b46;   /* the header, primary buttons */
  --rt-sign-ink:  #f4f8f5;
  --rt-green:     #0b6b46;   /* green as text */
  --rt-here:      #d1392b;
  --rt-hover:     rgba(23, 33, 29, .055);
  --rt-shadow:    0 1px 2px rgba(23, 33, 29, .05), 0 8px 24px -18px rgba(23, 33, 29, .35);

  --font-sign: "Overpass", var(--font-body);
  --font-code: "Overpass Mono", var(--font-mono);

  /* the plan's columns: time | road | what happens */
  --pad: 1.25rem;
  --col-time: 4.1rem;
  --col-road: 2.5rem;
  --road-x: calc(var(--pad) + var(--col-time) + var(--col-road) / 2);
}

[data-theme="dark"] .rt {
  --rt-paper:     #1a211e;
  --rt-paper-2:   #222a26;
  --rt-ground:    #141a17;
  --rt-ink:       #e7ede9;
  --rt-ink-soft:  #b4bfb9;
  --rt-faint:     #8e9993;
  --rt-rule:      rgba(255, 255, 255, .08);
  --rt-rule-2:    rgba(255, 255, 255, .16);
  --rt-road:      #e5ad0b;
  --rt-road-edge: #0c110f;
  --rt-done:      #48524d;
  --rt-sign:      #0d6a46;
  --rt-green:     #63d19f;
  --rt-here:      #ff5c48;
  --rt-hover:     rgba(255, 255, 255, .06);
  --rt-shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -20px rgba(0, 0, 0, .7);
}

.rt .rt-accent { color: #b98500; }
[data-theme="dark"] .rt .rt-accent { color: var(--rt-road); }

.rt ::selection { background: var(--rt-road); color: #17211d; }

.rt button:focus-visible, .rt a:focus-visible, .rt input:focus-visible,
.rt select:focus-visible, .rt textarea:focus-visible {
  outline: 2.5px solid var(--rt-green); outline-offset: 2px;
}

.rt [hidden] { display: none !important; }

/* ---- buttons -------------------------------------------------------------- */
.rt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 44px;
  padding: .5em 1.05em;
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  color: var(--rt-ink);
  background: var(--rt-paper-2);
  border: 1px solid var(--rt-rule-2); border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.rt-btn:hover { border-color: var(--rt-ink-soft); }
.rt-btn:active { transform: translateY(1px); }
.rt-btn:disabled { opacity: .5; cursor: default; }
.rt-btn--go { background: var(--rt-sign); border-color: var(--rt-sign); color: var(--rt-sign-ink); }
.rt-btn--go:hover { background: #095a3b; border-color: #095a3b; }
.rt-btn--lg { font-size: 1.02rem; padding: .7em 1.4em; }

.rt .linkish {
  background: none; border: none; padding: .4em .2em; cursor: pointer;
  font-family: var(--font-body); font-size: .92rem; color: var(--rt-ink-soft);
  letter-spacing: normal; text-transform: none;
  text-decoration: underline; text-underline-offset: 3px;
}
.rt .linkish:hover { color: var(--rt-ink); }
.rt .linkish.danger { color: var(--rt-here); }

/* ---- page frame ----------------------------------------------------------- */
.rtwrap {
  width: min(1080px, 100% - 2rem);
  margin-inline: auto;
  padding: 1rem 0 5rem;
}

.rt-actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem .7rem;
  margin: 0 0 .9rem;
  color: var(--on-desk);
}
.rt-actions .brand { font-size: 1.25rem; flex: none; }
.rt-actions .brand-name { color: var(--on-desk-strong); }
.rt-actions .brand-by { color: var(--on-desk-faint); }
.rt-actions .right { display: flex; align-items: center; gap: .25rem .45rem; flex-wrap: wrap; }
.rt-actions form { margin: 0; }
.rt-actions .theme-toggle { color: var(--on-desk-soft); }

.rt-icon {
  display: inline-grid; place-items: center;
  min-width: 40px; min-height: 40px; padding: 0;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  color: var(--on-desk-soft);
}
.rt-icon:hover { color: var(--on-desk-strong); background: var(--rt-hover); }

.rt-ai-btn {
  display: inline-flex; align-items: center; gap: .4em;
  min-height: 40px; padding: .3em .9em;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  color: var(--on-desk-strong);
  background: transparent;
  border: 1px solid var(--desk-line); border-radius: 8px;
  cursor: pointer;
}
[data-theme="light"] .rt-ai-btn { border-color: rgba(23, 33, 29, .2); }
.rt-ai-btn:hover { border-color: currentColor; }

.rt-acct {
  background: none; border: none; padding: .15em .2em; cursor: pointer;
  font-family: var(--font-body); font-size: .85rem;
  color: var(--on-desk-soft);
  text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.rt-acct--saved { text-decoration: none; color: var(--rt-green); }

/* ---- the header: where the trip stands ------------------------------------ */
.trip-head {
  position: relative;
  padding: 1.35rem 1.4rem 1.25rem;
  color: var(--rt-sign-ink);
  background: var(--rt-sign);
  border-radius: 14px;
}
.trip-head-top { display: flex; align-items: flex-start; gap: .5rem; }
.cover-title {
  flex: 1; min-width: 0;
  padding: 0; margin: 0;
  background: none; border: none; text-align: left; cursor: pointer;
  font-family: var(--font-sign); font-weight: 800;
  font-size: 2.25rem; line-height: 1.05; letter-spacing: -.02em;
  color: inherit;
  overflow-wrap: anywhere;
}
.cover-title:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.cover-dates {
  margin: .4rem 0 0;
  font-family: var(--font-sign); font-weight: 600; font-size: 1rem;
  color: rgba(244, 248, 245, .82);
  font-variant-numeric: tabular-nums;
}
.cover-more {
  flex: none; width: 40px; height: 40px; margin: -.2rem -.5rem 0 0;
  display: grid; place-items: center;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  color: inherit; fill: currentColor;
}
.cover-more:hover { background: rgba(255, 255, 255, .12); }

/* the status line: a highway sign's job, inside the header instead of a box in a box */
.sign {
  position: relative;
  display: grid; justify-items: start; gap: .05rem;
  width: calc(100% + 2.8rem); margin: 1.1rem -1.4rem -1.25rem;
  padding: .9rem 3.4rem 1rem 1.4rem;
  text-align: left; cursor: pointer;
  font-family: var(--font-body); color: var(--rt-sign-ink);
  background: rgba(0, 0, 0, .16);
  border: none; border-radius: 0 0 14px 14px;
}
.sign:hover { background: rgba(0, 0, 0, .22); }
.sign--after { background: rgba(0, 0, 0, .1); }
.sign-day { font-family: var(--font-sign); font-weight: 700; font-size: .8rem; color: rgba(244, 248, 245, .75); }
.sign-small { font-size: .92rem; color: rgba(244, 248, 245, .86); }
.sign-big { font-family: var(--font-sign); font-weight: 700; font-size: 1.3rem; line-height: 1.2; letter-spacing: -.01em; }
.sign-go {
  position: absolute; right: 1.2rem; top: 50%; translate: 0 -50%;
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- the body: dates to jump between + the plan ---------------------------- */
.trip-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

.daynav {
  position: sticky; top: 1rem;
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100svh - 2rem); overflow-y: auto;
  padding: .4rem;
  background: var(--rt-ground);
  border: 1px solid var(--rt-rule);
  border-radius: 12px;
  scrollbar-width: thin;
}
.nav-day {
  display: grid; grid-template-columns: 2.4rem 2.1rem minmax(0, 1fr); align-items: center; gap: .2rem;
  min-height: 44px; padding: .35rem .55rem;
  text-align: left; background: none; border: none; border-radius: 8px; cursor: pointer;
  color: var(--rt-ink-soft);
}
.nav-day:hover { background: var(--rt-hover); color: var(--rt-ink); }
.nav-week { font-family: var(--font-sign); font-weight: 600; font-size: .78rem; }
.nav-num { font-family: var(--font-sign); font-weight: 800; font-size: 1.15rem; color: var(--rt-ink); font-variant-numeric: tabular-nums; text-align: right; padding-right: .5rem; }
.nav-title { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-day.is-active { background: var(--rt-paper-2); color: var(--rt-ink); box-shadow: 0 0 0 1px var(--rt-rule-2); }
.nav-day.is-today .nav-num { box-shadow: inset 0 -3px 0 var(--rt-road); }

.trip-main {
  min-width: 0;
  background: var(--rt-paper);
  color: var(--rt-ink);
  border: 1px solid var(--rt-rule);
  border-radius: 14px;
  box-shadow: var(--rt-shadow);
  overflow: clip;
}
.daynav[hidden] + .trip-main { grid-column: 1 / -1; }

/* ---- before you leave ----------------------------------------------------- */
.before {
  border-bottom: 1px solid var(--rt-rule);
}
.before-head {
  display: flex; align-items: center; gap: .8rem;
  width: 100%; min-height: 56px; padding: .7rem var(--pad);
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--rt-ink);
}
.before-head:hover { background: var(--rt-hover); }
.before-title { flex: 1; font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; }
.before-count {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-sign); font-weight: 600; font-size: .88rem; color: var(--rt-ink-soft);
  font-variant-numeric: tabular-nums;
}
.before-count::after {
  content: ""; width: .45em; height: .45em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  rotate: 45deg; translate: 0 -.15em; transition: rotate .2s ease, translate .2s ease;
}
.before.is-open .before-count::after { rotate: -135deg; translate: 0 .1em; }
.before.is-done .before-count { color: var(--rt-green); }
/* how much is left, as a line that fills */
.before-bar { display: block; height: 3px; margin: -.2rem var(--pad) .6rem; background: var(--rt-rule); border-radius: 2px; overflow: hidden; }
.before-bar i { display: block; height: 100%; background: var(--rt-sign); border-radius: inherit; transition: width .25s ease; }
[data-theme="dark"] .before-bar i { background: var(--rt-green); }

.checks { list-style: none; margin: .4rem 0 0; padding: 0 calc(var(--pad) - .5rem); }
.check { display: flex; align-items: center; border-radius: 8px; }
.check:hover { background: var(--rt-hover); }
.check-box {
  flex: 1; display: flex; align-items: center; gap: .75rem;
  min-height: 46px; padding: .4rem .5rem;
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 1rem; color: var(--rt-ink);
}
.check-tick {
  flex: none; width: 22px; height: 22px; padding: 2px;
  border: 1.5px solid var(--rt-ink-soft); border-radius: 6px;
  fill: none; stroke: transparent; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  transition: background .15s ease, border-color .15s ease;
}
.check.is-done .check-tick { background: var(--rt-sign); border-color: var(--rt-sign); stroke: #fff; }
.check.is-done .check-text { color: var(--rt-faint); text-decoration: line-through; text-decoration-color: var(--rt-rule-2); }
.check-del {
  flex: none; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; border-radius: 8px;
  color: var(--rt-faint); font-size: .8rem;
  opacity: 0; transition: opacity .15s ease;
}
.check:hover .check-del, .check-del:focus-visible { opacity: 1; }
@media (hover: none) { .check-del { opacity: .55; } }
.check-del:hover { color: var(--rt-here); }
.check-add { display: flex; gap: .5rem; padding: .5rem var(--pad) 1rem; }
.check-input {
  flex: 1; min-width: 0; min-height: 44px;
  font: inherit; font-size: .98rem; color: var(--rt-ink);
  padding: .5rem .75rem;
  background: var(--rt-paper-2); border: 1px solid var(--rt-rule-2); border-radius: 8px;
}
.check-input::placeholder { color: var(--rt-faint); }
.check-input:focus { outline: none; border-color: var(--rt-green); box-shadow: 0 0 0 3px rgba(11, 107, 70, .15); }

/* ---- the route ------------------------------------------------------------ */
.route { position: relative; padding-bottom: 1.2rem; }

/* the road: yellow, cased, the whole length of the trip */
.road {
  position: absolute; top: 1.2rem; bottom: 2.6rem;
  left: calc(var(--road-x) - 3.5px); width: 7px;
  background: var(--rt-road);
  box-shadow: 0 0 0 1.5px var(--rt-road-edge);
  border-radius: 4px;
}
/* the stretch already travelled goes grey behind the arrow */
.road-done {
  position: absolute; left: 0; right: 0; top: 0;
  height: 0;
  background: var(--rt-done);
  border-radius: 4px 4px 0 0;
  transition: height .9s cubic-bezier(.3, .7, .2, 1);
}

.days { list-style: none; margin: 0; padding: 0; position: relative; }
.day { position: relative; }
.day + .day { margin-top: .6rem; }

/* each day opens with its date, big: the thing you look for first */
.day-sign {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: var(--col-time) 1fr auto auto;
  grid-template-areas: "num when meta more" "num title title title" "num tz tz tz";
  align-items: center;
  column-gap: .2rem;
  padding: 1rem var(--pad) .8rem;
  background: var(--rt-paper);
  border-top: 1px solid var(--rt-rule);
}
.day:first-child .day-sign { border-top: none; }
.day-num {
  grid-area: num; align-self: center; justify-self: end; padding-right: .6rem;
  font-family: var(--font-sign); font-weight: 800;
  font-size: 2.6rem; line-height: .85; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  color: var(--rt-ink);
}
.day-when {
  grid-area: when; display: flex; flex-direction: column; min-width: 0;
  padding-left: calc(var(--col-road) / 2 + .2rem);
  line-height: 1.2;
}
.day-week { display: flex; align-items: center; gap: .5rem; font-family: var(--font-sign); font-weight: 700; font-size: 1.08rem; }
.day-month { font-size: .88rem; color: var(--rt-ink-soft); }
.day-meta {
  grid-area: meta;
  font-family: var(--font-sign); font-weight: 600; font-size: .8rem; color: var(--rt-faint);
  font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap;
}
.day-tz {
  grid-area: tz;
  padding-left: calc(var(--col-road) / 2 + .2rem); margin-top: .2rem;
  font-size: .82rem; color: var(--rt-green);
}
.day-more {
  grid-area: more; width: 40px; height: 40px; margin-right: -.5rem;
  display: grid; place-items: center;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  color: var(--rt-faint); fill: currentColor;
}
.day-more:hover { background: var(--rt-hover); color: var(--rt-ink); }
.day-title {
  grid-area: title;
  padding-left: calc(var(--col-road) / 2 + .2rem); margin-top: .2rem;
  font-weight: 600; font-size: 1rem; color: var(--rt-ink);
}
.today-tag {
  display: inline-block; padding: .1em .45em 0;
  font-family: var(--font-sign); font-weight: 700; font-size: .72rem; text-transform: none;
  color: #17211d; background: var(--rt-road);
  border-radius: 4px;
}

.stops { list-style: none; margin: 0; padding: 0; }

.stop {
  position: relative;
  display: grid;
  grid-template-columns: var(--col-time) var(--col-road) minmax(0, 1fr);
  padding: .75rem var(--pad) .8rem;
}
.stop + .stop::before {
  content: ""; position: absolute; top: 0;
  left: calc(var(--road-x) + var(--col-road) / 2); right: var(--pad);
  border-top: 1px solid var(--rt-rule);
}

.stop-time {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: .25rem .55rem 0 0;
  font-family: var(--font-sign); font-variant-numeric: tabular-nums;
}
.t-start { font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.t-end { font-size: .76rem; line-height: 1.25; color: var(--rt-faint); text-align: right; margin-top: .15rem; }
.t-all { font-size: .74rem; color: var(--rt-faint); text-align: right; line-height: 1.2; padding-top: .25rem; }

.stop-pin {
  position: relative; z-index: 2;
  justify-self: center;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--rt-paper-2);
  border: 2px solid var(--rt-road-edge); border-radius: 50%;
  color: var(--rt-ink);
}
[data-theme="dark"] .stop-pin { border-color: var(--rt-ink-soft); }
.stop-pin .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.stop-body { min-width: 0; padding-left: .5rem; }
.stop-top { display: flex; align-items: flex-start; gap: .4rem; }
.stop-title {
  flex: 1; min-width: 0; margin: .2rem 0 0;
  font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; line-height: 1.35;
  color: var(--rt-ink);
  overflow-wrap: anywhere;
}
.stop-edit {
  flex: none; width: 36px; height: 36px; margin: -.2rem -.5rem 0 0;
  display: grid; place-items: center;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  color: var(--rt-faint);
}
.stop-edit .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stop-edit:hover { color: var(--rt-ink); background: var(--rt-hover); }

.stop-when {
  display: inline-block; margin-top: .25rem;
  font-family: var(--font-sign); font-weight: 700; font-size: .82rem;
  color: var(--rt-green);
}
.stop-place { margin: .2rem 0 0; font-size: .93rem; color: var(--rt-ink-soft); line-height: 1.4; }

/* what you do with a stop: map, link, codes to copy */
.stop-acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.act {
  display: inline-flex; align-items: center; gap: .4em;
  min-height: 36px; max-width: 100%; padding: .3em .7em;
  font-family: var(--font-body); font-weight: 600; font-size: .86rem;
  color: var(--rt-ink); text-decoration: none;
  background: var(--rt-paper-2);
  border: 1px solid var(--rt-rule-2); border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.act:hover { border-color: var(--rt-ink-soft); }
.act .ico, .act .copy-ico { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.act--map { color: var(--rt-green); }
.act--link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a code to copy reads as a small label over the value, so a long booking
   number stays on one line instead of breaking in the middle */
.act--copy {
  display: inline-grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label ico" "value ico";
  align-items: center; column-gap: .6em; row-gap: 0;
  padding: .3em .65em .35em; text-align: left;
}
.copy-label { grid-area: label; font-weight: 500; font-size: .72rem; line-height: 1.3; color: var(--rt-faint); white-space: nowrap; }
.copy-value { grid-area: value; font-family: var(--font-code); font-weight: 600; font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.act--copy .copy-ico { grid-area: ico; }
.act--copy:not(:has(.copy-label)) { grid-template-areas: "value ico"; }
.act--copy .copy-ico { color: var(--rt-faint); }
.act.is-copied, .stop-addr.is-copied { background: var(--rt-sign); border-color: var(--rt-sign); color: #fff; }
.act.is-copied .copy-label, .act.is-copied .copy-ico { color: inherit; }

.stop-addr {
  display: flex; align-items: flex-start; gap: .4em;
  margin: .45rem 0 0; padding: .15em .35em .15em 0;
  background: none; border: none; border-radius: 6px; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: .88rem; line-height: 1.4; color: var(--rt-ink-soft);
}
.stop-addr .copy-ico { flex: none; width: 14px; height: 14px; margin-top: .2em; fill: none; stroke: var(--rt-faint); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.stop-addr:hover span { text-decoration: underline; text-underline-offset: 3px; }
.stop-addr.is-copied { padding-left: .35em; }
.stop-addr.is-copied .copy-ico { stroke: currentColor; }

.stop-notes {
  margin: .45rem 0 0;
  white-space: pre-line;
  font-size: .92rem; line-height: 1.5; color: var(--rt-ink-soft);
  max-width: 62ch;
}

.stop-files { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .6rem; }
.file {
  position: relative; display: grid; place-items: center;
  width: 72px; height: 72px; padding: 0; overflow: hidden;
  background: var(--rt-ground);
  border: 1px solid var(--rt-rule-2); border-radius: 8px;
  cursor: pointer; color: var(--rt-ink-soft); text-decoration: none;
}
.file img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file--doc { align-content: center; gap: .25rem; padding: .4rem; }
.file--doc .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.file-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; }
.file:hover { border-color: var(--rt-ink-soft); }

/* stop states, all set by the clock */
.stop.is-past .stop-title, .stop.is-past .t-start { color: var(--rt-faint); }
.stop.is-past .stop-pin { border-color: var(--rt-done); color: var(--rt-faint); }
.stop.is-now { background: color-mix(in srgb, var(--rt-road) 13%, transparent); }
.stop.is-now .stop-pin { background: var(--rt-road); color: #17211d; border-color: var(--rt-road-edge); }
.stop.is-now .stop-when { color: var(--rt-here); }
.stop.is-next .stop-pin { border-color: var(--rt-green); color: var(--rt-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-green) 20%, transparent); }

.add-stop {
  position: relative; z-index: 2;
  display: block;
  margin: .1rem 0 .4rem calc(var(--road-x) + var(--col-road) / 2 - .1rem);
  min-height: 40px; padding: .3em .55em;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  color: var(--rt-faint);
}
.add-stop:hover { color: var(--rt-green); background: var(--rt-hover); }
.day.is-empty .add-stop { font-weight: 500; }

.route-end {
  position: relative; z-index: 2;
  display: flex; align-items: center;
  margin-top: .6rem;
  padding: .6rem var(--pad) 0 calc(var(--road-x) - 11px);
}
/* the road ends in a short bar */
.route-end::before {
  content: ""; flex: none;
  width: 22px; height: 5px; margin-right: 1rem;
  background: var(--rt-road-edge); border-radius: 3px;
}
[data-theme="dark"] .route-end::before { background: var(--rt-ink-soft); }
.add-day {
  min-height: 44px; padding: .4em 1em;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  color: var(--rt-green);
  background: none; border: 1px solid var(--rt-rule-2); border-radius: 8px;
  cursor: pointer;
}
.add-day:hover { border-color: var(--rt-green); background: var(--rt-hover); }

.day-empty {
  position: relative; z-index: 2;
  padding: 1.6rem var(--pad) 1rem calc(var(--road-x) + 1.4rem);
  color: var(--rt-ink-soft);
}
.day-empty p { margin: 0 0 1rem; max-width: 34ch; }
.day-empty + .route-end, .days:has(.day-empty) ~ .route-end { display: none; }

/* ---- you are here ---------------------------------------------------------- */
/* The arrow's tip sits exactly at "now" on the road. It only moves when the
   clock does, the one bit of motion on this page. */
.here {
  position: absolute; z-index: 4; top: 0;
  left: calc(var(--road-x) - 14px);
  width: 28px; height: 0;
  pointer-events: none;
  transition: transform .9s cubic-bezier(.3, .7, .2, 1);
}
.here-arrow {
  position: absolute; left: 1px; bottom: -3px;
  width: 26px; height: 30px;
  fill: var(--rt-here); stroke: var(--rt-paper); stroke-width: 2.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(80, 20, 10, .3));
}
.here.is-live::before {
  content: ""; position: absolute; left: 3px; top: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rt-here); opacity: 0;
  animation: here-pulse 2.6s ease-out infinite;
}
@keyframes here-pulse {
  0% { transform: scale(.5); opacity: .4; }
  100% { transform: scale(2.3); opacity: 0; }
}
.here-label {
  position: absolute; right: calc(100% + .3rem); bottom: 2px;
  padding: .12em .45em .02em;
  font-family: var(--font-sign); font-weight: 700; font-size: .72rem; white-space: nowrap;
  color: #fff; background: var(--rt-here);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.now-pill {
  position: fixed; z-index: 60;
  right: max(1rem, env(safe-area-inset-right)); bottom: calc(1.2rem + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 46px; padding: .5em 1.1em .45em .95em;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem;
  color: #fff; background: var(--rt-here);
  border: none; border-radius: 999px; cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(120, 30, 20, .7);
}
.now-pill svg { fill: currentColor; }

/* ---- menus ---------------------------------------------------------------- */
.rt-menu {
  position: absolute; z-index: 9600;
  min-width: 230px; max-width: calc(100vw - 16px);
  padding: .4rem;
  background: var(--rt-paper-2); color: var(--rt-ink);
  border-radius: 10px;
  box-shadow: 0 18px 40px -16px rgba(10, 20, 15, .5), 0 0 0 1px var(--rt-rule-2);
}
.rt-menu-label {
  padding: .45rem .7rem .3rem;
  font-family: "Overpass", var(--font-body); font-weight: 700; font-size: .82rem; color: var(--rt-faint);
}
.rt-menu-item {
  display: block; width: 100%; min-height: 44px; padding: .55em .75em;
  text-align: left; background: none; border: none; border-radius: 7px; cursor: pointer;
  font-family: var(--font-body); font-size: .98rem; color: inherit;
}
.rt-menu-item:hover, .rt-menu-item:focus-visible { background: var(--rt-hover); outline: none; }
.rt-menu-item.danger { color: var(--rt-here); }
.rt-menu-sep { height: 1px; margin: .3rem .5rem; background: var(--rt-rule); }
.rt-menu--sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto !important;
  max-width: none; border-radius: 16px 16px 0 0;
  padding: .7rem .7rem calc(.9rem + env(safe-area-inset-bottom));
  animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1);
}
.rt-menu-scrim { position: fixed; inset: 0; z-index: 9590; background: rgba(10, 16, 13, .4); }
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- the form sheet ------------------------------------------------------- */
html.rt-locked { overflow: hidden; }
.rt-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: grid; place-items: center;
  padding: 1rem;
  background: rgba(10, 16, 13, .5);
  overflow-y: auto;
}
.rt-modal {
  width: min(560px, 100%);
  max-height: calc(100svh - 2rem); overflow-y: auto;
  padding: 1.4rem 1.4rem 1.1rem;
  background: var(--rt-paper-2); color: var(--rt-ink);
  border-radius: 12px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55);
}
.rt-modal-title { margin: 0 0 .9rem; font-family: var(--font-sign); font-weight: 800; font-size: 1.4rem; letter-spacing: -.015em; }
.rt-modal-note { margin: -.4rem 0 1rem; font-size: .95rem; line-height: 1.5; color: var(--rt-ink-soft); }

.rt-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; min-width: 0; }
.rt-label { display: block; font-family: var(--font-sign); font-weight: 700; font-size: .85rem; color: var(--rt-ink-soft); margin-bottom: .3rem; }
.rt-field .rt-label { margin-bottom: 0; }
.rt-hint { font-size: .8rem; color: var(--rt-faint); }
.rt-input {
  width: 100%; min-width: 0; min-height: 46px;
  padding: .55rem .7rem;
  font-family: var(--font-body); font-size: 1rem; color: var(--rt-ink);
  background: var(--rt-paper-2); border: 1px solid var(--rt-rule-2); border-radius: 8px;
}
.rt-input:focus { outline: none; border-color: var(--rt-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-green) 18%, transparent); }
.rt-input::placeholder { color: var(--rt-faint); }
.rt-input--mono { font-family: var(--font-code); font-weight: 600; }
select.rt-input { appearance: auto; }
.rt-notes { resize: vertical; min-height: 84px; line-height: 1.45; }

.rt-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: .6rem; }

.kind-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: 1rem; }
.kind {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  min-height: 58px; padding: .4rem .2rem;
  font-family: var(--font-sign); font-weight: 700; font-size: .76rem;
  color: var(--rt-ink-soft); background: var(--rt-paper-2);
  border: 1px solid var(--rt-rule-2); border-radius: 8px; cursor: pointer;
}
.kind .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kind.sel { color: #17211d; border-color: var(--rt-road-edge); background: var(--rt-road); }

.copy-rows { display: flex; flex-direction: column; gap: .4rem; }
.copy-row { display: grid; grid-template-columns: 1fr 1.4fr 40px; gap: .4rem; align-items: center; }
.copy-row-del, .edit-file-del {
  width: 40px; height: 40px; border: none; background: none; border-radius: 50%; cursor: pointer;
  color: var(--rt-faint);
}
.copy-row-del:hover { color: var(--rt-here); background: rgba(209, 57, 43, .08); }
.copy-rows + .linkish { margin: .15rem 0 .8rem; }

.edit-files { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.edit-file {
  position: relative; width: 78px; height: 78px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--rt-paper-2); border: 1px solid var(--rt-rule-2); border-radius: 8px;
}
.edit-file img { width: 100%; height: 100%; object-fit: cover; }
.edit-file.is-new { border-style: dashed; border-color: var(--rt-sign); }
.edit-file-name { padding: .3rem; font-size: .68rem; text-align: center; overflow-wrap: anywhere; color: var(--rt-ink-soft); }
.edit-file-del {
  position: absolute; top: 2px; right: 2px; width: 26px; height: 26px;
  background: rgba(27, 38, 34, .75); color: #fff; font-size: .7rem;
}
.edit-file--add {
  cursor: pointer; border-style: dashed;
  font-family: var(--font-sign); font-weight: 700; font-size: .78rem; color: var(--rt-sign); text-align: center;
}
.edit-file--add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.rt-modal-acts {
  position: sticky; bottom: -1.1rem;
  display: flex; align-items: center; gap: .5rem;
  margin: .4rem -1.4rem -1.1rem; padding: .8rem 1.4rem 1.1rem;
  background: var(--rt-paper-2);
  border-top: 1px solid var(--rt-rule);
}
.rt-modal-acts .spacer { flex: 1; }

.ai-prompt { font-family: var(--font-code); font-size: .85rem; line-height: 1.55; min-height: 150px; resize: vertical; }
.ai-row { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; margin: .8rem 0 .4rem; }
.ai-safe { margin: .8rem 0 0; font-size: .86rem; }

/* ---- the image viewer ------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 9700;
  display: grid; grid-template-rows: 1fr auto;
  background: rgba(8, 12, 10, .94);
  outline: none;
}
.lightbox img {
  width: 100%; height: 100%; object-fit: contain;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 0;
  touch-action: pinch-zoom;
}
.lightbox-bar {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
  color: #e9eee9; font-family: var(--font-sign); font-weight: 600;
}
.lightbox-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; opacity: .8; }
.lightbox-open { color: #fff; font-weight: 800; }
.lightbox-close { width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1rem; cursor: pointer; }

.rt .toast { background: var(--rt-ink); color: var(--rt-paper-2); font-family: var(--font-sign); font-weight: 700; letter-spacing: 0; font-size: .92rem; }

/* ---- narrower screens ------------------------------------------------------ */
@media (max-width: 860px) {
  .trip-body { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  /* the dates become a row that sticks to the top while you scroll */
  .daynav {
    top: 0; z-index: 30;
    flex-direction: row; gap: .3rem;
    max-height: none; overflow-x: auto; overflow-y: hidden;
    margin: 0 -1rem; padding: .5rem 1rem;
    background: var(--desk); border: none; border-radius: 0;
    box-shadow: 0 1px 0 var(--desk-line);
    scrollbar-width: none;
  }
  .daynav::-webkit-scrollbar { display: none; }
  .nav-day {
    flex: none;
    grid-template-columns: none; grid-auto-flow: row; justify-items: center; gap: 0;
    min-width: 3.4rem; min-height: 54px; padding: .3rem .5rem .35rem;
    background: var(--rt-paper); box-shadow: 0 0 0 1px var(--rt-rule);
    text-align: center;
  }
  .nav-num { padding: 0; text-align: center; font-size: 1.2rem; line-height: 1.05; }
  .nav-title { display: none; }
  .nav-day.is-active { background: var(--rt-ink); color: var(--rt-paper); box-shadow: none; }
  .nav-day.is-active .nav-num { color: var(--rt-paper); }
  .nav-day.is-today .nav-num { box-shadow: none; }
  .nav-day.is-today::after { content: ""; width: 1.2rem; height: 3px; margin-top: 2px; border-radius: 2px; background: var(--rt-road); }
}

@media (max-width: 560px) {
  .rt { --pad: .9rem; --col-time: 3.5rem; --col-road: 2.2rem; }
  .rtwrap { width: min(1080px, 100% - 1.2rem); padding-top: .7rem; }
  .daynav { margin: 0 -.6rem; padding-inline: .6rem; }
  .rt-actions .brand { font-size: 1.1rem; }
  .rt-ai-btn { font-size: .85rem; padding: .3em .7em; }
  .trip-head { padding: 1.1rem 1.1rem 1.05rem; border-radius: 12px; }
  .cover-title { font-size: 1.75rem; }
  .sign { width: calc(100% + 2.2rem); margin: 1rem -1.1rem -1.05rem; padding: .85rem 3rem .9rem 1.1rem; border-radius: 0 0 12px 12px; }
  .sign-big { font-size: 1.15rem; }
  .trip-main { border-radius: 12px; }
  .day-num { font-size: 2.2rem; }
  .day-week { font-size: 1rem; }
  .t-start { font-size: .98rem; }
  .stop-pin { width: 28px; height: 28px; }
  .here-word { display: none; }
  .rt-row { grid-template-columns: 1fr 1fr; }
  .rt-row .rt-field:first-child { grid-column: 1 / -1; }
  .rt-overlay { place-items: end center; padding: 0; }
  .rt-modal {
    width: 100%; max-height: 92svh;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(1.1rem + env(safe-area-inset-bottom));
    animation: sheet-up .25s cubic-bezier(.2, .8, .2, 1);
  }
  .rt-modal-acts { padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); }
  .rt .toast { bottom: calc(5rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .here, .road-done { transition: none; }
  .here.is-live::before { animation: none; }
  .rt-modal, .rt-menu--sheet { animation: none; }
}

@media print {
  .rt-actions, .daynav, .now-pill, .cover-more, .day-more, .stop-edit, .add-stop, .route-end, .here, .check-del, .check-add, .grain { display: none !important; }
  body { background: #fff !important; }
  .trip-main { box-shadow: none; border: none; }
  .trip-body { display: block; }
  .stop { break-inside: avoid; }
}

/* ===========================================================================
   LANDING (/roteirinhos) and "meus roteiros"
   ========================================================================= */
.rt-landing { color: var(--on-desk, #f0e6cf); }
.rt-land {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 1.7rem) 0 0;
}
.rt-land-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rt-land-top .brand { font-size: 1.5rem; }
.rt-land-top .brand-name { color: var(--on-desk, #fbeecb); }
.rt-land-top .brand-by { color: var(--on-desk-faint, #b89a6e); }
.rt-land-nav { display: flex; align-items: center; gap: .3rem 1.2rem; flex-wrap: wrap; }
.rt-land-nav a {
  font-family: var(--font-sign); font-weight: 700; font-size: .92rem;
  color: var(--on-desk-soft, #cdbf9c); text-decoration: none;
}
.rt-land-nav a:hover { color: var(--on-desk, #f4ead2); }
.rt-land-nav .rt-icon { color: var(--on-desk-soft, #cdbf9c); }

.rt-hero {
  display: grid; grid-template-columns: 1fr minmax(0, 430px);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(2.4rem, 6vw, 4.4rem);
}
.rt-hero h1 {
  margin: 0;
  font-family: var(--font-sign); font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: .98; letter-spacing: -.03em;
  color: var(--on-desk, #fbeecb);
  max-width: 14ch;
}
.rt-hero .lede {
  margin: 1.2rem 0 0; max-width: 44ch;
  font-size: 1.12rem; line-height: 1.6;
  color: var(--on-desk-soft, #d3c7a8);
}

/* the "start a trip" form is a ticket: where to, and when */
.rt-start {
  display: grid; grid-template-columns: 1fr 1fr; gap: .7rem .7rem;
  margin-top: 1.8rem; max-width: 30rem;
  padding: 1rem;
  background: var(--rt-paper, #eff0ea); color: var(--rt-ink, #1b2622);
  border-radius: 10px;
  box-shadow: var(--rt-shadow);
}
.rt-start .rt-field { margin: 0; }
.rt-start .rt-field--wide { grid-column: 1 / -1; }
.rt-start .rt-btn { grid-column: 1 / -1; }
.rt-start-alt {
  display: flex; align-items: center; gap: .3rem 1rem; flex-wrap: wrap;
  margin-top: .9rem;
  font-size: .95rem; color: var(--on-desk-soft, #cdbf9c);
}
.rt-start-alt form { margin: 0; display: inline; }
.rt-start-alt button {
  padding: .3em 0; background: none; border: none; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--on-desk, #f4ead2);
  text-decoration: underline; text-underline-offset: 3px;
}

/* the prop: a piece of the strip, showing the arrow in the middle of a day */
.rt-prop { transform: rotate(1.6deg); }
.rt-prop .strip {
  pointer-events: none;
  background: var(--rt-paper); color: var(--rt-ink);
  border: 1px solid var(--rt-rule); border-radius: 14px; box-shadow: var(--rt-shadow);
  overflow: clip;
}
.rt-prop .stop { padding-block: .65rem; }
.rt-prop .here { transition: none; }

.rt-points {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 2.4rem);
  padding: clamp(1.6rem, 5vw, 2.8rem) 0;
  border-top: 1px solid var(--desk-line, rgba(255, 255, 255, .1));
}
.rt-points h3 { margin: 0 0 .35rem; font-family: var(--font-sign); font-weight: 800; font-size: 1.12rem; color: var(--on-desk, #f4ead2); }
.rt-points p { margin: 0; color: var(--on-desk-soft, #c9bc9c); font-size: .98rem; line-height: 1.55; }

.rt-ai-band {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem, 4vw, 3rem); align-items: center;
  padding: clamp(1.8rem, 5vw, 3rem) 0;
  border-top: 1px solid var(--desk-line, rgba(255, 255, 255, .1));
}
.rt-ai-band h2 { margin: 0 0 .7rem; font-family: var(--font-sign); font-weight: 900; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.05; letter-spacing: -.02em; color: var(--on-desk, #fbeecb); }
.rt-ai-band p { margin: 0 0 .8rem; color: var(--on-desk-soft, #c9bc9c); line-height: 1.6; max-width: 46ch; }
.rt-term {
  margin: 0; padding: 1rem 1.1rem;
  font-family: var(--font-code); font-size: .8rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  color: #dfe7e1; background: #17201c; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.rt-term .c { color: #7f9187; }
.rt-term .k { color: var(--rt-road, #f1b72c); }

.rt-land .studio-foot, .rt-land-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1rem;
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--desk-line, rgba(255, 255, 255, .1));
  font-family: var(--font-sign); font-weight: 600; font-size: .86rem;
  color: var(--on-desk-faint, #a99c7e);
}
.rt-land-foot a { color: var(--on-desk-soft, #cdbf9c); text-decoration: none; }
.rt-land-foot a:hover { color: var(--on-desk, #f4ead2); }

.rt-mine { list-style: none; margin: 0; padding: .4rem var(--pad) 1.2rem; }
.rt-mine li + li { border-top: 1px solid var(--rt-rule); }
.rt-mine a {
  display: grid; grid-template-columns: auto 1fr; gap: .1rem 1rem; align-items: center;
  padding: .85rem 0; text-decoration: none; color: var(--rt-ink);
}
.rt-mine-date { grid-row: span 2; font-family: var(--font-sign); font-weight: 900; font-size: 1.9rem; line-height: .9; min-width: 2.6ch; text-align: right; }
.rt-mine-name { font-family: var(--font-sign); font-weight: 800; font-size: 1.1rem; }
.rt-mine-meta { font-size: .88rem; color: var(--rt-ink-soft); }
.rt-mine a:hover .rt-mine-name { text-decoration: underline; text-underline-offset: 3px; }
.rt-empty { padding: 1rem var(--pad) 1.6rem; color: var(--rt-ink-soft); }

@media (max-width: 860px) {
  .rt-hero { grid-template-columns: 1fr; }
  .rt-prop { max-width: 460px; }
  .rt-points { grid-template-columns: 1fr; }
  .rt-ai-band { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .rt-land { width: min(1080px, 100% - 1.6rem); }
  .rt-start { grid-template-columns: 1fr 1fr; padding: .85rem; }
  .rt-prop { transform: none; margin-inline: -.2rem; }
}
