:root {
  --bg: #f7f7f8;
  --card-bg: #ffffff;
  --border: #e2e2e6;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --accent: #2f6fed;
  --danger: #c0392b;
  --success: #1f8a4c;
}

* { box-sizing: border-box; }

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

.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { font-weight: 700; }
.user-email { color: var(--muted); font-size: 0.9em; margin-left: auto; }

main#app {
  max-width: 720px;
  margin: 24px auto;
  padding: 0 16px 48px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.login-card { max-width: 420px; margin: 48px auto; }
.login-card h1 { font-size: 1.25rem; margin-top: 0; }
.muted { color: var(--muted); font-size: 0.9em; }

#loginForm { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
#loginForm label { font-size: 0.85em; color: var(--muted); }
#loginForm input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1em;
}
button { font-family: inherit; cursor: pointer; }
#loginSubmit, .action-button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1em;
}
#loginSubmit:disabled { opacity: 0.6; }

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9em;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 999px;
  font-size: 0.85em;
  color: var(--muted);
}
.filter-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.inquiry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.inquiry-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inquiry-item:hover { border-color: var(--accent); }
.inquiry-title { font-weight: 600; }
.inquiry-meta { color: var(--muted); font-size: 0.85em; }
.status-badge {
  align-self: flex-start;
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
}
.status-badge.unreviewed { background: #fff3cd; color: #7a5c00; }
.status-badge.reviewed { background: #e6f4ea; color: var(--success); }
.empty-state { color: var(--muted); padding: 24px; text-align: center; }

.detail-card { margin-top: 12px; }
.detail-meta { display: grid; grid-template-columns: 100px 1fr; gap: 6px 12px; margin: 0 0 16px; }
.detail-meta dt { color: var(--muted); font-size: 0.85em; }
.detail-meta dd { margin: 0; }

.body-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: inherit;
  max-height: 320px;
  overflow-y: auto;
}

.ai-info { margin: 16px 0; color: var(--muted); font-size: 0.9em; }
.ai-info summary { cursor: pointer; }

.reviewed-badge {
  background: #e6f4ea;
  color: var(--success);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9em;
  margin-bottom: 12px;
}

.review-question { margin: 16px 0 8px; }
.review-actions { display: flex; gap: 12px; }
.action-button.keep { background: var(--accent); }
.action-button.discard { background: #55575c; }
.discard-note { color: var(--muted); font-size: 0.8em; margin-top: 10px; line-height: 1.6; }

.message { min-height: 1.2em; font-size: 0.9em; }
.message[data-kind="error"] { color: var(--danger); }
.message[data-kind="success"] { color: var(--success); }
