/* Claude window with Numbers Game MCP — uses Claude's own canvas, not NG's */

/* Numbers Game tokens are imported only for the artifact card (JE/report) where NG branding applies */
@import url('../../colors_and_type.css');

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body {
  background: #2a2724;
  color: #1c1a17;
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Claude window chrome ---------- */
.cw {
  --c-canvas: #F0EEE6;
  --c-side:   #E8E5DD;
  --c-side-2: #DDD8CC;
  --c-ink:    #1F1E1C;
  --c-ink-2:  #5A554B;
  --c-ink-3:  #908874;
  --c-line:   #D4CFC1;
  --c-coral:  #C96442;
  --c-coral-soft: #E8C9A2;

  width: 1440px;
  height: 900px;
  margin: 40px auto;
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-canvas);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.18),
    0 32px 96px rgba(0,0,0,0.5),
    0 12px 32px rgba(0,0,0,0.3);
  display: grid;
  grid-template-rows: 36px 1fr;
  font: 14px/1.5 'Hanken Grotesk', -apple-system, system-ui, sans-serif;
}

.cw-titlebar {
  background: var(--c-side-2);
  border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; padding: 0 12px;
  gap: 8px;
}
.cw-titlebar .lights { display: flex; gap: 7px; }
.cw-titlebar .dot { width: 12px; height: 12px; border-radius: 50%; }
.cw-titlebar .dot.r { background: #FF5F57; border: 1px solid #E14640; }
.cw-titlebar .dot.y { background: #FEBC2E; border: 1px solid #DEA123; }
.cw-titlebar .dot.g { background: #28C840; border: 1px solid #1AAB29; }
.cw-titlebar .title {
  flex: 1; text-align: center;
  font: 500 13px/1 -apple-system, system-ui, sans-serif;
  color: var(--c-ink-2);
}

.cw-body {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 0;
}

/* ---------- Sidebar ---------- */
.cw-side {
  background: var(--c-side);
  border-right: 1px solid var(--c-line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.cw-side header {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.cw-side .brand {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--c-coral);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  font-family: ui-serif, Georgia, serif;
}
.cw-side .product { font: 600 14px/1 var(--c-ink); }
.cw-side .new {
  margin: 0 12px 8px;
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  background: var(--c-canvas);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  font: 500 13px var(--c-ink);
  cursor: pointer;
}
.cw-side .new:hover { background: white; }
.cw-side .new .plus { color: var(--c-ink-2); }

.cw-side .section { padding: 8px 12px; }
.cw-side .lbl {
  padding: 8px 8px 6px;
  font: 600 11px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink-3);
}
.cw-side .item {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  border-radius: 6px;
  font: 500 13px var(--c-ink);
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cw-side .item:hover { background: rgba(0,0,0,0.04); }
.cw-side .item.active { background: rgba(201, 100, 66, 0.10); color: var(--c-coral); }
.cw-side .item.active .ico { color: var(--c-coral); }
.cw-side .item .ico { color: var(--c-ink-3); flex: none; }
.cw-side .item .badge {
  margin-left: auto;
  font: var(--mono-sm); color: var(--c-ink-3);
}
.cw-side .grow { flex: 1; }

.cw-side .user {
  padding: 12px 16px;
  border-top: 1px solid var(--c-line);
  display: flex; align-items: center; gap: 10px;
}
.cw-side .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #6B7A8F; color: white;
  display: flex; align-items: center; justify-content: center;
  font: 600 12px sans-serif;
}
.cw-side .user .name { font: 500 13px var(--c-ink); }
.cw-side .user .meta { font: 11px var(--c-ink-3); }

/* ---------- Main area ---------- */
.cw-main {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  background: var(--c-canvas);
}
.cw-head {
  height: 56px; padding: 0 28px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--c-line);
}
.cw-head .crumbs {
  display: flex; align-items: center; gap: 6px;
  font: 500 14px var(--c-ink-2);
}
.cw-head .crumbs strong { color: var(--c-ink); font-weight: 600; }
.cw-head .crumbs .sep { color: var(--c-ink-3); }
.cw-head .right {
  margin-left: auto; display: flex; gap: 6px; align-items: center;
}
.cw-head button {
  height: 32px; padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  font: 500 13px var(--c-ink-2);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.cw-head button:hover { background: rgba(0,0,0,0.04); color: var(--c-ink); }
.cw-head .btn-share {
  background: var(--c-ink);
  color: var(--c-canvas);
  border-color: var(--c-ink);
}
.cw-head .btn-share:hover { background: #2C2825; color: var(--c-canvas); }

/* ---------- Conversation ---------- */
.cw-thread {
  flex: 1; overflow-y: auto;
  padding: 32px 0 120px;
}
.cw-msgs {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex; flex-direction: column; gap: 24px;
}

.msg-user {
  align-self: flex-end;
  max-width: 80%;
  background: #E1DCC9;
  border-radius: 18px;
  padding: 12px 18px;
  font: 15px/1.55 var(--c-ink);
  color: var(--c-ink);
}

.msg-claude { display: flex; gap: 14px; align-items: flex-start; }
.msg-claude .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-coral); color: white;
  display: flex; align-items: center; justify-content: center;
  font: 700 13px ui-serif, Georgia, serif;
  flex: none; margin-top: 2px;
}
.msg-claude .body { flex: 1; min-width: 0; }
.msg-claude .body p {
  font: 15px/1.6 var(--c-ink);
  margin: 0 0 8px;
}
.msg-claude .body strong { font-weight: 600; }
.msg-claude .body p:last-child { margin-bottom: 0; }

/* ---------- Tool call cards ---------- */
.tool {
  margin: 12px 0;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  overflow: hidden;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.tool .row {
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.tool .row .ico { color: var(--c-coral); flex: none; }
.tool .row .tool-name { color: var(--c-ink); font-weight: 600; }
.tool .row .tool-fn { color: var(--c-ink-2); }
.tool .row .grow { flex: 1; }
.tool .row .ms { color: var(--c-ink-3); font-size: 11px; }
.tool .preview {
  padding: 10px 14px;
  border-top: 1px solid var(--c-line);
  background: rgba(0,0,0,0.02);
  font-size: 11.5px;
  color: var(--c-ink-2);
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
}
.tool .preview .k { color: var(--c-coral); }
.tool .preview .s { color: var(--c-ink); }
.tool .preview .n { color: #6B7A8F; }

/* ---------- Numbers Game artifact card (JE preview) ---------- */
.ng-artifact {
  margin: 16px 0;
  background: var(--cream);
  border: 1px solid var(--mid);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-resting);
}
.ng-artifact .a-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--mid);
  display: flex; align-items: center; gap: 10px;
  background: var(--linen);
}
.ng-artifact .a-mark {
  font: italic 400 22px/1 var(--font-display);
  letter-spacing: -0.04em;
  color: var(--ink);
  display: inline-flex; align-items: center;
}
.ng-artifact .a-mark .d {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ochre);
  margin: 0 3px;
  transform: translateY(1px);
}
.ng-artifact .a-title {
  font: 600 14px var(--font-body);
  color: var(--ink);
}
.ng-artifact .a-meta {
  font: 500 11px var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-2);
  margin-left: auto;
}
.ng-artifact .a-body { padding: 18px 20px 6px; }
.ng-artifact .a-meta-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 4px 16px;
  font: var(--body-sm);
  color: var(--slate);
  margin-bottom: 14px;
}
.ng-artifact .a-meta-row .v { color: var(--ink); font-weight: 500; }
.ng-artifact table {
  width: 100%; border-collapse: collapse;
  font: var(--body-sm);
}
.ng-artifact table th {
  font: 600 11px var(--font-body);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--slate-2);
  text-align: left; padding: 8px 0;
  border-bottom: 1px solid var(--mid);
}
.ng-artifact table th.r, .ng-artifact table td.r { text-align: right; }
.ng-artifact table td {
  padding: 10px 0;
  color: var(--ink);
  border-bottom: 1px solid rgba(217, 207, 181, 0.5);
}
.ng-artifact table td .acct {
  font: 500 13px var(--font-body); color: var(--ink);
}
.ng-artifact table td .acct .num {
  font: 500 12px var(--font-mono);
  color: var(--slate-2); margin-right: 8px;
}
.ng-artifact table td.amt {
  font: 500 13px/1 var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}
.ng-artifact table tr.total td {
  border-bottom: 0;
  padding-top: 12px;
  font-weight: 600;
}
.ng-artifact .a-actions {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--mid);
  background: var(--linen);
  display: flex; gap: 8px;
}

/* ---------- Composer ---------- */
.cw-composer-wrap {
  position: absolute; bottom: 24px; left: 264px; right: 0;
  display: flex; justify-content: center;
  padding: 0 28px;
  pointer-events: none;
}
.cw-composer {
  pointer-events: auto;
  width: 100%; max-width: 760px;
  background: white;
  border: 1px solid var(--c-line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 14px 16px 10px;
}
.cw-composer .input {
  font: 15px/1.5 var(--c-ink);
  color: var(--c-ink-3);
  min-height: 24px;
}
.cw-composer .controls {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.cw-composer .pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  font: 500 12px var(--c-ink-2);
  cursor: pointer;
}
.cw-composer .pill.connected {
  background: rgba(95, 122, 90, 0.10);
  border-color: rgba(95, 122, 90, 0.25);
  color: #364B33;
}
.cw-composer .pill .dot-g {
  width: 6px; height: 6px; border-radius: 50%;
  background: #5F7A5A;
}
.cw-composer .send {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--c-coral);
  color: white;
  display: flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
}

/* relative root for absolute composer */
.cw-main { position: relative; }

/* small inline buttons used in artifact actions */
.ng-btn-approve {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  background: var(--ochre);
  color: #FAF6EE; border: 0;
  border-radius: 6px;
  font: 500 13px var(--font-body);
  cursor: pointer; white-space: nowrap;
}
.ng-btn-approve:hover { background: var(--ochre-deep); }
.ng-btn-edit, .ng-btn-discard {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--mid);
  border-radius: 6px;
  font: 500 13px var(--font-body);
  cursor: pointer; white-space: nowrap;
}
.ng-btn-edit:hover, .ng-btn-discard:hover { background: var(--linen); }
.ng-btn-discard { color: var(--slate); }
