:root {
  color-scheme: light;
  --ink: #14304a;
  --muted: #62728a;
  --paper: #fffdf4;
  --card: #ffffff;
  --blue: #1f8ed1;
  --blue-deep: #14639b;
  --teal: #2ca58d;
  --green: #61b15a;
  --yellow: #ffd95a;
  --orange: #f28b30;
  --red: #d7524f;
  --purple: #8668bd;
  --line: #b8c8d7;
  --soft-line: #e4edf4;
  --shadow: 0 16px 42px rgba(20, 48, 74, 0.13);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 217, 90, 0.22), transparent 28%),
    linear-gradient(180deg, #dff6ff 0%, #f9fdff 42%, #fff8dd 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 142, 209, 0.28);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

.shell {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 52px;
}

.hero,
.analysis-panel,
.web-version,
.app-version {
  border: 3px solid var(--blue-deep);
  border-radius: 8px;
  background: rgba(255, 253, 244, 0.96);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.56fr) minmax(160px, 0.24fr);
  gap: 18px;
  align-items: center;
  min-height: 174px;
  padding: 24px clamp(18px, 4vw, 42px);
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--orange);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 2px;
  color: var(--blue-deep);
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.02;
  text-shadow: 0 3px 0 rgba(255, 217, 90, 0.7);
}

.slogan {
  margin-top: 10px;
  color: #205f45;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 800;
}

.hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star,
.trophy-shape,
.coin {
  position: absolute;
  display: block;
}

.star {
  width: 42px;
  aspect-ratio: 1;
  background: var(--yellow);
  clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
  filter: drop-shadow(0 3px 0 rgba(225, 152, 35, 0.38));
}

.star-a {
  left: 22px;
  top: 28px;
}

.star-b {
  right: 22px;
  bottom: 18px;
  width: 32px;
}

.trophy-shape {
  right: 48px;
  top: 22px;
  width: 70px;
  height: 74px;
  border: 7px solid #d99b17;
  border-top: 0;
  border-radius: 0 0 34px 34px;
  background: linear-gradient(180deg, #ffe78b 0%, #f5bb2d 100%);
}

.trophy-shape::before,
.trophy-shape::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 24px;
  height: 34px;
  border: 6px solid #d99b17;
  border-radius: 50%;
}

.trophy-shape::before {
  left: -28px;
  border-right: 0;
}

.trophy-shape::after {
  right: -28px;
  border-left: 0;
}

.coin {
  width: 30px;
  height: 30px;
  border: 4px solid #e0a020;
  border-radius: 50%;
  background: #ffd95a;
}

.coin-a {
  left: 48%;
  top: 24px;
}

.coin-b {
  left: 56%;
  bottom: 26px;
}

.week-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.week-card label {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.week-card input {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid #d5e0e8;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
}

.total-card {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 114px;
  border: 2px solid #f0b535;
  border-radius: 8px;
  background: #fff5cf;
  text-align: center;
}

.total-card span {
  color: #77521b;
  font-weight: 800;
}

.total-card strong {
  color: var(--red);
  font-size: 2rem;
}

.view-tabs {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  overflow-x: auto;
}

.view-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.analysis-panel,
.web-version,
.app-version {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.analysis-panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  border-color: #64b7cf;
}

.analysis-panel h2,
.section-heading h2 {
  margin-top: 4px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.18;
}

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

.analysis-grid article {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.analysis-grid strong {
  display: block;
  color: var(--blue-deep);
  font-size: 1.06rem;
}

.analysis-grid p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

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

.section-note {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.7;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.summary-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d6e4ee;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.summary-strip strong {
  margin: 0 4px;
  color: var(--red);
}

.desktop-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.28fr);
  gap: 16px;
  align-items: start;
}

.habit-table-card,
.side-panel > section,
.phone-frame {
  border: 2px solid var(--blue-deep);
  border-radius: 8px;
  background: #fff;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 2px solid var(--blue-deep);
  background: #e9f7ff;
}

.table-toolbar h3,
.panel-title h3,
.privilege-card h4 {
  font-size: 1.18rem;
}

.table-toolbar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-color: #95c7e6;
  background: #fff;
  color: var(--blue-deep);
  font-size: 1.35rem;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
}

.habit-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.habit-table th,
.habit-table td {
  border: 1px solid var(--line);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.habit-table th {
  height: 48px;
  background: var(--blue);
  color: #fff;
  font-size: 0.94rem;
}

.habit-table th:nth-child(1) {
  width: 120px;
}

.habit-table th:nth-child(2) {
  width: 212px;
}

.habit-table th:nth-child(3) {
  width: 68px;
}

.habit-table th:nth-last-child(1) {
  width: 82px;
}

.category-cell {
  padding: 10px;
  color: #fff;
  font-weight: 900;
}

.category-box {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 58px;
  aspect-ratio: 1;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.75rem;
}

.rule-cell {
  padding: 8px 10px;
  text-align: left;
  background: #fffdf8;
}

.rule-title {
  display: block;
  font-weight: 900;
}

.rule-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.value-cell {
  font-weight: 900;
}

.value-positive {
  color: #13804f;
}

.value-negative {
  color: var(--red);
}

.value-neutral {
  color: #5f6772;
}

.check-cell {
  width: 44px;
  height: 54px;
  background:
    linear-gradient(90deg, rgba(20, 99, 155, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 99, 155, 0.08) 1px, transparent 1px),
    #fffefa;
  background-size: 12px 12px;
}

.check-cell button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 50px;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue-deep);
  font-size: 1.2rem;
  font-weight: 900;
}

.check-cell button:hover {
  background: rgba(31, 142, 209, 0.12);
}

.check-cell button.checked {
  color: #fff;
  background: var(--teal);
}

.subtotal-cell {
  background: #f7fbff;
  color: var(--blue-deep);
  font-weight: 900;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.income-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 210px;
  padding: 22px 16px;
  text-align: center;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 70px;
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 1.9rem;
  font-weight: 900;
}

.money-bag {
  position: relative;
  background: #ffd15c;
  color: #7a4d00;
}

.money-bag::before {
  content: "";
  position: absolute;
  top: -9px;
  width: 28px;
  height: 15px;
  border-radius: 8px 8px 2px 2px;
  background: #f3b13b;
}

.income-card p {
  color: var(--muted);
  font-weight: 800;
}

.income-card strong {
  color: var(--red);
  font-size: 2.2rem;
}

.income-card small {
  max-width: 230px;
  color: var(--muted);
  line-height: 1.55;
}

.privilege-card {
  padding: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--soft-line);
}

.panel-title span {
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e7f6ed;
  color: #157349;
  text-align: center;
  font-weight: 900;
}

.privilege-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 14px;
}

.privilege-card h4 {
  margin: 0 0 10px;
  color: var(--blue-deep);
}

.bonus-list,
.reward-list {
  display: grid;
  gap: 8px;
}

.bonus-item,
.reward-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fffef8;
}

.bonus-item button {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border: 2px solid #b9d8c8;
  background: #fff;
  color: transparent;
}

.bonus-item button.checked {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.bonus-item p,
.reward-list p {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
}

.bonus-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
}

.reward-list span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 8px;
  background: #fff0cc;
  color: var(--orange);
  font-weight: 900;
}

.phone-stage {
  display: grid;
  place-items: center;
  padding: 12px 0;
  background:
    linear-gradient(90deg, rgba(44, 165, 141, 0.18), transparent 32%),
    linear-gradient(270deg, rgba(242, 139, 48, 0.16), transparent 34%);
  border-radius: 8px;
}

.phone-frame {
  width: min(390px, 100%);
  max-height: 820px;
  overflow: hidden;
  background: #f6fbff;
  box-shadow: 0 20px 50px rgba(20, 48, 74, 0.18);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 28px;
  padding: 0 18px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.phone-status span:last-child {
  width: 66px;
  height: 8px;
  border-radius: 99px;
  background: #1d2e3f;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: var(--blue-deep);
  color: #fff;
}

.app-header p,
.app-income span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
}

.app-header h3 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.app-income {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: 96px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
}

.app-income span {
  color: var(--muted);
}

.app-income strong {
  color: var(--red);
}

.day-switch {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 12px 14px;
  background: #fff;
}

.day-switch button {
  min-height: 36px;
  border: 1px solid #d7e5ef;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.day-switch button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.today-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 14px 12px;
  background: #fff;
}

.today-summary div {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 10px 8px;
  border-radius: 8px;
  background: #f4f9fc;
  text-align: center;
}

.today-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.today-summary strong {
  color: var(--blue-deep);
  font-size: 1.05rem;
}

.mobile-list {
  display: grid;
  gap: 10px;
  max-height: 604px;
  padding: 12px 14px 78px;
  overflow: auto;
}

.mobile-category {
  border: 1px solid #d5e3ed;
  border-left-width: 8px;
  border-radius: 8px;
  background: #fff;
}

.mobile-category-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
}

.mobile-category-title {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.mobile-mini-icon {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  aspect-ratio: 1;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
}

.mobile-category h4 {
  margin: 0;
  font-size: 1rem;
}

.mobile-category small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.mobile-category-total {
  flex: 0 0 auto;
  color: var(--red);
  font-weight: 900;
}

.mobile-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border-top: 1px solid var(--soft-line);
}

.mobile-rule strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.35;
}

.mobile-rule span {
  display: inline-flex;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.mobile-rule button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid #c7d9e5;
  background: #fff;
  color: transparent;
  font-size: 1.1rem;
  font-weight: 900;
}

.mobile-rule button.checked {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid #dbe8f1;
  background: rgba(255, 255, 255, 0.94);
}

.bottom-nav button {
  border: 1px solid #d8e5ee;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.bottom-nav button.active {
  border-color: var(--blue);
  background: #e7f5ff;
  color: var(--blue-deep);
}

[data-color="blue"] {
  background-color: var(--blue);
}

[data-color="teal"] {
  background-color: var(--teal);
}

[data-color="purple"] {
  background-color: var(--purple);
}

[data-color="green"] {
  background-color: var(--green);
}

[data-color="orange"] {
  background-color: var(--orange);
}

[data-color="red"] {
  background-color: var(--red);
}

.mobile-category[data-color="blue"] {
  border-left-color: var(--blue);
  background: #f7fcff;
}

.mobile-category[data-color="teal"] {
  border-left-color: var(--teal);
  background: #f8fffc;
}

.mobile-category[data-color="purple"] {
  border-left-color: var(--purple);
  background: #fbf9ff;
}

.mobile-category[data-color="green"] {
  border-left-color: var(--green);
  background: #fbfff8;
}

.mobile-category[data-color="orange"] {
  border-left-color: var(--orange);
  background: #fffaf4;
}

.mobile-category[data-color="red"] {
  border-left-color: var(--red);
  background: #fff8f8;
}

.app-body {
  min-width: 320px;
  min-height: 100vh;
  background: #f6fbff;
}

.native-app {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 14px env(safe-area-inset-bottom);
  background:
    linear-gradient(180deg, #e7f6ff 0%, #f8fcff 34%, #fff9e8 100%);
}

.native-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 18px 2px 12px;
}

.native-header h1 {
  margin-top: 4px;
  color: var(--blue-deep);
  font-size: clamp(1.75rem, 8vw, 2.55rem);
  line-height: 1.08;
  text-shadow: 0 2px 0 rgba(255, 217, 90, 0.6);
}

.native-header p:last-child {
  margin-top: 8px;
  color: #205f45;
  font-weight: 800;
}

.today-line {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 10px;
  padding: 4px 10px;
  border: 1px solid #cfe3ef;
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-size: 0.86rem;
  font-weight: 900;
}

.app-reset {
  display: grid;
  place-items: center;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid #b8d5e6;
  background: #fff;
  color: var(--blue-deep);
  font-size: 1.35rem;
  font-weight: 900;
}

.app-goal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.34fr);
  gap: 10px;
  margin-bottom: 10px;
}

.app-goal-card div {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid #d6e5ef;
  border-radius: 8px;
  background: #fff;
}

.app-goal-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.app-goal-card strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.app-goal-card div:last-child {
  background: #fff3ce;
}

.app-goal-card div:last-child strong {
  color: var(--red);
  font-size: 1.35rem;
}

.date-control-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid #d6e5ef;
  border-radius: 8px;
  background: #fff;
}

.date-control-card label {
  display: grid;
  gap: 6px;
}

.date-control-card label span,
.range-toggle {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.date-control-card input {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #bfd5e4;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--ink);
  font-weight: 900;
}

.range-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  gap: 6px;
}

.range-toggle button {
  min-height: 42px;
  border: 1px solid #bfd5e4;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.range-toggle button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.native-day-switch {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 2;
  margin: 0 -2px;
  padding: 8px 0;
  background: rgba(246, 251, 255, 0.96);
  backdrop-filter: blur(12px);
}

.native-summary {
  padding: 2px 0 10px;
  background: transparent;
}

.native-summary div {
  background: #fff;
}

.app-screen {
  display: none;
  min-height: 0;
  padding-bottom: 84px;
}

.app-screen.active {
  display: block;
}

.app-screen-heading {
  display: grid;
  gap: 6px;
  padding: 14px 2px 12px;
}

.app-screen-heading h2 {
  color: var(--blue-deep);
  font-size: 1.35rem;
}

.app-screen-heading p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stats-panel div {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #d6e5ef;
  border-radius: 8px;
  background: #fff;
}

.stats-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.stats-panel strong {
  color: var(--blue-deep);
  font-size: 1.18rem;
}

.category-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.category-stat {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid #d6e5ef;
  border-radius: 8px;
  background: #fff;
}

.category-stat > span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
}

.category-stat strong,
.category-stat small {
  display: block;
}

.category-stat strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.category-stat small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.native-mobile-list {
  max-height: none;
  padding: 0 0 8px;
}

.app-week-list {
  display: grid;
  gap: 10px;
}

.app-week-list button {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(86px, 0.36fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #d6e5ef;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.app-week-list button.active {
  border-color: var(--blue);
  background: #e9f7ff;
}

.app-week-list span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.app-week-list strong {
  color: var(--red);
  font-size: 1.15rem;
}

.app-week-list small {
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

.native-bonus-list,
.native-reward-list {
  margin-top: 4px;
}

.native-reward-list {
  margin-top: 14px;
}

.native-bottom-nav {
  position: fixed;
  right: max(14px, calc((100vw - 520px) / 2 + 14px));
  bottom: env(safe-area-inset-bottom);
  left: max(14px, calc((100vw - 520px) / 2 + 14px));
  z-index: 5;
  border: 1px solid #d6e5ef;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -12px 28px rgba(20, 48, 74, 0.12);
}

@media (max-width: 1120px) {
  .hero,
  .desktop-board,
  .analysis-panel {
    grid-template-columns: 1fr;
  }

  .total-card {
    min-height: 92px;
  }

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 18px, 520px);
    padding-top: 10px;
  }

  .hero,
  .analysis-panel,
  .web-version,
  .app-version {
    border-width: 2px;
  }

  .hero {
    padding: 18px;
  }

  h1 {
    font-size: clamp(2.1rem, 15vw, 3.8rem);
  }

  .week-card label {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

  .summary-strip {
    justify-content: start;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .desktop-board {
    gap: 12px;
  }

  .side-panel {
    order: -1;
  }

  .habit-table {
    min-width: 860px;
  }

  .table-toolbar {
    align-items: start;
    padding: 14px;
  }

  .phone-stage {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    border-width: 0;
    box-shadow: none;
  }

  .mobile-list {
    max-height: none;
  }

  .date-control-card {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .view-tabs,
  .analysis-panel,
  .app-version,
  .icon-button,
  .bottom-nav {
    display: none;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .hero,
  .web-version,
  .habit-table-card,
  .side-panel > section {
    box-shadow: none;
  }
}
