* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c0392b;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 20px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #444;
  border-left: 3px solid #e74c3c;
  padding-left: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
}

input[type="number"] {
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.2s;
}

input[type="number"]:focus {
  outline: none;
  border-color: #e74c3c;
}

button {
  width: 100%;
  padding: 13px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #c0392b;
}

.result-card {
  border-top: 3px solid #e74c3c;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.result-item {
  background: #fafafa;
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid #eee;
}

.result-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 6px;
  font-weight: 600;
}

.result-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
}

.result-value.warn {
  color: #e74c3c;
}

.result-value.ok {
  color: #27ae60;
}

.judgment {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.6;
}

.judgment.now {
  background: #fdecea;
  color: #c0392b;
  border-left: 4px solid #e74c3c;
}

.judgment.soon {
  background: #fff8e1;
  color: #e67e22;
  border-left: 4px solid #f39c12;
}

.judgment.safe {
  background: #eafaf1;
  color: #27ae60;
  border-left: 4px solid #27ae60;
}

.judgment.norise {
  background: #eaf4fb;
  color: #2980b9;
  border-left: 4px solid #2980b9;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  background: #f8f8f8;
  padding: 8px 10px;
  text-align: right;
  font-weight: 700;
  color: #555;
  border-bottom: 2px solid #eee;
}

th:first-child {
  text-align: center;
}

td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

td:first-child {
  text-align: center;
  font-weight: 600;
  color: #666;
}

tr.timing-row td {
  background: #fdecea;
  color: #c0392b;
  font-weight: 700;
}

tr:hover td {
  background: #fafafa;
}

tr.timing-row:hover td {
  background: #fdecea;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-ok { background: #d5f5e3; color: #27ae60; }
.badge-warn { background: #fdecea; color: #e74c3c; }

@media (max-width: 480px) {
  .form-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.3rem; }
}
