:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f7efd9;
  color: #29231b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    repeating-linear-gradient(0deg, rgba(44, 36, 31, 0.035) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(90deg, rgba(44, 36, 31, 0.025) 0 1px, transparent 1px 17px),
    linear-gradient(135deg, #fff7db 0%, #f7efe1 42%, #e4f2ee 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
}

.app {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
}

.date {
  margin-bottom: 4px;
  color: #6d5a43;
  font-size: 14px;
  font-weight: 800;
}

h1 {
  max-width: 13ch;
  color: #2b2118;
  font-size: 34px;
  line-height: 1;
}

.badge {
  display: grid;
  place-items: center;
  flex: 0 0 76px;
  height: 76px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #ffcf4a;
  box-shadow: 0 6px 0 #2c241f;
  color: #2c241f;
  font-size: 15px;
  font-weight: 900;
  transform: rotate(3deg);
}

.badge-icon {
  display: block;
  color: #2c241f;
  font-size: 42px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.62);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}

.tab-button,
.small-button {
  min-height: 42px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 3px 0 #2c241f;
  color: #2c241f;
  font-weight: 900;
}

.tab-button.is-active {
  background: #9fc8ff;
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2c241f;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 16px;
}

.summary-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 86px;
  padding: 12px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  box-shadow: 0 5px 0 #2c241f;
}

.today-tile {
  background: #fff0a8;
}

.bank-tile {
  background: #a9dfc2;
}

.summary-number {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #fffaf0;
  color: #2c241f;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.summary-label {
  padding-left: 10px;
  color: #3f3428;
  font-size: 18px;
  font-weight: 900;
}

.view {
  display: none;
  padding-bottom: 24px;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  font-size: 22px;
  line-height: 1.1;
}

.compact-heading {
  align-items: center;
  margin-top: 16px;
}

.mini-note {
  color: #725f48;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.penalty-heading {
  align-items: center;
  margin-top: 18px;
}

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

.behavior-card {
  position: relative;
  display: grid;
  grid-template-rows: 128px 44px 24px;
  align-items: center;
  justify-items: center;
  min-height: 220px;
  padding: 12px 8px 10px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 5px 0 #2c241f;
  color: #2c241f;
  text-align: center;
  transition: transform 120ms ease, box-shadow 120ms ease;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

[data-action] {
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

[data-action].is-pressed {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #2c241f;
  filter: brightness(1.07);
}

[data-action]:focus-visible {
  outline: 3px solid #236ca4;
  outline-offset: 4px;
}

.connection-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 0;
  border-block: 2px solid #8b6740;
  color: #4e3927;
  font-size: 16px;
  font-weight: 800;
}

.connection-state[hidden], #retryConnection[hidden] { display: none; }
.connection-state p { min-width: 0; overflow-wrap: anywhere; }
.connection-state button { flex: 0 0 auto; min-width: 64px; min-height: 44px; }
.connection-state.is-pending { border-color: #387358; color: #28533f; }

.behavior-card:disabled {
  cursor: wait;
}

.behavior-card.is-saving {
  filter: saturate(0.9);
}

.behavior-card.is-celebrating {
  z-index: 1;
  animation: card-celebrate 900ms cubic-bezier(0.18, 1.35, 0.34, 1);
}

.behavior-card.is-penalizing {
  z-index: 1;
  animation: card-penalty 860ms cubic-bezier(0.3, 0, 0.2, 1);
}

.penalty-card {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.24) 0 8px, transparent 8px 17px),
    #ff9a76;
}

.penalty-icon {
  background: rgba(255, 248, 232, 0.72);
}

.penalty-stars {
  color: #7c2d2d;
}

.star-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  min-width: 128px;
  height: 62px;
  padding: 0 18px;
  border: 3px solid #2c241f;
  border-radius: 999px;
  background: #ffd45a;
  box-shadow: 0 6px 0 #2c241f, 0 16px 24px rgba(44, 36, 31, 0.22);
  color: #2c241f;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  animation: star-burst 1800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.star-sparkles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.star-sparkle {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #ffd45a;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    -1px -1px 0 #2c241f,
    1px -1px 0 #2c241f,
    -1px 1px 0 #2c241f,
    1px 1px 0 #2c241f,
    0 5px 10px rgba(44, 36, 31, 0.25);
  transform: translate(-50%, -50%) scale(0.2);
  animation: star-sparkle 1500ms ease-out forwards;
  animation-delay: calc(var(--spark-index) * 34ms);
}

.star-loss {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  min-width: 118px;
  height: 66px;
  padding: 0 18px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #ff5f56;
  box-shadow: 0 7px 0 #2c241f, 0 18px 26px rgba(124, 45, 45, 0.26);
  color: #fff8e8;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: star-loss 2200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.penalty-shards {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.penalty-shard {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #8a2c24;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    -1px -1px 0 #fff8e8,
    1px -1px 0 #fff8e8,
    -1px 1px 0 #fff8e8,
    1px 1px 0 #fff8e8,
    0 5px 10px rgba(44, 36, 31, 0.25);
  transform: translate(-50%, -50%) scale(0.3);
  animation: penalty-shard 1900ms ease-in forwards;
  animation-delay: calc(var(--shard-index) * 44ms);
}

.star-sparkle:nth-child(1) {
  --spark-x: -90px;
  --spark-y: -62px;
  --spark-rotate: -26deg;
}

.star-sparkle:nth-child(2) {
  --spark-x: -46px;
  --spark-y: -88px;
  --spark-rotate: 18deg;
}

.star-sparkle:nth-child(3) {
  --spark-x: 54px;
  --spark-y: -82px;
  --spark-rotate: -12deg;
}

.star-sparkle:nth-child(4) {
  --spark-x: 94px;
  --spark-y: -28px;
  --spark-rotate: 28deg;
}

.star-sparkle:nth-child(5) {
  --spark-x: 74px;
  --spark-y: 58px;
  --spark-rotate: -18deg;
}

.star-sparkle:nth-child(6) {
  --spark-x: -72px;
  --spark-y: 62px;
  --spark-rotate: 20deg;
}

.star-sparkle:nth-child(7) {
  --spark-x: -104px;
  --spark-y: 10px;
  --spark-rotate: -8deg;
}

.penalty-shard:nth-child(1) {
  --shard-x: -82px;
  --shard-y: 86px;
  --shard-rotate: -28deg;
}

.penalty-shard:nth-child(2) {
  --shard-x: -34px;
  --shard-y: 102px;
  --shard-rotate: 18deg;
}

.penalty-shard:nth-child(3) {
  --shard-x: 18px;
  --shard-y: 96px;
  --shard-rotate: -12deg;
}

.penalty-shard:nth-child(4) {
  --shard-x: 64px;
  --shard-y: 88px;
  --shard-rotate: 26deg;
}

.penalty-shard:nth-child(5) {
  --shard-x: 96px;
  --shard-y: 56px;
  --shard-rotate: -18deg;
}

.penalty-shard:nth-child(6) {
  --shard-x: -106px;
  --shard-y: 48px;
  --shard-rotate: 20deg;
}

.behavior-card:active,
.small-button:active,
.action-button:active {
  box-shadow: 0 1px 0 #2c241f;
  transform: translateY(3px);
}

.behavior-icon {
  display: grid;
  place-items: center;
  width: 128px;
  max-width: 100%;
  height: 128px;
  border: 2px solid rgba(44, 36, 31, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  font-size: 30px;
  line-height: 1;
}

.behavior-name {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #2c241f;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.08;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.behavior-stars {
  color: #5b4325;
  font-size: 15px;
  font-weight: 900;
}

.storybook-art {
  position: relative;
  display: block;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 0;
  pointer-events: none;
}
.storybook-art img { position: absolute; max-width: none; visibility: hidden; pointer-events: none; user-select: none; }
.storybook-art.art-ready img { visibility: visible; }
.storybook-art .art-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 36px; }
.storybook-art.art-ready .art-fallback { visibility: hidden; }
.behavior-card.has-illustration { background: #fff; }
.behavior-card.has-illustration .behavior-name { line-height: 1.2; }
.behavior-card.has-illustration .behavior-stars { color: #315a35; }
.behavior-card.has-illustration .penalty-stars { color: #9b3535; }
.behavior-stop {
  position: absolute; z-index: 1; top: 9px; right: 9px; width: 28px; height: 28px;
  border: 2px solid #fff; border-radius: 50%; background: #c23f3c;
  box-shadow: 0 1px 2px #66302b33; pointer-events: none;
}
.behavior-stop::after { content: ''; position: absolute; left: 5px; right: 5px; top: 11px; height: 3px; background: #fff; }
.manage-art-preview { display: block; width: 96px; height: 96px; justify-self: center; }
.manage-art-preview > span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 42px; }
#selectedBehaviorIcon > .storybook-art { width: 100%; height: 100%; }

@keyframes card-celebrate {
  0% {
    transform: translateY(0) scale(1);
  }

  32% {
    transform: translateY(-9px) scale(1.06);
  }

  58% {
    transform: translateY(2px) scale(0.99);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes card-penalty {
  0% {
    transform: translateX(0) scale(1);
  }

  16% {
    transform: translateX(-7px) scale(1.03);
  }

  32% {
    transform: translateX(7px) scale(1.03);
  }

  48% {
    transform: translateX(-5px) scale(1.01);
  }

  64% {
    transform: translateX(4px) scale(1.01);
  }

  100% {
    transform: translateX(0) scale(1);
  }
}

@keyframes star-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.5) rotate(-3deg);
  }

  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.22) rotate(2deg);
  }

  28% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }

  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -62%) scale(0.94) rotate(0);
  }
}

@keyframes star-loss {
  0% {
    opacity: 0;
    transform: translate(-50%, -38%) scale(0.52) rotate(-2deg);
  }

  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) rotate(1deg);
  }

  34% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }

  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, 22%) scale(0.92) rotate(0);
  }
}

@keyframes star-sparkle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }

  16% {
    opacity: 1;
  }

  70% {
    opacity: 1;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(1.18) rotate(var(--spark-rotate));
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(0.82) rotate(var(--spark-rotate));
  }
}

@keyframes penalty-shard {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }

  18% {
    opacity: 1;
  }

  76% {
    opacity: 1;
    transform: translate(calc(-50% + var(--shard-x)), calc(-50% + var(--shard-y))) scale(1.12) rotate(var(--shard-rotate));
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--shard-x)), calc(-50% + var(--shard-y) + 18px)) scale(0.76) rotate(var(--shard-rotate));
  }
}

.reward-list,
.manage-list,
.history-list {
  display: grid;
  gap: 9px;
}

.reward-row,
.manage-row,
.history-row,
.tool-panel {
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 4px 0 #2c241f;
}

.reward-row,
.manage-row,
.history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px;
}

.reward-row,
.manage-row {
  grid-template-columns: 1fr auto;
}

.manage-row {
  grid-template-columns: 44px 1fr 44px auto;
}

.reward-manage-row {
  grid-template-columns: 1fr 44px auto;
}

.manage-list.is-sorting .manage-row {
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.manage-list.is-saving-order {
  opacity: 0.72;
  pointer-events: none;
}

.manage-row.is-dragging {
  position: relative;
  z-index: 2;
  background: #fff0b8;
  box-shadow: 0 7px 0 #2c241f;
  transform: scale(1.018);
}

.manage-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 48px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #ffcf4a;
  box-shadow: 0 3px 0 #2c241f;
  font-size: 24px;
  line-height: 1;
}

.manage-drag-handle {
  width: 42px;
  height: 48px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #e7e1d4;
  box-shadow: 0 3px 0 #2c241f;
  color: #2c241f;
  cursor: grab;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  touch-action: none;
  user-select: none;
}

.manage-drag-handle:active {
  cursor: grabbing;
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2c241f;
}

.history-delete-button {
  min-width: 58px;
  height: 44px;
  border-color: #7c2d2d;
  background: #ffe1df;
  color: #7c2d2d;
  font-size: 15px;
}

.reward-row strong,
.manage-row strong,
.history-row strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.15;
}

.reward-row span,
.manage-row span,
.history-row span {
  display: block;
  margin-top: 4px;
  color: #685640;
  font-size: 14px;
  font-weight: 800;
}

.history-row {
  grid-template-columns: 44px 1fr;
}

.history-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #2c241f;
  border-radius: 8px;
  background: #ffcf4a;
  font-size: 22px;
}

.tool-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
}

.tool-panel .field {
  margin-bottom: 0;
}

.manager-section {
  margin-top: 14px;
}

.settings-panel {
  margin-bottom: 12px;
}

.settings-panel summary {
  display: inline-grid;
  place-items: center;
  min-width: 132px;
  padding: 0 14px;
  list-style: none;
}

.settings-panel summary::-webkit-details-marker {
  display: none;
}

.settings-panel .tool-panel {
  margin-top: 10px;
}

.empty-state,
.loading-state {
  display: grid;
  place-items: center;
  min-height: 112px;
  border: 3px dashed #86715b;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  color: #5e4d3d;
  font-size: 18px;
  font-weight: 900;
}

.behavior-grid .empty-state,
.behavior-grid .loading-state,
.penalty-grid .empty-state,
.penalty-grid .loading-state {
  grid-column: 1 / -1;
}

.dialog {
  width: min(calc(100% - 28px), 430px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.dialog::backdrop {
  background: rgba(35, 28, 22, 0.52);
}

.dialog-panel {
  padding: 16px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #fff9e9;
  box-shadow: 0 8px 0 #2c241f;
}

.selected-sticker {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: -2px auto 8px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #ffcf4a;
  font-size: 38px;
  font-weight: 900;
  transform: rotate(-3deg);
}

.reward-sticker {
  background: #f5a7c8;
  font-size: 28px;
}

.dialog-title {
  min-height: 34px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 24px;
  line-height: 1.15;
}

.dialog-subtitle {
  margin-bottom: 12px;
  color: #6d5a43;
  text-align: center;
  font-weight: 900;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #4b3d30;
  font-size: 15px;
  font-weight: 900;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #fff;
  color: #2c241f;
  font-size: 19px;
  font-weight: 800;
  padding: 8px 10px;
}

.field select {
  appearance: auto;
}

.dialog-actions {
  display: grid;
  gap: 9px;
}

.action-button {
  min-height: 50px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  box-shadow: 0 4px 0 #2c241f;
  color: #2c241f;
  font-size: 18px;
  font-weight: 900;
}

.reward-button {
  background: #ffcf4a;
}

.work-button {
  background: #ff9a76;
}

.bank-button {
  background: #9fc8ff;
}

.cancel-button {
  background: #e7e1d4;
}

.dialog.is-reward-mode .behavior-only,
.dialog:not(.is-reward-mode) .reward-only {
  display: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  min-width: 148px;
  max-width: calc(100% - 28px);
  padding: 11px 14px;
  border: 3px solid #2c241f;
  border-radius: 8px;
  background: #2c241f;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  color: #fff8e8;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 28px));
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  visibility: hidden;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

@media (min-width: 560px) {
  .app {
    padding: 22px;
  }

  h1 {
    font-size: 48px;
  }

  .behavior-grid,
  .penalty-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-panel {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }

  .tool-panel .action-button {
    min-width: 120px;
  }

  .dialog-actions {
    grid-template-columns: 1fr 1fr;
  }

  .cancel-button {
    grid-column: 1 / -1;
  }
}

@media (min-width: 760px) {
  body {
    min-height: 100vh;
  }

  .app {
    width: min(100%, 980px);
    padding: 28px;
  }

  .topbar {
    min-height: 106px;
  }

  h1 {
    max-width: none;
    font-size: 56px;
  }

  .badge {
    flex-basis: 92px;
    height: 92px;
  }

  .badge-icon {
    font-size: 52px;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
  }

  .tab-button,
  .small-button {
    min-height: 48px;
  }

  .summary {
    gap: 16px;
    margin-bottom: 22px;
  }

  .summary-tile {
    min-height: 104px;
    padding: 16px;
  }

  .summary-number {
    min-width: 68px;
    height: 68px;
    font-size: 44px;
  }

  .summary-label {
    font-size: 22px;
  }

  .section-heading {
    margin-bottom: 14px;
  }

  .section-heading h2 {
    font-size: 26px;
  }

  .behavior-grid,
  .penalty-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .behavior-card {
    grid-template-rows: 152px 44px 26px;
    min-height: 248px;
    padding: 14px 10px 12px;
  }

  .behavior-icon {
    width: 152px;
    height: 152px;
    font-size: 34px;
  }

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

  .tool-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 12px;
    padding: 14px;
  }

  .dialog {
    width: min(calc(100% - 56px), 520px);
  }

  #manageDialog {
    width: min(calc(100% - 56px), 640px);
  }

  #manageDialog .dialog-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  #manageDialog .cancel-button {
    grid-column: auto;
  }
}
