* {
  box-sizing: border-box;
}

:root {
  --red: #e22531;
  --deep-red: #b91422;
  --soft-red: #fff0f1;
  --cream: #fffaf4;
  --cream-2: #f9efe4;
  --text: #20242a;
  --muted: #777;
  --line: #eee2d8;
  --green: #25b76b;
  --orange: #f59e0b;
  --blue: #4f80ff;
  --purple: #8b5cf6;
  --shadow: 0 24px 70px rgba(90, 38, 24, 0.13);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(226, 37, 49, 0.08), transparent 28%),
    radial-gradient(circle at 80% 35%, rgba(226, 37, 49, 0.07), transparent 30%),
    linear-gradient(135deg, #fffdf9 0%, #fff6ec 100%);
}

button,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.app-shell.only-phone {
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-area {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone {
  width: 390px;
  height: 790px;
  background: #fff;
  border: 8px solid #141414;
  border-radius: 54px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  overflow: hidden;
  position: relative;
}

.phone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 46px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
  pointer-events: none;
  z-index: 10;
}

.phone-top {
  height: 40px;
  padding: 12px 34px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 800;
  background: #fff;
  position: relative;
  z-index: 5;
}

.dynamic-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 98px;
  height: 28px;
  border-radius: 50px;
  background: #080808;
}

.app-header {
  height: 52px;
  padding: 0 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  position: relative;
  z-index: 5;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo span {
  color: var(--red);
}

.app-logo strong {
  font-size: 15px;
}

.bell {
  border: 0;
  background: #fff;
  font-size: 18px;
}

.screen {
  position: absolute;
  left: 0;
  right: 0;
  top: 92px;
  bottom: 74px;
  padding: 18px 24px 22px;
  overflow-y: auto;
  display: none;
  background: #fff;
}

.screen.active {
  display: block;
}

.screen::-webkit-scrollbar {
  width: 0;
}

.start-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 6px;
}

.start-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: var(--text);
}

.start-logo span {
  color: var(--red);
  font-size: 20px;
}

.start-hero {
  margin-top: 8px;
  padding: 26px 22px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 28%, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(135deg, #e92735, #f45a5d);
  box-shadow: 0 18px 38px rgba(226, 37, 49, 0.25);
  position: relative;
  overflow: hidden;
}

.start-hero::after {
  content: "❤";
  position: absolute;
  right: 22px;
  bottom: 12px;
  font-size: 82px;
  opacity: 0.22;
}

.start-hero small {
  font-weight: 900;
  opacity: 0.95;
}

.start-hero h2 {
  margin: 14px 0 10px;
  font-size: 32px;
  line-height: 1.22;
  letter-spacing: -1px;
}

.start-hero p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
  opacity: 0.94;
}

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

.start-choice-card {
  width: 100%;
  border: 1px solid #f1e4da;
  background: #fffaf7;
  border-radius: 22px;
  padding: 17px;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  text-align: left;
  align-items: center;
  box-shadow: 0 12px 28px rgba(80, 40, 30, 0.07);
  transition: 0.2s ease;
}

.start-choice-card:hover {
  transform: translateY(-3px);
  border-color: rgba(226, 37, 49, 0.35);
  box-shadow: 0 18px 36px rgba(226, 37, 49, 0.13);
}

.choice-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 900;
}

.choice-icon.basic {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
}

.choice-icon.advanced {
  color: var(--red);
  background: #fff0f1;
}

.start-choice-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.start-choice-card p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #666;
}

.start-choice-card span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.start-notice {
  margin-top: auto;
  padding: 15px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #f1e4da;
  color: #555;
}

.start-notice strong {
  display: block;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 5px;
}

.start-notice p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.hero-card {
  background: linear-gradient(135deg, #e92735, #f45a5d);
  color: #fff;
  border-radius: 22px;
  padding: 25px 22px;
  min-height: 150px;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: 0 16px 35px rgba(226, 37, 49, 0.28);
}

.hero-card small {
  font-weight: 800;
  opacity: 0.96;
}

.hero-card h2 {
  font-size: 31px;
  margin: 16px 0 8px;
}

.hero-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.heart-visual {
  width: 96px;
  height: 96px;
  border-radius: 40px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.13));
  align-self: center;
}

.heart-visual span {
  font-size: 54px;
  filter: drop-shadow(0 8px 12px rgba(160, 0, 20, 0.2));
}

.grade-row {
  margin: 18px 0 24px;
  background: #fff;
  padding: 12px 8px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 12px 28px rgba(80, 40, 30, 0.08);
  gap: 5px;
}

.grade-pill {
  border-radius: 14px;
  padding: 10px 2px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: #888;
}

.good {
  color: var(--green);
}

.caution {
  color: var(--orange);
}

.warn {
  color: #ef6c00;
}

.danger {
  color: var(--red);
}

.severe {
  color: #8b0000;
}

.active-pill {
  background: #fff7e8;
  outline: 2px solid #ffb020;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title h3 {
  margin: 0;
  font-size: 18px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: #999;
  font-weight: 700;
}

.summary-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.summary-card {
  background: #fff;
  border: 1px solid #f1e8e2;
  border-radius: 18px;
  padding: 12px 8px;
  min-height: 106px;
  box-shadow: 0 10px 24px rgba(80, 40, 30, 0.06);
}

.summary-card span {
  font-size: 18px;
}

.summary-card small {
  display: block;
  margin: 7px 0;
  color: #777;
  font-size: 11px;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.summary-card em {
  font-style: normal;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.recommend-card {
  margin-top: 18px;
  background: #fff9f5;
  border-radius: 22px;
  border: 1px solid #f1e4da;
  padding: 17px;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  position: relative;
}

.runner {
  font-size: 38px;
}

.recommend-card h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.recommend-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #666;
}

.red-btn,
.main-btn {
  border: 0;
  background: linear-gradient(135deg, var(--red), var(--deep-red));
  color: #fff;
  border-radius: 16px;
  font-weight: 900;
  box-shadow: 0 12px 25px rgba(226, 37, 49, 0.24);
}

.red-btn {
  padding: 10px 14px;
  position: absolute;
  right: 16px;
  bottom: 15px;
  font-size: 12px;
}

.main-btn {
  width: 100%;
  height: 54px;
  margin-top: 16px;
  font-size: 16px;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 74px;
  background: #fff;
  border-top: 1px solid #eee;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 7px 18px 12px;
  z-index: 20;
}

.bottom-nav button {
  border: 0;
  background: transparent;
  font-size: 18px;
  color: #aaa;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-weight: 800;
}

.bottom-nav span {
  font-size: 10px;
}

.bottom-nav .active-nav {
  color: var(--red);
}

.top-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.top-title h2 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 18px;
}

.back-btn {
  border: 0;
  background: transparent;
  font-size: 32px;
  line-height: 1;
}

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

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

.form label,
.wide-label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid #eee0d7;
  border-radius: 14px;
  padding: 0 12px;
  background: #fffaf7;
  outline: none;
  font-size: 14px;
}

input:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(226, 37, 49, 0.08);
}

.toggle-list,
.emergency-box {
  background: #fff9f5;
  border: 1px solid #f1e4da;
  border-radius: 20px;
  padding: 15px;
  display: grid;
  gap: 10px;
}

#page-advanced .emergency-box:first-of-type {
  background: linear-gradient(135deg, #fff6f1, #fff);
  border-color: #f5d8d2;
}

#page-advanced .emergency-box:first-of-type h3 {
  color: var(--red);
}

.toggle-list label,
.emergency-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
}

.toggle-list input,
.emergency-box input {
  width: 16px;
  height: 16px;
}

.emergency-box h3 {
  margin: 0;
  font-size: 16px;
}

.emergency-box p {
  margin: -4px 0 4px;
  font-size: 12px;
  color: #777;
  line-height: 1.4;
}

.result-card {
  border-radius: 26px;
  padding: 25px;
  background: linear-gradient(135deg, #fff7ed, #fff);
  border: 1px solid #f1e5dc;
  text-align: center;
  box-shadow: 0 14px 36px rgba(80, 40, 30, 0.08);
}

.result-card small {
  color: var(--red);
  font-weight: 900;
}

.result-card h2 {
  margin: 12px 0 4px;
  font-size: 30px;
  color: var(--red);
}

.result-card > span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff0d9;
  color: #e57900;
  font-weight: 900;
  font-size: 12px;
}

.gauge {
  width: 210px;
  height: 105px;
  margin: 24px auto 8px;
  border-radius: 210px 210px 0 0;
  background: conic-gradient(from 270deg, #e84545 0deg, #f59e0b 70deg, #22c55e 145deg, #eee 145deg);
  position: relative;
  overflow: hidden;
}

.gauge-cover {
  position: absolute;
  left: 35px;
  bottom: 0;
  width: 140px;
  height: 70px;
  border-radius: 140px 140px 0 0;
  background: #fffdfb;
  display: grid;
  place-items: center;
}

.gauge-cover strong {
  font-size: 24px;
}

.result-card p {
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

/* 등급별 결과 색상 */
.result-card.grade-good {
  --grade-color: #22c55e;
  --grade-soft: #ecfdf5;
  --grade-border: #bbf7d0;
  --grade-fill: 55deg;
}

.result-card.grade-caution {
  --grade-color: #f59e0b;
  --grade-soft: #fff7ed;
  --grade-border: #fed7aa;
  --grade-fill: 80deg;
}

.result-card.grade-warning {
  --grade-color: #f97316;
  --grade-soft: #fff4e6;
  --grade-border: #fdba74;
  --grade-fill: 105deg;
}

.result-card.grade-danger {
  --grade-color: #ef4444;
  --grade-soft: #fff1f2;
  --grade-border: #fecaca;
  --grade-fill: 130deg;
}

.result-card.grade-severe {
  --grade-color: #991b1b;
  --grade-soft: #fef2f2;
  --grade-border: #fca5a5;
  --grade-fill: 155deg;
}

.result-card.grade-good,
.result-card.grade-caution,
.result-card.grade-warning,
.result-card.grade-danger,
.result-card.grade-severe {
  background: linear-gradient(135deg, var(--grade-soft), #fff);
  border-color: var(--grade-border);
}

.result-card.grade-good small,
.result-card.grade-caution small,
.result-card.grade-warning small,
.result-card.grade-danger small,
.result-card.grade-severe small,
.result-card.grade-good h2,
.result-card.grade-caution h2,
.result-card.grade-warning h2,
.result-card.grade-danger h2,
.result-card.grade-severe h2 {
  color: var(--grade-color);
}

.result-card.grade-good > span,
.result-card.grade-caution > span,
.result-card.grade-warning > span,
.result-card.grade-danger > span,
.result-card.grade-severe > span {
  background: var(--grade-soft);
  color: var(--grade-color);
  border: 1px solid var(--grade-border);
}

.result-card.grade-good .gauge,
.result-card.grade-caution .gauge,
.result-card.grade-warning .gauge,
.result-card.grade-danger .gauge,
.result-card.grade-severe .gauge {
  background: conic-gradient(
    from 270deg,
    var(--grade-color) 0deg var(--grade-fill),
    #eeeeee var(--grade-fill) 180deg
  );
}

.result-card.grade-good .gauge-cover strong,
.result-card.grade-caution .gauge-cover strong,
.result-card.grade-warning .gauge-cover strong,
.result-card.grade-danger .gauge-cover strong,
.result-card.grade-severe .gauge-cover strong {
  color: var(--grade-color);
}

.urgent-alert {
  margin-top: 14px;
  background: #fff0f0;
  color: #b10010;
  border: 1px solid #ffc9c9;
  border-radius: 18px;
  padding: 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.hidden {
  display: none;
}

.factor-list {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #f1e5dc;
  border-radius: 20px;
  padding: 16px;
}

.factor-list h3 {
  margin: 0 0 10px;
}

.empty-text {
  color: #888;
  font-size: 13px;
}

.factor-item {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-top: 1px solid #f4ebe5;
  font-size: 13px;
}

.factor-item:first-of-type {
  border-top: 0;
}

.factor-item em {
  font-style: normal;
  color: var(--red);
  font-weight: 900;
}

.tabs {
  background: #f7f1ec;
  border-radius: 16px;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.tabs button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  height: 34px;
  font-weight: 900;
  color: #888;
}

.tabs .active-tab {
  background: var(--red);
  color: #fff;
}

.report-card {
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(180deg, #fff0f2, #fff);
  border: 1px solid #f1e1e2;
}

.report-card small {
  color: var(--red);
  font-weight: 900;
}

.report-card h2 {
  margin: 10px 0 0;
  font-size: 40px;
  color: var(--red);
}

.report-card h2 span {
  font-size: 18px;
  color: #333;
}

.report-card p {
  margin: 4px 0 14px;
  color: #777;
}

.line-chart {
  height: 90px;
  display: flex;
  align-items: end;
  gap: 16px;
  border-bottom: 2px solid #f1d5d5;
}

.line-chart span {
  flex: 1;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--red), #ff9a9a);
}

.indicator-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.indicator-list div {
  padding: 14px;
  border-radius: 16px;
  background: #fffaf7;
  border: 1px solid #f0e5dc;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  font-size: 13px;
}

.indicator-list span {
  color: #666;
}

.indicator-list strong {
  font-size: 12px;
}

.indicator-list em {
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.ok {
  color: var(--green);
}

.caution-text {
  color: var(--orange);
}

.warn-text {
  color: var(--red);
}

.date-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  align-items: center;
  margin-bottom: 18px;
}

.date-row button {
  border: 0;
  background: transparent;
  font-size: 22px;
}

.habit-list {
  display: grid;
  gap: 12px;
}

.habit-list label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #f0e5dc;
  border-radius: 18px;
  padding: 15px;
  background: #fffaf7;
  font-weight: 900;
}

.habit-list small {
  color: #777;
  font-weight: 600;
}

.habit-list input {
  width: 22px;
  height: 22px;
  accent-color: var(--red);
}

.progress-box {
  margin-top: 18px;
  padding: 18px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #f0e5dc;
}

.progress-line {
  height: 8px;
  border-radius: 999px;
  background: #f2e7de;
  margin-top: 12px;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #ff8b8b);
}

.alert-list {
  display: grid;
  gap: 12px;
}

.alert-card {
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid #f0e5dc;
  background: #fff;
}

.alert-card > span {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}

.alert-card strong {
  display: block;
  font-size: 14px;
}

.alert-card p {
  margin: 5px 0 0;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.alert-card small {
  color: #aaa;
  font-size: 11px;
}

.alert-card.red > span {
  background: #fff0f0;
  color: var(--red);
}

.alert-card.green > span {
  background: #eafaf1;
  color: var(--green);
}

.alert-card.blue > span {
  background: #eef3ff;
  color: var(--blue);
}

.alert-card.purple > span {
  background: #f4efff;
  color: var(--purple);
}

@media (max-width: 920px) {
  .app-shell.only-phone {
    padding: 12px;
  }

  .phone {
    width: min(390px, 100%);
    height: min(790px, calc(100vh - 24px));
  }
}

