ogd4all / static /style.css
Michael Siebenmann
avoid 3 columns for examples
827d6f2
@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;
}