:root {
  --green: #0c4a34;
  --green-soft: #1f7a55;
  --cream: #f6f1e7;
  --ink: #1c1b19;
  --muted: #6e6b63;
  --past: #8f8c84;
  --red: #b91c1c;
  --red-soft: rgba(185, 28, 28, 0.12);
  --white: #fffcf7;
  --line: rgba(12, 74, 52, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px rgba(12, 74, 52, 0.1);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -5%, rgba(31, 122, 85, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(185, 28, 28, 0.08), transparent 50%),
    linear-gradient(180deg, #eaf3ee 0%, var(--cream) 45%, #efe6d8 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.app {
  min-height: 100dvh;
  padding-bottom: calc(1.25rem + var(--safe-bottom));
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.boot {
  padding: 2rem 1.25rem;
  color: var(--muted);
}

/* —— Brand strip —— */
.app-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: calc(0.65rem + var(--safe-top)) max(1rem, var(--safe-right)) 0.65rem max(1rem, var(--safe-left));
  background: rgba(246, 241, 231, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.flag {
  display: flex;
  width: 2.1rem;
  height: 1.35rem;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.flag span {
  flex: 1;
}

.flag span:nth-child(1) {
  background: #009246;
}
.flag span:nth-child(2) {
  background: #fff;
}
.flag span:nth-child(3) {
  background: #ce2b37;
}

.app-top-brand {
  min-width: 0;
  flex: 1;
}

.app-top-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--green);
  line-height: 1.1;
}

.app-top-brand small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-top-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.app-top-home {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.app-top-home:active {
  opacity: 0.82;
}

/* —— Login —— */
.login-view {
  padding: calc(1.5rem + var(--safe-top)) max(1.15rem, var(--safe-right)) 2rem max(1.15rem, var(--safe-left));
  max-width: 22rem;
  margin: 0 auto;
  animation: fadeIn 0.35s ease;
}

.login-view .brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 700;
  color: var(--green);
  margin: 0.85rem 0 0.35rem;
  line-height: 1.05;
}

.login-view .tagline {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

.login-view .subtitle {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.35;
}

.app-build {
  margin: 1.75rem auto 0.5rem;
  padding: 0 max(1.15rem, var(--safe-right)) calc(0.85rem + var(--safe-bottom)) max(1.15rem, var(--safe-left));
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.85;
}

.login-view .app-build {
  margin-top: 2rem;
  padding-left: 0;
  padding-right: 0;
}

.login-form {
  display: grid;
  gap: 0.85rem;
}

.login-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pin-input {
  width: 100%;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.85rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.login-error,
.login-warn {
  margin: 0;
  font-size: 0.9rem;
  color: var(--red);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.sync-missing {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.85rem;
  background: rgba(185, 28, 28, 0.06);
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink);
}

.sync-missing strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--red);
}

.sync-missing ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* —— Home —— */
.home {
  padding: 1rem max(1.15rem, var(--safe-right)) 2rem max(1.15rem, var(--safe-left));
  animation: fadeIn 0.35s ease;
}

.home-hero {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  min-height: 11rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
  background:
    linear-gradient(135deg, rgba(12, 74, 52, 0.82), rgba(185, 28, 28, 0.35)),
    #0c4a34;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.home-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: 1.05;
}

.home-hero p {
  margin: 0.35rem 0 0;
  opacity: 0.92;
  font-size: 0.95rem;
}

.day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.docs-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid rgba(31, 122, 85, 0.28);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 14px rgba(12, 74, 52, 0.07);
  transition: transform 0.15s ease;
}

.docs-entry:active {
  transform: scale(0.985);
}

.docs-entry-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.docs-entry-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.docs-entry-text strong {
  font-size: 0.98rem;
  color: var(--green);
}

.docs-entry-text span {
  font-size: 0.82rem;
  color: var(--muted);
}

.docs-entry-chevron {
  font-size: 1.35rem;
  color: var(--muted);
  opacity: 0.65;
}

/* —— Waypoints —— */
.waypoints-view {
  padding-bottom: 2rem;
}

.waypoint-tools {
  position: sticky;
  top: calc(3.1rem + var(--safe-top));
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin: 0 -0.25rem 1rem;
  padding: 0.7rem 0.25rem;
  background: rgba(246, 241, 231, 0.96);
  backdrop-filter: blur(10px);
}

.waypoint-tools label {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.waypoint-tools input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 0.9rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.waypoint-tools input:focus {
  outline: 2px solid rgba(31, 122, 85, 0.3);
  border-color: var(--green-soft);
}

.waypoint-tools span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.waypoint-day {
  margin-bottom: 1.35rem;
}

.waypoint-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.waypoint-day-head h2 {
  margin: 0;
  color: var(--green);
  font-family: var(--font-display);
  font-size: 1.02rem;
}

.waypoint-day-head span {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.waypoint-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.waypoint-card {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 247, 0.82);
}

.waypoint-card[hidden],
.waypoint-day[hidden] {
  display: none;
}

.waypoint-main {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}

.waypoint-main strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.waypoint-address {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.waypoint-meta {
  color: var(--green-soft);
  font-size: 0.68rem;
  font-weight: 700;
}

.waypoint-open {
  flex-shrink: 0;
  padding: 0.45rem 0.62rem;
  border: 1px solid rgba(31, 122, 85, 0.2);
  border-radius: 999px;
  background: rgba(31, 122, 85, 0.09);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.waypoint-empty {
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* —— Alimentação —— */
.alim-note {
  font-size: 0.85rem !important;
}

.alim-day {
  margin-bottom: 1.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(12, 74, 52, 0.12);
}

.alim-day:last-child {
  border-bottom: none;
}

.alim-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.55rem;
}

.alim-day-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--green);
}

.alim-day-link {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
}

.meal-block {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 252, 247, 0.85);
  border: 1px solid rgba(31, 122, 85, 0.16);
  border-radius: var(--radius);
}

.meal-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

.meal-skip {
  margin: 0 0 0.4rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.meal-sug {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-bottom: 0.5rem;
  font-size: 0.86rem;
  line-height: 1.35;
}

.meal-sug:last-child {
  margin-bottom: 0;
}

.meal-sug-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
}

.meal-option {
  color: var(--green);
}

.meal-map {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.meal-addr {
  color: var(--muted);
  font-size: 0.8rem;
}

.meal-price {
  font-weight: 600;
  color: var(--green);
  font-size: 0.84rem;
}

.meal-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* —— Documentos —— */
.docs-view {
  padding: 1rem max(1.15rem, var(--safe-right)) 2rem max(1.15rem, var(--safe-left));
  animation: fadeIn 0.35s ease;
}

.docs-head {
  margin-bottom: 1rem;
}

.docs-back {
  display: inline-block;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
  color: var(--green);
  text-decoration: none;
}

.docs-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  line-height: 1.1;
}

.docs-head p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.doc-section {
  margin-bottom: 1.25rem;
}

.doc-section h2 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.doc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
  background: rgba(255, 252, 247, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
}

.doc-row-main {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  min-width: 0;
}

.doc-status {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: var(--muted);
  opacity: 0.45;
}

.doc-row.is-local .doc-status {
  background: #178a4b;
  opacity: 1;
}

.doc-row.is-missing .doc-status {
  background: #c9a227;
  opacity: 1;
}

.doc-row.is-pending .doc-status {
  background: #8a8a8a;
  opacity: 1;
}

.btn-doc-open.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  font-size: 0.68rem;
}

.doc-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.doc-label {
  font-size: 0.92rem;
  line-height: 1.25;
}

.doc-who {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  width: fit-content;
}

.doc-who-andre {
  background: rgba(12, 74, 52, 0.1);
  color: var(--green);
}

.doc-who-patricia {
  background: rgba(185, 28, 28, 0.08);
  color: var(--red);
}

.doc-who-both {
  background: rgba(31, 122, 85, 0.1);
  color: var(--green-soft);
}

.doc-days {
  font-size: 0.78rem;
  color: var(--muted);
}

.doc-days a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

.doc-days-none {
  font-style: italic;
}

.doc-status-text {
  font-size: 0.72rem;
  color: var(--muted);
}

.btn-doc-open {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 0.38rem 0.6rem;
}

.doc-row-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-shrink: 0;
}

.btn-share {
  flex-shrink: 0;
  padding: 0.38rem;
  line-height: 0;
  color: var(--green);
  background: rgba(31, 122, 85, 0.08);
  border-color: rgba(31, 122, 85, 0.22);
}

.btn-share .icon-share {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.proof-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.day-link {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 0.75rem;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 252, 247, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(12, 74, 52, 0.05);
  transition: transform 0.15s ease;
}

.day-link:active {
  transform: scale(0.985);
}

.day-link.is-today {
  border-color: rgba(31, 122, 85, 0.45);
  box-shadow: 0 6px 18px rgba(31, 122, 85, 0.12);
}

.day-thumb {
  background-size: cover;
  background-position: center;
  min-height: 4.2rem;
}

.day-meta {
  padding: 0.7rem 0.75rem 0.7rem 0;
}

.day-meta strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.day-meta span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.today-pill {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-soft);
  background: rgba(31, 122, 85, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

/* —— Day —— */
.day-view {
  animation: fadeIn 0.3s ease;
  touch-action: pan-y;
}

.day-nav {
  display: grid;
  grid-template-columns: 2.6rem 1fr 2.6rem;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem max(0.5rem, var(--safe-right)) 0.55rem max(0.5rem, var(--safe-left));
  background: rgba(246, 241, 231, 0.9);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: calc(3.1rem + var(--safe-top));
  z-index: 25;
}

.nav-btn {
  appearance: none;
  border: none;
  background: rgba(12, 74, 52, 0.06);
  color: var(--green);
  font-size: 1.4rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  cursor: pointer;
}

.nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.nav-center {
  text-align: center;
  min-width: 0;
}

.nav-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 3.5vw, 1.1rem);
  color: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-hero {
  margin: 0.85rem max(1rem, var(--safe-right)) 0.75rem max(1rem, var(--safe-left));
  border-radius: var(--radius);
  min-height: 7.5rem;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.day-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 74, 52, 0.15), rgba(12, 74, 52, 0.72));
}

.day-hero-caption {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.75rem;
  z-index: 1;
  color: #fff;
}

.day-hero-caption strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.day-hero-caption span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 0.15rem;
}

.day-body {
  padding: 0.25rem max(1rem, var(--safe-right)) 5rem max(1rem, var(--safe-left));
}

.day-route {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.day-intro,
.day-costs {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.day-reminders {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  background: rgba(180, 60, 40, 0.08);
  border: 1px solid rgba(180, 60, 40, 0.2);
}

.day-reminders h2 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a3b2e;
}

.day-reminders ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.day-reminders li p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.reminder-links a {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.plan-chooser {
  margin: 0 0 1rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: rgba(31, 122, 85, 0.06);
  border: 1px solid rgba(31, 122, 85, 0.18);
}

.plan-question {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.plan-panel {
  margin-top: 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.plan-panel.is-active {
  background: rgba(31, 122, 85, 0.14);
  border-color: rgba(31, 122, 85, 0.55);
  box-shadow: 0 0 0 1px rgba(31, 122, 85, 0.12);
}

.plan-panel.is-inactive {
  opacity: 0.48;
}

.plan-panel.is-inactive .plan-panel-head,
.plan-panel.is-inactive .plan-panel-body {
  color: var(--past);
}

.plan-panel-head {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.plan-chevron {
  display: inline-block;
  width: 1rem;
}

.plan-panel.is-active .plan-panel-head {
  color: var(--green);
}

.plan-panel-body {
  padding: 0 0.65rem 0.65rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

.day-costs {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 3.2rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--line);
}

.item {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.8rem;
  padding: 0.75rem 0;
  position: relative;
}

.item-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--green);
  text-align: right;
  padding-top: 0.2rem;
}

.item-timeless .item-time {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.item-dot {
  position: absolute;
  left: 3rem;
  top: 1.05rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green-soft);
  border: 2px solid var(--cream);
  z-index: 1;
}

.item-main {
  min-width: 0;
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem 0.75rem;
}

.item-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.item-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.item-note {
  margin: 0.4rem 0 0;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.4;
}

.item-note .map-pin {
  display: inline;
  text-decoration: none;
  font-weight: 700;
  color: var(--green);
  border-bottom: 1px dashed rgba(31, 122, 85, 0.45);
}

.item-note .map-pin:hover {
  color: #145a3a;
}

.item-kv {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(31, 122, 85, 0.06);
  border: 1px solid rgba(12, 74, 52, 0.14);
}

.item-kv-sep {
  height: 0.45rem;
}

.item-kv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.12rem;
  padding: 0.35rem 0;
}

.item-kv-row + .item-kv-row {
  border-top: 1px solid rgba(12, 74, 52, 0.1);
}

.item-kv-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  line-height: 1.25;
}

.item-kv-value {
  display: block;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink);
  word-break: break-word;
}

.item-table {
  width: 100%;
  margin: 0.5rem 0 0;
  border-collapse: collapse;
  font-size: 0.78rem;
  line-height: 1.35;
}

.item-table th,
.item-table td {
  border: 1px solid rgba(12, 74, 52, 0.18);
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.item-table th {
  background: rgba(31, 122, 85, 0.1);
  font-weight: 700;
  color: var(--green);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.item-table tbody tr:nth-child(even) td {
  background: rgba(255, 252, 247, 0.55);
}

.item-links {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.item-links a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(31, 122, 85, 0.1);
  border: 1px solid rgba(31, 122, 85, 0.18);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  border-radius: 999px;
  width: 100%;
}

.btn-tiny {
  font-size: 0.68rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
}

.btn-ok {
  color: var(--green-soft);
  border-color: rgba(31, 122, 85, 0.28);
}

.btn-skip {
  color: var(--red);
  border-color: rgba(185, 28, 28, 0.25);
}

.btn-proof {
  color: var(--green);
  background: rgba(31, 122, 85, 0.08);
  border-color: rgba(31, 122, 85, 0.22);
}

.mark {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.mark-ok {
  color: #178a4b;
}
.mark-skip {
  color: var(--red);
}

.item.is-past .item-time,
.item.is-past .item-title,
.item.is-past .item-note {
  color: var(--past);
}

.item.is-past .item-dot {
  background: #9aa39a;
}

.item.is-late:not(.is-done):not(.is-skipped) .item-main {
  background: var(--red-soft);
  border-color: rgba(185, 28, 28, 0.22);
}

.item.is-done .item-main {
  background: rgba(31, 122, 85, 0.14);
  border-color: rgba(31, 122, 85, 0.28);
}

.item.is-skipped .item-main {
  background: rgba(185, 28, 28, 0.1);
  border-color: rgba(185, 28, 28, 0.24);
}

.item.is-done .item-title {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.now-line {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.8rem;
  align-items: center;
  margin: 0.2rem 0;
  animation: nowIn 0.4s ease;
  scroll-margin-top: 8rem;
}

.now-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--red);
  text-align: right;
  line-height: 1.15;
}

.now-bar {
  height: 2px;
  background: var(--red);
  position: relative;
  border-radius: 2px;
}

.now-bar::after {
  content: "";
  position: absolute;
  left: -0.15rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--red);
  transform: translateY(-50%);
}

.day-extra {
  margin-top: 1.4rem;
}

.day-extra h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--green);
}

.day-extra ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.day-extra li {
  display: grid;
  gap: 0.1rem;
  font-size: 0.88rem;
  background: rgba(255, 252, 247, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}

.day-extra li span {
  color: var(--muted);
}

.fab-clock {
  position: fixed;
  right: max(1rem, var(--safe-right));
  bottom: calc(1.15rem + var(--safe-bottom));
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 24px rgba(12, 74, 52, 0.28);
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 40;
}

.fab-clock.is-paused {
  background: var(--red);
}

.fab-clock small {
  display: block;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: -0.1rem;
}

.sim-banner {
  margin: 0.65rem max(1rem, var(--safe-right)) 0 max(1rem, var(--safe-left));
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(185, 28, 28, 0.08);
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
}

.offline-banner {
  margin: 0.65rem max(1rem, var(--safe-right)) 0 max(1rem, var(--safe-left));
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(31, 122, 85, 0.1);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
}

.test-panel {
  margin: 1.1rem 0 0.5rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(12, 74, 52, 0.22);
  background: rgba(255, 252, 247, 0.72);
}

.test-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.test-panel-head strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--green);
}

.test-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.test-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--green-soft);
}

.test-offset-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.test-offset-row input {
  width: 4.2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--green);
}

.test-hint {
  margin: 0.55rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.error {
  padding: 2rem 1.25rem;
  color: var(--red);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes nowIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (min-width: 720px) {
  .home,
  .day-body,
  .login-view {
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
  }

  .app-top,
  .day-nav,
  .day-hero,
  .sim-banner {
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
  }
}
