/* =========================================================
   ARVYNO 0.9.114 — GOALS 2.0
   Goal = result. Progress mode/source are independent.
   ========================================================= */

.page[data-page="goals"] .goals-v2-heading .tasks-heading-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.goals-v2-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(82,72,62,.08);
  border-radius: 16px;
  background: rgba(239,236,231,.78);
}
.goals-v2-filters button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #827b73;
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
}
.goals-v2-filters button.active {
  background: rgba(255,255,255,.94);
  color: var(--sage-dark);
  box-shadow: 0 4px 12px rgba(67,75,68,.055);
}

.page[data-page="goals"] .goals-v2-list-card {
  padding-top: 8px;
  padding-bottom: 8px;
}
.page[data-page="goals"] .goals-v2-row {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px 2px;
}
.goals-v2-row-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(143,159,138,.10);
  color: var(--sage-dark);
  font-size: 18px;
  font-weight: 760;
}
.goals-v2-row.is-completed {
  opacity: .72;
}
.goals-v2-row.is-completed .goal-task-title-row > b {
  color: #706a63;
}
.goals-v2-row .goal-task-meta {
  margin-top: 3px;
  line-height: 1.35;
}
.goals-v2-row .goal-task-progress {
  margin-top: 8px;
}
.goals-v2-status {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8d877f;
  font-size: 19px !important;
}
.goals-v2-status.done {
  background: rgba(85,105,86,.10);
  color: var(--sage-dark);
}

/* Home cards */
.goals-v2-home-goal .goals-v2-mode-icon {
  color: var(--sage-dark);
  font-size: 17px;
  font-weight: 780;
}
.goals-v2-home-goal .goal-percent.status {
  font-size: 22px;
  color: var(--sage-dark);
}
.goals-v2-home-goal.is-completed {
  opacity: .72;
}

/* Detail */
.goals-v2-detail-scroll {
  padding-bottom: calc(36px + max(env(safe-area-inset-bottom), var(--arvyno-content-safe-bottom, 0px)));
}
.goal-detail-hero.goals-v2-detail-hero {
  background: linear-gradient(135deg, rgba(143,159,138,.20), rgba(255,255,255,.78));
}
.goal-detail-hero.goals-v2-mode-sum { background: linear-gradient(135deg, rgba(143,159,138,.24), rgba(255,255,255,.78)); }
.goal-detail-hero.goals-v2-mode-count { background: linear-gradient(135deg, rgba(220,224,214,.86), rgba(255,255,255,.78)); }
.goal-detail-hero.goals-v2-mode-steps { background: linear-gradient(135deg, rgba(231,224,214,.88), rgba(255,255,255,.78)); }
.goal-detail-hero.goals-v2-mode-streak { background: linear-gradient(135deg, rgba(224,217,204,.90), rgba(255,255,255,.78)); }
.goal-detail-hero.goals-v2-mode-result { background: linear-gradient(135deg, rgba(213,220,211,.88), rgba(255,255,255,.78)); }
.goals-v2-detail-hero .goal-detail-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.goals-v2-detail-meta {
  flex-wrap: wrap;
}
.goals-v2-result-status {
  display: inline-flex;
  align-items: center;
  margin: 14px 0 4px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(96,107,96,.08);
  color: #69645e;
  font-size: 12px;
  font-weight: 760;
}
.goals-v2-result-status.done {
  background: rgba(85,105,86,.12);
  color: var(--sage-dark);
}
.goals-v2-detail-card {
  box-shadow: 0 10px 26px rgba(62,52,43,.055);
}
.goals-v2-source-card {
  display: grid;
  gap: 0;
}
.goals-v2-source-card > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(91,81,71,.08);
}
.goals-v2-source-card > div:last-child { border-bottom: 0; }
.goals-v2-source-card span { color: var(--muted); font-size: 11px; }
.goals-v2-source-card b { color: var(--text); font-size: 11px; text-align: right; }
.goals-v2-history { display: grid; }
.goals-v2-history > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(91,81,71,.08);
}
.goals-v2-history > div:last-child { border-bottom: 0; }
.goals-v2-history span { display: grid; gap: 2px; }
.goals-v2-history b { font-size: 11px; }
.goals-v2-history small { color: var(--muted); font-size: 9px; }
.goals-v2-history strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.goals-v2-result-action-card { padding: 10px; }
.goals-v2-status-button { width: 100%; }
.goals-v2-status-button:not(.is-done) {
  background: var(--sage-dark);
  color: white;
}

/* Form */
.goals-v2-form-screen .entity-form-scroll {
  padding-bottom: calc(42px + max(env(safe-area-inset-bottom), var(--arvyno-content-safe-bottom, 0px)));
}
#goal-form.goals-v2-form {
  display: grid;
  gap: 12px;
}
#goal-form.goals-v2-form .hidden { display: none !important; }
.goals-v2-form-section {
  display: grid;
  gap: 10px;
}
.goals-v2-form-section-title {
  display: grid;
  gap: 3px;
  padding: 0 2px;
}
.goals-v2-form-section-title b {
  font-size: 12px;
  color: var(--text);
}
.goals-v2-form-section-title span {
  font-size: 10px;
  color: var(--muted);
}
.goals-v2-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}
.goals-v2-mode-grid label { position: relative; min-width: 0; }
.goals-v2-mode-grid label:last-child:nth-child(odd) { grid-column: 1 / -1; }
.goals-v2-mode-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.goals-v2-mode-grid span {
  min-height: 76px;
  display: grid;
  grid-template-columns: 26px minmax(0,1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(91,81,71,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}
.goals-v2-mode-grid i {
  grid-row: 1 / span 2;
  align-self: center;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(143,159,138,.10);
  color: var(--sage-dark);
  font-style: normal;
  font-weight: 780;
}
.goals-v2-mode-grid b { font-size: 12px; }
.goals-v2-mode-grid small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.25; }
.goals-v2-mode-grid input:checked + span {
  border-color: rgba(85,105,86,.30);
  background: rgba(126,148,126,.12);
  box-shadow: inset 0 0 0 1px rgba(85,105,86,.07);
}
.goals-v2-mode-panel {
  margin-top: 0 !important;
}
.goals-v2-steps-field {
  display: grid;
  gap: 8px;
  padding: 14px 15px;
}
.goals-v2-steps-field > span {
  color: #667866;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.goals-v2-steps-field textarea {
  width: 100%;
  min-height: 150px;
  padding: 0;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
}
.goals-v2-steps-field small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.goals-v2-result-panel {
  padding: 0;
}
.goals-v2-result-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(85,105,86,.10);
  border-radius: 17px;
  background: rgba(143,159,138,.07);
}
.goals-v2-result-note > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: var(--sage-dark);
  font-size: 18px;
}
.goals-v2-result-note b { font-size: 12px; }
.goals-v2-result-note p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

@media (max-width: 390px) {
  .goals-v2-filters button { font-size: 9.3px; padding-inline: 5px; }
  .goals-v2-mode-grid span { min-height: 70px; padding: 10px; }
  .page[data-page="goals"] .goals-v2-row { grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; }
  .goals-v2-row-icon { width: 34px; height: 34px; border-radius: 11px; }
}
