/* App shell */
.frame {
  margin-inline: auto;
  max-inline-size: 100rem;
  padding-inline: calc(var(--gutter) + var(--safe-start)) calc(var(--gutter) + var(--safe-end));
}
.workspace, .rail { min-inline-size: 0; }
.rail { display: contents; }
.brand.rail-brand, .rail-note, .top-context { display: none; }
.topbar, #nav {
  border: 1px solid var(--edge);
  border-radius: 22px;
  background: var(--chrome-solid);
  box-shadow: var(--chrome-shadow);
  -webkit-backdrop-filter: var(--lens-filter, var(--chrome-filter));
  backdrop-filter: var(--lens-filter, var(--chrome-filter));
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .topbar, #nav { background: var(--chrome-background); }
}
.topbar::before, #nav::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid #fff3ff16;
  background: radial-gradient(ellipse 90px 45px at var(--shine-x, 24%) var(--shine-y, 0%), #ffd1ee3a, transparent),
    linear-gradient(147deg, #ffffff0c, transparent 45%, #efb8ff07);
  pointer-events: none;
}
.topbar {
  position: sticky;
  z-index: 20;
  top: calc(var(--safe-top) + 7px);
  min-block-size: var(--header-height);
  margin-block-start: calc(var(--safe-top) + 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: 5px 6px 5px 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-inline-size: 0;
  line-height: 1.1;
}
.brand-mark { display: block; flex: 0 0 auto; }
.brand strong, .brand small { display: block; white-space: nowrap; }
.brand strong { font-family: var(--display); font-size: 1.12rem; font-weight: 780; letter-spacing: -.025em; }
.brand small { margin-block-start: .18rem; color: #efb4d5; font-size: .77rem; font-weight: 700; }
.settings-button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: .52rem .8rem;
  border: 1px solid var(--edge-soft);
  border-radius: 13px;
  background: #ffd9f416;
  font-weight: 700;
  font-size: .91rem;
  line-height: 1.2;
  transition: background-color .17s, border-color .17s, transform .18s var(--spring);
}
.settings-button { flex: 0 0 auto; }
.settings-button:hover, .btn:hover { background: #ffd5f32b; }
.settings-button:active, .btn:active { transform: scale(.96); }
.settings-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; }
.settings-button span { display: none; }
.btn.primary { color: #26182b; background: var(--vi); border-color: #ffd2ec84; }

#nav {
  position: fixed;
  z-index: 25;
  inset-inline: max(.5rem, var(--safe-start)) max(.5rem, var(--safe-end));
  inset-block-end: calc(var(--safe-bottom) + 8px);
  margin-inline: auto;
  max-inline-size: 36rem;
  min-block-size: 58px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 5px;
}
#nav .pill {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--pill-width, 0px);
  height: var(--pill-height, 0px);
  transform: translate(var(--pill-x, 0px),var(--pill-y, 0px));
  border-radius: 16px;
  border: 1px solid #ffceeb65;
  background: linear-gradient(152deg, #ad618dba, #574787cf);
  box-shadow: inset 0 1px #ffe1f055, 0 2px 12px #0b091d3d;
  pointer-events: none;
  transition: transform .32s var(--spring), width .31s var(--spring), height .31s var(--spring);
}
#nav[data-measuring] .pill { transition: none; }
.tab {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-inline-size: 0;
  min-block-size: 49px;
  padding: .25rem .1rem;
  border-radius: 15px;
  color: var(--text-2);
  font-size: .7rem;
  line-height: 1.2;
  transition: color .18s, background-color .18s;
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; transition: transform .28s var(--spring-bounce); }
.tab span { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.on, .tab[aria-current="page"] { color: #fff7fc; font-weight: 770; }
.tab.on svg { transform: translateY(-1px) scale(1.07); }
.tab:active svg { transform: scale(.86); }
.tab:hover { background: #fff1fa12; }
html[data-keyboard="open"] #nav { visibility: hidden; }

.scroll {
  min-inline-size: 0;
  padding-block: clamp(1.15rem, 3vw, 2rem) calc(var(--dock-height) + var(--safe-bottom) + 1.5rem);
}
html[data-keyboard="open"] .scroll { padding-block-end: calc(var(--safe-bottom) + 1.25rem); }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .65rem;
  margin: 0 0 clamp(.9rem, 2.5vw, 1.4rem);
}
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.055em; font-weight: 770; }
.page-heading .sub { color: var(--text-3); font-size: .94rem; margin-block-start: .3rem; }
.page-heading :is(.vmark,.more,.spacer,[data-sheet]) { display: none; }
.notice { padding: 1rem; }

/* Início */
.home-layout { display: grid; min-inline-size: 0; gap: clamp(.85rem, 2.4vw, 1.4rem); }
.hero.hero-home {
  min-block-size: clamp(22rem, 48vw, 29rem);
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  padding: clamp(1.2rem, 3.2vw, 2.25rem);
  margin: 0;
  border-radius: clamp(20px, 3vw, 30px);
  border-color: #f7b4dc5e;
  background: linear-gradient(180deg, #19122600 16%, #1a102375 44%, #130f1ff2 96%),
    linear-gradient(90deg, #1a10246b, transparent 78%),
    #271a32 url("../assets/coast-twilight.jpg") 56% 48% / cover no-repeat;
  box-shadow: inset 0 1px #fff1f356, 0 21px 52px #08050d45;
}
.hero-content { min-inline-size: 0; max-inline-size: 42rem; }
.hero-kicker {
  color: #ffd2df;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .107em;
  text-transform: uppercase;
}
.hero .hero-title {
  max-inline-size: 16ch;
  margin-block: .6rem .45rem;
  font-size: clamp(2.35rem, 4.6vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: .98;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 17px #0d051d8a;
}
.hero .hero-copy { color: #f0dce9; font-size: .98rem; line-height: 1.45; max-inline-size: 42ch; }
.hero .hero-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-block-start: 1.15rem; }
.hero .cta {
  margin: 0;
  min-block-size: 47px;
  color: #241629;
  padding: .65rem 1rem;
  border: 1px solid #ffe1eca3;
  font-size: .91rem;
  white-space: normal;
}
.hero .cta svg { stroke: currentColor; }
.hero-progress {
  position: absolute;
  z-index: 1;
  inset: .9rem .9rem auto auto;
  padding: .45rem;
  border-radius: 50%;
  border: 1px solid #ffc6dd60;
  background: #20162a83;
  box-shadow: inset 0 1px #fcd9ed30;
}
.hero-progress .ring { width: 70px !important; height: 70px !important; }
.hero-progress .ring svg { width: 100%; height: 100%; }
.hero-progress .ring .val b { font-size: 1.2rem; }
.hero-progress .ring .val small { font-size: .64rem; color: #f3d6e5; }

.home-overview {
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-l);
  padding: clamp(.85rem, 2.2vw, 1.25rem);
  background: linear-gradient(156deg, #342640b7, #201b30ab);
}
.home-overview > .slabel { margin: .15rem 0 .85rem; }
.home-overview > :is(h2,h3) { margin-block-end: .85rem; font-size: 1.15rem; }
.home-overview .quick { margin: 0; gap: .55rem; }
.qcard { min-inline-size: 0; min-block-size: 7.15rem; padding: .75rem; }
.qcard .ql { font-size: .84rem; color: var(--text-2); }
.qcard .qv { display: flex; flex-wrap: wrap; align-items: baseline; gap: .12rem .22rem; font-size: clamp(1.45rem, 3vw, 2rem); color: var(--text); }
.qcard .qv small { font-size: .77rem; font-weight: 650; letter-spacing: 0; color: var(--text-3); }
.qcard .bar { margin-block-start: .5rem; }
.home-followup { min-inline-size: 0; margin-block-start: clamp(.85rem, 2vw, 1.4rem); }
.home-followup > * { min-inline-size: 0; }
.map-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
  padding: 1rem;
  text-align: start;
}
.map-card .ico { flex-shrink: 0; color: #271b37; }
.map-title, .map-copy .nums { display: block; }
.map-title { font-weight: 760; line-height: 1.25; }
.map-copy { flex: 1 1 10rem; }
.map-copy p { font-size: .87rem; color: var(--text-3); }
.guide-footer, p.foot { margin-block-start: 1.2rem; max-inline-size: 70ch; color: var(--text-3); font-size: .83rem; }

/* Reflow and touch targets for the retained screens */
.slabel { margin-block: 1.35rem .7rem; }
.slabel h3 { font-size: 1.13rem; }
.slabel .act, .slabel a { font-size: .86rem; }
.slabel > * { min-inline-size: 0; overflow-wrap: anywhere; }
.slabel > :last-child { text-align: end; }
.bar > span::after { animation: none; }
.journey { margin-inline: -.15rem; }
.chap { flex-basis: clamp(9.75rem, 23vw, 12rem); }
.chap h4 { font-size: .98rem; }
.chap .zone { white-space: normal; font-size: .8rem; }
.chap .dot, .chap .pc, .focus .tag { font-size: .73rem; }
.focus .cut { flex-wrap: wrap; }
.focus p, .note, .focus .cut { font-size: .93rem; }
.focus .reveal, .reveal { min-block-size: 38px; font-size: .85rem; }
.search { min-block-size: 48px; }
.search input { min-inline-size: 0; font-size: 1rem; }
.search:focus-within { outline: 2px solid #ffc4df; outline-offset: 2px; }
.chip { min-block-size: 42px; font-size: .875rem; }
.chip.on, .chip[aria-pressed="true"] { border-color: #eaa2d187; }
.mode-control, .chapter-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.mode-control { margin-block: .8rem 1.15rem; }
.mode-control .chip { border-radius: 13px; }

.grid.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); align-items: stretch; }
.grid > *, .collect .top > *, .item .body, .mk .body, .goal .gh > * { min-inline-size: 0; }
.collect, .goal { padding: clamp(.8rem, 2.3vw, 1.1rem); }
.collect h4, .item .nm, .mk .nm, .goal .gh b { font-size: .98rem; overflow-wrap: anywhere; }
.collect .nums, .mk .ds, .item .ds, .goal .gs { font-size: .875rem; line-height: 1.53; max-inline-size: 73ch; }
.collect .foot { gap: .35rem .65rem; }
.collect .link {
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: .4rem;
  font-size: .85rem;
}
.stepper { gap: .35rem; }
.stepper button { width: 43px; height: 44px; }
.stepper input { width: 52px; height: 44px; font-size: 1rem; }
.goal .gc { flex-wrap: wrap; }
.goal .gc input { width: 70px; height: 44px; font-size: 1rem; }
.goal .gc .mx { min-block-size: 44px; }
.item, .mk { gap: .75rem; padding: .9rem; }
.item .check { width: 43px; height: 43px; border-radius: 12px; }
.item :is(.loc,.tags), .mk small { font-size: .8rem; overflow-wrap: anywhere; }
.item .tags { flex-wrap: wrap; }
.mk input.hide { display: block !important; position: absolute; inset: auto; width: 1px; height: 1px; opacity: 0; }
.mk:has(input:focus-visible) { outline: 2px solid #ffc4df; outline-offset: 3px; }
.notes textarea { font-size: 1rem; }
.alert { flex-wrap: wrap; }
.alert > div:nth-child(2) { flex: 1 1 8.6rem; }
.alert b { font-size: .97rem; }
.alert p { font-size: .86rem; }
.alert .go { min-block-size: 40px; font-size: .86rem; }

/* Settings and feedback */
.sheet, .modal-bg {
  position: fixed;
  color: var(--text);
  border: 1px solid var(--edge);
  background: #2a2139;
  box-shadow: 0 24px 72px #05030aa0, inset 0 1px #f9d4f231;
  padding: 0;
}
.sheet::backdrop, .modal-bg::backdrop { background: #090610aa; }
.sheet[open], .modal-bg[open] { animation: sheet-in .25s var(--spring) both; }
@keyframes sheet-in { from { opacity: .55; scale: .98; } to { opacity: 1; scale: 1; } }
.sheet {
  inset: auto 0 calc(var(--safe-bottom) + 4px);
  margin: 0 auto;
  inline-size: min(37rem, calc(100% - 1.2rem - var(--safe-start) - var(--safe-end)));
  max-block-size: calc(var(--visual-height) - var(--safe-top) - var(--safe-bottom) - 1rem);
  border-radius: 24px;
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
html[data-keyboard="open"] .sheet {
  inset-block-start: calc(var(--visual-viewport-top, 0px) + max(6px, var(--safe-top)));
  inset-block-end: auto;
  margin-block: 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .85rem 1rem;
  border-block-end: 1px solid var(--edge-soft);
}
.sheet-head :is(button,.btn) { min-inline-size: 44px; flex: 0 0 auto; }
.sheet-head :is(h2,h3) { font-size: clamp(1.12rem, 5vw, 1.36rem); overflow-wrap: anywhere; }
.sheet-head p { margin-block-start: .25rem; color: var(--text-3); font-size: .84rem; }
.icon-btn {
  min-block-size: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--edge-soft);
  background: #ffd9f416;
}
:is(.btn, .icon-btn, .setting-row .si, .map-card .ico) svg {
  width: 19px; height: 19px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.sheet-body {
  min-block-size: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: .85rem 1rem 1rem;
  scrollbar-gutter: stable;
}
.settings-group { margin-block: 0 1rem; min-inline-size: 0; }
.settings-group > :is(h2,h3,h4,legend) { margin-block: .35rem .5rem; font-size: 1.02rem; }
.setting-row, .srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-block-size: 49px;
  padding: .65rem .6rem;
  border-block-end: 1px solid var(--edge-soft);
  overflow-wrap: anywhere;
}
.setting-row > :first-child, .srow > :first-child { min-inline-size: 0; }
.setting-row :is(button,.switch), .srow :is(button,.switch) { flex: 0 0 auto; }
.setting-row .si { display: grid; place-items: center; inline-size: 34px; block-size: 34px; flex: 0 0 34px; border-radius: 11px; background: #f4cbf408; color: #ecafcf; }
.setting-copy { flex: 1 1 auto; min-inline-size: 0; }
.setting-copy > span { display: block; margin-block-start: .12rem; color: var(--text-3); font-size: .82rem; }
.sheet .switch { cursor: pointer; }
.setting-row p, .setting-row small, .srow p { color: var(--text-3); font-size: .82rem; }
.setting-row :is(b,strong), .srow b { font-size: .94rem; }
.settings-group .switch:has(:focus-visible) { outline: 2px solid #ffc4df; outline-offset: 3px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .65rem; }
.cloud-form { display: grid; gap: .45rem; margin-block-start: .7rem; }
.cloud-form input {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  padding-inline: .65rem;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #100e19aa;
  color: var(--text);
  font: inherit;
}
.backup-entry { display: grid; gap: .55rem; margin-block: .65rem; }
.backup-entry summary { cursor: pointer; min-block-size: 40px; padding-block: .5rem; color: var(--gold); }
.backup-entry :is(label,textarea) { display: block; margin-block-end: .55rem; }
.backup-entry textarea, #backupText {
  min-inline-size: 0;
  inline-size: 100%;
  min-block-size: 5rem;
  resize: vertical;
  color: var(--text);
  background: #100e19aa;
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: .6rem;
  font-size: 1rem;
}
.sheet .res { margin-block: .45rem; }
.modal-bg {
  inset: 0;
  margin: auto;
  inline-size: min(28rem, calc(100% - 2rem - var(--safe-start) - var(--safe-end)));
  max-block-size: calc(var(--visual-height) - 1rem);
  border-radius: 21px;
  overflow: auto;
}
html[data-keyboard="open"] .modal-bg { inset-block: calc(var(--visual-viewport-top, 0px) + max(8px, var(--safe-top))) auto; }
.modal { padding: clamp(1rem, 4vw, 1.5rem); }
.modal h2 { font-size: 1.3rem; margin-block-end: .65rem; }
.modal p { color: var(--text-2); font-size: .95rem; }
.mrow { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; margin-block-start: 1.2rem; }

#toast {
  position: fixed;
  z-index: 60;
  inset-inline: max(.5rem,var(--safe-start)) max(.5rem,var(--safe-end));
  inset-block-end: calc(var(--dock-height) + var(--safe-bottom) + 1rem);
  margin-inline: auto;
  max-inline-size: 29rem;
  inline-size: max-content;
  max-width: calc(100vw - 1.2rem);
  padding: .68rem .9rem;
  border-radius: 13px;
  border: 1px solid var(--edge);
  background: #3c2c48;
  color: var(--text);
  font-size: .92rem;
  box-shadow: 0 12px 42px #07051078;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s, transform .25s var(--spring);
}
#toast.show { opacity: 1; transform: none; }
html[data-keyboard="open"] #toast { inset-block-end: auto; inset-block-start: calc(var(--visual-viewport-top, 0px) + max(8px,var(--safe-top))); }

@media (min-width: 25.5rem) { .settings-button span { display: inline; } }
@media (max-width: 30rem) {
  .page-heading { flex-direction: column; align-items: flex-start; gap: .28rem; }
}
@media (max-width: 19.25rem) {
  .tab span { display: none; }
  .topbar { --header-height: 54px; }
  .hero .hero-title { font-size: 2.05rem; }
  .hero.hero-home { min-block-size: 22rem; }
  .setting-row, .srow { gap: .45rem; padding-inline: .25rem; }
  .setting-row .si { display: none; }
}
@media (min-width: 43rem) {
  #nav { gap: 4px; padding: 6px; }
  .tab { min-block-size: 52px; font-size: .79rem; }
  .sheet { inset: 0; margin: auto; max-block-size: min(45rem, calc(var(--visual-height) - 2rem - var(--safe-top) - var(--safe-bottom))); }
  .home-layout { grid-template-columns: minmax(0, 1.8fr) minmax(15rem, 1fr); align-items: stretch; }
  .home-overview { display: flex; flex-direction: column; }
  .home-overview .quick { flex: 1; grid-auto-rows: 1fr; }
  .hero-progress .ring { width: 83px !important; height: 83px !important; }
}
@media (max-height: 31rem) and (orientation: landscape) and (max-width: 61.99rem) {
  :root { --dock-height: 52px; --header-height: 49px; }
  #nav { padding-block: 3px; min-block-size: 0; max-inline-size: 27rem; }
  #nav .tab { min-block-size: 43px; gap: 0; }
  #nav .tab span { font-size: .67rem; }
  .topbar { margin-block-start: calc(var(--safe-top) + 4px); }
}
@media (min-width: 62rem) {
  .frame { display: grid; grid-template-columns: clamp(11rem, 14vw, 14rem) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.6rem); }
  .rail {
    position: sticky;
    top: calc(var(--safe-top) + 18px);
    display: flex;
    flex-direction: column;
    align-self: start;
    gap: 1.1rem;
    min-block-size: min(39rem, calc(100dvh - 2.5rem - var(--safe-top) - var(--safe-bottom)));
    margin-block-start: calc(var(--safe-top) + 18px);
  }
  .brand.rail-brand { display: flex; padding-inline: .5rem; min-block-size: var(--header-height); }
  .rail-brand strong { font-size: 1.3rem; }
  .rail-note { display: grid; margin-block-start: auto; gap: .18rem; padding: .85rem .5rem; color: var(--text-2); font-size: .84rem; }
  .rail-note small { color: var(--text-3); }
  .topbar { top: calc(var(--safe-top) + 12px); margin-block-start: calc(var(--safe-top) + 18px); padding-inline: 1rem 6px; }
  .top-brand { display: none; }
  .top-context { display: inline; font-size: .91rem; color: var(--text-2); }
  #nav { position: relative; inset: auto; display: flex; flex-direction: column; margin: 0; max-inline-size: none; gap: .23rem; padding: .42rem; }
  #nav .tab { display: flex; justify-content: flex-start; align-items: center; gap: .65rem; padding-inline: .62rem; min-block-size: 49px; font-size: .91rem; text-align: start; }
  html[data-keyboard="open"] #nav { visibility: visible; }
  .scroll { padding-block-end: 2rem; }
  #toast { inset-block-end: 1rem; }
  .home-layout { grid-template-columns: minmax(0, 1.9fr) minmax(14rem, 1fr); }
  .hero.hero-home { min-block-size: clamp(22rem, 31vw, 28rem); }
  .home-followup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .85rem; }
  .home-followup > .guide-footer, .home-followup > :is(.slabel,.foot) { grid-column: 1 / -1; }
  .home-followup .alert { margin: 0; }
}

html[data-effects="reduced"] :is(.topbar,#nav) {
  background: var(--chrome-solid);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-effects="reduced"] :is(.topbar,#nav)::before { background: none; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root { --glass-card: #30273d; --edge-soft: #d1aac55c; }
  :is(.topbar,#nav) { background: var(--chrome-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

