:root {
  --kogera-green: #16834a;
  --kogera-green-dark: #0f6237;
  --kogera-green-light: #eaf7f0;
  --text: #27332d;
  --border: #d8e3dc;
  --danger: #a52222;
  --danger-bg: #fff0f0;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
  min-height: 100%;
  background: #f5f8f6;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #effaf4, transparent 42%),
    #f5f8f6;
  font-family:
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
  line-height: 1.7;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.member-body {
  display: flex;
  flex-direction: column;
}

.login-page {
  display: grid;
  place-items: center;
  flex: 1;
  width: 100%;
  padding:
    calc(28px + var(--safe-top))
    max(18px, var(--safe-right))
    calc(28px + var(--safe-bottom))
    max(18px, var(--safe-left));
}

.login-card {
  width: min(100%, 480px);
  padding: clamp(26px, 6vw, 44px);
  border: 1px solid rgba(22, 131, 74, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(22, 75, 47, 0.13);
}

.member-logo {
  display: inline-block;
  margin-bottom: 30px;
  color: var(--kogera-green);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}

.login-eyebrow {
  margin: 0 0 8px;
  color: var(--kogera-green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.login-card h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 6vw, 32px);
  line-height: 1.35;
}

.login-description {
  margin: 18px 0 24px;
}

.login-error {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid #efb4b4;
  border-radius: 12px;
  color: var(--danger);
  background: var(--danger-bg);
  font-weight: 700;
}

.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.login-field input {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid #aabbb1;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.login-field input:focus {
  outline: 3px solid rgba(22, 131, 74, 0.18);
  border-color: var(--kogera-green);
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-toggle {
  min-width: 72px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--kogera-green-dark);
  background: var(--kogera-green-light);
  cursor: pointer;
  font-weight: 800;
}

.login-submit,
.logout-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #2cad69, var(--kogera-green));
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(22, 131, 74, 0.2);
}

.login-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  border-radius: 14px;
  font-size: 17px;
}

.login-submit:hover,
.logout-button:hover {
  filter: brightness(0.96);
}

.login-help {
  margin: 24px 0 0;
  color: #5c6b63;
  font-size: 14px;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--kogera-green-dark);
  font-weight: 700;
}

.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding:
    calc(14px + var(--safe-top))
    max(18px, var(--safe-right))
    14px
    max(18px, var(--safe-left));
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 10;
}

.member-header__logo {
  color: var(--kogera-green);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

.member-header form {
  margin: 0;
}

.logout-button {
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 999px;
}

.member-main {
  flex: 1;
  width: min(100%, 960px);
  margin: 0 auto;
  padding:
    28px
    max(18px, var(--safe-right))
    calc(48px + var(--safe-bottom))
    max(18px, var(--safe-left));
}

.member-hero {
  padding: clamp(26px, 6vw, 48px);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(22, 131, 74, 0.95), rgba(44, 173, 105, 0.88));
  color: #fff;
  box-shadow: 0 18px 40px rgba(22, 75, 47, 0.17);
}

.member-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1.3;
}

.member-hero p {
  margin: 0;
}

.member-badge {
  display: inline-block;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 800;
}

.member-content {
  margin-top: 28px;
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
}

.member-content h2 {
  margin: 0 0 20px;
  color: var(--kogera-green-dark);
  font-size: 24px;
}

.empty-content {
  padding: clamp(24px, 6vw, 48px) 20px;
  border: 2px dashed #bdd5c6;
  border-radius: 18px;
  background: #f8fcfa;
  text-align: center;
}

.empty-content span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--kogera-green-dark);
  background: var(--kogera-green-light);
  font-size: 13px;
  font-weight: 800;
}

.empty-content h3 {
  margin: 16px 0 8px;
  font-size: 21px;
}

.empty-content p {
  margin: 0;
  color: #5c6b63;
}

.member-footer {
  padding:
    22px
    max(18px, var(--safe-right))
    calc(22px + var(--safe-bottom))
    max(18px, var(--safe-left));
  color: #607068;
  text-align: center;
}

.member-footer p {
  margin: 0;
}

@media (max-width: 520px) {
  .member-header__logo {
    font-size: 19px;
  }

  .logout-button {
    min-height: 40px;
    padding: 7px 14px;
    font-size: 14px;
  }

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

  .password-toggle {
    min-height: 44px;
  }
}


.service-badges { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.service-badges span { padding:5px 13px; border:1px solid rgba(255,255,255,.55); border-radius:999px; background:rgba(255,255,255,.16); font-size:13px; font-weight:800; }
.member-section { margin-top:28px; padding:clamp(22px,5vw,36px); border:1px solid var(--border); border-radius:22px; background:#fff; }
.section-heading { margin-bottom:20px; }
.section-heading p { margin:0 0 3px; color:var(--kogera-green); font-size:11px; font-weight:900; letter-spacing:.15em; }
.section-heading h2 { margin:0; color:var(--kogera-green-dark); font-size:clamp(22px,5vw,28px); }
.action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.action-card { position:relative; display:flex; flex-direction:column; min-height:170px; padding:22px; border:1px solid rgba(22,131,74,.22); border-radius:18px; color:var(--text); background:linear-gradient(145deg,#fff,#edf9f2); text-decoration:none; box-shadow:0 10px 24px rgba(22,75,47,.08); }
.action-card__label { padding-right:28px; color:var(--kogera-green-dark); font-size:20px; font-weight:900; }
.action-card__description { margin-top:10px; color:#5c6b63; font-size:14px; }
.action-card__arrow { position:absolute; right:20px; bottom:17px; color:var(--kogera-green); font-size:27px; font-weight:900; }
.action-card__status { align-self:flex-start; margin-top:auto; padding:4px 10px; border-radius:999px; color:#6c756f; background:#e8ecea; font-size:12px; font-weight:800; }
.action-card--disabled { cursor:default; opacity:.75; }
.notice-list { display:grid; gap:14px; }
.notice-card { padding:19px 20px; border:1px solid #dce8e0; border-left:5px solid var(--kogera-green); border-radius:14px; background:#fbfefc; }
.notice-card--important { border-color:#efc1c1; border-left-color:#b52c2c; background:#fff8f8; }
.notice-card__meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:8px; color:#69766f; font-size:12px; font-weight:700; }
.notice-tag { padding:3px 9px; border-radius:999px; color:var(--kogera-green-dark); background:var(--kogera-green-light); font-size:11px; font-weight:900; }
.notice-tag--important { color:#fff; background:#b52c2c; }
.notice-card h3 { margin:0; font-size:18px; }
.notice-card p { margin:9px 0 0; color:#526159; }
.notice-empty { margin:0; padding:22px; border:1px dashed #bdd5c6; border-radius:14px; color:#69766f; background:#f8fcfa; text-align:center; }
@media (max-width:640px) {
  .action-grid { grid-template-columns:1fr; }
  .action-card { min-height:145px; }
  .member-section { padding:21px 17px; }
}


.action-card__type {
  display:inline-flex;
  align-self:flex-start;
  margin-bottom:10px;
  padding:3px 8px;
  border-radius:999px;
  color:var(--kogera-green-dark);
  background:var(--kogera-green-light);
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
}

.notice-pdf-link {
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:14px;
  padding:9px 13px;
  border-radius:9px;
  color:#fff;
  background:var(--kogera-green);
  font-weight:900;
  text-decoration:none;
}

.notice-pdf-link span {
  font-size:12px;
  font-weight:600;
  opacity:.9;
}

.video-section h1 {
  margin:0;
  color:var(--kogera-green-dark);
}

.video-player {
  position:relative;
  width:100%;
  margin-top:20px;
  overflow:hidden;
  border-radius:16px;
  background:#000;
  aspect-ratio:16/9;
}

.video-player iframe,
.video-player video {
  width:100%;
  height:100%;
  border:0;
  object-fit:contain;
}


#youtubePlayer,
#youtubePlayer iframe {
  width:100%;
  height:100%;
}

.logout-button {
  text-decoration:none;
}


.notice-pdf-list {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.notice-pdf-list .notice-pdf-link {
  margin-top:0;
}


.member-header__back {
  color:var(--kogera-green-dark);
  font-size:14px;
  font-weight:800;
  text-decoration:none;
}

.member-hero--compact {
  margin-bottom:24px;
}

.member-alert {
  margin:22px 0;
  padding:15px 17px;
  border-radius:14px;
}

.member-alert--success {
  color:#155936;
  background:#eaf7ef;
  border:1px solid #b9ddc7;
}

.member-alert--error {
  color:var(--danger);
  background:var(--danger-bg);
  border:1px solid #efb4b4;
}

.member-alert ul {
  margin-bottom:0;
}



.member-header__logo img,
.member-logo img {
  display:block;
  width:auto;
  max-width:150px;
  height:42px;
  object-fit:contain;
}

.member-logo img {
  margin:0 auto;
  max-width:190px;
  height:58px;
}

.achievement-entry-card {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:20px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  text-decoration:none;
}

.achievement-entry-card strong {
  display:block;
  color:var(--kogera-green-dark);
  font-size:18px;
}

.achievement-entry-card small {
  display:block;
  margin-top:5px;
  color:#5c6b63;
}

.achievement-scroll {
  max-height:520px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:14px;
}

.achievement-table {
  width:100%;
  min-width:820px;
  border-collapse:collapse;
  background:#fff;
}

.achievement-table th,
.achievement-table td {
  padding:12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:middle;
}

.achievement-table th {
  position:sticky;
  top:0;
  z-index:2;
  background:#edf6f0;
}

.signature-form {
  display:grid;
  gap:7px;
  min-width:180px;
}

.signature-form input,
.signature-form button,
.achievement-user-select select,
.achievement-user-select button,
.achievement-entry-form input,
.achievement-entry-form button {
  min-height:42px;
  padding:9px 11px;
  border:1px solid #aabbb1;
  border-radius:9px;
  font:inherit;
}

.signature-form button,
.achievement-user-select button,
.achievement-entry-form button {
  border:0;
  color:#fff;
  background:var(--kogera-green);
  font-weight:800;
  cursor:pointer;
}

.signature-text {
  display:block;
  font-family:"Yu Mincho","Hiragino Mincho ProN",serif;
  font-size:18px;
}

.signature-text + small {
  display:block;
  margin-top:4px;
  color:#65746c;
}

.auto-stamp {
  display:inline-grid;
  width:48px;
  height:48px;
  place-items:center;
  border:3px double #c72323;
  border-radius:50%;
  color:#c72323;
  font-family:"Yu Mincho","Hiragino Mincho ProN",serif;
  font-size:14px;
  font-weight:900;
  line-height:1;
  transform:rotate(-5deg);
}

.stamp-pending {
  color:#7a8780;
  font-size:13px;
}

.achievement-user-select,
.achievement-entry-form {
  display:grid;
  gap:14px;
}

.achievement-user-select {
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
}

.achievement-user-select label,
.achievement-entry-form label {
  display:grid;
  gap:7px;
}

.achievement-entry-form {
  grid-template-columns:repeat(4,minmax(0,1fr)) auto;
  align-items:end;
}

.distributed-pdf-list {
  display:grid;
  gap:10px;
}

.distributed-pdf-list a {
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--kogera-green-dark);
  background:#fff;
  text-decoration:none;
}

.distributed-pdf-list small {
  color:#65746c;
}

@media (max-width:800px) {
  .achievement-entry-form,
  .achievement-user-select {
    grid-template-columns:1fr;
  }

  .member-header__logo img {
    max-width:120px;
    height:36px;
  }
}


.achievement-user-search input {
  width:100%;
  min-height:42px;
  padding:9px 11px;
  border:1px solid #aabbb1;
  border-radius:9px;
  font:inherit;
  background:#fff;
}

.achievement-user-select small {
  display:block;
  margin-top:6px;
  color:#65746c;
  font-size:12px;
}

.achievement-user-select {
  grid-template-columns:minmax(180px,1fr) minmax(220px,1.4fr) auto;
}

@media (max-width:800px) {
  .achievement-user-select {
    grid-template-columns:1fr;
  }
}


/* ご依頼履歴 */
.request-history-note {
  margin: -4px 0 18px;
  color: #5d6a63;
  font-size: .92rem;
  line-height: 1.7;
}

.request-history-list {
  display: grid;
  gap: 14px;
}

.request-history-card {
  overflow: hidden;
  border: 1px solid #d6e3da;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(30, 75, 46, .06);
}

.request-history-card summary {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 16px 46px 16px 18px;
  position: relative;
  cursor: pointer;
  list-style: none;
}

.request-history-card summary::-webkit-details-marker { display: none; }
.request-history-card summary::after {
  content: "＋";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.45rem;
  font-weight: 700;
}
.request-history-card[open] summary::after { content: "−"; }
.request-history-card__date { color: #63726a; font-size: .82rem; }
.request-history-card__toggle { color: #267143; font-size: .82rem; font-weight: 700; }
.request-history-card__body { padding: 0 16px 18px; border-top: 1px solid #edf2ee; }
.request-history-meta,
.request-history-item dl {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  margin: 14px 0 0;
}
.request-history-meta dt,
.request-history-meta dd,
.request-history-item dt,
.request-history-item dd {
  margin: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #edf2ee;
  overflow-wrap: anywhere;
}
.request-history-meta dt,
.request-history-item dt { background: #f4f8f5; font-weight: 700; }
.request-history-item {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #e0e9e2;
  border-radius: 13px;
  background: #fbfdfb;
}
.request-history-item h3 { margin: 0 0 4px; font-size: 1rem; }

@media (max-width: 520px) {
  .request-history-meta,
  .request-history-item dl { grid-template-columns: 82px minmax(0, 1fr); font-size: .9rem; }
  .request-history-meta dt,
  .request-history-meta dd,
  .request-history-item dt,
  .request-history-item dd { padding: 8px; }
}


/* ログイン中のアカウントID */
.member-account-id {
  margin: -8px 0 16px;
  color: #526159;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}


/* =========================================================
   ご依頼履歴：縦スクロール表示
   履歴件数が増えてもページ全体が下方向へ伸び続けないようにする。
   ========================================================= */
.request-history-list,
.request-history,
[data-request-history-list] {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-right: 6px;
}

.request-history-list > *,
.request-history > *,
[data-request-history-list] > * {
  min-width: 0;
}

@media (max-width: 700px) {
  .request-history-list,
  .request-history,
  [data-request-history-list] {
    max-height: 62vh;
    padding-right: 3px;
  }
}


/* =========================================================
   利用者・ヘルパー お知らせ一覧：縦スクロール表示
   個別のお知らせ／全体のお知らせが増えてもページ全体を伸ばさない。
   ========================================================= */
.notice-list,
.personal-notice-list,
.general-notice-list,
[data-notice-list] {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-right: 6px;
}

.notice-list > *,
.personal-notice-list > *,
.general-notice-list > *,
[data-notice-list] > * {
  min-width: 0;
}

@media (max-width: 700px) {
  .notice-list,
  .personal-notice-list,
  .general-notice-list,
  [data-notice-list] {
    max-height: 62vh;
    padding-right: 3px;
  }
}


/* =========================================================
   会員画面：蓄積データ一覧の縦スクロール
   ========================================================= */
.request-history-list,
.notice-list {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-right: 6px;
}

.request-history-list > *,
.notice-list > * {
  min-width: 0;
}

@media (max-width: 700px) {
  .request-history-list,
  .notice-list {
    max-height: 62vh;
    padding-right: 3px;
  }
}


/* =========================================================
   会員画面：最新3件＋折りたたみ表示
   ========================================================= */
.notice-list,
.request-history-list {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
  scrollbar-gutter: auto !important;
}

.member-fold {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.member-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 11px 15px;
  color: var(--kogera-green-dark);
  background: #f2f8f4;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.member-fold > summary::-webkit-details-marker {
  display: none;
}

.member-fold > summary::after {
  content: "＋";
  flex: 0 0 auto;
  font-size: 19px;
  line-height: 1;
}

.member-fold[open] > summary::after {
  content: "－";
}

.member-fold__count {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #4d6356;
  background: #e6f0e9;
  font-size: 12px;
}

.member-fold__body {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.member-fold__body .notice-list,
.member-fold__body .request-history-list {
  display: grid;
  gap: 12px;
}

/* =========================================================
   各種お手続き：コンパクトカード
   ========================================================= */
.action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.action-card {
  min-height: 0 !important;
  padding: 10px 12px !important;
  border-radius: 11px !important;
  gap: 3px !important;
}

.action-card__type {
  font-size: 9px !important;
  line-height: 1.2;
}

.action-card__label {
  font-size: 14px !important;
  line-height: 1.35;
}

.action-card__description {
  margin-top: 1px !important;
  font-size: 11px !important;
  line-height: 1.45;
}

.action-card__status,
.action-card__arrow {
  margin-top: 3px !important;
  font-size: 12px !important;
}

@media (max-width: 560px) {
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .action-card {
    padding: 9px 10px !important;
  }

  .action-card__label {
    font-size: 13px !important;
  }

  .action-card__description {
    font-size: 10px !important;
  }

  .member-fold > summary {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 13px;
  }
}

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

  .action-card__description {
    display: none;
  }
}


/* 表示不具合修正版：会員側は縦スクロールを使用しない */
.notice-list,
.request-history-list {
  max-height: none !important;
  overflow: visible !important;
}
