:root {
  color-scheme: light;
  --bg: #f4f8f3;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-2: #ffffff;
  --line: #d8e3dc;
  --text: #1d2730;
  --muted: #52606b;
  --green: #168a45;
  --green-2: #22b866;
  --cyan: #097c93;
  --yellow: #ad7b00;
  --pink: #b34b8f;
  --danger: #c24141;
  --shadow: 0 18px 46px rgba(30, 64, 53, 0.11);
  --soft-shadow: 0 8px 22px rgba(30, 64, 53, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(226, 247, 233, 0.92), rgba(245, 251, 255, 0.78) 42%, rgba(255, 252, 238, 0.72)),
    var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  letter-spacing: 0;
}

body::after {
  content: "실버메디컬복지센터 전용";
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 0;
  color: rgba(22, 138, 69, 0.055);
  font-size: clamp(44px, 8vw, 112px);
  font-weight: 900;
  pointer-events: none;
  white-space: nowrap;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.benefits-global-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.benefits-global-nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 5px;
  color: #33443a;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.benefits-global-nav a:hover,
.benefits-global-nav a:focus-visible,
.benefits-global-nav a[aria-current="page"] {
  background: #dff2e5;
  color: #0f6f37;
}

.brand-lock {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 116px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(22, 138, 69, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #eef9f2);
  box-shadow: var(--shadow);
}

.home-shortcut {
  margin-left: auto;
  min-width: 144px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 2px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(22, 138, 69, 0.22);
}

.home-shortcut:hover,
.home-shortcut:focus-visible {
  color: #ffffff;
  background: #0f6f37;
  outline: 4px solid rgba(34, 184, 102, 0.24);
}

.brand-lock img {
  width: 180px;
  height: 96px;
  object-fit: contain;
  border: 1px solid rgba(22, 138, 69, 0.18);
  border-radius: 8px;
  background: #dfe8bf;
}

.brand-lock div,
.app-footer div {
  display: grid;
  gap: 6px;
}

.brand-lock strong {
  color: var(--green);
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
}

.brand-lock span {
  color: #2f3b45;
  font-size: 24px;
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 18px 4px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 18px;
  font-weight: 900;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: #17212b;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.08;
}

.lead {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.55;
}

.hero-badge {
  min-width: 240px;
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 22px;
  border: 1px solid rgba(9, 124, 147, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #edfaff);
  box-shadow: var(--soft-shadow);
}

.hero-badge span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.hero-badge strong {
  color: var(--cyan);
  font-size: 34px;
}

.controls,
.summary,
.compare-section,
.memo {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.quick-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.quick-actions button {
  min-height: 64px;
  border: 2px solid #21a85e;
  border-radius: 8px;
  background: linear-gradient(135deg, #20b761, #0f7f95);
  color: #ffffff;
  font-size: 23px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(22, 138, 69, 0.18);
}

.quick-actions button:hover,
.quick-actions button:focus-visible {
  background: linear-gradient(135deg, #168a45, #086b7f);
  outline: 4px solid rgba(34, 184, 102, 0.24);
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: #34424f;
  font-size: 18px;
  font-weight: 900;
}

select,
input {
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 2px solid #bfd2c7;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}

select:focus,
input:focus {
  outline: 4px solid rgba(9, 124, 147, 0.18);
  border-color: var(--cyan);
}

.summary {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.result-card {
  min-height: 170px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.result-card span {
  color: var(--muted);
  font-size: 19px;
  font-weight: 900;
}

.result-card strong {
  color: var(--cyan);
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.08;
}

.result-card.primary {
  border-color: rgba(22, 138, 69, 0.34);
  background: linear-gradient(135deg, #ffffff, #eaf8ef);
}

.result-card.primary strong {
  color: var(--green);
}

.family-card {
  border-color: rgba(173, 123, 0, 0.32);
  background: linear-gradient(135deg, #ffffff, #fff7de);
}

.family-card strong {
  color: var(--yellow);
}

.result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.compare-section,
.memo {
  padding: 18px;
  margin-bottom: 18px;
}

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

h2 {
  margin-bottom: 0;
  color: #17212b;
  font-size: 28px;
}

.section-title p,
.source {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 19px;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: #0d6e3a;
  background: #eef8f2;
  font-size: 18px;
}

td {
  color: var(--text);
  font-weight: 800;
}

tr:last-child td {
  border-bottom: none;
}

.highlight {
  color: #9b6d00;
}

.family-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(173, 123, 0, 0.32);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #fff7df);
}

.family-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(34px, 4vw, 52px);
}

.family-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.family-hero > strong {
  color: var(--yellow);
  font-size: clamp(46px, 7vw, 88px);
  line-height: 1;
  white-space: nowrap;
}

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

.family-grid article {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.family-grid span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

.family-grid strong {
  color: var(--green);
  font-size: clamp(30px, 4vw, 48px);
}

.family-grid p {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.45;
  font-weight: 900;
}

.memo {
  display: grid;
  gap: 12px;
}

.app-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.app-footer img {
  width: 150px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: #dfe8bf;
}

.app-footer strong {
  color: var(--green);
  font-size: 22px;
}

.app-footer span {
  color: var(--muted);
  font-size: 18px;
}

#counselMemo {
  display: grid;
  gap: 10px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.55;
}

.memo-pill {
  padding: 14px 16px;
  border-left: 5px solid var(--green);
  background: #f4faf6;
  border-radius: 6px;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero,
  .summary,
  .family-hero,
  .family-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .benefits-global-nav {
    justify-content: flex-start;
  }
  .app {
    width: min(100% - 20px, 1280px);
    padding-top: 16px;
  }

  .brand-lock,
  .app-footer {
    align-items: start;
    flex-wrap: wrap;
  }

  .brand-lock img {
    width: 120px;
    height: 72px;
  }

  .home-shortcut {
    width: 100%;
    margin-left: 0;
  }

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

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

  .section-title {
    display: grid;
  }

  select,
  input {
    font-size: 22px;
  }

  .table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }

  table {
    min-width: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--soft-shadow);
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(216, 227, 220, 0.9);
    text-align: right;
    font-size: 18px;
    white-space: normal;
  }

  td:first-child {
    text-align: right;
  }

  td:last-child {
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    flex: 0 0 46%;
    color: var(--green);
    font-weight: 900;
    text-align: left;
  }
}
