:root {
  --bg: #f3f6fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: #dbe3ef;
  --line-strong: #c8d3e2;
  --txt: #0f172a;
  --muted: #64748b;
  --soft: #f8fafc;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--txt);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 32rem),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 30rem),
    var(--bg);
}

button, input, select { font: inherit; }
button { border: 0; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.panel, .project-row, .login-card {
  background: var(--panel);
  border: 1px solid rgba(219, 227, 239, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.new-project { padding: 20px; margin-bottom: 24px; }
.section-title { margin-bottom: 14px; }
.section-title p, .login-subtitle, .hint { margin-bottom: 0; color: var(--muted); }

.row-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.project-form {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 10px;
  align-items: center;
}

input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--txt);
  background: var(--panel-solid);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus, select:focus {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.primary-btn, .ghost-btn, .icon-btn {
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.primary-btn {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 18px;
  color: white;
  font-weight: 750;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.primary-btn:hover, .icon-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }

.ghost-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--txt);
  background: rgba(255, 255, 255, 0.7);
}

.project-list { display: grid; gap: 10px; margin-top: 12px; }
.project-row { overflow: hidden; }

.project-main {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px 14px;
}

.toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--soft);
  cursor: pointer;
}

.project-name {
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.project-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.project-controls {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-field { display: grid; gap: 5px; }

.compact-field > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.model-select { width: 175px; min-height: 38px; border-radius: 11px; }

.effort-radios {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-solid);
}

.radio-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pill.active { color: white; background: var(--txt); }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1.16rem;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.inject { background: #eff6ff; }
.report { background: #eff6ff; }
.delete { background: #fef2f2; }

.project-status.status-report { color: #2563eb; }

.project-details {
  border-top: 1px solid var(--line);
  padding: 14px;
  background: rgba(248, 250, 252, 0.72);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid div { min-width: 0; }

.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

code {
  display: block;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  color: #334155;
  background: white;
}

.feedback {
  min-height: 36px;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  color: var(--muted);
  background: white;
  white-space: pre-wrap;
}

.feedback:empty { display: none; }

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
}

.login-page { display: grid; min-height: 100vh; place-items: center; }
.login-shell { width: min(420px, calc(100% - 32px)); }

.login-card { padding: 30px; text-align: center; }

.login-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 18px;
  color: white;
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.24);
}

.login-card h1 { font-size: 2rem; }
.login-form { display: grid; gap: 10px; margin-top: 18px; }
.compact { text-align: left; }

@media (max-width: 860px) {
  .project-form { grid-template-columns: 1fr; }
  .row-title { align-items: start; flex-direction: column; }
  .project-main { grid-template-columns: 34px 1fr; }
  .project-controls { grid-column: 1 / -1; justify-content: start; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .topbar { align-items: start; flex-direction: column; }
  .project-controls { align-items: stretch; }
  .compact-field, .model-select, .effort-field { width: 100%; }
  .effort-radios { justify-content: space-between; }
}
