:root {
  --bg: #f6f6f7;
  --surface: #ffffff;
  --border: #e8e8ea;
  --border-soft: #f0f0f1;
  --text-primary: #1a1a1c;
  --text-secondary: #6b6b70;
  --text-tertiary: #9a9a9e;
  --red: #e0201e;
  --red-dark: #c41715;
  --red-soft: #fdecec;
  --red-soft-border: #f8cfce;
  --yellow-soft: #fff4e0;
  --yellow-text: #b9720a;
  --green-soft: #e7f6ec;
  --green-text: #1c8a44;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(20, 20, 22, 0.04), 0 1px 12px rgba(20, 20, 22, 0.03);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-item svg { flex-shrink: 0; }

.nav-item:hover {
  background: var(--border-soft);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--red-soft);
  color: var(--red-dark);
  border-left: 3px solid var(--red);
  font-weight: 700;
}

.sidebar-spacer { flex: 1; }

.help-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.help-card .icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.help-card .help-title {
  font-weight: 700;
  font-size: 13px;
}

.help-card .help-sub {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 2px;
}

/* ---------- Main ---------- */

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 80px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 24px;
  margin: 0 0 4px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.page-header .page-sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--surface);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.user-chip .user-name {
  font-weight: 700;
  font-size: 13px;
}

/* Channel filter tabs */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.tab.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

/* Goal hero card */

.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 30px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 36px;
  align-items: center;
  margin-bottom: 20px;
}

.goal-badge {
  display: inline-block;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  background: var(--red-soft);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 12px;
}

.goal-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.3;
}

.goal-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
  max-width: 46ch;
}

.kgi-block { text-align: left; }

.kgi-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.kgi-value {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.kgi-value .kgi-unit {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 2px;
}

.progress-track {
  width: 260px;
  height: 8px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
  margin-top: 14px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--red);
}

.progress-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  width: 260px;
}

.rate-block { text-align: left; }

.rate-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.rate-value {
  font-size: 44px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.rate-value .rate-unit { font-size: 20px; margin-left: 1px; }

.remain-box {
  background: var(--red-soft);
  border: 1px solid var(--red-soft-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  min-width: 108px;
}

.remain-box .remain-label {
  font-size: 11px;
  color: var(--red-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.remain-box .remain-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.remain-box .remain-value .remain-unit { font-size: 15px; margin-left: 1px; }

/* Section heading */

.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.info-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--text-tertiary);
  color: var(--text-tertiary);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.kpi-value-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 10px 0 8px;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.kpi-value .kpi-unit { font-size: 15px; font-weight: 700; margin-left: 1px; }

.sparkline { flex-shrink: 0; }

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.kpi-footer .kpi-remain { color: var(--red); font-weight: 700; }

.kpi-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.kpi-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--red);
}

/* Three-column bottom grid */

.grid-3 {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 1.1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-link {
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Today tasks */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
}

.task-item:last-child { border-bottom: none; }

.task-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  width: 40px;
  flex-shrink: 0;
}

.task-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.task-body { flex: 1; min-width: 0; }

.task-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-plan { background: var(--yellow-soft); color: var(--yellow-text); }
.tag-shoot { background: var(--red-soft); color: var(--red-dark); }
.tag-edit { background: #eaeaf4; color: #4c4ca0; }
.tag-post { background: var(--green-soft); color: var(--green-text); }
.tag-wait { background: var(--yellow-soft); color: var(--yellow-text); }

.see-all-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-top: 12px;
  font-weight: 600;
}

/* Weekly progress pipeline */

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.pipeline-step { text-align: center; }

.pipeline-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}

.pipeline-arrow {
  color: var(--text-tertiary);
  align-self: center;
  text-align: center;
}

.pipeline-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pipeline-value {
  font-size: 20px;
  font-weight: 800;
  margin: 2px 0 8px;
}

.pipeline-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.pipeline-fill {
  height: 100%;
  background: var(--red);
  border-radius: 999px;
}

.subsection-title {
  font-size: 13px;
  font-weight: 800;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
}

.team-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  width: 44px;
  flex-shrink: 0;
}

.team-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border-soft);
  flex-shrink: 0;
}

.team-body { flex: 1; min-width: 0; }

.team-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.team-content {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* In-progress content list */

.content-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.content-item {
  display: flex;
  gap: 12px;
  align-items: center;
}

.content-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ddd, #bbb);
  flex-shrink: 0;
}

.content-body { flex: 1; min-width: 0; }

.content-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.content-deadline {
  font-size: 11px;
  color: var(--text-tertiary);
}

.content-tags { flex-shrink: 0; }

/* Floating CTA */

.fab {
  position: fixed;
  right: 36px;
  bottom: 32px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 15px 26px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(224, 32, 30, 0.35);
  cursor: pointer;
}

@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: 1fr; }
  .goal-card { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { padding: 20px 20px 90px; }
  .kpi-row { grid-template-columns: 1fr; }
  .goal-card { padding: 22px; }
  .tabs { flex-wrap: wrap; }
  .tab { padding: 8px 14px; }
  .page-header { flex-wrap: wrap; gap: 12px; }
  .header-actions { flex-wrap: wrap; gap: 10px; }
}

/* ---------- User menu dropdown ---------- */

.user-chip { position: relative; cursor: pointer; }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-width: 140px;
  padding: 6px;
  z-index: 20;
}

.user-menu[hidden] { display: none; }

.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
}

.user-menu button:hover { background: var(--border-soft); }

.sample-note {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: 6px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state .btn-primary { margin-top: 16px; }

/* ---------- Buttons / form basics (shared: auth pages, wizard, business detail) ---------- */

.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { background: var(--text-tertiary); cursor: not-allowed; }

.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--border-soft); }

.btn-ghost { background: none; color: var(--text-secondary); border-color: transparent; padding: 11px 14px; }
.btn-ghost:hover { color: var(--text-primary); }

.field-group { margin-bottom: 20px; }

.field-question {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 4px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0 0 8px;
  line-height: 1.5;
}

.field-hint b { color: var(--text-secondary); font-weight: 700; }

.field-group input[type="text"],
.field-group input[type="number"],
.field-group input[type="date"],
.field-group select,
.field-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--red);
}

.field-group textarea { resize: vertical; min-height: 64px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.chip-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover { border-color: var(--red); color: var(--red); }
.chip.selected { background: var(--red-soft); border-color: var(--red); color: var(--red-dark); }

.error-banner {
  background: var(--red-soft);
  border: 1px solid var(--red-soft-border);
  color: var(--red-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.error-banner[hidden] { display: none; }

.info-banner {
  background: var(--green-soft);
  border: 1px solid #cdeed9;
  color: var(--green-text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.info-banner[hidden] { display: none; }

.warning-banner {
  background: var(--yellow-soft);
  border: 1px solid #f3ddab;
  color: var(--yellow-text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.warning-banner[hidden] { display: none; }

/* ---------- Auth pages (login / register) ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 34px 32px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}

.auth-title {
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 4px;
}

.auth-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin: 0 0 24px;
}

.auth-card form { display: flex; flex-direction: column; gap: 14px; }

.auth-card label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 5px;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
}

.auth-card input:focus { outline: none; border-color: var(--red); }

.auth-card .btn-primary { width: 100%; margin-top: 6px; padding: 12px; }

.auth-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 18px;
}

.auth-footer a { color: var(--red); font-weight: 700; text-decoration: none; }

/* ---------- Onboarding wizard ---------- */

.wizard-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 100px;
}

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 28px;
}

.wizard-progress .seg {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border-soft);
}

.wizard-progress .seg.done { background: var(--red); }

.wizard-step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 6px;
}

.wizard-heading {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 26px;
}

.wizard-step[hidden] { display: none; }

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.channel-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface);
}

.channel-card.selected { border-color: var(--red); background: var(--red-soft); color: var(--red-dark); }

.channel-role-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.channel-role-card h4 { margin: 0 0 10px; font-size: 14px; font-weight: 800; }

.journey-stage-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.journey-stage-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.journey-stage-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.journey-channel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.month-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.month-grid label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; }

.month-grid input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
}

.kpi-candidate-block { margin-bottom: 18px; }

.kpi-candidate-block h4 { font-size: 13px; font-weight: 800; margin: 0 0 8px; }

.kpi-entry-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  position: relative;
}

.kpi-entry-card .kpi-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.review-section { margin-bottom: 22px; }

.review-section h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.review-row {
  display: flex;
  gap: 14px;
  font-size: 13px;
  padding: 4px 0;
}

.review-row .review-label { width: 120px; flex-shrink: 0; color: var(--text-tertiary); }
.review-row .review-value { flex: 1; }

/* ---------- Business detail / list ---------- */

.detail-shell { max-width: 900px; margin: 0 auto; }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.detail-header h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.detail-header .detail-sub { font-size: 13px; color: var(--text-secondary); margin: 0; }

.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 26px;
  margin-bottom: 16px;
}

.detail-section h2 { font-size: 15px; font-weight: 800; margin: 0 0 16px; }

.business-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.business-list-item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
  text-decoration: none;
  color: inherit;
}

.business-list-item:hover { border-color: var(--red); }

.business-list-item .biz-name { font-size: 15px; font-weight: 800; margin-bottom: 3px; }
.business-list-item .biz-meta { font-size: 12px; color: var(--text-tertiary); }

.badge-role {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--border-soft);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 8px;
}

@media (max-width: 720px) {
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .month-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Content list ---------- */

.channel-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--border-soft);
  padding: 3px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-bar select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  font-family: inherit;
}

.content-table {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.content-table-head {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr 1fr 0.9fr 1fr 0.9fr 0.9fr 0.8fr;
  gap: 10px;
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-soft);
}

.content-table-row {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr 1fr 0.9fr 1fr 0.9fr 0.9fr 0.8fr;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
  align-items: center;
  font-size: 13px;
}

.content-table-row:last-child { border-bottom: none; }
.content-table-row:hover { background: var(--border-soft); }

.content-table-row .col-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  min-width: 0;
}

.content-table-row .col-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-table-row .col-sub {
  color: var(--text-tertiary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--border-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-tag { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.status-未着手 { background: var(--border-soft); color: var(--text-secondary); }
.status-進行中 { background: var(--red-soft); color: var(--red-dark); }
.status-確認待ち { background: var(--yellow-soft); color: var(--yellow-text); }
.status-完了 { background: var(--green-soft); color: var(--green-text); }
.status-スキップ { background: var(--border-soft); color: var(--text-tertiary); }

/* ---------- Content detail ---------- */

.content-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.content-detail-head .channel-icon { width: 40px; height: 40px; border-radius: 10px; padding: 6px; }

.content-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.progress-pipeline {
  display: flex;
  overflow-x: auto;
  gap: 0;
  padding-bottom: 6px;
}

.progress-pipeline-step {
  flex-shrink: 0;
  min-width: 108px;
  text-align: center;
  position: relative;
  padding: 0 4px;
}

.progress-pipeline-step::before {
  content: "";
  position: absolute;
  top: 17px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-pipeline-step:first-child::before { display: none; }

.progress-pipeline-step.step-done::before { background: var(--red); }

.progress-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-tertiary);
}

.progress-pipeline-step.step-done .progress-dot { background: var(--red); border-color: var(--red); color: #fff; }
.progress-pipeline-step.step-current .progress-dot { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.progress-pipeline-step .step-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.3;
}

.step-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.step-card .step-order-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-card.step-card-done .step-order-badge { background: var(--red); color: #fff; }

.step-card .step-card-name { font-weight: 700; font-size: 13px; min-width: 96px; }

.step-card select, .step-card input[type="date"] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .content-table-head { display: none; }
  .content-table-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 18px;
  }
}

/* ---------- Calendar ---------- */

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-nav .btn-ghost, .cal-nav .btn-secondary { padding: 8px 14px; }

.cal-period-label {
  font-size: 15px;
  font-weight: 800;
  margin-left: 8px;
  min-width: 110px;
}

.user-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.user-chip-toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.user-chip-toggle.selected {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red-dark);
}

.user-chip-toggle.selected .dot { background: var(--red); }

/* Month grid */

.month-grid-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border-soft);
  gap: 1px;
}

.month-weekday {
  background: var(--surface);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-align: center;
}

.month-day-cell {
  background: var(--surface);
  min-height: 108px;
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.month-day-cell.out-of-month { background: #fbfbfb; }
.month-day-cell.out-of-month .month-day-num { color: var(--text-tertiary); }

.month-day-num {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.month-day-cell.is-today .month-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}

.cal-event-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 5px;
  border-radius: 6px;
  background: var(--border-soft);
  color: var(--text-primary);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.cal-event-chip:hover { background: var(--red-soft); }
.cal-event-chip .cal-event-time { font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
.cal-event-chip .cal-event-user { font-weight: 700; flex-shrink: 0; }
.cal-event-chip .cal-event-icon { flex-shrink: 0; width: 12px; height: 12px; color: var(--text-tertiary); }
.cal-event-chip .cal-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.cal-event-more {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 700;
  padding: 2px 5px;
}

/* Agenda (mobile) */

.agenda-list { display: none; }

.agenda-day-group { margin-bottom: 18px; }

.agenda-day-heading {
  font-size: 13px;
  font-weight: 800;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
}

.agenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}

.agenda-item:last-child { border-bottom: none; }
.agenda-item .agenda-time { font-size: 12px; font-weight: 800; width: 44px; flex-shrink: 0; }
.agenda-item .agenda-body { flex: 1; min-width: 0; }
.agenda-item .agenda-title { font-size: 13px; font-weight: 700; }
.agenda-item .agenda-sub { font-size: 12px; color: var(--text-tertiary); }

@media (max-width: 860px) {
  .month-grid-cal { display: none; }
  .agenda-list { display: block; }
  .cal-toolbar { flex-direction: column; align-items: flex-start; }
}

/* Detail / create drawer */

.cal-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 22, 0.25);
  z-index: 30;
}

.cal-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 92vw;
  background: var(--surface);
  box-shadow: -8px 0 24px rgba(20, 20, 22, 0.12);
  z-index: 31;
  padding: 24px 22px;
  overflow-y: auto;
}

.cal-drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
}

.drawer-title { font-size: 17px; font-weight: 800; margin: 0 26px 4px 0; }
.drawer-sub { font-size: 12px; color: var(--text-tertiary); margin: 0 0 18px; }

.drawer-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.drawer-row .drawer-label { width: 88px; flex-shrink: 0; color: var(--text-tertiary); }
.drawer-row .drawer-value { flex: 1; }

.drawer-actions { display: flex; gap: 8px; margin-top: 18px; }

.free-slot-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}

.free-slot-result input[type="checkbox"] { margin-right: 8px; }

/* ---------- 会議・報告（木曜会議ビュー） ---------- */

.report-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 30px;
  margin-bottom: 16px;
}

.report-section-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.report-section h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 14px;
}

.report-big-line {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  margin: 0 0 10px;
}

.report-sub-line {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0;
}

.report-sub-line b { color: var(--text-primary); font-weight: 700; }

.report-empty {
  color: var(--text-tertiary);
  font-size: 13px;
}

.report-metric-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.report-metric-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.report-metric-name { font-size: 13px; font-weight: 700; width: 100%; margin-bottom: 4px; }

.report-metric-value { font-size: 30px; font-weight: 800; }
.report-metric-value .unit { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-left: 2px; }
.report-metric-label { font-size: 11px; color: var(--text-tertiary); font-weight: 700; margin-bottom: 2px; }

.report-stat-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.report-stat-trio .stat {
  text-align: center;
  padding: 16px;
  background: var(--border-soft);
  border-radius: var(--radius-md);
}

.report-stat-trio .stat-value { font-size: 32px; font-weight: 800; }
.report-stat-trio .stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 700; margin-top: 4px; }

.report-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.report-category-cell {
  text-align: center;
  padding: 12px 6px;
}

.report-category-cell .pipeline-icon { width: 44px; height: 44px; margin: 0 auto 6px; }
.report-category-cell .cat-count { font-size: 22px; font-weight: 800; }
.report-category-cell .cat-name { font-size: 11px; color: var(--text-secondary); font-weight: 700; }

.report-section textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
}

.report-section input[type="number"] {
  width: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
}

@media (max-width: 720px) {
  .report-stat-trio { grid-template-columns: 1fr 1fr; }
  .report-category-grid { grid-template-columns: repeat(2, 1fr); }
  .report-section { padding: 20px; }
  .report-big-line { font-size: 19px; }
}
