:root {
  color-scheme: light;
  --bg: #eaf4ff;
  --bg-2: #fdf7dc;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #17324d;
  --muted: #5c7287;
  --border: rgba(23, 50, 77, 0.12);
  --primary: #2e6ea6;
  --primary-dark: #1d507d;
  --accent: #f1cf67;
  --success: #2d7d46;
  --error: #b54444;
  --shadow: 0 18px 48px rgba(24, 50, 77, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(241, 207, 103, 0.30), transparent 28%),
    radial-gradient(circle at top right, rgba(46, 110, 166, 0.24), transparent 26%),
    linear-gradient(180deg, var(--bg), #f7fbff 60%, var(--bg-2));
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(18px);
  background: rgba(234, 244, 255, 0.82);
  border-bottom: 1px solid var(--border);
}

.site-brand {
  display: grid;
  gap: 0.15rem;
}

.brand-link {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-tag {
  color: var(--muted);
  font-size: 0.82rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav a {
  text-decoration: none;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--primary-dark);
}

.site-nav a.is-active,
.site-nav a:hover {
  background: rgba(46, 110, 166, 0.12);
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-strong);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--primary-dark);
  border-radius: 999px;
}

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.25rem auto 3rem;
}

.user-strip,
.content-card,
.hero-card,
.flash {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.user-strip {
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}

.user-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.flash {
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.flash-success { border-left: 6px solid var(--success); }
.flash-error { border-left: 6px solid var(--error); }

.content-card,
.hero-card {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.hero-card {
  max-width: 760px;
  margin: 4rem auto;
  text-align: center;
}

.login-hero-image-wrap {
  margin: -0.5rem -0.5rem 1rem;
  text-align: center;

  .login-hero-image {
    display: inline-block;
    width: 60%;
    height: auto;
    border-radius: 18px;
  }
}


.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 700;
}

.hero-card h1,
.content-card h1 {
  margin: 0;
  line-height: 1.25;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.hero-copy,
.help-copy,
.notice p,
.recommend-card p,
.recommend-card span {
  color: var(--muted);
}

.notice {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(241, 207, 103, 0.18);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.secondary-button {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--border);
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
}

.record-form,
.target-form {
  display: grid;
  gap: 1rem;
}

.record-top-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.record-form .recommend-card > .form-actions {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

label,
fieldset {
  display: grid;
  gap: 0.45rem;
}

.record-form .recommend-card {
  display: grid;
  gap: 0.75rem;
}

.record-form .recommend-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

label {
  font-size: 0.95rem;
}

input,
select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

fieldset {
  min-width: 0;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.54);
}

legend {
  padding: 0 0.4rem;
  color: var(--primary-dark);
  font-weight: 700;
}

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

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

.records-table th,
.records-table td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.records-table th {
  color: var(--muted);
  font-size: 0.88rem;
}

.recommend-card {
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid rgba(46, 110, 166, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 207, 103, 0.14));
}

.record-form .recommend-card:not(#recommend-card) {
  background: #f6f6f6;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.recommend-grid > div {
  padding: 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
}

.recommend-grid .chosen {
  border-color: rgba(46, 110, 166, 0.24);
  box-shadow: inset 0 0 0 1px rgba(46, 110, 166, 0.18);
}

@media (max-width: 900px) {
  .record-top-panels,
  .pair-grid,
  .grid.two,
  .grid.three,
  .recommend-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .user-strip {
    flex-direction: column;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1rem;
    background: rgba(234, 244, 255, 0.98);
    border-bottom: 1px solid var(--border);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-header {
    position: relative;
  }
}
