:root {
  --bg: #f6f5f2;
  --card-bg: #ffffff;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --border: #e2e0da;
  --accent: #2b2a27;
  --accent-contrast: #ffffff;
  --error: #b3261e;
  --error-bg: #fbeceb;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.site-header nav a {
  margin-left: 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--text); }

.site-main {
  max-width: 760px;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

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

.auth-card { max-width: 420px; margin: 0 auto; }

h1 { margin-top: 0; font-size: 1.5rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }

.subtitle { color: var(--muted); margin-top: -0.5rem; }
.muted { color: var(--muted); }

.problem-recap {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
}

form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }

input, textarea {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.65rem 1.1rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
button:hover, .button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.button-link {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 0.5rem 0;
  font: inherit;
}

.error {
  background: var(--error-bg);
  color: var(--error);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.list-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.list-table th, .list-table td { text-align: left; padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.list-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge-completed { background: #e8f3e8; color: #2e6b30; border-color: #cfe6cf; }
.badge-in_progress { background: #fff4e0; color: #8a5a00; border-color: #f4dfae; }
.badge-intake { background: var(--bg); }
.badge-failed { background: var(--error-bg); color: var(--error); border-color: #f2c9c6; }
.badge-dynamic { background: #eef0fb; color: #3c47b0; border-color: #d7dbf5; }
.badge-confidence { font-size: 0.85rem; }

.memo-section { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.memo-section p { margin: 0.3rem 0 0; }

.advisor-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; }
.advisor-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.advisor-detail summary { cursor: pointer; font-weight: 600; }
.advisor-response { margin-top: 0.6rem; white-space: pre-wrap; font-size: 0.93rem; color: var(--text); }

.qa-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 1.25rem; }

.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 1.5rem auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
