.en-dialog.mgh-dialog { position: fixed; display: flex; flex-direction: column; min-width: 0; margin: auto; padding: 0; color: var(--en-ink); font-size: 14px; line-height: 1.5; }
.mgh-dialog:not([open]), .mgh-dialog [hidden] { display: none !important; }
.mgh-dialog::backdrop { background: var(--theme-backdrop); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.en-dialog.mgh-history-dialog { width: min(1240px, calc(100vw - 100px)); max-height: calc(100dvh - 48px); }
.mgh-dialog .en-dialog-head, .mgh-dialog .en-dialog-actions { flex-shrink: 0; }
.mgh-dialog .en-dialog-head h2 { margin: 0; }
.mgh-dialog .en-dialog-head > button { flex: 0 0 auto; font-size: 24px; }
.mgh-dialog .en-dialog-actions { flex-wrap: wrap; margin: 0; }
.mgh-dialog .en-dialog-actions > button { min-width: 0; min-height: 40px; }
#memberGoalHistoryScroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px 24px; scrollbar-gutter: stable; }
.mgh-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; min-width: 0; margin-bottom: 14px; overflow-wrap: anywhere; }
.mgh-identity strong { font-size: 19px; }
.mgh-identity > span { color: var(--en-muted); font-size: 12px; }
.mgh-identity code { flex-basis: 100%; color: var(--en-muted); font-size: 11px; }
.mgh-today { display: grid; gap: 12px; width: 100%; padding: 16px 18px; border: 1px solid var(--glass-line); border-radius: 17px; color: inherit; background: linear-gradient(125deg, color-mix(in srgb, var(--blue-400) 14%, var(--surface-control)), var(--surface-control)); text-align: left; font: inherit; box-shadow: inset 0 1px 0 var(--glass-line); cursor: var(--site-cursor-pointer, pointer); }
.mgh-today:disabled { opacity: 1; cursor: var(--site-cursor-default, default); }
.mgh-today:not(:disabled):hover { border-color: var(--blue-400); }
.mgh-today-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.mgh-today-heading > span { color: var(--en-muted); font-size: 12px; }
.mgh-today-grid { display: grid; grid-template-columns: 1fr 1fr 1.5fr 1fr; gap: 12px; }
.mgh-today-grid > span { display: grid; align-content: start; min-width: 0; gap: 4px; }
.mgh-today-grid small { color: var(--en-muted); font-size: 11px; }
.mgh-today-grid b { max-width: 100%; overflow-x: auto; color: var(--blue-700); font-size: 18px; }
.mgh-today-grid em { display: inline-block; font-size: 12px; font-style: normal; white-space: nowrap; }
.mgh-today-note { font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.mgh-today-note small { color: var(--en-muted); font-size: inherit; }
.mgh-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.mgh-periods { position: relative; isolation: isolate; display: inline-flex; max-width: 100%; padding: 4px; gap: 3px; border: 1px solid var(--glass-line); border-radius: 14px; background: color-mix(in srgb, var(--blue-400) 10%, var(--surface-control)); }
.mgh-periods button { position: relative; z-index: 1; min-width: 53px; min-height: 34px; padding: 7px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--blue-800); font: inherit; font-size: 12px; white-space: nowrap; cursor: var(--site-cursor-pointer, pointer); transition: color .2s; }
.mgh-periods button.active { color: var(--blue-700); }
.mgh-periods .liquid-pill { border-color: var(--glass-line); border-radius: 10px; background: var(--surface-control); box-shadow: 0 3px 8px color-mix(in srgb, var(--blue-600) 12%, transparent); }
.mgh-periods .liquid-pill.flowing { border-radius: 15px; }
.mgh-range { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; margin: 12px 0 0; }
.mgh-range label { display: grid; gap: 4px; min-width: 0; }
.mgh-range label > span { color: var(--en-muted); font-size: 11px; }
.mgh-range input { width: 160px; min-width: 0; min-height: 36px; padding: 6px 9px; font-size: 12px; }
.mgh-date-to { padding-bottom: 9px; color: var(--en-muted); font-size: 12px; }
.mgh-range > button { min-height: 36px; }
.mgh-status { margin: 0; padding: 8px 0; color: var(--en-muted); font-size: 12px; overflow-wrap: anywhere; }
.mgh-status:empty { display: none; }
.mgh-status.is-error { color: var(--en-danger); }
.mgh-range-caption, .mgh-coverage-note { color: var(--en-muted); font-size: 11px; line-height: 1.7; }
.mgh-range-caption { margin: 14px 0 9px; }
.mgh-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mgh-summary-card { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 14px; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--surface-control); }
.mgh-summary-card > span { font-size: 11px; font-weight: 650; }
.mgh-summary-card > strong { max-width: 100%; overflow-x: auto; color: var(--blue-700); font-size: clamp(19px, 2vw, 26px); line-height: 1.25; }
.mgh-summary-card > strong > small { font-size: 12px; }
.mgh-summary-card > small { color: var(--en-muted); font-size: 10px; white-space: normal; }
.mgh-money { white-space: nowrap; }
.mgh-summary-card.mgh-money { overflow-x: auto; }
.mgh-chart-grid-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mgh-chart { min-width: 0; padding: 12px; border: 1px solid var(--glass-line); border-radius: 15px; background: color-mix(in srgb, var(--surface-control) 65%, transparent); }
.mgh-chart-heading, .mgh-days-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
.mgh-chart h3, .mgh-days-section h3 { margin: 0; font-size: 13px; }
.mgh-chart-legend { display: flex; gap: 10px; font-size: 10px; }
.mgh-chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.mgh-chart-legend i { width: 8px; height: 8px; border-radius: 3px; }
.mgh-chart-legend .is-goal { background: color-mix(in srgb, var(--blue-300) 60%, white); }
.mgh-chart-legend .is-actual { background: var(--blue-600); }
.mgh-chart-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.mgh-chart svg { display: block; min-width: 100%; max-width: none; overflow: visible; }
.mgh-chart-grid line { stroke: var(--en-line); stroke-dasharray: 3 5; }
.mgh-chart-grid text, .mgh-chart-label { fill: var(--en-muted); font: 10px sans-serif; }
.mgh-chart-hit { fill: transparent; }
.mgh-bar-goal { fill: color-mix(in srgb, var(--blue-300) 60%, white); }
.mgh-bar-actual { fill: var(--blue-600); }
.mgh-chart-point:hover .mgh-chart-hit, .mgh-chart-point:focus .mgh-chart-hit { fill: color-mix(in srgb, var(--blue-500) 7%, transparent); }
.mgh-chart-point:focus { outline: none; }
.mgh-chart-point:focus .mgh-chart-hit { stroke: var(--blue-500); stroke-width: 1; }
.mgh-chart-detail { min-height: 34px; margin: 0; color: var(--en-muted); font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.mgh-days-section { margin-top: 14px; min-width: 0; }
.mgh-days-heading { margin-bottom: 9px; }
.mgh-days-heading > span { color: var(--en-muted); font-size: 11px; }
.mgh-table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--en-line); border-radius: 13px; overscroll-behavior-x: contain; }
.mgh-table-scroll table { width: 100%; min-width: 950px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.mgh-table-scroll th, .mgh-table-scroll td { text-align: center; vertical-align: middle; padding: 11px 7px; border-bottom: 1px solid var(--en-line); }
.mgh-table-scroll th { color: var(--blue-800); background: var(--surface-control); font-size: 11px; }
.mgh-table-scroll th:first-child { width: 104px; }
.mgh-table-scroll th:nth-child(3), .mgh-table-scroll th:nth-child(5) { width: 145px; }
.mgh-table-scroll th:last-child { width: 175px; }
.mgh-table-scroll tbody tr:last-child td { border-bottom: 0; }
.mgh-note-cell { white-space: pre-wrap; overflow-wrap: anywhere; }
.mgh-empty { color: var(--en-muted); padding: 28px; text-align: center; font-size: 12px; }
.mgh-pagination { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 12px; }
.mgh-pagination span { font-size: 12px; color: var(--en-muted); }
.en-dialog.mgh-edit-dialog, .en-dialog.mgh-warning { width: min(630px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
#memberGoalEditForm { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
#memberGoalEditForm > .en-dialog-body { min-height: 0; gap: 14px; overflow: auto; overscroll-behavior: contain; }
.mgh-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.mgh-edit-dialog .en-field { min-width: 0; }
.mgh-edit-dialog .en-input { width: 100%; min-width: 0; box-sizing: border-box; }
.mgh-edit-dialog textarea { resize: vertical; min-height: 80px; max-height: 180px; }
.mgh-standard-note { margin: 0; padding: 11px; border: 1px solid var(--en-line); border-radius: 11px; color: var(--en-muted); background: var(--surface-control); font-size: 12px; }
#memberGoalEditStatus { flex-shrink: 0; max-height: 120px; overflow: auto; padding-inline: 24px; }
.mgh-standard-comparison { display: grid; gap: 10px; }
.mgh-standard-comparison > div { display: flex; flex-wrap: wrap; gap: 5px 14px; padding: 12px; border: 1px solid var(--en-line); border-radius: 12px; background: var(--surface-control); }
.mgh-standard-comparison strong { flex-basis: 100%; }
.mgh-standard-comparison span { font-size: 12px; }
.mgh-standard-comparison .is-below { border-color: color-mix(in srgb, var(--en-danger) 25%, var(--en-line)); }
.mgh-standard-comparison .is-below strong { color: var(--en-danger); }
.mgh-dialog button:focus-visible, .mgh-dialog [tabindex]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
@media (max-width: 900px) {
  .mgh-chart-grid-layout { grid-template-columns: minmax(0, 1fr); }
  .mgh-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mgh-today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .en-dialog.mgh-history-dialog, .en-dialog.mgh-edit-dialog, .en-dialog.mgh-warning { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); }
  #memberGoalHistoryScroll { padding: 14px 12px; }
  .mgh-today { padding: 13px; }
  .mgh-today-grid { gap: 12px 8px; }
  .mgh-today-grid b { font-size: 16px; }
  .mgh-today-grid em { display: block; margin-top: 2px; }
  .mgh-toolbar { gap: 6px; flex-wrap: wrap; }
  .mgh-periods { flex: 1 1 auto; gap: 1px; }
  .mgh-periods button { flex: 1; min-width: 35px; padding: 7px 6px; }
  .mgh-range { gap: 8px; }
  .mgh-range label { flex: 1 1 40%; }
  .mgh-range input { width: 100%; box-sizing: border-box; }
  .mgh-date-to { display: none; }
  .mgh-range > button { flex-basis: 100%; }
  .mgh-summary-card { padding: 11px 9px; }
  .mgh-chart { padding: 10px; }
  .mgh-edit-grid { grid-template-columns: minmax(0, 1fr); }
  #memberGoalEditReload { flex-basis: 100%; }
  #memberGoalEditStatus { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .mgh-periods button, .mgh-periods .liquid-pill { transition: none !important; }
}
