/* TTD board page + workspace. Uses the dashboard tokens from ttd-dash.css (.viz-root). */
html, body { height: 100%; }
body.viz-root { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
[hidden] { display: none !important; }

.bd-bar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--surface-1);
  border-bottom: 1px solid var(--border); flex: none; }
.bd-brand { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  color: var(--brand); text-decoration: none; flex: none; }
.bd-brand i { width: 12px; height: 12px; border-radius: 0 50% 50% 50%; transform: rotate(45deg); background: linear-gradient(135deg, #14a3a3, #1572d3); }
.bd-titles { min-width: 0; flex: 1; }
.bd-logo { flex: none; height: 32px; max-width: 150px; object-fit: contain; }
@media (max-width: 520px) { .bd-logo { height: 26px; max-width: 96px; } }
.bd-titles h1 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-titles p { margin: 1px 0 0; font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-titles p:empty { display: none; }
.bd-badge { flex: none; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-secondary); background: var(--page); white-space: nowrap; }
.bd-badge.is-draft { color: #8a5a00; background: #fff4d6; border-color: #f0d79a; }
.bd-badge.is-company { color: #0b5d2b; background: #e3f6ea; border-color: #a9dcbb; }
.bd-badge.is-public { color: #0b4a8f; background: #e3effc; border-color: #a9c9ee; }
.bd-live { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #c0392b; }
.bd-live i { width: 8px; height: 8px; border-radius: 50%; background: #e74c3c; animation: bd-pulse 1.6s infinite; }
@keyframes bd-pulse { 0% { box-shadow: 0 0 0 0 rgba(231,76,60,.5); } 70% { box-shadow: 0 0 0 8px rgba(231,76,60,0); } 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); } }
.bd-btn { flex: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--brand); background: transparent;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer; text-decoration: none; }
.bd-btn:hover { border-color: var(--brand); }
.bd-btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--surface-1); }

.bd-tabs { display: flex; gap: 4px; padding: 0 16px; background: var(--surface-1); border-bottom: 1px solid var(--border);
  overflow-x: auto; flex: none; scrollbar-width: none; }
.bd-tab { font: inherit; font-size: 14px; font-weight: 600; color: var(--text-secondary); background: none; border: 0;
  border-bottom: 3px solid transparent; padding: 11px 12px 9px; cursor: pointer; white-space: nowrap; }
.bd-tab.is-map::before { /* a folded map: this tab is a map (not a water drop) */
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px; background: currentColor; opacity: .75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 3 5.5v15.5l6-2.5 6 2.5 6-2.5V3l-6 2.5L9 3zm0 2.2 6 2.5v11.1l-6-2.5V5.2z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 3 5.5v15.5l6-2.5 6 2.5 6-2.5V3l-6 2.5L9 3zm0 2.2 6 2.5v11.1l-6-2.5V5.2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.bd-tab:hover { color: var(--text-primary); }
.bd-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

.bd-body { flex: 1; position: relative; min-height: 0; display: flex; flex-direction: column; }
.bd-cards { flex: 1; overflow-y: auto; }
.bd-cards .dash { padding-top: 20px; }
.bd-map { flex: 1; width: 100%; border: 0; display: block; min-height: 420px; background: #0b1118; }
/* a full-height map or document: the VISIBLE height (dvh); 100vh on phones runs under the browser's toolbars and hid the time bar and zoom (report #3) */
body.viz-root:has(.bd-map:not([hidden])) { height: 100vh; height: 100dvh; overflow: hidden; }

.bd-empty, .bd-pass { margin: 12vh auto 0; max-width: 520px; text-align: center; padding: 0 20px; }
.bd-empty-lead { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.bd-empty-eg { color: var(--text-secondary); font-size: 16px; margin: 0; }
.bd-pass input { font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; width: 220px; margin-right: 6px;
  background: var(--surface-1); color: var(--text-primary); }

.bd-flash { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text-primary); color: var(--surface-1);
  font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 20; }
.bd-flash.go { animation: bd-in .35s ease-out; }
@keyframes bd-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* embedded in another website */
.bd-made { flex: none; font-size: 12px; color: var(--text-secondary); text-decoration: none; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; }
.bd-made b { color: var(--brand); }
.bd-made:hover { border-color: var(--brand); }
body.is-embed .bd-bar { padding: 8px 14px; gap: 10px; }
body.is-embed .bd-titles h1 { font-size: 16px; }
body.is-embed #bd-nums, body.is-embed #bd-present { display: none; }
body.is-embed .bd-cards .dash { padding-top: 14px; }
body.is-embed .bd-map { min-height: 300px; }

/* workspace */
.ws { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ws-card { display: block; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.ws-card:hover { border-color: var(--brand); box-shadow: 0 6px 24px rgba(11,37,64,.08); }
.ws-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ws-when { font-size: 12px; color: var(--text-muted); }
.ws-card h2 { font-size: 17px; margin: 0 0 4px; }
.ws-card p { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; }
.ws-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.ws-tab { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--page); border: 1px solid var(--border); color: var(--text-secondary); }
.ws-tab.is-map { border-color: #a9c9ee; color: #0b4a8f; }

/* workspace: your data */
.ws-h { font-size: 15px; margin: 4px 0 12px; color: var(--text-secondary); font-weight: 700; }
.ws-data { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 24px; }
.ws-data-head h2 { font-size: 17px; margin: 0 0 2px; }
.ws-data-head p { font-size: 13px; color: var(--text-secondary); margin: 0 0 12px; }
.ws-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 14px;
  border: 2px dashed var(--border); border-radius: 10px; cursor: pointer; text-align: center; background: var(--page); transition: border-color .15s, background .15s; }
.ws-drop:hover, .ws-drop.is-over { border-color: var(--brand); }
.ws-drop.is-over { background: color-mix(in srgb, var(--brand) 8%, var(--page)); }
.ws-drop-main { font-size: 14px; font-weight: 600; }
.ws-drop-main u { color: var(--brand); }
.ws-drop-msg { font-size: 13px; color: var(--text-secondary); }
.ws-drop-msg:empty { display: none; }
.ws-drop-msg.is-ok { color: #0b5d2b; }
.ws-drop-msg.is-err { color: #b42318; }
.ws-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ws-file { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ws-file-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.ws-sheets { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-sheet { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--page); border: 1px solid var(--border); color: var(--text-secondary); }
.ws-sheet b { color: var(--text-primary); font-weight: 600; }

@media (max-width: 640px) {
  .bd-bar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .bd-titles h1 { font-size: 16px; }
  .bd-titles { flex-basis: calc(100% - 90px); }
  #bd-present, #bd-nums, #bd-embed { display: none; }
  body.is-embed .bd-titles { flex-basis: auto; }
}

/* a card the AI scrolled to ("show me card 6") glows briefly */
.bd-pulse { animation: bd-pulse 1.8s ease-out; }
@keyframes bd-pulse { 0%, 30% { box-shadow: 0 0 0 3px var(--accent, #4fb4ff); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .bd-pulse { animation: none; outline: 3px solid var(--accent, #4fb4ff); } }

/* the link card: publish confirmation, "show the link / QR code" */
.bd-share { position: fixed; right: 24px; bottom: 24px; z-index: 30; width: 300px; box-sizing: border-box; padding: 18px 18px 16px;
  background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 16px 48px rgba(11,37,64,.22); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.bd-share.go { animation: bd-share-in .35s ease-out; }
@keyframes bd-share-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.bd-share-x { position: absolute; top: 6px; right: 8px; font: inherit; font-size: 22px; line-height: 1; background: none; border: 0;
  color: var(--text-muted); cursor: pointer; padding: 6px; }
.bd-share-head { margin: 0; font-size: 18px; font-weight: 700; color: var(--brand); }
.bd-share-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-secondary); max-width: 100%; overflow-wrap: anywhere; }
.bd-share-qr { margin: 6px 0 2px; line-height: 0; }
.bd-share-qr canvas { width: 200px; height: 200px; border-radius: 8px; image-rendering: pixelated; }
.bd-share-url { margin: 4px 0 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; max-width: 100%; }
.bd-share-note { margin: 0 0 6px; font-size: 12.5px; color: var(--text-muted); }
.bd-share .bd-btn.is-primary { background: var(--brand); border-color: var(--brand); color: var(--surface-1); padding: 8px 18px; font-size: 14px; }
@media (min-width: 1600px) {   /* a TV across the room: bigger card, bigger code */
  .bd-share { width: 380px; right: 40px; bottom: 40px; }
  .bd-share-head { font-size: 24px; }
  .bd-share-url { font-size: 19px; }
  .bd-share-qr canvas { width: 260px; height: 260px; }
}
@media (max-width: 520px) { .bd-share { left: 16px; right: 16px; bottom: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .bd-share.go { animation: none; } }

/* edit mode (by hand) */
body.is-editing #dash .card { position: relative; outline: 1.5px dashed color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; cursor: grab; }
body.is-editing #dash .card.is-dragging { opacity: .45; }
body.is-editing #dash .card.is-drop { outline: 2.5px solid var(--brand); }
body.is-editing [contenteditable] { cursor: text; border-radius: 4px; }
body.is-editing [contenteditable]:hover, body.is-editing [contenteditable]:focus { background: color-mix(in srgb, var(--brand) 10%, transparent); outline: none; }
body.is-saving #dash { opacity: .7; transition: opacity .15s; }
body:not(.is-editing) .ed-bar { display: none; }
.ed-bar { position: absolute; top: 6px; left: 6px; z-index: 3; display: flex; gap: 4px; }
.ed-btn { font: inherit; font-size: 12px; font-weight: 700; line-height: 1; padding: 5px 7px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--brand); cursor: pointer; box-shadow: 0 2px 6px rgba(11, 37, 64, .12); }
.ed-btn:hover { border-color: var(--brand); }
body.is-editing #dash .card .chart-head, body.is-editing #dash .card .kpi-label { margin-top: 26px; }

/* which workspace this dashboard belongs to (links home) */
.bd-space { font-size: 12px; color: var(--text-secondary, #888); text-decoration: none; border: 1px solid var(--grid, #3333);
  border-radius: 999px; padding: 2px 10px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.bd-space:hover { color: var(--text-primary, inherit); }
@media (max-width: 520px) { .bd-space { display: none; } }
.bd-screen { font: inherit; font-size: 12px; color: var(--text-secondary, #888); background: none; cursor: pointer;
  border: 1px solid var(--grid, #3333); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.bd-screen:hover { color: var(--text-primary, inherit); }

/* the TV's ☰ Dashboards menu */
.bd-menu-btn { white-space: nowrap; }
.bd-menu { position: fixed; inset: 0; z-index: 60; background: rgba(4, 12, 24, .55); display: flex; justify-content: center; align-items: flex-start; padding: 64px 16px 16px; }
.bd-menu[hidden] { display: none; }
.bd-menu-box { width: min(760px, 100%); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow: auto; background: var(--surface-1, #fff); color: var(--text-primary, #0b2540);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); padding: 18px 20px 20px; animation: bd-menu-in .22s ease both; }
@keyframes bd-menu-in { from { opacity: 0; transform: translateY(-8px); } }
.bd-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 18px; }
.bd-menu-x { font: inherit; font-size: 26px; line-height: 1; background: none; border: 0; color: inherit; cursor: pointer; padding: 4px 8px; }
.bd-menu-ws h3 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary, #5b6b7d); }
.bd-menu-item { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left; font: inherit;
  background: none; border: 1px solid var(--grid, #e3e8ee); border-radius: 10px; padding: 12px 14px; margin: 6px 0; cursor: pointer; color: inherit; }
.bd-menu-item:hover, .bd-menu-item:focus-visible { border-color: var(--brand, #1572d3); background: color-mix(in srgb, var(--brand, #1572d3) 7%, transparent); }
.bd-menu-item.is-on { border-color: var(--brand, #1572d3); }
.bd-menu-item.is-busy { opacity: .6; }
.bd-menu-t { font-weight: 600; font-size: 16px; }
.bd-menu-m { font-size: 12px; color: var(--text-secondary, #5b6b7d); white-space: nowrap; }
.bd-menu-note { color: var(--text-secondary, #5b6b7d); }

/* filters: pickers above a cards tab */
.bd-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 16px 0; max-width: 1200px; margin: 0 auto; }
.bd-filters[hidden] { display: none; }
.bd-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.bd-filter select { font: inherit; color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 28px 6px 10px; min-width: 120px; max-width: 220px; }
.bd-filter select:disabled { opacity: 1; color: var(--text-primary); }
.bd-filter-note { font-size: 12px; color: var(--text-muted); }
.bd-filter-btn { font: inherit; font-size: 12px; color: var(--brand); background: none; border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.bd-filters:not([hidden]) + .dash { padding-top: 12px; }
@media (max-width: 640px) { .bd-filters { padding: 12px 16px 0; } .bd-filter { flex: 1 1 100%; } .bd-filter select { flex: 1; max-width: none; } }

/* the big screen on a TV-sized display: the title, tabs and buttons grow with the cards (one size across the page) */
@media (min-width: 1280px) {
  body[data-live="1"] .bd-titles h1 { font-size: 24px; }
  body[data-live="1"] .bd-titles p { font-size: 15px; }
  body[data-live="1"] .bd-tab { font-size: 17px; padding: 13px 14px 11px; }
  body[data-live="1"] .bd-btn { font-size: 15px; }
}

/* lighter type (Inter, ttd-dash.css): titles 650, tabs 500 (the open one 600), buttons 550 */
.bd-titles h1, .bd-empty-lead, .bd-share-head, .bd-share-url { font-weight: 650; }
.bd-tab { font-weight: 500; }
.bd-tab[aria-selected="true"] { font-weight: 600; }
.bd-btn, .bd-flash { font-weight: 550; }
.bd-brand { font-weight: 650; }

/* the ARIA wordmark (brand kit S2, black and white): the file's shape as a mask, in the page's text colour, so it is ink on
   light, white on dark and follows company themes; the word "Aria" stays in the link for screen readers */
.bd-brand { font-size: 0 !important; gap: 0; line-height: 0; }
.bd-brand i { display: none; }
.bd-brand::before { content: ""; display: block; width: 62px; height: 19px; background: var(--text-primary);
  -webkit-mask: url(/assets/brand/aria-wordmark.svg) left center / contain no-repeat; mask: url(/assets/brand/aria-wordmark.svg) left center / contain no-repeat; }
@media (max-width: 520px) { .bd-brand::before { width: 52px; height: 16px; } }
@media (min-width: 1280px) { body[data-live="1"] .bd-brand::before { width: 84px; height: 26px; } }
.bd-made b { font-size: 0; }
.bd-made b::after { content: ""; display: inline-block; width: 40px; height: 12px; vertical-align: -1px; background: var(--text-primary);
  -webkit-mask: url(/assets/brand/aria-wordmark.svg) center / contain no-repeat; mask: url(/assets/brand/aria-wordmark.svg) center / contain no-repeat; }
/* a TV on /live shows no buttons; a phone or laptop on /live keeps Save image / Share (the map's picture is made from it) */
@media (min-width: 1280px) { body[data-live="1"] #bd-saveimg { display: none; } }
/* Aria Docs on the big screen: the document page fills the space under the top bar */
.bd-doc { flex: 1; width: 100%; border: 0; display: block; min-height: 420px; background: #e9e7e3; }
body.viz-root.has-doc { height: 100vh; height: 100dvh; overflow: hidden; }
body.has-doc .bd-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* the Privacy link under every dashboard (w0 15 Nov: the anonymous browser ID is explained on /help#privacy) */
.bd-legal { flex: none; margin: 0; padding: 2px 16px 8px; font-size: 12px; text-align: right; }
.bd-legal a { color: var(--text-secondary); }
