:root {
  color-scheme: light;
  --bg: #f4f7f1;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.1);
  --green: #009a44;
  --green-dark: #007a35;
  --green-soft: #e7f6ec;
  --pink: #f7b7bd;
  --blue: #007aff;
  --red: #ff3b30;
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow: 0 16px 34px rgba(32, 88, 54, 0.1);
  --shadow-soft: 0 8px 22px rgba(32, 88, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 154, 68, 0.18), transparent 24rem),
    radial-gradient(circle at 100% 8%, rgba(247, 183, 189, 0.2), transparent 18rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 12px 34px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-title.compact {
  flex: 1;
  justify-content: center;
  min-height: 58px;
  padding: 0;
  margin-left: 10px;
  background: transparent;
  box-shadow: none;
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: 42% 50%;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 20px rgba(0, 122, 53, 0.14);
}

.brand-logo.small {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.title-block h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-title.compact .title-block h1 {
  font-size: 24px;
}

.title-block p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-title.compact .title-block p {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.back-button,
.ghost-button,
.primary-button,
.danger-button,
.boss-button {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 15px;
  font-weight: 700;
}

.back-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
  box-shadow: var(--shadow-soft);
}

.primary-button {
  width: 100%;
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 154, 68, 0.22);
}

.danger-button {
  background: rgba(255, 59, 48, 0.1);
  color: var(--red);
}

.boss-button {
  flex: 0 0 auto;
  background: #fff;
  color: var(--green-dark);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(0, 154, 68, 0.92), rgba(82, 178, 86, 0.86)),
    var(--green);
  color: #fff;
  box-shadow: 0 18px 38px rgba(0, 122, 53, 0.22);
}

.hero-panel h2 {
  margin: 7px 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 440px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.hero-total {
  min-width: 164px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  text-align: right;
}

.hero-total span,
.hero-total strong {
  display: block;
}

.hero-total span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.hero-total strong {
  margin-top: 7px;
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.store-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.store-card,
.panel,
.record-card,
.summary-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.store-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  min-height: 154px;
  padding: 22px 22px 18px;
  flex-direction: column;
  text-align: left;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.store-card:active {
  transform: scale(0.985);
}

.store-code {
  font-size: 36px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}

.store-card span,
.section-label,
.field span,
.empty,
.record-meta,
.summary-label {
  color: var(--muted);
}

.store-card span {
  display: block;
  margin-top: 7px;
  font-size: 15px;
  font-weight: 700;
}

.store-mini-summary {
  display: flex;
  width: 100%;
  min-width: 0;
  padding: 12px 0 0;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  align-items: center;
  flex-direction: row-reverse;
  justify-content: space-between;
  text-align: left;
}

.store-mini-summary strong,
.store-mini-summary small {
  display: block;
}

.store-mini-summary strong {
  display: inline-flex;
  width: fit-content;
  border-radius: 13px;
  padding: 7px 11px;
  background: var(--green-soft);
  font-size: 24px;
  line-height: 1;
  color: var(--green-dark);
}

.store-mini-summary small {
  margin-top: 0;
  padding-left: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: rgba(120, 120, 128, 0.16);
}

.tabs.single-tab {
  grid-template-columns: 1fr;
}

.tab {
  min-height: 38px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tab.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.12);
}

.panel {
  padding: 20px;
  margin-bottom: 14px;
}

.unlock-panel {
  width: min(100%, 440px);
  margin: 0 0 14px auto;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 154, 68, 0.16);
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.1);
}

.panel h2,
.unlock-panel h2 {
  margin: 0 0 14px;
  font-size: 21px;
  letter-spacing: 0;
}

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

.field {
  display: grid;
  gap: 7px;
}

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

.field span {
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(0, 154, 68, 0.46);
  box-shadow: 0 0 0 4px rgba(0, 154, 68, 0.12);
}

.photo-input {
  display: none;
}

.photo-button {
  min-height: 48px;
  border-radius: 17px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(0, 154, 68, 0.14);
}

.photo-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.records {
  display: grid;
  gap: 10px;
}

.daily-list {
  display: grid;
  gap: 14px;
}

.daily-card {
  padding: 14px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 0;
  background: transparent;
}

.daily-card:last-child {
  border-bottom: 0;
}

.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.daily-head h3 {
  margin: 0;
  font-size: 18px;
}

.daily-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.daily-row span,
.daily-row strong {
  display: block;
}

.daily-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.daily-row strong {
  margin-top: 5px;
  color: var(--green-dark);
  font-size: 18px;
  line-height: 1;
}

.record-card {
  padding: 16px;
}

.record-head,
.record-actions,
.summary-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-amount {
  font-size: 24px;
  font-weight: 800;
}

.record-meta {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.5;
}

.record-note {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 14px;
}

.verify-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(246, 247, 243, 0.9);
}

.verify-form .primary-button {
  grid-column: 1 / -1;
}

.record-photo {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.summary-grid {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin-bottom: 14px;
}

.balance-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.summary-card {
  padding: 14px 12px;
  box-shadow: none;
  border-color: rgba(0, 154, 68, 0.08);
}

.balance-strip .summary-card {
  min-height: 86px;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.summary-value {
  margin-top: 8px;
  font-size: 21px;
  font-weight: 800;
  color: var(--green-dark);
}

.summary-card.diff-nonzero .summary-value {
  color: var(--red);
}

.record-diff {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 59, 48, 0.1);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.required-mark {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 59, 48, 0.12);
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0;
}

.loading {
  padding: 80px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--green-soft);
  border: 1px solid rgba(0, 154, 68, 0.18);
}

.install-banner span {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
}

.install-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
  box-shadow: 0 6px 14px rgba(0, 154, 68, 0.22);
}

.boss-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(0, 154, 68, 0.92), rgba(82, 178, 86, 0.86));
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 122, 53, 0.2);
}

.boss-hero span {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.86;
}

.boss-hero strong {
  font-size: 24px;
  font-weight: 800;
}

.unlock-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.photo-status {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.month-row {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.month-row .field {
  flex: 1;
}

.empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.locked-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .app-shell {
    padding-inline: 12px;
  }

  .form-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .title-block h1 {
    font-size: 23px;
  }

  .brand-title.compact .title-block h1 {
    font-size: 22px;
  }

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

@media (max-width: 380px) {
  .balance-strip .summary-value {
    font-size: 17px;
  }

  .balance-strip .summary-label {
    font-size: 12px;
  }

  .balance-strip .summary-card {
    padding: 12px 8px;
  }
}
