:root {
  --green: #0a8f3c;
  --bg: #f3f8f3;
  --card: #ffffff;
  --text: #1d2b1f;
  --muted: #5b6b5e;
  --line: #c9dccb;
  --error: #c62828;
  --error-bg: #fdecec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

header.site {
  background: #fff;
  border-bottom: 4px solid var(--green);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
header.site img { display: block; max-height: 48px; width: auto; }
header.site h1 { margin: 0; font-size: 22px; color: var(--green); letter-spacing: 0.04em; }

main { max-width: 960px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.login { max-width: 420px; margin: 32px auto; }
.login h2 { margin-top: 0; }
.login label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.login input { display: block; width: 100%; margin-top: 4px; }

input[type=text], input[type=password], select, textarea {
  font: inherit;
  font-size: 16px;            /* iPhone で入力時に拡大されないようにする */
  padding: 6px 8px;
  border: 1px solid #9fb8a3;
  border-radius: 4px;
  background: #fff;
  min-width: 0;
}

textarea {
  display: block;
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace;
  line-height: 1.5;
  resize: vertical;
  overflow: auto;
}

button {
  font: inherit;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px 28px;
  cursor: pointer;
}
button:hover { background: #087a33; }

.whoami { text-align: right; margin: 0 0 12px; font-size: 14px; }
.error { background: var(--error-bg); border-left: 4px solid var(--error); padding: 8px 12px; color: var(--error); margin-bottom: 16px; }
.error p { margin: 0 0 4px; }
.error ul { margin: 0; padding-left: 1.4em; }

label.field { display: block; font-weight: bold; margin: 8px 0 4px; }
.card > label.field:first-child { margin-top: 0; }
.note { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.examples { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.examples code { background: #eef5ee; padding: 0 4px; border-radius: 3px; }

.settings .setting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 6px 0;
}
.settings .name { font-weight: bold; min-width: 9em; }
.settings label { white-space: nowrap; }
.settings input[type=text] { width: 12em; }

.actions { text-align: center; margin: 16px 0 32px; }
.saved-at { display: inline-block; margin-left: 16px; color: var(--green); font-weight: bold; }

/* 保存直後に画面上部へ数秒だけ重ねて出す通知 */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: #fff;
  color: var(--green);
  border: 2px solid var(--green);
  font-weight: bold;
  padding: 12px 32px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  animation: toast 3.5s ease forwards;
}
@keyframes toast {
  0%   { opacity: 0; transform: translate(-50%, -12px); }
  8%   { opacity: 1; transform: translate(-50%, 0); }
  80%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes toast-fade {
  0%, 80% { opacity: 1; }
  100%    { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation-name: toast-fade; }
}

@media (max-width: 767px) {
  main { padding: 12px; }
  header.site { flex-wrap: wrap; gap: 4px 12px; }
  header.site img { max-height: 36px; }
  header.site h1 { font-size: 18px; white-space: nowrap; }
  .settings .name { min-width: 0; width: 100%; }
  .settings input[type=text] { width: 100%; }
  .actions button { width: 100%; }
  .saved-at { display: block; margin: 8px 0 0; }
}
