:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #1f2937;
  --muted: #64748b;
  --line: #d9e1ea;
  --blue: #2563eb;
  --teal: #0f766e;
  --amber: #d97706;
  --red: #be123c;
  --green: #15803d;
  --ink: #111827;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.header-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.vendor-picker {
  display: grid;
  gap: 6px;
}

.vendor-picker label,
.field label,
.inline-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
}

select,
input {
  min-height: 40px;
  padding: 8px 10px;
}

textarea {
  min-height: 84px;
  padding: 10px;
  resize: vertical;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.view-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.view-switch button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.role-badge.admin-role {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--blue);
}

main {
  padding: 26px clamp(16px, 4vw, 40px) 48px;
}

.view-panel {
  min-width: 0;
  max-width: 1380px;
  margin: 0 auto;
}

.login-screen {
  display: grid;
  min-height: calc(100vh - 170px);
  align-content: center;
  gap: 22px;
}

.login-intro {
  max-width: 760px;
}

.login-intro h2 {
  margin-bottom: 10px;
  font-size: 30px;
}

.login-intro p {
  color: var(--muted);
  line-height: 1.7;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.login-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h3 {
  margin-bottom: 0;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-left: 7px solid var(--teal);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
}

.login-card:nth-child(2) h3 {
  border-left-color: var(--blue);
}

.login-submit {
  width: 100%;
}

.demo-account {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: stretch;
  gap: 20px;
  margin-bottom: 22px;
}

.compact-hero {
  margin-bottom: 16px;
  box-shadow: none;
}

.hero-copy {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.progress-panel {
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress-ring {
  --pct: 0%;
  display: grid;
  width: min(220px, 58vw);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--pct), #e5e7eb 0);
}

.progress-ring::before {
  content: "";
  position: absolute;
}

.progress-ring-inner {
  display: grid;
  width: 72%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: white;
  text-align: center;
}

.progress-ring strong {
  display: block;
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
}

.progress-ring span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.stat-card {
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 28px;
}

.stat-card.is-deadline-stat strong {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(190, 18, 60, 0.18);
}

.section-band {
  margin-top: 22px;
  padding: 22px 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.flow-focus {
  padding: 18px;
  border: 2px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: var(--shadow);
}

.flow-focus .section-heading {
  align-items: start;
}

.flow-focus .section-heading h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.flow-focus-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 480px;
}

.task-card,
.admin-card,
.timeline-item,
.vendor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

.task-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.action-flow {
  display: grid;
  gap: 0;
}

.flow-item {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 18px;
}

.flow-item:last-child {
  padding-bottom: 0;
}

.flow-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 48px;
  bottom: -8px;
  left: 34px;
  width: 4px;
  border-radius: 999px;
  background: #cbd5e1;
}

.flow-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
}

.flow-marker span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 3px solid #cbd5e1;
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.flow-item.is-current .flow-marker span {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.flow-item.is-complete .flow-marker span {
  border-color: var(--green);
  background: #ecfdf5;
  color: var(--green);
}

.flow-item.status-needs_fix .flow-marker span {
  border-color: var(--red);
  background: #fff1f2;
  color: var(--red);
}

.flow-card {
  position: relative;
  min-height: 112px;
}

.flow-item.is-current .flow-card {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.1);
}

.flow-item.is-complete .flow-card {
  padding-right: 130px;
  background: linear-gradient(90deg, #ffffff, #fffafa);
}

.current-pill {
  background: #eff6ff;
  color: var(--blue);
}

.vendor-accordion-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.vendor-accordion {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.vendor-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
}

.vendor-accordion summary::-webkit-details-marker {
  display: none;
}

.vendor-accordion summary span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.vendor-accordion summary span::before {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--blue);
  font-weight: 900;
}

.vendor-accordion[open] summary span::before {
  content: "-";
}

.vendor-accordion summary strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.accordion-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.done-stamp {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 2;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 5px solid rgba(190, 18, 60, 0.86);
  border-radius: 50%;
  color: rgba(190, 18, 60, 0.9);
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-13deg);
  box-shadow: inset 0 0 0 3px rgba(190, 18, 60, 0.28), 0 5px 10px rgba(190, 18, 60, 0.08);
  pointer-events: none;
}

.done-stamp::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(190, 18, 60, 0.45);
  border-radius: 50%;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-card h3 {
  margin-bottom: 4px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-chip,
.due-chip,
.deadline-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.due-chip,
.deadline-badge {
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 7px 16px rgba(190, 18, 60, 0.18);
}

.deadline-badge.compact {
  min-height: 24px;
  margin-top: 5px;
  padding: 4px 7px;
  font-size: 11px;
}

.status-not_started {
  background: #eef2f7;
  color: #475569;
}

.status-in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-submitted {
  background: #fef3c7;
  color: #92400e;
}

.status-needs_fix {
  background: #ffe4e6;
  color: #be123c;
}

.status-approved {
  background: #dcfce7;
  color: #166534;
}

.due-normal {
  background: var(--red);
  color: white;
}

.due-soon {
  background: #dc2626;
  color: white;
}

.due-overdue {
  background: #991b1b;
  color: white;
}

.due-done {
  background: var(--green);
  color: white;
  box-shadow: 0 7px 16px rgba(21, 128, 61, 0.14);
}

.task-description {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.deliverables {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.deliverables li {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-actions {
  display: grid;
  gap: 10px;
}

.document-download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.document-download-panel > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.document-download-panel strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
}

.document-download-panel.is-empty {
  border-color: var(--line);
  background: #f8fafc;
}

.document-download-panel.is-empty strong {
  color: var(--muted);
}

.submission-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: #fff7f7;
}

.submission-summary strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.file-note {
  color: var(--muted);
  font-size: 12px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.btn.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.btn.blue {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.btn.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--red);
}

.btn.ghost {
  background: transparent;
}

.btn.tiny {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.document-admin-cell {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.document-file-name {
  display: grid;
  gap: 2px;
}

.document-file-name strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.document-file-name span {
  color: var(--muted);
  font-size: 11px;
}

.document-upload-button {
  width: fit-content;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px;
  overflow: hidden;
}

.timeline-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--line);
}

.timeline-item.status-submitted::before {
  background: var(--amber);
}

.timeline-item.status-approved::before {
  background: var(--green);
}

.timeline-item.status-needs_fix::before {
  background: var(--red);
}

.timeline-item.status-in_progress::before {
  background: var(--blue);
}

.timeline-step {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-title {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

.timeline-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.category-chart {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.bar-label,
.bar-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-tabs,
.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-tabs button,
.admin-subtabs button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.admin-tabs button.is-active,
.admin-subtabs button.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.admin-subtabs {
  width: fit-content;
  max-width: 100%;
  margin-top: 0;
}

.admin-tab-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-event-grid {
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.vendor-admin-layout {
  grid-template-columns: minmax(620px, 0.9fr) minmax(420px, 1fr);
}

.admin-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-card,
.vendor-card {
  min-width: 0;
  padding: 16px;
}

.admin-card h3 {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-left: 7px solid var(--blue);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
}

.vendor-card h3 {
  margin-bottom: 12px;
}

.admin-card-copy {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-summary-item {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-summary-item strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
}

.admin-summary-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1040px, 100%);
  max-height: min(840px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
}

.modal-body h3 {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-left: 7px solid var(--blue);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
}

.modal-actions {
  margin-top: 14px;
}

.modal-table-wrap {
  max-height: 570px;
}

.event-image-card,
.add-document-card {
  border-color: #bfdbfe;
  background: #fbfdff;
}

.add-document-card {
  border-left: 6px solid var(--blue);
}

.event-image-preview {
  display: grid;
  width: 100%;
  min-height: 240px;
  margin-bottom: 14px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.event-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
}

.event-image-placeholder {
  display: grid;
  width: calc(100% - 28px);
  min-height: 190px;
  place-items: center;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.progress-mini {
  display: grid;
  gap: 6px;
  min-width: 110px;
}

.progress-mini .bar-track {
  height: 8px;
}

.matrix-table {
  min-width: 980px;
}

.vendor-overview-table {
  min-width: 620px;
}

.vendor-mobile-list {
  display: none;
}

.task-mobile-list {
  display: none;
}

.matrix-table th,
.matrix-table td {
  min-width: 130px;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 180px;
  background: white;
}

.matrix-table th:first-child {
  z-index: 3;
  background: #f8fafc;
}

.task-setting-row input[type="number"] {
  width: 90px;
}

.task-setting-row input[type="date"] {
  min-width: 150px;
}

.inline-field {
  display: grid;
  gap: 5px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .topbar,
  .hero,
  .admin-layout,
  .admin-event-grid,
  .vendor-admin-layout,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .header-controls {
    justify-content: stretch;
  }

  .vendor-picker,
  .view-switch {
    flex: 1 1 260px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-focus .section-heading {
    display: grid;
  }

  .flow-focus-meta {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 640px) {
  main {
    padding-inline: 12px;
  }

  body[data-route="admin"] main {
    padding-top: 8px;
  }

  body[data-route="vendor"] .topbar {
    position: static;
  }

  body[data-route="admin"] .topbar {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
  }

  body[data-route="admin"] .brand {
    gap: 8px;
    min-width: 0;
  }

  body[data-route="admin"] .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    font-size: 13px;
  }

  body[data-route="admin"] .brand .eyebrow {
    display: none;
  }

  body[data-route="admin"] h1 {
    font-size: 15px;
    line-height: 1.25;
  }

  body[data-route="admin"] .header-controls {
    margin-left: auto;
    gap: 6px;
  }

  body[data-route="admin"] .role-badge {
    display: none;
  }

  body[data-route="admin"] .header-controls .btn {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
  }

  body[data-route="admin"] #adminView > .section-heading {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  h1 {
    font-size: 19px;
  }

  .hero-copy,
  .progress-panel,
  .admin-card,
  .vendor-card,
  .task-card {
    padding: 14px;
  }

  .flow-focus {
    padding: 12px;
  }

  .flow-focus .section-heading h2 {
    font-size: 24px;
  }

  .vendor-accordion summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .modal-header,
  .modal-body {
    padding-inline: 14px;
  }

  .admin-tabs {
    position: sticky;
    top: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 0 -2px 12px;
    padding: 6px;
    border-color: #111827;
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  }

  .admin-tabs button {
    width: 100%;
    min-height: 42px;
    padding: 6px 5px;
    border-radius: 6px;
    color: #dbeafe;
    font-size: 13px;
    line-height: 1.25;
  }

  .admin-tabs button.is-active {
    background: var(--blue);
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  }

  .admin-subtabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .admin-subtabs button {
    width: 100%;
    min-height: 44px;
  }

  .stats-grid,
  .form-grid,
  .compact-grid,
  .admin-summary-grid,
  .document-download-panel,
  .submission-summary {
    grid-template-columns: 1fr;
  }

  .document-download-panel {
    display: grid;
    align-items: stretch;
  }

  .admin-card {
    overflow: hidden;
  }

  .admin-card h3 {
    font-size: 18px;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 8px;
  }

  .table-wrap::after {
    content: "表は横にスクロールできます";
    position: sticky;
    left: 0;
    display: block;
    padding: 7px 10px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .vendor-overview-table-wrap {
    display: none;
  }

  .task-settings-table-wrap {
    display: none;
  }

  .vendor-mobile-list {
    display: grid;
    gap: 10px;
  }

  .task-mobile-list {
    display: grid;
    gap: 10px;
  }

  .vendor-mobile-card {
    display: grid;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
  }

  .vendor-mobile-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .vendor-mobile-card-header strong {
    display: block;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.45;
  }

  .vendor-mobile-card-header span:not(.pill) {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
  }

  .vendor-mobile-progress {
    display: grid;
    gap: 6px;
  }

  .vendor-mobile-progress span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .vendor-mobile-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .vendor-mobile-meta > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
  }

  .vendor-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vendor-mobile-actions .btn {
    width: 100%;
  }

  .task-mobile-card {
    display: grid;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
  }

  .task-mobile-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .task-mobile-card-header strong {
    display: block;
    margin-top: 3px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
  }

  .task-mobile-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .task-required-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
  }

  .task-required-toggle input {
    width: 18px;
    min-height: 18px;
  }

  .task-mobile-document {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #f8fbff;
  }

  .task-mobile-document .document-admin-cell {
    min-width: 0;
  }

  .task-mobile-document .document-upload-button,
  .task-mobile-document .btn {
    width: 100%;
  }

  .matrix-table,
  table {
    min-width: 760px;
  }

  .flow-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
  }

  .flow-item:not(:last-child)::before {
    left: 25px;
  }

  .flow-marker {
    width: 52px;
    height: 58px;
  }

  .flow-marker span {
    width: 40px;
    height: 40px;
    font-size: 12px;
  }

  .flow-item.is-complete .flow-card {
    padding-right: 14px;
    padding-top: 74px;
  }

  .done-stamp {
    top: 12px;
    right: 14px;
    width: 64px;
    height: 64px;
    border-width: 4px;
    font-size: 30px;
  }

  .done-stamp::before {
    inset: 6px;
  }

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

  .view-switch {
    width: 100%;
  }

  .login-intro h2 {
    font-size: 24px;
  }
}
