/* AIDA Article UI — experience-first 2026-09-16 */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+JP:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --navy: #152238;
  --navy-mid: #1c2d4a;
  --navy-dark: #0f1a2c;
  --blue: #2f6df6;
  --blue-soft: #5b8cff;
  --blue-dark: #1f57d6;
  --ink: #152033;
  --sub: #5c6b82;
  --muted: #8b97ab;
  --line: rgba(28, 45, 74, 0.1);
  --bg: #eef2f8;
  --card: rgba(255, 255, 255, 0.86);
  --green: #15965a;
  --green-bg: #e6f7ee;
  --amber: #b86a10;
  --amber-bg: #fff4e5;
  --danger: #c0392b;
  --danger-bg: #fdeceb;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(21, 34, 56, 0.08);
  --shadow-sm: 0 4px 14px rgba(21, 34, 56, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "IBM Plex Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 109, 246, 0.16), transparent 55%),
    radial-gradient(900px 500px at 95% 5%, rgba(21, 150, 90, 0.08), transparent 50%),
    linear-gradient(165deg, #e8eef8 0%, #f4f6fb 45%, #eef3f9 100%);
  background-attachment: fixed;
}

.layout { display: flex; min-height: 100vh; align-items: stretch; }

.mobile-top { display: none; }
.side-backdrop { display: none; }

.side {
  width: 220px;
  flex: 0 0 220px;
  align-self: flex-start; /* flex+sticky: stretchだと追従しない */
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 0 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  box-shadow: 8px 0 32px rgba(15, 26, 44, 0.18);
  z-index: 40;
}

.side-brand { flex: 0 0 auto; }
.brand { display: flex; gap: 11px; align-items: flex-start; padding: 0 20px 20px; }
.brand-mark {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  border: 2.5px solid var(--blue-soft);
  border-right-color: transparent;
  transform: rotate(-30deg);
  animation: spin-slow 12s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(330deg); } }
.brand-name { font-family: Outfit, "IBM Plex Sans JP", sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.brand-tag { font-size: 10px; color: #9fb0cc; margin-top: 4px; line-height: 1.4; }

.nav { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.side-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px;
  color: #c5d0e4; text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
  position: relative;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; transform: translateX(2px); }
.nav a.on {
  background: linear-gradient(135deg, var(--blue) 0%, #457cf8 100%);
  color: #fff; font-weight: 700;
  box-shadow: 0 8px 20px rgba(47, 109, 246, 0.35);
}
.nav .ico { width: 18px; text-align: center; opacity: 0.9; }
.nav-sub {
  display: block;
  width: 100%;
  margin: 2px 0 0 28px;
  font-size: 10px;
  font-weight: 500;
  color: #9fb0cc;
  line-height: 1.3;
}
.nav a.on .nav-sub { color: rgba(255,255,255,0.85); }
.nav a { flex-wrap: wrap; }

.side-foot {
  flex: 0 0 auto;
  padding: 10px 10px 6px;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(15,26,44,0.2), rgba(15,26,44,0.55));
}
.side-aux { padding: 4px 0 0; }

.session-user--side,
.session-user--drawer {
  padding: 10px 10px 8px;
  margin-bottom: 4px;
}
.session-user__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #9fb0cc;
  margin-bottom: 4px;
}
.session-user__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.session-user__org {
  font-size: 10.5px;
  color: #9fb0cc;
  line-height: 1.35;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.session-user__logout-form { margin-top: 8px; }
.session-user__logout.logout {
  border: 0;
  background: rgba(255,255,255,0.08);
  color: #d7e0f0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  width: 100%;
  text-align: left;
  transition: color 0.2s, background 0.2s;
}
.session-user__logout.logout:hover,
.session-user__logout.logout:focus-visible {
  color: #fff;
  background: rgba(91, 140, 255, 0.28);
  outline: none;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: flex-start; align-items: center; gap: 16px;
  padding: 16px 28px 8px;
}
.logout {
  border: 0; background: transparent; color: var(--sub); cursor: pointer;
  font: inherit; font-size: 12px; padding: 4px 6px; border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.logout:hover { color: var(--blue); background: #eaf1fe; }

.hero { padding: 8px 28px 18px; animation: rise 0.55s var(--ease) both; }
.hero-eyebrow {
  font-size: 12px; font-weight: 700; color: var(--blue);
  letter-spacing: 0.08em; text-transform: none;
}
.hero-title {
  font-family: Outfit, "IBM Plex Sans JP", sans-serif;
  font-size: clamp(28px, 4vw, 36px); font-weight: 800;
  margin: 4px 0 8px; letter-spacing: -0.02em;
}
.hero-lead { font-size: 13.5px; color: var(--sub); max-width: 42em; margin: 0; }

.grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 18px;
  padding: 0 28px 32px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  animation: rise 0.6s var(--ease) both;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.18s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.card-title .ico { color: var(--blue); }

textarea {
  width: 100%; min-height: 92px; resize: vertical;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 14px; color: var(--ink);
  background: rgba(255,255,255,0.9);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.14);
  transform: translateY(-1px);
}
textarea:disabled { opacity: 0.6; }

.make-wrap { text-align: center; margin-top: 18px; }
.btn-make {
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--blue) 0%, #457cf8 55%, var(--blue-soft) 100%);
  background-size: 160% 160%;
  color: #fff; font: inherit; font-weight: 700; font-size: 15px;
  padding: 14px 42px; border-radius: 12px;
  box-shadow: 0 10px 24px rgba(47, 109, 246, 0.32);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, filter 0.2s, background-position 0.4s;
}
.btn-make:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 28px rgba(47, 109, 246, 0.4);
  background-position: 100% 50%;
}
.btn-make:active { transform: translateY(0) scale(0.98); }
.btn-make:disabled {
  background: #b8c2d4; box-shadow: none; cursor: not-allowed; transform: none;
}
.btn-make .spark {
  display: inline-block;
  animation: spark 1.8s ease-in-out infinite;
}
@keyframes spark {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.15) rotate(12deg); opacity: 0.85; }
}
.make-note { font-size: 11.5px; color: var(--sub); margin-top: 12px; }

.usage-num {
  font-family: Outfit, "IBM Plex Sans JP", sans-serif;
  font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
}
.usage-num small { font-size: 15px; font-weight: 600; color: var(--sub); margin-left: 4px; }
.bar {
  height: 8px; border-radius: 99px; background: #e4eaf3;
  margin: 14px 0 16px; overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-soft));
  border-radius: 99px;
  transition: width 1s var(--ease);
}
.plan {
  background: linear-gradient(135deg, #f7f9fc, #eef3fb);
  border-radius: 12px; padding: 13px 14px;
  border: 1px solid var(--line);
}
.plan-name { font-size: 13px; font-weight: 700; }
.plan-note { font-size: 11.5px; color: var(--sub); margin: 4px 0 0; }

.wide { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--sub);
  padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td {
  padding: 14px 10px; border-bottom: 1px solid rgba(241, 243, 248, 0.95);
  vertical-align: middle; font-size: 13px;
  transition: background 0.2s;
}
tr[data-request-id]:hover td { background: rgba(47, 109, 246, 0.04); }
.t-date { color: var(--sub); white-space: nowrap; }
.t-title { font-weight: 700; }
.t-sub { font-size: 12px; color: var(--sub); font-weight: 400; margin-top: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
}
.pill.done { background: var(--green-bg); color: var(--green); }
.pill.run {
  background: #eaf1fe; color: var(--blue);
  box-shadow: 0 0 0 0 rgba(47, 109, 246, 0.35);
  animation: pulse-ring 1.8s ease-out infinite;
}
.pill.need { background: var(--amber-bg); color: var(--amber); }
.pill.fail { background: var(--danger-bg); color: var(--danger); }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(47, 109, 246, 0.28); }
  70% { box-shadow: 0 0 0 8px rgba(47, 109, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 109, 246, 0); }
}

.btn-open {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; font: inherit; font-size: 12px; font-weight: 700;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-open:hover {
  border-color: var(--blue); color: var(--blue);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.btn-open.is-disabled {
  color: #aab3c2; cursor: not-allowed; background: #f7f8fb;
  pointer-events: none; box-shadow: none;
}

.flash, .error {
  margin: 0 28px 12px; padding: 12px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  animation: rise 0.4s var(--ease) both;
}
.flash { background: #eaf1fe; color: var(--blue); border: 1px solid rgba(47,109,246,0.15); }
.flash-live { display: grid; gap: 10px; }
.flash-live-row { display: flex; gap: 12px; align-items: flex-start; }
.flash-live-pulse {
  width: 10px; height: 10px; margin-top: 5px; border-radius: 50%;
  background: var(--blue); flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(47,109,246,0.45);
  animation: pulse-dot 1.4s ease-out infinite;
}
.flash-live.is-done .flash-live-pulse { background: var(--ok, #15965a); animation: none; box-shadow: none; }
.flash-live.is-fail .flash-live-pulse { background: var(--danger); animation: none; box-shadow: none; }
.flash-live-body { flex: 1; min-width: 0; }
.flash-live-body strong { display: block; line-height: 1.45; }
.flash-live-bar {
  margin-top: 8px; height: 6px; border-radius: 999px; background: rgba(47,109,246,0.12); overflow: hidden;
}
.flash-live-bar > i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #2f6df6, #5b8cff);
  transition: width 0.45s var(--ease);
}
.flash-live-note { margin: 6px 0 0; font-size: 12px; font-weight: 500; opacity: 0.8; }
.flash-live-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.flash-live-actions[hidden] { display: none !important; }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(47,109,246,0.45); }
  70% { box-shadow: 0 0 0 10px rgba(47,109,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,109,246,0); }
}
.error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(192,57,43,0.12); }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: "";
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,109,246,0.22), transparent 70%);
  top: -80px; right: -60px; animation: float 8s ease-in-out infinite;
}
.login-wrap::after {
  content: "";
  position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(21,150,90,0.12), transparent 70%);
  bottom: -40px; left: -40px; animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  position: relative; z-index: 1;
  animation: rise 0.55s var(--ease) both;
}
.login-card h1 {
  font-family: Outfit, "IBM Plex Sans JP", sans-serif;
  font-size: 26px; margin: 0 0 8px; letter-spacing: -0.02em;
}
.login-card p { color: var(--sub); font-size: 13.5px; margin: 0 0 18px; }
.login-card label { display: block; font-size: 12px; font-weight: 700; margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.14);
}
.login-card button {
  width: 100%; margin-top: 22px; border: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  color: #fff; font: inherit; font-weight: 700; padding: 13px;
  border-radius: 12px; cursor: pointer;
  box-shadow: 0 10px 22px rgba(47, 109, 246, 0.28);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.login-card button:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(47, 109, 246, 0.36); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    min-height: 100dvh;
  }
  .mobile-top {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 10px 12px;
    background: rgba(238, 242, 248, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    max-width: 100%;
    overflow: hidden;
  }
  .mobile-menu-btn {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 10px;
    min-height: 40px;
    cursor: pointer;
  }
  .session-user--bar {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .session-user--bar .session-user__label {
    color: var(--muted);
    margin: 0;
  }
  .session-user--bar .session-user__name {
    color: var(--ink);
    font-size: 13px;
  }
  .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 44, 0.45);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease);
  }
  .layout.is-menu-open .side-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, 86vw);
    flex-basis: auto;
    height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease);
    z-index: 60;
    box-shadow: 12px 0 36px rgba(15, 26, 44, 0.28);
  }
  .layout.is-menu-open .side {
    transform: translateX(0);
  }
  .main {
    width: 100%;
    max-width: 100%;
  }
  .grid { grid-template-columns: 1fr; padding: 0 16px 24px; }
  .hero, .topbar, .flash, .error { padding-left: 16px; padding-right: 16px; margin-left: 0; margin-right: 0; }
  body.aida-menu-lock { overflow: hidden; }
}

@media (min-width: 901px) {
  .mobile-top,
  .side-backdrop { display: none !important; }
  .side {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Keyword map */
.map-stats { display:flex; gap:18px; flex-wrap:wrap; margin-bottom:16px; }
.map-stats > div {
  min-width:120px; padding:12px 14px; border-radius:12px;
  background:linear-gradient(135deg,#f7f9fc,#eef3fb); border:1px solid var(--line);
}
.map-stats strong {
  display:block; font-family:Outfit,"IBM Plex Sans JP",sans-serif;
  font-size:28px; font-weight:800; letter-spacing:-0.02em; line-height:1.1;
}
.map-stats span { font-size:11.5px; color:var(--sub); font-weight:600; }
.map-filters { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.map-filters select, .map-add-form input, .map-add-form select {
  padding:10px 12px; border:1px solid var(--line); border-radius:10px;
  font:inherit; background:#fff; min-width:160px;
}
.map-count { font-size:12px; color:var(--sub); font-weight:600; }
.map-table-wrap { overflow-x:auto; }
tr.is-gap td { background:rgba(47,109,246,0.03); }
.pill.intent-info, .pill.status-todo { background:#eaf1fe; color:var(--blue); }
.pill.intent-compare, .pill.status-draft_wp { background:var(--amber-bg); color:var(--amber); }
.pill.intent-quote, .pill.status-published { background:var(--green-bg); color:var(--green); }
.pill.intent-nav, .pill.status-drafting { background:#f0eefc; color:#5b4db8; animation:none; }
.pill.status-decline { background:#eef1f5; color:var(--sub); }
.btn-make-sm { padding:9px 16px; font-size:12.5px; border-radius:10px; }
.map-add-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px;
}
.map-add-grid label { display:flex; flex-direction:column; gap:6px; font-size:12px; font-weight:700; }

/* Strategy brief */
.strategy-principles {
  margin: 0 0 18px; padding-left: 1.1em;
  color: var(--sub); font-size: 12.5px; line-height: 1.65;
}
.strategy-principles li { margin-bottom: 4px; }
.strategy-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 700; margin-bottom: 14px;
}
.strategy-form input, .strategy-form select {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: rgba(255,255,255,0.9);
}
.strategy-form input:focus, .strategy-form select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.14);
}
.strategy-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.strategy-recent {
  display: block; text-decoration: none; color: inherit;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  transition: color 0.2s;
}
.strategy-recent:last-child { border-bottom: 0; }
.strategy-recent:hover { color: var(--blue); }
.strategy-recent strong { display: block; font-size: 13px; margin-bottom: 4px; }
.strategy-recent span { font-size: 11.5px; color: var(--sub); }
.strategy-week {
  background: linear-gradient(135deg, rgba(47,109,246,0.08), rgba(255,255,255,0.9));
  border-color: rgba(47,109,246,0.2);
}
.strategy-pillars { font-size: 12.5px; color: var(--sub); margin: 12px 0 0; font-weight: 600; }
@media (max-width: 900px) {
  .strategy-grid { grid-template-columns: 1fr; }
}

/* L0 home move */
.home-move.stage-start { border-color: rgba(47,109,246,0.22); }
.home-move.stage-growth { border-color: rgba(184,106,16,0.28); }
.home-move.stage-mature { border-color: rgba(21,150,90,0.28); }
.stage-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:6px; }
.stage-pill {
  display:inline-flex; align-items:center;
  font-size:11.5px; font-weight:700; padding:6px 12px; border-radius:999px;
  background:#eaf1fe; color:var(--blue);
}
.stage-growth .stage-pill { background:var(--amber-bg); color:var(--amber); }
.stage-mature .stage-pill { background:var(--green-bg); color:var(--green); }
.stage-blurb { margin:0; font-size:13px; color:var(--sub); }
.home-move-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:18px; }

/* L1 chat */
.chat-log {
  max-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 2px 12px;
}
.chat-bubble {
  max-width: 92%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap;
}
.chat-bubble.assistant {
  align-self: flex-start;
  background: linear-gradient(135deg, #f3f6fb, #eaf1fe);
  border: 1px solid var(--line);
}
.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  color: #fff;
}
.chat-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px;
}
.chat-form input[type="text"] {
  flex: 1; min-width: 180px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: #fff;
}
.chat-form input[type="text"]:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.14);
}
.strategy-advanced { margin-top: 18px; font-size: 12.5px; color: var(--sub); }
.strategy-advanced summary { cursor: pointer; font-weight: 700; color: var(--ink); }

.ops-mini {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ops-mini > div {
  padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(135deg, #f7f9fc, #eef3fb);
  border: 1px solid var(--line);
}
.ops-mini strong {
  display: block; font-family: Outfit, "IBM Plex Sans JP", sans-serif;
  font-size: 22px; font-weight: 800; line-height: 1.1;
}
.ops-mini span { font-size: 11px; color: var(--sub); font-weight: 600; }

.metrics-import label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 700;
}
.metrics-import input[type="file"] {
  font: inherit; font-size: 12px; font-weight: 500;
}

/* 3-menu: home outcomes / plan / articles hub */
.home-grid { grid-template-columns: 1.4fr 1fr; }
.outcome-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.outcome-form:first-of-type { border-top: 0; padding-top: 0; }
.outcome-channel { margin: 0 0 10px; font-size: 15px; }
.outcome-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px;
}
.outcome-cell {
  padding: 10px 12px; border-radius: 12px; background: #f7f9fc; border: 1px solid var(--line);
}
.outcome-label { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.outcome-cell label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--sub); font-weight: 600; margin-bottom: 6px;
}
.outcome-cell input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit;
}

.plan-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin: 0 0 16px;
}
.plan-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
  padding: 4px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
a.plan-tab,
a.plan-tab:link,
a.plan-tab:visited {
  display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink); font: inherit; font-size: 12px; font-weight: 700;
  text-decoration: none !important;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}
a.plan-tab:hover {
  border-color: var(--blue); color: var(--blue);
  background: rgba(47, 109, 246, 0.06);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
a.plan-tab.on,
a.plan-tab.on:visited {
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 109, 246, 0.28);
}
a.plan-tab.on:hover {
  color: #fff; border-color: transparent; transform: none;
}
.plan-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-layout { grid-template-columns: 1.7fr 0.9fr; }
.plan-side .map-add-form label,
.map-add-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 700; margin-bottom: 10px;
}
.map-add-form input,
.map-add-form select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff;
}

.tree-list { list-style: none; margin: 0; padding: 0 0 0 calc(var(--depth, 0) * 14px); }
.tree-item { margin: 4px 0; }
.tree-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px; background: rgba(247,249,252,0.9); border: 1px solid var(--line);
}
.tree-toggle {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font: inherit;
}
.tree-toggle.is-leaf { border: 0; background: transparent; color: var(--muted); cursor: default; }
.tree-name { font-size: 13.5px; }
.tree-type { font-size: 11px; }
.tree-dispatch { margin-left: auto; }
.tree-children.is-collapsed { display: none; }

.mindmap-viewport {
  position: relative; height: 420px; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, rgba(47,109,246,0.08), transparent 55%),
    #f5f8fc;
  cursor: grab;
}
.mindmap-viewport.is-dragging { cursor: grabbing; }
.mindmap-canvas {
  position: absolute; left: 50%; top: 50%;
  width: 0; height: 0;
  transform: translate(-50%, -50%) scale(var(--mm-scale, 1));
  transform-origin: center center;
  transition: transform 0.15s var(--ease);
}
.mm-center {
  position: absolute; left: -70px; top: -28px; width: 140px;
  padding: 12px 10px; text-align: center; border-radius: 999px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: #fff; font-weight: 700; font-size: 12px;
  box-shadow: var(--shadow-sm);
}
.mm-node {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  min-width: 140px; max-width: 200px;
  padding: 10px 12px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.mm-type { display: block; font-size: 10px; color: var(--sub); font-weight: 700; margin-bottom: 2px; }
.mm-children { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.mm-child {
  font-size: 11px; color: var(--sub); padding: 4px 6px; border-radius: 8px; background: #f3f6fb;
}
.mindmap-controls { display: flex; gap: 6px; }

.articles-hub-grid { grid-template-columns: 1.4fr 0.8fr; margin-bottom: 4px; }

.articles-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.articles-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 8px 0 4px; }
.articles-filters input[type="search"],
.articles-filters select {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; background: #fff;
}
.articles-period-note { margin: 0 0 10px; }
.compact-connect { margin: 0 0 12px; }
.notice-banner {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; margin-bottom: 12px;
}
.notice-banner.need { border-color: #f0b4b4; background: #fff6f6; }
.notice-banner.done { border-color: #b7e0c2; background: #f3fbf5; }
.articles-list-card { margin-top: 4px; }
.articles-table th { white-space: nowrap; }
.article-title-link {
  color: var(--ink); font-weight: 700; text-decoration: none; font-size: 16px; line-height: 1.4;
}
.article-title-link:hover { text-decoration: underline; }
.metric-cell { min-width: 110px; }
.metric-value { font-weight: 700; font-size: 16px; }
.metric-missing { color: var(--sub); font-weight: 600; }
.metric-big { font-size: 28px; font-weight: 800; margin: 8px 0 4px; }
.articles-metric-cards { grid-template-columns: repeat(3, 1fr); }
.scroll-bar {
  height: 8px; background: #e8eef6; border-radius: 999px; overflow: hidden; margin-top: 8px;
}
.scroll-bar > span { display: block; height: 100%; background: var(--accent, #2f6fed); }
.article-body-preview {
  font-size: 16px; line-height: 1.7; white-space: pre-wrap; max-height: 70vh; overflow: auto;
}
.improvement-block { padding: 14px 0; border-top: 1px solid var(--line); }
.improvement-block:first-of-type { border-top: 0; padding-top: 0; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.diff-box {
  white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: #f6f8fb; border-radius: 10px;
  padding: 10px; max-height: 220px; overflow: auto; border: 1px solid var(--line);
}
.articles-mobile { display: none; }
.article-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; background: #fff;
}
.article-card-metrics { margin: 10px 0; padding-left: 18px; font-size: 15px; }

@media (max-width: 980px) {
  .home-grid, .plan-layout, .articles-hub-grid { grid-template-columns: 1fr; }
  .articles-metric-cards { grid-template-columns: 1fr; }
  .diff-grid { grid-template-columns: 1fr; }
  .outcome-grid { grid-template-columns: 1fr 1fr; }
  .articles-desktop { display: none; }
  .articles-mobile { display: block; }
}
@media (max-width: 640px) {
  .outcome-grid { grid-template-columns: 1fr; }
  .btn-make, .btn-open, .articles-filters button { min-height: 44px; }
}

/* realtime progress (2026-09-19) */
.topbar { display:flex; align-items:center; justify-content:flex-start; gap:12px; flex-wrap:wrap; }
.live-chip { max-width:100%; }
.live-chip a {
  display:inline-flex; gap:6px; align-items:center; padding:6px 10px; border-radius:999px;
  background:#eaf1fe; color:var(--blue); font-size:12px; font-weight:700; text-decoration:none;
  white-space:nowrap; max-width:100%;
}
.other-runs-banner {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 12px;
  background: #f4f6fa; border: 1px solid var(--line); font-size: 14px; line-height: 1.5;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.progress-card {
  margin: 0 0 14px; padding: 14px 16px; border-radius: 14px;
  background: #eaf1fe; color: var(--blue); border: 1px solid rgba(47,109,246,0.15);
  display: grid; gap: 8px;
  max-width: 100%; overflow-wrap: anywhere;
}
.progress-card.is-done { background: #eaf8f0; color: #0f6b3f; border-color: rgba(21,150,90,0.2); }
.progress-card.is-fail { background: var(--danger-bg); color: var(--danger); border-color: rgba(192,57,43,0.15); }
.progress-card-head { display:flex; gap:10px; align-items:flex-start; }
.progress-pulse {
  width:10px; height:10px; margin-top:6px; border-radius:50%; background:#9bb6e8; flex:0 0 auto;
}
.progress-pulse.is-on {
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(47,109,246,0.45);
  animation: pulse-dot 1.4s ease-out infinite;
}
.progress-card.is-done .progress-pulse, .progress-card.is-fail .progress-pulse { animation:none; box-shadow:none; }
.progress-headline { display:block; line-height:1.45; overflow-wrap:anywhere; }
.progress-detail { margin:0; font-size:13px; font-weight:600; opacity:0.9; }
.progress-meta { margin:0; }
.progress-stages-bar { margin-top:2px; }
.progress-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.progress-timeline { list-style:none; margin:8px 0 0; padding:0; display:grid; gap:6px; }
.progress-timeline li { display:flex; gap:8px; align-items:baseline; font-size:13px; }
.progress-timeline .tl-mark { width:1.2em; text-align:center; font-weight:700; }
.progress-timeline .is-done { opacity:0.75; }
.progress-timeline .is-current { font-weight:700; }
.progress-timeline .is-upcoming { opacity:0.45; }
.progress-timeline .is-stopped { color: var(--danger); font-weight:700; }

.main, .hero-lead, .hero-title, .articles-hero, .t-sub { overflow-wrap: anywhere; word-break: break-word; }
/* overflow-x:hidden を .layout に置くと position:sticky が効かないため .main 側へ */
.main { overflow-x: hidden; }
@media (max-height: 700px) {
  .side { padding-top: 12px; }
  .brand { padding-bottom: 12px; }
  .session-user--side { padding: 6px 8px; }
  .nav a { padding: 9px 12px; }
}
@media (max-width: 640px) {
  .topbar { align-items: flex-start; }
  .live-chip a { white-space: normal; line-height: 1.3; }
  .progress-actions .btn-make,
  .progress-actions .btn-open,
  .home-move-actions .btn-make,
  .home-move-actions .btn-open,
  .notice-banner .btn-make,
  .notice-banner .btn-open { width: 100%; justify-content: center; box-sizing: border-box; }
  .hero-lead, .articles-hero .t-sub { font-size: 14px; }
}
