/*
 * デザイン参考：WordPress パネル配置方法
 * https://chatgpt.com/c/696b8a5f-f2b8-8321-936f-bbebc4571278
 */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card-grid-s {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

/* 既存の card スタイルはそのまま使える */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  /* text-decoration: none; */
  transition: background-color 0.15s ease,
              transform 0.15s ease,
              box-shadow 0.15s ease;
}

.card:hover {
  background-color: #f2f4f8;      /* Hover Color */
  transform: translateY(-2px);    /* 押し上げ */
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  /* text-decoration: none; */
}

/* .card * {
  text-decoration: none;
} */

/* .card {
  line-height: 1.1;
} */

/* .card h4,
.card p {
  margin: 0.25em;
} */

.card h4 {
  margin: 0.6em;
}
.card p {
  margin: 0.1em;
}


.card .highlight {
  background: #fff3cd;
  /* padding: 0.25em 10px; */
  padding: 2px 10px 0px 10px;
  margin-bottom: 10px;  /* 下の要素との間隔だけ広く */
  border-radius: 4px;
}


button.card {
  position: relative;     /* 親要素を position: relative、マスクを absolute で重ねる */
  /* display: inline-block; */  /* ← ボタンの実サイズに追従 */
  
  background: #fff;
  border: none;
  /* text-align: left; */
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  /* text-decoration: none; */
  transition: background-color 0.15s ease,
              transform 0.15s ease,
              box-shadow 0.15s ease;
}


/* ボタンとマスクを兄弟にするときに、共通の親として使用 */
.button-wrapper {
  position: relative;     /* 親要素を position: relative、マスクを absolute で重ねる */
  display: inline-block;  /* ← ボタンの実サイズに追従 */
}

/* ボタンが押せないときのマスク表示（※ 実際の押下禁止処理は別途必要） */
.button-mask {
  position: absolute;
  inset: 0;               /* ← 親のサイズにピッタリ一致 */
  background: rgba(0, 0, 0, 0.5);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  color: #fff;
  font-size: 14px;

  border-radius: 8px;  /* ← ボタンと同じ値 */
}

/* ボタンが押せない時の鍵アイコン表示 */
.button-mask img {
  width: 32px;
  margin-bottom: 8px;
}


.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: min(90vw, 600px);
  display: flex;
  flex-direction: column;
  max-height: 70vh;           /* モーダル全体の上限 */
}


.modal-buttons {
  display: flex;
  gap: 12px;                  /* ボタン間の余白 */
}

.modal-buttons .btn {
  flex: 1;                    /* 同じ幅にする */
  text-align: center;
  padding: 0.6em 0;
}

/* OKボタン：見た目を分かりやすくする（推奨） */
#confirmBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* 同意確認チェックボックス */
.agree {
  /* 横方向センタリング */
  /* display: flex; */
  display: inline-flex;    /* ← flex ではなく inline-flex */
  align-items: center;     /* 縦位置を揃える */
  /* justify-content: center; */ /* 横方向センタリング */
  gap: 6px;                /* チェックと文字の間隔 */
}


.modal-scroll {
  flex: 1;                      /* 残り高さを占有 */
  /* max-height: 50vh; */       /* モーダル内での最大高さ */

  overflow-y: auto;             /* 縦スクロール */
  /* margin: 16px 0; */
  padding: 12px 12px;           /* ← 影の逃げ場 */
  overscroll-behavior: contain; /* 背後のWebページがスクロールしないように */

  /* 枠線（またはインセット影）を付ける */
  /* border: 1px solid #ddd;
  border-radius: 6px; */
  /* box-shadow: inset 0 0 0 1px #ddd; */

  /* 上下フェード（スクロールできる感を出す） */
  position: relative;
  mask-image: linear-gradient(
    to bottom,
    transparent,
    black 5px,
    black calc(100% - 5px),
    transparent
  );

  background: #f6f8fa;
  border-radius: 8px;
  /* box-shadow: 0 23px 28px rgba(0,0,0,0.2); */
}

/* .modal-scroll::before,
.modal-scroll::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: none;
  z-index: 2;
}

.modal-scroll::before {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,1),
    rgba(255,255,255,0)
  );
}

.modal-scroll::after {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(255,255,255,1),
    rgba(255,255,255,0)
  );
} */

/* グリッド内ボタン選択時 */
.grid-btn-selectable.selected {
  outline: 2px solid #007cba;
  background: #e6f2fb;
}


/* クロワッサン消費量確認 */
.croi-confirm {
  background: #fff3cd;
  border: none;
  /* text-align: left; */
  border-radius: 8px;
  padding: 0px;
  /* box-shadow: 0 3px 8px rgba(0,0,0,0.2); */
}


/* 購入確認コンテナ */
.slot-confirm-container {
  display: flex;
  margin-bottom: 12px;

  background: #f6f8fa;
}

/* 購入確認コンテナ：左側 */
.slot-confirm-container > .left {
  max-width: 200px;     /* 画像エリアの最大幅 */
  max-height: 200px;    /* 画像エリアの最大高 */
  flex-shrink: 0;       /* 画像を縮めない */
}

/* 購入確認コンテナ：左側：画像 */
.slot-confirm-container > .left img {
  display: block;

  max-width: 100%;
  height: auto;
}

/* 購入確認コンテナ：右側 */
.slot-confirm-container > .right {
  display: flex;
  flex-direction: column;
  justify-content: center; /* 縦中央揃え */
  margin-left: 16px;
}

/* 購入確認コンテナ：右側：1行目 */
.slot-confirm-container .line1 {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ファイルプレビュー画像 */
.file-preview-img {
  max-width: 200px;
  max-height: 200px;
  height: auto;
}


/* 特殊API */
.special-api-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.special-api-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.special-api-notice,
.special-api-result {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 16px;
}

.special-api-notice p,
.special-api-result p {
  margin: 0;
}

.special-api-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d8dee4;
  box-shadow: none;
}

.special-api-card:hover {
  background: #fff;
  transform: none;
  box-shadow: none;
}

.special-api-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.special-api-name {
  opacity: 0.7;
  font-family: monospace;
}

.special-api-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eceff3;
}

.special-api-status.issued {
  background: #fff3cd;
}

.special-api-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #f6f8fa;
}

.special-api-meta .line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.special-api-meta .line span:last-child {
  font-family: monospace;
  word-break: break-all;
}

.special-api-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.special-api-actions .button {
  min-width: 140px;
}

.special-api-key-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}

.special-api-copy-notice {
  color: rgba(0,0,0,0.55);
  font-size: 12px;
  margin-bottom: 8px;
}

.special-api-key-box {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  font-family: monospace;
  word-break: break-all;
}

.special-api-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.special-api-confirm-overlay[hidden] {
  display: none;
}

.special-api-confirm-dialog {
  width: min(90vw, 420px);
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}


/* 特殊API 英単語一覧 */
.special-api-word-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.special-api-word-summary {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 16px;
}

.special-api-word-summary p {
  margin: 0;
}

.special-api-word-delete-result {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 12px 16px;
}

.special-api-word-delete-result p {
  margin: 0;
}

.special-api-word-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.special-api-word-pager-left,
.special-api-word-pager-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.special-api-word-page-status {
  min-width: 64px;
  text-align: center;
  font-family: monospace;
}

.special-api-word-pages {
  display: flex;
  flex-direction: column;
}

.special-api-word-page[hidden] {
  display: none;
}

.special-api-word-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.special-api-word-table th,
.special-api-word-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.special-api-word-table th {
  background: #f6f8fa;
}

.special-api-word-col-no {
  width: 72px;
  font-family: monospace;
}

.special-api-word-col-word {
  width: 240px;
  font-family: monospace;
}

.special-api-word-col-check {
  width: 88px;
  text-align: center;
}

.special-api-word-empty {
  color: rgba(0,0,0,0.6);
}

.special-api-word-delete-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  margin-bottom: 16px;
}


/* メンテナンス情報 */
.maintenance-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.maintenance-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.maintenance-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d8dee4;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.maintenance-card.is-active {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(217,119,6,0.18);
  background: #fff9ed;
}

.maintenance-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.maintenance-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.maintenance-card-title {
  margin: 0;
}

.maintenance-card-subtitle {
  margin: 0;
  color: rgba(0,0,0,0.6);
  font-family: monospace;
}

.maintenance-status-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eceff3;
  white-space: nowrap;
}

.maintenance-status-label.is-active {
  background: #f59e0b;
  color: #fff;
}

.maintenance-card-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.maintenance-card-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}

.maintenance-card-label {
  color: rgba(0,0,0,0.65);
}

.maintenance-card-value {
  word-break: break-word;
}

.maintenance-card-row-period .maintenance-card-value {
  font-family: monospace;
}

.maintenance-empty {
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: #f6f8fa;
  color: rgba(0,0,0,0.65);
}


/* follow / follower */
.follow-user-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.follow-user-search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.follow-user-search-form input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #ccd5df;
  border-radius: 999px;
}

.follow-user-search-summary,
.follow-user-feedback,
.follow-user-empty {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 12px 16px;
}

.follow-user-feedback {
  color: #8a1c1c;
}

.follow-user-search-summary p,
.follow-user-feedback p,
.follow-user-empty p {
  margin: 0;
}

.follow-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.follow-user-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #d8dee4;
  border-radius: 16px;
  background: #fff;
}

.follow-user-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.follow-user-avatar-wrap {
  flex-shrink: 0;
}

.follow-user-avatar-link,
.follow-user-name-link {
  color: inherit;
  text-decoration: none;
}

.follow-user-avatar-link:hover .follow-user-avatar,
.follow-user-name-link:hover {
  opacity: 0.86;
}

.follow-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  background: #eef2f6;
}

.follow-user-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.follow-user-name {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.follow-user-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.follow-user-x-status,
.follow-user-follows-you {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.follow-user-x-status {
  background: #eef2f6;
  color: #4b5563;
}

.follow-user-follows-you {
  background: #e8f5e9;
  color: #22603a;
}

.follow-user-follows-you[hidden] {
  display: none;
}

.follow-user-actions {
  flex-shrink: 0;
}

.follow-user-action-button {
  min-width: 120px;
  border-radius: 999px;
}

.follow-user-action-button.is-following {
  position: relative;
}

.follow-user-button-hover {
  display: none;
}

.follow-user-action-button.is-following:hover .follow-user-button-default {
  display: none;
}

.follow-user-action-button.is-following:hover .follow-user-button-hover {
  display: inline;
}

.profile-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-user-head-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.profile-user-name {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.profile-follow-user-actions {
  margin-left: auto;
}

@media (max-width: 640px) {
  .follow-user-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .follow-user-actions {
    width: 100%;
  }

  .follow-user-action-button {
    width: 100%;
  }

  .profile-user-head {
    flex-direction: column;
  }

  .profile-follow-user-actions {
    width: 100%;
    margin-left: 0;
  }
}


/* profile settings */
.profile-setting-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-setting-summary {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 12px 16px;
}

.profile-setting-summary p {
  margin: 0;
}

.profile-setting-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-setting-option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-setting-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid #d8dee4;
  border-radius: 12px;
  background: #fff;
}

.profile-setting-option input[type="radio"] {
  margin-top: 2px;
}

.profile-setting-option-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-setting-option-title {
  font-weight: 600;
}

.profile-setting-option-caption,
.profile-setting-help {
  color: rgba(0,0,0,0.68);
}

.profile-setting-help {
  margin: 0;
}

.profile-setting-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-setting-actions {
  display: flex;
  justify-content: flex-end;
}


/* admin csv */
.admin-csv-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-csv-notice,
.admin-csv-feedback,
.admin-csv-result {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 12px 16px;
}

.admin-csv-notice p,
.admin-csv-feedback p,
.admin-csv-result p {
  margin: 0;
}

.admin-csv-feedback {
  color: #8a1c1c;
}

.admin-csv-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-csv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-csv-field input[type="text"],
.admin-csv-field input[type="file"] {
  max-width: 100%;
}

.admin-csv-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-csv-actions {
  display: flex;
  justify-content: flex-end;
}

