:root {
  --bg: #FAFAF7;
  --bg-elevated: #FFFFFF;
  --ink: #0F172A;
  --ink-muted: #475569;
  --ink-subtle: #94A3B8;
  --line: #E5E2DA;
  --line-strong: #CFCABC;
  --accent: #E85D3A;
  --accent-ink: #B4431F;
  --accent-soft: #FBE9E1;
  --success: #0F7A4A;
  --success-soft: #E3F3EC;
  --danger: #B42318;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "游ゴシック", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Noto Sans JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ink);
  color: #FAFAF7;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.brand-sub { font-size: 11px; color: var(--ink-subtle); letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--font-display); }
.help-link {
  font-size: 14px;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 120ms ease;
}
.help-link:hover { background: var(--bg); color: var(--ink); }

/* Main */
.app-main { flex: 1; padding: 48px 0 180px; }

/* Step */
.step { margin-bottom: 48px; animation: fadeIn 240ms ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.hidden { display: none !important; }

.step-head { margin-bottom: 24px; }
.step-index {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.step-title {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.step-desc {
  font-size: 15px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.65;
}

/* Upload actions (camera + library buttons) */
.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.upload-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  text-align: left;
  user-select: none;
}
.upload-btn:active { transform: scale(0.995); }
.upload-btn svg { flex-shrink: 0; }
.upload-btn-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.upload-btn-text strong { font-size: 16px; font-weight: 700; line-height: 1.3; }
.upload-btn-text span { font-size: 12px; line-height: 1.4; }
.upload-btn-primary {
  background: var(--ink);
  color: #FAFAF7;
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-sm);
}
.upload-btn-primary:hover { background: #1E293B; }
.upload-btn-primary .upload-btn-text span { color: rgba(250, 250, 247, 0.7); }
.upload-btn-secondary {
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.upload-btn-secondary:hover { border-color: var(--accent); }
.upload-btn-secondary .upload-btn-text span { color: var(--ink-muted); }

.dropzone-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-subtle);
  text-align: center;
}

/* Invisible overlay for drag & drop */
.dropzone-drop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius-lg);
  transition: background 160ms ease, outline 160ms ease;
}
.dropzone-drop.dragover {
  pointer-events: auto;
  background: rgba(232, 93, 58, 0.08);
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

/* Preview */
.preview-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.preview-wrap img { width: 100%; display: block; max-height: 360px; object-fit: contain; background: #F5F2EC; }
.preview-retake {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(4px);
}
.preview-retake:hover { background: rgba(15, 23, 42, 1); }

/* OCR Status */
.ocr-status {
  margin-top: 16px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-muted);
}
.ocr-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Form */
.entry-form { display: flex; flex-direction: column; gap: 32px; }
.field-group { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin: 0; background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
.field-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field-row .field { margin-bottom: 0; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.field .req {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  line-height: 1.5;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 93, 58, 0.16);
}
.field textarea { resize: vertical; min-height: 84px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  color: #FAFAF7;
}
.btn-primary:hover:not(:disabled) { background: #1E293B; }
.btn-primary .btn-arrow { transition: transform 160ms ease; }
.btn-primary:hover:not(:disabled) .btn-arrow { transform: translateX(2px); }

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--ink); background: var(--bg-elevated); }

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.form-actions .btn-primary { flex: 1; max-width: 280px; }

/* Done */
.done-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.done-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  color: var(--success);
}
.done-check svg { width: 100%; height: 100%; }
.done-check circle { stroke: var(--success); stroke-width: 2; }
.done-check path { stroke: var(--success); stroke-width: 3; }
.done-title { font-size: 28px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.01em; }
.done-desc { font-size: 15px; color: var(--ink-muted); margin: 0 0 32px; }
.done-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.done-actions .btn { min-width: 140px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #FAFAF7;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-width: calc(100vw - 48px);
  animation: toastIn 220ms ease;
}
.toast.toast-error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Batch list */
.batch { margin-top: 24px; }
.batch-head { margin-bottom: 24px; animation: fadeIn 240ms ease; }
.batch-title {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
#cards-container { display: flex; flex-direction: column; gap: 16px; }

.card-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, opacity 200ms ease;
  animation: fadeIn 240ms ease;
}
.card-item[data-status="submitted"] { opacity: 0.75; border-color: #CDEBD9; background: #F4FBF7; }
.card-item[data-status="failed"] { border-color: #F6C9C2; }
.card-item[data-status="pending_ocr"] { border-color: var(--line-strong); }

.card-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.card-thumbs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.card-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.card-head-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.card-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
  letter-spacing: 0.06em;
}
.card-head-company {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.card-head-name {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.card-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-status-pill:empty { display: none; }
.pill-busy { background: #EFF4F9; color: #3F5875; }
.pill-busy::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1.5px solid #B8C6D7;
  border-top-color: #3F5875;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.pill-ready { background: #E8EDE4; color: #4D5A43; }
.pill-warn { background: #FDF2E2; color: #8A5D0B; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-error { background: #FCE6E3; color: var(--danger); }

.card-remove {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.card-remove:hover { background: #FCE6E3; border-color: var(--danger); color: var(--danger); }
.card-remove:disabled { opacity: 0.35; cursor: not-allowed; }

.card-item-body { padding: 16px; }
.back-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.back-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.back-add-btn:hover { background: var(--accent-soft); border-color: var(--accent-ink); }
.back-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.back-hint {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.card-item[data-status="submitted"] .card-item-body { display: none; }
.card-form .field-group { box-shadow: none; border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.card-form .field-group:last-child { margin-bottom: 0; }
.card-form .field-group-title { margin-bottom: 12px; font-size: 11px; }
.card-form .field { margin-bottom: 12px; }
.card-form .field-row { margin-bottom: 12px; gap: 12px; }

/* Batch bar */
.batch-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 12px 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  animation: slideUp 240ms ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.batch-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.batch-bar-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.batch-bar-count {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.batch-bar-status {
  font-size: 12px;
  color: var(--ink-muted);
}
.batch-bar .btn-primary { padding: 14px 22px; white-space: nowrap; }

/* Done list */
.done-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  max-height: 320px;
  overflow-y: auto;
}
.done-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid var(--line);
}
.done-list li.fail {
  background: #FDF0EE;
  border-color: #F6C9C2;
  color: var(--danger);
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.done-list li a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.done-list li a:hover { text-decoration: underline; }
.done-tick {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ロック画面（アクセスコード） */
body.locked { overflow: hidden; }
.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 200ms ease;
}
.lock-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
  text-align: center;
}
.lock-logo { display: block; margin: 0 auto 12px; }
.lock-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.lock-desc { margin: 0 0 20px; font-size: 13px; color: var(--ink-muted); line-height: 1.6; }
.lock-form { display: flex; flex-direction: column; gap: 12px; }
.lock-form input {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
  letter-spacing: 0.08em;
}
.lock-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.lock-submit { justify-content: center; }
.lock-error { margin: 12px 0 0; font-size: 13px; color: var(--danger); font-weight: 600; }

/* 重複警告バナー */
.dup-banner {
  border: 1px solid #F0C9A0;
  background: #FDF6EC;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.dup-banner-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8A5D0B;
}
.dup-banner-title { font-size: 13px; font-weight: 700; }
.dup-list {
  list-style: none;
  margin: 8px 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dup-list li {
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}
.dup-list a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.dup-list a:hover { color: var(--accent-ink); }
.dup-meta { font-size: 11px; color: var(--ink-muted); }
.dup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dup-actions .btn-ghost { font-size: 12px; padding: 7px 12px; }
.dup-remove-card:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); background: #FCE6E3; }
.dup-acked-note { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--success); }
.dup-banner.acked { border-color: #CDEBD9; background: #F4FBF7; }
.dup-banner.acked .dup-banner-head { color: var(--success); }

/* 操作性ポリッシュ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.batch-bar { padding-bottom: env(safe-area-inset-bottom, 0); }

/* ================= ボトムナビ ================= */
:root { --nav-h: 58px; }
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--nav-h);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-subtle);
  text-decoration: none;
  transition: color 120ms ease;
}
.bn-item.active, .bn-item:hover { color: var(--accent-ink); }
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0)); }
.batch-bar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0)); }

/* ================= 営業管理: リスト ================= */
.sales-main { padding: 16px 0 32px; }
.sales-view { animation: fadeIn 200ms ease; }

.list-toolbar { margin-bottom: 8px; }
.search-row {
  position: relative;
  margin-bottom: 10px;
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-subtle);
  pointer-events: none;
}
.search-row input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 14px 11px 38px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.search-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 120ms ease;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.list-summary { font-size: 11px; color: var(--ink-subtle); margin: 4px 2px 8px; }

.list-container { display: flex; flex-direction: column; gap: 8px; }
.rec-card {
  font: inherit;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 80ms ease;
}
.rec-card:active { transform: scale(0.99); }
.rec-card:hover { border-color: var(--line-strong); }
.rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rec-company {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rec-meta { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.rec-next {
  font-size: 12px;
  color: var(--accent-ink);
  font-weight: 600;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rec-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-subtle);
}
.rec-assignee { font-weight: 600; color: var(--ink-muted); }

.st-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.st-gray { background: #EEECE6; color: #57534E; }
.st-blue { background: #E3EDF9; color: #1D4E89; }
.st-purple { background: #EDE7F6; color: #5E35B1; }
.st-orange { background: var(--accent-soft); color: var(--accent-ink); }
.st-green { background: var(--success-soft); color: var(--success); }

.list-more-wrap { text-align: center; margin: 16px 0; }
.list-loading { font-size: 13px; color: var(--ink-subtle); padding: 12px; text-align: center; }
.empty-note { font-size: 13px; color: var(--ink-subtle); padding: 16px 8px; text-align: center; }

/* ================= 作戦会議 ================= */
.kaigi-head { margin: 8px 0 16px; }
.kaigi-title { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.kaigi-sub { font-size: 12px; color: var(--ink-muted); margin: 0; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.kpi-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1; }
.kpi-value small { font-size: 11px; font-weight: 600; color: var(--ink-muted); margin-left: 1px; }
.kpi-label { font-size: 10px; color: var(--ink-subtle); font-weight: 600; }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.panel-title { font-size: 14px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; }
.panel-note { font-size: 10px; font-weight: 600; color: var(--ink-subtle); }
.panel-help { font-size: 11px; color: var(--ink-subtle); margin: -4px 0 10px; }

.funnel { display: flex; flex-direction: column; gap: 6px; }
.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 28px;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}
.bar-row[data-status] { cursor: pointer; }
.bar-label { font-size: 11px; font-weight: 600; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 7px; background: #B9B3A4; }
.bar-gray { background: #C8C2B4; }
.bar-blue { background: #6B9BD1; }
.bar-purple { background: #9C7FD4; }
.bar-orange { background: var(--accent); }
.bar-green { background: #3D9970; }
.bar-count { font-size: 12px; font-weight: 700; text-align: right; font-family: var(--font-display); }

.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-item {
  display: block;
  font: inherit;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.mini-item:hover { border-color: var(--line-strong); }
.mini-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.mini-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { font-size: 11px; color: var(--ink-muted); margin-top: 3px; }

.assign-list { display: flex; flex-direction: column; gap: 12px; }
.assign-group { display: flex; flex-direction: column; gap: 6px; }
.assign-who { font-size: 13px; font-weight: 700; display: flex; align-items: baseline; gap: 6px; }
.assign-more { padding: 2px 4px; }

/* ================= 戦略ノート ================= */
.gen-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gen-panel.gen-stale { border-color: #F0C9A0; background: #FDF6EC; }
.gen-panel.gen-running { border-color: var(--accent); background: var(--accent-soft); }
.gen-panel.gen-running .gen-text span {
  color: var(--accent-ink);
  font-weight: 600;
}
.gen-panel.gen-running .gen-text span::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid #E8C4B2;
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
  animation: spin 700ms linear infinite;
}
.gen-text { display: flex; flex-direction: column; gap: 2px; }
.gen-text strong { font-size: 14px; }
.gen-text span { font-size: 11px; color: var(--ink-muted); }
.btn-sm { padding: 10px 16px; font-size: 13px; flex-shrink: 0; }
.notes-actions { margin: 4px 0 12px; }

.notes-list { display: flex; flex-direction: column; gap: 8px; }
.note-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.note-item:hover { border-color: var(--line-strong); }
.note-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.nb-orange { background: var(--accent-soft); color: var(--accent-ink); }
.nb-blue { background: #E3EDF9; color: #1D4E89; }
.nb-green { background: var(--success-soft); color: var(--success); }
.nb-gray { background: #EEECE6; color: #57534E; }
.note-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.note-item-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item-text span { font-size: 11px; color: var(--ink-subtle); }

.note-article { padding: 4px 2px 24px; overflow-y: auto; }
.note-article h3 { font-size: 15px; margin: 18px 0 8px; padding-left: 8px; border-left: 3px solid var(--accent); }
.note-article h4 { font-size: 13px; margin: 14px 0 6px; }
.note-article p { font-size: 13px; line-height: 1.8; margin: 0 0 8px; }
.note-article .na-li { font-size: 13px; line-height: 1.8; padding-left: 8px; }
.note-article blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--line-strong);
  background: var(--bg);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-muted);
}
.note-article hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

/* ================= ボトムシート ================= */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 160ms ease;
}
.sheet {
  width: 100%;
  max-width: 640px;
  max-height: 88dvh;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  animation: sheetUp 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-tall { min-height: 60dvh; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  margin: 4px auto 10px;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sheet-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sheet-head-text strong { font-size: 17px; font-weight: 700; line-height: 1.3; }
.sheet-head-text span { font-size: 12px; color: var(--ink-muted); }
.sheet-close {
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  cursor: pointer;
}
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.qa {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 14px;
  transition: all 120ms ease;
}
.qa:hover { background: var(--accent-soft); border-color: var(--accent-ink); }
.detail-form .field { margin-bottom: 12px; }
.detail-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.detail-form label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-muted); margin-bottom: 4px; }
.detail-form input, .detail-form select, .detail-form textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  box-sizing: border-box;
}
.detail-form input:focus, .detail-form select:focus, .detail-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.detail-extra { margin: 4px 0 12px; }
.detail-extra summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 8px 0;
}
.sheet-actions { position: sticky; bottom: 0; background: var(--bg-elevated); padding: 8px 0 4px; }
.sheet-actions .btn { width: 100%; justify-content: center; }

@media (max-width: 480px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 80px 1fr 26px; }
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  font-size: 12px;
  color: var(--ink-subtle);
  text-align: center;
}
.footer-sep { margin: 0 8px; }

@media (max-width: 480px) {
  .app-main { padding: 32px 0 160px; }
  .step-title { font-size: 26px; }
  .batch-title { font-size: 22px; }
  .done-card { padding: 32px 24px; }
  .done-title { font-size: 22px; }
  .form-actions .btn-primary { max-width: none; }
  .card-item-head { padding: 10px 12px; gap: 10px; }
  .card-thumb { width: 48px; height: 48px; }
  .card-status-pill { font-size: 10px; padding: 3px 8px; }
  .card-item-body { padding: 12px; }
  .batch-bar .btn-primary { padding: 12px 16px; font-size: 14px; }
  .batch-bar .btn-arrow { display: none; }
  .batch-bar-count { font-size: 18px; }
  .upload-btn { padding: 16px; }
  .upload-btn-text strong { font-size: 15px; }
  .upload-btn-text span { font-size: 11px; }
}

/* 社内担当者（一括登録の既定値）*/
.batch-assignee { margin-top: 16px; padding: 14px 16px; background: var(--bg-elevated); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.batch-assignee-hint { margin: 0; font-size: 12px; color: var(--ink-muted); line-height: 1.6; }
.card-head-assignee { font-size: 11px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-head-assignee:empty { display: none; }
.done-list .done-assignee { font-size: 12px; color: var(--ink-muted); margin-left: 8px; }
