/* 展示会商談管理 ─ 白基調・緑アクセント */
:root {
  --green: #1a7f4b;
  --green-dark: #136238;
  --green-soft: #e8f4ed;
  --green-line: #b9dcc7;
  --ink: #1d2521;
  --ink-2: #4b5751;
  --ink-3: #7b8781;
  --line: #e3e8e5;
  --bg: #f6f8f7;
  --white: #fff;
  --red: #c0392b;
  --red-soft: #fdecea;
  --amber: #b26a00;
  --amber-soft: #fff4e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 28, .06), 0 2px 8px rgba(16, 40, 28, .05);
  --header-h: 56px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
.boot { padding: 40vh 0; text-align: center; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ───── レイアウト ───── */
.header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: .95rem;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--green); background: var(--green-soft); }
.header-user { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-2); }
.main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--ink-3); font-size: .9rem; margin-top: 2px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: .9rem; margin-bottom: 8px; }

.tabbar { display: none; }

@media (max-width: 760px) {
  .header { padding: 0 14px; gap: 12px; }
  .nav, .header-user .name { display: none; }
  .header-user { margin-left: auto; }
  .main { padding: 16px 14px calc(var(--tab-h) + var(--safe-b) + 28px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--white); border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--ink-3); font-size: .7rem; font-weight: 600;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--green); }
  .tabbar a.add span.plus {
    width: 52px; height: 52px; margin-top: -18px; border-radius: 50%;
    background: var(--green); color: #fff; display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(26, 127, 75, .35);
  }
  .tabbar a.add span.plus svg { width: 28px; height: 28px; }
  body.form-open .tabbar { display: none; }
  body.form-open .main { padding-bottom: calc(96px + var(--safe-b)); }
}

/* ───── ボタン ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--white); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.outline { border-color: var(--green); color: var(--green); }
.btn.outline:hover { background: var(--green-soft); }
.btn.danger { color: var(--red); border-color: #efc3bd; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn.lg { min-height: 52px; font-size: 1.05rem; padding: 0 24px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ───── カード・統計 ───── */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; color: var(--ink);
}
a.stat:hover { text-decoration: none; border-color: var(--green-line); }
.stat .label { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.stat .value { font-size: 1.9rem; font-weight: 700; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: .85rem; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.stat.alert .value { color: var(--amber); }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .value { font-size: 1.6rem; }
  .card { padding: 16px; }
}

.current-ex {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--green-soft); border: 1px solid var(--green-line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 20px;
}
.current-ex .label { font-size: .8rem; color: var(--green-dark); font-weight: 700; }
.current-ex .name { font-weight: 700; font-size: 1.05rem; }

/* 展示会別の件数バー */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; color: var(--ink); }
.bar-row:hover { text-decoration: none; }
.bar-row .bar-name { font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-num { font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-row .bar-track { grid-column: 1 / -1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--green); border-radius: 4px; }

/* ───── 一覧 ───── */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { text-decoration: none; background: #fafcfb; }
.list-item .main-col { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: .84rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--ink-3); padding: 36px 12px; }
.empty .btn { margin-top: 12px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th {
  text-align: left; font-size: .8rem; color: var(--ink-3); font-weight: 700;
  padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafcfb;
}
table.data td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:hover td { background: #fafcfb; }
table.data td.company a { font-weight: 700; }

.m-cards { display: none; }
@media (max-width: 760px) {
  .table-wrap.responsive { display: none; }
  .m-cards { display: flex; flex-direction: column; gap: 10px; }
}
.m-card {
  display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px; color: var(--ink); box-shadow: var(--shadow);
}
.m-card:hover { text-decoration: none; border-color: var(--green-line); }
.m-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.m-card .company { font-weight: 700; font-size: 1.02rem; }
.m-card .person { font-size: .9rem; color: var(--ink-2); }
.m-card .meta { font-size: .82rem; color: var(--ink-3); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.m-card .tags { margin-top: 8px; }

/* タグ */
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.tag.green { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-line); }
.tag.amber { background: var(--amber-soft); color: var(--amber); border-color: #f3d9a8; }
.tag.done { background: #f1f3f2; color: var(--ink-3); text-decoration: line-through; }
.tag svg { width: 13px; height: 13px; }
.card-icon { display: inline-flex; align-items: center; gap: 3px; color: var(--green); font-weight: 700; font-size: .85rem; }
.card-icon svg { width: 18px; height: 18px; }
.card-icon.none { color: #c4ccc8; }

/* ───── 検索 ───── */
.filters { margin-bottom: 16px; }
.filters .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.filters .row + .row { margin-top: 10px; }
.filters .actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.filter-toggle { display: none; }
@media (max-width: 760px) {
  .filters .row { grid-template-columns: 1fr 1fr; }
  .filter-toggle { display: inline-flex; }
  .filters.collapsed .more { display: none; }
}
.result-count { font-size: .9rem; color: var(--ink-2); }

/* ───── フォーム ───── */
label.field, .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span.lbl, .lbl { font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.req::after { content: "必須"; margin-left: 6px; font-size: .7rem; color: var(--red); font-weight: 700; }
input[type=text], input[type=search], input[type=date], input[type=number], input[type=password], input[type=tel], input[type=email], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid #cfd7d3; border-radius: 10px; background: var(--white);
  font: inherit; font-size: 16px; color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237b8781'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26, 127, 75, .15); }
input[type=date] { min-width: 0; }

.form-section {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px; scroll-margin-top: calc(var(--header-h) + 56px);
}
.form-section > .sec-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.form-section > .sec-head .num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none;
}
.form-section > .sec-head h2 { font-size: 1rem; }
.form-section > .sec-head .hint { margin-left: auto; font-size: .78rem; color: var(--ink-3); }
.form-section > .sec-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fgrid .span-2 { grid-column: span 2; }
.fgrid .span-3 { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .fgrid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .fgrid .span-2, .fgrid .span-m2 { grid-column: 1 / -1; }
  .form-section > .sec-body { padding: 14px 14px 16px; }
  .form-section > .sec-head { padding: 11px 14px; }
}
.subgroup > .lbl { display: block; margin-bottom: 8px; }

/* セクションへのジャンプ */
.jump {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -20px 14px; padding: 8px 20px; background: rgba(246, 248, 247, .94);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.jump::-webkit-scrollbar { display: none; }
.jump a {
  flex: none; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--white); border: 1px solid var(--line); color: var(--ink-2);
}
.jump a:hover { text-decoration: none; border-color: var(--green-line); }
.jump a.filled { color: var(--green-dark); border-color: var(--green-line); background: var(--green-soft); }
@media (max-width: 760px) { .jump { margin: 0 -14px 12px; padding: 8px 14px; } }

/* チップ（チェックボックス・ラジオ） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 14px 0 12px;
  border: 1px solid #cfd7d3; border-radius: 999px; background: var(--white);
  font-weight: 600; font-size: .95rem; color: var(--ink-2); cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.chip span::before {
  content: ""; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #b5c0ba; background: #fff; flex: none;
}
.chip input[type=radio] + span::before { border-radius: 50%; }
.chip input:checked + span { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.chip input:checked + span::before {
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5 8.5 14 15 6.5'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--green);
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(26, 127, 75, .25); }
.other-input { margin-top: 8px; }
.other-input input { max-width: 520px; }
.inline-detail { display: flex; flex-direction: column; gap: 8px; }
.proc-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; }
.proc-row .chip span { width: 100%; }
@media (max-width: 760px) { .proc-row { grid-template-columns: 112px 1fr; } }
.num-unit { display: flex; align-items: center; gap: 8px; }
.num-unit input { flex: 1; }
.num-unit .unit { color: var(--ink-2); font-weight: 600; }
.seg { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* 保存バー */
.savebar {
  position: sticky; bottom: 0; z-index: 25;
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 12px 0 calc(12px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(246, 248, 247, 0), var(--bg) 30%);
}
.savebar .status { margin-right: auto; font-size: .82rem; color: var(--ink-3); }
@media (max-width: 760px) {
  .savebar {
    position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + var(--safe-b));
    background: var(--white); border-top: 1px solid var(--line);
  }
  .savebar .btn.primary { flex: 1; min-width: 0; }
  .savebar .status { display: none; }
}

.notice {
  border-radius: 10px; padding: 12px 14px; font-size: .9rem; margin-bottom: 14px;
  background: var(--amber-soft); color: #6d4300; border: 1px solid #f3d9a8;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.notice.info { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-line); }
.notice.error { background: var(--red-soft); color: #8c2318; border-color: #efc3bd; }
.notice .grow { flex: 1; min-width: 180px; }

/* ───── 名刺画像 ───── */
.photo-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.photo-actions .btn { min-height: 56px; min-width: 0; white-space: normal; line-height: 1.3; padding: 0 10px; text-align: center; }
.photo-actions .btn svg { width: 22px; height: 22px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo {
  position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f0f3f1;
}
.photo img { display: block; width: 100%; aspect-ratio: 91 / 55; object-fit: cover; cursor: zoom-in; }
.photo .ops { display: flex; border-top: 1px solid var(--line); background: var(--white); }
.photo .ops button {
  flex: 1; min-height: 38px; border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
}
.photo .ops button + button { border-left: 1px solid var(--line); }
.photo .ops button { white-space: nowrap; padding: 0 4px; }
.photo .ops button[data-up] { flex: 0 0 40px; }
.photo .ops button:hover { background: var(--bg); }
.photo .ops button.del { color: var(--red); }
.photo .badge {
  position: absolute; top: 6px; left: 6px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); font-size: .72rem; font-weight: 700; color: var(--ink-2);
}
.photo .badge.new { color: var(--green-dark); }
.photo.uploading img { opacity: .5; }
@media (max-width: 760px) { .photos { grid-template-columns: 1fr 1fr; gap: 10px; } }

/* 撮影プレビュー */
.preview-img { width: 100%; max-width: 100%; height: auto; max-height: 52vh; object-fit: contain; background: #111; border-radius: 10px; display: block; }

/* ───── 詳細 ───── */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.detail-head .company { font-size: 1.45rem; font-weight: 700; }
.detail-head .person { font-size: 1.05rem; color: var(--ink-2); margin-top: 2px; }
.kv { display: grid; grid-template-columns: 150px 1fr; border-top: 1px solid var(--line); }
.kv > div { padding: 11px 4px; border-bottom: 1px solid var(--line); }
.kv > .k { font-size: .85rem; font-weight: 700; color: var(--ink-3); }
.kv > .v { min-width: 0; overflow-wrap: anywhere; }
.kv .sub-k { display: inline-block; min-width: 3.5em; font-size: .82rem; color: var(--ink-3); font-weight: 700; margin-right: 4px; }
.kv .line + .line { margin-top: 6px; }
@media (max-width: 760px) {
  .kv { grid-template-columns: 1fr; }
  .kv > .k { padding-bottom: 0; border-bottom: 0; }
  .kv > .v { padding-top: 2px; }
}
.memo { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.history { font-size: .85rem; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.todo-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ───── モーダル ───── */
.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 25, 20, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--white); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
}
.modal .m-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal .m-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.modal .m-body > * { min-width: 0; }
.modal .m-foot { padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal.wide { max-width: 860px; }
@media (max-width: 760px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal .m-foot .btn { flex: 1; }
}
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; }
.lightbox img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px calc(10px + var(--safe-b)); color: #fff; gap: 8px; }
.lightbox .btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .2); }

/* ───── ログイン ───── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(180deg, var(--green-soft), var(--bg) 60%); }
.login { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; font-size: 1.2rem; margin-bottom: 20px; }
.login .brand img { width: 40px; height: 40px; }
.login form { display: flex; flex-direction: column; gap: 14px; }

/* ───── トースト ───── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px);
  z-index: 80; background: #1d2521; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red); }
@media (min-width: 761px) { #toast { bottom: 28px; } }

.spinner {
  width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 48px 0; text-align: center; color: var(--ink-3); }

.role { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.role.admin { background: var(--green); color: #fff; }
.role.member { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.status-off { color: var(--red); font-weight: 700; font-size: .8rem; }

@media print {
  .header, .tabbar, .btn, .savebar, .jump { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

.grid-2 > .card + .card { margin-top: 0; }

/* ───── 2026-12-02 スマホでの使いやすさ（展示会で慌ただしい中での登録を想定） ───── */
.home-cta {
  display: flex; align-items: center; gap: 16px;
  background: var(--green); color: #fff; border-radius: 16px;
  padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(26, 127, 75, .28);
}
.home-cta:hover { text-decoration: none; background: var(--green-dark); }
.home-cta .ic { width: 56px; height: 56px; border-radius: 14px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; }
.home-cta .ic svg { width: 32px; height: 32px; }
.home-cta .t { display: block; font-size: 1.3rem; font-weight: 800; line-height: 1.3; }
.home-cta .s { display: block; font-size: .88rem; opacity: .9; }

.form-top { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.form-top .back { margin-bottom: 0; }
.form-top h1 { font-size: 1.25rem; }
#mf, .form-top, .saved-note, #draft-note, .jump { max-width: 860px; margin-left: auto; margin-right: auto; }
.saved-note svg { width: 20px; height: 20px; flex: none; }

.photo-actions .btn.primary svg { width: 24px; height: 24px; }
.photo-actions .btn { font-size: 1rem; }
.photo-actions .btn.primary { min-height: 60px; }

.filters .row { grid-template-columns: 2fr 1fr 1fr; }

.qr-box { display: flex; gap: 18px; align-items: center; }
.qr-box img { width: 180px; height: 180px; flex: none; border: 1px solid var(--line); border-radius: 10px; }

@media (max-width: 760px) {
  .header { justify-content: center; }
  .header-user, .hide-m { display: none !important; }
  .main { padding-top: 14px; }
  .page-head { margin-bottom: 12px; }
  .page-head h1 { font-size: 1.2rem; }

  /* 登録画面：上の帯も固定せず、入力欄をできるだけ広く */
  body.form-open .header { position: static; }
  body.form-open .jump { top: 0; }
  .form-section { scroll-margin-top: 60px; margin-bottom: 12px; }
  .form-section > .sec-body { gap: 14px; }
  .fgrid { gap: 10px; }
  .chips { gap: 6px; }
  .chip span { min-height: 44px; font-size: .95rem; }
  .seg { flex-wrap: nowrap; gap: 6px; }
  .seg .chip span { min-width: 0; padding: 0 12px 0 10px; justify-content: center; }
  .photo-actions { grid-template-columns: 3fr 2fr; }
  .photo-actions .btn { min-height: 60px; }
  .savebar .btn { min-height: 52px; }
  body.form-open #toast { bottom: calc(84px + var(--safe-b)); }

  .filters .row { grid-template-columns: 1fr 1fr; }
  .filters .span-m2 { grid-column: 1 / -1; }

  .detail-head .btn-row { width: 100%; }
  .detail-head .btn-row .btn { flex: 1; }
  .detail-head .company { font-size: 1.25rem; }
  .todo-box .chip { width: 100%; }
  .todo-box .chip span { width: 100%; justify-content: center; }

  .qr-box { flex-direction: column; text-align: center; }
  .qr-box .btn-row { justify-content: center; }
  #staff-add .btn { flex: none; }
}
@media (max-width: 380px) {
  .fgrid { grid-template-columns: 1fr; }
  .stat .value { font-size: 1.4rem; }
  .home-cta { padding: 16px; }
}
