/* NSCアプリ（New Step College）— デザインは NSC 1期生 決起会スライド（_shared/slide_design/nsc）の言語をそのまま使う
   白地 × スカイブルーの斜めストライプと網点 ／ 見出しはピル ／ 強調語だけ青グラデ・ゴールド ／ 本文はチャコール */
:root {
  --ink: #3F4348; --sub: #7a8089; --line: #e3ecf5;
  --sky: #70BBFF; --stripe: #A2D4F3; --pill-l: #8BC9FD; --pill-r: #C8E4FB; --pale: #EBF5FF;
  --blue1: #6CB8D2; --blue2: #2F62D0; --navy: #2F62D0;
  --gold: linear-gradient(180deg, #F8E09A 0%, #D9A955 30%, #F3D58B 50%, #C18A3B 72%, #8F5E1E 100%);
  --bgrad: linear-gradient(180deg, #6CB8D2 0%, #2F62D0 100%);
  --card: #ffffff; --radius: 18px; --shadow: 0 6px 22px rgba(47, 98, 208, .08);
  --red: #e5484d; --green: #2f9e6b; --amber: #c98a12;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink); background: #f6faff; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.6;
}
#app { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
body.has-tabbar #app { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
/* 背景のストライプと網点（スライドの四隅）を画面の後ろに薄く敷く */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 92% 6%, rgba(112,187,255,.22) 1.4px, transparent 1.6px) 0 0 / 9px 9px,
    linear-gradient(120deg, rgba(112,187,255,.16) 0 9%, transparent 9% 100%),
    linear-gradient(300deg, rgba(162,212,243,.22) 0 7%, transparent 7% 100%), #f6faff;
  -webkit-mask: none;
}
a { color: var(--blue2); }
button { font-family: inherit; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 28px; }
.muted { color: var(--sub); }
.small { font-size: .82rem; }
h1, h2, h3 { margin: 0; line-height: 1.35; }

/* ---- ピル見出し（スライドの「NSC 1期生 決起会」ラベル） ---- */
.pill {
  display: inline-block; padding: .28rem 1.05rem; border-radius: 999px; color: #fff; font-weight: 700; font-size: .82rem; letter-spacing: .04em;
  background: linear-gradient(90deg, var(--pill-l), var(--pill-r)); box-shadow: 0 2px 8px rgba(112,187,255,.25);
}
.sec-title { display: flex; align-items: center; gap: .55rem; margin: 22px 2px 10px; font-weight: 800; font-size: 1.02rem; }
.sec-title::before { content: ''; width: 5px; height: 1.1em; border-radius: 3px; background: var(--bgrad); }
.sec-title .more { margin-left: auto; font-size: .8rem; font-weight: 600; text-decoration: none; }
.em-blue { background: var(--bgrad); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; font-weight: 900; }
.em-gold { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; font-weight: 900; }

/* ---- カード ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card.pale { background: var(--pale); border-color: #d6e8fb; box-shadow: none; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list > a, .list > div.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.list > :first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 700; }
.list .s { font-size: .8rem; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .chev { color: #b8c3cf; font-size: 1.2rem; }
.empty { text-align: center; color: var(--sub); padding: 26px 12px; font-size: .9rem; }

/* ---- ヒーロー（ホーム上部＝スライドの表紙） ---- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 20px 18px 18px; margin-bottom: 14px;
  background: url(/bg.jpg) center / cover, #fff; border: 1px solid #dcebfb; box-shadow: var(--shadow); text-align: center;
}
.hero .logo { width: 64px; height: 64px; display: block; margin: 0 auto 6px; }
.hero .hello { font-size: .9rem; color: var(--sub); margin-top: 8px; }
.hero .stage-no { font-size: .86rem; font-weight: 800; margin-top: 10px; letter-spacing: .06em; }
.hero .stage-title { font-size: 1.55rem; font-weight: 900; margin: 2px 0 2px; }
.hero .stage-goal { font-size: .84rem; color: var(--sub); }
.hero .sub-line { margin-top: 10px; font-size: .82rem; color: var(--sub); }
.hero .sub-line::before, .hero .sub-line::after { content: '—'; margin: 0 .5em; color: #b9c9db; }

/* 段階のドット（6段） */
.steps { display: flex; gap: 6px; justify-content: center; margin: 12px 0 2px; }
.steps i { width: 30px; height: 6px; border-radius: 3px; background: #d9e8f8; }
.steps i.on { background: var(--bgrad); }
.steps i.cur { background: linear-gradient(90deg, #F3D58B, #C18A3B); }

/* ---- 次にやること ---- */
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 11px 2px; border-top: 1px dashed var(--line); cursor: pointer; }
.todo:first-of-type { border-top: 0; }
.todo .box { flex: 0 0 22px; height: 22px; border-radius: 7px; border: 2px solid #b8d4ee; margin-top: 1px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 900; transition: all .15s; }
.todo.done .box { background: var(--bgrad); border-color: transparent; }
.todo.done .lbl { color: var(--sub); text-decoration: line-through; }

/* ---- タイル（ホームのメニュー） ---- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); position: relative; min-height: 86px; }
.tile .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--pill-l), var(--blue2)); color: #fff; margin-bottom: 8px; }
.tile .ic svg { width: 19px; height: 19px; fill: currentColor; }
.tile b { display: block; font-size: .92rem; }
.tile span { font-size: .74rem; color: var(--sub); }
.badge { display: inline-block; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; padding: 0 6px; }
.tile .badge { position: absolute; top: 10px; right: 10px; }

/* ---- フォーム ---- */
label.f { display: block; font-size: .8rem; font-weight: 700; margin: 12px 0 5px; }
input, textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); border: 1.5px solid #d6e3f0; border-radius: 12px; padding: 11px 12px; background: #fff; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(112,187,255,.18); }
textarea { min-height: 96px; resize: vertical; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 800; font-size: 1rem; color: #fff; cursor: pointer;
  background: var(--bgrad); box-shadow: 0 6px 16px rgba(47,98,208,.22); margin-top: 14px; text-align: center; text-decoration: none;
}
.btn:disabled { opacity: .55; }
.btn.secondary { background: #fff; color: var(--blue2); border: 1.5px solid #cfe2f6; box-shadow: none; }
.btn.small { display: inline-block; width: auto; padding: 7px 13px; font-size: .84rem; margin-top: 0; border-radius: 10px; }
.btn.gold { background: linear-gradient(180deg, #E9C672, #B9802F); box-shadow: 0 6px 16px rgba(193,138,59,.25); }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid #f2c7c9; box-shadow: none; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }
.form-error { color: var(--red); font-size: .85rem; min-height: 1.2em; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(47,57,72,.92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .88rem; z-index: 200; max-width: 88vw; }

/* ---- 認証 ---- */
.auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 26px 18px; background: url(/bg.jpg) center / cover; }
.auth-card { width: 100%; max-width: 400px; background: rgba(255,255,255,.94); border-radius: 24px; padding: 24px 20px; box-shadow: 0 10px 34px rgba(47,98,208,.14); }
.auth-card .logo { display: block; width: 210px; max-width: 70%; margin: 0 auto 6px; }
.auth-card .tag { text-align: center; font-size: .84rem; color: var(--sub); margin-bottom: 8px; }
.seg { display: flex; background: var(--pale); border-radius: 12px; padding: 4px; margin: 12px 0 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 700; color: var(--sub); cursor: pointer; }
.seg button.on { background: #fff; color: var(--blue2); box-shadow: 0 2px 6px rgba(0,0,0,.06); }

/* ---- ヘッダー（下層ページ） ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: rgba(246,250,255,.86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid #e6eef7; }
.top .back { border: 0; background: none; font-size: 1.5rem; color: var(--blue2); padding: 0 6px; cursor: pointer; line-height: 1; }
.top h1 { font-size: 1.02rem; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .r { margin-left: auto; }

/* ---- 部屋（チャット） ---- */
.room { display: flex; flex-direction: column; height: 100%; }
.room .msgs { flex: 1; overflow-y: auto; padding: 14px 12px 8px; -webkit-overflow-scrolling: touch; }
.msg { display: flex; flex-direction: column; margin: 8px 0; max-width: 82%; }
.msg .who { font-size: .72rem; color: var(--sub); margin: 0 4px 3px; }
.msg .who .role { display: inline-block; font-size: .64rem; padding: 0 6px; border-radius: 6px; background: var(--pale); color: var(--blue2); margin-left: 4px; font-weight: 700; }
.msg .bub { background: #fff; border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 9px 12px; white-space: pre-wrap; word-break: break-word; box-shadow: 0 2px 8px rgba(0,0,0,.03); }
.msg.me { align-self: flex-end; align-items: flex-end; margin-left: auto; }
.msg.me .bub { background: var(--bgrad); color: #fff; border: 0; border-radius: 18px 4px 18px 18px; }
.msg.me .bub a { color: #fff; }
.msg .at { font-size: .66rem; color: #a3adb8; margin: 2px 4px 0; }
.msg img.att { max-width: 220px; max-height: 260px; border-radius: 12px; display: block; margin-top: 6px; cursor: pointer; }
.msg .file { display: inline-block; margin-top: 6px; padding: 6px 10px; background: rgba(255,255,255,.2); border-radius: 10px; font-size: .82rem; }
.msg:not(.me) .file { background: var(--pale); }
.day-sep { text-align: center; margin: 14px 0 4px; }
.day-sep span { font-size: .72rem; color: #8a96a3; background: #e9f1fa; padding: 2px 10px; border-radius: 10px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.95); border-top: 1px solid var(--line); }
.composer textarea { min-height: 42px; max-height: 140px; border-radius: 21px; padding: 9px 14px; }
.composer .ib { flex: 0 0 42px; height: 42px; border-radius: 21px; border: 0; background: var(--pale); color: var(--blue2); font-size: 1.15rem; cursor: pointer; }
.composer .send { background: var(--bgrad); color: #fff; }
.pending-att { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 6px; font-size: .78rem; }
.pending-att span { background: var(--pale); padding: 3px 9px; border-radius: 9px; }
body.in-room #app { overflow: hidden; padding-bottom: 0; }

/* ---- 部屋一覧・受講生一覧 ---- */
.av { flex: 0 0 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--pill-l), var(--blue2)); font-size: 1rem; }
.tagline { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.chip { font-size: .68rem; padding: 1px 8px; border-radius: 8px; background: var(--pale); color: var(--blue2); font-weight: 700; white-space: nowrap; }
.chip.warn { background: #fff1e0; color: var(--amber); }
.chip.red { background: #fde8e8; color: var(--red); }
.chip.ok { background: #e6f6ee; color: var(--green); }
.chip.gold { background: #fbf1da; color: #9a6a23; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; }
.filters button { flex: 0 0 auto; border: 1.5px solid #d6e6f6; background: #fff; border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 700; color: var(--sub); cursor: pointer; }
.filters button.on { background: var(--blue2); border-color: var(--blue2); color: #fff; }
.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 1.45rem; line-height: 1.2; }
.kpi span { font-size: .72rem; color: var(--sub); }
.kpi .warn b { color: var(--amber); } .kpi .red b { color: var(--red); }

/* ---- レポート ---- */
.rp-block { margin-bottom: 14px; }
.rp-block h3 { font-size: .86rem; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.rp-block p { margin: 0; white-space: pre-wrap; }
.comment-box { background: linear-gradient(180deg, #fffaf0, #fff); border: 1.5px solid #f0dcae; border-radius: 16px; padding: 12px 14px; }
.status { font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 8px; }
.status.draft { background: #eef2f6; color: #7a8592; } .status.submitted { background: #fff1e0; color: var(--amber); }
.status.commented { background: var(--pale); color: var(--blue2); } .status.published { background: #e6f6ee; color: var(--green); }
.status.none { background: #fde8e8; color: var(--red); }
table.mini { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.mini th, table.mini td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
table.mini th:first-child, table.mini td:first-child { text-align: left; }

/* ---- 予定 ---- */
.ev { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev .d { flex: 0 0 52px; text-align: center; border-radius: 12px; background: var(--pale); padding: 6px 0; }
.ev .d b { display: block; font-size: 1.2rem; line-height: 1.1; color: var(--blue2); }
.ev .d span { font-size: .68rem; color: var(--sub); }
.ev.past { opacity: .5; }

/* ---- タブバー（LINE型・GoAlアプリ共通） ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: stretch;
  height: calc(58px + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom);
  background: rgba(255,255,255,.78); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-top: .5px solid rgba(0,0,0,.09);
}
.tabbar[hidden] { display: none; }
body.kb-open .tabbar, body.in-room .tabbar { display: none; }
.tabbar button { flex: 1; min-width: 0; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 0 0 7px; color: #9ca1a9; position: relative; -webkit-tap-highlight-color: transparent; transition: transform .12s, color .12s; }
.tabbar button:active { transform: scale(.9); }
.tabbar button .ic { position: relative; width: 26px; height: 26px; display: block; }
.tabbar button svg { width: 26px; height: 26px; display: block; fill: currentColor; }
.tabbar button span { font-size: 10px; font-weight: 600; line-height: 1; white-space: nowrap; }
.tabbar button.on { color: var(--blue2); }
.tabbar .dot { position: absolute; top: -5px; left: 16px; min-width: 18px; height: 18px; border-radius: 9px; background: #ff334b; color: #fff; font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; padding: 0 5px; box-shadow: 0 0 0 2px #fff; }
.tabbar .dot[hidden] { display: none; }

/* ---- ローディング ---- */
.loading-screen { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: url(/bg.jpg) center / cover; }
.loading-screen img { width: 190px; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #d6e8fb; border-top-color: var(--blue2); animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.lightbox { position: fixed; inset: 0; background: rgba(10,20,35,.88); z-index: 300; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 8px; }
.lightbox button { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; border: 0; background: rgba(255,255,255,.18); color: #fff; width: 40px; height: 40px; border-radius: 20px; font-size: 1.2rem; }
.note-banner { font-size: .78rem; background: #fff8e8; border: 1px solid #f2dfb3; color: #8a6514; border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; }
@media (min-width: 900px) { .wrap { max-width: 760px; } }
