:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --surface: #fffdfa;
  --surface-strong: #ffffff;
  --line: #d8ded5;
  --line-dark: #2f463b;
  --text: #18201c;
  --muted: #66736b;
  --green: #118060;
  --green-dark: #0d4f42;
  --mint: #dff2e8;
  --yellow: #f2c94c;
  --coral: #e0644f;
  --blue: #4c7fb4;
  --grid-line: rgba(17, 128, 96, 0.045);
  --summary-bg: #10231d;
  --summary-text: #f8fbf7;
  --topbar-bg: rgba(244, 246, 241, 0.92);
  --soft: #f8faf6;
  --soft-line: #e5ebe2;
  --segment-bg: #eef4ed;
  --empty-bg: #fbfcf8;
  --empty-line: #cbd5ca;
  --placeholder: #828b84;
  --shadow: 0 18px 48px rgba(24, 32, 28, 0.1);
  font-family:
    Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1110;
  --surface: #121a17;
  --surface-strong: #17211d;
  --line: #2d3b35;
  --line-dark: #4c6a5e;
  --text: #edf5ef;
  --muted: #a7b4ad;
  --green: #2fb98f;
  --green-dark: #6ed8b5;
  --mint: #193127;
  --yellow: #ffd45e;
  --coral: #ff856f;
  --blue: #73a9df;
  --grid-line: rgba(111, 216, 181, 0.055);
  --summary-bg: #07120f;
  --summary-text: #f4fff8;
  --topbar-bg: rgba(12, 17, 16, 0.9);
  --soft: #101713;
  --soft-line: #293832;
  --segment-bg: #18241f;
  --empty-bg: #101713;
  --empty-line: #34483f;
  --placeholder: #8e9c94;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--bg);
  background-size: 30px 30px;
  color: var(--text);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: calc(10px + env(safe-area-inset-top)) clamp(16px, 4vw, 34px) 10px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(17, 128, 96, 0.18));
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--green-dark);
  box-shadow: 0 8px 22px rgba(24, 32, 28, 0.08);
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.page-nav a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.theme-button {
  font-size: 18px;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto max(34px, env(safe-area-inset-bottom));
}

.summary-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto) auto;
  align-items: center;
  gap: 18px;
  min-height: 146px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 20px 112px 20px 20px;
  background: var(--summary-bg);
  color: var(--summary-text);
  box-shadow: var(--shadow);
}

.summary-title {
  min-width: 0;
}

.summary-title h1 {
  overflow-wrap: anywhere;
}

.panel-kicker {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.summary-band .panel-kicker {
  color: var(--yellow);
}

h1,
h2 {
  margin: 0;
  color: inherit;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(26px, 3.4vw, 44px);
}

h2 {
  font-size: clamp(21px, 1.8vw, 27px);
}

.summary-amount {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 0;
}

.summary-amount span,
.summary-stat span {
  color: rgba(248, 251, 247, 0.68);
  font-size: 12px;
  font-weight: 850;
}

.summary-amount strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--yellow);
  font-size: clamp(42px, 5.4vw, 70px);
  line-height: 1;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  gap: 8px;
  min-width: 0;
}

.summary-stat {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 76px;
  border: 1px solid rgba(248, 251, 247, 0.14);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.07);
}

.summary-stat strong {
  font-size: 24px;
  line-height: 1;
}

.summary-stat.danger strong {
  color: #ffad9f;
}

.summary-stat.annual-stat strong {
  color: var(--yellow);
  font-size: 17px;
  line-height: 1.15;
}

.save-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid rgba(248, 251, 247, 0.22);
  border-radius: 999px;
  padding: 0 11px;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.summary-band > .save-state {
  position: absolute;
  top: 18px;
  right: 18px;
}

.tool-panel .save-state {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface-strong);
}

.goal-strip {
  display: grid;
  grid-template-columns: minmax(150px, 0.58fr) minmax(260px, 1.25fr) minmax(260px, 0.85fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(24, 32, 28, 0.08);
}

.goal-copy h2 {
  font-size: clamp(20px, 1.6vw, 24px);
}

.goal-meter {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.goal-meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.goal-meter-top strong {
  color: var(--green-dark);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.goal-meter-top span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
  overflow-wrap: anywhere;
}

.goal-meter-values {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.goal-meter-values small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--segment-bg);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 180ms ease;
}

.goal-form {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.goal-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.goal-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.goal-input-row input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

.goal-filter-button {
  width: 100%;
}

.goal-filter-button.active {
  border-color: rgba(224, 100, 79, 0.35);
  background: rgba(224, 100, 79, 0.1);
  color: var(--coral);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(380px, 1.22fr);
  gap: 14px;
  margin-top: 14px;
}

.tool-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(24, 32, 28, 0.08);
}

.input-area {
  align-self: start;
  padding: 15px;
}

.report-area {
  min-height: 520px;
  padding: 15px;
}

.transaction-area {
  grid-column: 1 / -1;
  padding: 15px;
}

.feedback-area {
  grid-column: 1 / -1;
  padding: 15px;
}

.data-area {
  grid-column: 1 / -1;
  padding: 15px;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.helper-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.helper-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 950;
}

.helper-box p {
  margin: 0;
}

.helper-box b {
  color: var(--text);
}

.intro-helper {
  margin-bottom: 12px;
}

.confidence-helper {
  margin-bottom: 12px;
}

.paste-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.paste-box::before {
  content: "";
  display: block;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--green) 0 18px,
    var(--yellow) 18px 27px,
    var(--coral) 27px 36px
  );
}

textarea {
  display: block;
  width: 100%;
  min-height: 224px;
  resize: vertical;
  border: 0;
  padding: 15px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  outline: none;
}

textarea::placeholder {
  color: var(--placeholder);
  font-weight: 750;
}

textarea:focus,
input:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(17, 128, 96, 0.16);
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 9px;
  margin-top: 11px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 900;
}

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

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

.secondary-button,
.ghost-button {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.ghost-button {
  min-height: 40px;
}

.compact {
  min-height: 40px;
}

.manual-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--soft);
}

.manual-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.manual-form input,
.manual-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

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

.safety-note {
  margin: 0 0 12px;
  border: 1px solid rgba(224, 100, 79, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(224, 100, 79, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.feedback-form {
  display: grid;
  grid-template-columns: 0.82fr 1fr 1.2fr;
  gap: 9px;
  margin-bottom: 12px;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.feedback-form input,
.feedback-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

.feedback-message-field,
.feedback-actions {
  grid-column: 1 / -1;
}

.feedback-message {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.feedback-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
  gap: 9px;
}

.feedback-list {
  display: grid;
  gap: 9px;
}

.feedback-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.feedback-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.feedback-kind {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 950;
}

.feedback-meta {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.feedback-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.tiny-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.data-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 9px;
}

.danger-button {
  border-color: rgba(224, 100, 79, 0.36);
  color: var(--coral);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--segment-bg);
}

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

.card-summary:empty {
  display: none;
}

.card-summary-item {
  display: grid;
  gap: 4px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-strong);
}

.card-summary-item span,
.card-summary-item small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.card-summary-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.12;
}

.card-summary-item.unknown-provider {
  border-style: dashed;
}

.priority-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  border: 1px solid rgba(17, 128, 96, 0.22);
  border-radius: 8px;
  padding: 11px;
  background: rgba(17, 128, 96, 0.06);
}

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

.priority-summary > strong {
  color: var(--green-dark);
  font-size: 14px;
}

.priority-summary > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 3px;
}

.priority-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: var(--surface-strong);
}

.priority-item.cancel {
  border-color: rgba(224, 100, 79, 0.45);
}

.priority-item strong,
.priority-item span,
.priority-item small {
  overflow-wrap: anywhere;
}

.priority-item strong {
  font-size: 13px;
}

.priority-item span,
.priority-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.segment.active {
  background: var(--surface-strong);
  color: var(--green-dark);
  box-shadow: 0 5px 14px rgba(24, 32, 28, 0.08);
}

.cancel-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  border: 1px solid rgba(224, 100, 79, 0.24);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(224, 100, 79, 0.07);
}

.cancel-summary strong {
  color: var(--coral);
  font-size: 14px;
  line-height: 1.25;
}

.cancel-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.4;
}

.subscription-list,
.transaction-list {
  display: grid;
  gap: 10px;
}

.subscription-card,
.transaction-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.subscription-card {
  position: relative;
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 13px;
  border-left: 6px solid var(--green);
}

.subscription-card.keep {
  border-left-color: var(--blue);
}

.subscription-card.cancel {
  border-left-color: var(--coral);
}

.subscription-card.unknown {
  border-left-color: var(--yellow);
}

.subscription-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.merchant-name {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  line-height: 1.22;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  background: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.category-pill.shopping {
  background: var(--green);
}

.category-pill.ott {
  background: #6d5ca4;
}

.category-pill.ai {
  background: #8d4f9e;
}

.category-pill.cloud {
  background: var(--blue);
}

.category-pill.music {
  background: #b36a27;
}

.category-pill.game {
  background: #2d7c8a;
}

.category-pill.finance {
  background: #aa6c12;
}

.category-pill.life {
  background: var(--coral);
}

.subscription-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.meta-box {
  display: grid;
  gap: 4px;
  min-height: 54px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 8px;
  background: var(--soft);
}

.meta-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.meta-box strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.25;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.status-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.confidence {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detection-reason {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.status-select {
  min-width: 118px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 900;
  outline: none;
}

.subscription-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  align-items: center;
}

.ai-usage {
  border-color: rgba(109, 92, 164, 0.28) !important;
  color: #5c4d8f !important;
  background: rgba(109, 92, 164, 0.08) !important;
}

.ai-batch-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.ai-insight-block {
  margin-top: 12px;
  border-top: 1px solid var(--soft-line);
  padding-top: 12px;
}

.ai-insight-block strong {
  display: block;
  color: #5c4d8f;
  font-size: 13px;
}

.ai-insight-block p {
  margin: 7px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.transaction-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 124px 64px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
}

.transaction-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.transaction-date,
.transaction-provider {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.transaction-merchant {
  font-weight: 900;
}

.transaction-amount {
  text-align: right;
  font-weight: 950;
}

.empty-state {
  display: grid;
  gap: 7px;
  min-height: 148px;
  place-content: center;
  border: 1px dashed var(--empty-line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: var(--empty-bg);
}

.empty-state strong {
  color: var(--text);
  font-size: 17px;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto max(28px, env(safe-area-inset-bottom));
  color: var(--muted);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 15px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(24, 32, 28, 0.06);
  font-size: 12px;
  font-weight: 850;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: center;
  min-width: 0;
}

.site-footer a,
.content-shell a {
  color: var(--green-dark);
  font-weight: 900;
}

.site-footer a {
  text-decoration: none;
}

.content-shell {
  width: min(920px, calc(100% - 32px));
  margin: 22px auto 24px;
}

.content-hero,
.content-card,
.content-list article,
.content-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(24, 32, 28, 0.08);
}

.content-hero {
  display: grid;
  gap: 14px;
  padding: clamp(20px, 4vw, 34px);
}

.content-hero h1 {
  max-width: 760px;
  font-size: clamp(30px, 4vw, 48px);
}

.content-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.65;
}

.primary-link {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--green);
  color: #fff !important;
  text-decoration: none;
}

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

.content-card,
.content-list article,
.content-note {
  padding: 18px;
}

.sitemap-grid .content-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.content-card h2,
.content-list h2,
.content-note h2 {
  margin: 0 0 10px;
  font-size: 21px;
}

.content-card p,
.content-list p,
.content-note p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.65;
}

.content-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.content-note {
  margin-top: 12px;
  border-color: rgba(224, 100, 79, 0.24);
  background: rgba(224, 100, 79, 0.07);
}

@media (max-width: 980px) {
  .summary-band {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
  }

  .summary-amount {
    justify-items: start;
  }

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

  .save-state {
    justify-self: start;
  }

  .summary-band > .save-state {
    position: static;
  }

  .goal-strip {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .input-area {
    position: static;
  }

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

  .site-footer-inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .site-footer nav {
    justify-content: start;
  }
}

@media (max-width: 620px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    gap: 10px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    margin-top: 3px;
    font-size: 11px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
    justify-self: end;
  }

  .page-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .page-nav::-webkit-scrollbar {
    display: none;
  }

  .page-nav a {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .app-shell {
    width: calc(100% - 16px);
    margin-top: 8px;
  }

  .content-shell,
  .site-footer {
    width: calc(100% - 16px);
    margin-top: 8px;
  }

  .content-hero,
  .content-card,
  .content-list article,
  .content-note {
    padding: 14px;
  }

  .content-hero h1 {
    font-size: 27px;
  }

  .content-hero p {
    font-size: 14px;
  }

  .summary-band {
    min-height: 0;
    gap: 12px;
    padding: 14px;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 21px;
  }

  .summary-amount strong {
    font-size: 38px;
  }

  .summary-stat {
    min-height: 66px;
    padding: 10px;
  }

  .workspace {
    gap: 8px;
    margin-top: 8px;
  }

  .goal-strip {
    gap: 12px;
    margin-top: 8px;
    padding: 12px;
  }

  .goal-meter-top {
    display: grid;
    gap: 7px;
  }

  .goal-meter-top span {
    text-align: left;
  }

  .input-area,
  .report-area,
  .transaction-area,
  .feedback-area,
  .data-area {
    padding: 12px;
  }

  textarea {
    min-height: 178px;
    padding: 12px;
    font-size: 14px;
  }

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

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

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

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

  .feedback-card-top {
    grid-template-columns: 1fr;
  }

  .subscription-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .card-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .priority-list {
    grid-template-columns: 1fr;
  }

  .status-row {
    grid-template-columns: 1fr;
  }

  .subscription-actions {
    justify-content: flex-start;
  }

  .transaction-row {
    grid-template-columns: 50px minmax(0, 1fr) auto minmax(54px, 0.32fr);
    gap: 7px;
    min-height: 48px;
    padding: 9px 10px;
  }

  .transaction-date,
  .transaction-provider {
    font-size: 11px;
  }

  .transaction-amount {
    text-align: right;
  }
}
