:root {
  --bg: #fff4ef;
  --paper: #fff8f5;
  --card: #ffffff;
  --ink: #1c1614;
  --muted: #7a6c68;
  --line: #ead8d2;
  --accent: #e56b5c;
  --peach: #ffc2b5;
  --red: #b5474a;
  --shadow: 0 12px 36px rgba(80, 24, 16, .08);
}

* { box-sizing: border-box; }

html { background: #f0d8d0; }

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(229, 107, 92, .28), transparent 70%),
    linear-gradient(#f8e6df, #efd4cc);
  min-height: 100vh;
}

.shell {
  width: min(100%, 600px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(80, 24, 16, .06), 0 18px 60px rgba(80, 24, 16, .08);
}

.shell.wide { width: min(100%, 920px); }

.site-header {
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: rgba(255, 244, 239, .92);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.brand {
  font-weight: 900;
  font-size: 21px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.03em;
}

.brand span { color: var(--accent); }

.unofficial {
  font-size: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .12em;
  background: var(--peach);
}

main { padding: 0 18px 48px; }

.hero { padding: 40px 4px 24px; }

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--accent);
  margin: 0 0 10px;
}

.hero h1,
.question-card h1 {
  font-size: 30px;
  line-height: 1.32;
  letter-spacing: -.045em;
  margin: 0;
}

.lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 14px 0 0;
}

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

.maker { padding: 20px 18px 18px; }

.field { display: block; margin-bottom: 18px; }

.field-label,
.state-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 8px;
  color: #393b42;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: -2px 0 10px;
  font-weight: 500;
}

.field textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid #e4cfc8;
  border-radius: 14px;
  background: #fff;
  padding: 13px 14px;
  font: inherit;
  font-size: 15px;
  line-height: 1.7;
  outline: none;
}

.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 107, 92, .16);
}

.field-meta {
  display: block;
  text-align: right;
  font-size: 11px;
  color: #b39a94;
  margin-top: 6px;
}

.type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.type-tab {
  position: relative;
  border: 1px solid #e4cfc8;
  border-radius: 14px;
  padding: 12px 8px;
  cursor: pointer;
  background: #fff;
  text-align: center;
}

.type-tab input { position: absolute; opacity: 0; pointer-events: none; }

.type-tab b { display: block; font-size: 13px; letter-spacing: -.02em; }

.type-tab small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.type-tab:has(input:checked) {
  border: 2px solid var(--ink);
  padding: 11px 7px;
  background: var(--peach);
}

.criteria-box {
  display: none;
  margin: -4px 0 18px;
  padding: 13px;
  border-radius: 14px;
  background: #fbf0ec;
  border: 1px solid #ead8d2;
}

.criteria-box.show { display: block; }

.criteria-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
}

.mini-btn,
.secondary {
  border: 1px solid #e0cbc4;
  background: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.mini-btn:hover,
.secondary:hover { background: #fff6f3; }

.mini-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.mini-btn:disabled:hover { background: #fff; }

.criterion-row {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}

.criterion-row input {
  flex: 1;
  border: 1px solid #e4cfc8;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
}

.criterion-row button {
  border: 0;
  background: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.dev-note {
  font-size: 12px;
  color: #8a5c54;
  background: #fff1ec;
  border: 1px dashed #e7b7ad;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
}

.setup-note,
.errorbox {
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  background: #fff0ed;
  border: 1px solid #ffd0c9;
  color: #7e3029;
  margin: 12px 0;
}

.errorbox p { margin: 3px 0; }

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 900;
  font-size: 15px;
  padding: 15px;
  cursor: pointer;
}

.primary:hover { opacity: .92; }

.btn-busy { display: none; }

.maker.is-submitting { pointer-events: none; }

.maker.is-submitting .primary {
  opacity: .78;
  cursor: wait;
}

.maker.is-submitting .btn-idle,
.report-form.is-submitting .btn-idle { display: none; }
.maker.is-submitting .btn-busy,
.report-form.is-submitting .btn-busy { display: inline; }

.micro {
  font-size: 11px;
  color: #b39a94;
  line-height: 1.6;
  text-align: center;
  margin: 12px 0 0;
}

.recent { padding-top: 28px; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 9px;
}

.section-title h2 { font-size: 18px; margin: 0; }
.section-title span { font-size: 11px; color: var(--muted); }

.recent-list { display: flex; flex-direction: column; }

.recent-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
}

.recent-item:hover strong { text-decoration: underline; text-underline-offset: 3px; }

.recent-item strong { font-size: 14px; line-height: 1.5; }

.recent-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aaa;
}

.recent-meta .time { font-size: 11px; white-space: nowrap; }
.arrow { font-size: 22px; line-height: 1; }

.type-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 5px 8px;
  background: #ffe3dc;
  color: #c45a4c;
}

.type-choice { background: #ffe8d2; color: #9a5528; }
.type-score { background: #f3e0ea; color: #8a4560; }

.empty { font-size: 13px; color: var(--muted); padding: 20px 2px; }

.question-page { padding-top: 28px; }
.question-card { padding: 22px; }
.question-card h1 { font-size: 28px; margin-top: 14px; }
.state-label { margin-top: 25px; }

.state-text {
  margin: 0;
  color: #5d5f66;
  font-size: 14px;
  line-height: 1.8;
  white-space: normal;
}

.answer-card {
  padding: 28px 24px 24px;
  margin-top: 16px;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, #fff6f2 0%, #fff 42%);
}

.jev-stamp {
  display: inline-block;
  margin: 0;
  border: 2.5px solid var(--accent);
  color: var(--accent);
  transform: rotate(-6deg);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  border-radius: 4px;
}

.answer-main {
  font-size: 64px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -.06em;
  margin: 18px 0 6px;
}

.answer-main.is-yes { color: var(--accent); }
.answer-main.is-no { color: var(--red); }

.choice-answer,
.score-answer {
  font-size: 38px;
  line-height: 1.3;
  word-break: break-word;
}

.answer-percent {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 16px;
}

.bar {
  height: 10px;
  background: #f0e4df;
  border-radius: 99px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  color: #999;
  margin-top: 5px;
}

.prob-list { margin-top: 22px; text-align: left; }
.prob-row { margin-top: 13px; }

.prob-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 5px;
}

.prob-row b { font-size: 12px; }

.confidence,
.score-number {
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 0;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.share-actions .secondary {
  font-weight: 800;
  font-size: 14px;
  padding: 14px 10px;
}

.make-another {
  display: block;
  text-align: center;
  margin: 26px 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.browse-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}

.browse-page .browse-links { margin: 0 0 20px; }

a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
}

.q-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.browse-page .q-card-grid,
.related .q-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.q-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 148px;
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}

.q-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(80, 24, 16, .12);
}

.q-card strong {
  font-size: 15px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.q-card .time {
  font-size: 11px;
  color: var(--muted);
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.pager > span {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

.pager > :last-child { justify-self: end; }

.related {
  margin-top: 36px;
  padding-top: 4px;
}

.related .q-card-grid { margin-top: 14px; }

.related .section-title a {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}

.related .section-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 760px) {
  .browse-page .q-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .browse-page .q-card-grid,
  .related .q-card-grid {
    grid-template-columns: 1fr;
  }
}

.report-open {
  display: block;
  margin: 18px auto 0;
  border: 0;
  background: none;
  color: #b39a94;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-open:hover { color: #8a6e68; }

.report-dialog {
  width: min(calc(100% - 32px), 420px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: var(--card);
  box-shadow: var(--shadow);
}

.report-dialog::backdrop {
  background: rgba(28, 22, 20, .46);
}

.report-form { padding: 22px 20px 18px; }

.report-form h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -.03em;
}

.report-form p,
.report-form li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.report-form p { margin: 0 0 8px; }

.report-form ul {
  margin: 0 0 16px;
  padding-left: 1.2em;
}

.report-form .errorbox,
.report-form .dev-note,
.report-form .setup-note { margin: 0 0 14px; }

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.dialog-actions .primary {
  padding: 12px;
  font-size: 14px;
}

.dialog-actions .secondary {
  font-weight: 800;
  font-size: 14px;
  padding: 12px 10px;
}

.report-form.is-submitting { pointer-events: none; }
.report-form.is-submitting .primary { opacity: .78; cursor: wait; }

.noticebox {
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.7;
  background: #fff6ea;
  border: 1px solid #f0d7b8;
  color: #7a5530;
  margin: 0 0 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 18px 30px;
  color: #b39a94;
  font-size: 10px;
  line-height: 1.6;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer p { margin: 0; }
.site-footer p + p { margin-top: 8px; }

.site-footer a {
  color: #8a6e68;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #8a6e68;
  font-weight: 700;
}

.lang-switch select {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid #e0cbc4;
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
}

.lang-apply {
  border: 1px solid #e0cbc4;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

html.has-js .lang-apply { display: none; }

.about-jev {
  margin: 36px 0 0;
  padding: 18px 18px 16px;
}

.about-jev h2 {
  font-size: 15px;
  margin: 0 0 8px;
}

.about-jev p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.about-jev a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.about-jev a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 420px) {
  .hero h1 { font-size: 26px; }
  .question-card h1 { font-size: 24px; }
  .answer-main { font-size: 52px; }
  .type-tab b { font-size: 12px; }
  .recent-item { grid-template-columns: auto 1fr; }
  .recent-meta { display: none; }
}

@media (min-width: 601px) {
  body { padding: 28px 0; }
  .shell {
    border-radius: 22px;
    overflow: hidden;
    min-height: calc(100vh - 56px);
  }
  .site-header { position: static; }
}
