:root {
  --performance-blue: #2563eb;
  --performance-blue-deep: #1d4ed8;
  --performance-ink: #162337;
  --performance-muted: #66758a;
  --performance-border: #dce7f7;
  --performance-surface: #ffffff;
  --performance-soft: #f4f8ff;
  --performance-radius: 22px;
  --performance-shadow: 0 16px 42px rgba(37, 99, 235, .09);
}

.performance-targets-main { max-width: 1120px; }
.performance-targets-hero { border-left: 5px solid var(--performance-blue); }
.performance-targets-control,
.performance-target-form-card,
.performance-target-list { border: 1px solid var(--performance-border); border-radius: var(--performance-radius); box-shadow: var(--performance-shadow); }
.performance-month-filter > label { display: block; margin-bottom: 10px; color: var(--performance-ink); font-weight: 800; }
.performance-month-filter > div { display: flex; gap: 12px; align-items: end; }
.performance-month-filter input { min-height: 48px; }
.performance-target-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: end; }
.performance-target-form > .button { min-height: 48px; }
.performance-money-field { display: grid; grid-template-columns: auto 1fr; min-height: 48px; border: 1px solid var(--performance-border); border-radius: 14px; overflow: hidden; background: white; }
.performance-money-field:focus-within { border-color: var(--performance-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.performance-money-field span { display: grid; place-items: center; padding: 0 16px; color: var(--performance-blue-deep); background: var(--performance-soft); font-weight: 900; }
.performance-money-field input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-width: 0; }
.performance-visibility { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 12px 14px; border: 1px solid var(--performance-border); border-radius: 14px; cursor: pointer; }
.performance-visibility input { width: 22px; height: 22px; accent-color: var(--performance-blue); flex: 0 0 auto; }
.performance-visibility span { display: grid; gap: 2px; }
.performance-visibility small { color: var(--performance-muted); }
.performance-target-grid { display: grid; gap: 12px; }
.performance-target-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; gap: 16px; align-items: center; padding: 15px 16px; border: 1px solid var(--performance-border); border-radius: 16px; background: var(--performance-surface); }
.performance-target-row > div { display: flex; gap: 12px; align-items: center; min-width: 0; }
.performance-target-row > div > span:last-child { display: grid; min-width: 0; }
.performance-target-row small { color: var(--performance-muted); }
.performance-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; color: var(--performance-blue-deep); background: #eaf2ff; border-radius: 13px; font-weight: 900; }
.performance-target-amount { color: var(--performance-ink); white-space: nowrap; }
.performance-no-target { color: var(--performance-muted); font-weight: 700; }

.performance-dashboard { display: grid; gap: 18px; }
.performance-dashboard__heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.performance-dashboard__heading h2 { margin: 3px 0 0; color: var(--performance-ink); font-size: clamp(1.45rem, 3vw, 2rem); }
.performance-dashboard__heading time { color: var(--performance-muted); font-weight: 750; white-space: nowrap; }
.performance-dashboard__grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 18px; }
.performance-card { position: relative; min-width: 0; padding: 22px; overflow: hidden; border: 1px solid var(--performance-border); border-radius: var(--performance-radius); background: var(--performance-surface); box-shadow: var(--performance-shadow); }
.performance-today-card { display: flex; align-items: center; gap: 18px; }
.performance-card__icon { display: grid; place-items: center; width: 56px; height: 56px; flex: 0 0 56px; color: var(--performance-blue-deep); background: #eaf2ff; border-radius: 17px; }
.performance-card__icon svg { width: 28px; height: 28px; }
.performance-today-card span:not(.performance-card__icon),
.performance-progress-copy > span,
.performance-distance-card > span { color: var(--performance-muted); font-weight: 800; }
.performance-today-card--detail { display: grid; grid-column: 1 / -1; align-items: stretch; gap: 16px; }
.performance-today-card__header { display: flex; align-items: center; gap: 14px; min-width: 0; }
.performance-today-card__header > div { display: grid; gap: 3px; min-width: 0; }
.performance-today-card__header h3 { margin: 0; color: var(--performance-ink); font-size: 1.16rem; }
.performance-today-card__header p { margin: 0; color: var(--performance-muted); font-size: .86rem; line-height: 1.4; }
.performance-today-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.performance-today-grid > div { display: grid; min-width: 0; gap: 5px; padding: 13px 14px; border: 1px solid var(--performance-border); border-radius: 14px; background: #fbfdff; }
.performance-today-grid span { color: var(--performance-muted); font-size: .8rem; font-weight: 800; }
.performance-today-grid strong { display: block; min-width: 0; max-width: 100%; color: var(--performance-ink); font-size: clamp(.84rem, 1.5vw, 1rem); white-space: nowrap; font-variant-numeric: tabular-nums; }
.performance-today-goal { display: grid; align-content: end; gap: 5px; min-width: 0; margin-top: 4px; }
.performance-today-goal__top { display: flex; align-items: end; justify-content: space-between; gap: 6px; min-width: 0; }
.performance-today-goal__top small { min-width: 0; color: var(--performance-muted); font-size: .68rem; font-weight: 750; line-height: 1.25; }
.performance-today-goal__top b { flex: 0 0 auto; color: var(--performance-blue-deep); font-size: .7rem; font-variant-numeric: tabular-nums; }
.performance-today-goal__track { height: 5px; overflow: hidden; border-radius: 99px; background: #e6edf7; }
.performance-today-goal__track i { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--performance-blue); transition: width .35s ease; }
.performance-today-goal__detail { color: var(--performance-muted); font-size: .65rem; line-height: 1.3; overflow-wrap: anywhere; }
.performance-today-goal.is-complete .performance-today-goal__track i { background: #168b6b; }
.performance-today-goal.is-complete .performance-today-goal__top b { color: #168b6b; }
.performance-today-goal.is-fixed .performance-today-goal__track { display: none; }
.performance-today-goal.is-fixed .performance-today-goal__top { align-items: center; min-height: 20px; }
.performance-today-goal.is-fixed .performance-today-goal__top b { padding: 3px 7px; border-radius: 99px; background: #eaf2ff; }
.performance-progress-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.performance-ring { --performance-ring-color: #8396ad; position: relative; display: grid; place-items: center; width: 154px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--performance-ring-color) calc(var(--performance-progress) * 1%), #e9eff7 0); }
.performance-ring::before { content: ''; position: absolute; width: 118px; aspect-ratio: 1; border-radius: 50%; background: white; }
.performance-ring > div { position: relative; z-index: 1; display: grid; place-items: center; gap: 1px; }
.performance-ring strong { color: var(--performance-ink); font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.performance-ring span { color: var(--performance-muted); font-size: .78rem; font-weight: 750; }
.performance-progress-card.is-active .performance-ring { --performance-ring-color: var(--performance-blue); }
.performance-progress-card.is-near .performance-ring { --performance-ring-color: #c8992f; }
.performance-progress-card.is-complete .performance-ring { --performance-ring-color: #168b6b; }
.performance-progress-copy { display: grid; gap: 5px; min-width: 0; }
.performance-progress-copy strong { color: var(--performance-ink); font-size: clamp(1.45rem, 3.5vw, 2.15rem); white-space: nowrap; font-variant-numeric: tabular-nums; }
.performance-progress-copy small { color: var(--performance-muted); font-weight: 700; }
.performance-distance-card { display: grid; align-content: center; gap: 7px; border-left: 5px solid var(--performance-blue); }
.performance-distance-card strong { color: var(--performance-ink); font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.performance-distance-card p { margin: 0; color: var(--performance-muted); line-height: 1.55; }
.performance-categories-card { grid-column: 1 / -1; }
.performance-category-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 5px; border: 1px solid var(--performance-border); border-radius: 15px; background: var(--performance-soft); }
.performance-category-tabs button { min-height: 44px; padding: 8px 10px; color: var(--performance-muted); border: 0; border-radius: 11px; background: transparent; font: inherit; font-weight: 850; cursor: pointer; }
.performance-category-tabs button[aria-selected="true"] { color: var(--performance-blue-deep); background: #fff; box-shadow: 0 4px 13px rgba(37,99,235,.12); }
.performance-category-tabs button:focus-visible { outline: 3px solid rgba(37,99,235,.22); outline-offset: 1px; }
.performance-category-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.performance-category-panel:not([hidden]) { display: grid; }
.performance-category-panel > div { display: grid; min-width: 0; gap: 6px; padding: 14px; border: 1px solid var(--performance-border); border-radius: 14px; background: #fbfdff; }
.performance-category-panel span { color: var(--performance-muted); font-size: .83rem; font-weight: 750; }
.performance-category-panel strong { display: block; min-width: 0; max-width: 100%; color: var(--performance-ink); font-size: 1.05rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.performance-cat-card { display: flex; align-items: center; gap: 18px; background: #f8fbff; }
.performance-cat-visual { position: relative; display: grid; place-items: end center; width: 118px; height: 112px; flex: 0 0 118px; overflow: visible; border-radius: 30px; background: #eaf2ff; isolation: isolate; }
.performance-cat-visual::before { content: ''; position: absolute; inset: 14px 12px 8px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(37,99,235,.14), rgba(37,99,235,0) 72%); }
.performance-cat-visual img { display: block; width: 116px; height: 116px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 8px 9px rgba(37,99,235,.13)); transform-origin: 50% 86%; transition: transform .24s ease, filter .24s ease; }
.performance-cat-badge { position: absolute; top: 6px; right: 4px; display: grid; place-items: center; width: 28px; height: 28px; color: #fff; border: 3px solid #f8fbff; border-radius: 50%; background: var(--performance-blue); box-shadow: 0 5px 14px rgba(37,99,235,.22); opacity: 0; transform: scale(.72); transition: opacity .2s ease, transform .2s ease; }
.performance-cat-badge svg { width: 14px; height: 14px; fill: currentColor; }
.performance-cat-card.is-near .performance-cat-badge { color: #fff9df; background: #c8992f; opacity: 1; transform: scale(1); }
.performance-cat-card.is-complete .performance-cat-badge,
.performance-cat-card.is-exceeded .performance-cat-badge { background: #168b6b; opacity: 1; transform: scale(1); }
.performance-cat-card.is-exceeded .performance-cat-badge { color: #fff4bd; box-shadow: 0 5px 16px rgba(22,139,107,.28); }
.performance-cat-card.is-near .performance-cat-visual img { transform: translateY(-2px); }
.performance-cat-card.is-complete .performance-cat-visual img,
.performance-cat-card.is-exceeded .performance-cat-visual img { filter: drop-shadow(0 9px 10px rgba(22,139,107,.17)); }
.performance-cat-card.is-celebrating .performance-cat-visual img { animation: performance-cat-cheer .72s ease-in-out 2; }
.performance-cat-card__kicker { color: var(--performance-blue-deep); font-size: .74rem; font-weight: 900; letter-spacing: .13em; }
.performance-cat-card h3 { margin: 5px 0 6px; color: var(--performance-ink); font-size: 1.12rem; }
.performance-cat-card p { margin: 0; color: var(--performance-muted); line-height: 1.5; }
.performance-shortcuts-card { grid-column: 1 / -1; }
.performance-card-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.performance-card-heading h3 { margin: 0; color: var(--performance-ink); font-size: 1.16rem; }
.performance-card-heading span { color: var(--performance-muted); }
.performance-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.performance-shortcut { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 13px 15px; color: var(--performance-ink); border: 1px solid var(--performance-border); border-radius: 16px; background: white; font-weight: 850; text-decoration: none; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.performance-shortcut svg { width: 24px; height: 24px; flex: 0 0 24px; color: var(--performance-blue); }
.performance-shortcut:hover { border-color: #9fc3ff; box-shadow: 0 9px 22px rgba(37,99,235,.1); transform: translateY(-1px); }
.performance-shortcut:focus-visible { outline: 3px solid rgba(37,99,235,.25); outline-offset: 2px; }

.performance-celebration { position: fixed; top: max(96px, calc(env(safe-area-inset-top) + 78px)); left: 50%; z-index: 1200; width: min(440px, calc(100vw - 32px)); pointer-events: none; transform: translateX(-50%); }
.performance-celebration[hidden] { display: none; }
.performance-celebration__sign { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 14px 18px; color: #123e33; border: 1px solid #a8dccb; border-radius: 17px; background: #effcf7; box-shadow: 0 16px 36px rgba(22,35,55,.16); opacity: 0; transform: translateY(-10px) scale(.97); }
.performance-celebration__sign > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; color: white; border-radius: 50%; background: #168b6b; font-weight: 900; }
.performance-celebration__sign strong { font-size: .96rem; line-height: 1.4; }
.performance-celebration.is-active .performance-celebration__sign,
.performance-celebration.is-static .performance-celebration__sign { animation: performance-sign-in .28s ease forwards; }
.performance-celebration.is-error .performance-celebration__sign { color: #79362f; border-color: #efc5bf; background: #fff4f2; }
.performance-celebration.is-error .performance-celebration__sign > span { background: #dc3545; }
.performance-celebration__stars { position: absolute; inset: -8px 0 auto; z-index: 1; height: 100px; overflow: visible; }
.performance-celebration__stars i { --star-x: 50%; --star-delay: 0ms; position: absolute; top: 22px; left: var(--star-x); width: 8px; height: 8px; border-radius: 2px; background: var(--performance-blue); opacity: 0; animation: performance-star 1.05s ease-out var(--star-delay) forwards; }
.performance-celebration__stars i:nth-child(3n + 1) { background: #c8992f; transform: rotate(45deg); }
.performance-celebration__stars i:nth-child(3n + 2) { background: #168b6b; border-radius: 50%; }

.performance-preference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.performance-preference-card { display: flex; align-items: flex-start; gap: 12px; min-height: 82px; padding: 15px; border: 1px solid var(--performance-border); border-radius: 16px; background: #fff; cursor: pointer; }
.performance-preference-card:has(input:checked) { border-color: #9fc3ff; background: #f5f9ff; box-shadow: 0 0 0 2px rgba(37,99,235,.06); }
.performance-preference-card input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 22px; accent-color: var(--performance-blue); }
.performance-preference-card > span { display: grid; gap: 4px; }
.performance-preference-card strong { color: var(--performance-ink); }
.performance-preference-card small,
.performance-settings-grid .feature-card__copy small { color: var(--performance-muted); line-height: 1.45; overflow-wrap: anywhere; }

@keyframes performance-cat-cheer {
  0%, 100% { transform: translateY(0) rotate(0); }
  28% { transform: translateY(-6px) rotate(-2deg); }
  56% { transform: translateY(-2px) rotate(2deg); }
}
@keyframes performance-sign-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes performance-star {
  0% { opacity: 0; translate: -50% 6px; scale: .55; }
  18% { opacity: 1; }
  100% { opacity: 0; translate: -50% -58px; rotate: 150deg; scale: 1; }
}

@media (max-width: 720px) {
  .performance-targets-main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .performance-month-filter > div { align-items: stretch; }
  .performance-month-filter input { min-width: 0; width: 100%; }
  .performance-target-form { grid-template-columns: 1fr; }
  .performance-target-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
  .performance-target-row .status-pill { justify-self: start; }
  .performance-target-edit { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; }
  .performance-dashboard { gap: 14px; }
  .performance-dashboard__heading { align-items: start; }
  .performance-dashboard__grid { grid-template-columns: 1fr; gap: 14px; }
  .performance-card { padding: 18px; border-radius: 19px; }
  .performance-progress-card { grid-template-columns: 126px minmax(0, 1fr); gap: 18px; }
  .performance-ring { width: 126px; }
  .performance-ring::before { width: 96px; }
  .performance-ring strong { font-size: 1.38rem; }
  .performance-shortcuts-card { grid-column: 1; }
  .performance-categories-card { grid-column: 1; }
  .performance-card-heading { display: grid; gap: 4px; }
  .performance-today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .performance-today-grid > div { padding: 12px 13px; }
  .performance-today-goal__top { align-items: flex-start; }
  .performance-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-shortcut { min-height: 58px; }
  .performance-category-panel:not([hidden]) { grid-template-columns: 1fr; gap: 8px; }
  .performance-category-panel > div { grid-template-columns: minmax(0, 1fr) minmax(0, max-content); align-items: center; gap: 12px; padding: 12px 14px; }
  .performance-category-panel span { min-width: 0; line-height: 1.35; }
  .performance-category-panel strong { justify-self: end; text-align: right; font-size: clamp(.78rem, 3.2vw, 1.05rem); letter-spacing: -.015em; }
  .performance-preference-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .performance-month-filter > div { flex-direction: column; }
  .performance-target-row { grid-template-columns: minmax(0, 1fr); }
  .performance-target-edit { grid-column: 1; grid-row: auto; width: 100%; }
  .performance-dashboard__heading time { font-size: .82rem; }
  .performance-today-card__header { align-items: flex-start; }
  .performance-today-card__header .performance-card__icon { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; }
  .performance-today-grid strong { font-size: clamp(.78rem, 3.4vw, .96rem); }
  .performance-progress-card { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  .performance-ring { width: 112px; }
  .performance-ring::before { width: 84px; }
  .performance-ring strong { font-size: 1.15rem; }
  .performance-progress-copy strong { font-size: 1.35rem; }
  .performance-cat-card { align-items: flex-start; }
  .performance-cat-visual { width: 82px; height: 82px; flex-basis: 82px; border-radius: 23px; }
  .performance-cat-visual img { width: 84px; height: 84px; }
  .performance-cat-badge { top: 0; right: -2px; width: 24px; height: 24px; }
  .performance-shortcuts { grid-template-columns: 1fr 1fr; gap: 9px; }
  .performance-shortcut { flex-direction: column; justify-content: center; gap: 6px; padding: 11px 8px; text-align: center; font-size: .88rem; }
  .performance-celebration { top: max(84px, calc(env(safe-area-inset-top) + 68px)); width: calc(100vw - 24px); }
  .performance-celebration__sign { min-height: 52px; padding: 12px 14px; border-radius: 15px; }
  .performance-category-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .performance-shortcut,
  .performance-cat-visual img,
  .performance-cat-badge { transition: none; }
  .performance-shortcut:hover { transform: none; }
  .performance-cat-card.is-celebrating .performance-cat-visual img,
  .performance-celebration.is-active .performance-celebration__sign,
  .performance-celebration.is-static .performance-celebration__sign,
  .performance-celebration__stars i { animation: none; }
  .performance-celebration.is-active .performance-celebration__sign,
  .performance-celebration.is-static .performance-celebration__sign { opacity: 1; transform: none; }
}
