:root {
  --mark-no: #26232a;
  --red: #d60234;
  --red-dark: #ab0229;
  --red-hover: var(--red-dark);
  --red-pale: #fcE9ed;
  --navy: #2b3a66;
  --navy-dark: #22305a;
  --ink: #26232a;
  --muted: #8b8590;
  --bg: #f6f4f2;
  --card: #ffffff;
  --line: #e8e4e0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--red); text-decoration: none; }

.site-header { position: sticky; top: 0; z-index: 50; }
.topbar { display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: #fff; padding: 12px 16px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .05em; line-height: 1.2; min-width: 0; }
@media (max-width: 480px) { .topbar .brand { font-size: 15px; letter-spacing: .02em; } }
.topbar .brand img, .topbar .brand svg { width: 46px; height: 46px; display: block; margin: -11px 0; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 999px; opacity: .85; }
.topbar nav a:hover { background: rgba(255,255,255,.15); opacity: 1; }
.nav-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 999px; padding: 0 4px; }
.hscroll-wrap { overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.hscroll-wrap::-webkit-scrollbar { display: none; }
@media (max-width: 760px) {
  .answers:not(.sched-matrix):not(.static) { display: block; overflow-x: auto; }
  .hscroll-wrap > .answers:not(.sched-matrix) { display: table; overflow: hidden; }
  .topbar nav { gap: 0; }
  .topbar nav a .nav-label { display: none; }
  .topbar nav a { font-size: 17px; padding: 8px 11px; opacity: 1; }
  .topbar .brand { font-size: 15px; }
  .nav-badge { top: -2px; right: 0; }
}

.container { max-width: 720px; margin: 0 auto; padding: 18px 14px 70px; }
.home-cols > div { min-width: 0; }
/* 折りたたみカード（ガゼボから移植） */
details.fold { background: var(--card); border-radius: 16px; box-shadow: 0 2px 12px rgba(70,60,40,.07); padding: 0 14px; margin: 14px 0; }
details.fold summary { list-style: none; cursor: pointer; padding: 13px 0; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
details.fold summary i { color: var(--red); }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-left: auto; font-size: 12px; color: var(--muted); transition: transform .2s; }
details.fold[open] summary::after { transform: rotate(180deg); }
details.fold[open] { padding-bottom: 14px; }
details.fold > *:not(summary) { margin-left: 0; margin-right: 0; }
details.fold h2 { margin-top: 16px; }
details.fold .invite-box { border-color: var(--line); }
@media (min-width: 1000px) {
  .container { max-width: 960px; }
  .home-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
  .sched-sub { display: inline-block; margin-right: 12px; }
  .calendar td { height: 86px; font-size: 12px; }
  .admin-actions.add-event { justify-content: flex-end; }
  .admin-actions.add-event a { flex: 0 0 auto; padding: 7px 16px; font-size: 13px; }
}
h1 { font-size: 20px; margin: 6px 0 14px; letter-spacing: .02em; }
h2 { font-size: 14px; margin: 26px 0 10px; color: var(--ink); letter-spacing: .06em; border-left: 3px solid var(--red); padding-left: 9px; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 13px; }
.flash { background: var(--red-pale); border: 1px solid var(--red); color: var(--red-dark); padding: 9px 13px; border-radius: 10px; margin: 12px 0; font-size: 14px; }

/* バッジ：意味で5種類。色は必ずここで決め、画面側で style を書かない（Gazebo・MATCHDAY と共通） */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.6; padding: 2px 10px; border-radius: 999px; font-weight: 800; margin-left: 4px; white-space: nowrap; vertical-align: middle; border: 1px solid transparent; }
.badge.ok,     .badge.done      { background: #e6f2ea; color: #2f6b49; border-color: #cfe4d8; }  /* 良好・完了 */
.badge.wait,   .badge.todo      { background: #fdefdc; color: #9a5a00; border-color: #f3dcbb; }  /* 待ち・未完了 */
.badge.warn,   .badge.nocon     { background: #fdeceb; color: #b3261e; border-color: #f3c9c5; }  /* 注意・要対応 */
.badge.info,   .badge.acct-parent { background: #eaf0f8; color: #2b4a8a; border-color: #d3dff0; } /* 情報・属性 */
.badge.mute,   .badge.cancel    { background: #efedea; color: #857f79; border-color: #e2ded9; }  /* 無効・対象外 */
.badge.acct-self { background: #e6f2ea; color: #2f6b49; border-color: #cfe4d8; }
/* LINE連携だけは LINE の色を使う（一目で分かるように） */
.badge.line-on  { background: #06c755; color: #fff; border-color: #06c755; }
.badge.line-on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.badge.line-off { background: #fff; color: #857f79; border-color: #ddd8d2; }
.badge.line-off::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d8d3ce; }

.cal-nav { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.cal-nav a { font-size: 13px; font-weight: 600; padding: 5px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.cal-nav strong { font-size: 16px; letter-spacing: .05em; }

.calendar { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); table-layout: fixed; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calendar th { font-size: 11px; padding: 6px 0; background: #faf8f7; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.calendar td { height: 66px; padding: 3px; font-size: 11px; vertical-align: top; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.calendar td:last-child { border-right: 0; }
.calendar tr:last-child td { border-bottom: 0; }
.calendar td .d { font-size: 11px; color: var(--muted); font-weight: 600; }
.calendar td.today { background: var(--red-pale); }
.calendar td.today .d { color: var(--red); }
.calendar th.sun, .calendar td.sun .d { color: #d0455e; }
.calendar th.sat, .calendar td.sat .d { color: #4a76c9; }
.calendar td.empty { background: #faf8f7; }

.ev { display: block; border-radius: 5px; padding: 1px 4px; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.ev[style*="--evc"] { background: color-mix(in srgb, var(--evc) 16%, #fff); color: var(--evc); }
.ev.et-practice { background: #e7f3ea; color: #2e6d3c; }
.ev.et-game { background: #fbe3e9; color: #b81b44; }
.ev.et-practice_game { background: #fdefdc; color: #a96410; }
.ev.et-meeting { background: #ece7f8; color: #5f43a8; }
.ev.et-other { background: #e5eef8; color: #34659e; }
.ev.cancelled { background: #eeece9 !important; color: #a29c96 !important; text-decoration: line-through; }
.list .ev, h1 .ev, .legend .ev { display: inline-block; border-radius: 5px; padding: 0 7px; font-size: 11px; }
.list .ev, .list .att-mark, .list .badge { vertical-align: middle; position: relative; top: -1px; }
.legend { margin: 8px 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.calendar .ev { white-space: normal; word-break: break-all; line-height: 1.25; }
.calendar td { height: auto; min-height: 66px; }

.hscroll-track { display: none; height: 4px; background: var(--line); border-radius: 2px; margin: 6px 2px 12px; position: relative; cursor: pointer; touch-action: none; }
.hscroll-track .hscroll-thumb { position: absolute; top: -3px; height: 10px; background: var(--muted); background-clip: content-box; padding: 3px 0; border-radius: 5px; cursor: grab; }

.list { list-style: none; }
.list li { border-bottom: 1px solid var(--line); padding: 11px 0; }
.list li:last-child { border-bottom: none; }
.list.upcoming li { font-size: 14px; }
.detail { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.detail dt { font-size: 11px; color: var(--muted); margin-top: 10px; letter-spacing: .05em; }
.detail .dt { font-size: 11px; color: var(--muted); letter-spacing: .05em; font-weight: 600; }
.detail dt:first-child { margin-top: 0; }
.detail dd { font-size: 15px; }

.answer-form, .survey-form fieldset, fieldset { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 15px; margin: 14px 0; min-inline-size: 0; min-width: 0; max-width: 100%; }
html, body { overflow-x: clip; overflow-y: visible; max-width: 100%; overscroll-behavior-x: none; }
input[type=file] { display: block; width: 100%; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.answer-btns { display: flex; gap: 8px; margin-bottom: 12px; }
.answer-btns .ans { flex: 1; text-align: center; border: 2px solid var(--line); border-radius: 10px; padding: 11px 0; cursor: pointer; font-weight: 700; background: #fff; color: var(--ink); }
.answer-btns .ans input { display: none; }
.answer-btns .ans.selected, .answer-btns .ans:has(input:checked) { border-color: var(--red); background: var(--red-pale); color: var(--red-dark); }

input[type=text], input[type=url], input[type=search], input[type=tel], input[type=number], input[type=email], input[type=date], input[type=month], input[type=time], input[type=datetime-local], textarea, select { width: 100%; padding: 9px 10px; border: 1px solid #d8d3ce; border-radius: 8px; font-size: 16px; margin-bottom: 10px; background: #fff; color: var(--ink); }
@media (min-width: 701px) {
  input[type=text], input[type=url], input[type=search], input[type=tel], input[type=number], input[type=email], input[type=date], input[type=month], input[type=time], input[type=datetime-local], textarea, select { font-size: 14px; }
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--red-pale); border-color: var(--red); }
input[type=date], input[type=month], input[type=time], input[type=datetime-local] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; min-height: 42px; }
label { font-size: 13px; color: #55505b; font-weight: 600; }

button { background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 12px; width: 100%; font-size: 15px; font-weight: 700; cursor: pointer; letter-spacing: .04em; }
button:hover { background: var(--red-hover); }
button.secondary { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
button.secondary:hover { background: var(--red-pale); }
button.danger { background: #fff; color: #b3261e; border: 1.5px solid #d8d3ce; }
button.danger:hover { background: #fbe9e7; }

.att-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.att-tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 10px 4px 8px; }
.att-tile .n { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; }
.att-tile .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.att-tile.t-yes .n { color: #2e9e4f; }
.att-tile.t-no .n { color: var(--mark-no); }
.att-tile.t-maybe .n { color: #f08300; }
.att-tile.t-none .n { color: var(--red); }
.answers { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.answers th { background: #faf8f7; font-size: 12px; text-align: left; padding: 8px; color: #55505b; border-bottom: 1px solid var(--line); white-space: nowrap; }
.answers td { border-bottom: 1px solid #f1eeeb; padding: 9px 8px; font-size: 14px; }
.answers tr:last-child td { border-bottom: 0; }
.answers .mark { width: 34px; text-align: center; font-weight: 800; }
.att-mark { display: inline-block; width: 27px; height: 27px; line-height: 27px; text-align: center; border-radius: 6px; color: #fff; font-weight: 800; font-size: 15px; -webkit-text-stroke: 1.2px #fff; }
.answer-btns .ans > span { -webkit-text-stroke: 1px currentColor; margin-right: 7px; }
.att-summary .l, .sched-matrix td span[style*="color:#2e9e4f"], .sched-matrix td span[style*="color:#f08300"], .sched-matrix td span[style*="mark-no"] { -webkit-text-stroke: .6px currentColor; }
.sched-matrix th, .sched-matrix td { white-space: nowrap; }
.sched-matrix .sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; }
.sched-matrix th.sticky-col { background: #faf8f7; }
.proxy-btn { width: auto; text-align: center; padding: 6px 12px; font-size: 12px; background: #fff; color: #55505b; border: 1px solid #d8d3ce; border-radius: 6px; margin-left: 3px; font-weight: 700; }
.proxy-btn:hover { background: var(--red-pale); color: var(--red); border-color: var(--red); }
.proxy-mark { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: 13px; line-height: 1; background: #fff; color: #55505b; border: 1px solid #d8d3ce; border-radius: 6px; margin-left: 3px; font-weight: 700; }
.proxy-mark:hover { background: var(--red-pale); color: var(--red); border-color: var(--red); }
.att-mark.yes { background: #2e9e4f; }
.att-mark.no { background: #26232a; }
.att-mark.maybe { background: #f08300; }
.mark-yes { color: #2e9e4f; }
.mark-maybe { color: #f08300; }
.mark-no { color: var(--mark-no); }

legend { float: left; width: 100%; font-weight: 700; padding: 0; margin-bottom: 10px; font-size: 14px; }
fieldset > legend + * { clear: both; }
fieldset::after { content: ""; display: block; clear: both; }
.opt { display: block; padding: 6px 0; font-weight: 500; }

.login-wrap { text-align: center; padding: 90px 20px; }
.login-wrap .logo-mark { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 18px; display: block; }
.login-wrap h1 { font-size: 26px; letter-spacing: .12em; color: var(--red); }

.title-row { display: flex; align-items: flex-start; gap: 8px; }
.title-row h1 { flex: 1; }
.kebab-wrap { position: relative; flex-shrink: 0; }
.kebab { width: 38px; height: 34px; padding: 0; background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; font-size: 15px; }
.kebab:hover { background: #faf8f7; }
.dropdown { display: none; position: absolute; right: 0; top: 40px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1); min-width: 200px; z-index: 20; overflow: hidden; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 11px 15px; background: none; color: var(--ink); font-size: 14px; font-weight: 600; border: 0; border-radius: 0; border-bottom: 1px solid #f1eeeb; letter-spacing: 0; }
.dropdown a:hover, .dropdown button:hover { background: #faf8f7; }
.dropdown form { margin: 0; }
.dropdown a:last-child, .dropdown form:last-child button { border-bottom: 0; }
.dropdown .danger-item { color: #b3261e; }
.dropdown i { width: 18px; text-align: center; margin-right: 4px; color: var(--muted); }
.dropdown .danger-item i { color: #b3261e; }
.lu-set { background: #fff; color: var(--ink); border: 1px solid #e8e4e0; border-radius: 12px; padding: 12px 14px; margin: 12px 0; position: relative; }
.lu-title { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.lu-court { background: #eef4ee; border: 1px solid #d8e2d8; border-radius: 10px; padding: 8px 4px 12px; }
.lu-net { background: var(--navy); color: #fff; text-align: center; font-size: 10px; letter-spacing: .4em; border-radius: 4px; padding: 2px 0; margin: 0 4px 4px; font-weight: 700; }
.lu-row { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.lu-card { width: 62px; min-height: 58px; text-align: center; background: none; color: var(--ink); border: 0; padding: 5px 2px 4px; }
.lu-card img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.lu-noicon { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: #e8e4e0; color: #b6b0aa; align-items: center; justify-content: center; }
.lu-help { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; font-size: 9px; font-weight: 800; color: var(--red); border: 1.5px solid var(--red); border-radius: 50%; padding: 0; }
.lu-name { font-size: 11px; font-weight: 700; line-height: 1.2; margin-top: 2px; word-break: break-all; }
.lu-serve { font-size: 12px; margin-top: 8px; line-height: 1.7; }
.lu-note { font-size: 12px; color: #8a5200; background: #fdefdc; border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.member-card-link { display: block; color: inherit; }
.member-card-link:hover .mcx { box-shadow: 0 6px 18px rgba(10,16,38,.6); }
.mcx { background: linear-gradient(150deg, #46589a, #22305a 55%, #141d38); border-radius: 13px; padding: 8px; aspect-ratio: 63 / 88; display: flex; box-shadow: 0 4px 14px rgba(10,16,38,.45); }
.mcx-in { flex: 1; display: flex; flex-direction: column; background: linear-gradient(170deg, #2e3c6e, #1d2947); border: 1px solid rgba(255,255,255,.18); border-radius: 7px; overflow: hidden; text-align: center; position: relative; }
.mcx-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 7px 10px 5px; }
.mcx-name { font-weight: 800; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.mcx-num { font-weight: 900; font-size: 19px; color: #ff2d5e; font-style: italic; flex-shrink: 0; }
.mcx-art { position: relative; flex: 1; margin: 0 7px; border: 1.5px solid rgba(255,255,255,.25); border-radius: 5px; background: radial-gradient(circle at 50% 34%, #3f4f8c, #1a2440 82%); display: flex; align-items: center; justify-content: center; min-height: 110px; overflow: hidden; }
.mcx-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.18) 50%, transparent 58%); pointer-events: none; }
.mcx-avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; display: block; border: 3px solid rgba(255,255,255,.9); box-shadow: 0 3px 12px rgba(0,0,0,.5); margin-bottom: 26px; }
.mcx-avatar-none { background: #3a4877; display: flex; align-items: center; justify-content: center; color: #7d89b3; font-size: 34px; }
.mcx-bday { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); background: #fff; color: #d60234; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 10px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3); z-index: 1; }
.mcx-foot { padding: 7px 6px 11px; color: #9aa5c6; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.mcx-line { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; }
.mcx-line.g-player { background: linear-gradient(90deg, #d60234, #ff2d5e); }
.mcx-line.g-coach { background: linear-gradient(90deg, #c8992a, #f0c419); }
.mcx-line.g-staff { background: linear-gradient(90deg, #0e7c66, #2dd4a8); }
.mcx-line.g-general { background: linear-gradient(90deg, #2a6fd6, #6aa8ff); }
.member-card { background: linear-gradient(150deg, #f9e49a, #e6bb3f 45%, #c8992a 90%); border-radius: 13px; padding: 8px; aspect-ratio: 63 / 88; display: flex; box-shadow: 0 4px 12px rgba(90,70,10,.28), inset 0 1px 0 rgba(255,255,255,.5); }
.mc-in { flex: 1; display: flex; flex-direction: column; background: #fdfdfa; border: 1px solid #d9cfae; border-radius: 7px; overflow: hidden; text-align: center; }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 6px 9px 4px; }
.mc-name { font-weight: 800; font-size: 13px; color: #22305a; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-num { font-weight: 800; font-size: 18px; color: #d60234; font-style: italic; flex-shrink: 0; }
.mc-art { position: relative; flex: 1; margin: 0 7px; border: 2px solid #cfc290; border-radius: 5px; background: radial-gradient(circle at 50% 32%, #ffffff, #dfe5f0 80%); display: flex; align-items: center; justify-content: center; min-height: 110px; }
.mc-art::after { content: ""; position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.55) 50%, transparent 58%); pointer-events: none; }
.mc-bday { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); background: #fff; border: 1.5px solid #d60234; color: #d60234; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 10px; white-space: nowrap; box-shadow: 0 1px 4px rgba(20,28,58,.15); z-index: 1; }
.mc-art .m-avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; display: block; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(20,28,58,.3); }
.mc-art .m-avatar-none { background: #dfe3ec; display: flex; align-items: center; justify-content: center; color: #a7aec2; font-size: 34px; }
.mc-foot { padding: 7px 6px 9px; }
.mc-foot .badge { margin-left: 0; }
.bulk-table { border-collapse: collapse; width: 100%; }
.bulk-table th, .bulk-table td { padding: 4px 6px; text-align: left; font-size: 13px; white-space: nowrap; }
.bulk-table th { color: var(--muted); font-weight: 600; border-bottom: 1px solid #ddd; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.admin-actions a, .admin-actions button { flex: 1 1 auto; min-width: 96px; text-align: center; }
.admin-actions a { background: var(--red); color: #fff; border-radius: 10px; padding: 12px 6px; font-weight: 700; font-size: 14px; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 5px; line-height: 1; }
.admin-actions a:hover { background: var(--red-dark); }

/* ===== 管理トップのボタン（PCは詰めて最小行数に） ===== */
@media (min-width: 700px) {
  .admin-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .admin-menu .am-group { display: contents; }
  .admin-menu .admin-actions a { flex: 0 0 auto; min-width: 0; padding: 8px 18px; }
}
.q-row { border: 1px dashed #d8d3ce; border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fcfbfa; }
.invite-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px; word-break: break-all; margin: 12px 0; }

/* ポジション表 編集UI */
.lu-ecourt { background: #e8f2e8; border: 2px solid #b9d4b9; border-radius: 12px; padding: 8px 6px 14px; }
.lu-ecourt .lu-net { margin: 0 4px 2px; }
.lu-erow { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
button.lu-eslot { width: 76px; min-height: 88px; background: #fff; color: #26232a; border: 1px solid #c9d6c9; border-radius: 10px; padding: 5px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 11px; letter-spacing: 0; }
button.lu-eslot:hover { background: #f7fbf7; }
button.lu-eslot:active { transform: scale(.95); }
button.lu-eslot.empty { background: rgba(255,255,255,.5); border-style: dashed; border-color: #94b894; box-shadow: none; }
button.lu-eslot.empty:hover { background: rgba(255,255,255,.8); }
.lu-eslot .pos { font-size: 9px; font-weight: 800; color: #6b8e6b; letter-spacing: .06em; }
.lu-eslot .face img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: block; }
.lu-eslot .face .lu-noicon { width: 38px; height: 38px; }
.lu-eslot .lu-plus { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; border: 1.5px dashed #94b894; color: #94b894; align-items: center; justify-content: center; }
.lu-eslot .nm { font-size: 11px; font-weight: 700; line-height: 1.2; word-break: break-all; }
.lu-eslot.empty .nm { color: #94b894; font-weight: 600; }
@media (max-width: 430px) {
  .lu-erow { gap: 5px; }
  button.lu-eslot { width: 64px; min-height: 82px; }
  .lu-eslot .face img, .lu-eslot .face .lu-noicon, .lu-eslot .lu-plus, .lu-help { width: 34px; height: 34px; }
  .lu-eslot .nm { font-size: 10px; }
}
.lu-serve-list li { display: flex; align-items: center; gap: 8px; background: #fff; color: #26232a; border: 1px solid #e8e4e0; border-radius: 10px; padding: 6px 10px; margin-top: 6px; }
.lu-serve-list li.sortable-ghost { opacity: .35; }
.lu-serve-list .sv-handle { color: #b6b0aa; padding: 10px 6px; touch-action: none; cursor: grab; }
.lu-serve-list .sv-num { font-weight: 800; color: #fff; background: var(--red); width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.lu-serve-list .sv-face img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; }
.sv-helptag { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--red); color: var(--red); font-weight: 800; font-size: 12px; align-items: center; justify-content: center; }
.lu-serve-list .sv-label { font-weight: 700; flex: 1; min-width: 50px; font-size: 14px; }
.lu-serve-list .lu-bsel { width: 104px; margin: 0; padding: 6px; font-size: 13px; flex-shrink: 0; }
.lu-backdrop { position: fixed; inset: 0; background: rgba(38,35,42,.5); z-index: 60; }
.lu-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: #fff; border-radius: 16px 16px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 72vh; overflow-y: auto; box-shadow: 0 -4px 24px rgba(0,0,0,.25); }
@media (min-width: 700px) { .lu-sheet { left: 50%; right: auto; bottom: 6vh; transform: translateX(-50%); width: 640px; border-radius: 16px; } }
.lu-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
button.lu-sheet-close { width: auto; background: none; color: var(--muted); border: 0; font-size: 20px; padding: 4px 10px; }
button.lu-sheet-close:hover { background: var(--bg); }
.lu-sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
button.lu-chip { display: flex; flex-direction: column; align-items: center; gap: 5px; background: #fff; color: #26232a; border: 1.5px solid #e8e4e0; border-radius: 10px; padding: 9px 4px; font-size: 12px; font-weight: 700; width: auto; letter-spacing: 0; line-height: 1.2; }
button.lu-chip:hover { background: var(--bg); }
button.lu-chip img, .lu-chip-face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.lu-chip-face { display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.lu-chip-face.gray { background: #eeebe7; color: #b6b0aa; }
.lu-chip-face.helpface { border: 2px solid var(--red); color: var(--red); font-weight: 800; }
button.lu-chip.sel { border-color: var(--red); background: var(--red-pale); }
button.lu-chip.used { opacity: .35; cursor: default; }
button.lu-chip.used:hover { background: #fff; }
.lu-builder { display: grid; grid-template-columns: minmax(0, 460px) minmax(300px, 1fr); gap: 18px; }
@media (max-width: 700px) { .lu-builder { grid-template-columns: 1fr; } }
button.lu-eslot.active { border: 2px solid var(--red); box-shadow: 0 0 0 2.5px rgba(214,2,52,.3); }
.lu-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; max-height: 540px; overflow-y: auto; }
.lu-panel-head { font-size: 13px; margin-bottom: 6px; }
.lu-panel-head strong { color: var(--red); }
.lu-panel-sec { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .08em; margin: 10px 0 4px; }
.lu-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.lu-chips button.lu-chip { padding: 7px 2px; font-size: 11px; }
.lu-chips button.lu-chip img, .lu-chips .lu-chip-face { width: 34px; height: 34px; }
.lu-serve-list .sv-name { flex: 1; min-width: 60px; margin: 0; padding: 8px; font-size: 14px; }
.lu-serve-list button.sv-slot { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; font-weight: 700; width: auto; letter-spacing: 0; text-align: left; }
.lu-serve-list button.sv-slot:hover { background: #efece9; }
.lu-serve-list button.sv-slot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-serve-list button.sv-slot .ph { color: var(--muted); font-weight: 600; font-size: 12px; }
.lu-serve-list button.sv-slot img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lu-serve-list button.sv-slot .lu-chip-face { width: 26px; height: 26px; font-size: 12px; flex-shrink: 0; }
.lu-serve-list button.sv-slot .sv-helptag { flex-shrink: 0; }
.lu-serve-list button.sv-slot.active { border: 2px solid var(--red); box-shadow: 0 0 0 2px rgba(214,2,52,.2); padding: 4px 7px; }
.lu-serve-list .sv-swap { flex-shrink: 0; color: var(--muted); font-size: 11px; }
/* スマホ: コート右にサーブ順（縦）・下にベンチ→注意メモ */
.lu-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.lu-rightcol { display: contents; }
.lu-body > .lu-court { grid-column: 1; grid-row: 1; }
.lu-serve-side { grid-column: 2; grid-row: 1; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.lu-serve-side .sv-i { line-height: 1.7; font-weight: 600; }
.lu-note-side { grid-column: 1 / -1; grid-row: 3; margin-top: 0; }
.lu-bench { grid-column: 1 / -1; grid-row: 2; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.lu-bench .bp { display: inline-flex; align-items: center; gap: 4px; margin: 2px 10px 2px 0; font-size: 11px; font-weight: 700; }
.lu-bench .bp img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.lu-note-side .nt, .lu-serve-side .nt, .lu-bench .nt { font-size: 10px; font-weight: 800; letter-spacing: .1em; margin-bottom: 2px; }
.lu-serve-side .nt, .lu-bench .nt { color: var(--navy); }
@media (max-width: 700px) {
  .lu-body.has-serve .lu-card { width: 50px; min-height: 50px; padding: 4px 1px 4px; }
  .lu-body.has-serve .lu-card img, .lu-body.has-serve .lu-card .lu-noicon { width: 26px; height: 26px; }
  .lu-body.has-serve .lu-name { font-size: 9px; }
  .lu-body.has-serve .lu-row { gap: 4px; }
  .lu-serve-side .sv-i { white-space: nowrap; font-size: 11px; }
}
/* PC: コート下にベンチ横並び・右カラムに注意メモ→サーブ順（縦積み・独立フロー） */
@media (min-width: 701px) {
  .lu-body.has-side { grid-template-columns: minmax(0, 3fr) minmax(180px, 2fr); }
  .lu-body.six.has-side { grid-template-columns: minmax(0, 2fr) minmax(180px, 3fr); }
  .lu-body.has-side > .lu-court { grid-column: 1; grid-row: 1; }
  .lu-body.has-side .lu-bench { grid-column: 1; grid-row: 2; }
  .lu-body.has-side .lu-rightcol { display: flex; flex-direction: column; gap: 10px; align-items: stretch; grid-column: 2; grid-row: 1 / span 2; }
  .lu-body.six.has-side > .lu-court { grid-row: 1 / span 2; }
  .lu-body.six.has-side .lu-rightcol { grid-row: 1; }
  .lu-body.six.has-side .lu-bench { grid-column: 2; grid-row: 2; }
}
.lu-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
button.lu-panel-close { display: none; }
@media (max-width: 700px) {
  .lu-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; border-radius: 16px 16px 0 0; max-height: 55vh; box-shadow: 0 -6px 24px rgba(0,0,0,.28); transform: translateY(110%); transition: transform .22s ease; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .lu-panel.open { transform: none; }
  button.lu-panel-close { display: inline-block; width: auto; flex-shrink: 0; background: var(--navy); color: #fff; padding: 5px 16px; font-size: 12px; border-radius: 999px; }
  .lu-builder { padding-bottom: 10px; }
}

/* スマホ幅調整: コートカードは可変幅で画面内に収める */
@media (max-width: 700px) {
  .lu-court { padding: 6px 3px 10px; }
  .lu-row { gap: 4px; }
  .lu-card { flex: 1 1 0; min-width: 0; max-width: 62px; width: auto; padding: 4px 1px 4px; }
  .lu-body.has-serve { grid-template-columns: minmax(0, 1fr) minmax(92px, 38%); }
  .lu-serve-side { min-width: 0; }
  .lu-serve-side .sv-i { white-space: normal; overflow-wrap: anywhere; font-size: 11px; line-height: 1.5; margin-top: 2px; }
  .lu-body.has-serve .lu-card { max-width: 52px; }
  .lu-body.has-serve .lu-card img, .lu-body.has-serve .lu-card .lu-noicon { width: 24px; height: 24px; }
  .lu-body.has-serve .lu-name { font-size: 9px; }
  .lu-erow { gap: 4px; }
  button.lu-eslot { flex: 1 1 0; min-width: 0; width: auto; max-width: 76px; padding: 4px 1px 6px; }
}
.lu-score { position: absolute; top: 9px; right: 12px; background: var(--red); color: #fff; border-radius: 999px; padding: 3px 14px; font-size: 13px; font-weight: 900; font-style: italic; letter-spacing: .04em; box-shadow: 0 1px 4px rgba(214,2,52,.35); }
.lu-score.lose { background: #5b6472; box-shadow: 0 1px 4px rgba(70,80,100,.35); }

/* ヘッダ歯車ドロップダウン */
.topbar nav .kebab-wrap { position: relative; display: inline-flex; align-items: center; width: auto; height: auto; padding: 0; background: none; border: 0; }
.topbar nav .kebab-wrap > a { display: inline-block; }
.nav-dropdown { right: 0; top: calc(100% + 8px); }
.topbar nav .nav-dropdown a { display: block; width: 100%; white-space: nowrap; color: var(--ink); opacity: 1; font-size: 14px; font-weight: 600; padding: 11px 15px; border-radius: 0; border-bottom: 1px solid #f1eeeb; }
.topbar nav .nav-dropdown a:last-child { border-bottom: 0; }
.topbar nav .nav-dropdown a:hover { background: #faf8f7; }
.topbar nav .nav-dropdown a i { width: 18px; text-align: center; margin-right: 4px; color: var(--muted); }

.theme-picker { padding: 9px 14px 16px; border-top: 1px solid #f1eeeb; display: flex; flex-wrap: wrap; gap: 6px; }
.theme-picker .tp-label { flex: 0 0 100%; font-size: 10px; font-weight: 700; color: var(--muted); }
.theme-picker form { flex: 1 1 0; margin: 0; min-width: 0; }
button.tp-opt { appearance: none; -webkit-appearance: none; display: block; width: 100%; white-space: nowrap; text-align: center; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 2px; font-size: 11px; font-weight: 700; letter-spacing: 0; outline: none; box-shadow: none; }
button.tp-opt:hover, button.tp-opt:focus, button.tp-opt:focus-visible { background: var(--bg); outline: none; box-shadow: none; }
button.tp-opt.sel { border-color: var(--red); color: var(--red); background: var(--red-pale); }
html[data-theme="dark"] button.tp-opt { background: var(--card); }


/* ---- dark mode ---- */
html[data-theme="dark"] {
  --ink: #e9e6ea;
  --muted: #98929e;
  --bg: #14171c;
  --card: #1d222a;
  --line: #343b46;
  --navy: #1b2435;
  --navy-dark: #151d2b;
  --red: #ff5c7a;
  --red-dark: #ffb6c6;
  --red-hover: #d94060;
  --red-pale: color-mix(in srgb, var(--red) 22%, #171b21);
  --mark-no: #b8c0cc;
  color-scheme: dark;
}
html[data-theme="dark"] .calendar th,html[data-theme="dark"] .calendar td.empty,html[data-theme="dark"] .answers th,html[data-theme="dark"] .sched-matrix th.sticky-col,html[data-theme="dark"] .kebab:hover,html[data-theme="dark"] .dropdown a:hover,html[data-theme="dark"] .dropdown button:hover { background: #232933; }
html[data-theme="dark"] .answers th { color: var(--muted); }
html[data-theme="dark"] .lu-serve-side .nt,html[data-theme="dark"] .lu-bench .nt { color: var(--red); }
html[data-theme="dark"] input[type=text],html[data-theme="dark"] input[type=url],html[data-theme="dark"] input[type=search],html[data-theme="dark"] input[type=tel],html[data-theme="dark"] input[type=number],html[data-theme="dark"] input[type=email],html[data-theme="dark"] input[type=month],html[data-theme="dark"] input[type=date],html[data-theme="dark"] input[type=time],html[data-theme="dark"] input[type=datetime-local],html[data-theme="dark"] textarea,html[data-theme="dark"] select { background: #232933; border-color: #3a424e; color: var(--ink); }
html[data-theme="dark"] .answer-btns .ans,html[data-theme="dark"] button.secondary,html[data-theme="dark"] button.danger,html[data-theme="dark"] .kebab,html[data-theme="dark"] .proxy-btn,html[data-theme="dark"] .proxy-mark,html[data-theme="dark"] .sched-matrix .sticky-col,html[data-theme="dark"] .lu-set,html[data-theme="dark"] .lu-card,html[data-theme="dark"] .lu-panel,html[data-theme="dark"] .dropdown { background: var(--card); }
html[data-theme="dark"] button.danger { border-color: #3a424e; }
html[data-theme="dark"] button.danger:hover { background: #33222a; }
html[data-theme="dark"] .q-row { background: #20262e; border-color: #3a424e; }
html[data-theme="dark"] .flash { color: color-mix(in srgb, var(--red) 45%, #fff); }
html[data-theme="dark"] details.fold { box-shadow: 0 2px 12px rgba(0,0,0,.35); }
html[data-theme="dark"] .lu-note { background: #3a2d12; color: #e8b45a; }
html[data-theme="dark"] .ev.et-game { background: #47182a; color: #ff8ba8; }
html[data-theme="dark"] .ev.et-practice_game { background: #3f2c10; color: #efb35f; }
html[data-theme="dark"] .ev.et-practice { background: #163a24; color: #7fe0a4; }
html[data-theme="dark"] .ev.et-meeting { background: #2c1f4a; color: #c3aeff; }
html[data-theme="dark"] .ev.et-other { background: #16283f; color: #8ab6f0; }
html[data-theme="dark"] .ev.cancelled { background: #2a2f36 !important; color: #8a939e !important; }
html[data-theme="dark"] .ev[style*="--evc"] { background: color-mix(in srgb, var(--evc) 32%, #171b21); color: color-mix(in srgb, var(--evc) 65%, #fff); }
html[data-theme="dark"] .proxy-btn,html[data-theme="dark"] .proxy-mark { color: var(--muted); border-color: #3a424e; }
html[data-theme="dark"] .proxy-btn:hover { color: var(--red); border-color: var(--red); background: var(--red-pale); }
html[data-theme="dark"] label { color: var(--muted); }
@media (prefers-color-scheme: dark) {
html[data-theme="auto"] {
  --ink: #e9e6ea;
  --muted: #98929e;
  --bg: #14171c;
  --card: #1d222a;
  --line: #343b46;
  --navy: #1b2435;
  --navy-dark: #151d2b;
  --red: #ff5c7a;
  --red-dark: #ffb6c6;
  --red-hover: #d94060;
  --red-pale: color-mix(in srgb, var(--red) 22%, #171b21);
  --mark-no: #b8c0cc;
  color-scheme: dark;
}
html[data-theme="auto"] .calendar th,html[data-theme="auto"] .calendar td.empty,html[data-theme="auto"] .answers th,html[data-theme="auto"] .sched-matrix th.sticky-col,html[data-theme="auto"] .kebab:hover,html[data-theme="auto"] .dropdown a:hover,html[data-theme="auto"] .dropdown button:hover { background: #232933; }
html[data-theme="auto"] .answers th { color: var(--muted); }
html[data-theme="auto"] .lu-serve-side .nt,html[data-theme="auto"] .lu-bench .nt { color: var(--red); }
html[data-theme="auto"] input[type=text],html[data-theme="auto"] input[type=url],html[data-theme="auto"] input[type=search],html[data-theme="auto"] input[type=tel],html[data-theme="auto"] input[type=number],html[data-theme="auto"] input[type=email],html[data-theme="auto"] input[type=month],html[data-theme="auto"] input[type=date],html[data-theme="auto"] input[type=time],html[data-theme="auto"] input[type=datetime-local],html[data-theme="auto"] textarea,html[data-theme="auto"] select { background: #232933; border-color: #3a424e; color: var(--ink); }
html[data-theme="auto"] .answer-btns .ans,html[data-theme="auto"] button.secondary,html[data-theme="auto"] button.danger,html[data-theme="auto"] .kebab,html[data-theme="auto"] .proxy-btn,html[data-theme="auto"] .proxy-mark,html[data-theme="auto"] .sched-matrix .sticky-col,html[data-theme="auto"] .lu-set,html[data-theme="auto"] .lu-card,html[data-theme="auto"] .lu-panel,html[data-theme="auto"] .dropdown { background: var(--card); }
html[data-theme="auto"] button.danger { border-color: #3a424e; }
html[data-theme="auto"] button.danger:hover { background: #33222a; }
html[data-theme="auto"] .q-row { background: #20262e; border-color: #3a424e; }
html[data-theme="auto"] .flash { color: color-mix(in srgb, var(--red) 45%, #fff); }
html[data-theme="auto"] details.fold { box-shadow: 0 2px 12px rgba(0,0,0,.35); }
html[data-theme="auto"] .lu-note { background: #3a2d12; color: #e8b45a; }
html[data-theme="auto"] .ev.et-game { background: #47182a; color: #ff8ba8; }
html[data-theme="auto"] .ev.et-practice_game { background: #3f2c10; color: #efb35f; }
html[data-theme="auto"] .ev.et-practice { background: #163a24; color: #7fe0a4; }
html[data-theme="auto"] .ev.et-meeting { background: #2c1f4a; color: #c3aeff; }
html[data-theme="auto"] .ev.et-other { background: #16283f; color: #8ab6f0; }
html[data-theme="auto"] .ev.cancelled { background: #2a2f36 !important; color: #8a939e !important; }
html[data-theme="auto"] .ev[style*="--evc"] { background: color-mix(in srgb, var(--evc) 32%, #171b21); color: color-mix(in srgb, var(--evc) 65%, #fff); }
html[data-theme="auto"] .proxy-btn,html[data-theme="auto"] .proxy-mark { color: var(--muted); border-color: #3a424e; }
html[data-theme="auto"] .proxy-btn:hover { color: var(--red); border-color: var(--red); background: var(--red-pale); }
html[data-theme="auto"] label { color: var(--muted); }
html[data-theme="auto"] button.tp-opt { background: var(--card); }
}

html[data-theme="dark"] .answers td { border-bottom-color: #2a313b; }
html[data-theme="dark"] .dropdown a, html[data-theme="dark"] .dropdown button { border-bottom-color: #2a313b; }
html[data-theme="dark"] .theme-picker { border-top-color: #2a313b; }
html[data-theme="dark"] .att-mark.no { background: #59616e; }
html[data-theme="dark"] .answer-btns .ans:not(.selected) { color: #f2f0f4; }
@media (prefers-color-scheme: dark) {
html[data-theme="auto"] .answers td { border-bottom-color: #2a313b; }
html[data-theme="auto"] .dropdown a, html[data-theme="auto"] .dropdown button { border-bottom-color: #2a313b; }
html[data-theme="auto"] .theme-picker { border-top-color: #2a313b; }
html[data-theme="auto"] .att-mark.no { background: #59616e; }
html[data-theme="auto"] .answer-btns .ans:not(.selected) { color: #f2f0f4; }
}

/* ===== カスタム（自由配置）コート ===== */
.lu-dcourt { position: relative; width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 6 / 9; background: #eef4ee; border: 2px solid #b9d4b9; border-radius: 12px; overflow: hidden; touch-action: none; }
.lu-dcourt.lu-dcourt-6 { max-width: 340px; aspect-ratio: 1 / 1; }
.lu-dnet { position: absolute; left: 4%; right: 4%; top: 8%; height: 0; border-top: 3px dashed var(--navy); }
.lu-dattack { position: absolute; left: 4%; right: 4%; top: 38.5%; height: 0; border-top: 1.5px dashed rgba(0,0,0,.28); }
.lu-dslot { position: absolute; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; width: 60px; background: none; border: 0; padding: 0; cursor: pointer; touch-action: none; }
.lu-ddisc { position: relative; width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: #b6b0aa; font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,.15); overflow: visible; flex-shrink: 0; }
.lu-ddisc img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.lu-ddisc.helper { font-size: 9px; font-weight: 800; color: var(--red); border-color: var(--red); }
.lu-dname { background: rgba(20,20,20,.72); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 8px; white-space: nowrap; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
.lu-dname.gender-f { background: rgba(214,51,132,.82); }
.lu-dname.gender-m { background: rgba(47,127,214,.82); }
.lu-dslot.is-empty .lu-ddisc { background: rgba(255,255,255,.5); border-style: dashed; border-color: #94b894; box-shadow: none; }
.lu-dslot.is-empty .lu-dname { background: none; color: #6b8e6b; font-weight: 600; }
.lu-dslot.active .lu-ddisc { border: 2px solid var(--red); box-shadow: 0 0 0 2.5px rgba(214,2,52,.3); }
@media (max-width: 480px) {
  .lu-ddisc { width: 36px; height: 36px; }
  .lu-dname { font-size: 9px; max-width: 60px; }
}

/* ===== 性別の参考表示（バッジ＋枠線） ===== */
.g-mark { display: inline-block; font-size: 11px; font-weight: 800; margin-left: 2px; }
.g-mark.f { color: #d63384; }
.g-mark.m { color: #2f7fd6; }
.face { position: relative; display: inline-block; }
.lu-libero-badge { position: absolute; bottom: -3px; right: -3px; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 3px; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; line-height: 1; border: 1.5px solid var(--card); z-index: 2; }
.lu-gender-badge { position: absolute; top: -3px; left: -3px; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 800; line-height: 1; border: 1.5px solid var(--card); z-index: 2; }
.lu-gender-badge.f { background: #d63384; }
.lu-gender-badge.m { background: #2f7fd6; }
.am-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--line); }
.am-avatar-none { display: inline-flex; align-items: center; justify-content: center; background: #eeebe7; color: #b6b0aa; font-size: 13px; }
button.lu-chip img.gender-f, button.lu-chip .lu-chip-face.gender-f, .lu-eslot .face img.gender-f, .lu-eslot .face .lu-noicon.gender-f, .lu-card img.gender-f, .lu-card .lu-noicon.gender-f, .lu-ddisc.gender-f, .mcx-avatar.gender-f, .am-avatar.gender-f { border-color: #d63384; }
button.lu-chip img.gender-m, button.lu-chip .lu-chip-face.gender-m, .lu-eslot .face img.gender-m, .lu-eslot .face .lu-noicon.gender-m, .lu-card img.gender-m, .lu-card .lu-noicon.gender-m, .lu-ddisc.gender-m, .mcx-avatar.gender-m, .am-avatar.gender-m { border-color: #2f7fd6; }
button.lu-chip img.gender-f, button.lu-chip .lu-chip-face.gender-f, .lu-eslot .face img.gender-f, .lu-eslot .face .lu-noicon.gender-f, .lu-card img.gender-f, .lu-card .lu-noicon.gender-f { border: 2px solid #d63384; }
button.lu-chip img.gender-m, button.lu-chip .lu-chip-face.gender-m, .lu-eslot .face img.gender-m, .lu-eslot .face .lu-noicon.gender-m, .lu-card img.gender-m, .lu-card .lu-noicon.gender-m { border: 2px solid #2f7fd6; }
html[data-theme="dark"] .g-mark.f { color: #ff8fc0; }
html[data-theme="dark"] .g-mark.m { color: #7ec4ff; }
html[data-theme="dark"] button.lu-chip img.gender-f,html[data-theme="dark"] button.lu-chip .lu-chip-face.gender-f,html[data-theme="dark"] .lu-eslot .face img.gender-f,html[data-theme="dark"] .lu-eslot .face .lu-noicon.gender-f,html[data-theme="dark"] .lu-card img.gender-f,html[data-theme="dark"] .lu-card .lu-noicon.gender-f,html[data-theme="dark"] .lu-ddisc.gender-f,html[data-theme="dark"] .mcx-avatar.gender-f,html[data-theme="dark"] .am-avatar.gender-f { border-color: #ff8fc0; }
html[data-theme="dark"] button.lu-chip img.gender-m,html[data-theme="dark"] button.lu-chip .lu-chip-face.gender-m,html[data-theme="dark"] .lu-eslot .face img.gender-m,html[data-theme="dark"] .lu-eslot .face .lu-noicon.gender-m,html[data-theme="dark"] .lu-card img.gender-m,html[data-theme="dark"] .lu-card .lu-noicon.gender-m,html[data-theme="dark"] .lu-ddisc.gender-m,html[data-theme="dark"] .mcx-avatar.gender-m,html[data-theme="dark"] .am-avatar.gender-m { border-color: #7ec4ff; }
@media (prefers-color-scheme: dark) {
html[data-theme="auto"] .g-mark.f { color: #ff8fc0; }
html[data-theme="auto"] .g-mark.m { color: #7ec4ff; }
html[data-theme="auto"] button.lu-chip img.gender-f,html[data-theme="auto"] button.lu-chip .lu-chip-face.gender-f,html[data-theme="auto"] .lu-eslot .face img.gender-f,html[data-theme="auto"] .lu-eslot .face .lu-noicon.gender-f,html[data-theme="auto"] .lu-card img.gender-f,html[data-theme="auto"] .lu-card .lu-noicon.gender-f,html[data-theme="auto"] .lu-ddisc.gender-f,html[data-theme="auto"] .mcx-avatar.gender-f,html[data-theme="auto"] .am-avatar.gender-f { border-color: #ff8fc0; }
html[data-theme="auto"] button.lu-chip img.gender-m,html[data-theme="auto"] button.lu-chip .lu-chip-face.gender-m,html[data-theme="auto"] .lu-eslot .face img.gender-m,html[data-theme="auto"] .lu-eslot .face .lu-noicon.gender-m,html[data-theme="auto"] .lu-card img.gender-m,html[data-theme="auto"] .lu-card .lu-noicon.gender-m,html[data-theme="auto"] .lu-ddisc.gender-m,html[data-theme="auto"] .mcx-avatar.gender-m,html[data-theme="auto"] .am-avatar.gender-m { border-color: #7ec4ff; }
}

/* ===== 種別カラーピッカー（iOSの装飾チップ潰し） ===== */
input[type="color"] { -webkit-appearance: none; appearance: none; border: none; padding: 0; background: none; width: 50px; height: 40px; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 2px solid var(--line); border-radius: 8px; }
input[type="color"]::-moz-color-swatch { border: 2px solid var(--line); border-radius: 8px; }

/* ===== 種別の管理フォーム（スマホは色+リマインド／表示順+ボタンを2列） ===== */
.et-row2 { display: flex; gap: 10px; margin-bottom: 10px; }
.et-row3 { display: flex; gap: 10px; }
.et-match-line { display: flex; align-items: center; gap: 6px; }

/* ===== スマホ幅：2列の枠の高さを揃える ===== */
@media (max-width: 699px) {
  .et-row2 { align-items: center; }
  .et-row2 label { display: flex; align-items: center; min-height: 40px; gap: 6px; margin-bottom: 0; }
  .et-row2 .et-color { flex: 0 0 auto; }
  .et-row2 .et-color input[type="color"] { margin: 0; }
  .et-row2 .et-match { flex: 1 1 auto; }
  .et-row3 { align-items: flex-end; }
  .et-row3 .et-order { flex: 0 0 90px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 67px; margin-bottom: 0; }
  .et-row3 .et-order input { margin-bottom: 0; height: 46px; }
  .et-row3 .et-submit { flex: 1 1 auto; align-self: flex-end; height: 46px; }
  .et-row3 .et-actions { flex: 1 1 auto; align-self: flex-end; height: 46px; margin: 0; }
  .et-row3 .et-actions button { height: 46px; }
}

/* ===== 種別の管理フォーム（PCは1行・枠の高さを揃える） ===== */
@media (min-width: 700px) {
  .et-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
  .et-form p { flex: 1 0 100%; }
  .et-form label { margin-bottom: 0; display: flex; flex-direction: column; justify-content: flex-end; min-height: 66px; }
  .et-form input[type="text"], .et-form input[type="number"] { margin-bottom: 0; height: 43px; }
  .et-form input[type="color"] { width: 50px; height: 43px; }
  .et-form .et-match-line { display: flex; align-items: center; height: 43px; }
  .et-form .et-row2, .et-form .et-row3 { display: contents; }
  .et-form .et-name { flex: 1.2 1 120px; }
  .et-form .et-color { flex: 0 0 auto; }
  .et-form .et-match { flex: 1.6 1 300px; white-space: nowrap; }
  .et-form .et-order { flex: 0.5 1 90px; }
  .et-form .et-submit { flex: 0 0 110px; align-self: flex-end; height: 43px; padding: 0; font-size: 13px; }
  .et-form .et-actions { flex: 0 0 150px; align-self: flex-end; height: 43px; gap: 6px !important; }
  .et-form .et-actions button { height: 43px; padding: 0 9px; font-size: 13px; }
}

/* ===== 場所の管理フォーム（区分+表示順を2列） ===== */
.pl-pair { display: flex; gap: 10px; margin-bottom: 10px; }
.pl-pair label { margin-bottom: 0; }
.pl-pair .pl-cat { flex: 1 1 120px; }
.pl-pair .pl-order { flex: 0 0 90px; }
.pl-actions { display: flex; gap: 8px; }
.pl-actions button { flex: 1; }

/* ===== 場所の管理フォーム（PCは名称＋区分＋表示順＋ボタンを1行、住所＋地図URLを1行・スマホの並び順はそのままorderで組み替え） ===== */
@media (min-width: 700px) {
  .pl-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
  .pl-form label { margin-bottom: 0; display: flex; flex-direction: column; justify-content: flex-end; min-height: 66px; }
  .pl-form input[type="text"], .pl-form input[type="number"], .pl-form select { margin-bottom: 0; height: 43px; }
  .pl-form .pl-pair { display: contents; }
  .pl-form .pl-name { order: 1; flex: 1 1 200px; }
  .pl-form .pl-cat { order: 2; flex: 0 0 110px; }
  .pl-form .pl-order { order: 3; flex: 0 0 90px; }
  .pl-form .pl-submit { order: 4; flex: 0 0 110px; align-self: flex-end; height: 43px; padding: 0; font-size: 13px; }
  .pl-form .pl-actions { order: 4; flex: 0 0 170px; align-self: flex-end; height: 43px; }
  .pl-form .pl-actions button { height: 43px; padding: 0 9px; font-size: 13px; }
  .pl-form .pl-break { order: 5; flex: 1 0 100%; height: 0; }
  .pl-form .pl-addr { order: 6; flex: 1 1 260px; }
  .pl-form .pl-map { order: 7; flex: 1 1 260px; }
}

/* 引き継ぎ時の注意書き */
.warn-note { color: #e60023; font-size: 12px; font-weight: 700; margin: -6px 0 10px; }
html[data-theme="dark"] .warn-note { color: #ff5a6e; }

/* バレーコート（半面・縦・ネット上・縦横比固定）: フリーゾーン緑／アタックゾーン橙／後衛側 薄橙／白線 */
.lu-court, .lu-ecourt { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 1 / 1; background: #0e7c4b; border: 0; border-radius: 12px; padding: 5% 7% 6%; }
.lu-court::before, .lu-ecourt::before { content: ""; position: absolute; left: 5.5%; right: 5.5%; top: 5%; bottom: 6%; z-index: -1; border: 2px solid #fff; border-top: 0; background: linear-gradient(#fff, #fff) 0 33.3% / 100% 2px no-repeat, linear-gradient(#f07a3c 0 33.3%, #f9b98f 33.3%); }
.lu-court .lu-net, .lu-ecourt .lu-net { position: absolute; top: 5%; left: 2.5%; right: 2.5%; height: 0; margin: 0; padding: 0; background: none; border-radius: 0; border-top: 4px solid #fff; font-size: 0; color: transparent; letter-spacing: 0; flex: none; }
.lu-net::before, .lu-net::after, .lu-dnet::before, .lu-dnet::after { content: ""; position: absolute; top: -8px; width: 12px; height: 12px; border-radius: 50%; background: #1b1b1b; }
.lu-net::before, .lu-dnet::before { left: -6px; }
.lu-net::after, .lu-dnet::after { right: -6px; }
.lu-court .lu-row { flex: 1; align-items: center; margin-top: 0; }
.lu-court.six .lu-row { flex: none; margin-top: 8px; }
.lu-court.six .lu-row:last-child { margin-top: auto; margin-bottom: 3%; }
.lu-ecourt .lu-erows { flex: 1; display: flex; flex-direction: column; }
.lu-ecourt .lu-erow { flex: 1; align-items: center; margin-top: 0; }
.lu-ecourt.six .lu-erow { flex: none; margin-top: 10px; }
.lu-ecourt.six .lu-erow:last-child { margin-top: auto; margin-bottom: 3%; }
.lu-court .lu-card { background: none; color: #14161a; }
.lu-court .lu-name { color: #14161a; }
.lu-court .lu-noicon { background: #fff; color: #b6b0aa; }
button.lu-eslot.empty { background: rgba(255,255,255,.45); border-color: #fff; }
button.lu-eslot.empty:hover { background: rgba(255,255,255,.65); }
.lu-eslot .lu-plus { border-color: #fff; color: #fff; }
.lu-eslot.empty .nm { color: #7a4a2a; }
.lu-eslot.empty .pos { color: #7a4a2a; }
.lu-dcourt { max-width: 380px; aspect-ratio: 1 / 1; background: #0e7c4b; border: 0; isolation: isolate; }
.lu-dcourt.lu-dcourt-6 { max-width: 380px; aspect-ratio: 1 / 1; }
.lu-dcourt::before { content: ""; position: absolute; left: 5.5%; right: 5.5%; top: 5%; bottom: 6%; z-index: -1; border: 2px solid #fff; border-top: 0; background: linear-gradient(#fff, #fff) 0 33.3% / 100% 2px no-repeat, linear-gradient(#f07a3c 0 33.3%, #f9b98f 33.3%); }
.lu-dnet { left: 2.5%; right: 2.5%; top: 5%; border-top: 4px solid #fff; }
.lu-dslot.is-empty .lu-ddisc { background: rgba(255,255,255,.4); border-color: #fff; color: #fff; }
.lu-dslot.is-empty .lu-dname { color: #5a3a20; }
.lu-vbtn { position: absolute; right: 4%; bottom: 4%; z-index: 2; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #ff0033; color: #fff; font-size: 18px; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.35); text-decoration: none; }
.lu-vbtn:hover { background: #d40029; color: #fff; }

/* birthday drum sheet (v116) */
.bdsel.has-drum select,.bdsel.has-drum .bd-u{display:none}
.bd-trigger{display:block;width:100%;text-align:left;font-size:17px;padding:12px 14px;border:1px solid var(--line,#d0d5dd);border-radius:10px;background:var(--card,#fff);color:inherit}
.bd-sheet-bg{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:1000;display:flex;align-items:flex-end}
.bd-sheet{width:100%;background:#fff;border-radius:16px 16px 0 0;padding:0 0 max(12px,env(safe-area-inset-bottom));box-shadow:0 -6px 24px rgba(0,0,0,.2)}
[data-theme="dark"] .bd-sheet{background:#1f2937;color:#e5e7eb}
.bd-sheet-bar{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;font-weight:700;font-size:15px;border-bottom:1px solid rgba(0,0,0,.06)}
.bd-sheet-bar span{flex:1;text-align:center;white-space:nowrap;writing-mode:horizontal-tb}
.bd-sheet-bar button{background:none;border:0;font-size:17px;color:#0a66c2;font-weight:700;padding:6px 4px;width:auto;min-width:64px;flex:0 0 auto}
.bd-sheet-bar .bd-clear{color:#888;font-weight:500}
.bd-drum{position:relative;display:flex;height:264px;padding:0 10px;overflow:hidden;-webkit-mask-image:linear-gradient(transparent,#000 22%,#000 78%,transparent);mask-image:linear-gradient(transparent,#000 22%,#000 78%,transparent)}
.bd-col{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scrollbar-width:none;position:relative;z-index:1}
.bd-col::-webkit-scrollbar{display:none}
.bd-pad{height:110px}
.bd-item{height:44px;line-height:44px;text-align:center;font-size:17px;font-weight:500;color:#8a8f98;transition:font-size .1s,color .1s}
.bd-item.sel{font-size:27px;font-weight:800;color:#0e8a4d}
[data-theme="dark"] .bd-item.sel{color:#22c37a}
.bd-band{display:none}
body.bd-lock{overflow:hidden}

/* 保存・送信の結果を画面の下にも出す（ボタンが下にあるとき上の .flash では気づけないため） */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 200; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 32px); padding: 13px 22px; border-radius: 999px; background: #2f6b49; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.6; box-shadow: 0 10px 28px rgba(20,30,24,.30); opacity: 0; transform: translateX(-50%) translateY(14px); transition: opacity .25s ease, transform .25s ease; cursor: pointer; }
.toast.err { background: #b3261e; box-shadow: 0 10px 28px rgba(60,16,12,.32); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { font-size: 15px; flex: 0 0 auto; }
@media (max-width: 760px) { .toast { font-size: 13.5px; padding: 12px 18px; } }

/* 日付ピッカー（flatpickr）。アプリ側の input/select の指定が見出しに効いて年月が潰れるので、この中だけ打ち消す。
   flatpickr のCSSは実行時に後から読み込まれるため !important が要る */
.flatpickr-calendar select,
.flatpickr-calendar input { width: auto !important; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; background-image: none !important; box-shadow: none !important; outline: none !important; font-size: 15px !important; font-weight: 700 !important; color: inherit !important; line-height: 1.4 !important; }
.flatpickr-calendar .flatpickr-monthDropdown-months { padding-right: 2px !important; }
.flatpickr-calendar input.cur-year { width: 4.4ch !important; text-align: left !important; }
.flatpickr-calendar .numInputWrapper { width: auto !important; }
.flatpickr-months { padding: 2px 0 !important; }
.flatpickr-months .flatpickr-month { height: 44px !important; overflow: visible !important; }
.flatpickr-current-month { height: 44px !important; padding: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 3px !important; font-size: 15px !important; }

html[data-theme="dark"] .lu-court .lu-card { background: none; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .lu-court .lu-card { background: none; } }
