/* Match estimator vibe: cream header, big yellow background, white card, bold black type */
:root{
  --cream:#f7f0d5;
  --yellow:#f3d31b;
  --yellow2:#e4c307;
  --ink:#0b0b0b;
  --line:#e0d7b6;
  --card:#ffffff;
  --shadow: 0 18px 40px rgba(0,0,0,.18);
  --radius: 14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--ink);
  background: radial-gradient(1200px 700px at 50% 10%, var(--yellow) 0%, var(--yellow2) 60%, #d9b600 100%);
}

.topbar{
  background:var(--cream);
  border-bottom:1px solid var(--line);
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  font-size:20px;
}
.toast{display:grid; place-items:center; color:var(--ink)}
.title{letter-spacing:.2px}
.brand-logo{height:22px;width:auto;display:block;filter:brightness(0)}

.top-actions .toplink{
  color:var(--ink);
  text-decoration:underline;
  font-weight:800;
}

.page{
  padding:34px 18px 60px;
}

.panel{
  max-width: 1040px;
  margin: 0 auto;
  background: rgba(255,255,255,.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  border: 1px solid rgba(0,0,0,.08);
}

.panel-hd{
  background: linear-gradient(0deg, #fff6b5 0%, #fffad2 100%);
  border-bottom:1px solid rgba(0,0,0,.12);
  padding:16px 18px;
}
.panel-title{
  font-weight:900;
  font-size:14px;
  letter-spacing:.8px;
}

.tabs{
  display:flex;
  gap:12px;
  padding:16px 18px;
  flex-wrap:wrap;
}

.tab{
  flex: 1 1 220px;
  padding:12px 14px;
  border-radius: 10px;
  border:1px solid rgba(0,0,0,.2);
  background: var(--yellow);
  font-weight:900;
  cursor:pointer;
}
.tab:hover{filter:brightness(.98)}
.tab-active{
  border:2px solid var(--ink);
}

.tabpanel{
  padding: 0 18px 18px;
}

.hidden{display:none}

.chatlog{
  height: 410px;
  overflow:auto;
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding:12px;
}

.msg{
  display:flex;
  margin: 10px 0 6px;
}
.bubble{
  max-width:78%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(0,0,0,.14);
  white-space:pre-wrap;
  line-height:1.35;
  background:#fff;
}
.msg.user{justify-content:flex-end}
.msg.user .bubble{
  background: #fff6b5;
  border:2px solid var(--ink);
  font-weight:700;
}
.msg.bot .bubble{
  background:#ffffff;
  border:2px solid var(--ink);
  font-weight:700;
}
.thinking-bubble{
  display:flex;
  align-items:center;
  gap:6px;
  padding:14px 18px;
}
.thinking-bubble .dot{
  width:8px;
  height:8px;
  background:#555;
  border-radius:50%;
  animation: bounce 1.4s infinite ease-in-out;
}
.thinking-bubble .dot:nth-child(2){animation-delay:0.2s}
.thinking-bubble .dot:nth-child(3){animation-delay:0.4s}
@keyframes bounce{
  0%,60%,100%{transform:translateY(0)}
  30%{transform:translateY(-6px)}
}
.meta{
  font-size:12px;
  opacity:.7;
  margin-bottom:6px;
}

.composer{
  display:flex;
  gap:12px;
  margin-top:12px;
}
textarea, input{
  width:100%;
  padding:10px 12px;
  border-radius: 10px;
  border:1px solid rgba(0,0,0,.18);
  font-size:14px;
  outline:none;
}
textarea{resize:vertical}
textarea:focus, input:focus{border-color: rgba(0,0,0,.5)}

.composer-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:160px;
}

.btn{
  background: var(--yellow);
  border:2px solid var(--ink);
  border-radius: 10px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
}
.btn:hover{filter:brightness(.98)}
.btn:disabled{opacity:.55; cursor:not-allowed}
.btn-outline{
  background:#fff;
}

.form{display:flex; flex-direction:column; gap:12px}
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.field{display:flex; flex-direction:column; gap:6px}
.field > span{
  font-size:12px;
  font-weight:900;
  letter-spacing:.3px;
}

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

.hint{
  margin:10px 0 0;
  font-size:12px;
  opacity:.8;
}
code{
  background:#fff;
  padding:2px 6px;
  border-radius: 8px;
  border:1px solid rgba(0,0,0,.12);
}

.status{display:flex; flex-direction:column; gap:14px}
.status-block{
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding:14px;
}
.status-title{
  font-weight:900;
  font-size:13px;
  letter-spacing:.6px;
  margin-bottom:8px;
}
.pre{
  background:#111;
  color:#f5f5f5;
  padding:12px;
  border-radius: 12px;
  overflow:auto;
  min-height:120px;
  margin:10px 0 0;
}
.checklist{margin:0; padding-left:18px}
.checklist li{margin:6px 0}

@media (max-width: 820px){
  .grid{grid-template-columns: 1fr}
  .composer{flex-direction:column}
  .composer-actions{flex-direction:row; min-width:unset; justify-content:flex-end}
  .chatlog{height:360px}
  .tab{flex-basis: 100%}
}
