:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-muted: #eef2ed;
  --ink: #1d2520;
  --muted: #647067;
  --line: #d9e0da;
  --green: #28724f;
  --green-soft: #dceee4;
  --theme-dark: #183327;
  --theme-accent: #b9e4c9;
  --theme-rgb: 40, 114, 79;
  --theme-dark-rgb: 24, 51, 39;
  --theme-accent-rgb: 185, 228, 201;
  --blue: #2f638f;
  --amber: #9a681a;
  --red: #a13d35;
  --shadow: 0 18px 45px rgba(33, 45, 38, 0.08);
  --ad-banner-height: 82px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.login-scene {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(var(--theme-dark-rgb), 0.92), rgba(var(--theme-rgb), 0.8)),
    var(--bg);
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #f6fbf7;
  background: rgba(var(--theme-dark-rgb), 0.92);
  box-shadow: 0 28px 70px rgba(var(--theme-dark-rgb), 0.28);
}

.login-card h1 {
  margin-top: 12px;
}

.login-card p {
  margin-top: 8px;
  color: #c8d9cf;
  line-height: 1.5;
}

.login-card label {
  color: #d8e8dd;
}

.login-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: var(--theme-dark);
  background: var(--theme-accent);
  font-weight: 900;
}

.login-reset-button {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #d8e8dd;
  background: transparent;
  font-weight: 800;
}

.login-helper-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px;
  color: #f6fbf7;
  background: var(--theme-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--theme-dark);
  background: var(--theme-accent);
  font-weight: 800;
}

.profile-image-control {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  cursor: pointer;
  outline: 2px solid transparent;
  transition:
    outline-color 0.15s ease,
    transform 0.15s ease;
}

.profile-image-control img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-image-control:hover,
.profile-image-control:focus-within {
  outline-color: rgba(var(--theme-accent-rgb), 0.55);
  transform: translateY(-1px);
}

.image-edit-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--theme-dark);
  border-radius: 50%;
  color: var(--theme-dark);
  background: #f6fbf7;
}

.image-edit-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #b7c8be;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.ghost-button,
.text-button,
.primary-button,
.month-control button {
  border: 0;
  border-radius: 8px;
}

.nav-item {
  padding: 12px 14px;
  color: #d8e8dd;
  text-align: left;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  color: var(--theme-dark);
  background: var(--theme-accent);
}

.storage-panel {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.storage-panel span {
  color: #b7c8be;
  font-size: 12px;
}

.storage-panel label {
  color: #b7c8be;
}

.storage-panel input {
  padding: 9px 10px;
  border-color: rgba(255, 255, 255, 0.18);
  color: #f6fbf7;
  background: rgba(255, 255, 255, 0.08);
}

.storage-panel input::placeholder {
  color: #9eb2a6;
}

.ghost-button {
  padding: 9px 10px;
  color: #f6fbf7;
  background: rgba(255, 255, 255, 0.1);
}

.content {
  min-width: 0;
  padding: 30px 30px calc(30px + var(--ad-banner-height));
}

.bottom-ad-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 260px;
  z-index: 30;
  padding: 10px 30px;
  border-top: 1px solid rgba(var(--theme-rgb), 0.18);
  background: rgba(244, 246, 243, 0.94);
  backdrop-filter: blur(10px);
}

.ad-banner-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(33, 45, 38, 0.08);
}

.ad-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.ad-banner-inner strong,
.ad-banner-inner p {
  display: block;
}

.ad-banner-inner strong {
  font-size: 15px;
}

.ad-banner-inner p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.ad-live-slot {
  display: block;
  min-height: 58px;
  padding: 0;
  overflow: hidden;
}

.ad-live-slot .adsbygoogle {
  width: 100%;
  min-height: 58px;
}

.ad-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--theme-dark);
  background: var(--theme-accent);
  font-size: 13px;
  font-weight: 900;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: 0;
}

.month-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.month-control button {
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: var(--surface-muted);
  font-size: 22px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel,
.insight-card,
.badge-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  border: 1px solid var(--line);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.metric-card:hover,
.metric-card:focus-visible {
  color: var(--theme-dark);
  border-color: var(--theme-accent);
  background: var(--green-soft);
  box-shadow: 0 18px 45px rgba(var(--theme-rgb), 0.14);
  transform: translateY(-1px);
}

.metric-card span,
.panel-heading span,
.insight-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.metric-card.emphasis {
  color: inherit;
  border-color: var(--line);
  background: var(--surface);
}

.metric-card.emphasis:hover,
.metric-card.emphasis:focus-visible {
  color: var(--theme-dark);
  border-color: var(--theme-accent);
  background: var(--green-soft);
}

.dashboard-grid,
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 14px;
}

.active-goals-panel {
  margin-bottom: 14px;
}

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

.goal-progress-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: #fbfcfb;
}

.goal-progress-item:hover,
.goal-progress-item:focus-visible {
  border-color: var(--green);
  box-shadow: 0 12px 28px rgba(var(--theme-rgb), 0.12);
}

.goal-progress-item.good {
  border-color: var(--theme-accent);
  background: var(--green-soft);
}

.goal-progress-item.danger {
  border-color: #d78178;
  background: #fff0ef;
}

.goal-progress-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.goal-progress-top strong,
.goal-progress-top span {
  display: block;
}

.goal-progress-top span,
.goal-progress-item small {
  color: var(--muted);
  font-size: 13px;
}

.goal-progress-top em {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.goal-progress-item.progress .goal-progress-top em {
  color: var(--theme-dark);
  background: var(--theme-accent);
}

.goal-progress-item.danger .goal-progress-top em {
  background: var(--red);
}

.goal-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.goal-progress-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.goal-progress-item.danger .goal-progress-track div {
  background: var(--red);
}

.wide-panel {
  grid-column: span 1;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.transaction-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.transaction-view-controls {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.transaction-view-controls button {
  min-width: 54px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.transaction-view-controls button.active {
  color: var(--theme-dark);
  background: #fff;
  box-shadow: 0 1px 4px rgba(33, 45, 38, 0.08);
}

.text-button {
  color: var(--green);
  background: transparent;
  font-weight: 700;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  text-decoration: none;
}

.excel-sample-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bar-list,
.compact-list,
.table-list,
.investment-strip {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 110px;
  align-items: center;
  gap: 12px;
  min-height: 34px;
}

.payment-stat-row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(80px, 1fr) 110px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.list-item,
.investment-item,
.table-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.clickable-list-item {
  width: 100%;
  color: inherit;
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.clickable-list-item:hover,
.clickable-list-item:focus-visible {
  border-color: var(--theme-accent);
  box-shadow: 0 8px 22px rgba(var(--theme-rgb), 0.14);
  outline: 0;
  transform: translateY(-1px);
}

.selected-row {
  border-color: var(--theme-accent);
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 var(--green);
}

.list-item,
.table-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.list-item small,
.table-row small,
.investment-item small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.transaction-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-width: 0;
}

.transaction-summary strong {
  flex: 0 0 auto;
}

.transaction-summary small {
  min-width: 0;
  color: #526057;
  font-size: 13px;
  letter-spacing: 0;
}

.amount-income {
  color: var(--blue);
}

.amount-expense {
  color: var(--red);
}

.amount-saving {
  color: var(--green);
}

.form-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.primary-button {
  padding: 12px 14px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-button,
.danger-button,
.mini-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.secondary-button,
.danger-button {
  padding: 11px 12px;
}

.secondary-button {
  color: var(--ink);
}

.danger-button {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.table-panel {
  min-width: 0;
}

.registered-history-panel {
  margin-top: 14px;
}

.transaction-calendar-panel {
  margin-top: 14px;
}

#transactionsView .transaction-calendar-panel {
  display: none;
}

#transactionsView.calendar-mode .work-grid {
  grid-template-columns: 1fr;
}

#transactionsView.calendar-mode .transaction-calendar-panel {
  display: block;
  order: -1;
  margin-top: 0;
}

#transactionsView.calendar-mode .form-panel,
#transactionsView.calendar-mode .table-panel {
  display: none;
}

#transactionsView.calendar-mode .excel-import-panel,
#transactionsView.calendar-mode .registered-history-panel {
  display: none;
}

.excel-import-panel {
  margin-top: 14px;
}

.excel-import-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.excel-import-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.excel-import-status.success {
  color: var(--green);
  font-weight: 800;
}

.excel-import-status.error {
  color: var(--red);
  font-weight: 800;
}

.monthly-transaction-list {
  max-height: 520px;
  overflow: auto;
}

.monthly-transaction-item {
  min-height: 58px;
}

.transaction-calendar-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-weekdays,
.transaction-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  min-width: 760px;
}

.calendar-weekdays {
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.transaction-calendar {
  gap: 6px;
}

.calendar-day {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 6px;
  min-height: 116px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #fbfcfb;
}

.calendar-day.outside-day {
  background: transparent;
  border-style: dashed;
  opacity: 0.35;
}

.calendar-day.has-transactions {
  background: #fff;
}

.calendar-day.active {
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}

.calendar-day-number {
  font-weight: 900;
}

.calendar-totals,
.calendar-chips {
  display: grid;
  gap: 3px;
}

.calendar-totals {
  min-height: 18px;
  font-size: 12px;
  font-weight: 800;
}

.calendar-chip,
.calendar-more {
  min-width: 0;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  color: var(--muted);
}

.calendar-day-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.calendar-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-detail-heading strong,
.calendar-detail-heading span {
  display: block;
}

.calendar-detail-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-detail-totals {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
}

.categorized-history {
  display: grid;
  gap: 14px;
}

.history-group {
  display: grid;
  gap: 10px;
}

.history-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.history-group-heading span {
  color: var(--muted);
  font-size: 13px;
}

.history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.history-item small {
  color: #526057;
  font-size: 13px;
  line-height: 1.45;
}

.history-actions {
  display: flex;
  gap: 6px;
}

.mini-button {
  padding: 7px 9px;
  color: var(--ink);
  font-size: 12px;
}

.mini-button.danger {
  color: var(--red);
  border-color: #e0b7b2;
}

.history-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.security-detail-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.security-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
}

.security-tab {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.security-tab.active {
  color: var(--theme-dark);
  border-color: var(--theme-accent);
  background: var(--green-soft);
}

.security-detail-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.26fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.security-detail-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.security-detail-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.detail-metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.detail-metrics dt,
.detail-metrics dd {
  margin: 0;
}

.detail-metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-metrics dd {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.announcement-metrics {
  grid-template-columns: repeat(6, minmax(105px, 1fr));
}

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

.investment-item strong {
  font-size: 19px;
}

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

.insight-card,
.badge-panel {
  padding: 20px;
}

.insight-card strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 26px;
}

.insight-card p {
  color: var(--muted);
  line-height: 1.5;
}

.badge-panel {
  grid-column: 1 / -1;
}

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

.review-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.review-panel {
  padding: 20px;
}

.risk-panel {
  border-color: #e8c998;
  background: linear-gradient(180deg, #fffaf0, var(--surface));
}

.risk-panel .panel-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(154, 104, 26, 0.2);
}

.risk-panel .panel-heading h2 {
  color: #6d3f07;
}

.wide-review-panel {
  grid-column: 1 / -1;
}

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

.review-metric,
.goal-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.goal-item {
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.goal-item:hover,
.goal-item:focus-visible {
  border-color: var(--theme-accent);
  background: var(--green-soft);
  box-shadow: 0 12px 28px rgba(var(--theme-rgb), 0.12);
  transform: translateY(-1px);
}

.goal-item.selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.review-metric span,
.goal-item span,
.goal-item small,
.review-list-item small,
.signal-item span {
  color: var(--muted);
  font-size: 13px;
}

.review-metric strong,
.goal-item strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 20px;
}

.goal-item em {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 28, 23, 0.42);
  backdrop-filter: blur(6px);
}

.goal-modal {
  display: grid;
  gap: 18px;
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--theme-accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(25, 35, 29, 0.24);
}

.goal-modal-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
}

.goal-modal-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.modal-eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.goal-modal h2 {
  margin: 6px 0 0;
  font-size: 25px;
}

.goal-modal p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.goal-modal-preview {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--theme-accent);
  border-radius: 8px;
  background: var(--green-soft);
}

.goal-modal-preview span,
.goal-modal-preview small {
  color: var(--muted);
}

.goal-modal-preview strong {
  font-size: 30px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.account-modal {
  width: min(560px, 100%);
}

.account-form {
  display: grid;
  gap: 14px;
}

.account-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.account-summary span,
.form-status {
  color: var(--muted);
  font-size: 13px;
}

.account-summary strong {
  font-size: 20px;
}

.form-status {
  min-height: 20px;
  margin: 0;
  line-height: 1.45;
}

.form-status.success {
  color: var(--green);
  font-weight: 800;
}

.form-status.error {
  color: var(--red);
  font-weight: 800;
}

.review-list,
.recommendation-list,
.goal-list {
  display: grid;
  gap: 10px;
}

.review-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.review-list-item strong,
.review-list-item small {
  display: block;
}

.review-list-item small {
  margin-top: 4px;
}

.review-list-item span {
  font-weight: 900;
}

.signal-item,
.recommendation-item {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.signal-item {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  min-height: 82px;
  overflow: hidden;
  padding: 16px 16px 16px 18px;
  border-width: 2px;
  box-shadow: 0 12px 28px rgba(80, 54, 12, 0.08);
}

.signal-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
}

.signal-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
}

.signal-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.signal-copy {
  display: grid;
  gap: 5px;
}

.signal-copy strong {
  font-size: 16px;
}

.signal-copy span {
  line-height: 1.45;
}

.signal-item.good {
  border-color: var(--theme-accent);
  background: var(--green-soft);
}

.signal-item.good::before,
.signal-item.good .signal-icon {
  color: #fff;
  background: var(--green);
}

.signal-item.warning {
  border-color: #e5bb65;
  background: #fff6df;
}

.signal-item.warning::before,
.signal-item.warning .signal-icon {
  color: #fff;
  background: #b87508;
}

.signal-item.danger {
  border-color: #d78178;
  background: #fff0ef;
}

.signal-item.danger::before,
.signal-item.danger .signal-icon {
  color: #fff;
  background: var(--red);
}

.recommendation-item {
  border-color: var(--theme-accent);
  background: linear-gradient(90deg, var(--green-soft), #fff);
  font-weight: 800;
  line-height: 1.5;
}

.goal-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.settings-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.settings-profile-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 16px;
}

.settings-profile-image {
  width: 64px;
  height: 64px;
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.member-item span,
.member-item small {
  display: block;
}

.member-item span {
  font-weight: 900;
}

.member-item small {
  color: var(--muted);
  font-size: 12px;
}

.invite-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--theme-accent);
  border-radius: 8px;
  background: var(--green-soft);
}

.invite-box span,
.invite-code-result span,
.invite-code-result small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.invite-code-result {
  display: grid;
  gap: 5px;
  margin: 0;
}

.invite-code-result strong {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 20px;
  letter-spacing: 1px;
}

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

.theme-swatches button {
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--swatch-color);
}

.theme-swatches button.active {
  border-color: #ffffff;
  box-shadow:
    0 0 0 2px var(--theme-accent),
    0 6px 16px rgba(var(--theme-rgb), 0.2);
}

.settings-panel input[type="color"] {
  height: 48px;
  padding: 5px;
}

.badge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.badge.active {
  color: var(--theme-dark);
  border-color: var(--theme-accent);
  background: var(--green-soft);
}

.badge.inactive {
  color: #8b958f;
  border-color: #dde2dd;
  background: #f1f3f1;
}

.badge-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
}

.badge.active .badge-icon {
  color: #fff;
  background: var(--green);
}

.badge.inactive .badge-icon {
  color: #9aa39d;
  background: #e1e5e2;
}

.badge-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.badge-copy {
  min-width: 0;
}

.badge-copy strong,
.badge-copy small {
  display: block;
}

.badge-copy strong {
  font-size: 14px;
}

.badge-copy small {
  margin-top: 5px;
  color: currentColor;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.76;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .bottom-ad-banner {
    left: 0;
  }

  .sidebar {
    position: static;
    gap: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
  }

  .metric-grid,
  .dashboard-grid,
  .work-grid,
  .insight-layout,
  .badge-list,
  .review-metric-grid,
  .goal-list,
  .goal-progress-list,
  .investment-strip,
  .settings-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .content {
    padding: 20px 20px calc(20px + var(--ad-banner-height));
  }

  .bottom-ad-banner {
    padding: 8px 12px;
  }

  .ad-banner-inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ad-action {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-list,
  .metric-grid,
  .dashboard-grid,
  .work-grid,
  .insight-layout,
  .review-layout,
  .badge-list,
  .review-metric-grid,
  .goal-list,
  .goal-progress-list,
  .investment-strip,
  .settings-layout,
  .history-list,
  .security-detail-list {
    grid-template-columns: 1fr;
  }

  .security-detail-card {
    grid-template-columns: 1fr;
  }

  .security-detail-heading {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 12px;
  }

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

  .history-item {
    grid-template-columns: 1fr;
  }

  .excel-import-controls {
    grid-template-columns: 1fr;
  }

  .history-actions {
    justify-content: flex-end;
  }

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