:root {
  --bg: #fff7f5;
  --surface: #ffffff;
  --text: #2d2326;
  --muted: #7a6a6f;
  --accent: #ff7a8a;
  --accent-dark: #e85f71;
  --accent-soft: #ffe8eb;
  --border: #f2dfe2;
  --ok-bg: #e7f8ef;
  --ok-text: #1b7f4d;
  --warn-bg: #fff4df;
  --warn-text: #995c00;
  --radius: 20px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  background: radial-gradient(circle at top right, #ffe9ee 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.container {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(255, 122, 138, 0.25);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(173, 98, 112, 0.06);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.badge.neutral {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 95, 113, 0.28);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-sm {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.latest-body {
  font-size: 19px;
  line-height: 1.65;
  font-weight: 600;
  margin: 8px 0 12px;
  white-space: pre-wrap;
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

.guide-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  line-height: 1.8;
  font-size: 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.history-item {
  padding: 12px 14px;
  background: #fffafa;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.history-item .body {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 4px;
  white-space: pre-wrap;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fffdfd;
  color: var(--text);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.msg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fffafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #2d2326;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
}

.hidden {
  display: none !important;
}
