* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; background: #f7f7f8; color: #222; }
header { background: #1D445D; color: #fff; padding: 1.2rem 1.5rem; }
header h1 { margin: 0 0 .2rem; font-size: 1.25rem; }
header p { margin: 0; opacity: .8; font-size: .9rem; }
main { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
.card { background: #fff; border-radius: 12px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
label { display: block; margin: .8rem 0; font-size: .9rem; }
input, textarea { width: 100%; padding: .6rem .8rem; border: 1px solid #d0d0d4; border-radius: 8px; font-size: 1rem; font-family: inherit; }

button {
  background: #1D445D; color: #fff; border: 0;
  padding: .7rem 1.2rem; border-radius: 8px;
  font-size: 1rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .55rem;
  transition: background .15s ease;
}
button:hover { background: #00769D; }
button:disabled, button[disabled] {
  background: #95a8b5;
  cursor: wait;
  opacity: .85;
}
textarea:disabled { background: #f0f2f4; cursor: not-allowed; }

/* ===== Chat messages ===== */
.msg {
  padding: .8rem 1rem;
  border-radius: 12px;
  margin: .6rem 0;
  max-width: 88%;
  word-wrap: break-word;
}
.msg p { margin: 0 0 .55rem; }
.msg p:last-child { margin-bottom: 0; }

.msg.user {
  background: #2FA0C5;
  color: #fff;
  margin-left: auto;
}

.msg.assistant {
  background: #eef3f7;
  color: #1D445D;
  font-size: 1.05rem;
  line-height: 1.55;
  border-left: 4px solid #2FA0C5;
  padding: .95rem 1.15rem;
}
.msg.assistant strong {
  color: #00769D;
  font-weight: 700;
}

/* ===== Typing bubble (HTMX indicator while waiting for Claude) ===== */
.typing-bubble {
  background: #fffaf0;
  border-left: 4px solid #F4942B;
  border-radius: 12px;
  padding: .9rem 1.1rem;
  margin: .6rem 0;
  display: none;
  align-items: center;
  gap: .75rem;
  color: #6c4a1e;
  font-style: italic;
}

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: flex; }

/* ===== Spinner (used inline in typing-bubble and inside Wyślij button) ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(0, 118, 157, .25);
  border-top-color: #00769D;
  border-radius: 50%;
  animation: persona-spin .75s linear infinite;
  flex-shrink: 0;
}

@keyframes persona-spin {
  to { transform: rotate(360deg); }
}

/* Button-internal spinner: hidden by default, shown only during htmx request */
.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, .35);
  border-top-color: #fff;
}
.htmx-request #composer-submit .btn-spinner { display: inline-block; }
.htmx-request #composer-submit .btn-label::after { content: "…"; }

/* ===== Status page progress block ===== */
.status-progress {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin: 1.5rem 0 1rem;
  padding: 1.2rem 1.3rem;
  background: linear-gradient(180deg, #eef7fa 0%, #f7fbfc 100%);
  border-radius: 14px;
  border: 1px solid #d0e4ec;
}
.big-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(0, 118, 157, .2);
  border-top-color: #00769D;
  border-radius: 50%;
  animation: persona-spin .9s linear infinite;
  flex-shrink: 0;
}
.status-text p { margin: 0 0 .4rem; }
.status-text p:last-child { margin-bottom: 0; }
.status-text .hint { font-size: .9rem; color: #557; }

#elapsed {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #1D445D;
}

/* ===== Misc ===== */
.hint { color: #777; font-size: .9rem; }
.downloads { padding-left: 1.2rem; }
.downloads li { margin: .35rem 0; }
