/* 時給計算機 — モバイルファースト・レスポンシブ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --surface-elevated: #232d3a;
  --border: #2d3a4a;
  --text: #e8edf4;
  --text-muted: #8b9cb0;
  --accent: #3d9cf0;
  --accent-dim: #2a6fa8;
  --error: #f07178;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, transparent 55%),
    var(--bg);
}

.app {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lead {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow);
}

.card--result {
  background: linear-gradient(165deg, var(--surface-elevated) 0%, var(--surface) 100%);
}

.card__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field__input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.field__input:hover {
  border-color: var(--accent-dim);
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 156, 240, 0.25);
}

/* number スピンボタンを控えめに */
.field__input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.field__input[type="number"]::-webkit-outer-spin-button,
.field__input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.fieldset {
  margin: 0 0 1rem;
  padding: 0;
  border: none;
}

.fieldset__legend {
  float: left;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  clear: both;
}

.field--inline {
  margin-bottom: 0;
}

.errors {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--error);
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
  border-radius: var(--radius-sm);
}

.errors[hidden] {
  display: none !important;
}

.errors__list {
  margin: 0;
  padding-left: 1.15rem;
}

.errors__item {
  margin-bottom: 0.25rem;
}

.errors__item:last-child {
  margin-bottom: 0;
}

.results {
  margin: 0;
}

.results__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.results__row:first-child {
  padding-top: 0;
}

.results__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.results__term {
  margin: 0;
  font-weight: 500;
  flex: 1 1 auto;
  min-width: 8rem;
}

.results__def {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.footer {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer__note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

@media (min-width: 480px) {
  .app {
    padding: 2rem 1.25rem 2.5rem;
  }

  .card {
    padding: 1.5rem 1.25rem;
  }
}

@media (min-width: 640px) {
  .app {
    max-width: 36rem;
  }
}
