:root {
  color-scheme: light;
  --ink: #18211b;
  --muted: #66716a;
  --surface: #fffef9;
  --surface-soft: #f3f4ed;
  --line: #d9ddd5;
  --brand: #1d6a4a;
  --brand-dark: #124a34;
  --brand-soft: #dcefe5;
  --ahead: #176b45;
  --behind: #a43d2e;
  --behind-soft: #fbe4df;
  --warning: #8a5a13;
  --warning-soft: #fff0ce;
  --shadow: 0 18px 50px rgb(31 49 39 / 8%);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgb(215 237 225 / 65%), transparent 34rem),
    #eef0e9;
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  padding: 56px 0 34px;
}

.eyebrow,
.section-number {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

main {
  display: grid;
  gap: 22px;
  padding-bottom: 56px;
}

body.has-quick-progress main {
  padding-bottom: 128px;
}

.panel {
  min-width: 0;
  max-width: 100%;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgb(217 221 213 / 90%);
  border-radius: var(--radius);
  background: rgb(255 254 249 / 95%);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.025em;
}

.save-status,
.activity-list-status,
.table-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.editor-status,
.activity-list-controls {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
}

.activity-list-controls {
  flex-direction: column;
  align-items: flex-end;
}

.activity-list-buttons {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.activity-list[hidden] {
  display: none;
}

.activity-list > .activity-card {
  min-width: 0;
  max-width: 100%;
}

.activity-card {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.activity-card:hover {
  border-color: #9faf9f;
}

.activity-card-selected {
  grid-column: 1 / -1;
  border-color: var(--brand);
  background: #fbfffc;
  box-shadow: 0 0 0 2px rgb(29 106 74 / 14%);
}

.activity-card-header {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.activity-card-select {
  display: block;
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.activity-card-select:focus-visible,
.activity-card-icon-button:focus-visible {
  outline: 3px solid rgb(29 106 74 / 24%);
  outline-offset: 3px;
}

.activity-card-title {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.activity-card-game,
.activity-card-name,
.activity-card-meta,
.activity-card-stat-label,
.activity-card-stat-value {
  display: block;
}

.activity-card-game {
  margin-bottom: 3px;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.activity-card-name {
  font-size: 1.03rem;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.activity-card-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.activity-card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.activity-card-icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.activity-card-icon-button:hover {
  border-color: #9faf9f;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.activity-card-icon-button-delete {
  color: #8b625b;
}

.activity-card-icon-button-delete:hover,
.activity-card-icon-button-delete:focus-visible {
  border-color: #d8a59d;
  background: var(--behind-soft);
  color: var(--behind);
}

.activity-card-icon {
  width: 18px;
  height: 18px;
}

.activity-card-compact-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.activity-card-stat-label {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.activity-card-stat-value {
  font-size: 0.95rem;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.activity-card-expanded {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.activity-card-detail-grid {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin-bottom: 14px;
}

.activity-card-detail-item {
  min-width: 0;
  max-width: 100%;
  padding-block: 1px;
}

.activity-card-detail-label,
.activity-card-detail-value {
  display: block;
}

.activity-card-detail-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.activity-card-detail-value {
  max-width: 100%;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 780;
  white-space: nowrap;
}

.activity-card-expanded-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.activity-card-expanded-stat {
  min-width: 0;
  padding: 13px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.activity-card-expanded-label,
.activity-card-expanded-value {
  display: block;
}

.activity-card-expanded-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.activity-card-expanded-value {
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.activity-card-schedule-link,
.section-jump-button {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 760;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.activity-card-schedule-link {
  display: block;
  margin: 12px 0 0 auto;
  padding: 7px 0;
}

.activity-card-schedule-link:hover,
.section-jump-button:hover {
  color: var(--brand);
}

.activity-card-schedule-link:focus-visible,
.section-jump-button:focus-visible {
  outline: 3px solid rgb(29 106 74 / 24%);
  outline-offset: 3px;
  border-radius: 4px;
}

.schedule-heading-actions {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.section-jump-button {
  padding: 4px 0;
  white-space: normal;
}

.form-grid {
  display: grid;
  min-width: 0;
  min-inline-size: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px 20px;
}

.form-grid[hidden] {
  display: none;
}

.field {
  min-width: 0;
  max-width: 100%;
}

.field-wide {
  grid-column: 1 / -1;
}

.custom-plan-period-toggle {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.field .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}

.field .checkbox-label input {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
}

.custom-plan-period-fields {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px 20px;
}

.custom-plan-period-fields[hidden] {
  display: none;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.9rem;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #bcc5bd;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input[type="date"] {
  width: min(100%, 17rem);
}

fieldset:disabled input,
fieldset:disabled select {
  opacity: 1;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background: var(--surface-soft);
  cursor: default;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(29 106 74 / 14%);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--behind);
}

.field-hint,
.field-error {
  margin: 6px 0 0;
  font-size: 0.84rem;
}

.field-hint {
  color: var(--muted);
}

.field-error {
  min-height: 1.15em;
  color: var(--behind);
  font-weight: 650;
}

.error-summary {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid #e1a49a;
  border-radius: 10px;
  background: var(--behind-soft);
  color: #74291f;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
}

.button {
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 760;
  transition: transform 120ms ease, background-color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid rgb(29 106 74 / 24%);
  outline-offset: 2px;
}

.button-primary {
  background: var(--brand);
  color: #fff;
}

.button-primary:hover {
  background: var(--brand-dark);
}

.button-secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.storage-note {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-neutral {
  background: var(--surface-soft);
  color: var(--muted);
}

.status-active,
.status-achieved {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.status-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-behind {
  background: var(--behind-soft);
  color: var(--behind);
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed #c6ccc5;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.text-ahead {
  color: var(--ahead);
}

.text-behind {
  color: var(--behind);
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.schedule-mobile-label {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

td {
  font-size: 0.9rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.progress-date-row {
  background: var(--brand-soft);
}

.numeric {
  text-align: right;
}

.date-marker {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.74rem;
  font-weight: 700;
  vertical-align: middle;
}

.activity-editor-dialog {
  width: min(760px, calc(100% - 32px));
  max-width: 760px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
  box-shadow: 0 24px 70px rgb(18 33 25 / 28%);
}

.activity-editor-dialog::backdrop {
  background: rgb(18 33 25 / 52%);
}

.activity-editor-sheet {
  max-height: min(88dvh, 780px);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
  background: var(--surface);
}

.activity-editor-sheet input,
.activity-editor-sheet select {
  font-size: 16px;
}

.activity-editor-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.games-dialog {
  width: min(460px, calc(100% - 32px));
  max-width: 460px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
  box-shadow: 0 24px 70px rgb(18 33 25 / 28%);
}

.games-dialog::backdrop {
  background: rgb(18 33 25 / 52%);
}

.games-sheet {
  max-height: min(82dvh, 680px);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
  background: var(--surface);
}

.games-header {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.games-status {
  max-width: 15rem;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.games-list-empty {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px dashed #bfc7bf;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.games-list {
  display: grid;
  max-height: min(38dvh, 300px);
  margin: 0 0 18px;
  padding: 0;
  gap: 8px;
  overflow-y: auto;
  list-style: none;
}

.games-list[hidden] {
  display: none;
}

.games-list-item {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.games-list-name {
  min-width: 0;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.games-delete-button {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #8b625b;
  cursor: pointer;
}

.games-delete-button:hover,
.games-delete-button:focus-visible {
  border-color: #d8a59d;
  background: var(--behind-soft);
  color: var(--behind);
}

.games-delete-button:focus-visible {
  outline: 3px solid rgb(29 106 74 / 24%);
  outline-offset: 2px;
}

.games-form {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.games-form input {
  font-size: 16px;
}

.games-form .button {
  margin-bottom: 1.15em;
}

.games-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.backup-dialog {
  width: min(500px, calc(100% - 32px));
  max-width: 500px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
  box-shadow: 0 24px 70px rgb(18 33 25 / 28%);
}

.backup-dialog::backdrop {
  background: rgb(18 33 25 / 52%);
}

.backup-sheet {
  max-height: min(86dvh, 760px);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
  background: var(--surface);
}

.backup-header {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.backup-status {
  max-width: 16rem;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.backup-error {
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid #e1a49a;
  border-radius: 10px;
  background: var(--behind-soft);
  color: #74291f;
  font-size: 0.9rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.backup-error[hidden] {
  display: none;
}

.backup-section {
  min-width: 0;
  max-width: 100%;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.backup-section h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.backup-section > p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.backup-section .backup-warning {
  padding-left: 10px;
  border-left: 3px solid #d6a34f;
  color: var(--warning);
}

.backup-dialog input {
  font-size: 16px;
}

.backup-file-name {
  min-height: 1.4em;
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.backup-summary {
  margin: 0 0 16px;
  padding: 10px 0;
  border-block: 1px solid var(--line);
}

.backup-summary[hidden] {
  display: none;
}

.backup-summary dl {
  display: grid;
  margin: 0;
  gap: 7px;
}

.backup-summary dl > div {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.backup-summary dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.backup-summary dd {
  min-width: 0;
  margin: 0;
  font-weight: 750;
  text-align: right;
  overflow-wrap: anywhere;
}

.button-import-danger {
  border-color: #d8a59d;
  background: #fff7f5;
  color: #842f24;
}

.button-import-danger:hover:not(:disabled) {
  background: var(--behind-soft);
}

.button-import-danger:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.quick-progress-button {
  position: fixed;
  z-index: 20;
  right: max(16px, calc(env(safe-area-inset-right) + 16px));
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 16px));
  box-shadow: 0 10px 28px rgb(18 74 52 / 28%);
}

.quick-progress-button[hidden] {
  display: none;
}

.quick-progress-dialog {
  width: min(460px, calc(100% - 32px));
  max-width: 460px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
  box-shadow: 0 24px 70px rgb(18 33 25 / 28%);
}

.quick-progress-dialog::backdrop {
  background: rgb(18 33 25 / 52%);
}

.quick-progress-sheet {
  max-height: min(80dvh, 640px);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
  background: var(--surface);
}

.quick-progress-header {
  margin-bottom: 20px;
}

.quick-progress-activity {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.quick-progress-error {
  margin-bottom: 16px;
}

.quick-progress-fields {
  display: grid;
  gap: 16px;
}

.quick-progress-fields input {
  font-size: 16px;
}

.quick-progress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.site-footer {
  padding: 0 0 36px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    padding-top: 38px;
  }

  .activity-list,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-wide {
    grid-column: auto;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .storage-note {
    flex-basis: 100%;
    margin: 5px 0 0;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
  }

  .panel {
    border-radius: 14px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .schedule-heading-actions {
    width: 100%;
    align-items: flex-start;
  }

  .activity-card-detail-grid,
  .activity-card-expanded-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .custom-plan-period-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .save-status,
  .table-caption {
    text-align: left;
  }

  .editor-status {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .activity-list-controls {
    align-items: flex-start;
  }

  .activity-list-buttons {
    justify-content: flex-start;
  }

  .form-actions .button {
    flex: 1;
  }

  .activity-editor-dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .activity-editor-sheet {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)));
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .activity-editor-header {
    flex-direction: column;
    gap: 10px;
  }

  .games-dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .games-sheet {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)));
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .games-header {
    flex-direction: column;
    gap: 8px;
  }

  .games-status {
    max-width: 100%;
    text-align: left;
  }

  .games-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .games-form .button {
    width: 100%;
    margin-bottom: 0;
  }

  .games-actions .button {
    width: 100%;
  }

  .backup-dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .backup-sheet {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)));
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .backup-header {
    flex-direction: column;
    gap: 8px;
  }

  .backup-status {
    max-width: 100%;
    text-align: left;
  }

  .backup-summary dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  .backup-summary dd {
    text-align: left;
  }

  .backup-section .button,
  .backup-actions .button {
    width: 100%;
  }

  .table-wrap {
    overflow-x: visible;
    border: 0;
    border-radius: 0;
  }

  .table-wrap table,
  .table-wrap tbody {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .table-wrap tbody tr {
    display: grid;
    min-width: 0;
    max-width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .table-wrap tbody tr.progress-date-row {
    border-color: #a9cdb9;
    background: #f2faf5;
  }

  .table-wrap td {
    display: flex;
    min-width: 0;
    max-width: 100%;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table-wrap .schedule-date-cell {
    display: block;
    padding-top: 0;
    font-weight: 780;
  }

  .table-wrap .schedule-cumulative-cell {
    text-align: right;
  }

  .schedule-mobile-label {
    display: inline;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
  }

  .schedule-point-value {
    min-width: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    overflow-wrap: anywhere;
  }

  .date-marker {
    margin-left: 5px;
  }

  .quick-progress-dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .quick-progress-sheet {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)));
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .quick-progress-actions .button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
