/* 会員ページ（スマホ前提）。専用HTML（templates/app.php）で表示するためテーマの影響は受けない */
.mdesk-topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-direction: column; padding: 10px 16px calc(10px); background: var(--c-navy); color: #fff; }
.mdesk-topbar__org { font-size: 12px; color: #9fb0c7; }
.mdesk-topbar__app { font-size: 17px; font-weight: 700; }
.mdesk-main { padding: 8px 16px 48px; }
.mdesk-portal h2:first-child { margin-top: .6em; }
.mdesk-portal .mdesk-card { box-shadow: var(--shadow); }
.mdesk-portal {
	--md-accent: var(--c-primary);
	--md-ok: #1e7b34;
	--md-warn: #c0392b;
	--md-muted: #6b7280;
	--md-line: #e5e7eb;
	--md-bg: #fff;
	max-width: 640px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.6;
}
.mdesk-portal * { box-sizing: border-box; }
.mdesk-portal h2 { font-size: 1.3em; margin: 1.2em 0 .5em; }
.mdesk-portal h3 { font-size: 1.1em; margin: 1.4em 0 .4em; }
.mdesk-muted { color: var(--md-muted); font-size: .88em; }
.mdesk-me { padding: 12px 0; border-bottom: 1px solid var(--md-line); }

.mdesk-card { display: block; padding: 14px 16px; margin: 10px 0; border: 1px solid var(--md-line); border-radius: 10px; background: var(--md-bg); color: inherit; text-decoration: none; }
.mdesk-card:active { background: #f3f4f6; }
.mdesk-card-top { display: flex; justify-content: space-between; align-items: center; }
.mdesk-card-title { font-weight: 700; margin: 4px 0 2px; }
.mdesk-type { font-size: .78em; color: var(--md-accent); font-weight: 600; }

.mdesk-badge { font-size: .78em; padding: 2px 10px; border-radius: 999px; background: #f3f4f6; color: var(--md-muted); white-space: nowrap; }
.mdesk-badge.is-pending { background: var(--md-warn); color: #fff; }
.mdesk-badge.is-attend, .mdesk-badge.is-late, .mdesk-badge.is-early { background: #e7f5ea; color: var(--md-ok); }
.mdesk-badge.is-absent, .mdesk-badge.is-official { background: #f3f4f6; color: #374151; }

.mdesk-alert, .mdesk-notice { padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.mdesk-alert { background: #fdecea; color: #7f1d1d; }
.mdesk-notice { background: #e7f5ea; color: #14532d; }

.mdesk-dl { display: grid; grid-template-columns: 7em 1fr; gap: 6px 10px; margin: 12px 0; }
.mdesk-dl dt { color: var(--md-muted); font-size: .9em; }
.mdesk-dl dd { margin: 0; }
.mdesk-desc { padding: 12px 0; border-top: 1px solid var(--md-line); }

.mdesk-form { margin-top: 8px; }
.mdesk-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.mdesk-choice input { position: absolute; opacity: 0; }
.mdesk-choice span { display: block; text-align: center; padding: 14px 6px; border: 2px solid var(--md-line); border-radius: 10px; font-weight: 700; cursor: pointer; }
.mdesk-choice input:checked + span { border-color: var(--md-accent); background: var(--md-accent); color: #fff; }
.mdesk-choice.is-attend input:checked + span { border-color: var(--md-ok); background: var(--md-ok); }
.mdesk-choice input:focus-visible + span { outline: 3px solid #93c5fd; }
.mdesk-extra { border: 1px solid var(--md-line); border-radius: 10px; padding: 8px 14px; margin: 12px 0; }
.mdesk-extra label { display: inline-block; margin-right: 18px; padding: 6px 0; }
.mdesk-reason { display: block; margin: 12px 0; font-size: .9em; }
.mdesk-reason textarea { width: 100%; margin-top: 4px; font-size: 16px; padding: 8px; border: 1px solid var(--md-line); border-radius: 8px; }
.mdesk-btn { display: block; width: 100%; padding: 14px; border: 0; border-radius: 10px; background: var(--md-accent); color: #fff; font-size: 1.05em; font-weight: 700; cursor: pointer; }
.mdesk-back { text-decoration: none; }
.mdesk-foot { margin-top: 2em; text-align: center; font-size: .88em; }

.mdesk-checked { text-align: center; padding: 30px 0; }
.mdesk-checked-mark { width: 88px; height: 88px; margin: 0 auto 12px; border-radius: 50%; background: var(--md-ok); color: #fff; font-size: 52px; line-height: 88px; }

.mdesk-portal #loginform p { margin: 10px 0; }
.mdesk-portal #loginform input[type=text], .mdesk-portal #loginform input[type=password] { width: 100%; font-size: 16px; padding: 10px; }
.mdesk-portal #loginform input[type=submit] { width: 100%; padding: 12px; font-size: 1em; }

/* 資料・総会 */
.mdesk-docs, .mdesk-motions { padding-left: 1.3em; }
.mdesk-docs li, .mdesk-motions li { margin: 6px 0; }
.mdesk-vcard { padding: 14px 16px; margin: 10px 0; border: 2px solid var(--md-line); border-radius: 10px; }
.mdesk-vcard.is-open { border-color: var(--md-accent); }
.mdesk-vbtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.mdesk-vbtn { padding: 16px 4px; border: 2px solid var(--md-line); border-radius: 10px; background: #fff; font-size: 1.05em; font-weight: 700; cursor: pointer; color: inherit; }
.mdesk-vbtn:disabled { opacity: .45; cursor: default; }
.mdesk-vbtn.is-on.is-for { background: var(--md-ok); border-color: var(--md-ok); color: #fff; }
.mdesk-vbtn.is-on.is-against { background: var(--md-warn); border-color: var(--md-warn); color: #fff; }
.mdesk-vbtn.is-on.is-abstain { background: #4b5563; border-color: #4b5563; color: #fff; }
.mdesk-radio { display: block; padding: 8px 0; }
.mdesk-select { width: 100%; margin: 0 0 6px 1.6em; max-width: calc(100% - 1.6em); font-size: 16px; padding: 8px; }
.mdesk-written { margin-top: 8px; }
.mdesk-withdraw { margin-top: 10px; text-align: center; }
.mdesk-linkbtn { background: none; border: 0; color: var(--md-accent); text-decoration: underline; cursor: pointer; font-size: .9em; }

/* LINE */
.mdesk-line-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; margin: 12px 0; border-radius: 10px; background: #06c755; color: #fff !important; font-weight: 700; font-size: 16px; text-decoration: none !important; }
.mdesk-line-btn:active { background: #05b34c; }
.mdesk-line-btn__logo { padding: 2px 6px; border-radius: 6px; background: #fff; color: #06c755; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.mdesk-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--md-muted); font-size: .85em; }
.mdesk-or::before, .mdesk-or::after { content: ""; flex: 1; height: 1px; background: var(--md-line); }
.mdesk-linecard { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--md-line); }

.mdesk-portal #loginform label { display: block; margin-bottom: 4px; font-size: .9em; font-weight: 600; }
.mdesk-portal #loginform .login-remember label { display: inline; font-weight: 400; }
.mdesk-portal #loginform input[type=text], .mdesk-portal #loginform input[type=password] { border: 1px solid var(--c-line-strong); border-radius: 8px; }
.mdesk-portal #loginform input[type=submit] { border: 0; border-radius: 10px; background: var(--c-primary); color: #fff; font-weight: 700; cursor: pointer; }

/* 選挙 */
.mdesk-card--elect { border-left: 4px solid #5b3cc4; }
.mdesk-cands { display: grid; gap: 8px; }
.mdesk-cand { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--md-line); border-radius: 10px; background: #fff; }
.mdesk-cand__no { flex: none; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; background: #efeafd; color: #5b3cc4; font-weight: 800; }
.mdesk-cand__st { margin: 6px 0 0; color: #374151; font-size: .92em; }
.mdesk-bcand { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 8px 0; border: 2px solid var(--md-line); border-radius: 10px; background: #fff; font-weight: 700; cursor: pointer; }
.mdesk-bcand input { width: 22px; height: 22px; accent-color: #5b3cc4; }
.mdesk-bcand:has(input:checked) { border-color: #5b3cc4; background: #f7f4fe; }
.mdesk-ballot__count { text-align: right; font-weight: 700; }
.mdesk-results { padding: 0; list-style: none; counter-reset: r; }
.mdesk-results li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--md-line); }
.mdesk-roll, .mdesk-objection { margin: 20px 0; padding: 12px 14px; border: 1px solid var(--md-line); border-radius: 10px; background: #fff; }
.mdesk-roll summary, .mdesk-objection summary { font-weight: 700; cursor: pointer; }
.mdesk-roll__names { margin-top: 10px; line-height: 2; }
.mdesk-btn--sub { background: #4b5563; }

/* カレンダー */
.mdesk-h2row { display: flex; align-items: center; justify-content: space-between; }
.mdesk-pill { display: inline-block; padding: 4px 14px; border: 1px solid var(--md-line); border-radius: 999px; background: #fff; font-size: .85em; font-weight: 700; text-decoration: none; }
.mdesk-calhead { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.mdesk-calhead h2 { margin: 0; }
.mdesk-cday { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--md-line); }
.mdesk-cday__date { flex: none; width: 2.6em; text-align: center; font-size: 1.3em; font-weight: 800; line-height: 1.1; }
.mdesk-cday__date small { display: block; font-size: .55em; color: var(--md-muted); }
.mdesk-cday.is-today .mdesk-cday__date { color: var(--md-accent); }
.mdesk-cday__items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mdesk-citem { display: flex; gap: 10px; padding: 8px 10px; border-left: 4px solid var(--ct, #1f4fa3); border-radius: 6px; background: #fff; color: inherit; text-decoration: none; }
.mdesk-citem small { display: block; color: var(--md-muted); font-size: .8em; }
.mdesk-citem__time { flex: none; width: 3em; font-weight: 700; font-variant-numeric: tabular-nums; }
/* 予定の行で、自分の出欠を右端に寄せる */
.mdesk-citem > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.mdesk-citem .mdesk-badge { flex: none; align-self: flex-start; }
.mdesk-ct--assembly { --ct: #5b3cc4; } .mdesk-ct--board { --ct: #0f6b6b; } .mdesk-ct--committee { --ct: #3f7d20; }
.mdesk-ct--project { --ct: #b25b00; } .mdesk-ct--convention { --ct: #a3246b; } .mdesk-ct--external { --ct: #5c6b7a; } .mdesk-ct--election { --ct: #7a4b00; }
.mdesk-subscribe { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--md-line); }
.mdesk-subscribe .mdesk-btn { margin: 10px 0; text-align: center; text-decoration: none; }
.mdesk-copy { width: 100%; padding: 8px; font-size: 13px; border: 1px solid var(--md-line); border-radius: 8px; }

/* 書類・承認 */
.mdesk-card--appr { border-left: 4px solid #b25b00; }
.mdesk-steps { padding: 0; list-style: none; }
.mdesk-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--md-line); }
.mdesk-steps__mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef0f3; color: var(--md-muted); font-weight: 700; }
.mdesk-steps li.is-approved .mdesk-steps__mark { background: var(--md-ok); color: #fff; }
.mdesk-steps li.is-rejected .mdesk-steps__mark { background: var(--md-warn); color: #fff; }
.mdesk-btn--danger { background: var(--md-warn); margin-top: 8px; }

/* 諸大会・写真の記録 */
.mdesk-table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: .95em; }
.mdesk-table th, .mdesk-table td { padding: 8px 10px; border-bottom: 1px solid var(--md-line); text-align: left; vertical-align: top; }
.mdesk-table th { width: 6.5em; color: var(--md-muted); font-weight: 600; white-space: nowrap; }
button.mdesk-choice { padding: 14px 6px; border: 2px solid var(--md-line); border-radius: 10px; background: #fff; font-family: inherit; font-size: 1em; font-weight: 700; color: inherit; cursor: pointer; }
button.mdesk-choice.is-on { border-color: var(--md-ok); background: var(--md-ok); color: #fff; }
.mdesk-label { display: block; margin: 12px 0; font-size: .9em; }
.mdesk-label input, .mdesk-label textarea { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--md-line); border-radius: 8px; font-size: 16px; font-family: inherit; }
.mdesk-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0; }
.mdesk-album { display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--md-line); border-radius: 10px; color: inherit; text-decoration: none; font-size: .9em; }
.mdesk-album img { width: 100%; height: 92px; object-fit: cover; border-radius: 6px; }
.mdesk-album__noimg { display: flex; align-items: center; justify-content: center; height: 92px; background: #f1f5f9; border-radius: 6px; color: var(--md-muted); font-size: .85em; }
.mdesk-album__title { font-weight: 700; }
.mdesk-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.mdesk-photo { display: block; color: inherit; text-decoration: none; }
.mdesk-photo img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.mdesk-photo__cap { display: block; margin-top: 2px; color: var(--md-muted); font-size: .8em; }
/* 他の単位会・購読カレンダーから取り込んだ予定 */
.mdesk-ct--shared { --ct: #6b7280; background: #f6f7f9; }
.mdesk-ct--shared strong { font-weight: 600; }

/* 事務局が「この会員に何が見えているか」を確かめる下見 */
.mdesk-preview-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: #fff4d6; color: #7a4b00; font-size: 14px; }
.mdesk-preview-bar strong { flex: none; padding: 2px 8px; border-radius: 4px; background: #7a4b00; color: #fff; font-size: 12px; }
.mdesk-preview-bar span { flex: 1 1 auto; min-width: 0; }
.mdesk-preview-bar a { flex: none; color: #7a4b00; font-weight: 700; }
/* 操作できない部分は、見た目でもそれと分かるようにする */
.mdesk-portal.is-preview [inert] { opacity: .5; }

/* 月のマス目（会員用カレンダー） */
.mdesk-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin: 0 0 20px;
  background: var(--md-line, #e3e6ea); border: 1px solid var(--md-line, #e3e6ea); border-radius: 8px; overflow: hidden; }
.mdesk-cal__wd { padding: 6px 0; background: #f4f6f8; color: var(--md-muted, #6b7280); font-size: 12px; font-weight: 700; text-align: center; }
.mdesk-cal__wd.is-sun { color: #c0322b; } .mdesk-cal__wd.is-sat { color: #1f4fa3; }
.mdesk-cal__day { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 46px;
  padding: 5px 2px; background: #fff; color: inherit; text-decoration: none; }
.mdesk-cal__day.is-out { background: #fafbfc; }
.mdesk-cal__day.is-sun .mdesk-cal__num { color: #c0322b; } .mdesk-cal__day.is-sat .mdesk-cal__num { color: #1f4fa3; }
.mdesk-cal__num { font-size: 13px; font-weight: 700; line-height: 22px; min-width: 22px; text-align: center; }
.mdesk-cal__day.is-today .mdesk-cal__num { border-radius: 50%; background: #1f4fa3; color: #fff !important; }
.mdesk-cal__day.has-items:hover { background: #f4f8ff; }
.mdesk-cal__dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.mdesk-cal__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ct, #1f4fa3); }
/* 日付から飛んだとき、見出しが隠れないようにする */
.mdesk-cday { scroll-margin-top: 70px; }
