/* Claude Linux - interface clara, responsiva e sem build */
:root {
  --bg: #f4f7fb;
  --bg-2: #eaf1f8;
  --panel: #ffffff;
  --panel-soft: #f8fbfe;
  --border: #d8e3ef;
  --border-strong: #b9c9dc;
  --text: #111827;
  --text-dim: #5f6f84;
  --text-faint: #91a0b4;
  --accent: #2563eb;
  --accent-2: #0f766e;
  --accent-soft: #eaf2ff;
  --danger: #dc2626;
  --good: #16a34a;
  --shadow-sm: 0 10px 28px rgba(31, 45, 64, .08);
  --shadow: 0 22px 60px rgba(31, 45, 64, .16);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(760px 360px at 50% -160px, rgba(37, 99, 235, .15), transparent 70%),
    linear-gradient(180deg, #fff 0%, var(--bg) 42%, var(--bg-2) 100%);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, .035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 70%);
}
.hidden { display: none !important; }
i[data-lucide] { width: 18px; height: 18px; stroke-width: 2.2; }

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(700px 420px at 50% 0%, rgba(37, 99, 235, .14), transparent 66%),
    var(--bg);
}
.login-card {
  width: min(92vw, 420px);
  padding: 34px 30px 30px;
  text-align: center;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(216, 227, 239, .95);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: pop .3s cubic-bezier(.2,.8,.2,1);
}
.login-logo,
.brand-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 850;
  letter-spacing: .02em;
  box-shadow: 0 14px 32px rgba(37, 99, 235, .24);
}
.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 19px;
  font-size: 20px;
}
.login-card h1 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.03em; }
.login-sub { margin: 0 0 24px; color: var(--text-dim); font-size: 14px; line-height: 1.45; }
#login-form { display: flex; flex-direction: column; gap: 10px; }
#token-input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#token-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
#login-btn {
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(37, 99, 235, .23);
  transition: transform .12s, filter .15s;
}
#login-btn:hover { filter: brightness(1.04); }
#login-btn:active { transform: translateY(1px) scale(.99); }
.login-error { min-height: 18px; margin-top: 12px; color: var(--danger); font-size: 13px; }

.app { position: relative; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 22px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(216, 227, 239, .95);
  box-shadow: 0 8px 26px rgba(31, 45, 64, .06);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 14px;
  font-size: 13px;
}
.brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: -.02em; }
.meta-line { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.status-pill,
.icon-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill {
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); transition: background .3s, box-shadow .3s; }
.conn-dot.on  { background: var(--good); box-shadow: 0 0 0 4px rgba(22, 163, 74, .13); }
.conn-dot.off { background: var(--danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }
.icon-btn,
.primary-btn {
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform .12s, box-shadow .15s, background .15s, color .15s;
}
.icon-btn {
  padding: 0 15px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.primary-btn {
  padding: 0 16px;
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 24, 39, .17);
}
.primary-btn:hover { background: #22304a; transform: translateY(-1px); }
.icon-btn:active,
.primary-btn:active { transform: translateY(0) scale(.98); }

.messages {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 40px 0 14px;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar { width: 11px; }
.messages::-webkit-scrollbar-thumb { background: #c8d5e4; border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }
.thread { width: min(900px, 92vw); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.welcome {
  width: min(850px, 92vw);
  margin: 10vh auto 0;
  text-align: center;
  animation: fade .32s ease;
}
.welcome-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.welcome h2 {
  max-width: 820px;
  margin: 0 auto 13px;
  font-size: clamp(34px, 5.6vw, 64px);
  line-height: .98;
  letter-spacing: -.055em;
}
.welcome p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.58;
}

.row { display: flex; gap: 12px; animation: fade .22s ease; }
.row.user { justify-content: flex-end; }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  margin-top: 2px;
  border-radius: 12px;
  font-size: 15px;
}
.avatar.ai { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 9px 20px rgba(37, 99, 235, .18); }
.bubble { max-width: 78%; }
.row.user .bubble {
  padding: 12px 15px;
  border-radius: 18px 18px 5px 18px;
  background: #111827;
  color: #fff;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 12px 26px rgba(17, 24, 39, .16);
}
.row.ai { align-items: flex-start; }
.row.ai .bubble {
  max-width: 86%;
  min-width: 0;
  overflow: hidden;
  padding: 7px 17px;
  border: 1px solid var(--border);
  border-radius: 5px 18px 18px 18px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow-sm);
}

.md { line-height: 1.65; font-size: 15px; word-wrap: break-word; }
.md p { margin: 10px 0; }
.md h1,.md h2,.md h3 { margin: 16px 0 8px; line-height: 1.25; letter-spacing: -.02em; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3 { font-size: 16px; }
.md ul,.md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md a { color: var(--accent); text-decoration: none; font-weight: 650; }
.md a:hover { text-decoration: underline; }
.md strong { color: #0f172a; }
.md code:not(pre code) {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
  font-family: var(--mono);
  font-size: 13px;
}
.md blockquote { margin: 10px 0; padding: 2px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--panel-soft); color: var(--text-dim); }
.md hr { margin: 14px 0; border: 0; border-top: 1px solid var(--border); }

.code-block { position: relative; margin: 12px 0; overflow: hidden; border: 1px solid #243246; border-radius: 13px; box-shadow: var(--shadow-sm); }
.code-block pre { margin: 0; padding: 15px 16px; overflow-x: auto; background: #101827; }
.code-block code { color: #dbeafe; font-family: var(--mono); font-size: 13px; line-height: 1.56; }
.copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #cbd5e1;
  cursor: pointer;
  opacity: 0;
  font-size: 11px;
  transition: opacity .15s, background .15s;
}
.code-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: #fff; background: rgba(255,255,255,.14); }

.tool { margin: 10px 0; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #f8fbfe; }
.tool-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: pointer; user-select: none; font-size: 13px; }
.tool-head:hover { background: #f1f6fb; }
.tool-ico { font-size: 15px; }
.tool-name { color: var(--accent-2); font-weight: 850; }
.tool-sum { min-width: 0; flex: 1; overflow: hidden; color: var(--text-dim); font-family: var(--mono); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.tool-spin { width: 12px; height: 12px; flex: none; border: 2px solid #c8d5e4; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.tool-status { flex: none; font-size: 12px; font-weight: 900; }
.tool-status.ok { color: var(--good); }
.tool-status.err { color: var(--danger); }
.tool-caret { flex: none; color: var(--text-faint); font-size: 11px; transition: transform .2s; }
.tool.open .tool-caret { transform: rotate(90deg); }
.tool-body { display: none; border-top: 1px solid var(--border); background: #fff; }
.tool.open .tool-body { display: block; }
.tool-body pre { max-height: 320px; margin: 0; padding: 12px 13px; overflow: auto; color: #334155; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.tool-body.err pre { color: #991b1b; background: #fff7f7; }

.thinking { margin: 6px 0; color: var(--text-faint); font-size: 13.5px; font-style: italic; white-space: pre-wrap; }
.caret { display: inline-block; width: 7px; height: 16px; margin-left: 2px; border-radius: 2px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
.turn-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 2px 0; color: var(--text-faint); font-size: 11.5px; }
.turn-meta.err { color: var(--danger); }
.notice { width: min(900px, 92vw); margin: 4px auto; padding: 12px 14px; border: 1px solid; border-radius: 14px; font-size: 13.5px; animation: fade .22s; }
.notice.err { background: #fff7f7; border-color: #fecaca; color: #991b1b; }
.notice.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.composer {
  padding: 16px 0 18px;
  background: linear-gradient(transparent, rgba(244,247,251,.94) 26%, var(--bg) 100%);
}
.composer-inner {
  width: min(900px, 92vw);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 9px 9px 9px 17px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.composer-inner:focus-within { border-color: rgba(37, 99, 235, .55); box-shadow: 0 0 0 4px rgba(37, 99, 235, .11), var(--shadow); }
#input {
  flex: 1;
  max-height: 180px;
  padding: 9px 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
#input::placeholder { color: var(--text-faint); }
.send-btn,
.stop-btn {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  transition: transform .12s, filter .15s, box-shadow .15s;
}
.send-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 22px rgba(37, 99, 235, .22); }
.send-btn:hover,
.stop-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.send-btn:active,
.stop-btn:active { transform: translateY(0) scale(.96); }
.send-btn:disabled { opacity: .45; cursor: default; filter: none; }
.stop-btn { background: var(--danger); box-shadow: 0 12px 22px rgba(220, 38, 38, .18); }
.composer-hint { width: min(900px, 92vw); margin: 8px auto 0; text-align: center; color: var(--text-faint); font-size: 12px; }

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px;
}
.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .28);
  backdrop-filter: blur(7px);
}
.settings-panel {
  position: relative;
  width: min(480px, 100%);
  padding: 22px;
  border: 1px solid rgba(216, 227, 239, .92);
  border-radius: 26px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  animation: sheetIn .2s ease;
}
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.settings-head h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.close-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.field { margin-top: 14px; }
.field label {
  display: block;
  margin: 0 0 7px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 800;
}
.select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.select-wrap i { color: var(--accent); }
.select-wrap select {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 750 15px var(--sans);
}
.settings-note {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.4;
}
.settings-note i { flex: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

@media (min-width: 760px) {
  .settings-overlay { place-items: start end; padding-top: 76px; padding-right: 22px; }
}
@media (max-width: 720px) {
  .topbar { padding: 11px 12px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 13px; }
  .brand-text strong { font-size: 15px; }
  .topbar-actions { gap: 7px; }
  .status-pill { display: none; }
  .icon-btn,
  .primary-btn { width: 42px; height: 42px; padding: 0; border-radius: 14px; }
  .icon-btn span,
  .primary-btn span { display: none; }
  .messages { padding-top: 28px; }
  .welcome { margin-top: 7vh; }
  .welcome h2 { font-size: clamp(34px, 11vw, 48px); }
  .welcome p { font-size: 16px; }
  .settings-overlay { padding: 0; align-items: end; }
  .settings-panel { width: 100%; border-radius: 26px 26px 0 0; padding: 22px 18px 24px; }
}
@media (max-width: 560px) {
  .thread { width: min(94vw, 900px); }
  .bubble,
  .row.ai .bubble { max-width: 90%; }
  .composer-inner { width: min(94vw, 900px); }
  .composer-hint { width: min(94vw, 900px); }
}
