/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

 html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
}

/**
 * Render the `main` element consistently in IE.
 */

main {
  display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}


/* /////////////////共通設定///////////////// */
/* 諸々の色設定 */
:root {
  --background-navbar: #263238;
  --text-primary: #24313a;
  --text-muted: #596875;
  --surface-bg: #ffffff;
  --page-bg: #f7f8fa;
  --btn-light-bg: #f8f9fa;
  --btn-light-hover: #e9ecef;
  --btn-dark-bg: #495057;
  --btn-dark-hover: #6c757d;
  --primary-bg: #f8f9fa;
  --form-bg: #ffffff;
  --border-color: #e1e6eb;
  --btn-login: #d9272e;
  --btn-login-hover: #b91f26;
  --link-color: #0b6fc6;
  --focus-ring: rgba(13, 111, 198, 0.2);
  --shadow-sm: 0 2px 10px rgba(30, 44, 54, 0.08);
  --shadow-md: 0 10px 30px rgba(30, 44, 54, 0.12);
  --content-max-width: 1120px;
  --radius-control: 10px;
  --radius-card: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --input-height: 48px;
  --button-height: 48px;
  --input-border: #8796a3;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--page-bg);
  color: var(--text-primary);
  font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.7;
}

a {
  color: var(--link-color);
}

a:hover {
  color: #084f8c;
}

img {
  max-width: 100%;
  height: auto;
}

.btn,
.form-control,
.form-select {
  border-radius: var(--radius-control);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

/* /////////////////ヘッダー///////////////// */
 /* カスタムクラスでナビバーのスタイルを調整 */
.navbar-custom {
  background-color: var(--background-navbar);
  box-shadow: 0 2px 8px rgba(26, 46, 68, 0.08);
  min-height: 64px;
}

/* ブランド名やリンクの色をカスタマイズ */
.navbar-brand, .nav-link {
  color: var(--brand-primary) !important;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0;
}

.navbar-custom .nav-link {
  border-radius: 8px;
  font-weight: 600;
  padding: 8px 12px !important;
}

/* ホバー時のリンク色を変更 */
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--brand-primary-dark) !important;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35);
  border-radius: 8px;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

/* ナビバー固定時のスペース確保 */
main {
  flex: 1 0 auto;
  width: 100%;
  margin-top: 64px;
  padding: 32px 20px 48px;
}

.site-main > .container,
.site-main > .container-fluid,
.site-main > .userTemp,
.site-main > .login-container,
.site-main > .register-container,
.site-main > .resetPasswordRequestTemp,
.site-main > .reset-password-container {
  width: 100%;
}

.site-footer {
  flex-shrink: 0;
  background-color: var(--brand-primary);
  padding: 16px 0;
}

/* Footer geometry lives here; design.css supplies the existing palette. */
.site-footer .row { --bs-gutter-y: 12px; }

.site-footer-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 8px;
}

.site-footer-title a {
  color: #ffffff;
  text-decoration: none;
}

.site-footer-title a:hover {
  color: #ffffff;
  text-decoration: none;
}

.site-footer-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0;
}

.site-footer-link-groups {
  display: grid;
  gap: 8px;
}

.site-footer-link-group + .site-footer-link-group {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px 12px;
  font-size: 14px;
  line-height: 1.5;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer-links li {
  display: flex;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  max-width: 100%;
  margin: 0;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.site-footer-links a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.site-footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer-bottom {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px 12px;
  margin-top: 12px;
  padding-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
}

.site-footer-bottom a {
  color: #ffffff;
}

.site-footer-bottom p { font-size: 12px; line-height: 1.6; }

@media (max-width: 991.98px) {
  .navbar-custom .navbar-collapse {
    padding: 12px 0 6px;
  }

  .navbar-custom .nav-link {
    padding: 10px 8px !important;
  }
}

@media (max-width: 767.98px) {
  main {
    padding: 24px 12px 36px;
  }

  .site-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* /////////////////ランディングページ///////////////// */

.home-page {
  margin: -32px -20px -48px;
}

/* ヒーローセクションのスタイル */
.hero {
  background-color: #ffffff;
  color: var(--text-primary);
  padding: 72px 20px 56px;
  border-bottom: 1px solid var(--border-color);
}

.home-hero-grid {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 40px;
}

.home-hero-single {
  display: block;
  max-width: 820px;
  margin: 0 auto;
}

.home-hero-copy {
  text-align: left;
}

.home-hero-single .home-hero-copy {
  text-align: center;
}

.home-eyebrow {
  margin-bottom: 10px;
  color: var(--link-color);
  font-weight: 700;
}

.home-lead {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.9;
}

.home-hero-single .home-lead {
  margin-right: auto;
  margin-left: auto;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-hero-single .home-hero-actions {
  justify-content: center;
}

.home-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 46px;
  font-weight: 700;
  line-height: 1.2;
}

.home-hero-subactions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.home-hero-subactions a {
  color: var(--text-muted);
  font-weight: 700;
}

/* ヒーローテキストのスタイル */
.hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.24;
}

.hero .home-hero-title {
  font-size: clamp(36px, 5vw, 56px);
}

.home-hero-heading-line {
  display: block;
}

.home-service-name {
  display: block;
}

.home-service-name {
  white-space: nowrap;
}

.hero h2 {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
}

/* ボタンのスタイルをカスタマイズ */
.btn-custom-light {
  background-color: var(--btn-light-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.btn-custom-light:hover {
  background-color: var(--btn-light-hover);
  color: var(--text-primary);
}
.btn-custom-dark {
  background-color: var(--background-navbar);
  color: #ffffff;
  border: none;
  transition: background-color 0.3s ease;
}
.btn-custom-dark:hover {
  background-color: var(--btn-dark-hover);
}

.home-section {
  padding: 64px 0;
  margin-top: 0 !important;
  color: var(--text-primary);
  background-color: #ffffff;
  border-bottom: 0;
}

.home-page .home-section:nth-of-type(odd) {
  background-color: var(--surface-muted);
}

.home-page .home-section:nth-of-type(even) {
  background-color: #ffffff;
}

.home-section-heading {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.home-section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.home-section-lead {
  max-width: 820px;
  margin: 0 auto 28px;
  color: var(--text-muted);
  line-height: 1.9;
}

.home-seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-seo-item {
  padding: 22px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.home-seo-item h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.home-seo-item p {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

.home-seo-item a {
  font-weight: 700;
}

.home-guide-panel {
  margin-top: 24px;
  padding: 16px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.home-guide-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--brand-primary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.home-guide-title::-webkit-details-marker {
  display: none;
}

.home-guide-title::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: #ffffff;
  background-color: var(--brand-primary);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.home-guide-panel[open] .home-guide-title {
  margin-bottom: 12px;
}

.home-guide-panel[open] .home-guide-title::after {
  content: "-";
}

.home-guide-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-guide-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
  border: 1px solid #d4e0ec;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

.home-guide-links a:hover,
.home-guide-links a:focus {
  color: var(--brand-primary-dark);
  background-color: #dde9f4;
  border-color: #b9ccdf;
  text-decoration: none;
}

.home-list-card,
.home-feature-card,
.home-step-card {
  height: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm) !important;
}

.home-list-card {
  padding: 20px;
}

.home-list-card-header h4 {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 700;
}

.home-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.home-list-row span {
  font-weight: 700;
}

.home-list-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-list-card .btn {
  min-width: 160px;
}

.home-feature-card .card-body,
.home-step-card .card-body {
  padding: 22px;
}

.home-feature-card .card-title,
.home-step-card .card-title {
  font-weight: 700;
}

.home-about-button {
  min-width: 180px;
}

/* ホームページのカードの隙間調整 */
@media (max-width: 768px) { /* ブレイクポイントは適宜調整 */
  .home-page {
    margin: -24px -12px -36px;
  }

  .home-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .home-hero-copy {
    text-align: center;
  }

  .hero {
    padding: 64px 20px 48px;
  }

  .hero h1 {
    font-size: clamp(34px, 9.5vw, 42px);
    line-height: 1.34;
  }

  .hero .home-hero-title {
    font-size: clamp(30px, 8.5vw, 38px);
  }

  .home-service-name {
    font-size: 0.9em;
  }

  .home-lead {
    font-size: 16px;
  }

  .home-hero-actions {
    flex-direction: column;
  }

  .home-hero-actions .btn {
    width: 100%;
  }

  .home-section {
    padding: 40px 0;
  }

  .home-seo-grid {
    grid-template-columns: 1fr;
  }

  .home-guide-links {
    grid-template-columns: 1fr;
  }

  .row .col-md-4 {
    margin-bottom: 15px; /* カード間の隙間を指定 */
  }
  .row .col-md-4:last-child {
    margin-bottom: 0; /* 最後のカードには隙間を追加しない */
  }
}

/* ログインページ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */

.login-container, .register-container {
  max-width: 400px;
  margin: 50px auto;
  background-color: var(--form-bg);
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
}

.form-control {
  margin-bottom: 15px;
}



.btn-back, .btn-login {
  width: 100%;
  padding: 10px;
}

.btn-login {
  background-color: var(--btn-login);
  color: white;
  border: none;
}

.btn-login:hover {
  background-color: var(--btn-login-hover);
}

.btn-back {
  background-color: var(--btn-dark-bg);
  color: white;
  border: none;
}

.btn-back:hover {
  background-color: var(--btn-dark-hover);
}

.forgot-link, .register-link {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--link-color);
  text-decoration: none;
}

.forgot-link:hover, .register-link:hover {
  text-decoration: underline;
}

.auth-panel {
  width: 100%;
  max-width: 440px;
  margin: 32px auto;
  padding: 28px;
  background-color: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.auth-header {
  margin-bottom: 22px;
  text-align: center;
}

.auth-header h2 {
  margin-bottom: 0;
}

.auth-form {
  display: grid;
  gap: 16px;
}

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

.auth-field .form-label {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.auth-field .form-control {
  min-height: 46px;
  margin-bottom: 0;
}

.auth-field .form-text {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-links {
  display: grid;
  gap: 6px;
}

.auth-links .forgot-link,
.auth-links .register-link {
  margin-top: 0;
}

.auth-panel .btn-login,
.auth-panel .btn-back,
.auth-panel .reset-btn,
.auth-panel .auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 0;
  font-weight: 700;
}

.auth-panel .auth-back {
  margin-top: 12px;
}

@media (max-width: 575.98px) {
  .auth-panel {
    margin: 12px auto;
    padding: 20px;
  }
}


/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */

/* 会員登録ページ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */

/* 自由入力欄 */
textarea {
  height: 100px;
  resize: none;
}

.register-panel {
  width: 100%;
  max-width: 860px;
  margin: 32px auto;
  padding: 28px;
}

.register-header {
  margin-bottom: 22px;
}

.register-header h2 {
  margin-bottom: 0;
}

.register-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.register-form > .mb-3 {
  margin-bottom: 0 !important;
}

.register-form .form-label,
.register-form .form_label {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.register-form .form-control {
  min-height: 46px;
  margin-bottom: 0;
}

.register-form .form-text {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.field-validation-message {
  display: none;
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.field-validation-message.is-visible {
  display: block;
}

.required-note,
.form-section-title,
.register-form > label[for="terms"],
.register-form > .terms-scroll,
.register-form > .form-check,
.register-form > .btn-login,
.register-form > .mb-3:has(textarea),
.register-form > .mb-3:has(.junior_high_subjects),
.register-form > .mb-3:has(.high_school_subjects),
.register-form > .mb-3:has(.university_subjects) {
  grid-column: 1 / -1;
}

.form-section-title {
  margin: 10px 0 -2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.required-note {
  margin: 0;
  padding: 12px 14px;
  color: var(--text-muted);
  background-color: #f7fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
}

.junior_high_subjects,
.high_school_subjects,
.university_subjects,
.subject-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.junior_high_subjects label,
.high_school_subjects label,
.university_subjects label,
.subject-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  padding: 8px 12px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
}

.register-form textarea.form-control {
  min-height: 120px;
}

.register-form > .btn-login,
.register-panel > .btn-back {
  max-width: 320px;
  min-height: 46px;
  justify-self: center;
  font-weight: 700;
}

.register-panel > .btn-back {
  display: block;
  margin: 14px auto 0 !important;
}

@media (max-width: 767.98px) {
  .register-panel {
    margin: 12px auto;
    padding: 20px;
  }

  .register-form {
    grid-template-columns: 1fr;
  }

  .register-form > .btn-login,
  .register-panel > .btn-back {
    max-width: none;
    width: 100%;
  }
}

.listing-benefits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 14px 0 0;
  padding: 0;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  list-style: none;
}

.listing-benefits i {
  margin-right: 5px;
  color: var(--brand-primary);
}

.guide-related-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 1040px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  background: #f5f8fb;
  border: 1px solid var(--surface-line);
  border-radius: 12px;
}

.guide-related-nav span {
  margin-right: 4px;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.guide-related-nav a {
  padding: 5px 9px;
  background: #fff;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.guide-page-toc {
  max-width: none;
  margin-bottom: 24px;
}

.guide-page-toc + section {
  margin-top: 0;
}

.guide-byline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.guide-byline a {
  font-weight: 700;
}

@media (max-width: 575.98px) {
  .listing-benefits {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .guide-related-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-related-nav a {
    border-radius: 8px;
  }
}

/* 利用規約 */
.terms-scroll {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #fbfcfd;
  border-color: var(--border-color);
  border-radius: 8px;
  line-height: 1.8;
}

.terms-scroll h2 {
  margin-top: 18px;
  font-size: 18px;
  text-align: left;
}

/* 大学名オートフィル */
.university-field {
  position: relative;
}

.university-field .autocomplete-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: white;
}

.autocomplete-suggestions div {
  cursor: pointer;
  padding: 8px;
  border: 1px solid #ddd;
}
.autocomplete-suggestions div:hover {
  background-color: #ffffff;
}
.suggestions-list{
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  background-color: white;
  z-index: 1000;
}
/* チェックボックスのスタイルをカスタマイズ */
input[type="checkbox"]:not(.form-check-input) {
  -webkit-appearance: none; /* Chrome, Safariのデフォルトスタイルをリセット */
  -moz-appearance: none;    /* Firefoxのデフォルトスタイルをリセット */
  appearance: none;         /* 全てのブラウザに対するリセット */
  width: 15px;
  height: 15px;
  border: 2px solid #6c757d; /* 明示的に枠線を設定 */
  border-color: #6c757d;
  border-radius: 4px;        /* 角を丸くする */
  background-color: #fff;    /* 背景色を白に */
  position: relative;
  display: inline-block;
}
/* チェックが入った時のスタイル */
input[type="checkbox"]:not(.form-check-input):checked {
  background-color: #007bff; /* チェック時の背景色 */
  border-color: #007bff;     /* チェック時の枠線の色 */
}
/* チェックマークを追加 */
input[type="checkbox"]:not(.form-check-input):checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.profile-edit-form input[type="checkbox"].form-control {
  display: inline-block;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0 0 8px;
  padding: 0;
  vertical-align: middle;
}

/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */


/* ユーザー一覧 */
/* テーブルスタイル */
/* テーブルのスタイル */


/* ボタンのコンテナ */

/* 一覧ページ */
.listing-page {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.listing-header {
  margin-bottom: 20px;
  text-align: center;
}

.listing-header h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.listing-eyebrow {
  margin: 0 0 8px;
  color: var(--link-color);
  font-size: 14px;
  font-weight: 700;
}

.listing-description {
  max-width: 760px;
  margin: 10px auto 0;
  color: var(--text-muted);
  line-height: 1.8;
}

.listing-count {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.app-notification-region {
  margin-bottom: 16px;
}

.app-notification {
  margin-bottom: 0;
}

.blocked-user-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.unblock-confirm {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.unblock-confirm span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.listing-search {
  position: relative;
  margin-bottom: 24px;
  padding: 20px;
  background-color: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.listing-search .form-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.listing-search .form-control,
.listing-search .form-select {
  margin-bottom: 0;
}

.listing-search-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.listing-results {
  display: grid;
  gap: 14px;
}

.listing-seo {
  margin-top: 32px;
  padding: 24px;
  background: #f8fbff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.listing-seo h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.listing-seo p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.8;
}

.listing-seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

.listing-seo-links a {
  font-weight: 700;
}

.userCard,
.listing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 18px 20px;
  background-color: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.userCard:hover,
.listing-card:hover {
  border-color: #b8c7d3;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.listing-card-main {
  min-width: 0;
  flex: 1 1 auto;
  width: auto;
}

.listing-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.userCard p,
.listing-card .userName {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.listing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  color: #0b5b99;
  background-color: #eaf4ff;
  border: 1px solid #cce5ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.listing-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.listing-meta div {
  min-width: 0;
}

.listing-meta dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.listing-meta dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-card-action {
  flex: 0 0 auto;
}

.listing-card-action form {
  margin: 0;
}

.listing-card-action input[type="submit"] {
  min-width: 112px;
  border-radius: 8px;
  font-weight: 700;
}

.listing-empty {
  padding: 28px 20px;
  text-align: center;
  background-color: var(--surface-bg);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}

.listing-empty p {
  margin-bottom: 14px;
  color: var(--text-muted);
}

/* テーブルを含むコンテナのスタイル */
.table-container {
  display: flex; /* フレックスボックスで横並び */
  align-items: center; /* テーブルとボタンを縦方向で中央揃え */
  justify-content: space-between; /* テーブルとボタンの間にスペースを均等に */
  width: 100%; /* 横幅を100%に */
}

/* テーブルのスタイル */
.table {
  width: 80%; /* テーブルが横幅の80%を占める */
  border-collapse: collapse;
}

.table th, .table td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

.table th {
  font-weight: bold;
}

/* ボタンのスタイル */
.button-container {
  text-align: center; /* ボタンを中央に配置 */
}

form input[type="submit"] {
  background-color: #e60012;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

form input[type="submit"]:hover {
  background-color: #b8000d;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .table-container {
    flex-direction: column; /* モバイルでは縦並びに変更 */
    align-items: flex-start; /* 左揃え */
  }

  .table {
    width: 100%; /* テーブルが画面幅の100%を占める */
    table-layout: fixed;
  }

  .button-container {
    width: 100%; /* ボタンも画面幅100%を占める */
    margin-top: 10px; /* テーブルの下に余白を追加 */
  }

  .userName {
    font-size: 16px;
  }

  .listing-search {
    padding: 16px;
  }

  .listing-search-actions {
    flex-direction: column;
  }

  .listing-search-actions .btn {
    width: 100%;
  }

  .userCard,
  .listing-card {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .userCard.listing-card {
    grid-template-columns: 1fr;
  }

  .listing-card-action {
    flex: 0 1 auto;
    min-width: 0;
    width: 100%;
  }

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

  .listing-card-action input[type="submit"] {
    width: 100%;
  }
}


/* ユーザ一覧画面のページネーション */

.pagination,
.listing-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
}

.listing-page-link,
.listing-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 40px;
  padding: 8px 12px;
  background-color: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.listing-page-link:hover {
  border-color: #b8c7d3;
  color: var(--link-color);
  text-decoration: none;
}

.listing-page-link.active {
  color: #ffffff;
  background-color: var(--link-color);
  border-color: var(--link-color);
}

.listing-pagination-ellipsis {
  color: var(--text-muted);
  background-color: transparent;
  border-color: transparent;
}


/* ////////////////////////////////////////////////////////// */
/* 教師詳細情報 */
.custom-card-header {
  background-color: #f5f5f5; /* 背景色を薄い灰色に設定 */
  color: #333; /* 文字色を濃い灰色に設定 */
}

.profile-detail-page {
  max-width: var(--content-max-width);
}

.profile-detail-card {
  overflow: hidden;
  background-color: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.listing-search-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.listing-search-summary::-webkit-details-marker {
  display: none;
}

.listing-search-summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  color: #0b5b99;
  background-color: #eaf4ff;
  border: 1px solid #cce5ff;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
}

.listing-search[open] .listing-search-summary {
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.listing-search[open] .listing-search-summary::after {
  content: "-";
}

.listing-search-hint {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.listing-search-active {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.profile-detail-header {
  padding: 24px 28px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.profile-detail-kicker {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.profile-detail-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 700;
}

.profile-detail-body {
  padding: 24px 28px;
}

.profile-mobile-action {
  display: none;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.profile-detail-grid > div {
  min-width: 0;
  padding: 16px 0;
  background-color: var(--surface-bg);
  border: 0;
  border-bottom: 1px solid var(--border-color);
}

.profile-detail-grid dt {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-detail-grid dd {
  margin: 0;
  color: var(--text-primary);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.profile-detail-wide {
  grid-column: 1 / -1;
}

.profile-detail-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 28px;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
}

.profile-detail-actions .btn {
  min-width: 140px;
  font-weight: 700;
}

.profile-related {
  max-width: 960px;
  margin: 2rem auto 0;
}

.profile-related h2 {
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

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

.profile-related-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: .75rem;
}

.profile-related-card:hover,
.profile-related-card:focus-visible {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.profile-related-card span {
  color: #4f5963;
  font-size: .92rem;
}

.profile-related-more {
  display: inline-block;
  margin-top: 1rem;
}

@media (max-width: 767px) {
  .profile-related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .profile-detail-header,
  .profile-detail-body,
  .profile-detail-actions {
    padding: 20px;
  }

  .profile-detail-header h1 {
    font-size: 24px;
  }

  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-detail-actions {
    flex-direction: column;
  }

  .profile-detail-actions .btn {
    width: 100%;
  }
}

/* 保有資格や自己PRのテキストに適用 */
.wraptext {
  white-space: pre-wrap;  /* 改行・連続スペースを反映 */
  word-wrap: break-word;  /* 長い文字列も折り返す */
}


/* ////////////////////////////////////////////////////////// */
/* マイページ */
/* カードのホバー効果をカスタマイズ */
.card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* ホバー時の影 */
  transition: box-shadow 0.3s ease;
}

/* カーソルを指示棒にする */
.card {
  cursor: default;
}

.user-management {
  max-width: 1000px; /* 横幅を調整 */
  margin: 0 auto;   /* 中央揃え */
}

.account-home-header {
  max-width: 720px;
}

.account-home-header h1 {
  margin-bottom: 10px;
  font-size: 30px;
  font-weight: 700;
}

.account-home-header p {
  margin-bottom: 0;
  color: var(--text-muted);
}

.account-menu-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.account-menu-card:hover {
  border-color: #b8c7d3;
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}

.account-menu-card .card-body {
  padding: 22px;
}

.account-menu-card .card-title {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.account-page {
  max-width: var(--content-max-width);
}

.account-layout {
  row-gap: 20px;
}

.account-sidebar .list-group {
  position: sticky;
  top: 88px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.account-sidebar .list-group-item {
  border-color: var(--border-color);
  color: var(--text-primary);
  font-weight: 700;
}

.account-sidebar .list-group-item a {
  display: block;
  color: inherit !important;
}

.account-sidebar .list-group-item.active {
  background-color: #eaf4ff;
  border-color: var(--border-color);
  color: #0b5b99;
}

.account-mobile-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  white-space: nowrap;
}

.account-mobile-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #fff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.account-mobile-nav-link.active {
  background-color: #eaf4ff;
  border-color: var(--border-color);
  color: #0b5b99;
}

.account-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.account-card > .card-body {
  padding: 24px;
}

.account-card h1 {
  margin-bottom: 18px;
  font-weight: 700;
}

.danger-account-card {
  border-color: #f0c2c2;
}

.input {
  min-height: 48px;
  border-color: var(--border-color);
  border-radius: 8px;
}

.profile-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.profile-edit-form > .mb-3 {
  margin-bottom: 0 !important;
}

.profile-edit-form .form-label {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.profile-edit-form .form-control {
  min-height: 46px;
  margin-bottom: 0;
}

.profile-edit-form .form-text {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.profile-edit-form > .required-note,
.profile-edit-form > .form-section-title,
.profile-edit-form > button[type="submit"],
.profile-edit-form > .mb-3:has(textarea),
.profile-edit-form > .mb-3:has(.junior-high-subjects),
.profile-edit-form > .mb-3:has(.junior_high_subjects),
.profile-edit-form > .mb-3:has(.high_school_subjects),
.profile-edit-form > .mb-3:has(.university-subjects),
.profile-edit-form > .mb-3:has(.university_subjects) {
  grid-column: 1 / -1;
}

.profile-edit-form > button[type="submit"] {
  justify-self: center;
  min-width: 220px;
  min-height: 46px;
  font-weight: 700;
}

.junior-high-subjects,
.university-subjects,
.subject-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.junior-high-subjects label,
.university-subjects label,
.subject-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  padding: 8px 12px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .account-card > .card-body {
    padding: 20px;
  }

  .profile-edit-form {
    grid-template-columns: 1fr;
  }

  .profile-edit-form > button[type="submit"] {
    width: 100%;
  }
}

/* ////////////////////////////////////////////////////////// */
/* 基本情報更新 */
.list-group-item.active {
  background-color: #f5f5f5;
  color:#bbb3b3;
}

.card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: #ddd;
  color: #333;
}

.btn-secondary:hover {
  background-color: #ccc;
}

/* サイドバーを小さい画面で非表示に */
@media (max-width: 768px) {
  nav {
    display: none;
  }
}

/* マイページに戻るボタンを大きい画面で非表示に */
@media (min-width: 768px) {
  .btn-secondary.d-md-none {
    display: none;
  }
}



/* ////////////////////////////////////////////////////////// */
/* PWリセット */
.resetPasswordRequestTemp, .reset-password-container {
  width: 100%;
  max-width: 440px;
}

.reset-btn {
  width: 100%;
  padding: 10px;
  color: #fff;
  background-color: #e60012;
  border: none;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
}


/* ////////////////////////////////////////////////////////// */
/* PWメアド変更画面 */

.input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #fff;
}

body .btn-link.security-edit-button,
body .btn-link.security-edit-button:hover,
body .btn-link.security-edit-button:focus,
body .btn-link.security-edit-button:active {
  background-color: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
}

/* ////////////////////////////////////////////////////////// */
/* チャット画面 */

.chat-list-page {
  max-width: 820px;
}

.chat-list-card {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.chat-list-header {
  padding: 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.chat-list-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 26px;
}

.chat-room-list {
  display: grid;
  gap: 10px;
}

.chat-room-item {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
}

.chat-room-link {
  display: block;
  padding: 16px;
  color: var(--text-primary);
  font-weight: 700;
}

.chat-room-link:hover {
  background-color: #f8fafc;
  color: var(--link-color);
}

.chat-page {
  min-height: calc(100vh - 220px);
}

/* 最大幅を設定して画面全体に広がりすぎないよう調整 */
.chat-container {
  max-width: 720px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.chat-header {
  gap: 12px;
  padding: 14px 16px;
  background-color: #0b6fc6 !important;
}

.chat-header h5 {
  min-width: 0;
  font-weight: 700;
}

.chat-header h5 a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.button-group {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

/* メッセージエリアのスクロール調整 */
#messages {
  height: min(58vh, 520px);
  min-height: 320px;
  padding: 18px;
  background-color: #f6f8fa;
  overflow-y: auto;
}

/* メッセージのラッパー */
.message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

/* メッセージを左揃え・右揃え */
.align-start {
  justify-content: flex-start;
}

.align-end {
  justify-content: flex-end;
}

/* 吹き出しのデザイン */
.message-bubble {
  width: fit-content;
  max-width: min(72%, 460px);
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;   /* 改行・スペースをそのまま反映 */
  overflow-wrap: anywhere;
  word-wrap: break-word;   /* 長い文字列も折り返す */
}

.message-bubble > * {
  margin-top: 0;
  margin-bottom: 0;
}

.message-sender {
  background-color: #dff7df;
  color: var(--text-primary);
}

.message-receiver {
  background-color: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* 時間表示のスタイル */
.time-left {
  margin-left: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.time-right {
  margin-right: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.chat-input-bar {
  gap: 10px;
  padding: 12px;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
}


#message {
  resize: none;          /* ユーザーによる手動リサイズを禁止 */
  overflow-y: auto;      /* 入力が多い場合はスクロールバー */
  max-height: 150px;     /* 上限の高さ（ここは好みで調整） */
  min-height: 42px;
  margin-right: 0 !important;
}

#send-message-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 42px;
  padding: 0;
}

@media (max-width: 767.98px) {
  .chat-page {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .chat-header {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .button-group {
    width: 100%;
  }

  .button-group .btn {
    flex: 1;
  }

  #messages {
    height: calc(100vh - 300px);
    min-height: 300px;
    padding: 14px 12px;
  }

  .message-wrapper {
    align-items: flex-start;
    flex-direction: column;
  }

  .align-end {
    align-items: flex-end;
  }

  .message-bubble {
    max-width: 88%;
  }

  .time-left,
  .time-right {
    font-size: 11px;
  }
}



/* ////////////////////////////////////////////////////////// */
/* 補助ページ */

.content-page {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.content-header {
  margin-bottom: 22px;
  text-align: center;
}

.content-header h1 {
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 700;
}

.content-header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.content-card {
  padding: 28px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.privacy-text section + section,
.privacy-text h2:not(:first-child) {
  margin-top: 28px;
}

.privacy-text h2,
.terms-text h2 {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  text-align: left;
}

.privacy-text p,
.privacy-text li {
  color: var(--text-primary);
  line-height: 1.85;
}

.privacy-text ul {
  padding-left: 1.25rem;
}

.guide-page {
  max-width: 960px;
}

.guide-page .content-header {
  max-width: none;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: auto;
  padding: 28px 24px;
  background-color: #ffffff;
  border: 1px solid var(--surface-line);
  border-top: 4px solid var(--brand-primary);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow-sm);
}

.guide-eyebrow {
  margin: 0 0 8px;
  color: var(--link-color);
  font-size: 14px;
  font-weight: 700;
}

.guide-page .guide-eyebrow {
  color: var(--brand-primary);
}

.guide-card {
  background-color: #ffffff;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.guide-card section + section {
  margin-top: 34px;
  padding-top: 6px;
}

.guide-card h2 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 0 12px 14px;
  color: var(--brand-primary);
  border-bottom: 1px solid var(--surface-line);
  border-left: 4px solid var(--brand-primary);
  font-size: 22px;
  font-weight: 700;
  text-align: left;
  background-color: #f8fafc;
}

.guide-card h2::before {
  content: none;
}

.guide-card h3 {
  margin: 18px 0 8px;
  padding-left: 10px;
  color: var(--brand-primary);
  border-left: 3px solid #9aa8b5;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.guide-card p,
.guide-card li {
  color: var(--text-primary);
  line-height: 1.9;
}

.guide-card ul {
  padding-left: 1.25rem;
}

.safety-checklist li + li {
  margin-top: 8px;
}

.guide-figure {
  margin: 22px 0;
}

.guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.guide-figure figcaption {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.guide-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.guide-table {
  width: 100%;
  min-width: 720px;
  margin: 0;
  border-collapse: collapse;
  background: var(--surface-bg);
}

.guide-table th,
.guide-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  line-height: 1.7;
  text-align: left;
  vertical-align: top;
}

.guide-table thead th {
  background: #f6f8fb;
  font-weight: 700;
}

.guide-table tbody tr:last-child th,
.guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.rate-distribution-table {
  min-width: 0;
  table-layout: fixed;
}

.rate-distribution-table th:first-child {
  width: 54%;
}

.rate-distribution-table td {
  font-variant-numeric: tabular-nums;
}

.guide-point-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 18px 0;
  border-top: 1px solid var(--border-color);
}

.guide-point-list > div,
.guide-step-list > div {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.guide-step-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
}

.guide-point-list h3,
.guide-step-list h3 {
  margin-top: 0;
}

.guide-step-list h3 {
  align-self: center;
  margin-bottom: 8px;
  padding-left: 0;
  border-left: 0;
}

.guide-point-list p,
.guide-step-list p {
  margin-bottom: 0;
}

.guide-step-list p {
  grid-column: 2;
}

.guide-step-list {
  display: grid;
  margin-top: 18px;
  border-top: 1px solid var(--border-color);
}

.guide-step-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #fff;
  font-weight: 700;
  background: var(--link-color);
  border-radius: 50%;
}

.guide-flow-list {
  padding-left: 1.25rem;
}

.guide-flow-list li + li {
  margin-top: 10px;
}

.guide-faq-list {
  display: grid;
  border-top: 1px solid var(--border-color);
}

.guide-faq-list details {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.guide-faq-list summary {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.7;
  cursor: pointer;
}

.guide-faq-list p {
  margin: 10px 0 0;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.contract-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 20px 0;
}

.contract-data-card {
  display: grid;
  gap: 4px;
  padding: var(--space-5);
  background: var(--surface-muted);
  border: 0;
  border-radius: var(--radius-control);
}

.contract-data-card span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.contract-data-card strong {
  color: var(--brand-primary);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.contract-data-card small {
  color: var(--text-muted);
}

.contract-data-note,
.guide-legal-note {
  padding: 14px 16px;
  background: #f8fafc;
  border-left: 4px solid var(--brand-primary);
}

.contract-data-note p {
  margin: 0;
  font-size: 14px;
}

.contract-data-note p + p {
  margin-top: 8px;
}

.guide-source-list {
  display: grid;
  gap: 12px;
  padding-left: 0 !important;
  list-style: none;
}

.guide-source-list li {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
}

.guide-source-list a {
  font-weight: 700;
}

.guide-source-list span {
  color: var(--text-muted);
  font-size: 14px;
}

.guide-legal-note {
  margin-top: 16px;
  font-size: 14px;
}

@media (max-width: 575.98px) {
  .contract-data-grid {
    grid-template-columns: 1fr;
  }
}

.matching-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.matching-stat {
  display: grid;
  min-width: 190px;
  padding: 14px 20px;
  color: var(--text-primary);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--surface-line);
  border-radius: 10px;
}

.matching-stat strong {
  color: var(--brand-primary);
  font-size: 28px;
  line-height: 1.2;
}

.matching-stat span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.matching-entry-grid,
.matching-profile-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.matching-entry-card {
  padding: 22px;
  background: #f8fafc;
  border: 1px solid var(--surface-line);
  border-radius: 10px;
}

.guide-card .matching-entry-card h3,
.guide-card .matching-profile-heading h3 {
  padding-left: 0;
  border-left: 0;
}

.matching-entry-label {
  margin-bottom: 4px;
  color: var(--brand-primary) !important;
  font-size: 14px;
  font-weight: 700;
}

.matching-profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.matching-profile-heading h3 {
  margin: 0;
}

.matching-profile-heading a {
  font-size: 14px;
  font-weight: 700;
}

.matching-profile-list {
  display: grid;
  gap: 10px;
}

.matching-profile-card {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
}

.matching-profile-card:hover {
  border-color: var(--brand-primary);
}

.matching-profile-card span {
  color: var(--text-muted);
  font-size: 14px;
}

.matching-empty {
  padding: 14px 16px;
  color: var(--text-muted) !important;
  background: #f8fafc;
  border-radius: 8px;
}

.matching-guide-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.matching-guide-links a {
  padding: 12px 14px;
  font-weight: 700;
  background: #f8fafc;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  text-decoration: none;
}

@media (max-width: 767.98px) {
  .matching-entry-grid,
  .matching-profile-columns,
  .matching-guide-links {
    grid-template-columns: 1fr;
  }

  .matching-stat {
    width: 100%;
  }
}

.pricing-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.pricing-hero {
  padding: 34px 28px;
  background: #ffffff;
  border: 1px solid var(--surface-line);
  border-top: 4px solid var(--brand-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.pricing-hero h1 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
}

.pricing-hero p:last-child {
  max-width: 820px;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.85;
}

.pricing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.pricing-summary > div {
  min-height: 132px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.pricing-summary span {
  display: block;
  color: var(--brand-primary);
  font-weight: 700;
}

.pricing-summary strong {
  display: block;
  margin: 4px 0;
  color: #1f2a31;
  font-size: 40px;
  line-height: 1.15;
}

.pricing-summary small {
  color: var(--text-muted);
  font-weight: 700;
}

.pricing-comparison,
.pricing-note {
  padding: 26px;
  background: #ffffff;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.pricing-section-heading {
  margin-bottom: 20px;
  text-align: center;
}

.pricing-section-heading h2,
.pricing-note h2 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
}

.pricing-section-heading p,
.pricing-note p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.85;
}

.pricing-table {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 0 24px;
}

.pricing-row {
  display: contents;
}

.pricing-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  background: #f7f9fb;
  border-bottom: 10px solid #ffffff;
}

.pricing-feature {
  justify-content: flex-start;
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
}

.pricing-head .pricing-cell {
  min-height: 118px;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border-bottom: 14px solid #ffffff;
}

.pricing-head .pricing-feature {
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 0;
  color: var(--text-muted);
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

.pricing-head .pricing-empty-head {
  background: transparent;
  border-color: transparent;
}

.pricing-plan {
  border-top: 30px solid #13948d;
  border-radius: 8px 8px 0 0;
  position: relative;
}

.pricing-plan::before {
  content: "";
  position: absolute;
  top: -30px;
  right: 0;
  left: 0;
  height: 30px;
  background: #13948d;
  border-radius: 8px 8px 0 0;
}

.pricing-plan span {
  position: absolute;
  top: -25px;
  right: 10px;
  left: 10px;
  z-index: 1;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
}

.pricing-plan strong {
  color: var(--brand-primary);
  font-size: 14px;
}

.pricing-plan-free::before {
  background: #ccefeb;
}

.pricing-plan-free span {
  color: var(--brand-primary);
}

.pricing-free {
  color: var(--brand-primary);
  font-weight: 700;
}

.pricing-free strong {
  color: #1f2a31;
  font-size: 24px;
}

.pricing-free .fa-circle-check {
  margin-right: 6px;
}

.pricing-note {
  margin-top: 22px;
}

.pricing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

@media (max-width: 991.98px) {
  .pricing-table {
    grid-template-columns: 190px repeat(3, 230px);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .pricing-cell {
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  .pricing-hero,
  .pricing-comparison,
  .pricing-note {
    padding: 22px 16px;
  }

  .pricing-hero h1 {
    font-size: 26px;
  }

  .pricing-summary {
    grid-template-columns: 1fr;
  }

  .pricing-actions .btn {
    width: 100%;
  }
}

.choice-page {
  max-width: 900px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 260px;
  padding: 26px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.choice-kicker {
  margin: 0 0 8px;
  color: var(--link-color);
  font-size: 14px;
  font-weight: 700;
}

.choice-card h2 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.choice-card p:not(.choice-kicker) {
  flex: 1;
  margin-bottom: 20px;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: center;
}

.choice-card .btn {
  min-width: 180px;
}

@media (max-width: 767.98px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

.area-index-page {
  max-width: 1040px;
}

.area-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.area-popular-card {
  margin-bottom: 20px;
}

.area-popular-card h2,
.area-all-heading {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

.area-popular-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.area-popular-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--brand-primary-soft);
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  text-decoration: none;
}

.area-popular-link span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.area-link-item {
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
}

.area-link-item h3 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.area-link-item a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  font-weight: 700;
}

.area-link-item a span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.area-subject-links {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--surface-line);
}

.area-subject-links a {
  color: var(--brand-primary);
  font-size: 0.82rem;
}

.listing-topic-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--brand-primary-soft);
  border-radius: 8px;
}

.listing-topic-links span {
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.listing-topic-links a {
  padding: 5px 9px;
  background: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.teacher-area-links {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--brand-primary-soft);
  border-radius: 8px;
}

.teacher-area-links > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.teacher-area-links > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.teacher-area-links a {
  font-size: 0.9rem;
  font-weight: 700;
}

.landing-data-block {
  margin: 0 0 22px;
}

.landing-data-block h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

@media (max-width: 767.98px) {
  .profile-mobile-action {
    position: sticky;
    top: 68px;
    z-index: 5;
    display: block;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--surface-line);
    backdrop-filter: blur(6px);
  }

  .profile-mobile-action .btn {
    width: 100%;
    min-height: 46px;
    font-weight: 700;
  }

  .area-popular-grid,
  .area-link-grid {
    grid-template-columns: 1fr;
  }
}

.contact-page {
  max-width: 720px;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form .mb-3 {
  margin-bottom: 0 !important;
}

.contact-form .form-label {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.contact-alt {
  margin: 16px 0 0;
  color: var(--text-muted);
  text-align: center;
}

.contact-form .form-control {
  margin-bottom: 0;
}

.contact-form textarea.form-control {
  min-height: 180px;
  resize: vertical;
}

.contact-form .btn {
  justify-self: center;
  min-width: 180px;
  min-height: 46px;
  font-weight: 700;
}

.faq-page {
  max-width: 860px;
}

.faq-content {
  display: grid;
  gap: 12px;
}

.faq-item {
  padding: 0;
  background-color: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.faq-question {
  position: relative;
  padding: 18px 52px 18px 20px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.6;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #0b5b99;
  background-color: #eaf4ff;
  border: 1px solid #cce5ff;
  border-radius: 999px;
  transform: translateY(-50%);
}

.faq-item[open] .faq-question::after {
  content: "-";
}

.faq-answer {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--text-muted);
  line-height: 1.8;
}

.error-template,
.error-tenmplate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(62vh, 560px);
}

.error-container {
  width: 100%;
  max-width: 560px;
  padding: 34px 28px;
  text-align: center;
  background-color: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.error-container h1 {
  margin: 0 0 12px;
  color: #c62828;
  font-size: 40px;
  font-weight: 700;
}

.error-container p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.8;
}

.error-container a {
  margin-top: 22px;
  min-width: 160px;
  font-weight: 700;
}

@media (max-width: 575.98px) {
  .content-header h1 {
    font-size: 26px;
  }

  .content-card {
    padding: 20px;
  }

  .guide-page .content-header {
    padding: 22px 18px;
  }

  .guide-card {
    padding: 20px;
  }

  .guide-card section + section {
    margin-top: 28px;
  }

  .guide-point-list {
    grid-template-columns: 1fr;
  }

  .guide-table {
    min-width: 640px;
  }

  .rate-distribution-table {
    min-width: 0;
  }

  .rate-distribution-table th,
  .rate-distribution-table td {
    padding: 12px 10px;
  }

  .contact-form .btn {
    width: 100%;
  }

  .faq-question {
    padding: 16px 48px 16px 16px;
  }

  .faq-answer {
    padding: 0 16px 16px;
  }
}

/* マイページ */
.pointer {
  cursor: pointer;
}

/* PWエラーメッセージのスタイル */
.password-error-message {
  display: none; /* 初期状態で非表示 */
}


/* ////////////////////////////////////////////////////////// */
/* 大学公式サイトページ */
.section-title {
  text-align: left;
}

h3 {
  color: #333;
  font-size: 20px;
  margin-bottom: 20px;
  text-align: left;
  font-weight: 600;
}




/* ////////////////////////////////////////////////////////// */
/* 都道府県別紹介ページ */
/* 
.toc ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.toc > ul > li {
  font-weight: bold;
  margin: 10px 0;
}

.toc ul ul {
  margin-left: 20px;
  font-weight: normal;
}

.toc a {
  text-decoration: none;
  color: #333333;
}

.toc a:hover {
  text-decoration: underline;
}

.toc {
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-size: 10px 10px;
}



.section-title {
  font-size: 1.8rem;
  margin-top: 30px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
  color: #333;
}

.subsection-title {
  font-size: 1.4rem;
  color: #212529;
  margin-top: 30px;
  padding-bottom: 5px;
  border-bottom: 1.5px solid #515151;
}


.section-paragraph {
  line-height: 1.8;
  font-size: 1rem;
  color: #333;
}


.custom-list {
  padding-left: 20px;
  margin-top: 15px;
}

.custom-list li {
  margin-bottom: 20px;
}


.source-link, .school-link {
  color: #007bff;
  text-decoration: none;
}

.source-link:hover, .school-link:hover {
  text-decoration: underline;
}

.info-text {
  font-size: 1.3rem;
  color: #212529;
  margin-top: 20px;
  text-decoration:underline;
}

.item-text{
  font-size: 1.1rem;
  color: #212529;
  margin-top: 20px;
  font-weight: bold;
} */

/* ////////////////////////////////////////////////////////// */
/* UI refresh: listings, filters, and chat */

:root {
  --brand-primary: #1a2e44;
  --brand-primary-dark: #061d32;
  --brand-primary-soft: #edf2f6;
  --surface-muted: var(--page-bg);
  --surface-line: var(--border-color);
  --text-soft: var(--text-muted);
  --danger: #b42318;
  --link-color: var(--brand-primary);
  --btn-login: var(--brand-primary);
  --btn-login-hover: var(--brand-primary-dark);
  --focus-ring: rgba(26, 46, 68, 0.18);
  --shadow-sm: 0 2px 8px rgba(26, 46, 68, 0.035);
  --shadow-md: 0 6px 20px rgba(26, 46, 68, 0.07);
}

body {
  background-color: var(--surface-muted);
}

.navbar-custom {
  background-color: var(--brand-primary);
}

.navbar-custom .nav-link-subtle {
  opacity: 0.78;
}

.navbar-custom .nav-link-subtle:hover,
.navbar-custom .nav-link-subtle:focus {
  opacity: 1;
}

.btn-primary,
.btn-success,
form input[type="submit"] {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover,
.btn-success:hover,
form input[type="submit"]:hover {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

.btn-success {
  color: #ffffff;
}

body .btn,
body .btn-custom-light,
body .btn-custom-dark,
body .btn-login,
body .btn-back,
body form input[type="submit"] {
  color: var(--brand-primary);
  background-color: #ffffff;
  border: 1px solid var(--brand-primary);
  box-shadow: none;
  font-weight: 700;
  min-height: var(--button-height);
  padding: 11px 20px;
  border-radius: var(--radius-control);
  line-height: 1.5;
  white-space: normal;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body .btn:hover,
body .btn:focus,
body .btn-custom-light:hover,
body .btn-custom-light:focus,
body .btn-custom-dark:hover,
body .btn-custom-dark:focus,
body .btn-login:hover,
body .btn-login:focus,
body .btn-back:hover,
body .btn-back:focus,
body form input[type="submit"]:hover,
body form input[type="submit"]:focus {
  color: var(--brand-primary-dark);
  background-color: var(--brand-primary-soft);
  border-color: var(--brand-primary-dark);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

body .btn-secondary,
body .btn-outline-secondary,
body .btn-back,
body .btn-custom-light {
  color: var(--text-soft);
  border-color: #9aa8b5;
}

body .btn-secondary:hover,
body .btn-secondary:focus,
body .btn-outline-secondary:hover,
body .btn-outline-secondary:focus,
body .btn-back:hover,
body .btn-back:focus,
body .btn-custom-light:hover,
body .btn-custom-light:focus {
  color: var(--brand-primary);
  background-color: #f4f7fb;
  border-color: var(--text-soft);
}

body .btn-danger,
body .btn-outline-danger {
  color: var(--danger);
  border-color: var(--danger);
}

body .btn-danger:hover,
body .btn-danger:focus,
body .btn-outline-danger:hover,
body .btn-outline-danger:focus {
  color: #8f1c14;
  background-color: #fff4f2;
  border-color: #8f1c14;
}

body .btn-primary,
body .btn-success,
body .btn-custom-dark,
body .btn-login,
body form input[type="submit"] {
  color: #ffffff;
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

body .btn-primary:hover,
body .btn-primary:focus,
body .btn-success:hover,
body .btn-success:focus,
body .btn-custom-dark:hover,
body .btn-custom-dark:focus,
body .btn-login:hover,
body .btn-login:focus,
body form input[type="submit"]:hover,
body form input[type="submit"]:focus {
  color: #ffffff;
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

body .btn:disabled,
body .btn.disabled,
body form input[type="submit"]:disabled {
  color: #8b98a5;
  background-color: #ffffff;
  border-color: #c7d0da;
  opacity: 0.65;
}

.listing-page {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.listing-header,
.listing-seo,
.listing-pagination {
  grid-column: 1 / -1;
}

.prefecture-listing-page .listing-results {
  grid-column: 1 / -1;
}

.prefecture-listing-page .listing-topic-links,
.prefecture-listing-page .listing-sort-form {
  grid-column: 1 / -1;
}

.teacher-listing-page .teacher-area-links,
.teacher-listing-page .listing-topic-links,
.teacher-listing-page .landing-data-block,
.prefecture-listing-page .landing-data-block,
.junior-high-exam-listing-page .landing-data-block {
  grid-column: 1 / -1;
}

.listing-sort-form {
  display: grid;
  grid-template-columns: auto minmax(180px, 280px) auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-bottom: 18px;
}

.listing-sort-form .form-label {
  margin: 0;
  font-weight: 700;
}

.listing-sort-form .btn {
  min-height: 38px;
}

.listing-header {
  padding: 20px 0 8px;
  margin-bottom: 0;
  text-align: left;
}

.listing-header h1 {
  color: var(--brand-primary);
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: 0;
}

.listing-description {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  margin-top: var(--space-4);
  line-height: 1.95;
}

.listing-count {
  text-align: left;
  margin-top: var(--space-4);
}

.listing-search {
  position: sticky;
  top: 88px;
  max-height: calc(100dvh - 112px);
  margin-bottom: 0;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-color: var(--surface-line);
  box-shadow: none;
}

.listing-search-summary {
  align-items: center;
  flex-wrap: wrap;
  min-height: 44px;
  gap: 8px;
}

.listing-search-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-primary);
}

.listing-search-summary::after {
  color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
  border-color: #c9d8e8;
}

.listing-search-hint {
  display: none;
}

.listing-search[open] .listing-search-summary {
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.listing-search .row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px !important;
  margin: 0;
}

.listing-search .row > * {
  width: 100%;
  max-width: none;
  padding: 0;
  margin-top: 0;
  min-width: 0;
}

.listing-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.listing-active-filters a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 3px 10px;
  color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
  border: 1px solid #d4e0ec;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.listing-active-filters a:hover {
  color: var(--brand-primary-dark);
  background-color: #dde9f4;
  text-decoration: none;
}

.listing-search-actions {
  flex-direction: column;
  position: sticky;
  bottom: -18px;
  margin-right: -18px;
  margin-left: -18px;
  padding: 14px 18px 18px;
  background-color: #ffffff;
  border-top: 1px solid var(--surface-line);
}

.listing-search-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.listing-results {
  gap: var(--space-5);
  min-width: 0;
}

.userCard,
.listing-card {
  align-items: stretch;
  gap: 18px;
  padding: 28px;
  border-color: var(--surface-line);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-card);
}

.userCard:hover,
.listing-card:hover {
  border-color: #c1ccda;
  box-shadow: var(--shadow-sm);
  transform: none;
}

.listing-card-title {
  justify-content: space-between;
  margin-bottom: 20px;
}

.listing-card .userName {
  color: var(--brand-primary);
  font-size: 22px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.listing-card-subtitle {
  margin: 2px 0 0 !important;
  color: var(--text-soft) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.listing-badge {
  color: var(--brand-primary);
  background-color: #f4f7fb;
  border-color: var(--surface-line);
  border-radius: 8px;
}

.listing-last-login {
  flex: 0 0 auto;
  text-align: right;
}

.listing-last-login span {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.listing-last-login time {
  display: block;
  margin-top: 2px;
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.listing-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.listing-subject-group {
  display: inline-flex;
  align-items: stretch;
  min-height: 30px;
  overflow: hidden;
  color: var(--brand-primary);
  background-color: #ffffff;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  max-width: 100%;
}

.listing-subject-label,
.listing-subject-values {
  display: inline-flex;
  align-items: center;
}

.listing-subject-label {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
  font-weight: 700;
  white-space: nowrap;
}

.listing-subject-values {
  padding: 5px 10px;
  color: var(--text-primary);
  background-color: var(--surface-muted);
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.listing-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 20px;
  gap: 20px 16px;
  border-top: 1px solid var(--surface-line);
}

.listing-meta dd {
  white-space: normal;
}

.listing-excerpt-block {
  margin-top: var(--space-5);
}

.listing-excerpt-label {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.userCard .listing-excerpt,
.listing-card .listing-excerpt {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: #24313A;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.85;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.listing-card-action {
  flex: 0 0 156px;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 10px;
  min-width: 156px;
  width: 100%;
  flex-wrap: wrap;
}

.listing-card-action .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.userCard.listing-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.listing-card-chat {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.listing-card-chat:hover {
  color: var(--brand-primary-dark);
  background-color: var(--brand-primary-soft);
  border-color: var(--brand-primary-dark);
}

.chat-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  width: min(100%, 1120px);
  margin: 0 auto;
}

.chat-shell.chat-page {
  align-items: stretch;
}

#chat-data {
  display: none;
}

.chat-list-page,
.chat-page {
  max-width: 1120px;
  min-height: 560px;
}

.chat-page {
  height: calc(100dvh - 144px);
}

.chat-threads,
.chat-conversation,
.chat-empty-panel {
  overflow: hidden;
  background-color: #ffffff;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.chat-threads {
  grid-column: 1;
  grid-row: 1;
  height: 100%;
  min-height: 560px;
}

.chat-threads-head {
  padding: 18px;
  background-color: var(--surface-muted);
  border-bottom: 1px solid var(--surface-line);
}

.chat-threads-head h2 {
  margin: 0;
  color: var(--brand-primary);
  font-size: 22px;
}

.chat-threads-head p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.chat-thread-list {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  border-left: 4px solid transparent;
  border-bottom: 1px solid #eef2f6;
  text-decoration: none;
}

.chat-thread-item:hover,
.chat-thread-item.active {
  color: var(--text-primary);
  background-color: #f2f6fb;
  border-left-color: var(--brand-primary);
  text-decoration: none;
}

.chat-thread-avatar,
.chat-partner-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
  border-radius: 50%;
}

.chat-thread-body {
  min-width: 0;
  flex: 1;
}

.chat-thread-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.chat-thread-top strong,
.chat-thread-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread-top time {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 11px;
}

.chat-thread-preview {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 13px;
}

.chat-thread-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: #ffffff;
  background-color: var(--danger);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.chat-thread-empty,
.chat-empty-panel {
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--text-soft);
  text-align: center;
}

.chat-empty-panel h1 {
  color: var(--brand-primary);
  font-size: 28px;
}

.chat-empty-kicker {
  color: var(--brand-primary);
  font-weight: 700;
}

.chat-conversation {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background-color: #ffffff !important;
  border-bottom: 1px solid var(--surface-line);
}

.chat-partner {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.chat-partner a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--brand-primary);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-partner p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

#messages {
  flex: 1;
  height: auto;
  max-height: none;
  min-height: 0;
  padding: 22px;
  background-color: var(--surface-muted);
  overflow-y: auto;
}

.message-date-divider {
  margin: 4px 0 18px;
  text-align: center;
}

.message-date-divider span {
  display: inline-flex;
  padding: 4px 10px;
  color: var(--text-soft);
  background-color: #e9eef4;
  border-radius: 999px;
  font-size: 12px;
}

.message-wrapper {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 14px;
}

.align-end {
  align-items: flex-end;
}

.message-bubble {
  max-width: min(74%, 520px);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(26, 46, 68, 0.04);
}

.message-sender {
  color: #ffffff;
  background-color: var(--brand-primary);
}

.message-receiver {
  background-color: #ffffff;
}

.time-left,
.time-right {
  font-size: 11px;
}

.message-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
}

.read-receipt {
  min-width: 24px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.read-receipt:not(.is-read) {
  visibility: hidden;
}

.chat-input-bar {
  display: flex;
  align-items: flex-end;
  padding-bottom: 30px;
}

.chat-compose {
  flex: 1;
  position: relative;
}

.chat-compose #message {
  display: block;
  width: 100%;
}

.message-status {
  position: absolute;
  top: 100%;
  left: 0;
  min-height: 18px;
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.message-status.error {
  color: var(--danger);
}

#send-message-btn.is-sending {
  opacity: 0.75;
}

#message {
  border-color: var(--surface-line);
  margin-bottom: 0;
}

#send-message-btn {
  color: #ffffff;
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

@media (max-width: 991.98px) {
  .listing-page {
    display: block;
  }

  .listing-search {
    position: static;
    max-height: none;
    margin-bottom: 20px;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .listing-search-actions {
    position: static;
    margin-right: 0;
    margin-left: 0;
    padding: 0;
    background-color: transparent;
    border-top: 0;
  }

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

  .chat-shell {
    grid-template-columns: 1fr;
  }

  .chat-threads,
  .chat-conversation {
    grid-column: 1;
  }

  .chat-page .chat-threads {
    display: none;
  }

  .chat-conversation {
    height: calc(100dvh - 112px);
    min-height: 520px;
  }
}

@media (max-width: 767.98px) {
  .listing-header {
    padding-top: 0;
  }

  .listing-sort-form {
    grid-template-columns: 1fr;
  }

  .listing-sort-form .btn {
    width: 100%;
  }

  .listing-search .row {
    grid-template-columns: 1fr;
  }

  .listing-card {
    padding: 16px;
  }

  .userCard.listing-card {
    grid-template-columns: 1fr;
  }

  .listing-card-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .listing-last-login {
    text-align: left;
  }

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

  .listing-card-action {
    flex: 0 1 auto;
    min-width: 0;
    width: 100%;
  }

  .chat-shell {
    width: 100%;
  }

  .chat-list-page,
  .chat-page {
    height: auto;
    min-height: calc(100vh - 130px);
  }

  .chat-threads,
  .chat-conversation,
  .chat-empty-panel {
    border-radius: 0;
  }

  .chat-threads {
    min-height: auto;
  }

  .chat-thread-list {
    max-height: none;
  }

  .chat-header {
    align-items: stretch !important;
    flex-direction: column;
  }

  .button-group {
    width: 100%;
  }

  .button-group .btn {
    flex: 1;
  }

  #messages {
    min-height: 0;
    padding: 16px 12px;
    overflow-y: auto;
  }

  .message-bubble {
    max-width: 88%;
  }

  .chat-input-bar {
    position: sticky;
    bottom: 0;
    padding: 10px;
    padding-bottom: 28px;
    z-index: 2;
  }
}

/* Shared visual rules. Keep markup, content order and interaction hooks intact. */
h1, h2, h3 {
  color: var(--brand-primary);
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

html {
  scroll-padding-top: 84px;
}

:focus-visible {
  outline: 3px solid #537795;
  outline-offset: 3px;
}

body .btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 3px solid #537795;
  outline-offset: 3px;
}

.navbar-custom .nav-link:focus-visible,
.navbar-toggler:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.navbar-custom .navbar-brand {
  font-size: 21px;
  letter-spacing: 0.02em;
}

.navbar-custom .nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.navbar-custom .nav-link[href="/signup"] {
  background: #ffffff;
  color: var(--brand-primary) !important;
}

.navbar-custom .nav-link[href="/signup"]:hover {
  background: var(--brand-primary-soft);
}

.navbar-custom .nav-link[href="/login"] {
  border: 1px solid #9aa8b5;
}

.navbar-nav { gap: var(--space-2); }
.navbar-toggler { min-width: 44px; min-height: 44px; }

.form-control:not([type="checkbox"]):not([type="radio"]),
.form-select {
  min-height: var(--input-height);
  border-color: var(--input-border);
  color: var(--text-primary);
  background-color: var(--surface-bg);
  font-size: 16px;
  line-height: 1.5;
}

.form-control::placeholder { color: var(--text-muted); opacity: 1; }
.form-label, .form_label { line-height: 1.6; }
.form-check { min-height: 44px; }
.form-check-label { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.form-check-input { border-color: var(--input-border); margin-top: 14px; }
.form-check-input:checked,
input[type="checkbox"]:not(.form-check-input):checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.subject-options label,
.junior_high_subjects label,
.high_school_subjects label,
.university_subjects label {
  min-height: 44px;
  border-radius: var(--radius-control);
}

.auth-panel,
.register-panel,
.profile-detail-card,
.choice-card,
.content-card,
.home-seo-item,
.home-list-card,
.home-feature-card,
.home-step-card,
.listing-search,
.listing-seo,
.listing-empty,
.chat-threads,
.chat-conversation,
.chat-empty-panel {
  border-radius: var(--radius-card);
  border-color: var(--surface-line);
}

.auth-panel { padding: var(--space-6); }
.auth-header, .register-header { margin-bottom: var(--space-6); }
.auth-links a { padding: 8px 0; }
.register-form { gap: var(--space-5); }
.required-note { border: 0; background: var(--surface-muted); }
.form-section-title { margin-top: var(--space-5); padding-bottom: var(--space-3); }
.register-header p { margin: 16px 0 0; color: var(--text-muted); }
.profile-detail-grid { gap: 8px 32px; }
.profile-detail-header { background: var(--surface-bg); padding: var(--space-6); }
.profile-detail-body { padding: 8px 32px 32px; }
.profile-detail-kicker { margin-bottom: var(--space-3); }
.profile-detail-wide { padding: 20px 0; }

body #backButton,
body .home-hero-actions a[href="/studentlist"],
body .listing-lower-account-buttons .btn-secondary {
  color: var(--brand-primary);
  background-color: var(--surface-bg);
  border-color: var(--input-border);
}

body #backButton:hover,
body .home-hero-actions a[href="/studentlist"]:hover,
body .listing-lower-account-buttons .btn-secondary:hover {
  background-color: var(--brand-primary-soft);
}

.landing-data-block,
.public-profile-stats {
  padding: var(--space-5);
  background: var(--surface-bg);
  border-radius: var(--radius-card);
}

.landing-data-block { margin-bottom: 0; }
.landing-data-block h2, .public-profile-stats h2 { text-align: left; font-size: 20px; }
.landing-data-block .contract-data-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.landing-data-block .contract-data-card { padding: 20px 16px; }
.contract-data-card span { font-size: 13px; }
.contract-data-card small { font-size: 12px; line-height: 1.7; }
.contract-data-note {
  padding: 0;
  margin-bottom: 0;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.85;
}

.teacher-area-links { margin: 0; padding: 20px 24px; background: var(--surface-bg); }
.teacher-area-links a, .listing-topic-links a { display: inline-flex; align-items: center; min-height: 44px; }
.listing-topic-links { margin-bottom: 0; padding: 12px 24px; background: var(--surface-bg); }
.listing-topic-links a { background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.listing-seo { background: var(--surface-bg); padding: var(--space-6); }
.listing-seo h2 { text-align: left; }
.listing-seo-links a { display: inline-flex; align-items: center; min-height: 44px; }
.listing-card-title > div:first-child { min-width: 0; }
.listing-card-subtitle { overflow-wrap: anywhere; }
.listing-meta dd { overflow-wrap: anywhere; }
.listing-meta > div:last-child dd { color: var(--brand-primary); font-size: 19px; font-weight: 700; }
.listing-page-link { min-width: 44px; min-height: 44px; border-radius: var(--radius-control); }
.listing-empty .btn { margin: 4px; max-width: 100%; }
.listing-search-actions .btn { min-height: var(--button-height); }
.listing-search .form-check { margin-bottom: 0 !important; }

.home-seo-item, .home-list-card { padding: var(--space-5); }
.home-feature-card .card-body, .home-step-card .card-body { padding: var(--space-5); }
.home-page .shadow-sm { box-shadow: var(--shadow-sm) !important; }
.home-list-row { padding: 14px 0; }
.home-guide-panel { border-left: 0; box-shadow: none; }
.guide-page .content-header { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.guide-card { border-radius: 0 0 var(--radius-card) var(--radius-card); }
.guide-card h2 { padding: 0; border: 0; background: transparent; }
.guide-card h3 { padding-left: 0; border: 0; }
.chat-partner > div, .chat-compose { min-width: 0; }
.chat-thread-preview { color: var(--text-muted); }
.message-bubble { line-height: 1.8; }
body #send-message-btn { min-width: 48px; min-height: 48px; padding: 0; }

@media (max-width: 991.98px) {
  .navbar-custom .nav-link { justify-content: flex-start; }
  .listing-header, .landing-data-block, .teacher-area-links, .listing-topic-links { margin-bottom: var(--space-5); }
}

@media (max-width: 767.98px) {
  .listing-header h1 { font-size: 28px; }
  .listing-description { font-size: 15px; line-height: 1.9; }
  .listing-search .row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px !important; }
  .listing-search .form-label { font-size: 13px; width: 100%; min-height: 22px; margin-bottom: 6px; display: flex; align-items: flex-end; }
  .listing-search .row > :last-child { grid-column: 1 / -1; }
  .listing-search .form-check-label { font-size: 13px; }
  .listing-search .form-control, .listing-search .form-select { padding-left: 8px; }
  .listing-search-actions { flex-direction: row; }
  .listing-search-actions .btn { flex: 1; padding-right: 8px; padding-left: 8px; }
  .listing-card { padding: 20px; }
  .listing-card-title { gap: 12px; margin-bottom: 16px; }
  .listing-last-login { display: flex; align-items: baseline; gap: 8px; }
  .listing-card-action .btn { flex: 1 1 140px; min-height: var(--button-height); }
  .listing-subjects { gap: 6px; }
  .listing-subject-group { font-size: 12px; }
  .landing-data-block, .public-profile-stats { padding: 20px 16px; }
  .landing-data-block .contract-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .landing-data-block .contract-data-card { padding: 16px 12px; }
  .contract-data-card strong { font-size: 25px; }
  .teacher-area-links, .listing-topic-links { padding: 16px; }
  .listing-seo { padding: var(--space-5); }
  .auth-panel, .register-panel { padding: 24px 20px; }
  .profile-detail-header, .profile-detail-body { padding: var(--space-5); }
  .profile-detail-grid > div { padding: 12px 0; }
  .chat-header { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  body .btn, .userCard, .listing-card { transition: none; }
}
