:root {
  --bg: #0f172a;
  --panel: #111827;
  --accent: #10b981;
  --accent-2: #8b5cf6;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2937;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  font-family: "Noto Sans JP", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at 20% 20%, rgba(16, 185, 129, 0.08), transparent),
    radial-gradient(ellipse at 80% 0%, rgba(139, 92, 246, 0.08), transparent),
    var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: transparent;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  background: radial-gradient(ellipse at 20% 20%, rgba(16, 185, 129, 0.08), transparent),
    radial-gradient(ellipse at 80% 0%, rgba(139, 92, 246, 0.08), transparent),
    var(--bg);
}

.landing-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.landing .hero {
  max-width: 640px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.hero p {
  margin: 0 0 18px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--border);
}

.hero-btn.primary {
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  color: #0b1222;
}

.hero-btn.ghost {
  background: #0b1222;
  color: var(--text);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 8px;
  max-width: 960px;
  margin: 0 auto;
  gap: 12px;
}

.nav-links {
  display: flex;
  gap: 10px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--border);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.nav-btn.primary {
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  color: #0b1222;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.28);
}

.nav-btn.ghost {
  background: #0b1222;
  color: var(--text);
  border-color: var(--border);
}

.nav-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 20px 32px;
  max-width: 960px;
  margin: 0 auto;
}

a {
  color: var(--accent);
}

.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

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

.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

input[type="text"],
select {
  background: #0b1222;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  flex: 1;
  min-width: 180px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button.primary {
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  color: #0b1222;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.28);
}

button.ghost {
  background: #0b1222;
  color: var(--text);
  border: 1px solid var(--border);
}

button:hover {
  transform: translateY(-1px);
}

.list {
  display: grid;
  gap: 10px;
  max-height: 44vh;
  overflow-y: auto;
  padding-right: 4px;
}

.law-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.law-item:hover,
.law-item.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
}

.law-item.active {
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4);
}

.law-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.law-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #0b1222;
  background: var(--accent);
}

.markdown {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  max-height: 60vh;
  overflow-y: auto;
  background: #0b1222;
}

.list-card,
.preview-card {
  height: 100%;
}

.selected-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selected-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.chip button {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 2px 6px;
}

.small {
  font-size: 12px;
}

.ai-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-actions {
  display: flex;
  gap: 8px;
}

.report-output {
  margin-top: 10px;
  min-height: 140px;
}

.case-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #0b1222;
}

.case-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
}

.case-textarea {
  width: 100%;
  min-height: 90px;
  background: #0b1222;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}

.report-output {
  margin-top: 10px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .panel.left,
  .panel.right {
    grid-template-rows: none;
  }
  .list,
  .markdown {
    max-height: none;
  }
  .ai-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .ai-actions {
    width: 100%;
  }
  .ai-actions button {
    flex: 1;
  }
  .hero-actions {
    flex-direction: column;
  }
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 20px 24px;
  color: var(--muted);
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}
