:root {
  --bg: #f6f1e7;
  --ink: #2c261f;
  --muted: #5c534a;
  --line: #e4d9c8;
  --card: #fffcf7;
  --green: #2a9b82;
  --warn: #fff4cc;
  --danger: #c23b2e;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
a { color: inherit; }
header.app {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
header.app .inner, main.wrap {
  max-width: 960px;
  margin: 0 auto;
}
header.app .inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
nav.top a, nav.bottom a, button.linkish {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
}
nav.top a.on, nav.bottom a.on { color: var(--green); font-weight: 600; background: rgba(42,155,130,.12); }
nav.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.bottom a {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
main.wrap { padding: 24px 16px 112px; }
h1 { font-size: 28px; margin: 0 0 8px; font-weight: 600; }
h2 { font-size: 20px; margin: 0 0 8px; }
p { line-height: 1.75; }
.muted { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
label.field { display: grid; gap: 6px; font-size: 14px; }
input, textarea, select, button {
  font: inherit;
}
input, textarea, select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
textarea { min-height: 160px; }
button, .btn {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn.light, button.light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost, button.ghost { background: transparent; color: var(--green); }
.warn { background: var(--warn); border-radius: 12px; padding: 14px 16px; }
.err { color: var(--danger); }
.grid2 { display: grid; gap: 16px; }
@media (min-width: 800px) {
  .grid2 { grid-template-columns: 1.1fr .9fr; }
  nav.bottom { display: none; }
}
.article a { text-decoration: none; }
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login form { width: 100%; max-width: 400px; }
.preview {
  white-space: pre-wrap;
  line-height: 1.8;
}
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.modes button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.modes button.on { border-color: var(--green); background: rgba(42,155,130,.12); color: var(--green); font-weight: 600; }
