/* ORIME Portal — mobile first */
:root {
  --ivory: #FAF8F5;
  --rose: #C98A96;
  --rose-deep: #A96877;
  --rose-soft: #F4E6E9;
  --charcoal: #333333;
  --bronze: #B88A5A;
  --greige: #B8ADA4;
  --greige-soft: #E9E4DF;
  --white: #FFFFFF;
  --muted: #7A716B;
  --danger: #B5534F;
  --ok: #5E8A6E;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(51, 51, 51, .05), 0 4px 16px rgba(51, 51, 51, .04);
  --serif: "Shippori Mincho", "Noto Serif JP", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: .02em;
}
img { max-width: 100%; height: auto; }
a { color: var(--rose-deep); text-underline-offset: 3px; }
a:hover { color: var(--charcoal); }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- typography ---------- */
.h1, .h2, .h3, .h4 { font-family: var(--serif); font-weight: 600; line-height: 1.5; margin: 0 0 .7em; color: var(--charcoal); }
.h1 { font-size: 1.35rem; margin-top: .4em; }
.h2 { font-size: 1.12rem; }
.h3 { font-size: 1.02rem; }
.h4 { font-size: .95rem; margin-top: 1em; }
.with-accent { display: flex; align-items: center; gap: .6em; }
.with-accent::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--rose); }
.hint { font-size: .82rem; color: var(--muted); margin: .3em 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .03em; }
.empty { color: var(--muted); padding: 2em 0; text-align: center; }
.prose { white-space: normal; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: .15em 0; }
pre.code { background: var(--greige-soft); padding: .8em 1em; border-radius: 8px; font-size: .85rem; overflow-x: auto; }

/* ---------- card ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--greige-soft);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head .h3 { margin: 0; }
.grid-2 { display: grid; gap: 16px; }
.stack { display: grid; gap: 10px; }

/* ---------- flash ---------- */
.flash { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; border: 1px solid; }
.flash ul { margin: 0; }
.flash-success { background: #EEF5F0; border-color: #CFE2D5; color: #2F5E40; }
.flash-error { background: #FBEFEE; border-color: #F0CFCC; color: #8A3A36; }
.flash-info { background: #F6F1EA; border-color: #E6D8C5; color: #6B5232; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 44px; padding: 8px 20px;
  border-radius: 999px; border: 1px solid var(--charcoal);
  background: var(--charcoal); color: var(--white);
  font: inherit; font-size: .92rem; font-weight: 500; letter-spacing: .05em;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: #1f1f1f; color: var(--white); }
.btn-primary { background: var(--rose); border-color: var(--rose); color: var(--white); }
.btn-primary:hover { background: var(--rose-deep); border-color: var(--rose-deep); }
.btn-outline { background: transparent; color: var(--charcoal); border-color: var(--greige); }
.btn-outline:hover { background: var(--greige-soft); color: var(--charcoal); }
.btn-outline.is-current { border-color: var(--rose); background: var(--rose-soft); }
.btn-danger-outline { background: transparent; color: var(--danger); border-color: #E3B7B4; }
.btn-danger-outline:hover { background: #FBEFEE; color: var(--danger); }
.btn-sm { min-height: 34px; padding: 4px 14px; font-size: .84rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--rose-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- forms ---------- */
.form-row { margin: 0 0 16px; }
.form-row > label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], input:not([type]), select, textarea {
  width: 100%; max-width: 100%;
  padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--greige); border-radius: 8px;
  background: var(--white); color: var(--charcoal);
  font: inherit; font-size: 16px; /* iOS のズーム防止 */
}
textarea { resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, .linklike:focus-visible {
  outline: 2px solid var(--rose); outline-offset: 2px; border-color: var(--rose);
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--rose); vertical-align: -3px; margin-right: 6px; }
input[type="file"] { font-size: .85rem; max-width: 100%; }
.input-short { max-width: 160px; }
.input-code { font-size: 1.5rem; letter-spacing: .4em; text-align: center; max-width: 240px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: .85rem; margin: .3em 0 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form-inline-grid { display: grid; gap: 0 16px; align-items: end; }
.form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-inline input, .form-inline select { width: auto; min-width: 140px; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.inline-form select { width: auto; min-height: 34px; padding: 4px 8px; font-size: .88rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.danger-zone { margin-top: 12px; text-align: right; }
.counter { display: block; text-align: right; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.counter.is-over { color: var(--danger); }
details.inline-details { margin: 10px 0; }
details.inline-details > summary { cursor: pointer; color: var(--rose-deep); font-size: .9rem; }
details.inline-details[open] > summary { margin-bottom: 10px; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 1px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 500; line-height: 1.8; letter-spacing: .03em;
  background: var(--greige-soft); color: var(--charcoal); white-space: nowrap;
}
.badge-empty, .badge-closed, .badge-muted { background: var(--greige-soft); color: var(--muted); }
.badge-draft, .badge-open_private { background: #F3ECE2; color: #7A5B36; }
.badge-submitted { background: #E7EEF5; color: #3E5A78; }
.badge-approved { background: #EAF2EC; color: #3F6B4E; }
.badge-returned { background: #FBEAE8; color: #8A3A36; }
.badge-public, .badge-open_public { background: var(--rose-soft); color: var(--rose-deep); }
.badge-important { background: var(--bronze); color: var(--white); }
.badge-today { background: var(--bronze); color: var(--white); }
.badge-me { background: var(--charcoal); color: var(--white); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--greige-soft); text-align: left; vertical-align: top; }
.table th { font-weight: 500; font-size: .8rem; color: var(--muted); background: #FCFBF9; white-space: nowrap; }
.table tr.is-inactive td { opacity: .55; }
.table tr.is-error td { background: #FDF5F4; }
.table td.ua { max-width: 260px; font-size: .75rem; color: var(--muted); word-break: break-all; }
.table td.detail { max-width: 360px; font-size: .78rem; word-break: break-all; }
.diff-before { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.2); }
.diff-after { background: #FFF8EC; }
.kv { display: grid; grid-template-columns: 7.5em 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.pager { display: flex; justify-content: center; gap: 16px; margin: 16px 0; font-size: .9rem; }

/* ---------- auth ---------- */
.auth-main { max-width: 440px; margin: 0 auto; padding: 40px 16px 48px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-logo { width: 190px; }
.auth-sub { font-family: var(--serif); color: var(--muted); letter-spacing: .3em; font-size: .85rem; margin: 6px 0 0; }
.auth-card { padding: 24px 20px; }
.auth-card .h2 { text-align: center; }
.auth-link { text-align: center; margin: 16px 0 0; font-size: .9rem; }
.auth-body.is-admin .auth-sub { color: var(--bronze); }

/* ---------- participant layout ---------- */
.p-header { position: sticky; top: 0; z-index: 100; background: rgba(250, 248, 245, .96); border-bottom: 1px solid var(--greige-soft); backdrop-filter: blur(6px); }
.p-header-inner { max-width: 960px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--charcoal); }
.brand-logo { height: 34px; width: auto; }
.brand-sub { font-family: var(--serif); font-size: .78rem; letter-spacing: .25em; color: var(--muted); }
.menu-toggle { width: 44px; height: 44px; border: 0; background: none; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; cursor: pointer; border-radius: 8px; }
.menu-bar { display: block; width: 22px; height: 2px; background: var(--charcoal); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.p-nav { display: none; border-top: 1px solid var(--greige-soft); background: var(--ivory); }
.p-nav.is-open { display: block; }
.p-nav ul { list-style: none; margin: 0 auto; padding: 4px 16px 12px; max-width: 960px; }
.p-nav li a, .p-nav li .linklike { display: block; padding: 12px 4px; color: var(--charcoal); text-decoration: none; border-bottom: 1px solid var(--greige-soft); width: 100%; text-align: left; }
.p-nav li:last-child .linklike { border-bottom: 0; color: var(--muted); }
.p-nav a[aria-current="page"] { color: var(--rose-deep); font-weight: 500; }
.p-nav-me { max-width: 960px; margin: 0 auto; padding: 12px 20px 0; font-size: .88rem; }
.p-nav-no { font-family: var(--serif); font-weight: 700; color: var(--rose-deep); }
.p-nav-program { display: block; font-size: .78rem; color: var(--muted); }
.p-program-bar { max-width: 960px; margin: 0 auto; padding: 0 16px 8px; }
.p-program-bar select { min-height: 38px; padding: 4px 10px; font-size: 15px; border-color: var(--rose); background: var(--white); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.p-main { max-width: 960px; margin: 0 auto; padding: 16px 16px 72px; }
.p-footer { text-align: center; font-size: .75rem; color: var(--greige); padding: 16px 16px 48px; }
.back-link { font-size: .9rem; margin: 4px 0 12px; }
.back-link a { text-decoration: none; }

/* home */
.hero { padding: 12px 2px 8px; }
.hero-program { font-size: .8rem; color: var(--bronze); letter-spacing: .12em; margin: 0; }
.hero-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: .2em 0 .6em; }
.topics { list-style: none; margin: 0; padding: 0; }
.topic { border-bottom: 1px solid var(--greige-soft); }
.topic:last-child { border-bottom: 0; }
.topic summary { cursor: pointer; padding: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; list-style: none; }
.topic summary::-webkit-details-marker { display: none; }
.topic-date { font-size: .8rem; color: var(--muted); }
.topic-title { font-weight: 500; }
.topic.is-important .topic-title { color: var(--charcoal); }
.topic-body { padding: 0 0 12px; font-size: .92rem; }
/* HOT TOPICS：開ける項目であることが分かる表示（右端に「詳細を見る ›」、開くと「閉じる」） */
.topic summary { align-items: center; border-radius: 8px; transition: background .15s; padding-right: 4px; }
.topic summary:hover { background: #FBF8F4; }
.topic summary:hover .topic-title { color: var(--rose-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(169, 104, 119, .4); }
.topic summary:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.topic-title { flex: 1 1 auto; min-width: 0; }
.topic-more { margin-left: auto; flex: 0 0 auto; font-size: .75rem; color: var(--rose-deep); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.topic-more::before { content: "詳細を見る"; }
.topic-more::after { content: "›"; font-size: 1.15rem; line-height: 1; transition: transform .2s; display: inline-block; }
.topic details[open] .topic-more::before { content: "閉じる"; }
.topic details[open] .topic-more::after { transform: rotate(90deg); }

/* 顔写真（個別プロフィールのみ） */
.face-photo { float: right; margin: 0 0 8px 12px; padding: 0; border: 1px solid var(--greige-soft); border-radius: 50%; overflow: hidden; width: 84px; height: 84px; background: var(--greige-soft); cursor: zoom-in; }
.face-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face-photo-own { width: 140px; height: 140px; border-radius: 50%; overflow: hidden; border: 1px solid var(--greige-soft); margin-bottom: 12px; }
.face-photo-own img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-head::after { content: ""; display: block; clear: both; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.quick-link { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 72px; padding: 12px; background: var(--white); border: 1px solid var(--greige-soft); border-radius: var(--radius); color: var(--charcoal); text-decoration: none; font-size: .9rem; font-weight: 500; box-shadow: var(--shadow); }
.quick-link:hover { border-color: var(--rose); color: var(--rose-deep); }
.notice-prohibit { font-size: .78rem; line-height: 1.7; color: #6B5A4B; background: #F6F1EA; border-left: 3px solid var(--bronze); border-radius: 6px; padding: 10px 12px; margin: 0 0 16px; }
.notice-box { background: var(--rose-soft); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: .9rem; }

/* schedule */
.schedule-day.is-today { border-color: var(--bronze); }
.schedule-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.schedule-label { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--rose-deep); letter-spacing: .08em; }
.schedule-date { font-weight: 500; }
.schedule-venue { font-size: .9rem; color: var(--muted); margin: 2px 0 10px; }
.schedule-venue::before { content: "場所："; }
.schedule-note { font-size: .88rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 4.8em 1fr; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--greige-soft); }
.timeline li:first-child { border-top: 0; }
.timeline-time { font-family: var(--serif); font-weight: 600; color: var(--bronze); white-space: nowrap; }
.timeline-body p { margin: 2px 0 0; font-size: .88rem; color: #555; }

/* members */
.member-group { margin-bottom: 20px; }
.member-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.member-card {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  min-height: 92px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--greige-soft); border-radius: var(--radius);
  color: var(--charcoal); text-decoration: none; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.member-card:hover { border-color: var(--rose); color: var(--charcoal); }
.member-card.is-me { background: #FDFBF8; border-style: dashed; }
.member-no { font-family: var(--serif); font-weight: 700; font-size: .9rem; color: var(--rose-deep); letter-spacing: .06em; }
.member-name { font-weight: 500; font-size: 1.02rem; line-height: 1.5; word-break: break-all; }
.member-line { font-size: .78rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.member-card .badge-me { position: absolute; top: 10px; right: 10px; }
.fav-mark { position: absolute; right: 12px; bottom: 8px; color: var(--rose); font-size: .95rem; }

/* profile */
.profile-head { padding-top: 22px; }
.profile-id { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.profile-no { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--rose-deep); letter-spacing: .06em; }
.profile-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin: 0; }
.fav-form { margin: 0 0 12px; }
.fav-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--greige); background: var(--white); color: var(--charcoal); font: inherit; font-size: .88rem; cursor: pointer; }
.fav-btn.is-on { border-color: var(--rose); color: var(--rose-deep); background: var(--rose-soft); }
.fav-star { color: var(--rose); font-size: 1.1rem; line-height: 1; }
.profile-dl { margin: 0; }
.profile-dl-row { padding: 10px 0; border-top: 1px solid var(--greige-soft); }
.profile-dl-row:first-child { border-top: 0; }
.profile-dl dt { font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.profile-dl dd { margin: 0; font-size: 1rem; word-break: break-word; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumbs-sm { grid-template-columns: repeat(auto-fill, minmax(80px, 96px)); }
.thumb { display: block; padding: 0; border: 1px solid var(--greige-soft); border-radius: 10px; overflow: hidden; background: var(--greige-soft); cursor: zoom-in; aspect-ratio: 1 / 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-admin { text-align: center; }
/* プロフィール画像カード：タイトル＋画像（縦横比を保って全体を表示）＋補足 */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pcard { margin: 0; }
.pcard-title { font-size: .85rem; color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
/* 画像そのものには枠線・背景を付けない（縦長・横長とも元の縦横比のまま表示し、画像の角だけ丸める） */
.pcard-img { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; max-width: 100%; }
.pcard-img img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; border-radius: 10px; }
.pcard-img-sm img { max-height: 120px; }
.pcard-caption { margin: 6px 0 0; font-size: .92rem; word-break: break-word; }
.pcard-own { max-width: 320px; margin-bottom: 12px; }
/* 画像選択時のプレビュー（保存前）：現在の画像と区別できるよう点線枠 */
.preview-label { font-size: .82rem; font-weight: 500; margin: 8px 0 4px; }
.pcard-preview { margin-top: 8px; }
.pcard-preview .pcard-img { cursor: default; }
.memo-card { background: #FDFBF8; border-style: dashed; }
.self-edit-cta { max-width: 420px; margin: 24px auto 8px; }
.memo-card textarea { margin-bottom: 10px; }

/* self profile */
.block-list { list-style: none; margin: 0; padding: 0; }
.block-item { padding: 12px 0; border-top: 1px solid var(--greige-soft); }
.block-item:first-child { border-top: 0; }
.block-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.block-name { font-weight: 500; }
.return-comment { background: #FBEFEE; border-radius: 8px; padding: 8px 12px; font-size: .88rem; color: #8A3A36; }

/* watermark：閲覧者の管理No.（スクリーンショットにも残るよう画面上に重ねる） */
.wm {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background-image: url("../../watermark.svg");
  background-repeat: repeat; background-size: 300px 200px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.wm-badge {
  position: fixed; z-index: 901; pointer-events: none;
  right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  padding: 1px 8px; border-radius: 999px;
  background: rgba(250, 248, 245, .82); border: 1px solid rgba(184, 173, 164, .45);
  color: rgba(51, 51, 51, .55);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; line-height: 1.8; letter-spacing: .06em;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

/* ---------- ORIME Viewer（スマートフォン優先・閲覧専用） ---------- */
.vwm { position: fixed; inset: 0; z-index: 900; pointer-events: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.vwm svg { display: block; width: 100%; height: 100%; }
.vwm-badge { max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-header { position: sticky; top: 0; z-index: 100; background: rgba(250, 248, 245, .96); border-bottom: 1px solid var(--greige-soft); }
.v-header-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v-brand { text-decoration: none; color: var(--charcoal); font-family: var(--serif); font-weight: 700; letter-spacing: .04em; }
.v-brand-no { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; color: var(--rose-deep); margin-left: 4px; }
.v-header-sub { max-width: 960px; margin: 0 auto; padding: 0 16px 8px; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-logout { margin: 0; }
.v-tabs { max-width: 960px; margin: 0 auto; padding: 0 12px; display: flex; gap: 4px; }
.v-tabs a { flex: 1; text-align: center; padding: 10px 4px; font-size: .88rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; min-height: 44px; }
.v-tabs a[aria-current="page"] { color: var(--rose-deep); border-bottom-color: var(--rose-deep); font-weight: 500; }
.v-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.v-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--white); border: 1px solid var(--greige-soft); border-radius: 12px; text-decoration: none; color: var(--charcoal); min-height: 56px; }
.v-list-main { line-height: 1.5; }
.v-mno { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.v-mno-line { font-size: .82rem; color: var(--muted); margin: 4px 0 8px; }
.v-footer p { margin: .3em 0; }
.checkbox-line { display: block; padding: 4px 0; font-weight: 400; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 800; background: rgba(34, 30, 28, .86); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal img { max-width: 100%; max-height: 88vh; border-radius: 8px; background: var(--white); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--charcoal); font-size: 1.4rem; cursor: pointer; }

/* ---------- admin ---------- */
.a-body { background: #F7F5F2; }
.a-header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--white); border-bottom: 1px solid var(--greige-soft); }
.a-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--charcoal); font-size: .85rem; font-weight: 700; letter-spacing: .1em; }
.a-brand span { color: var(--bronze); }
.a-logo { height: 26px; width: auto; }
.a-program-switch { flex: 1; min-width: 0; }
.a-program-switch select { min-height: 36px; padding: 4px 8px; font-size: .85rem; }
.a-layout { display: block; }
.a-nav { display: none; background: var(--white); border-bottom: 1px solid var(--greige-soft); }
.a-nav.is-open { display: block; }
.a-nav ul { list-style: none; margin: 0; padding: 8px 12px; }
.a-nav li a, .a-nav li .linklike { display: block; padding: 9px 10px; border-radius: 8px; color: var(--charcoal); text-decoration: none; font-size: .9rem; width: 100%; text-align: left; }
.a-nav li a:hover { background: var(--greige-soft); }
.a-nav a[aria-current="page"] { background: var(--rose-soft); color: var(--rose-deep); font-weight: 500; }
.a-nav-user { padding: 12px 10px 2px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--greige-soft); margin-top: 8px; }
.a-main { padding: 16px 12px 64px; min-width: 0; }
.a-title { font-size: 1.2rem; font-weight: 700; margin: 4px 0 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--white); border: 1px solid var(--greige-soft); border-radius: 10px; padding: 12px 14px; }
.stat-label { display: block; font-size: .75rem; color: var(--muted); }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.day1-table input { min-height: 38px; padding: 6px 8px; min-width: 180px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(247, 245, 242, .96); padding: 10px 0; border-top: 1px solid var(--greige-soft); }
.approval-check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.memo-body { white-space: normal; max-width: 520px; }
.import-row { border-top: 1px solid var(--greige-soft); padding: 10px 0; }
.import-row.is-error { background: #FDF5F4; }
.schedule-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.schedule-row { display: grid; grid-template-columns: 6.5em 1fr; gap: 6px; padding: 8px; background: #FCFBF9; border: 1px solid var(--greige-soft); border-radius: 8px; }
.schedule-row textarea { grid-column: 1 / -1; min-height: 38px; }
.input-time { max-width: 7em; }
.return-form { margin-top: 12px; border-top: 1px dashed var(--greige-soft); padding-top: 12px; }
.history-item .card-head { align-items: flex-start; }

/* ---------- ≥ 720px ---------- */
@media (min-width: 720px) {
  body { font-size: 15.5px; }
  .card { padding: 22px 24px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .form-inline-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .member-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-links { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .schedule-row { grid-template-columns: 7em 1fr 1.4fr; }
  .schedule-row textarea { grid-column: auto; }
  .p-main { padding-top: 24px; }
  .hero-title { font-size: 1.5rem; }
}

@media (min-width: 960px) {
  .member-grid { grid-template-columns: repeat(4, 1fr); }
  /* 参加者：PCではナビを常時表示 */
  .p-header .menu-toggle { display: none; }
  .p-nav { display: block; border-top: 0; background: transparent; }
  .p-nav-me { display: none; }
  .p-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; padding: 0 16px 10px; }
  .p-nav li a, .p-nav li .linklike { border: 0; padding: 4px 2px; font-size: .88rem; }
  .p-nav li:last-child .linklike { color: var(--muted); }
  /* 管理：サイドバー */
  .a-menu-toggle { display: none; }
  .a-program-switch { flex: 0 1 420px; }
  .a-layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 53px); }
  .a-nav { display: block; border-bottom: 0; border-right: 1px solid var(--greige-soft); }
  .a-nav ul { position: sticky; top: 53px; }
  .a-main { padding: 20px 28px 64px; }
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- 管理画面：一括操作・強制非公開・利用状況 ---------- */
.bulk-bar { padding: 8px 10px; background: #FCFBF9; border: 1px solid var(--greige-soft); border-radius: 8px; }
.hide-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--greige-soft); }
.hide-reason { min-height: 34px !important; padding: 4px 8px !important; font-size: .85rem !important; max-width: 240px; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge-updated { background: #FFF1D6; color: #8A5A00; text-decoration: none; }
a.badge-updated:hover { background: #FFE3AD; color: #6B4600; }
.photo-preview { margin-top: 10px; }

/* 利用状況：2段見出し・グループの区切り・並べ替え */
.usage-summary .stat-value small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.usage-table th, .usage-table td { white-space: nowrap; }
.usage-table th.group { text-align: center; border-bottom: 2px solid var(--greige); }
.usage-table th.group-given { background: #FCF6F7; }
.usage-table th.group-received { background: #F7F7FC; }
.usage-table .group-start { border-left: 2px solid var(--greige); }
.usage-table th.sub, .usage-table td.sub { color: #666; font-size: .82rem; }
.usage-table th.sub { font-weight: 400; }
.usage-table td.sub::before { content: "└ "; color: var(--greige); }
.usage-table th.sortable { cursor: pointer; user-select: none; }
.usage-table th.sortable:hover { color: var(--rose-deep); }
.usage-table .sort-ind::after { content: " ⇅"; color: var(--greige); font-size: .75rem; }
.usage-table th[aria-sort="ascending"] .sort-ind::after { content: " ▲"; color: var(--rose-deep); }
.usage-table th[aria-sort="descending"] .sort-ind::after { content: " ▼"; color: var(--rose-deep); }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover { color: var(--rose-deep); }

/* ---------- 管理画面：お気に入り相関図 ---------- */
.rel-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; font-size: .85rem; }
.rel-key::before { content: ""; display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.rel-key-mf::before { border-color: #3B7BC8; }
.rel-key-fm::before { border-color: #E8742A; }
.rel-key-mutual::before { border-color: #E0559A; border-top-width: 5px; }
.rel-card { padding: 8px; }
.rel-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 横幅100%に拡大縮小（男女各20名程度がPC幅に収まる）。タブレット以下の狭い幅では横スクロール */
.rel-svg { display: block; margin: 0 auto; width: 100%; height: auto; min-width: 900px; max-width: 1500px; font-family: var(--sans); }
.rel-bg { fill: transparent; }
.rel-row-label { font-size: 13px; fill: var(--muted); }
.rel-arrow-mutual { fill: #E0559A; }
.rel-line { stroke-width: 1.6; opacity: .55; transition: opacity .15s, stroke-width .15s; }
.rel-mf { stroke: #3B7BC8; }
.rel-fm { stroke: #E8742A; }
.rel-mutual { stroke: #E0559A; stroke-width: 3.5; opacity: .85; }
.rel-arrow-mf { fill: #3B7BC8; }
.rel-arrow-fm { fill: #E8742A; }
.rel-node { cursor: pointer; outline: none; }
.rel-node circle { stroke-width: 2; transition: opacity .15s; }
.rel-node-f circle { fill: #FBE9EC; stroke: var(--rose); }
.rel-node-m circle { fill: #E8F0FA; stroke: #3B7BC8; }
.rel-no { font-size: 10px; font-weight: 700; text-anchor: middle; fill: var(--charcoal); pointer-events: none; }
.rel-name { font-size: 10.5px; text-anchor: middle; fill: var(--charcoal); pointer-events: none; }
.rel-svg.is-focus .rel-line { opacity: .07; }
.rel-svg.is-focus .rel-line.is-hl { opacity: 1; stroke-width: 3; }
.rel-svg.is-focus .rel-mutual.is-hl { stroke-width: 5; }
.rel-svg.is-focus .rel-node { opacity: .3; }
.rel-svg.is-focus .rel-node.is-hl { opacity: 1; }
.rel-node.is-selected circle { stroke-width: 4; }

/* ---------- 管理画面：相関図 匿名モード（キャプチャ素材用） ---------- */
.anon-toolbar { align-items: center; }
/* 背景・ノードの塗りは SVG 内のグラデーション（fill 属性）で指定するため、ここでは fill を上書きしない */
.anon-card { background: #FCF8F5; border: 1px solid var(--greige-soft); border-radius: var(--radius); padding: 0; overflow: hidden; }
.anon-svg { display: block; width: 100%; height: auto; font-family: var(--sans); }
/* 段ラベル：細い枠の小さなピル */
.anon-label rect { fill: #FFFFFF; fill-opacity: .75; stroke-width: 1; }
.anon-label text { font-family: var(--serif); font-size: 15px; letter-spacing: .18em; text-anchor: middle; }
.anon-label-f rect { stroke: #E3B9C3; }
.anon-label-f text { fill: #B9798A; }
.anon-label-m rect { stroke: #B9CDE6; }
.anon-label-m text { fill: #6F8FB8; }
/* 片思い：細く半透明＋小さな矢印（背景に溶け込む程度） */
.anon-oneway line { stroke: #8E7F99; stroke-width: 1.2; stroke-opacity: .30; }
/* 両想い：淡いグロー → 白縁 → 太く濃いピンク（両端に矢印） */
.anon-mutual-glow line { stroke: #F06BA8; stroke-width: 14; stroke-linecap: round; stroke-opacity: .45; }
.anon-mutual-edge line { stroke: #FFFFFF; stroke-width: 9; stroke-linecap: round; }
.anon-mutual line { stroke: #D94489; stroke-width: 4.5; stroke-linecap: round; }
.anon-node-f { stroke: #FFFFFF; stroke-width: 2; }
.anon-node-m { stroke: #FFFFFF; stroke-width: 2; }
.anon-time { font-size: 13px; fill: #A39790; text-anchor: end; letter-spacing: .04em; }

/* ---------- TEST環境の固定帯（env = test のときだけ出力される） ---------- */
.env-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(-45deg, #E8590C 0 16px, #1F1F1F 16px 32px);
  color: #FFFFFF; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  border-bottom: 2px solid #E8590C;
  pointer-events: none;
}
body.is-test-env { padding-top: 30px; }
body.is-test-env .p-header,
body.is-test-env .a-header { top: 30px; }
@media (min-width: 960px) {
  body.is-test-env .a-nav ul { top: 83px; }
}

@media print {
  .p-header, .a-header, .a-nav, .p-footer, .modal { display: none !important; }
}
