html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
}

#app-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #1a73e8;
  margin: 0 0 8px 0;
}

#app-subtitle {
  text-align: center;
  font-size: 15px;
  color: #666;
  margin: 0 0 28px 0;
}

#config-section {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #222;
}

.card-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #444;
}

#base-card {
  flex: 1 1 280px;
}

#ratios-card {
  flex: 2 1 480px;
}

.input-field {
  width: 100%;
  padding: 10px 14px;
  font-size: 18px;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.input-field:focus {
  border-color: #1a73e8;
}

.city-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.inline-label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

.select-field {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  background: #fafafa;
}

.select-field:focus {
  border-color: #1a73e8;
}

.base-tip {
  font-size: 12px;
  color: #999;
  margin: 10px 0 0 0;
}

.ratio-table {
  width: 100%;
}

.ratio-header {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 2px solid #eee;
  margin-bottom: 8px;
}

.ratio-header .ratio-name {
  flex: 0 0 90px;
  font-size: 13px;
  font-weight: 600;
  color: #888;
}

.ratio-header .ratio-personal,
.ratio-header .ratio-company {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-align: center;
}

.ratio-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}

.ratio-row .ratio-name {
  flex: 0 0 90px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.ratio-input {
  width: 60px;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.ratio-input:focus {
  border-color: #1a73e8;
}

.ratio-input.ratio-personal {
  margin-left: auto;
  margin-right: 0;
}

.ratio-input.ratio-company {
  margin-left: auto;
  margin-right: 0;
}

.ratio-unit {
  font-size: 13px;
  color: #999;
  margin-left: 4px;
  margin-right: 20px;
}

.ratio-row .ratio-personal,
.ratio-row .ratio-company {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

#result-section {
  margin-bottom: 24px;
}

#result-card {
  padding: 20px;
}

#result-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

#result-table th,
#result-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

#result-table thead th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
  font-size: 13px;
}

#result-table tbody tr:hover {
  background: #f8fbff;
}

.foot-row td {
  background: #f0f7ff;
  font-size: 15px !important;
}

#result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.summary-item {
  flex: 1 1 calc(50% - 6px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.summary-label {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.summary-value {
  font-size: 18px;
  font-weight: 700;
  color: #1a73e8;
}

.summary-highlight {
  flex: 1 1 100%;
  background: #e8f0fe;
}

.summary-highlight .summary-value {
  color: #d93025;
  font-size: 20px;
}

.summary-takehome {
  flex: 1 1 100%;
  background: #e6f4ea;
}

.summary-takehome .summary-value {
  color: #137333;
  font-size: 20px;
}

#features,
#scenarios,
#FAQ {
  max-width: 900px;
  margin: 0 auto 32px auto;
  padding: 0 16px;
}

#features h2,
#scenarios h2,
#FAQ h2 {
  font-size: 20px;
  font-weight: 600;
  color: #222;
  margin: 0 0 12px 0;
}

#features p {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin: 0;
}

#scenarios ul {
  padding-left: 20px;
  margin: 0;
}

#scenarios li {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 4px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 16px 0 6px 0;
}

#FAQ dd {
  font-size: 14px;
  color: #666;
  line-height: 1.7;
  margin: 0 0 0 0;
}

#__fork {
  max-width: 900px;
  margin: 0 auto 24px auto;
  padding: 0 16px;
  text-align: center;
}

#__fork button {
  padding: 10px 28px;
  font-size: 14px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

#__fork button:hover {
  background: #1557b0;
}

@media (max-width: 768px) {
  #config-section {
    flex-direction: column;
    gap: 16px;
  }

  #ratio-table .ratio-header,
  #ratio-table .ratio-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .ratio-row .ratio-name {
    flex: 0 0 100%;
  }

  .ratio-input {
    width: 52px;
    font-size: 13px;
  }

  .summary-item {
    flex: 1 1 100%;
  }

  #result-table th,
  #result-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #app-title {
    font-size: 22px;
  }

  #app-subtitle {
    font-size: 13px;
  }

  .card {
    padding: 14px;
  }

  .input-field {
    font-size: 16px;
    padding: 8px 10px;
  }

  #result-table th,
  #result-table td {
    padding: 6px 4px;
    font-size: 11px;
  }

  .summary-value {
    font-size: 15px;
  }
}
