/*
 * 日本語フォント（AppDockBase 本体と同じ設定）
 * - 游ゴシック・ヒラギノがある端末（Windows・Mac・iPhone）は端末のフォントを使う
 * - ない端末（Android など）は index.html で読み込む Noto Sans JP（Web フォント）を使う
 * - system-ui は使わない。Android や Windows の Chrome では lang="ja" でも中国語の字形になることがある
 * フォントを指定するときは var(--font-sans) を使う（canvas に文字を描くときも同じフォント名を使う）
 */
@font-face {
  font-family: "YuGothicWeb";
  src: local("Yu Gothic Medium"), local("YuGothic-Medium"), local("游ゴシック Medium");
  font-weight: 400 500;
}
@font-face {
  font-family: "YuGothicWeb";
  src: local("Yu Gothic Bold"), local("YuGothic-Bold"), local("游ゴシック Bold");
  font-weight: 600 900;
}

:root {
  --accent: #e8590c;
  --accent-soft: #fff1e6;
  --ok: #0f9d58;
  --maybe: #d99100;
  --ng: #94a3b8;
  --text: #1f1a17;
  --muted: #6b625c;
  --border: #ece4dc;
  --font-sans: "YuGothicWeb", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  font-family: var(--font-sans);
  color: var(--text);
  background: #fbf7f3;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px 40px;
  flex: 1;
}

.brand {
  margin-bottom: 20px;
}

.logo {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.lead {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.3rem;
}

h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
}

.hero {
  background: var(--accent-soft);
  border-color: #fbd6bb;
}

.hero-text {
  margin: 0;
  line-height: 1.8;
}

label {
  display: block;
  font-weight: 700;
  margin: 16px 0 8px;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d6ccc3;
  border-radius: 10px;
  background: #fff;
  color: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-color: var(--accent);
}

button {
  cursor: pointer;
  border-radius: 10px;
  font-weight: 700;
}

.primary {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px 20px;
  color: #fff;
  background: var(--accent);
  border: 0;
}

.primary:hover {
  filter: brightness(0.95);
}

.ghost {
  padding: 10px 14px;
  color: var(--accent);
  background: #fff;
  border: 1px solid #f3c3a1;
  white-space: nowrap;
}

.icon {
  width: 40px;
  flex: none;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.error {
  margin: 12px 0 0;
  color: #c0262d;
  font-weight: 700;
}

.error:empty {
  display: none;
}

.date-rows {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.date-row {
  display: flex;
  gap: 8px;
}

.date-row input[type="date"] {
  flex: 1.4;
  min-width: 0;
}

.date-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.advanced {
  margin-top: 16px;
}

.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.range-row input {
  flex: 1;
  accent-color: var(--accent);
}

.range-row output {
  font-weight: 700;
  min-width: 2em;
}

.how ol {
  margin: 0;
  padding-left: 1.3em;
  line-height: 1.9;
}

.note {
  margin: -8px 0 12px;
  color: var(--muted);
  white-space: pre-wrap;
}

.share {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.share input {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 0.95rem;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

thead th {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 6em;
  overflow: hidden;
  text-overflow: ellipsis;
}

thead th.me {
  color: var(--accent);
}

thead th.muted {
  font-weight: 500;
}

tbody th {
  text-align: left;
  font-weight: 700;
}

.ok-count {
  margin-left: 8px;
  font-size: 0.8rem;
  color: var(--ok);
}

td.a2 {
  color: var(--ok);
  font-weight: 700;
}

td.a1 {
  color: var(--maybe);
  font-weight: 700;
}

td.a0 {
  color: var(--ng);
}

.answer-rows {
  display: grid;
  gap: 10px;
}

.answer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.answer-date {
  font-weight: 700;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

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

.seg label {
  margin: 0;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--muted);
  background: #fff;
}

.seg label + input + label {
  border-left: 1px solid var(--border);
}

.seg input:checked + label.a2 {
  background: var(--ok);
  color: #fff;
}

.seg input:checked + label.a1 {
  background: var(--maybe);
  color: #fff;
}

.seg input:checked + label.a0 {
  background: #64748b;
  color: #fff;
}

.seg input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.secret {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 999px;
  background: #1f1a17;
  color: #fff;
  vertical-align: middle;
}

.want input {
  --p: 50%;
  width: 100%;
  height: 10px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--p), #eadfd6 var(--p));
}

.want input::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.15);
}

.want input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
}

.want-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
}

#a-want-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
}

.admin {
  border-style: dashed;
}

.result {
  text-align: center;
  padding: 28px 20px;
}

.result p {
  margin: 4px 0;
}

.result-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.result-main {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 12px 0 4px !important;
}

.result-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 12px !important;
}

.result.go {
  background: #effaf3;
  border-color: #bfe8cf;
}

.result.go .result-tag {
  background: var(--ok);
  color: #fff;
}

.result.cancel {
  background: #f4f4f6;
  border-color: #dedee6;
}

.result.cancel .result-tag {
  background: #475569;
  color: #fff;
}

.footer {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.875rem;
}

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

.footer a + a {
  margin-left: 1.25em;
}
