:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e2e5ea;
  --text: #1a1d23;
  --muted: #6b7280;
  --accent: #2f6feb;
  --ok: #157347;
  --err: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  line-height: 1.7;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

header h1 { font-size: 1.15rem; margin: 0; }

.tag {
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .1rem .5rem;
  vertical-align: 2px;
}

#account { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.who { color: var(--muted); }

nav {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  padding: .5rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

nav button {
  flex: 0 0 auto;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: .4rem .8rem;
  font: inherit;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
}

nav button.on { background: var(--accent); color: #fff; }

main { max-width: 720px; margin: 0 auto; padding: 1.25rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
}

.card.intro { background: #eef3fd; border-color: #d3e0f9; }
.card h2 { font-size: 1rem; margin: 0 0 .4rem; }
.card p { margin: .3rem 0; }

.section-title { font-size: .95rem; margin: 1.5rem 0 .6rem; color: var(--muted); }

label { display: block; font-size: .85rem; color: var(--muted); margin: .6rem 0; }

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: .95rem;
  color: var(--text);
}

textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
  padding: .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }

/* 送信中。押せないことが見て分かるようにする */
button:disabled { opacity: .55; cursor: default; }
button:disabled:hover { border-color: var(--line); filter: none; }

button.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font-size: .85rem;
}

.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.row > label { flex: 1 1 10rem; margin: 0; }
.row > input { flex: 2 1 12rem; width: auto; margin: 0; }
.row > select { flex: 1 1 9rem; width: auto; margin: 0; }

.item-head { display: flex; gap: .75rem; align-items: baseline; justify-content: space-between; }
.item-head h3 { font-size: 1rem; margin: 0; }
.price { font-weight: 700; white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: .8rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }

.contact {
  background: #f0f8f2;
  border: 1px solid #cfe8d6;
  border-radius: 7px;
  padding: .4rem .6rem;
  font-size: .85rem;
}

.badge {
  font-size: .75rem;
  border-radius: 999px;
  padding: .15rem .6rem;
  white-space: nowrap;
  background: #eef0f3;
  color: var(--muted);
}

.badge.s-approved { background: #e6f4ea; color: var(--ok); }
.badge.s-completed { background: #e8ecf7; color: var(--accent); }
.badge.s-rejected, .badge.s-cancelled { background: #fbeaea; color: var(--err); }

#dev-code {
  background: #fff8e6;
  border: 1px solid #f0d99a;
  border-radius: 8px;
  padding: .6rem .8rem;
  margin: .6rem 0;
}

.dev-code-label { font-size: .8rem; color: #8a6d1f; margin: 0 !important; }
.dev-code-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: .3em;
  margin: .1rem 0 0 !important;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

.msg { font-size: .85rem; min-height: 1.2em; margin: .5rem 0 0; }
.msg.error { color: var(--err); }
.msg.ok { color: var(--ok); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; }
.stats .card { margin: 0; }
.tile-label { font-size: .8rem; color: var(--muted); margin: 0; }
.tile-value { font-size: 1.5rem; font-weight: 700; margin: .1rem 0; }
.tile.key { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.stats .wide { grid-column: 1 / -1; }
.blocker {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .9rem;
  border-bottom: 1px solid var(--line);
  padding: .25rem 0;
}
.blocker:last-of-type { border-bottom: 0; }
.blocker-count { font-weight: 700; white-space: nowrap; }

#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#modal[hidden] { display: none; }

.sheet {
  background: var(--card);
  border-radius: 12px;
  padding: 1.25rem;
  width: min(28rem, 100%);
  max-height: 90vh;
  overflow: auto;
}

.sheet h2 { margin: 0 0 .2rem; font-size: 1.05rem; }

/* 「はじめての人へ」。大学のアドレスを預けてよいか判断する材料なので、
   読み飛ばされない程度に詰めつつ、1 項目ずつ独立して読めるようにする */
ul.about {
  margin: .5rem 0 0;
  padding-left: 1.2rem;
  font-size: .9rem;
}

ul.about li { margin: .4rem 0; }
