/* Daily OK / まいにちタッチ — warm, calm, high-contrast design system.
   Palette: deep navy / muted green / warm ivory / soft white.
   Success is a gentle yellow-green. No red-heavy alerts. */

:root {
  --navy: #16294d;
  --navy-soft: #24406e;
  --green: #5f8264;
  --green-soft: #7ba183;
  --ivory: #faf5ec;
  --soft-white: #fffdf7;
  --ink: #232a36;
  --ink-muted: #5a6472;
  --success: #b9d17f;
  --success-ink: #3d5a1e;
  --warn-bg: #fdf3d8;
  --warn-ink: #6b5316;
  --line: #e4dcc9;
  --focus: #f2b134;
  --radius: 16px;
  --radius-lg: 28px;
  --shadow: 0 2px 10px rgba(22, 41, 77, 0.08);
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

#app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------------- header ---------------- */
#site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}
.brand img { display: block; border-radius: 8px; }
#site-nav { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
#site-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
#site-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
#site-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.18); color: #fff; }
.header-right select {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: var(--navy-soft);
  color: #fff;
  padding: 0 0.5rem;
  font-size: 0.9rem;
}

main { flex: 1; width: 100%; }
#view { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.loading { color: var(--ink-muted); }

/* ---------------- generic blocks ---------------- */
.card {
  background: var(--soft-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

h1 { font-size: 1.7rem; line-height: 1.35; color: var(--navy); margin: 0.4rem 0 0.8rem; }
h2 { font-size: 1.25rem; color: var(--navy); margin: 1.6rem 0 0.6rem; }
h3 { font-size: 1.05rem; color: var(--navy); margin: 1.2rem 0 0.4rem; }
p { margin: 0.5rem 0; }
.muted { color: var(--ink-muted); font-size: 0.92rem; }
.small { font-size: 0.85rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  min-width: 48px;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-soft); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: rgba(22, 41, 77, 0.07); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-soft); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); }
.field .hint { font-size: 0.85rem; color: var(--ink-muted); margin-top: 0.25rem; }

.notice {
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin: 0.8rem 0;
  border: 1px solid var(--line);
  background: var(--soft-white);
}
.notice-warn { background: var(--warn-bg); border-color: #ecd9a0; color: var(--warn-ink); }
.notice-success { background: #eef5df; border-color: var(--success); color: var(--success-ink); }

.safety-box {
  background: #f3efe3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  font-size: 0.92rem;
}
.safety-box h2 { margin-top: 0; font-size: 1.05rem; }
.safety-box li { margin-bottom: 0.45rem; }

/* ---------------- landing ---------------- */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}
.hero img.hero-mark { width: 120px; height: 120px; }
.hero h1 { font-size: 2rem; }
.hero .lead { font-size: 1.1rem; color: var(--ink-muted); max-width: 34em; margin: 0.6rem auto 1.4rem; }
.hero-cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.hero-art { display: block; margin: 2rem auto 0; max-width: 960px; }
.hero-art img { width: 100%; height: auto; border-radius: 18px; box-shadow: 0 8px 30px rgba(22, 41, 77, 0.10); }

.steps { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 680px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--soft-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.step .num {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--navy); color: #fff;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.price-card {
  text-align: center;
  border: 2px solid var(--navy);
  border-radius: var(--radius-lg);
  background: var(--soft-white);
  padding: 1.6rem;
  max-width: 420px;
  margin: 1rem auto;
}
.price-card .price { font-size: 2.2rem; font-weight: 800; color: var(--navy); }

.faq details {
  background: var(--soft-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}
.faq summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }

.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 2rem; font-size: 0.9rem; }
.footer-links a { color: var(--navy); }

/* ---------------- parent screen ---------------- */
.parent-wrap {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding-top: 1rem;
}
.parent-greeting { font-size: 1.5rem; color: var(--navy); font-weight: 700; }
.big-ok {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(78vw, 340px);
  height: min(78vw, 340px);
  margin: 1.4rem auto;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 1.9rem;
  font-weight: 800;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(95, 130, 100, 0.4);
  transition: transform 0.08s ease, background 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.big-ok:active { transform: scale(0.96); }
.big-ok.sending { background: var(--navy-soft); }
.big-ok.done { background: var(--success); color: var(--success-ink); }
.big-ok[disabled] { cursor: default; }

.contact-btn {
  min-height: 56px;
  padding: 0.8rem 1.6rem;
  font-size: 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.parent-status { font-size: 1.15rem; margin: 1rem 0; min-height: 2rem; }
.parent-status.ok { color: var(--success-ink); font-weight: 700; }
.parent-status.err {
  color: var(--warn-ink);
  background: var(--warn-bg);
  border: 2px solid #ecd9a0;
  border-radius: var(--radius);
  padding: 0.9rem;
  font-weight: 700;
}

/* ---------------- dashboard ---------------- */
.status-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .status-grid { grid-template-columns: 1fr 1fr; } }
.member-card { display: flex; flex-direction: column; gap: 0.5rem; }
.member-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.member-name { font-size: 1.2rem; font-weight: 800; color: var(--navy); }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}
.status-pill::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.status-pill.done { background: #eef5df; color: var(--success-ink); }
.status-pill.waiting { background: #eef1f6; color: var(--navy-soft); }
.status-pill.paused { background: #f3efe3; color: var(--ink-muted); }
.status-pill.contact { background: var(--warn-bg); color: var(--warn-ink); }

table.history { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.history th, table.history td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  background: #f3efe3;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  display: block;
}

.consent-list { text-align: left; font-size: 0.95rem; }

/* ---------------- admin console ---------------- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.4rem 0 1.1rem;
}
.admin-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft-white);
  color: var(--navy);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}
.admin-tabs a:hover { background: #f3efe3; }
.admin-tabs a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.stat-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0.8rem 0;
}
.stat {
  background: var(--soft-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
}
.stat .num { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.stat .lbl { color: var(--ink-muted); font-size: 0.85rem; }

.table-wrap { overflow-x: auto; }
.table-wrap td .mono { display: inline-block; padding: 0.15rem 0.45rem; }

.status-pill.bad { background: var(--warn-bg); color: var(--warn-ink); }
.status-pill.neutral { background: #f3efe3; color: var(--ink-muted); }

.banner-stop {
  background: var(--warn-bg);
  border: 2px solid #ecd9a0;
  color: var(--warn-ink);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-weight: 700;
  margin: 0.8rem 0;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #efe9da;
  border-radius: 10px;
  min-height: 2.6rem;
  margin-bottom: 0.5rem;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: sk-shimmer 1.2s infinite;
}
@keyframes sk-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

@media (max-width: 480px) {
  html { font-size: 17px; }
  #view { padding: 1rem 0.8rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
