/* =========================
   app.css（全文・括弧整合版）
   ========================= */

/* base */
*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color:#111;
  background:#fff7d6;
}
a{ color:inherit; }

/* layout */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:16px;
}
@media (min-width: 992px){
  .container{ padding:24px; }
}

/* header / footer */
.site-header{
  background:#fff;
  border-bottom:1px solid #e5e5e5;
  position:sticky;
  top:0;
  z-index:10;
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:nowrap;
  gap:8px;
}
.site-title{
  flex:1;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.site-nav{
  margin-left:auto;
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
  flex-shrink:0;
}
.nav-link{
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:10px;
  background:#fff;
  text-decoration:none;
}
.site-footer{
  margin-top:24px;
  border-top:1px solid #e5e5e5;
  background:#fff;
}
.footer-inner{
  padding:16px;
  color:#666;
}

/* スマホだけ：ボタンと文字を少し小さくして1行に収める */
@media (max-width: 480px){
  .site-title{ font-size:14px; }
  .nav-link{
    padding:6px 8px;
    font-size:12px;
    border-radius:10px;
  }
}

/* card / buttons / messages */
.card{
  background:#fff;
  border:1px solid #e5e5e5;
  border-radius:14px;
  padding:12px;
}

.btn{
  display:inline-block;
  padding:8px 12px;
  border:1px solid #ccc;
  border-radius:10px;
  background:#f0fff0;
  cursor:pointer;
  text-decoration:none;
  font: inherit;
}
.btn.primary{
  background:#111;
  color:#fff;
  border-color:#111;
}
.btn[disabled], button.btn:disabled{
  opacity:.5;
  cursor:not-allowed;
}

.msg-ok{
  background:#e8f5ff;
  border:1px solid #b9e2ff;
  padding:10px;
  border-radius:12px;
}
.msg-err{
  background:#fff0f0;
  border:1px solid #ffcccc;
  padding:10px;
  border-radius:12px;
}

/* table utility（横スクロール） */
.table-wrap{
  overflow-x:auto;
  max-width:100%;
  -webkit-overflow-scrolling:touch;
}

/* dashboard table（共通） */
.dashboard-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}
.dashboard-table th,
.dashboard-table td{
  padding:10px 12px;
  vertical-align:top;
  white-space:nowrap;
}
.dashboard-table th{
  background:#f7f7f7;
  font-weight:700;
  font-size:13px;
  border-bottom:1px solid #e5e5e5;
}
.dashboard-table td{ border-bottom:1px solid #eee; }
.dashboard-table th:not(:last-child),
.dashboard-table td:not(:last-child){ border-right:1px solid #eee; }
.dashboard-table tr:nth-child(even) td{ background:#fcfcfc; }
.dashboard-table tr:hover td{ background:#f4f8ff; }
.dashboard-table tr:last-child td{ border-bottom:none; }

/* PC/SP 出し分け */
.pc-only{ display:block !important; }
.sp-only{ display:none !important; }
@media (max-width: 991.98px){
  .pc-only{ display:none !important; }
  .sp-only{ display:block !important; }
}

/* dashboard: 上段（プロフィール＋履修） */
.dashboard-top{
  display:grid;
  gap:16px;
}
@media (min-width: 992px){
  .dashboard-top{
    grid-template-columns: 1fr 1fr;
    align-items:stretch;
  }
}

/* プロフィール表 */
.profile-table{
  width:100%;
  border-collapse:collapse;
}
.profile-table th,
.profile-table td{
  padding:8px 0;
  border:none;
  border-bottom:1px solid #eee;
  vertical-align:top;
}
.profile-table th{
  width:110px;
  text-align:left;
  color:#666;
  font-weight:700;
  white-space:nowrap;
}
.profile-table tr:last-child th,
.profile-table tr:last-child td{ border-bottom:none; }
@media (max-width: 480px){
  .profile-table th{ width:86px; white-space:normal; }
}

/* ===== 履修（リング＋バー） ===== */
@media (min-width: 992px){
  .progress-card{
    display:flex;
    gap:14px;
    align-items:center;
    flex-wrap:nowrap;
  }
  .progress-ring{ flex:0 0 auto; }
  .progress-meta{
    flex:1 1 auto;
    min-width:0;
  }
}
@media (max-width: 991.98px){
  .progress-card{
    display:flex;
    gap:14px;
    align-items:center;
    flex-wrap:wrap;
  }
}

.progress-ring{
  --p: 0;
  --size: 140px;
  --thick: 18px;

  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  position: relative;
  display:grid;
  place-items:center;

  background: conic-gradient(from -90deg,
    rgba(255,61,113,.28),
    rgba(255,209,102,.28),
    rgba(6,214,160,.28),
    rgba(0,194,255,.28),
    rgba(124,77,255,.28),
    rgba(255,61,113,.28)
  );
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.12));
}
.progress-ring::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  z-index:0;
  background: conic-gradient(from -90deg,
    #ff3d71 0 calc(var(--p) * .34%),
    #ffd166 calc(var(--p) * .34%) calc(var(--p) * .67%),
    #00c2ff calc(var(--p) * .67%) calc(var(--p) * 1%),
    transparent calc(var(--p) * 1%) 100%
  );
}
.progress-ring::before{
  content:"";
  position:absolute;
  width: calc(var(--size) - (var(--thick) * 2));
  height: calc(var(--size) - (var(--thick) * 2));
  background:#fff;
  border-radius:50%;
  z-index:1;
}
.progress-ring span{
  position:relative;
  z-index:2;
  font-weight:900;
  font-size:24px;
}
.progress-meta .label{ color:#666; font-size:12px; }
.progress-meta .big{ font-size:18px; font-weight:800; }

.progress-bar{
  margin-top:10px;
  height:16px;
  background:#f1f1f1;
  border-radius:999px;
  overflow:hidden;
}
.progress-bar i{
  display:block;
  height:100%;
  border-radius:999px;
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,.40) 0 10px,
      rgba(255,255,255,0) 10px 20px
    ),
    linear-gradient(90deg,
      #ff3d71,
      #ffd166,
      #06d6a0,
      #00c2ff,
      #7c4dff
    );
}

/* size table layout */
.size-grid{
  display:grid;
  gap:16px;
}
.size-grid > section{ min-width:0; }
@media (min-width: 992px){
  .size-grid{
    grid-template-columns: 1fr 1.4fr;
    align-items:start;
  }
}

/* inputs */
.form-control{
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:10px;
  background:#fff;
}
.num{
  width:90px;
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:10px;
  background:#fff;
}

/* teacher menu（整列：Grid） */
.teacher-menu{
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.teacher-menu .btn{
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e5e5e5;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  font-weight: 700;
  text-align: center;
}
.teacher-menu .btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

/* ===== スマホ：size-table-card をカード表示（入力テーブル用） ===== */
@media (max-width: 768px){
  table.size-table-card thead{ display:none; }
  table.size-table-card tbody{ display:block; }
  table.size-table-card tbody tr{
    display:block;
    margin:10px 0;
    padding:12px;
    border:1px solid #eee;
    border-radius:14px;
    background:#fff;
  }
  table.size-table-card tbody td{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:6px 0;
    border:none;
    white-space:normal;
  }
  table.size-table-card tbody td::before{
    content: attr(data-label);
    color:#666;
    font-weight:700;
    white-space:nowrap;
  }
}

/* 犬：画像と表 */
.dog-card{
  display:flex;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
}
.dog-photo{
  width:160px;
  max-width:160px;
  height:auto;
  display:block;
  border:1px solid #e5e5e5;
  border-radius:12px;
}
@media (min-width: 769px){
  .dog-card{
    flex-wrap:nowrap;
    align-items:flex-start;
  }
  .dog-info{
    min-width:0;
    flex:1 1 auto;
  }
}
@media (max-width: 768px){
  .dog-card{
    flex-direction:column;
    align-items:center;
  }
  .dog-photo{
    width:100% !important;
    max-width:260px;
  }
}

/* 犬情報表：折り返し＆固定レイアウト */
.dog-info table.dashboard-table:not(.finish-size-table){
  width:100%;
  table-layout:fixed;
}
.dog-info table.dashboard-table:not(.finish-size-table) th,
.dog-info table.dashboard-table:not(.finish-size-table) td{
  white-space:normal;
}
.dog-info table.dashboard-table:not(.finish-size-table) th:first-child{
  width:7.5em;
}

/* ===== コース見出し（ポップ版） ===== */
.course-head{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:18px 0 10px;
}
.course-title{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 16px;
  border-radius:999px;

  border:2px solid rgba(0,0,0,.12);
  background: linear-gradient(135deg, #fff 0%, #fff3c4 40%, #ffe0ee 100%);

  font-weight:900;
  font-size:26px;
  letter-spacing:.02em;

  box-shadow:
    0 10px 0 rgba(0,0,0,.06),
    0 18px 30px rgba(0,0,0,.10);

  transform: translateY(-2px);
}
.course-title::before{
  content:"★";
  font-size:18px;
  line-height:1;
  display:inline-grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:999px;
  background:#111;
  color:#fff;
}
.course-progress{
  display:inline-flex;
  align-items:baseline;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;

  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  box-shadow:0 10px 24px rgba(0,0,0,.08);
}
.course-rate{
  font-size:26px;
  font-weight:900;
  line-height:1;
}
.course-frac{
  font-size:14px;
  font-weight:800;
  color:#555;
}
.course-pill.done{
  display:inline-block;
  padding:10px 14px;
  border-radius:999px;
  border:2px solid rgba(10,160,10,.35);
  background: linear-gradient(135deg, #e9ffe9, #ffffff);
  color:#0a0;
  font-weight:900;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
}
@media (max-width:768px){
  .course-title{ font-size:18px; padding:8px 12px; }
  .course-title::before{ width:24px; height:24px; font-size:14px; }
  .course-rate{ font-size:22px; }
  .course-frac{ font-size:13px; }
}

/* ===== スマホ：右側（仕上がりサイズ表カード）だけ細めに中央寄せ ===== */
@media (max-width: 768px){
  #dogsize .size-grid > section.card:last-child{
    max-width:360px;
    margin-left:auto;
    margin-right:auto;
  }
}

/* 仕上がりサイズ表（finish-size-table） */
.finish-size-table{
  display:inline-table;
  width:auto;
  border-collapse:collapse;
  border-spacing:0;
  background:#fff;
}
.finish-size-table th,
.finish-size-table td{
  border:1px solid #e5e5e5;
  padding:10px 12px;
  white-space:nowrap;
}
.finish-size-table th{
  background:#f7f7f7;
  font-weight:700;
  font-size:13px;
}
.finish-size-table th:nth-child(n+2),
.finish-size-table td:nth-child(n+2){
  width:1%;
  text-align:center;
}
.finish-size-table th:first-child,
.finish-size-table td:first-child{
  width:auto;
  white-space:nowrap;
  word-break:keep-all;
  overflow-wrap:normal;
}
@media (max-width: 768px){
  .finish-size-table th,
  .finish-size-table td{ padding:6px 8px; }
}

/* カリキュラム等の外枠（テーブルの外側カード） */
.table-card{
  background:#fff;
  border:1px solid #e5e5e5;
  border-radius:14px;
  overflow:hidden;
}

/* course guide */
.course-guide{
  margin:8px 0 12px;
  border-left:6px solid rgba(0,0,0,.12);
}
.course-guide-title{ font-weight:900; margin-bottom:6px; }
.course-guide-message{ color:#444; font-size:14px; margin-bottom:10px; }
.course-guide-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.course-guide-actions audio{
  width:240px;
  max-width:100%;
}
.course-guide-note{ color:#666; font-size:12px; }

/* ガイド内ボタン：文字・色を統一 */
.course-guide-actions a.btn,
.course-guide-actions button.btn{
  font-family:inherit !important;
  font-size:15px !important;
  font-weight:700;
  line-height:1.2;

  background:#2f6feb;
  color:#fff !important;
  border:1px solid #2f6feb;
  border-radius:10px;
  padding:8px 12px;

  cursor:pointer;
  text-decoration:none;
  -webkit-appearance:none;
  appearance:none;
}
.course-guide-actions a.btn:hover,
.course-guide-actions button.btn:hover{ filter:brightness(0.95); }
.course-guide-actions button.btn:disabled{
  opacity:.5;
  cursor:not-allowed;
}

/* ダッシュボードの横幅を他と揃える */
.dashboard-wrap{
  max-width:980px;
  margin:0 auto;
}
.dashboard-wrap *{ min-width:0; }

/* ダッシュボード：みんなの作品（正方形サムネ / PC5列） */
.dash-works-grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:12px;
}
@media (min-width: 992px){
  .dash-works-grid{ grid-template-columns:repeat(5, 1fr); }
}
.dash-works-card{
  border:1px solid #eee;
  border-radius:14px;
  padding:10px;
}
.dash-works-thumb{
  position:relative;
  width:100%;
  overflow:hidden;
  border-radius:10px;
  border:1px solid #ddd;
  background:#f5f5f5;
}
.dash-works-thumb::before{
  content:"";
  display:block;
  padding-top:100%;
}
.dash-works-thumb img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.dash-works-thumb--empty{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#888;
  font-size:12px;
}

/* 最新作品（dashboard.phpで使用） */
.latest-works-grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:12px;
}
@media (min-width: 992px){
  .latest-works-grid{ grid-template-columns:repeat(5, 1fr); }
}
.latest-works-item{
  border:1px solid #eee;
  border-radius:14px;
  padding:10px;
}
.latest-works-thumb{
  position:relative;
  width:100%;
  overflow:hidden;
  border-radius:10px;
  border:1px solid #ddd;
  background:#f5f5f5;
}
.latest-works-thumb::before{ content:""; display:block; padding-top:100%; }
.latest-works-thumb img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.latest-works-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#888;
  font-size:12px;
}

/* 認定カード */
.cert-card-title{
  font-weight:900;
  font-size:14px;
  margin-bottom:8px;
}
.cert-card-body{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:6px;
  min-height:120px;
}

/* 星版（技術認定） */
.cert-stars{
  display:flex;
  justify-content:center;
  gap:6px;
  line-height:1;
}
.cert-star{
  font-size:36px;
  font-weight:900;
  color:#ffd400;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0px  2px 0 #000;
}
.cert-star--off{
  color:#ddd;
  text-shadow:none;
}
.cert-level{
  font-size:18px;
  font-weight:900;
  letter-spacing:.02em;
}
.cert-goal{
  margin-top:4px;
  font-size:16px;
  font-weight:800;
  color:#444;
  line-height:1.35;
}

/* 上段：3列（PC） */
@media (min-width: 992px){
  .dashboard-top.dashboard-top--3{
    display:grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(160px, 200px);
    gap:12px;
    align-items:stretch;
  }
  .dashboard-top.dashboard-top--3 > *{ min-width:0; }
}
/* タブレット/スマホ：縦 */
@media (max-width: 991.98px){
  .dashboard-top.dashboard-top--3{
    display:grid;
    grid-template-columns: 1fr;
  }
}

/* 合格/再提出 表示（受講生ダッシュボード） */
.judge-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:7px 14px;
  border-radius:999px;
  border:2px solid #111;
  font-weight:900;
  background:#fff;
  box-shadow:0 8px 18px rgba(0,0,0,.18);
  margin:0 auto;
}
.judge-status.judge-pass{
  border:3px solid #f2b705;
  color:#b15400;
  font-size:22px;
  letter-spacing:.12em;
  background: linear-gradient(90deg, #fff6b7, #ffe27a, #fff6b7);
  text-shadow:0 2px 0 rgba(0,0,0,.12);
  position:relative;
  overflow:hidden;
  animation: judgePop .35s ease-out;
}
.judge-status.judge-pass::before{
  content:"";
  position:absolute;
  top:-40%;
  left:-60%;
  width:80%;
  height:200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  transform: rotate(18deg);
  animation: judgeShine 1.6s ease-in-out infinite;
}
@keyframes judgeShine{
  0%{ left:-70%; opacity:0; }
  20%{ opacity:.9; }
  50%{ left:120%; opacity:0; }
  100%{ left:120%; opacity:0; }
}
@keyframes judgePop{
  0%{ transform: scale(.92); }
  100%{ transform: scale(1); }
}
.judge-status.judge-retry{
  border:2px dashed #333;
  font-size:18px;
  letter-spacing:.06em;
  background:#fff;
  color:#333;
}
.judge-date{
  margin-top:6px;
  font-size:12px;
  color:#333;
  text-align:center;
}


/* ===== カリキュラム：PCは2列 ===== */
@media (min-width: 992px){
  .curriculum-table-pc{ table-layout: fixed; }
  .curriculum-table-pc th,
  .curriculum-table-pc td{ width: 50%; }
  .curriculum-table-pc td{
    white-space: normal;
    vertical-align: top;
  }

  .curriculum-table-pc .curcell{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  .curriculum-table-pc .curcell-title{
    font-weight:900;
    line-height:1.35;
    word-break:break-word;
  }
  .curriculum-table-pc .curcell-no{
    display:inline-block;
    margin-right:6px;
    color:#666;
    font-weight:800;
  }
  .curriculum-table-pc .curcell-actions{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
  }
  .curriculum-table-pc .judge-status{ margin:0; }
  .curriculum-table-pc .judge-date{
    text-align:left;
    margin-top:6px;
  }
}

/* PC/SP共通（PCセル用の箱） */
.curcell{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.curcell-title{
  font-weight:900;
  line-height:1.35;
}
.curcell-no{
  display:inline-block;
  margin-right:6px;
  color:#666;
  font-weight:800;
}

/* 次にやること（強調） */
.progress-next{
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  border:2px solid rgba(255, 170, 0, .45);
  background: linear-gradient(135deg, #fff7cf, #ffffff);
  box-shadow: 0 8px 18px rgba(0,0,0,.10);
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.progress-next-label{
  font-weight:900;
  font-size:12px;
  padding:4px 10px;
  border-radius:999px;
  background:#111;
  color:#fff;
  line-height:1.2;
  letter-spacing:.04em;
}
.progress-next-name{
  font-weight:900;
  font-size:16px;
  color:#b15400;
  line-height:1.3;
}

/* =========================
   works.php だけ（.works-page で限定）
   ========================= */
.works-page{
  max-width:980px;
  margin:0 auto;
  padding:16px;

  background: rgba(255,255,255,.55);
  border: 2px solid rgba(0,0,0,.06);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0,0,0,.10);
}
@media (min-width: 992px){
  .works-page{ padding:22px; }
}

/* タイトル */
.works-page .works-title{
  margin:0 0 10px;
  font-family: "M PLUS Rounded 1c","Hiragino Maru Gothic ProN","Meiryo",system-ui,sans-serif;
  font-weight: 900;
  letter-spacing: .06em;

  color:#1e90ff;
  -webkit-text-stroke: 1px #fff;

  text-shadow:
    0 2px 0 rgba(0,0,0,.10),
    0 10px 22px rgba(0,0,0,.12);
  line-height: 1.15;
}
@media (max-width: 768px){
  .works-page .works-title{
    font-size:26px;
    -webkit-text-stroke: 1.5px #fff;
  }
}
@media (min-width: 769px){
  .works-page .works-title{ font-size:34px; }
}

/* works内のボタン */
.works-page .btn{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  font-weight: 900;
  background: linear-gradient(135deg, #e9ffe9, #e8f5ff);
}

/* 一覧カード */
.works-page .latest-works-item{
  position: relative;
  overflow: hidden;

  border-radius: 18px;
  padding: 12px;
  border: 2px solid rgba(0,0,0,.08);
  background: linear-gradient(135deg, #fff 0%, #fff7ff 45%, #fffaf0 100%);
  box-shadow: 0 12px 26px rgba(0,0,0,.10);

  transition: transform .12s ease, box-shadow .12s ease;
}
.works-page .latest-works-item::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:7px;
  background: linear-gradient(90deg, #ff3d71, #ffd166, #06d6a0, #00c2ff, #7c4dff);
  opacity:.9;
}
.works-page .latest-works-item:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0,0,0,.14);
}
.works-page .latest-works-thumb{
  border-radius: 14px;
  border: 2px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 18px rgba(0,0,0,.10);
  background: #fff;
  overflow:hidden;
}
.works-page .latest-works-thumb img{
  width:100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display:block;
}

/* 作者表示 */
.works-page .work-author{
  margin-top:4px;
  font-size:12px;
  color:#666;
  display:flex;
  align-items:baseline;
  gap:6px;
}
.works-page .work-author__label{ font-weight:900; color:#666; }
.works-page .work-author__name{ font-weight:900; color:#111; }
.works-page .work-author__label::before{
  content:"" !important;
  display:none !important;
}

/* 詳細グリッド */
.works-page .work-detail-card{ border-radius:18px; }
.works-page .work-detail-grid{
  display:grid;
  gap:16px;
  grid-template-columns: 1fr;
}
@media (min-width: 992px){
  .works-page .work-detail-grid{
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    align-items:start;
  }
}
.works-page .work-side{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.works-page .work-curriculum{
  font-weight:900;
  font-size:18px;
  line-height:1.35;
}
.works-page .work-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin-top:2px;
}
.works-page .work-meta::before{
  content:"" !important;
  display:none !important;
}
.works-page .work-author__label{
  font-size:12px;
  color:#666;
  font-weight:900;
  letter-spacing:.06em;
}
.works-page .work-author__name{
  font-size:18px;
  font-weight:900;
  letter-spacing:.04em;
  color:#111;
  text-shadow: 0 1px 0 rgba(255,255,255,.9);
}
.works-page .work-date{
  font-size:12px;
  color:#666;
  margin-left:6px;
}
.works-page .work-main img{
  width:100%;
  height:auto;
  display:block;
  border:1px solid #ddd;
  border-radius:14px;
}

/* サムネ（詳細）：PC5列、スマホ3→2列 */
.works-page .work-thumbs{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:8px;
}
@media (max-width: 768px){
  .works-page .work-thumbs{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px){
  .works-page .work-thumbs{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
.works-page .work-thumb{
  width:100%;
  padding:0;
  border:2px solid transparent;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
  cursor:pointer;
  -webkit-appearance:none;
  appearance:none;
}
.works-page .work-thumb img{
  width:100%;
  aspect-ratio:1 / 1;
  height:auto;
  object-fit:cover;
  display:block;
}
.works-page .work-thumb.is-active{ border-color:#2f6feb; }
.works-page .work-thumb:focus{
  outline: 3px solid rgba(47,111,235,.35);
  outline-offset: 2px;
}
.works-page .work-thumb-note{
  margin-top:6px;
  font-size:12px;
  color:#666;
}

/* いいね */
.works-page .work-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.works-page .work-like-btn{
  font-weight:900;
  border-width:2px;
  background:#fff2a8;
  border-color:#f2b705;
}
.works-page .work-like-btn:hover{
  filter:brightness(.98);
  transform:translateY(-1px);
}
.works-page .work-like-count{
  font-weight:900;
  color:#444;
}

/* 日記 */
.works-page .work-diary{
  margin-top:4px;
  padding:14px 14px 14px 18px;
  border-radius:14px;
  border:1px solid #eee;
  line-height:1.8;
  background: repeating-linear-gradient(
    #fff,
    #fff 28px,
    #f0f6ff 28px,
    #f0f6ff 29px
  );
  position:relative;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.works-page .work-diary::before{
  content:"";
  position:absolute;
  left:12px;
  top:0;
  bottom:0;
  width:2px;
  background:rgba(255,80,80,.35);
  border-radius:2px;
}

/* iPhone(Safari)で文字色が変になる対策：worksページだけ */
.works-page a.btn,
.works-page button.btn{
  color:#111 !important;
  -webkit-text-fill-color:#111;
  -webkit-appearance:none;
  appearance:none;
}
.works-page .work-like-btn{
  color:#111 !important;
  -webkit-text-fill-color:#111;
}

/* LINE連携ボタン（緑） */
.btn.btn-line{
  background:#06C755;
  border:1px solid #06C755;
  color:#fff;
  font-weight:700;
}
.btn.btn-line:hover{
  background:#05b84b;
  border-color:#05b84b;
  color:#fff;
}

/* =========================
   アイテム別 仕上がりサイズ：横スクロール（1行固定）
   ========================= */
.itemsize-cols{
  display:flex;
  flex-wrap:nowrap;
  gap:12px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  padding-bottom:8px;
}
.itemsize-col{ flex:0 0 160px; }
.itemsize-col-title{
  text-align:center;
  font-weight:800;
  margin-bottom:6px;
}
.itemsize-table{
  width:100%;
  border:1px solid #ddd;
  border-collapse:collapse;
  background:#fff;
  table-layout:fixed;
  font-size:inherit;
}
.itemsize-table th,
.itemsize-table td{
  border:1px solid #eee;
  text-align:center;
  vertical-align:middle;
  padding:4px 6px;
  font-size:inherit;
}
.itemsize-table thead th{
  font-weight:800;
  background:#fafafa;
}
.itemsize-table th:last-child,
.itemsize-table td:last-child{
  width:70px;
  white-space:nowrap;
  text-align:right;
}

/* 実習履歴登録済ボタン */
.btn.is-done{
  background:#eaf6ee;
  border:1px solid rgba(0,0,0,.10);
  font-weight:900;
}
a.btn.is-done{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
a.btn.is-done .done-check{
  color:#e60000 !important;
  font-weight:900;
  line-height:1;
}

/* はみ出し防止の保険 */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; height: auto; }
input, select, textarea { max-width: 100%; }

/* 横はみ出し対策（まずはこれだけ） */
html, body { overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; height: auto; }
input, select, textarea { max-width: 100%; }
* { overflow-wrap: anywhere; word-break: break-word; }
