/* ============================================================
   エムキャリア 取引先ポジショニングマップ — スタイル
   白基調・高級感(ネイビー×ゴールド)
   ============================================================ */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1a1612;
  --ink-soft: #4d463f;
  --sub: #8a8176;
  --orange: #ea5404;
  --orange-dark: #c44303;
  --gold: #b8965a;
  --gold-soft: #e0cda0;
  --line: #ece5da;
  --shadow: 0 12px 34px rgba(26, 22, 18, 0.09);
  --shadow-sm: 0 3px 10px rgba(26, 22, 18, 0.06);
  --radius: 16px;
  /* カテゴリ色(JSと一致) */
  --cat-shinchiku: #e08a3c;
  --cat-kaitori: #3f7fd6;
  --cat-toushi: #8a5cd6;
  --cat-corp: #2aa37a;
  --cat-chukai: #d6517f;
  --cat-proptech: #5d6b7d;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 88% -12%, #fff6ef, transparent),
    radial-gradient(900px 420px at 5% 0%, #fbf3e6, transparent),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* 見出しは和セリフ + Cormorant でフドカツ統一の高級感 */
.brand-text h1, .p-name {
  font-family: "Cormorant Garamond", "Noto Serif JP", serif;
}

/* ---------- App bar ---------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px;
  background: rgba(255, 252, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-div { width: 1px; height: 30px; background: var(--line); flex: none; }
.brand-text h1 { font-size: 21px; margin: 0; letter-spacing: .2px; font-weight: 700; line-height: 1.15; }
.brand-text p { margin: 3px 0 0; font-size: 12px; color: var(--sub); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-soft); color: var(--ink); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #f0671b, var(--orange-dark)); color: #fff; border-color: transparent; }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 20px rgba(234,84,4,.32); }
.btn-ghost { background: transparent; }
.btn-danger { background: #fff; color: #c0392b; border-color: #eccac4; }
.btn-danger:hover { background: #c0392b; color: #fff; border-color: transparent; }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px; padding: 20px 22px 40px; align-items: start;
  max-width: 1500px; margin: 0 auto;
}
@media (max-width: 1040px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Board ---------- */
.board {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px 22px;
}
.board-controls {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.search { display: flex; align-items: center; gap: 10px; }
.search input {
  font: inherit; font-size: 13px; padding: 8px 12px; width: 220px;
  border: 1px solid var(--line); border-radius: 9px; background: #fcfbf8;
}
.search input:focus { outline: none; border-color: var(--gold-soft); background: #fff; }
.count { font-size: 12px; color: var(--sub); font-weight: 600; }
.btn-mini { padding: 5px 10px; font-size: 11.5px; border-radius: 8px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.legend .lg {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  cursor: pointer; user-select: none; transition: all .12s;
}
.legend .lg .sw { width: 10px; height: 10px; border-radius: 50%; }
.legend .lg.off { opacity: .35; background: #f3f0e9; }
.legend .lg:hover { border-color: var(--gold-soft); }
.sync { font-size: 11.5px; color: var(--sub); white-space: nowrap; }
.sync.ok { color: #2aa37a; }
.sync.err { color: #c0392b; }

/* ---------- Chart (4象限) ---------- */
.chart {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: 26px minmax(0,1fr) 26px;
  grid-template-rows: 24px minmax(0,1fr) 24px;
  grid-template-areas:
    ".    top    ."
    "left plot  right"
    ".    bottom .";
  gap: 6px;
}
.axis { color: var(--ink-soft); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.axis b { color: var(--ink); }
.axis-top { grid-area: top; }
.axis-bottom { grid-area: bottom; }
.axis-left { grid-area: left; }
.axis-right { grid-area: right; }
.axis-left span, .axis-right span { writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap; }

.plot {
  grid-area: plot;
  position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px #fff, inset 0 0 40px rgba(27,39,64,.025);
  touch-action: none;
}
.q { position: absolute; width: 50%; height: 50%; }
.q-tl { left: 0; top: 0; background: rgba(26,22,18,.045); }
.q-tr { right: 0; top: 0; background: rgba(234,84,4,.055); }
.q-bl { left: 0; bottom: 0; background: rgba(184,150,90,.075); }
.q-br { right: 0; bottom: 0; background: rgba(47,143,107,.05); }
.grid-v { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed #ddd3c2; }
.grid-h { position: absolute; top: 50%; left: 0; right: 0; border-top: 1px dashed #ddd3c2; }
.qlabel {
  position: absolute; font-size: 11px; font-weight: 700; color: rgba(26,22,18,.42);
  display: flex; flex-direction: column; gap: 1px; line-height: 1.25; pointer-events: none;
}
.qlabel small { font-size: 9.5px; font-weight: 600; color: rgba(26,22,18,.32); }
.ql-tl { left: 12px; top: 10px; }
.ql-tr { right: 12px; top: 10px; text-align: right; align-items: flex-end; }
.ql-bl { left: 12px; bottom: 10px; }
.ql-br { right: 12px; bottom: 10px; text-align: right; align-items: flex-end; }

.dots { position: absolute; inset: 0; }
/* 「点のみ」モード: ラベルは hover / 選択時だけ表示 */
.dots.labels-hover .tag { opacity: 0; pointer-events: none; transition: opacity .12s; }
.dots.labels-hover .dot:hover .tag,
.dots.labels-hover .dot.selected .tag { opacity: 1; pointer-events: auto; }

/* ---------- Dot ---------- */
.dot { position: absolute; width: 0; height: 0; z-index: 2; user-select: none; -webkit-user-select: none; touch-action: none; }
.dot .pin {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--c, #888); border: 2.5px solid #fff;
  box-shadow: 0 2px 7px rgba(27,39,64,.28); cursor: grab;
  transition: transform .08s;
}
.dot .tag {
  position: absolute; left: 0; top: 11px; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; color: var(--ink);
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  box-shadow: var(--shadow-sm); cursor: grab; max-width: 130px; overflow: hidden; text-overflow: ellipsis;
}
.dot:hover { z-index: 20; }
.dot:hover .pin { transform: translate(-50%, -50%) scale(1.25); }
.dot.dragging { z-index: 60; }
.dot.dragging .pin, .dot.dragging .tag { cursor: grabbing; }
.dot.selected { z-index: 40; }
.dot.selected .pin {
  box-shadow: 0 0 0 4px rgba(176,138,62,.35), 0 2px 8px rgba(27,39,64,.3);
  transform: translate(-50%, -50%) scale(1.2);
}
.dot.selected .tag { border-color: var(--gold); color: var(--ink); font-weight: 700; }

/* ---------- Detail panel ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; position: sticky; top: 84px; min-height: 300px;
}
.panel .empty { color: var(--sub); font-size: 13px; line-height: 1.9; }
.panel .empty h3 { color: var(--ink); font-size: 15px; margin: 0 0 8px; }
.panel .empty ul { margin: 8px 0 0; padding-left: 18px; }
.panel .empty li { margin-bottom: 4px; }

.p-head { display: flex; align-items: flex-start; gap: 10px; }
.p-cat {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; color: #fff;
}
.p-name { font-size: 20px; font-weight: 800; margin: 8px 0 2px; line-height: 1.3; }
.p-coords { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.p-chip {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: #f6f3ec; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; flex: 1; min-width: 120px;
}
.p-chip b { color: var(--ink); display: block; font-size: 14px; margin-top: 2px; }
.p-section { margin-top: 14px; }
.p-section h4 {
  font-size: 11px; letter-spacing: .8px; color: var(--gold); margin: 0 0 5px;
  text-transform: uppercase; font-weight: 800;
}
.p-section p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); white-space: pre-wrap; }
.p-actions { display: flex; gap: 8px; margin-top: 20px; }
.p-actions .btn { flex: 1; justify-content: center; text-align: center; }

/* ---------- 選考実績(applicants) ---------- */
.ap-stat { font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-left: 6px; }
.ap-stat.muted { color: var(--sub); font-weight: 600; }
.ap-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ap-empty { font-size: 12px; color: var(--sub); padding: 6px 0; }
.ap-row { border: 1px solid var(--line); border-radius: 9px; padding: 7px 30px 7px 9px; background: #fcfbf8; position: relative; }
.ap-main { display: flex; align-items: center; gap: 7px; }
.ap-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.ap-meta { font-size: 11px; color: var(--sub); margin-top: 2px; }
.ap-date { color: var(--gold); }
.ap-badge { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: #fff; white-space: nowrap; }
.ap-badge.ok { background: #2aa37a; }
.ap-badge.warn { background: #d9962b; }
.ap-badge.bad { background: #b6483a; }
.ap-badge.prog { background: #5878b8; }
.ap-ops { position: absolute; top: 6px; right: 7px; display: flex; gap: 2px; }
.ap-ic { border: none; background: transparent; cursor: pointer; font-size: 12px; opacity: .5; padding: 2px 3px; border-radius: 5px; }
.ap-ic:hover { opacity: 1; background: #ece7db; }
.ap-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-company-label { font-size: 12px; color: var(--sub); margin: 0 0 4px; }
.ap-company-label b { color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 着地設計・目標・着地プラン（井﨑メソッドの言語化欄） */
.accent-field > span { color: var(--orange) !important; }
.p-closing { background: #fff6ef; border: 1px solid #f3d9c4; border-radius: 11px; padding: 11px 13px; margin-top: 14px; }
.p-closing h4 { color: var(--orange) !important; }
.p-closing p { color: var(--ink) !important; }
.ap-goal { font-size: 11.5px; color: var(--orange-dark); font-weight: 700; margin-top: 5px; line-height: 1.5; }
.ap-landing { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.5; }
.ap-due { font-size: 11.5px; font-weight: 700; margin-top: 3px; color: var(--ink-soft); }
.ap-due.overdue, .ap-due.today { color: #c0392b; }
.ap-due.soon { color: #c9821f; }
.ap-due.done { color: var(--sub); font-weight: 600; }

/* ビュー切替 + アラート */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.vt-btn { font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 13px; border: none; background: transparent; color: var(--sub); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.vt-btn.active { background: var(--ink); color: #fff; }
.vt-btn:not(.active):hover { background: #f3f0e9; color: var(--ink); }
.alert-badge { background: #c0392b; color: #fff; font-size: 10.5px; font-weight: 800; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }

/* 学生一覧テーブル */
.students { margin-top: 10px; }
.stu-alert { background: #fdecea; border: 1px solid #f3c5bf; color: #c0392b; font-weight: 700; font-size: 13px; padding: 9px 13px; border-radius: 10px; margin-bottom: 10px; }
.stu-empty { color: var(--sub); font-size: 13px; padding: 26px 8px; text-align: center; }
.stu-wrap { overflow-x: auto; }
.stu-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.stu-table th { text-align: left; color: var(--sub); font-weight: 700; font-size: 11px; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.stu-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stu-table tr[data-ap] { cursor: pointer; }
.stu-table tbody tr:hover { background: #fbf7ef; }
.stu-table .st-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.stu-table .st-attr { color: var(--ink-soft); }
.stu-table .st-plan { color: var(--ink-soft); line-height: 1.6; min-width: 200px; }
.stu-table .st-due { font-weight: 700; white-space: nowrap; }
.st-due.overdue, .st-due.today { color: #c0392b; }
.st-due.soon { color: #c9821f; }
.st-due.done { color: var(--sub); font-weight: 600; }
.stu-table .st-ca { font-weight: 700; color: var(--gold); white-space: nowrap; }
.stu-filter { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; flex-wrap: wrap; }
.stu-filter select { font: inherit; font-size: 12.5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.stu-count { color: var(--sub); font-size: 11.5px; }
.ap-ca { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--gold); background: #f6efe0; border-radius: 999px; padding: 1px 7px; margin-right: 4px; }
.ver-badge { position: fixed; right: 8px; bottom: 6px; z-index: 50; font-size: 10px; color: var(--sub); opacity: .6; background: rgba(255,255,255,.7); padding: 1px 6px; border-radius: 6px; pointer-events: none; }
@media print { .ver-badge { display: none; } }

/* ============================================================
   ✨ ブラッシュアップ v9 — 上品・見やすさ強化(上書きレイヤー)
   ============================================================ */
:root { --shadow: 0 16px 44px rgba(26,22,18,.10); --shadow-sm: 0 4px 14px rgba(26,22,18,.07); }
body {
  background:
    radial-gradient(1200px 560px at 90% -15%, #fff3e7, transparent),
    radial-gradient(1000px 520px at -5% 4%, #f8efde, transparent),
    radial-gradient(1000px 760px at 50% 125%, #fbf4e8, transparent),
    var(--bg);
}

/* ヘッダー */
.appbar { box-shadow: 0 1px 0 rgba(26,22,18,.04), 0 10px 26px rgba(26,22,18,.04); }
.brand-logo { height: 36px; }
.brand-text h1 { font-size: 22px; letter-spacing: .4px; }
.admin-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink);
  background: linear-gradient(135deg, #ffffff, #fbf3e4); border: 1px solid var(--gold-soft);
  border-radius: 999px; padding: 6px 13px; box-shadow: var(--shadow-sm); white-space: nowrap;
}

/* ボタン */
.btn { border-radius: 11px; }
.btn-primary { box-shadow: 0 7px 18px rgba(234,84,4,.22); }

/* カード */
.board, .panel { border-radius: 20px; box-shadow: var(--shadow); border-color: #efe7d8; }
.panel { background: linear-gradient(180deg, #fffdf9, #ffffff 140px); }

/* マップ */
.plot { border-radius: 16px; background: linear-gradient(135deg, #fffdf9, #fdfaf2); box-shadow: inset 0 0 0 1px #fff, inset 0 2px 26px rgba(26,22,18,.045); }
.q-tl { background: rgba(26,22,18,.035); }
.q-tr { background: linear-gradient(135deg, rgba(234,84,4,.075), rgba(234,84,4,.015)); }
.q-bl { background: rgba(184,150,90,.06); }
.q-br { background: linear-gradient(315deg, rgba(47,143,107,.06), transparent); }
.grid-v, .grid-h { border-color: #e6dcc7; }
.qlabel { letter-spacing: .3px; }

/* ドット(光沢ピン+上品な選択リング) */
.dot .pin {
  width: 17px; height: 17px; border: 2.5px solid #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.6), rgba(255,255,255,0) 55%), var(--c, #888);
  box-shadow: 0 3px 9px rgba(26,22,18,.30), 0 0 0 1px rgba(26,22,18,.04);
  transition: transform .12s cubic-bezier(.2,.8,.2,1);
}
.dot .tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,.95); border-color: #ece5d8;
  box-shadow: 0 2px 8px rgba(26,22,18,.10);
}
.dot:hover .pin { transform: translate(-50%,-50%) scale(1.3); }
.dot.selected .pin { box-shadow: 0 0 0 4px rgba(234,84,4,.26), 0 0 0 7px rgba(184,150,90,.22), 0 3px 10px rgba(26,22,18,.3); }
.dot.selected .tag { border-color: var(--orange); color: var(--ink); box-shadow: 0 3px 12px rgba(234,84,4,.2); }

/* 詳細パネル */
.p-name { font-size: 23px; letter-spacing: .3px; }
.p-name::after { content: ""; display: block; width: 40px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--orange), var(--gold)); margin-top: 9px; }
.p-cat { box-shadow: 0 2px 8px rgba(26,22,18,.15); }
.p-chip { background: linear-gradient(180deg, #ffffff, #faf5ec); border-radius: 11px; }
.p-section h4 { display: inline-flex; align-items: center; gap: 7px; }
.p-section h4::before { content: ""; width: 14px; height: 2px; background: var(--gold); border-radius: 2px; }

/* 凡例 */
.legend .lg { border-radius: 999px; box-shadow: var(--shadow-sm); background: #fff; transition: transform .12s, border-color .12s; }
.legend .lg:hover { transform: translateY(-1px); }

/* 学生テーブル */
.stu-table thead th { background: #faf5ec; }
.stu-table tbody tr:nth-child(even) { background: #fdfbf6; }
.stu-table tbody tr:hover { background: #fff3e6; }

/* ビュー切替 / ログイン / トースト */
.view-toggle { box-shadow: var(--shadow-sm); border-radius: 11px; }
.auth-card { border-radius: 24px; box-shadow: 0 42px 92px rgba(26,22,18,.22), inset 0 0 0 1px rgba(255,255,255,.6); }
.auth-title { font-size: 26px; }
.toast { border-radius: 12px; box-shadow: 0 16px 40px rgba(26,22,18,.3); }

/* 属性ハイライト操作 */
.hl-select { font: inherit; font-size: 11.5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-soft); cursor: pointer; max-width: 200px; }
.hl-select.active { border-color: var(--gold); color: var(--ink); font-weight: 700; }

/* dot 応募数バッジ */
.dot .ap-count {
  position: absolute; left: 9px; top: -9px; transform: translateX(-50%);
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px;
  background: #1a1612; color: #fff; font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); pointer-events: none;
}
/* ハイライト時の減光 */
.dots.has-highlight .dot { opacity: .16; transition: opacity .15s; }
.dots.has-highlight .dot.hl { opacity: 1; }
.dots.has-highlight .dot.hl .pin { box-shadow: 0 0 0 4px rgba(176,138,62,.5), 0 2px 8px rgba(27,39,64,.3); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(27,39,64,.45); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 16px; width: min(560px, 100%);
  max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff;
}
.modal-head h2 { font-size: 17px; margin: 0; }
.icon-btn { border: none; background: #f3f0e9; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink-soft); }
.icon-btn:hover { background: #e7e1d3; }
.modal-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.field > span i { color: var(--gold); font-style: normal; font-size: 10px; margin-left: 4px; }
.field > span b { color: var(--gold); }
.field input[type=text], .field input[type=date], .field select, .field textarea {
  font: inherit; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; background: #fcfbf8; color: var(--ink); resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold-soft); background: #fff; }
.field input[type=range] { width: 100%; accent-color: var(--gold); }
.field .hint { font-size: 11px; color: var(--sub); }
.modal-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.modal-foot .spacer { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a1612; color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 200; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 560px) {
  .appbar { padding: 12px 14px; }
  .layout { padding: 14px; }
  .brand-text h1 { font-size: 16px; }
  .search input { width: 150px; }
}

/* ============================================================
   管理者ログイン
   ============================================================ */
.auth {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 600px at 82% -12%, #fff4ea, transparent),
    radial-gradient(820px 520px at 0% 110%, #f7efe0, transparent),
    var(--bg);
  overflow: hidden;
}
.auth.hide { opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(64px); }
.auth-glow.g1 { width: 440px; height: 440px; background: rgba(234,84,4,.16); top: -130px; right: -90px; animation: floatA 11s ease-in-out infinite; }
.auth-glow.g2 { width: 400px; height: 400px; background: rgba(184,150,90,.20); bottom: -130px; left: -100px; animation: floatB 13s ease-in-out infinite; }
.auth-f3 { position: absolute; right: -50px; bottom: -50px; width: 440px; height: 520px;
  background: url("brand/logo-mark.png") no-repeat center/contain; opacity: .055; transform: rotate(-8deg); }
@keyframes floatA { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-28px,22px)} }
@keyframes floatB { 0%,100%{transform:translate(0,0)} 50%{transform:translate(24px,-20px)} }

.auth-card {
  position: relative; z-index: 1; width: min(400px, 100%); text-align: center;
  background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 20px; padding: 38px 34px 26px;
  box-shadow: 0 30px 70px rgba(26,22,18,.16), inset 0 0 0 1px rgba(255,255,255,.5);
  animation: cardIn .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes cardIn { from{opacity:0; transform:translateY(16px) scale(.98)} to{opacity:1; transform:none} }
.auth-card.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }
.auth-logo { height: 38px; width: auto; margin: 0 auto 18px; display: block; }
.auth-rule { display: flex; align-items: center; gap: 10px; color: var(--sub); font-size: 10.5px; letter-spacing: 1px; margin-bottom: 16px; }
.auth-rule::before, .auth-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-title { font-family: "Cormorant Garamond","Noto Serif JP",serif; font-size: 23px; margin: 0; color: var(--ink); letter-spacing: .5px; }
.auth-sub { font-size: 12px; color: var(--sub); margin: 4px 0 22px; }
.auth-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: #fcfbf8; padding: 0 12px; transition: border-color .15s, box-shadow .15s; }
.auth-field:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(234,84,4,.12); background: #fff; }
.auth-ico { opacity: .55; font-size: 14px; }
.auth-field input { flex: 1; border: none; background: transparent; font: inherit; font-size: 15px; padding: 13px 2px; outline: none; color: var(--ink); }
.auth-btn { width: 100%; margin-top: 16px; padding: 13px; font-size: 15px; border-radius: 11px; position: relative; overflow: hidden; }
.auth-btn::after { content: ""; position: absolute; top: 0; left: -60%; width: 38%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); animation: shimmer 3.2s ease-in-out infinite; }
@keyframes shimmer { 0%{left:-60%} 60%,100%{left:130%} }
.auth-err { color: #c0392b; font-size: 12px; font-weight: 700; margin: 10px 0 0; min-height: 16px; }
.auth-foot { color: var(--sub); font-size: 10.5px; letter-spacing: .5px; margin: 16px 0 0; }

/* ============================================================
   ようこそ モーション(三國谷修平 → 馬淵修平)
   ============================================================ */
.welcome {
  position: fixed; inset: 0; z-index: 290; display: grid; place-items: center;
  pointer-events: none;  /* アプリをブロックしない */
  background: rgba(250, 248, 244, 0.72); backdrop-filter: blur(3px);
}
.welcome.hide { opacity: 0; transition: opacity .45s ease; }
.welcome-inner {
  text-align: center; padding: 34px 46px; pointer-events: none;
  background: #fff; border-radius: 20px; border: 1px solid var(--line);
  box-shadow: 0 26px 64px rgba(26, 22, 18, 0.18);
}
.welcome-hi { font-size: 18px; color: var(--sub); letter-spacing: 3px; margin: 0 0 8px; opacity: 0; animation: hiIn .6s ease .1s forwards; }
.welcome-name { font-family: "Cormorant Garamond","Noto Serif JP",serif; font-weight: 700; font-size: clamp(36px, 8vw, 66px); color: var(--ink); margin: 0; letter-spacing: 1px; opacity: 0; animation: hiIn .7s ease .35s forwards; }
.welcome-name span { display: inline-block; }
#w-sei { transform-origin: center; }
.welcome-name.morph #w-sei { animation: flipSwap .66s ease both; }
.welcome-name.morph #w-mei { animation: meiPulse 1s ease both; }
.welcome-san { font-size: .46em; color: var(--sub); margin-left: .25em; }
@keyframes flipSwap {
  0% { transform: rotateX(0); opacity: 1; }
  46% { transform: rotateX(88deg) translateY(-6px); opacity: 0; }
  54% { transform: rotateX(-88deg) translateY(6px); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}
@keyframes meiPulse {
  0% { color: var(--ink); }
  40% { color: var(--orange); text-shadow: 0 0 20px rgba(234,84,4,.45); transform: scale(1.09); }
  100% { color: var(--ink); transform: none; }
}
.welcome-role { margin: 22px 0 0; font-size: 14px; color: var(--orange); font-weight: 700; letter-spacing: 1.5px; opacity: 0; transform: translateY(8px); }
.welcome-role.show { animation: roleIn .5s ease forwards; }
.welcome-skip { margin: 18px 0 0; font-size: 11px; color: var(--sub); letter-spacing: 1px; opacity: .75; }
@keyframes hiIn { to { opacity: 1; transform: none; } }
@keyframes roleIn { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-glow, .auth-btn::after, .welcome-hi, .welcome-name, .welcome-name.morph #w-sei, .welcome-name.morph #w-mei { animation: none !important; }
  .welcome-hi, .welcome-name { opacity: 1 !important; }
}

/* ============================================================
   印刷 / PDF
   ============================================================ */
.print-meta { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .appbar, .board-controls, .toast, .auth, .welcome, .modal-overlay,
  .p-actions, .ap-ops, .ap-buttons, .students { display: none !important; }

  .print-meta {
    display: flex !important; align-items: center; gap: 14px;
    padding: 0 0 12px; margin: 0 0 16px; border-bottom: 2px solid var(--orange);
  }
  .print-meta img { height: 30px; width: auto; }
  .print-meta .pm-title { font-family: "Cormorant Garamond","Noto Serif JP",serif; font-size: 19px; font-weight: 700; color: var(--ink); }
  .print-meta .pm-sub { font-size: 11px; color: var(--sub); margin-top: 2px; }

  .layout { display: block !important; padding: 0 !important; max-width: none; margin: 0; }
  .board, .panel { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .chart { max-width: 640px; margin: 0 auto; }
  .plot, .q, .dot .pin, .ap-badge, .p-cat, .p-chip, .grid-v, .grid-h {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .dots.labels-hover .tag { opacity: 1 !important; }

  body[data-print="map"] .panel { display: none !important; }
  body[data-print="company"] .board { display: none !important; }
  body[data-print="company"] .panel { position: static !important; }
  body[data-print="company"] .p-applicants { display: none !important; }  /* 営業用1枚: 学生PIIは載せない */
  .p-closing { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
