@charset "UTF-8";
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--aco-bg);
  color: var(--aco-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--aco-focus);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  color: var(--aco-text);
  font-weight: 700;
  line-height: 1.25;
}

/* ---------- aCo shell: left rail ---------- */
.aco-left-rail {
  display: none;
}
@media (min-width: 1024px) {
  .aco-left-rail {
    display: block;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    width: 385px;
    overflow-y: auto;
    padding: 24px 16px 80px;
    background: var(--aco-bg);
  }
}

.aco-left-rail__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aco-left-rail__link {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--aco-text);
  text-decoration: none;
}
.aco-left-rail__link:hover {
  background: var(--aco-panel);
}

.aco-left-rail__link.is-active {
  color: var(--aco-blue);
}

/* ---------- aCo shell: footer ---------- */
/* Goals fix (Nov 17, 2026): extra clearance so the footer's credit line
   always sits clear of the bottom bar's raised + button (the circle
   reaches ~32px above the bar once its ring is counted). */
.aco-footer {
  padding: 24px 16px calc(80px + 44px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.aco-footer__line {
  font-size: 12px;
  color: var(--aco-muted);
}

.aco-footer__link {
  color: var(--aco-muted);
  text-decoration: none;
}
.aco-footer__link:hover {
  text-decoration: underline;
}

.aco-footer__credit {
  margin-top: 4px;
  font-size: 11px;
}

.aco-footer__crest {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}

/* ---------- aCo shell: top row ---------- */
.aco-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
  background: var(--aco-bg);
  color: var(--aco-text);
}

.aco-top-row__back {
  font-size: 24px;
  line-height: 1;
  color: var(--aco-text);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.aco-top-row__divider {
  color: var(--aco-text);
  opacity: 0.7;
}

.aco-top-row__title {
  font-size: 21px;
  font-weight: 700;
  color: var(--aco-text);
}

.aco-top-row__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.aco-top-row__avatar {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--aco-panel);
  box-shadow: 0 0 0 2px #3fae6a;
}

.aco-top-row__avatar::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.aco-top-row__avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.aco-top-row__icon-btn {
  position: relative;
  font-size: 20px;
  line-height: 1;
  color: var(--aco-text);
  display: flex;
  align-items: center;
}

.aco-top-row__badge {
  position: absolute;
  top: -6px;
  right: -10px;
  padding: 1px 4px;
  border-radius: 999px;
  background: var(--aco-badge);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

/* ---------- aCo shell: breadcrumb ---------- */
.aco-breadcrumb {
  font-size: 12px;
  padding: 4px 16px 0;
}

.aco-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.aco-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.aco-breadcrumb__link {
  color: var(--aco-breadcrumb);
  text-decoration: none;
}
.aco-breadcrumb__link:hover {
  text-decoration: underline;
}

.aco-breadcrumb__sep {
  color: var(--aco-breadcrumb);
}

.aco-breadcrumb__current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  color: var(--aco-breadcrumb);
}

/* ---------- aCo shell: bottom nav + more panel ---------- */
.aco-bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  height: 80px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--aco-bottom-bar);
  color: var(--aco-bottom-bar-text);
}

.aco-bottom-nav__list {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.aco-bottom-nav__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

.aco-bottom-nav__link,
.aco-bottom-nav__more-btn,
.aco-bottom-nav__action {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  color: var(--aco-bottom-bar-text);
  text-decoration: none;
}

.aco-bottom-nav__link.is-active {
  color: var(--aco-blue);
}

.aco-bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.aco-bottom-nav__icon-svg {
  width: 26px;
  height: 26px;
}

/* Goals fix (Nov 17, 2026): at a true 390px the shell's 10px/0.08em
   labels are wider than their slots (CONTACTS measured 58px in a 56px
   slot) and run into their neighbours. Slightly smaller, tighter
   labels keep every label inside its own slot with air either side. */
.aco-bottom-nav__label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.aco-bottom-nav__action-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border-radius: 50%;
  background: var(--aco-pink);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 0 6px var(--aco-bg);
}

.aco-more-panel {
  position: fixed;
  right: 0;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 0;
  z-index: 99;
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px;
  background: var(--aco-panel);
}

.aco-more-panel[hidden] {
  display: none;
}

.aco-more-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto 8px;
}

.aco-more-panel__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--aco-text);
}

.aco-more-panel__close {
  padding: 2px 10px;
  font-size: 22px;
  line-height: 1.2;
  color: var(--aco-text);
}

.aco-more-panel__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}

.aco-more-panel__link {
  display: block;
  padding: 12px;
  border-radius: 10px;
  background: var(--aco-card);
  color: var(--aco-text);
  font-weight: 600;
  text-decoration: none;
}

.aco-more-panel__link.is-active {
  color: var(--aco-blue);
  box-shadow: inset 0 0 0 2px var(--aco-blue);
}

/* ---------- page: goals ---------- */
.goals-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}
@media (min-width: 1024px) {
  .goals-main {
    margin-left: calc(385px + (100vw - 385px - 960px) / 2);
    margin-right: 0;
  }
}

.aco-page-title {
  font-size: 22px;
  margin: 8px 0 4px;
}

.goals-sub {
  color: var(--aco-text-soft);
  font-size: 15px;
  margin-bottom: 16px;
  max-width: 640px;
}

.goals-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.goals-user {
  font-size: 13px;
  color: var(--aco-muted);
}

/* Inline text links follow the app rule: never blue, never underlined. */
.text-link {
  color: var(--aco-pink);
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover {
  text-decoration: none;
}

.link-btn {
  color: var(--aco-pink);
  font-weight: 600;
  font-size: 13px;
  padding: 2px 4px;
  text-decoration: none;
}

/* ---------- buttons: filled pills, never blue, never underlined ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--aco-pink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid var(--aco-pink);
  cursor: pointer;
  font: inherit;
}
.btn:hover {
  filter: brightness(1.07);
}

.btn-ghost {
  background: transparent;
  color: var(--aco-text);
  border-color: var(--aco-text);
}
.btn-ghost:hover {
  filter: none;
  background: var(--aco-panel);
}

.btn-danger {
  background: transparent;
  color: #b93939;
  border-color: #b93939;
}
.btn-danger:hover {
  filter: none;
  background: #fbeeee;
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

.goals-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

/* ---------- filter chips ---------- */
.goals-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.chip {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--aco-panel);
  color: var(--aco-text);
  font-weight: 600;
  font-size: 14px;
  border: 2px solid transparent;
}
.chip.is-active {
  background: var(--aco-pink);
  color: #fff;
}

/* ---------- goal groups + cards ---------- */
.goals-group {
  margin-top: 26px;
}

.goals-group__title {
  font-size: 18px;
  margin-bottom: 4px;
}

.goals-group__hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--aco-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 6px;
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.goal-card {
  background: var(--aco-card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(34, 54, 74, 0.12);
}

.goal-card--done {
  opacity: 0.75;
}
.goal-card--done .goal-card__title {
  text-decoration: line-through;
}

.goal-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.goal-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--aco-text);
}

.goal-pill {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
}
.goal-pill--short {
  background: var(--aco-blue);
}
.goal-pill--long {
  background: var(--aco-pink);
}

.goal-card__statement {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--aco-text);
}

.goal-card__date {
  margin-top: 2px;
  font-size: 13px;
  color: var(--aco-muted);
}

.goal-parts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goal-part {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.goal-part__text {
  font-size: 14px;
  color: var(--aco-text-soft);
}

.smart-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--aco-pink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* ---------- progress notes ---------- */
.goal-notes {
  margin-top: 14px;
  border-top: 1px solid var(--aco-panel);
  padding-top: 10px;
}

.goal-notes__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--aco-muted);
  margin-bottom: 6px;
}

.goal-notes__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-note {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--aco-text-soft);
}

.goal-note__date {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--aco-muted);
  padding-top: 2px;
  min-width: 86px;
}

.goal-note--empty {
  color: var(--aco-muted);
  font-size: 13px;
}

.goal-note-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.goal-note-form__input {
  flex: 1;
  min-width: 0;
}

.goal-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.goals-empty {
  margin-top: 20px;
  padding: 16px;
  background: var(--aco-panel);
  border-radius: 12px;
  color: var(--aco-text-soft);
  font-size: 15px;
}

/* ---------- forms ---------- */
.view-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.view-head .aco-page-title {
  margin: 8px 0 4px;
}

.back-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--aco-panel);
  color: var(--aco-text);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.fieldset {
  border: 0;
  padding: 0;
}

.field__label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--aco-text);
  margin-bottom: 4px;
}
.field__label .smart-letter {
  margin-right: 6px;
  vertical-align: -5px;
}

.field__hint {
  display: block;
  font-size: 13px;
  color: var(--aco-muted);
  margin-bottom: 6px;
}

.field__input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--aco-panel);
  border-radius: 12px;
  background: #fff;
  color: var(--aco-text);
  font: inherit;
  font-size: 15px;
}
.field__input:focus {
  border-color: var(--aco-blue);
  outline: none;
}

textarea.field__input {
  resize: vertical;
}

.radio-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.radio-pill span {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--aco-panel);
  color: var(--aco-text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid transparent;
}
.radio-pill input:checked + span {
  background: var(--aco-pink);
  color: #fff;
}
.radio-pill input:focus-visible + span {
  outline: 2px solid var(--aco-focus);
  outline-offset: 2px;
}

.smart-preview {
  background: var(--aco-panel);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.smart-preview__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aco-muted);
  margin-bottom: 4px;
}

.smart-preview__text {
  font-size: 15px;
  font-weight: 600;
  color: var(--aco-text);
}

.form-error {
  color: #b93939;
  font-weight: 600;
  margin-bottom: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- learn page ---------- */
.learn-card {
  background: var(--aco-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(34, 54, 74, 0.12);
}

.learn-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}
.learn-card h3 .smart-letter {
  margin-right: 6px;
  vertical-align: -5px;
}

.learn-card p {
  font-size: 15px;
  color: var(--aco-text-soft);
  margin-bottom: 8px;
}
.learn-card p:last-child {
  margin-bottom: 0;
}

.learn-card--example {
  border: 2px solid var(--aco-pink);
}

.learn-breakdown,
.learn-tips {
  list-style: none;
  margin-top: 6px;
}
.learn-breakdown li,
.learn-tips li {
  font-size: 14px;
  color: var(--aco-text-soft);
  padding: 3px 0 3px 16px;
  position: relative;
}
.learn-breakdown li::before,
.learn-tips li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--aco-pink);
  font-weight: 800;
}

@media (max-width: 640px) {
  .goal-note {
    flex-direction: column;
    gap: 0;
  }
  .goal-note__date {
    min-width: 0;
  }
  .goal-note-form {
    flex-direction: column;
  }
  .goal-note-form .btn {
    align-self: flex-start;
  }
}

/* ---------- themes ---------- */
[data-theme=dark],
.aco-theme-dark {
  --aco-bg: #131c2f;
  --aco-card: #2f4063;
  --aco-panel: #222e46;
  --aco-blue: #369eea;
  --aco-action: #369eea;
  --aco-bottom-bar: #3d5a98;
  --aco-bottom-bar-text: #ffffff;
  --aco-pink: #e21d7c;
  --aco-edit-blue: #3ba0ea;
  --aco-breadcrumb: #2c8dd8;
  --aco-muted: #a6a9b1;
  --aco-text: #ffffff;
  --aco-text-soft: #e8ebf1;
  --aco-badge: #b93939;
  --aco-focus: #369eea;
  --aco-pill-open: #cfe3f7;
  --aco-pill-high: #793446;
}

[data-theme=light],
.aco-theme-light {
  --aco-bg: #f4f6fa;
  --aco-card: #ffffff;
  --aco-panel: #e8edf5;
  --aco-blue: #369eea;
  --aco-action: #369eea;
  --aco-bottom-bar: #ffffff;
  --aco-bottom-bar-text: #22364a;
  --aco-pink: #e21d7c;
  --aco-edit-blue: #1685d7;
  --aco-breadcrumb: #1685d7;
  --aco-muted: #5b6472;
  --aco-text: #22364a;
  --aco-text-soft: #3a4a61;
  --aco-badge: #b93939;
  --aco-focus: #1685d7;
  --aco-pill-open: #d7e9fa;
  --aco-pill-high: #793446;
}
