@charset "utf-8";

/* ==========================================================
   明細書AIスタジオ  本実装スタイル
   （prototype-ai の設計言語を継承し、実運用向け部品を追加）
   ========================================================== */

:root {
  --bg:       #f6f7fb;
  --surface:  #ffffff;
  --line:     #e2e6ef;
  --ink:      #1e293b;
  --sub:      #64748b;
  --acc:      #4f46e5;
  --acc-soft: #eef2ff;
  --ai:       #7c3aed;
  --ai-soft:  #f5f3ff;
  --ok:       #059669;
  --ok-soft:  #ecfdf5;
  --warn:     #d97706;
  --warn-soft:#fffbeb;
  --ng:       #dc2626;
  --ng-soft:  #fef2f2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: "Meiryo", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- トップバー ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit;
}
.topbar .brand:hover { text-decoration: none; opacity: .9; }
.brand-mark {
  width: 27px; height: 27px; flex: 0 0 27px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff; border-radius: 8px; font-size: 15px; line-height: 1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .38);
}
.brand-name { font-weight: 800; font-size: 15.5px; letter-spacing: .01em; }
.brand-sub {
  font-size: 11px; color: var(--sub); font-weight: normal;
  padding-left: 8px; border-left: 1px solid var(--line);
}
@media (max-width: 720px) { .brand-sub { display: none; } }
.case-chip {
  background: var(--acc-soft); color: var(--acc);
  font-size: 12px; font-weight: bold;
  padding: 3px 12px; border-radius: 999px;
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mode-chip {
  font-size: 11.5px; font-weight: bold;
  padding: 3px 12px; border-radius: 999px; color: #fff; white-space: nowrap;
}
.mode-chip.pro  { background: var(--acc); }
.mode-chip.easy { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.cost-chip {
  font-size: 11.5px; color: var(--sub);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; background: #fafbfe;
}
.topbar .nav { margin-left: auto; display: flex; gap: 16px; font-size: 12.5px; }

/* ---------- レイアウト／進捗レール ---------- */
.layout {
  display: flex; align-items: flex-start; gap: 18px;
  max-width: 1280px; margin: 18px auto 50px; padding: 0 18px;
}
.rail {
  width: 216px; flex: 0 0 216px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px;
  position: sticky; top: 14px;
}
.rail a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 8px;
  color: var(--sub); font-size: 12.5px; text-decoration: none;
}
.rail a:hover { background: #f4f6fb; }
.rail .num {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 11px; font-weight: bold;
  border: 1.5px solid #cbd5e1; color: var(--sub); background: #fff;
}
.rail a.done { color: var(--ink); }
.rail a.done .num { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.rail a.cur  { background: var(--acc-soft); color: var(--acc); font-weight: bold; }
.rail a.cur .num { border-color: var(--acc); background: var(--acc); color: #fff; }
.rail-foot {
  margin-top: 8px; padding: 8px 9px 2px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--sub);
}
.main { flex: 1; min-width: 0; }

/* ---------- 見出し・カード ---------- */
.page-h { margin: 2px 0 2px; font-size: 17px; font-weight: bold; }
.page-sub { margin: 0 0 14px; color: var(--sub); font-size: 12.5px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin: 0 0 14px;
}
.card > h3 {
  margin: 0 0 10px; font-size: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card > h3 .sp { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.sub-note { font-size: 11px; color: var(--sub); font-weight: normal; }

/* ---------- バッジ・チップ・ピル ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: bold;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.badge.ai   { background: linear-gradient(135deg, #7c3aed, #6366f1); color: #fff; }
.badge.ok   { background: var(--ok-soft);  color: var(--ok);  border: 1px solid #a7f3d0; }
.badge.edit { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }
.badge.wait { background: #f1f5f9; color: var(--sub); border: 1px solid var(--line); }

.chip {
  display: inline-block;
  font-size: 11.5px; padding: 2px 10px; margin: 2px;
  border-radius: 999px;
  background: #f1f5f9; border: 1px solid var(--line); color: var(--ink);
}
.chip.on  { background: var(--acc-soft); border-color: #c7d2fe; color: var(--acc); font-weight: bold; }
.chip.ai3 { background: var(--ai-soft); border-color: #ddd6fe; color: var(--ai); }

.pill {
  display: inline-block; min-width: 52px; text-align: center;
  font-size: 11px; font-weight: bold;
  padding: 2px 8px; border-radius: 6px;
}
.pill.pass { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ng   { background: var(--ng-soft); color: var(--ng); }
.pill.skip { background: #f1f5f9; color: var(--sub); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 88px; padding: 8px 18px;
  background: var(--acc); color: #fff;
  border: 0; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: bold;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #4338ca; text-decoration: none; }
.btn.ai2 { background: linear-gradient(135deg, #7c3aed, #6366f1); }
.btn.ai2:hover { background: linear-gradient(135deg, #6d28d9, #4f46e5); }
.btn.sub {
  background: #fff; color: var(--ink);
  border: 1px solid #cbd5e1; font-weight: normal;
}
.btn.sub:hover { background: #f4f6fb; }
.btn.ok { background: var(--ok); }
.btn.sm { min-width: 0; padding: 4px 12px; font-size: 11.5px; font-weight: normal; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.step-nav { display: flex; justify-content: space-between; margin-top: 18px; }

/* ---------- 進行スピナー・トースト ---------- */
.spin { font-size: 12px; color: var(--ai); }
.spin::before {
  content: ""; display: inline-block; width: 12px; height: 12px;
  border: 2px solid #ddd6fe; border-top-color: var(--ai); border-radius: 50%;
  margin-right: 6px; vertical-align: -2px;
  animation: rot .8s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1e293b; color: #fff; font-size: 13px;
  padding: 10px 20px; border-radius: 10px; z-index: 100;
  max-width: 80vw; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.toast.err { background: var(--ng); }

/* ---------- 入力部品 ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="search"], textarea, select {
  width: 100%; padding: 7px 10px;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--ink); background: #fff;
}
textarea { resize: vertical; line-height: 1.8; }
input::placeholder, textarea::placeholder { color: #9aa7b8; }
input[type="number"] { width: 64px; }
.form-line {
  display: grid; grid-template-columns: 140px 1fr;
  align-items: center; gap: 10px; margin: 0 0 8px;
}
.form-line > label { font-size: 12.5px; color: var(--sub); text-align: right; }
.chk-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 8px 0; }
.chk-line input { width: auto; }

/* ---------- メーター・チェックリスト ---------- */
.meter { height: 10px; border-radius: 999px; overflow: hidden; background: #eaedf4; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .4s; }
.check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ck {
  font-size: 11.5px; padding: 4px 9px;
  border-radius: 8px; display: flex; align-items: center; gap: 6px;
  background: var(--ok-soft); color: #065f46; border: 1px solid #a7f3d0;
}
.ck.no { background: #f8fafc; color: #94a3b8; border-color: var(--line); }

/* ---------- チャット ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 13px; }
.msg .who { display: block; font-size: 10.5px; color: var(--sub); margin-bottom: 3px; font-weight: bold; }
.msg.ai   { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.ai .who { color: var(--ai); }
.msg.user { align-self: flex-end; background: var(--acc-soft); border-top-right-radius: 4px; }

/* ---------- テーブル ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl thead th {
  background: #f8fafc; color: var(--sub);
  font-size: 11.5px; text-align: left;
  padding: 7px 8px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
.tbl tbody td { padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover td { background: #fafbff; }
.tbl .c-chk { width: 30px; text-align: center; }
.tbl .c-chk input { width: auto; }
.tbl .bold { font-weight: bold; }
.tbl .sub { color: var(--sub); font-size: 11.5px; }
.tbl textarea { font-size: 12px; padding: 5px 8px; min-width: 110px; }
.tbl input[type="text"] { font-size: 12px; padding: 5px 8px; }

.cmp td, .cmp th { text-align: center; }
.cmp td:first-child, .cmp th:first-child { text-align: left; }
.mark { font-weight: bold; font-size: 14px; }
.mark.o { color: var(--ok); }
.mark.d { color: var(--warn); }
.mark.x { color: var(--ng); }

.del-row {
  border: 0; background: none; cursor: pointer;
  color: #94a3b8; font-size: 13px; padding: 4px;
}
.del-row:hover { color: var(--ng); }
.add-row {
  display: block; width: 100%;
  margin-top: 6px; padding: 7px 10px;
  background: #f8fafc; color: var(--sub);
  border: 1px dashed #cbd5e1; border-radius: 8px;
  font-family: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.add-row:hover { background: #f1f5f9; color: var(--acc); }

/* ---------- 発明単位カード ---------- */
.unit-card {
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px; background: #fff;
}
.unit-card.sel { border-color: var(--acc); background: #fbfcff; }
.unit-card h4 {
  margin: 0 0 10px; font-size: 13.5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.unit-card h4 input[type="checkbox"] { width: 18px; height: 18px; }
.unit-key { width: 44px !important; font-weight: bold; text-align: center; }
.unit-title { flex: 1; min-width: 180px; font-weight: bold; }
.role-sel { width: auto; font-size: 12px; }
.kv { display: grid; grid-template-columns: 150px 1fr; row-gap: 8px; column-gap: 12px; font-size: 12.5px; }
.kv dt { color: var(--sub); padding-top: 6px; }
.kv dd { margin: 0; }

/* ---------- 検証 ---------- */
.vrow {
  display: grid; grid-template-columns: 70px 1fr;
  gap: 12px; align-items: start;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.vrow:last-child { border-bottom: 0; }
.vrow .v-t { font-weight: bold; font-size: 12.5px; }
.vrow .v-d { color: var(--sub); font-size: 12px; }
.fix {
  background: var(--ai-soft); border-left: 3px solid var(--ai);
  border-radius: 6px; padding: 8px 12px; margin-top: 6px; font-size: 12.5px;
}
.fix b { color: var(--ai); }
.notice {
  background: var(--ai-soft); border-left: 3px solid var(--ai);
  border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; font-size: 12.5px;
}
.notice b:first-child { color: var(--ai); }

/* ---------- 請求項カード ---------- */
.claim-card h3 { gap: 6px; }
.claim-no { width: 56px !important; }
.claim-card textarea { font-family: "Meiryo", serif; }

/* ---------- 書類スタジオ ---------- */
.doc-grid { display: flex; flex-direction: column; gap: 0; }
.doc-text {
  width: 100%; margin-top: 6px;
  font-family: "MS Mincho", "ＭＳ 明朝", "Yu Mincho", serif;
  font-size: 13px; line-height: 2.0;
  background: #fffdf8;
}
/* 明細書生成中の思考プレビュー */
.stream-think {
  margin: 6px 0 0;
  padding: 8px 12px;
  background: var(--ai-soft);
  border-left: 3px solid var(--ai);
  border-radius: 6px;
  font-size: 12px; color: var(--ai);
  line-height: 1.7;
  max-height: 90px; overflow: hidden;
  white-space: pre-wrap; word-break: break-all;
  animation: think-pulse 1.6s ease-in-out infinite;
}
@keyframes think-pulse { 0%,100% { opacity: .75; } 50% { opacity: 1; } }
.biblio-box { margin: 0 0 10px; font-size: 12.5px; }
.biblio-box summary { cursor: pointer; color: var(--acc); margin-bottom: 8px; }

/* S8: 図面の一覧サムネイル（省スペース） */
.fig-strip {
  display: grid; gap: 10px; margin: 10px 0 0;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.fig-thumb { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.fig-thumb img, .fig-thumb-empty {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.fig-thumb img { cursor: zoom-in; transition: border-color .15s, transform .15s; }
.fig-thumb img:hover { border-color: var(--acc); transform: scale(1.03); }
.fig-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); font-size: 11px; background: #fafafa; border-style: dashed;
}
.fig-thumb figcaption {
  font-size: 11px; line-height: 1.35; color: var(--sub);
  display: flex; flex-direction: column; gap: 1px;
}
.fig-thumb figcaption b { color: var(--fg); }
.fig-thumb figcaption span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 書類の版履歴 */
.rev-box { font-size: 12px; margin-left: 4px; }
.rev-box summary { cursor: pointer; color: var(--muted); }
.rev-box[open] summary { color: var(--acc); }
.rev-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow-y: auto; }
.rev-list li { display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; }
.rev-meta { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 添付資料 ---------- */
.know-item { margin-bottom: 6px; font-size: 12.5px; }
.know-item summary { cursor: pointer; }
.know-body {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin: 6px 0 0; font-size: 12px; color: var(--sub);
  max-height: 240px; overflow-y: auto;
}

/* ---------- モード選択（ホーム） ---------- */
.choose { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.choice {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 18px 20px;
}
.choice:hover { border-color: #c7d2fe; }
.choice.easy { border-color: #ddd6fe; background: linear-gradient(180deg, #fbfaff, #fff); }
.choice h3 { margin: 0 0 6px; font-size: 15px; }
/* 受付停止中のモード（調査中） */
.choice.disabled-mode { background: #fafafa; border-color: var(--line); }
.choice.disabled-mode:hover { border-color: var(--line); }
.choice.disabled-mode h3, .choice.disabled-mode > p { opacity: .55; }
.choice.disabled-mode textarea, .choice.disabled-mode .chk-line { opacity: .5; }
.choice .cost {
  font-size: 11.5px; color: var(--sub);
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; margin: 10px 0;
}
.note-list { margin: 6px 0; padding-left: 20px; font-size: 12.5px; color: var(--sub); }
.note-list li { margin: 3px 0; }

/* ---------- おまかせ実行ログ ---------- */
.tl { list-style: none; margin: 12px 0 0; padding: 0; }
.tl li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 12.5px;
}
.tl li:last-child { border-bottom: 0; }
.tl .st { width: 20px; text-align: center; font-weight: bold; color: var(--ok); }
.tl .st.run { color: var(--ai); }
.tl .st.err { color: var(--ng); }
.tl .st.skip { color: var(--sub); }
.tl .tm { margin-left: auto; color: var(--sub); font-size: 11px; white-space: nowrap; }

/* おまかせ一括: 工程ごとの実況＋ミニ進捗バー */
.tl .ez-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tl .ez-label { font-weight: 600; }
.tl .ez-note {
  color: var(--sub); font-size: 11.5px; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 14px;
}
.tl .ez-mini { display: block; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tl .ez-mini i {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--ai), var(--acc)); transition: width .45s ease;
}

/* ---------- 進捗パネル（長時間処理） ---------- */
.progress-box {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  background: linear-gradient(180deg, #faf9ff, #fff);
  font-size: 12.5px;
}
.pg-head { display: flex; align-items: center; justify-content: space-between; }
.pg-title { font-weight: bold; color: var(--ai); }
.pg-title::before {
  content: ""; display: inline-block; width: 11px; height: 11px;
  border: 2px solid #ddd6fe; border-top-color: var(--ai); border-radius: 50%;
  margin-right: 7px; vertical-align: -1px; animation: rot .8s linear infinite;
}
.pg-time { font-variant-numeric: tabular-nums; color: var(--sub); font-size: 12px; }
.pg-bar { position: relative; height: 8px; margin: 8px 0 2px; border-radius: 999px; background: #eae7fb; overflow: hidden; }
.pg-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .18s linear; }
.pg-pct { font-variant-numeric: tabular-nums; font-weight: bold; color: var(--ai); font-size: 12px; }
.pg-est { color: var(--sub); font-size: 11px; font-weight: normal; }
.pg-phase { margin: 6px 0 0; color: var(--ink); min-height: 1.4em; }
.pg-searches { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pg-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #eef2ff; border: 1px solid #c7d2fe; color: var(--acc);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pg-safe {
  margin: 8px 0 0; padding: 7px 10px;
  background: var(--ok-soft); border: 1px solid #a7f3d0; border-radius: 8px;
  color: #065f46; font-size: 11.5px; line-height: 1.6;
}
.stream-think + .pg-safe { margin-top: 6px; }

/* 文献リストの favicon */
.fav {
  width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px;
  border-radius: 3px; background: #f1f5f9;
}

/* ---------- 図面スタジオ ---------- */
.fig-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.fig-info { min-width: 0; }
.fig-preview { }
.fig-img {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; display: block;
}
.fig-empty {
  width: 100%; aspect-ratio: 4 / 3;
  border: 1px dashed #cbd5e1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #9aa7b8; background: #fafbfe; font-size: 12px;
}
.fig-card h3 { gap: 8px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .rail { width: 100%; flex: none; position: static; display: flex; flex-wrap: wrap; }
  .rail a { flex: 1 1 40%; }
  .rail-foot { display: none; }
  .choose { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
  .form-line { grid-template-columns: 1fr; }
  .form-line > label { text-align: left; }
  .fig-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   ログイン画面（独立ページ・洗練レイアウト）
   ========================================================== */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(124,58,237,.35), transparent 60%),
    radial-gradient(1000px 500px at 110% 110%, rgba(79,70,229,.35), transparent 55%),
    linear-gradient(135deg, #1e1b3a 0%, #2a2352 45%, #1b2352 100%);
}
.login-wrap { width: 100%; max-width: 410px; }
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 34px 32px 30px;
  box-shadow: 0 24px 60px rgba(15, 12, 40, .45), 0 2px 8px rgba(0,0,0,.2);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; margin-bottom: 12px;
  font-size: 30px; color: #fff; line-height: 1;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(99, 102, 241, .5);
}
.login-brand h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.login-tag { margin: 6px 0 0; font-size: 12px; color: var(--sub); }

.login-form { margin-top: 8px; }
.login-field { margin-bottom: 15px; }
.login-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--sub); margin-bottom: 6px;
}
.login-field input {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid #e2e6ef; border-radius: 10px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: #f8fafc; transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-field input:focus {
  outline: none; background: #fff;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}
.login-btn {
  width: 100%; margin-top: 6px; padding: 12px;
  font-size: 15px; font-weight: 700; border: 0; border-radius: 10px;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow: 0 10px 24px rgba(99, 102, 241, .4);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.login-btn:hover { filter: brightness(1.05); box-shadow: 0 12px 28px rgba(99,102,241,.5); }
.login-btn:active { transform: translateY(1px); }

.login-msg {
  padding: 11px 14px; border-radius: 10px; font-size: 12.5px;
  margin-bottom: 16px; line-height: 1.6;
}
.login-msg.err { background: var(--ng-soft); color: #b91c1c; border: 1px solid #fecaca; }
.login-msg.hint { background: var(--ai-soft); color: #6d28d9; border: 1px solid #ddd6fe; }
.login-msg code {
  background: rgba(124,58,237,.12); padding: 1px 6px; border-radius: 5px;
  font-size: 12px; font-weight: 700;
}
.login-foot {
  text-align: center; margin: 18px 4px 0;
  font-size: 11px; color: rgba(255,255,255,.6); line-height: 1.7;
}
@media (max-width: 460px) {
  .login-card { padding: 26px 22px; }
}

/* ==========================================================
   添付資料サムネイル ＆ 画像ライトボックス（クリックで拡大）
   ========================================================== */
.know-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.know-item {
  width: 190px; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; background: #fafbfe;
}
.know-thumb {
  display: block; width: 100%; height: 120px;
  object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  cursor: zoom-in; transition: transform .12s, box-shadow .12s;
}
.know-thumb:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(30,41,59,.14); }
.know-pdf {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 30px; color: var(--sub); text-decoration: none; cursor: pointer;
}
.know-pdf span { font-size: 11px; font-weight: bold; }
.know-item details { margin-top: 6px; font-size: 12px; }
.know-item summary { cursor: pointer; }
.know-item .chip { max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fig-img.zoomable { cursor: zoom-in; }
.fig-img.zoomable:hover { box-shadow: 0 6px 20px rgba(30,41,59,.18); }

/* ライトボックス */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(12, 10, 28, .88);
  padding: 28px 20px; cursor: zoom-out;
  animation: lb-in .14s ease-out;
}
@keyframes lb-in { from { opacity: 0 } to { opacity: 1 } }
.lightbox img {
  max-width: 94vw; max-height: 84vh;
  background: #fff; border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  cursor: default;
}
.lightbox .lb-cap {
  margin-top: 14px; color: #fff; font-size: 13px; text-align: center;
  max-width: 80vw; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.lightbox .lb-close {
  position: absolute; top: 16px; right: 22px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.26); }
.lightbox .lb-open {
  margin-top: 8px; color: #c7d2fe; font-size: 12px; text-decoration: underline;
}

/* ==========================================================
   トップページ ― 見出し行と利用状況
   ========================================================== */

.home-top {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  margin: 0 0 18px; align-items: center;
}
@media (max-width: 900px) { .home-top { grid-template-columns: 1fr; } }
.home-lead { padding-top: 6px; }
.home-domain {
  margin: 0 0 6px; font-size: 12px; letter-spacing: .14em; font-weight: 700;
  color: var(--acc);
}

/* 見出しのアイコンチップ */
.sec-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px; margin-right: 8px;
  font-size: 13px; font-weight: 700; vertical-align: -4px;
}
.ic-new  { background: var(--acc-soft);  color: var(--acc); }
.ic-list { background: var(--ai-soft);   color: var(--ai); }
.ic-note { background: var(--warn-soft); color: var(--warn); }

/* 利用状況（通常は1行の最小表示、上限到達時のみ拡大） */
.usage-mini {
  justify-self: end; align-self: center;
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--sub); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 14px;
}
.usage-mini b { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.usage-mini span + span { border-left: 1px solid var(--line); padding-left: 10px; }

.usage-alert {
  display: grid; gap: 4px; padding: 12px 16px;
  border-radius: 10px; border: 1px solid #fecaca; background: var(--ng-soft);
  font-size: 12.5px; line-height: 1.7;
}
.usage-alert b { color: var(--ng); font-size: 13px; }
.usage-alert .ua-sub { color: var(--sub); font-size: 11.5px; }

/* モード選択の色分け */
.choice.easy h3 { color: var(--ai); }
.choice.pro  h3 { color: var(--acc); }
.steps-rail { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.steps-rail span {
  font-size: 10.5px; color: var(--sub); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px;
}

/* 注意書きのアイコン
   本文は必ず .nt でひとまとめにする。grid/flex の直下に裸のテキストノードを
   置くと独立した子要素になり、アイコン用の狭い列に落ちて崩れるため。 */
.note-list.icons { list-style: none; padding: 0; margin: 6px 0 0; }
.note-list.icons li {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 9px; font-size: 12.5px; line-height: 1.75; color: var(--sub);
}
.note-list.icons .nt { flex: 1; min-width: 0; }
.note-list.icons b { color: var(--ink); }
.ni {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; display: flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.ni-warn { background: var(--warn-soft); color: var(--warn); }
.ni-info { background: var(--acc-soft);  color: var(--acc); }
.ni-lock { background: var(--ok-soft);   color: var(--ok); }

/* ポイント上限の通知 */
.points-alert {
  display: grid; gap: 3px; margin: 0 0 16px; padding: 12px 16px;
  border-radius: 10px; border: 1px solid #fecaca; background: var(--ng-soft);
  font-size: 12.5px; line-height: 1.7; color: var(--ink);
}
.points-alert b { color: var(--ng); }

/* ホーム: 案件作成時の初期添付（図面PDF・参考資料） */
.init-files { margin: 8px 0 2px; }
.init-file-list {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.init-file-list li { display: inline-flex; align-items: center; gap: 2px; }
.init-file-list .chip { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.init-file-list .rm {
  border: none; background: none; cursor: pointer;
  color: var(--sub); font-size: 12px; padding: 2px 4px;
}
.init-file-list .rm:hover { color: var(--ng); }
.init-file-list .rm:disabled { visibility: hidden; }
.init-file-status { margin-top: 6px; }
.choice.disabled-mode .init-files { opacity: .5; }
