:root {
  --ink: #3d3630;
  --paper: rgba(250, 246, 238, 0.88);
  --accent: #a05a2c;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #e9e4da;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
}
#app, #app canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- interface ---------- */
.ui { transition: opacity 0.45s ease; }
body.hide-ui .ui { opacity: 0 !important; pointer-events: none !important; }

.card {
  position: absolute; top: 18px; left: 18px; max-width: 372px;
  background: var(--paper);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 14px 18px 12px;
  box-shadow: 0 2px 14px rgba(60, 45, 25, 0.14);
  user-select: text;
}
.card h1 { font-size: 19px; margin: 0 0 2px; font-weight: 600; letter-spacing: 0.2px; }
.card h1 .latin { font-weight: 400; color: #7d746a; }
.card .place { margin: 0; font-size: 13px; color: #6f675e; }
.card .note { margin: 8px 0 4px; font-size: 12.5px; line-height: 1.45; color: #56504a; }
.card .model { margin: 4px 0 8px; font-size: 12.5px; color: #56504a; }
.card .model .dim { color: #8b8378; }
.card .keys { margin: 8px 0 0; font-size: 11.5px; color: #7d746a; }
.card details { margin: 2px 0 4px; font-size: 12.5px; }
.card summary { cursor: pointer; color: var(--accent); font-weight: 600; user-select: none; }
.card .prompt-body { margin-top: 8px; }
.card .prompt-body p { font-size: 12px; line-height: 1.5; color: #56504a; margin: 0 0 8px; }
#promptText {
  max-height: 300px; overflow: auto; white-space: pre-wrap; tab-size: 2;
  font: 11px/1.5 "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid #ddd3c4; border-radius: 8px;
  padding: 10px 12px; margin: 0; color: #4a443d;
}

.hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(250, 246, 238, 0.82); border-radius: 20px;
  padding: 7px 16px; font-size: 12px; color: #6f675e;
  box-shadow: 0 1px 8px rgba(60, 45, 25, 0.10);
  transition: opacity 1.2s ease; user-select: none;
}
.hint.faded { opacity: 0; }

.loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #ece7dd; color: #7d746a; font-size: 14px; letter-spacing: 0.4px;
  z-index: 5; transition: opacity 0.8s ease;
}
.loading.done { opacity: 0; pointer-events: none; }

@media (max-width: 640px) { .card { max-width: 300px; } }
