:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --border: #d7dde3;
  --bg: #f6f8f7;
  --text: #22303a;
  --muted: #66788a;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border);
}
.brand h1 { margin: 0; font-size: 20px; }
.tagline { margin: 0; font-size: 12px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-info { font-size: 13px; color: var(--muted); }
.btn {
  appearance: none; border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 14px; cursor: pointer; min-height: 40px;
}
.btn:hover { background: #eef3f0; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-small { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

.dev-login {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 16px; background: #fff8e1; border-bottom: 1px solid var(--border); font-size: 13px;
}
.dev-login input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }

.layout { flex: 1; display: grid; grid-template-columns: 400px 1fr; min-height: 0; }
.sidebar { overflow-y: auto; background: #fff; border-right: 1px solid var(--border); padding: 12px; }
.filters { display: grid; gap: 8px; margin-bottom: 12px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filters select { padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.filter-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

.request-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px;
  cursor: pointer; background: #fff;
}
.request-card:hover { border-color: var(--primary); }
.request-card h3 { margin: 0 0 6px; font-size: 15px; }
.request-card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.request-card .desc { font-size: 13px; margin: 6px 0 0; color: #41505c;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; }
.badge-open { background: #2e7d32; }
.badge-in_progress { background: #1565c0; }
.badge-awaiting_review { background: #ef6c00; }
.badge-changes_requested { background: #b3261e; }
.badge-completed { background: #616161; }
.badge-withdrawn { background: #9e9e9e; }
.badge-joined { background: #1565c0; }
.badge-reported { background: #ef6c00; }
.badge-approved { background: #616161; }

.map-wrap { position: relative; min-height: 320px; }
#map { position: absolute; inset: 0; }
.map-note {
  position: absolute; right: 8px; bottom: 4px; margin: 0; font-size: 11px; color: #555;
  background: rgba(255,255,255,.8); padding: 2px 6px; border-radius: 4px; pointer-events: none;
}

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.18); z-index: 50;
  overflow-y: auto; padding: 20px;
}
.panel-close {
  position: sticky; top: 0; float: right; border: none; background: #eef3f0;
  width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer;
}
.panel h2 { margin: 4px 0 8px; font-size: 20px; }
.panel h3 { margin: 20px 0 8px; font-size: 15px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.panel .meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.panel p { line-height: 1.7; font-size: 14px; white-space: pre-wrap; }
.panel .actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.participant { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.participant .p-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.participant .p-name { font-weight: 600; font-size: 14px; }
.cs-links { font-size: 12px; margin-top: 6px; }
.cs-links a { color: var(--primary-dark); }
.event { font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.event .e-meta { color: var(--muted); font-size: 12px; }
.event .e-comment { white-space: pre-wrap; margin-top: 2px; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.form input[type="text"], .form select, .form textarea {
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-weight: 400;
}
.form .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form .area-box { border: 1px dashed var(--border); border-radius: 8px; padding: 10px; font-size: 13px; }
.error-text { color: var(--danger); font-size: 13px; min-height: 1em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #22303a; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; }
  .sidebar { border-right: none; border-top: 1px solid var(--border); order: 2; }
  .map-wrap { order: 1; }
}
