.goals-card .task-create-topic-btn {
  border-color: rgba(91, 101, 113, 0.38);
  background: rgba(220, 226, 232, 0.96);
  color: #363f4a;
}

.goals-card {
  margin-top: 12px;
  border-color: rgba(84, 94, 106, 0.22);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.93), rgba(238, 241, 245, 0.92));
}

.goals-main-toggle {
  width: 100%;
  border: 1px solid rgba(91, 101, 113, 0.26);
  border-radius: 14px;
  background: rgba(244, 247, 250, 0.96);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.goals-main-top {
  grid-column: 1 / 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.goals-main-title {
  min-width: 0;
  color: #262f39;
  font-size: 0.9rem;
  font-weight: 590;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.goals-main-help {
  grid-column: 1 / 2;
  color: #5c6673;
  font-size: 0.76rem;
  line-height: 1.35;
}

.goals-main-icon {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  align-self: start;
  justify-self: end;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(91, 101, 113, 0.26);
  background: rgba(226, 232, 238, 0.96);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

.goals-main-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 590;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0 4px;
  box-shadow: 0 4px 10px rgba(255, 59, 48, 0.36);
}

.goals-main-toggle .goals-chevron {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  align-self: end;
  justify-self: end;
}

.goals-main-toggle.is-open .goals-chevron {
  transform: rotate(225deg);
}

.goals-main-body {
  margin-top: 10px;
}

.goals-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.goals-status-btn {
  width: auto;
  min-width: 92px;
}

.goals-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.goal-card {
  border: 1px solid rgba(93, 103, 115, 0.22);
  border-radius: 12px;
  background: rgba(246, 248, 251, 0.96);
  padding: 7px;
  display: grid;
  gap: 7px;
}

.goal-card-open-btn {
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 9px 8px;
  text-align: left;
  color: inherit;
  font: inherit;
  display: grid;
  gap: 6px;
  aspect-ratio: 1 / 1;
  align-content: start;
}

.goal-card-title {
  color: #2b3340;
  font-size: 0.84rem;
  font-weight: 590;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.goal-card-badge {
  border-radius: 999px;
  border: 1px solid rgba(103, 113, 125, 0.22);
  font-size: 0.64rem;
  font-weight: 590;
  line-height: 1;
  padding: 4px 7px;
  background: rgba(236, 240, 245, 0.96);
  color: #4b5563;
}

.goal-card-badge.is-urgent {
  border-color: rgba(219, 110, 49, 0.36);
  background: rgba(242, 140, 40, 0.2);
  color: #a25f12;
}

.goal-card-badge.is-inactive {
  border-color: rgba(45, 89, 146, 0.26);
  background: rgba(180, 198, 225, 0.35);
  color: #43618f;
}

.goal-card-badge.is-realized {
  border-color: rgba(41, 149, 95, 0.28);
  background: rgba(207, 242, 223, 0.75);
  color: #236a46;
}

.goal-card-meta {
  margin: 0;
  font-size: 0.69rem;
  line-height: 1.25;
  color: #5f6a77;
  overflow-wrap: anywhere;
}

.goal-card-meta.is-strong {
  color: #3f4956;
  font-weight: 590;
}

.goal-card-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.26);
  overflow: hidden;
}

.goal-card-track span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4dc97d, #2f9a61);
}

.goal-card-funding-btn,
.goal-card-manage-btn {
  border-radius: 10px;
  border: 1px solid rgba(93, 103, 115, 0.36);
  background: rgba(227, 232, 238, 0.96);
  color: #38424f;
  font: inherit;
  font-size: 0.71rem;
  font-weight: 590;
  line-height: 1.1;
  min-height: 30px;
  padding: 6px 9px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.goal-card-funding-btn {
  border-color: rgba(49, 151, 98, 0.44);
  background: linear-gradient(160deg, #4cc57d, #2f9a61);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(49, 151, 98, 0.28);
}

.goal-card-funding-btn:disabled,
.goal-card-manage-btn:disabled {
  opacity: 0.6;
}

.goal-card-funding-btn:disabled {
  border-color: rgba(121, 133, 148, 0.34);
  background: rgba(225, 230, 236, 0.96);
  color: #67717e;
  box-shadow: none;
}

.goal-card-manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.goals-treasurer-card {
  margin-top: 10px;
  border-top: 1px dashed rgba(93, 103, 115, 0.24);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.goals-treasurer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.goals-treasurer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.goals-treasurer-actions .goals-status-icon-btn {
  width: 32px;
  height: 32px;
  font-size: 0.96rem;
}

.goals-treasurer-card h4 {
  margin: 0;
  color: #2d3642;
  font-size: 0.88rem;
}

.goals-treasurer-help {
  margin: 0;
  color: #5f6a77;
  font-size: 0.75rem;
  line-height: 1.35;
}

.goals-treasurer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.goals-treasurer-item {
  border: 1px solid rgba(93, 103, 115, 0.2);
  border-radius: 10px;
  background: rgba(244, 247, 251, 0.96);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.goals-treasurer-line {
  margin: 0;
  color: #333d49;
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.goals-treasurer-time {
  margin: 0;
  color: #64707d;
  font-size: 0.68rem;
}

.goals-treasurer-note {
  margin: 0;
  color: #5e6a78;
  font-size: 0.72rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.goals-treasurer-empty {
  border: 1px dashed rgba(93, 103, 115, 0.24);
  border-radius: 10px;
  background: rgba(239, 243, 247, 0.88);
  color: #5e6a78;
  font-size: 0.76rem;
  text-align: center;
  padding: 10px;
}

.goal-funding-goal-meta,
.goal-funding-coverage-meta {
  margin: 0;
  color: #525d6b;
  font-size: 0.82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.goal-funding-coverage-meta {
  color: #3d4754;
  font-weight: 590;
}

.goal-funding-frequency-field {
  margin: 0;
}

.goal-funding-frequency-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.goal-funding-frequency-group button {
  border-radius: 10px;
  border: 1.5px solid rgba(86, 102, 126, 0.38);
  background: rgba(242, 246, 251, 0.98);
  color: #334255;
  min-height: 40px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 640;
  line-height: 1.15;
  padding: 7px 8px;
}

.goal-funding-frequency-group button.is-active {
  border-color: rgba(27, 89, 171, 0.9);
  background: linear-gradient(165deg, rgba(210, 229, 255, 0.98), rgba(184, 212, 249, 0.98));
  color: #123e79;
  box-shadow: 0 0 0 2px rgba(57, 109, 184, 0.22), 0 8px 14px rgba(43, 86, 151, 0.2);
}

.goal-funding-thanks {
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(39, 127, 83, 0.24);
  background: rgba(39, 167, 100, 0.13);
  color: #1c6e45;
  font-size: 0.76rem;
  font-weight: 510;
  line-height: 1.35;
  padding: 8px 10px;
}

.goals-status-dialog {
  width: min(94vw, 520px);
}

.goals-status-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goals-status-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(93, 103, 115, 0.28);
  background: rgba(232, 236, 241, 0.96);
  color: #434d59;
  font: inherit;
  font-size: 1.02rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.goals-status-icon-btn:active {
  transform: translateY(1px);
}

.goals-status-wrap {
  padding: 4px 16px 16px;
  max-height: min(68vh, 540px);
  overflow: auto;
}

.goals-status-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.77rem;
}

.goals-status-table th,
.goals-status-table td {
  border-bottom: 1px solid rgba(93, 103, 115, 0.2);
  text-align: left;
  vertical-align: top;
  padding: 8px 6px;
}

.goals-status-table th {
  color: #4b5664;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.goals-status-table th:nth-child(1),
.goals-status-table td:nth-child(1) {
  width: 40%;
}

.goals-status-table th:nth-child(2),
.goals-status-table td:nth-child(2) {
  width: 21%;
}

.goals-status-table th:nth-child(3),
.goals-status-table td:nth-child(3) {
  width: 21%;
}

.goals-status-table th:nth-child(4),
.goals-status-table td:nth-child(4) {
  width: 18%;
}

.goals-status-goal {
  margin: 0;
  font-weight: 590;
  color: #2c3642;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.goals-status-sub {
  margin: 3px 0 0;
  color: #657180;
  font-size: 0.7rem;
  line-height: 1.2;
}

.goals-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(93, 103, 115, 0.24);
  background: rgba(238, 243, 248, 0.9);
  color: #4e5866;
  font-size: 0.68rem;
  font-weight: 590;
  line-height: 1;
  white-space: nowrap;
}

.goals-status-chip.is-yes {
  border-color: rgba(49, 151, 98, 0.36);
  background: rgba(220, 243, 230, 0.9);
  color: #236d46;
}

.goals-status-chip.is-no {
  border-color: rgba(122, 132, 146, 0.3);
  background: rgba(237, 241, 246, 0.9);
  color: #5d6876;
}

.goals-status-empty {
  margin: 8px 0 0;
  border: 1px dashed rgba(93, 103, 115, 0.24);
  border-radius: 10px;
  background: rgba(239, 243, 247, 0.88);
  color: #5e6a78;
  font-size: 0.78rem;
  text-align: center;
  padding: 12px;
}

body.native-app .goals-status-wrap,
body.compact-layout .goals-status-wrap {
  max-height: none;
  padding-bottom: calc(20px + var(--safe-bottom));
}

body.native-app .goals-grid,
body.compact-layout .goals-grid {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

@media (max-width: 900px) {
  .goals-head {
    flex-direction: column;
    align-items: stretch;
  }

  .goals-grid {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  }
}

@media (max-width: 340px) {
  .goals-grid {
    grid-template-columns: 1fr;
  }

  .goal-card-open-btn {
    aspect-ratio: auto;
    min-height: 150px;
  }
}
