.goals-page {
  min-height: 100vh;
  padding: 16px 48px 56px;
  background: linear-gradient(135deg, #fefefe 0%, #f4f4f4 100%);
  color: #111111;
  font-family: 'DM Sans', sans-serif;
}

.goals-shell {
  width: min(100%, 1220px);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.goals-panel {
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
}

.goals-hero {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  padding: 30px 34px;
}

.goals-kicker,
.goals-label,
.goals-stat-label,
.goal-card__label {
  margin: 0;
  color: #555555;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.goals-title {
  margin: 8px 0 12px;
  font-family: 'NeonBold', 'DM Sans', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.goals-copy {
  margin: 0;
  max-width: 68ch;
  color: #2d2d2d;
  font-size: 1rem;
  line-height: 1.55;
}

.goals-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.goals-stat {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px 18px;
  border: 2px solid #111111;
  border-radius: 18px;
  background: #f8fafc;
  align-content: center;
  color: #111111;
  text-decoration: none;
}

.goals-stat--link:hover,
.goals-stat--link:focus-visible {
  background: #111111;
  color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.1);
}

.goals-stat--link:hover .goals-stat-label,
.goals-stat--link:focus-visible .goals-stat-label,
.goals-stat--link:hover span:last-child,
.goals-stat--link:focus-visible span:last-child {
  color: rgba(255, 255, 255, 0.86);
}

.goals-stat strong {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1;
  font-weight: 800;
}

.goals-stat span:last-child {
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.35;
}

.goals-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.goals-builder,
.goals-active {
  padding: 28px 30px;
  display: grid;
  gap: 22px;
}

.goals-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 2px solid #111111;
  padding-bottom: 12px;
}

.goals-section-header h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.goals-form {
  display: grid;
  gap: 18px;
}

[hidden] {
  display: none !important;
}

.goals-form[hidden],
.goal-builder-panel[hidden],
.goal-source-card-grid[hidden],
.goal-type-grid[hidden],
.streak-builder[hidden] {
  display: none !important;
}

.goal-flow-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 2px solid #111111;
  border-radius: 18px;
  background: #f8fafc;
}

.goal-flow-tab {
  min-height: 68px;
  padding: 14px 16px;
  border: 2px solid #8b8b8b;
  border-radius: 14px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  text-align: left;
  font: inherit;
  display: grid;
  gap: 5px;
}

.goal-flow-tab[aria-selected="true"] {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

.goal-flow-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.goal-flow-tab strong {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-flow-tab span {
  color: currentColor;
  font-size: 0.84rem;
  line-height: 1.25;
  opacity: 0.72;
}

.goal-builder-panel {
  display: grid;
  gap: 18px;
}

.goal-source-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.goal-source-type-button {
  min-height: 40px;
  padding: 0 16px;
  border: 2px solid #111111;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font: 800 0.8rem/1 'DM Sans', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-source-type-button[aria-pressed="true"],
.goal-source-type-button:hover,
.goal-source-type-button:focus-visible {
  background: #111111;
  color: #ffffff;
  outline: none;
}

.goal-source-summary {
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid #111111;
  border-radius: 14px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.goal-source-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.goal-source-card-grid[data-goal-wizard-step="dictionary"] {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.goal-source-card {
  min-height: 118px;
  padding: 16px;
  border: 2px solid #111111;
  border-radius: 16px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  display: grid;
  align-content: space-between;
  gap: 12px;
  text-align: left;
  font: inherit;
  box-shadow: 0 8px 16px rgba(17, 17, 17, 0.06);
}

.goal-source-card:hover,
.goal-source-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.goal-source-card[aria-pressed="true"] {
  background: #111111;
  color: #ffffff;
}

.goal-source-card strong {
  font-size: 1rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.goal-source-card span {
  color: currentColor;
  opacity: 0.72;
  font-size: 0.86rem;
  line-height: 1.3;
}

.goal-routine-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.goal-plan-panel {
  grid-column: 1 / -1;
}

.goal-routine-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid #111111;
  border-radius: 16px;
  background: #f8fafc;
  min-width: 0;
}

.goal-routine-panel[hidden] {
  display: none !important;
}

.goal-routine-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.goal-routine-panel__title {
  margin: 0;
  color: #111111;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.goal-routine-status {
  min-height: 40px;
  padding: 10px 12px;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.goal-bonus-rules {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid #111111;
  border-radius: 14px;
  background: #ffffff;
}

.goal-bonus-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  color: #111111;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

.goal-bonus-rule span {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.goal-bonus-rule strong {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.goal-scope-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.goal-scope-button {
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid #111111;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font: 800 0.78rem/1 'DM Sans', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.goal-scope-button[aria-pressed="true"],
.goal-scope-button:hover,
.goal-scope-button:focus-visible {
  background: #111111;
  color: #ffffff;
  outline: none;
}

.goal-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.goal-range-fields[hidden] {
  display: none !important;
}

.goal-builder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.goal-create-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.goal-wizard-intro {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid #111111;
  border-radius: 16px;
  background: #f8fafc;
}

.goal-wizard-intro strong {
  color: #111111;
  font-size: 1.08rem;
  line-height: 1.2;
}

.goal-wizard-intro p {
  margin: 0;
  color: #334155;
  font-size: 0.94rem;
  line-height: 1.45;
}

.goal-wizard-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.goal-wizard-track__step {
  min-height: 8px;
  border: 2px solid #111111;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.04);
}

.goal-wizard-track__step.is-current,
.goal-wizard-track__step.is-complete {
  background: #111111;
}

.goal-wizard-track__step.is-current {
  box-shadow: 0 0 18px rgba(17, 17, 17, 0.24);
}

.goal-wizard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.goal-assignment-panel {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 2px solid #111111;
  border-radius: 16px;
  background: #f8fafc;
}

.goal-assignment-panel[hidden] {
  display: none !important;
}

.goal-assignment-status {
  min-height: 44px;
  padding: 10px 12px;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  display: flex;
  align-items: center;
}

.goal-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.goal-type-button {
  min-height: 84px;
  padding: 16px;
  border: 2px solid #111111;
  border-radius: 16px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font: inherit;
  display: grid;
  align-content: center;
  gap: 8px;
  box-shadow: 0 8px 16px rgba(17, 17, 17, 0.06);
}

.goal-type-button:hover,
.goal-type-button:focus-visible {
  background: #f8fafc;
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.goal-type-button strong {
  font-size: 1rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.goal-type-button span {
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.35;
}

.streak-builder {
  display: grid;
  gap: 18px;
}

.streak-step {
  display: grid;
  gap: 10px;
}

.streak-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.streak-option {
  position: relative;
  min-height: 62px;
  padding: 12px 14px;
  border: 2px solid #111111;
  border-radius: 14px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font: 800 0.9rem/1.2 'DM Sans', sans-serif;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.streak-option:hover,
.streak-option:focus-visible,
.streak-option[aria-pressed="true"] {
  background: #111111;
  color: #ffffff;
  outline: none;
}

.streak-option[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 5;
  width: min(280px, 72vw);
  padding: 10px 12px;
  border: 2px solid #111111;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 12px 24px rgba(17, 17, 17, 0.16);
  font: 600 0.82rem/1.35 'DM Sans', sans-serif;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.streak-option[data-tooltip]:hover::after,
.streak-option[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.streak-custom-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.5fr);
  gap: 12px;
  padding: 14px;
  border: 2px dashed #94a3b8;
  border-radius: 16px;
  background: #f8fafc;
}

.streak-custom-detail[hidden] {
  display: none !important;
}

.goals-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 12px;
}

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

.goals-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  align-content: start;
}

.goals-input,
.goals-select,
.goals-textarea {
  width: 100%;
  min-height: 44px;
  border: 2px solid #111111;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  font: 500 0.94rem/1.35 'DM Sans', sans-serif;
  box-sizing: border-box;
}

.goals-input,
.goals-select {
  padding: 0 12px;
}

.goals-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #111111 50%),
    linear-gradient(135deg, #111111 50%, transparent 50%);
  background-position:
    calc(100% - 21px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.goals-textarea {
  min-height: 138px;
  resize: vertical;
  padding: 12px;
}

.goals-input:focus,
.goals-select:focus,
.goals-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.goals-source-detail[hidden],
.goals-empty[hidden],
.goal-card[hidden] {
  display: none !important;
}

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

.goals-mode-options--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.goals-mode-options--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.goals-mode-options--core {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.goals-mode-specialized {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.goals-mode-specialized__title {
  margin: 0;
  color: #5f5f5f;
  font: 800 0.78rem/1.1 'DM Sans', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.goals-mode-options--load {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.goals-mode-options--load .goals-mode-option:nth-child(3) {
  grid-column: 1 / -1;
}

.goal-mode-customization {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.goal-mode-customization[hidden] {
  display: none !important;
}

.goal-mode-customization__group {
  display: grid;
  gap: 8px;
}

.goals-frequency-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.goals-mode-option,
.goals-frequency-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 72px;
  padding: 12px 14px;
  border: 2px solid #111111;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
}

.goals-mode-options--compact .goals-mode-option {
  min-height: 64px;
}

.goals-frequency-option {
  min-height: 58px;
}

.goals-mode-option input,
.goals-frequency-option input {
  margin-top: 3px;
  accent-color: #111111;
}

.goals-mode-option:hover,
.goals-mode-option:focus-within,
.goals-frequency-option:hover,
.goals-frequency-option:focus-within {
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.goals-mode-option:has(input:checked) {
  background: #111111;
  color: #ffffff;
}

.goals-mode-option strong,
.goals-frequency-option strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.2;
}

.goals-mode-option span,
.goals-frequency-option span {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.35;
}

.goals-mode-option:has(input:checked) span,
.goals-mode-option:has(input:checked) span span {
  color: rgba(255, 255, 255, 0.82);
}

.goals-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.goals-button {
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid #111111;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  font: 800 0.84rem/1 'DM Sans', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.goals-button--secondary {
  background: #ffffff;
  color: #111111;
}

.goals-button--danger {
  background: #8b1f2a;
  color: #ffffff;
  border-color: #8b1f2a;
}

.goals-button--reward {
  --goal-reward-panel-background:
    radial-gradient(circle at center, rgba(0, 255, 255, 0.2), transparent 34%),
    linear-gradient(145deg, #071016 0%, #111111 52%, #233146 100%);
  --goal-reward-panel-scan:
    linear-gradient(115deg, transparent 0 18%, rgba(0, 255, 0, 0.14) 19%, transparent 20% 45%, rgba(0, 255, 255, 0.12) 46%, transparent 48% 100%);
  --goal-reward-panel-dots:
    radial-gradient(circle at 18% 24%, rgba(218, 236, 38, 0.94) 0 5px, rgba(218, 236, 38, 0.24) 6px 17px, transparent 18px),
    radial-gradient(circle at 70% 34%, rgba(47, 216, 139, 0.9) 0 6px, rgba(47, 216, 139, 0.24) 7px 20px, transparent 21px),
    radial-gradient(circle at 84% 78%, rgba(0, 255, 255, 0.52) 0 4px, rgba(0, 255, 255, 0.16) 5px 15px, transparent 16px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 58px;
  min-width: 190px;
  padding: 0 24px;
  border-radius: 16px;
  background: var(--goal-reward-panel-background);
  color: #ffffff;
  box-shadow: 0 10px 0 rgba(7, 16, 22, 0.34), 0 0 22px rgba(0, 255, 255, 0.28);
  animation: goalRewardPulse 1.55s ease-in-out infinite;
}

.goals-button--reward::before,
.goals-button--reward::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.goals-button--reward::before {
  background: var(--goal-reward-panel-scan);
  background-size: 260px 260px;
  animation: goalRewardScan 10s linear infinite;
}

.goals-button--reward::after {
  background: var(--goal-reward-panel-dots);
  opacity: 0.94;
  animation: goalRewardDots 5.6s ease-in-out infinite alternate;
}

.goals-button--reward:hover,
.goals-button--reward:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 13px 0 rgba(7, 16, 22, 0.34), 0 0 34px rgba(0, 255, 255, 0.42);
  outline: none;
}

.goals-button--reward span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.goals-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.goals-delete-dialog,
.goals-launch-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 2px solid #111111;
  border-radius: 24px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 28px 70px rgba(17, 17, 17, 0.26);
}

.goals-launch-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at center, rgba(0, 255, 255, 0.16), transparent 34%),
    linear-gradient(145deg, #071016 0%, #111111 52%, #233146 100%);
  color: #ffffff;
}

.goals-launch-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(0, 255, 0, 0.08) 19%, transparent 20% 45%, rgba(0, 255, 255, 0.08) 46%, transparent 48% 100%);
  background-size: 260px 260px;
  opacity: 0.72;
  animation: goalRewardScan 10s linear infinite;
}

.goals-launch-dialog > * {
  position: relative;
  z-index: 1;
}

.goals-delete-dialog::backdrop,
.goals-launch-dialog::backdrop {
  background: rgba(17, 17, 17, 0.48);
  backdrop-filter: blur(2px);
}

.goals-delete-dialog__body,
.goals-launch-dialog__body {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.goals-launch-dialog__body {
  justify-items: center;
  gap: 24px;
  padding: 36px;
  text-align: center;
}

.goals-delete-dialog__title,
.goals-launch-dialog__title {
  margin: 0;
  color: #111111;
  font: 800 1.35rem/1.15 'DM Sans', sans-serif;
  letter-spacing: 0;
}

.goals-launch-dialog__title {
  color: #ffffff;
  max-width: 100%;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
}

.goals-launch-dialog .goals-label {
  color: rgba(255, 255, 255, 0.68);
}

.goals-delete-dialog__copy,
.goals-launch-dialog__copy {
  margin: 0;
  color: #475569;
  font-size: 0.98rem;
  line-height: 1.45;
}

.goals-launch-dialog__copy[hidden],
.goals-launch-summary[hidden] {
  display: none !important;
}

.goals-launch-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
}

.goals-launch-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  padding: 0;
  overflow-x: auto;
  background: transparent;
  box-shadow: none;
}

.goals-launch-preview[hidden] {
  display: none !important;
}

.goals-launch-preview__image,
.goals-launch-preview__slot {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.goals-launch-preview__image {
  display: block;
  object-fit: cover;
}

.goals-launch-preview__slot {
  opacity: 0.55;
}

.goals-launch-summary__chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid #111111;
  border-radius: 999px;
  background: #f8fafc;
  color: #111111;
  font: 800 0.78rem/1.1 'DM Sans', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.goals-launch-edit {
  display: grid;
  gap: 12px;
}

.goals-launch-edit[hidden] {
  display: none !important;
}

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

.goals-launch-choice:nth-child(3) {
  grid-column: 1 / -1;
}

.goals-launch-choice {
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border: 2px solid #111111;
  border-radius: 14px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: grid;
  gap: 5px;
}

.goals-launch-choice:hover,
.goals-launch-choice:focus-visible,
.goals-launch-choice[aria-pressed="true"] {
  background: #f8fafc;
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.goals-launch-choice[aria-pressed="true"] {
  background: #111111;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.14);
}

.goals-launch-choice strong {
  font-size: 0.96rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.goals-launch-choice span {
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.35;
}

.goals-launch-choice[aria-pressed="true"] span {
  color: rgba(255, 255, 255, 0.78);
}

.goals-launch-dialog__modes,
.goals-launch-dialog__scope {
  display: grid;
  gap: 10px;
}

.goals-launch-dialog__modes {
  grid-template-columns: 1fr;
}

.goals-launch-dialog__panel[hidden] {
  display: none !important;
}

.goals-launch-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.goals-launch-tab {
  min-height: 46px;
  padding: 8px 10px;
  border: 2px solid #111111;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font: 800 0.82rem/1.1 'DM Sans', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goals-launch-tab:hover,
.goals-launch-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.goals-launch-tab[aria-selected="true"] {
  background: #111111;
  color: #ffffff;
}

.goals-launch-dialog__scope > .goals-label {
  grid-column: 1 / -1;
}

.goals-launch-dialog__scope {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.goals-launch-scope-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 66px;
  padding: 12px;
  border: 2px solid #111111;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
}

.goals-launch-scope-option input {
  margin-top: 2px;
  accent-color: #111111;
}

.goals-launch-scope-option:has(input:checked) {
  background: #111111;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.14);
}

.goals-launch-scope-option:has(input:checked) input {
  accent-color: #ffffff;
}

.goals-launch-scope-option strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.goals-launch-scope-option span span {
  display: block;
  margin-top: 4px;
  color: inherit;
  font-size: 0.78rem;
  line-height: 1.3;
  opacity: 0.78;
}

.goals-delete-dialog__actions,
.goals-launch-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.goals-launch-dialog__actions--primary {
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 0;
  width: 100%;
}

.goals-launch-dialog__actions--primary .goals-button {
  min-height: 44px;
  background: #ffffff;
  color: #111111;
  border-color: #ffffff;
  box-shadow: none;
  animation: none;
  transform: none;
}

#goal-launch-start {
  order: 2;
  gap: 10px;
  justify-content: center;
  min-width: 220px;
  min-height: 72px;
  padding: 0 28px;
  border-radius: 22px;
}

#goal-launch-edit-toggle {
  order: 1;
}

#goal-launch-cancel {
  order: 3;
}

.goals-launch-dialog__actions--primary .goals-button--secondary {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.78);
}

.goals-launch-dialog__actions--primary .goals-button::before,
.goals-launch-dialog__actions--primary .goals-button::after {
  content: none !important;
}

.goals-launch-dialog__actions--primary .goals-button span {
  position: static;
  text-shadow: none;
}

.goals-delete-dialog__actions .goals-button,
.goals-launch-dialog__actions .goals-button {
  min-width: 112px;
}

.goals-status {
  min-height: 20px;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.35;
}

.goals-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 14px;
  align-items: stretch;
}

.goal-student-progress {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid #111111;
  border-radius: 16px;
  background: #f8fafc;
}

.goal-student-progress[hidden] {
  display: none !important;
}

.goal-student-progress__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.goal-student-progress__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.goal-student-progress__item {
  min-height: 72px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  align-content: center;
  gap: 5px;
}

.goal-student-progress__label {
  color: #555555;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-student-progress__value {
  color: #111111;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
}

.goals-empty {
  margin: 0;
  padding: 18px 20px;
  border: 2px dashed #94a3b8;
  border-radius: 16px;
  color: #475569;
  background: #f8fafc;
}

.goal-card {
  --goal-card-panel-background:
    radial-gradient(circle at center, rgba(0, 255, 255, 0.2), transparent 34%),
    linear-gradient(145deg, #071016 0%, #111111 52%, #233146 100%);
  --goal-card-panel-scan:
    linear-gradient(115deg, transparent 0 18%, rgba(0, 255, 0, 0.14) 19%, transparent 20% 45%, rgba(0, 255, 255, 0.12) 46%, transparent 48% 100%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
  min-height: 224px;
  padding: 18px;
  border: 2px solid #111111;
  border-radius: 18px;
  background: var(--goal-card-panel-background);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(17, 17, 17, 0.18), 0 0 22px rgba(0, 255, 255, 0.22);
  cursor: pointer;
  min-width: 0;
}

.goal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.goal-card::before {
  background: var(--goal-card-panel-scan);
  background-size: 260px 260px;
  opacity: 0.9;
  animation: goalRewardScan 10s linear infinite;
}

.goal-card::after {
  content: none;
}

.goal-card > * {
  position: relative;
  z-index: 1;
}

.goal-card:hover,
.goal-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 255, 255, 0.14), 0 12px 26px rgba(17, 17, 17, 0.22), 0 0 34px rgba(0, 255, 255, 0.34);
}

.goal-card--complete {
  border-color: #2fd88b;
}

.goal-card.is-editing {
  cursor: default;
}

.goal-card--play-preset {
  --goal-card-play-content-width: 172px;
  align-self: start;
  justify-content: center;
  align-items: center;
  gap: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 15px;
}

.goal-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.goal-card--play-preset .goal-card__head {
  display: grid;
  justify-content: center;
  width: min(100%, var(--goal-card-play-content-width));
  text-align: center;
}

.goal-card__identity {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.goal-card--play-preset .goal-card__identity {
  justify-items: center;
  width: 100%;
  gap: 7px;
}

.goal-card--play-preset .goal-card__label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.66rem;
  text-align: center;
}

.goal-card__title {
  margin: 4px 0 0;
  font-size: 1rem;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.68);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.goal-card--play-preset .goal-card__title {
  width: 100%;
  max-width: var(--goal-card-play-content-width);
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.12;
  text-align: center;
  -webkit-line-clamp: 2;
}

.goal-card__preview {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-auto-rows: 48px;
  gap: 8px;
  min-height: 104px;
  margin: 2px 0;
  overflow: hidden;
}

.goal-card--play-preset .goal-card__preview {
  grid-template-columns: repeat(3, 45px);
  grid-auto-rows: 45px;
  justify-content: center;
  gap: 7px;
  min-height: 97px;
  width: 149px;
  max-width: 100%;
  margin: 0 auto;
  overflow: visible;
}

.goal-card__preview-image,
.goal-card__preview-slot {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.goal-card--play-preset .goal-card__preview-image,
.goal-card--play-preset .goal-card__preview-slot {
  width: 45px;
  height: 45px;
  border-radius: 9px;
}

.goal-card__preview-image {
  display: block;
  object-fit: cover;
}

.goal-card__preview-slot {
  opacity: 0.55;
}

.goal-card__badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.goal-card__chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111111;
  font-size: 0.84rem;
  font-weight: 700;
  max-width: 100%;
}

.goal-progress {
  display: grid;
  gap: 8px;
}

.goal-card__identity .goal-progress {
  margin-top: 2px;
}

.goal-card--play-preset .goal-card__identity .goal-progress {
  width: min(100%, var(--goal-card-play-content-width));
  justify-self: center;
}

.goal-progress__bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.goal-progress__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9ec26, #2fd88b, #00ffff);
  transition: width 0.24s ease;
}

.goal-progress__caption {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  line-height: 1.35;
}

.goal-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.goal-card__actions .goals-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.74rem;
  border-radius: 10px;
}

.goals-check-option {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
}

.goals-footer-panel {
  padding: 22px 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.goals-footnote {
  padding: 16px 18px;
  border: 2px solid #111111;
  border-radius: 16px;
  background: #f8fafc;
}

.goals-footnote strong {
  display: block;
  margin-bottom: 6px;
}

.goals-footnote span {
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.4;
}

@keyframes goalRewardScan {
  from { background-position: 0 0; }
  to { background-position: 260px 260px; }
}

@keyframes goalRewardPulse {
  0%, 100% { box-shadow: 0 10px 0 rgba(7, 16, 22, 0.34), 0 0 18px rgba(0, 255, 255, 0.24); }
  50% { box-shadow: 0 10px 0 rgba(7, 16, 22, 0.34), 0 0 34px rgba(0, 255, 255, 0.46); }
}

@keyframes goalRewardDots {
  0%, 100% { opacity: 0.82; transform: translate3d(0, 0, 0); }
  50% { opacity: 1; transform: translate3d(2px, -3px, 0); }
}

@media (max-width: 980px) {
  .goals-page {
    padding: 16px 20px 40px;
  }

  .goals-hero,
  .goals-workspace,
  .goal-routine-grid,
  .goals-footer-panel {
    grid-template-columns: 1fr;
  }

  .goals-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goal-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .goals-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .goals-hero,
  .goals-builder,
  .goals-active,
  .goals-footer-panel {
    padding: 20px;
  }

  .goals-summary,
  .goals-grid,
  .goal-assignment-panel,
  .goal-student-progress__grid,
  .goal-flow-tabs,
  .goals-mode-options,
  .goals-mode-options--compact,
  .goals-mode-options--triple,
  .goals-mode-options--core,
  .goals-mode-options--load,
  .goals-frequency-options,
  .goal-scope-toggle,
  .goal-range-fields,
  .goal-type-grid,
  .goals-launch-dialog__choices,
  .goals-launch-dialog__modes .goals-mode-options--core,
  .goals-launch-tabs,
  .goals-launch-dialog__scope,
  .streak-custom-detail {
    grid-template-columns: 1fr;
  }

  .goal-wizard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goal-wizard-actions .goals-button {
    width: 100%;
  }

  .goal-wizard-actions .goals-button--reward {
    grid-column: 1 / -1;
    order: -1;
  }

  .goal-card__head {
    display: grid;
  }
}
