:root {
  --primary: #1f4e79;
  --primary-light: #e8f0f8;
  --accent: #c0392b;
  --text: #222;
  --muted: #666;
  --border: #ddd;
  --bg: #f6f7f9;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}
a { color: var(--primary); }
header.site-header { background: var(--primary); color: #fff; }
header.site-header .inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
header.site-header a { color: #fff; text-decoration: none; }
.site-title { font-size: 1.4rem; font-weight: bold; }
nav a { margin-left: 16px; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 20px; margin-bottom: 20px;
}
h1 { font-size: 1.6rem; margin-top: 0; }
h2 { font-size: 1.25rem; border-left: 5px solid var(--primary); padding-left: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--primary-light); border-radius: 8px; padding: 16px; text-align: center; }
.stat .num { font-size: 2rem; font-weight: bold; color: var(--primary); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--primary-light); white-space: nowrap; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-form input[type=text], .search-form select { padding: 8px; border: 1px solid var(--border); border-radius: 4px; min-width: 240px; }
button, .btn {
  background: var(--primary); color: #fff; border: none; border-radius: 4px;
  padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-block; font-size: .95rem;
}
.btn-danger { background: var(--accent); }
.btn-link { background: none; color: var(--primary); padding: 0; text-decoration: underline; }
.muted { color: var(--muted); font-size: .9rem; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: .8rem;
  background: #eee; color: #333; white-space: nowrap;
}
.badge-achieved { background: #d4edda; color: #155724; }
.badge-partially_achieved { background: #e2f0d9; color: #3c763d; }
.badge-in_progress { background: #fff3cd; color: #856404; }
.badge-not_started { background: #e2e3e5; color: #383d41; }
.badge-broken { background: #f8d7da; color: #721c24; }
.score { color: #e6a700; letter-spacing: 1px; }
.breadcrumb { font-size: .9rem; margin-bottom: 12px; color: var(--muted); }
.messages { list-style: none; padding: 0; }
.messages li { background: #d4edda; color: #155724; padding: 10px 14px; border-radius: 4px; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.summary-list { display: flex; gap: 8px; flex-wrap: wrap; }
form.eval-form p { margin: 0 0 12px; }
form.eval-form label { font-weight: bold; display: block; }
form.eval-form textarea, form.eval-form input[type=url], form.eval-form select { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; }
form.eval-form ul { list-style: none; padding: 0; display: flex; gap: 12px; margin: 0; }
form.eval-form ul label { font-weight: normal; display: inline; }
.errorlist { color: var(--accent); }
.pledge-content { white-space: pre-wrap; }
.evaluation { border-top: 1px solid var(--border); padding: 12px 0; }
.evaluation:first-child { border-top: none; }
.politician-photo {
  display: block; width: 105px; height: 140px;
  object-fit: cover; border: 1px solid var(--border); border-radius: 4px; margin: 0 0 16px;
}
/* 一覧の写真列：高さ 80px（縦横比 3:4） */
th.photo-col, td.photo-col { width: 76px; }
td.photo-col { padding-top: 6px; padding-bottom: 6px; }
.politician-thumb {
  display: block; width: 60px; height: 80px;
  object-fit: cover; border-radius: 3px; background: var(--primary-light);
}
.politician-thumb.no-image {
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: .7rem; line-height: 1.2; color: var(--muted); border: 1px solid var(--border);
}
/* 一覧の件数表示・ページング */
.list-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.list-toolbar select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; margin-left: 4px; }
.pagination { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.pagination a, .pagination span {
  min-width: 2.2em; padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px;
  text-align: center; text-decoration: none; background: #fff;
}
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: bold; }
.pagination .disabled { color: #bbb; }
.pagination .ellipsis { border: none; background: none; }

/* アカウント（ログイン・新規登録） */
.account-card { max-width: 560px; margin: 0 auto; }
.signup-steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 16px; font-size: .85rem; }
.signup-steps li { flex: 1; text-align: center; padding: 6px 4px; background: var(--bg); color: var(--muted); border-radius: 4px; }
.signup-steps li.current { background: var(--primary); color: #fff; font-weight: bold; }
form.account-form .field { margin: 0 0 16px; }
form.account-form .field-label { font-weight: bold; display: block; margin-bottom: 4px; }
form.account-form .required { font-size: .75rem; font-weight: normal; color: #fff; background: var(--accent); border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
form.account-form input[type=text], form.account-form input[type=email], form.account-form input[type=password],
form.account-form select { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; }
form.account-form .field > div:not(.helptext) { display: flex; gap: 20px; flex-wrap: wrap; }
form.account-form .field > div:not(.helptext) label { font-weight: normal; }
form.account-form .helptext { color: var(--muted); font-size: .85rem; margin-top: 4px; }
form.account-form .certificate-note, form.account-form .password-note { margin: -8px 0 16px; }
form.account-form .certificate-note p { margin: 0; }
form.account-form fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px 0; margin: 0 0 16px; }
form.account-form fieldset legend { font-weight: bold; padding: 0 6px; }
form.account-form [hidden] { display: none !important; }
.errorlist { color: var(--accent); list-style: none; padding: 0; margin: 4px 0 0; font-size: .9rem; }
.has-error input, .has-error select { border-color: var(--accent) !important; }

/* 公約へのコメント（ポップアップ） */
.nowrap { white-space: nowrap; }
.btn-small { padding: 4px 10px; font-size: .85rem; }
.comment-dialog { border: none; border-radius: 8px; padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.comment-dialog::backdrop { background: rgba(0,0,0,.45); }
.comment-dialog h2 { margin-top: 0; }
.comment-dialog .comment-pledge-title { font-weight: bold; margin: 0 0 12px; }
.comment-dialog .field-label { font-weight: bold; display: block; margin-bottom: 4px; }
.comment-dialog .required { font-size: .75rem; font-weight: normal; color: #fff; background: var(--accent); border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.comment-dialog textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; font: inherit; }
.star-input { border: none; padding: 0; margin: 0 0 12px; }
.star-input legend { font-weight: bold; padding: 0; margin-bottom: 4px; }
/* 右から 5,4,3,2,1 と並べ、選んだ星より左（小さい値）も塗る */
.star-input .stars { display: inline-flex; flex-direction: row-reverse; }
.star-input .stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input .stars label { font-size: 2rem; line-height: 1; color: #ccc; cursor: pointer; padding: 0 2px; }
.star-input .stars input:checked ~ label,
.star-input .stars label:hover, .star-input .stars label:hover ~ label { color: #f5a623; }
.star-input .stars input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 3px; }
.star-hint { margin-left: 8px; }
.comment-error { color: var(--accent); margin: 8px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 16px; align-items: center; margin-top: 16px; }
