Spaces:
Sleeping
Sleeping
File size: 10,819 Bytes
793c96d a1cabf9 793c96d a1cabf9 793c96d 9e51f43 075a828 827d6f2 075a828 9e51f43 f3ca561 151ba7d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@800&display=swap');
.full-height {
min-height: 0;
}
/* ββ Default: centered layout (no class needed β avoids load flash) ββ */
#chat-col-inner {
display: flex;
flex-direction: column;
justify-content: center;
padding-top: 12vh;
}
/* Chatbot shrinks to content by default (shows examples, hides empty space) */
#main-chatbot {
flex: 0 0 auto !important;
min-height: 0 !important;
transition: flex 0.4s ease;
}
/* ChatInterface wrapper: narrower by default (targets the non-chatbot child) */
#chat-col-inner > div:not(#main-chatbot) {
max-width: 780px;
width: 75%;
margin: 0 auto;
transition: max-width 0.4s ease, width 0.4s ease, margin 0.4s ease;
}
/* ββ Active state: input at bottom, full layout βββββββββββββ */
#chat-col-inner.chat-active {
justify-content: flex-start !important;
padding-top: 0 !important;
}
#chat-col-inner.chat-active #main-chatbot {
flex: 1 1 auto !important;
min-height: unset !important;
}
#chat-col-inner.chat-active > div:not(#main-chatbot) {
max-width: none !important;
width: 100% !important;
margin: 0 !important;
}
@media (max-width: 768px) {
#chat-col-inner {
padding-top: 6vh;
}
#chat-col-inner > div:not(#main-chatbot) {
width: 90% !important;
}
#chat-col-inner.chat-active > div:not(#main-chatbot) {
width: 100% !important;
}
}
/* ββ Title: large mono in centered mode, compact h1 in active mode ββ */
.title-big {
overflow: hidden;
max-height: 160px;
opacity: 1;
transition: max-height 0.4s ease, opacity 0.3s ease;
text-align: center;
padding: 0.5rem 0 0.8rem;
}
.title-big-name {
font-family: 'JetBrains Mono', 'Courier New', monospace;
font-size: 3.8rem;
font-weight: 900;
letter-spacing: 0.06em;
line-height: 1;
}
.title-big-sub {
margin-top: 0.45em;
font-size: 0.92rem;
color: #999;
letter-spacing: 0.01em;
}
.title-small {
overflow: hidden;
max-height: 0;
opacity: 0;
transition: max-height 0.4s ease, opacity 0.3s ease;
text-align: center;
}
body.chat-active .title-big {
max-height: 0;
opacity: 0;
}
body.chat-active .title-small {
max-height: 80px;
opacity: 1;
}
/* Map panel: propagate height through Gradio's wrapper divs */
.map-panel {
height: 100%;
}
.map-panel .prose,
.map-panel > div {
height: 100% !important;
max-height: 100% !important;
}
/* Override folium's padding-bottom aspect-ratio trick */
.map-panel div[style*="padding-bottom"] {
padding-bottom: 0 !important;
height: 100% !important;
}
/* Hide folium's Jupyter notebook trust fallback message */
.map-panel div[style*="padding-bottom"] > span {
display: none;
}
.map-panel iframe {
height: 100% !important;
position: relative !important;
}
@media (max-width: 768px) {
/* Fixed-height app layout β keeps input pinned at the bottom */
html, body {
height: 100dvh !important;
overflow: hidden !important;
}
.gradio-container,
.gradio-container > .main,
.gradio-container > .main > .wrap {
height: 100% !important;
min-height: unset !important;
overflow: hidden !important;
}
/* Main row fills remaining height; other rows stay auto */
.full-height {
flex: 1 1 auto !important;
height: auto !important;
min-height: 0 !important;
overflow: hidden !important;
}
/* Map panel: hidden on mobile (map-col is hidden) */
.map-panel { display: none !important; }
/* Reduce side padding */
#chat-col-inner {
padding-left: 4px !important;
padding-right: 4px !important;
}
/* Prevent footer row from growing alongside the main row */
#footer-row {
flex: 0 0 auto !important;
min-height: unset !important;
height: auto !important;
}
#footer-row > *,
#footer-row .grow-children {
height: auto !important;
min-height: unset !important;
align-items: center !important;
}
}
/* Dynamic split layout: map column hidden until a real map is available */
@media (min-width: 769px) {
#map-col {
flex: 0 0 0% !important;
width: 0 !important;
max-width: 0 !important;
min-width: 0 !important;
overflow: hidden !important;
opacity: 0;
transition: flex-basis 0.5s cubic-bezier(0.4, 0, 0.2, 1),
max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.4s ease 0.1s;
}
#map-col.map-active {
flex: 1 1 50% !important;
width: auto !important;
max-width: 50% !important;
min-width: 0 !important;
overflow: visible !important;
opacity: 1;
}
}
/* ββ Mobile: hide title row + map column ββ */
@media (max-width: 768px) {
#title-row { display: none !important; }
#map-col { display: none !important; }
}
/* ββ In-chat map button (mobile only) ββ */
#map-chat-btn {
padding: 4px 8px 6px;
}
#map-chat-btn button {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 9px 16px;
background: var(--background-fill-secondary, #f3f4f6);
border: 1px solid var(--border-color-primary, rgba(0, 0, 0, 0.1));
border-radius: 14px;
cursor: pointer;
font-size: 0.875rem;
font-weight: 500;
color: var(--body-text-color, #374151);
font-family: inherit;
transition: background 0.15s ease;
}
#map-chat-btn button:hover {
background: var(--background-fill-primary, #e5e7eb);
}
/* Never show on desktop */
@media (min-width: 769px) {
#map-chat-btn { display: none !important; }
}
/* ββ Fullscreen map overlay (mobile) ββ */
#map-overlay {
display: flex;
flex-direction: column;
position: fixed;
inset: 0;
z-index: 10000;
background: #000;
/* Hidden: slid off-screen below */
visibility: hidden;
transform: translateY(100%);
transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
visibility 0s linear 0.35s;
pointer-events: none;
}
#map-overlay.active {
visibility: visible;
transform: translateY(0);
pointer-events: auto;
transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
visibility 0s linear 0s;
}
#map-overlay-bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
background: #1f2937;
color: #f9fafb;
flex-shrink: 0;
min-height: 48px;
}
.map-overlay-title {
font-size: 1rem;
font-weight: 600;
letter-spacing: 0.02em;
}
#map-overlay-close {
display: flex;
align-items: center;
justify-content: center;
background: none;
border: none;
color: #f9fafb;
cursor: pointer;
padding: 6px;
border-radius: 8px;
transition: background 0.15s ease;
}
#map-overlay-close:hover,
#map-overlay-close:focus-visible {
background: rgba(255, 255, 255, 0.12);
outline: none;
}
#map-overlay-content {
flex: 1;
overflow: hidden;
background: #fff;
}
/* Never show the overlay on desktop */
@media (min-width: 769px) {
#map-overlay { display: none !important; }
}
/* ββ Footer bar ββ */
#footer-bar {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 0.2rem 0;
}
.footer-attribution {
text-align: center;
color: #b0b8c1;
font-size: 0.8rem;
margin: 0.4rem 0 0.2rem;
}
.footer-mobile-btns {
display: none;
align-items: center;
justify-content: center;
gap: 10px;
padding: 4px 0;
}
@media (max-width: 768px) {
.footer-attribution { display: none; }
.footer-mobile-btns { display: flex; }
}
#footer-info-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 5px;
height: 30px;
padding: 0 14px;
line-height: 1;
background: transparent;
border: 1px solid var(--border-color-primary, rgba(0, 0, 0, 0.15));
border-radius: 15px;
font-size: 0.82rem;
font-family: inherit;
color: var(--body-text-color-subdued, #6b7280);
cursor: pointer;
transition: background 0.15s ease;
}
#footer-info-btn:hover {
background: var(--background-fill-secondary, rgba(0, 0, 0, 0.05));
}
#footer-info-btn svg {
display: block;
flex-shrink: 0;
}
/* ββ Info modal ββ */
#info-modal-backdrop {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.45);
z-index: 10001;
align-items: flex-end;
justify-content: center;
padding: 0;
}
#info-modal-backdrop.active {
display: flex;
}
#info-modal {
background: var(--background-fill-primary, #fff);
border-radius: 20px 20px 0 0;
padding: 28px 24px 32px;
width: 100%;
max-width: 540px;
position: relative;
max-height: 60vh;
overflow-y: auto;
}
#info-modal p {
font-size: 0.82rem;
color: #6b7280;
line-height: 1.6;
margin: 0 0 0.75rem;
}
#info-modal p:last-child { margin-bottom: 0; }
/* ββ Image lightbox for chatbot charts ββ */
#img-lightbox {
display: none;
position: fixed;
inset: 0;
z-index: 20000;
background: rgba(0, 0, 0, 0.85);
align-items: center;
justify-content: center;
cursor: zoom-out;
}
#img-lightbox.active {
display: flex;
}
#img-lightbox img {
max-width: 92vw;
max-height: 92vh;
object-fit: contain;
border-radius: 4px;
box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
cursor: default;
}
/* Make chatbot area blend with page background */
#main-chatbot {
background: #f9fafb !important;
border: none !important;
box-shadow: none !important;
}
#main-chatbot > div,
#main-chatbot .bubble-wrap {
background: transparent !important;
}
/* Dark mode */
.dark #main-chatbot,
[data-theme="dark"] #main-chatbot {
background: #0c0f18 !important;
}
/* Cap example grid at 2 columns (1 on narrow screens) */
#main-chatbot .examples {
grid-template-columns: 1fr !important;
max-width: none !important;
}
@media (min-width: 600px) {
#main-chatbot .examples {
grid-template-columns: 1fr 1fr !important;
}
}
/* Keep example buttons with their own card background */
#main-chatbot button.example {
background: #fff !important;
}
.dark #main-chatbot button.example,
[data-theme="dark"] #main-chatbot button.example {
background: #222936 !important;
}
/* Zoom cursor hint on the image */
#main-chatbot .image-frame {
cursor: zoom-in;
}
/* Hide Chrome's default scrollbar arrows on the chat input textarea */
.multimodal-textbox textarea {
overflow-y: auto !important;
}
|