/* Yucca Lab identity: navy + white carry the page, teal is the accent, coral the one spotlight. */

@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url("fonts/Outfit_400Regular.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("fonts/Outfit_500Medium.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("fonts/Outfit_600SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url("fonts/Outfit_700Bold.woff2") format("woff2"); }

:root {
  --navy: #121B3A;
  --navy-2: #0F2A44;
  --teal: #12C9BE;
  --coral: #FF8754;
  --coral-deep: #E76F51;
  --lav: #F5F5FD;
  --teal-tint: #E7FAF8;
  --coral-tint: #FFF0E8;
  --ink: #2A3342;
  --muted: #6B7785;
  --grey: #D7DFE6;
  --navy-light: #AEB6C6;
  --pale: #E7EAF2;
  --white: #FFFFFF;

  --radius: 10px;
  --topbar: 60px;
  --statusbar: 34px;
  --sidebar: 296px;
  --tile: 172px;
  --shadow: 0 1px 2px rgba(18, 27, 58, .06), 0 4px 16px rgba(18, 27, 58, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 14px/1.45 "Outfit", system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.kicker {
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.kicker.section { margin-bottom: 12px; }

/* Top bar ------------------------------------------------------------------------------------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 10;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: var(--navy); color: var(--white);
  border-bottom: 3px solid var(--teal);
}
.topbar .logo { height: 26px; width: auto; display: block; }
.topbar .product { padding-left: 18px; border-left: 1px solid rgba(231, 234, 242, .25); color: var(--pale); font-weight: 500; font-size: 15px; }
.topbar .spacer { flex: 1; }
.menu-button { display: none; background: none; border: 0; color: var(--white); padding: 6px; }
.sections { display: flex; align-self: stretch; gap: 2px; }
.sections a {
  display: flex; align-items: center; padding: 0 14px; margin-bottom: -3px;
  color: var(--navy-light); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent;
}
.sections a:hover { color: var(--white); }
.sections a[aria-current] { color: var(--white); border-bottom-color: var(--coral); }

.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--teal); color: var(--navy); font-weight: 700; font-size: 13px;
}
.who .lines { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .detail { color: var(--navy-light); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .detail.warn { color: var(--coral); }
.who-menu { position: relative; min-width: 0; }
.who-menu > summary {
  display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; list-style: none;
  padding: 4px 8px; margin: 0 -8px; border-radius: var(--radius);
}
.who-menu > summary::-webkit-details-marker { display: none; }
.who-menu > summary:hover, .who-menu[open] > summary { background: rgba(231, 234, 242, .1); }
.who-menu > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.who-menu .menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 300px; z-index: 30;
  background: var(--white); color: var(--ink); border: 1px solid var(--grey); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; display: grid; gap: 12px;
}
.who-menu .menu-block { display: grid; gap: 2px; overflow-wrap: anywhere; }
.who-menu .menu-block .kicker { margin-bottom: 2px; }
.who-menu .dim { color: var(--muted); font-size: 13px; }
.who-menu .menu-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--grey); padding-top: 12px; }
.who-menu .menu-actions form { margin-left: auto; }
.tree-action { padding: 4px 10px 0; }

/* Layout -------------------------------------------------------------------------------------- */

.layout {
  position: fixed; top: var(--topbar); bottom: var(--statusbar); left: 0; right: 0;
  display: grid; grid-template-columns: var(--sidebar) 1fr;
}
.sidebar { overflow-y: auto; border-right: 1px solid var(--grey); padding: 18px 12px 24px; background: var(--white); }
.main { overflow-y: auto; padding: 22px 28px 40px; min-width: 0; }

/* Sidebar ------------------------------------------------------------------------------------- */

.sidebar .kicker { padding: 0 10px 10px; }
.group-label { padding: 14px 10px 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.tree-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border: 0; border-left: 3px solid transparent; border-radius: 0 8px 8px 0;
  background: none; text-align: left; color: var(--ink);
}
.tree-row:hover { background: var(--lav); }
.tree-row.active { background: var(--teal-tint); border-left-color: var(--teal); color: var(--navy); font-weight: 600; }
.tree-row .label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-row .chevron { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.tree-row.open .chevron { transform: rotate(90deg); }
.tree-row .icon { color: var(--navy); }
.tree-children { padding-left: 22px; }
.tree-note { padding: 6px 10px; font-size: 12px; color: var(--muted); }
.tree-row .starred-mark { width: 14px; height: 14px; color: var(--coral); }
.tree-row .starred-mark svg { fill: currentColor; }

.badge {
  flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px;
  background: var(--lav); color: var(--muted);
}
.badge.lake { background: var(--teal-tint); color: #0B8F87; }
.badge.key { background: var(--coral-tint); color: var(--coral-deep); }

.add-account { display: flex; gap: 6px; padding: 16px 10px 0; }
.add-account input { flex: 1; min-width: 0; }

/* Inputs -------------------------------------------------------------------------------------- */

.field {
  height: 36px; padding: 0 12px; border: 1px solid var(--grey); border-radius: 8px; background: var(--white);
}
.field:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18, 201, 190, .18); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--grey); border-radius: 8px; background: var(--white); color: var(--navy); font-weight: 500;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--teal); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn.primary:hover:not(:disabled) { background: var(--navy-2); }
.btn.icon-only { width: 36px; padding: 0; }

.segmented { display: inline-flex; border: 1px solid var(--grey); border-radius: 8px; overflow: hidden; }
.segmented button { height: 34px; width: 38px; border: 0; background: var(--white); color: var(--muted); display: grid; place-items: center; }
.segmented button.on { background: var(--navy); color: var(--white); }

/* Heading and toolbar ------------------------------------------------------------------------- */

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; border-radius: 4px; padding: 1px 3px; }
.crumbs a:hover { color: var(--navy); background: var(--lav); }
.crumbs .sep { width: 12px; height: 12px; opacity: .6; }
h1 { margin: 4px 0 2px; color: var(--navy); font-size: 28px; font-weight: 700; letter-spacing: -.01em; word-break: break-word; }
.subtitle { color: var(--muted); font-style: italic; margin-bottom: 18px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .icon { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.search input { width: 100%; padding-left: 36px; background: var(--lav); border-color: var(--lav); }
.toolbar .grow { flex: 1; }
.pager { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.pager .page { min-width: 64px; text-align: center; font-weight: 500; color: var(--navy); }
.pager.bottom { display: flex; justify-content: center; margin-top: 26px; }

/* Stars --------------------------------------------------------------------------------------- */

/* A star sits next to the card or tile it marks, never inside the button that opens it. */
.starrable { position: relative; display: flex; flex-direction: column; min-width: 0; }
.starrable > .tile, .starrable > .container-card { flex: 1; }
.star {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: none; color: var(--navy-light);
}
.star .icon { width: 18px; height: 18px; }
.star:hover { color: var(--coral); }
.star.on { color: var(--coral); }
.star.on svg { fill: currentColor; }
.starrable > .star { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .88); opacity: 0; transition: opacity .15s; }
.starrable:hover > .star, .starrable > .star:focus-visible, .starrable > .star.on { opacity: 1; }
@media (hover: none) { .starrable > .star { opacity: 1; } }
.folder-row .starrable > .star, .containers .starrable > .star { top: 50%; transform: translateY(-50%); background: none; }
.kicker.section ~ .kicker.section { margin-top: 26px; }

/* Grid ---------------------------------------------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 16px; }
.tile {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border: 0; padding: 0; background: none; text-align: left; border-radius: var(--radius);
}
.tile .frame {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--lav);
  display: grid; place-items: center; color: var(--muted);
  transition: box-shadow .15s, transform .15s;
}
.tile:hover .frame { box-shadow: var(--shadow); transform: translateY(-1px); }
.tile .frame img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .2s; }
.tile .frame img.ready { opacity: 1; }
.tile .frame.loading { background: linear-gradient(100deg, var(--lav) 30%, #ECECF9 50%, var(--lav) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -150% 0; } }
.tile .frame .icon { width: 40px; height: 40px; }
.tile .frame .icon svg { stroke-width: 1.4; }
.tile .frame .ext { position: absolute; bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.tile .frame .note { position: absolute; bottom: 10px; left: 10px; right: 10px; text-align: center; font-size: 11.5px; }
.tile .caption { padding: 8px 2px 0; min-width: 0; }
.tile .name { font-weight: 500; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta { font-size: 12px; color: var(--muted); }

.tile.folder .frame { aspect-ratio: auto; height: 64px; place-items: center start; padding: 0 44px 0 16px; grid-auto-flow: column; gap: 12px; justify-content: start; }
.tile.folder .frame::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.tile.folder .frame .icon { width: 24px; height: 24px; color: var(--navy); }
.tile.folder .frame .name { font-weight: 600; }
.tile.folder .caption { display: none; }
.folder-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 6px; }

/* List ---------------------------------------------------------------------------------------- */

table.list { width: 100%; border-collapse: collapse; }
.list th { white-space: nowrap; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--grey); }
.list td { padding: 7px 10px; border-bottom: 1px solid var(--lav); white-space: nowrap; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: var(--lav); }
.list td.name { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list .name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list .name-cell span.text { overflow: hidden; text-overflow: ellipsis; color: var(--navy); font-weight: 500; }
.list .mini { width: 40px; height: 30px; border-radius: 5px; background: var(--lav); flex: none; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.list .mini img { width: 100%; height: 100%; object-fit: cover; }
.list .mini .icon { width: 18px; height: 18px; }
.list td.num { text-align: right; color: var(--muted); }
.list td.dim { color: var(--muted); }
.list .star-cell { width: 1%; padding: 2px 0 2px 4px; }
.list tbody tr.section { cursor: default; }
.list tbody tr.section:hover { background: none; }
.list tr.section td { padding: 18px 10px 6px; border-bottom: 1px solid var(--grey); }
.list tr.section:first-child td { padding-top: 6px; }
.list tr.missing .text { color: var(--muted); text-decoration: line-through; }

/* Cards: empty states, errors, welcome -------------------------------------------------------- */

.card {
  position: relative; background: var(--lav); border-radius: var(--radius); padding: 20px 22px 20px 26px; max-width: 760px;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: var(--radius) 0 0 var(--radius); background: var(--teal); }
.card.error::before { background: var(--coral); }
.card h2 { margin: 0 0 6px; font-size: 18px; color: var(--navy); }
.card p { margin: 6px 0; }
.card .hint { color: var(--muted); }
.card .actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.card code { background: var(--white); padding: 1px 6px; border-radius: 4px; font-size: 13px; }

.containers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.container-card {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 46px 16px 20px;
  border: 0; border-radius: var(--radius); background: var(--lav); text-align: left; color: var(--navy);
}
.container-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); background: var(--teal); }
.container-card:hover { box-shadow: var(--shadow); }
.container-card .icon { width: 26px; height: 26px; }
.container-card .name { font-weight: 600; }
.container-card .meta { font-size: 12px; color: var(--muted); }

.spinner { width: 22px; height: 22px; border: 2.5px solid var(--grey); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 30px 0; }

/* Status bar ---------------------------------------------------------------------------------- */

.statusbar {
  position: fixed; inset: auto 0 0 0; height: var(--statusbar); z-index: 10;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: var(--lav); border-top: 1px solid var(--grey); color: var(--muted); font-size: 12.5px;
  white-space: nowrap; overflow: hidden;
}
.statusbar strong { color: var(--navy); font-weight: 600; }
.statusbar .grow { flex: 1; }
.statusbar .saved { color: #0B8F87; font-weight: 600; }

/* Viewer -------------------------------------------------------------------------------------- */

.viewer { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: 58px minmax(0, 1fr); background: var(--navy); color: var(--white); }
.viewer .bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 22px; background: var(--navy); border-bottom: 3px solid var(--teal); }
.viewer .bar .title { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .bar .count { color: var(--navy-light); font-size: 13px; }
.viewer .vbtn { height: 36px; min-width: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(231, 234, 242, .2); border-radius: 8px; background: transparent; color: var(--white); font-weight: 500; text-decoration: none; }
.viewer .vbtn:hover:not(:disabled) { border-color: var(--teal); }
.viewer .vbtn.on { background: var(--teal); border-color: var(--teal); color: var(--navy); }
.viewer .vbtn:disabled { opacity: .35; cursor: default; }
.viewer .vbtn.star { width: 36px; padding: 0; border-radius: 8px; color: var(--white); }
.viewer .vbtn.star.on { background: transparent; border-color: var(--coral); color: var(--coral); }
.viewer .stage { position: relative; overflow: hidden; }
.viewer .canvas { position: absolute; inset: 0; display: flex; padding: 24px; overflow: hidden; }
.viewer .canvas > * { margin: auto; }
.viewer .canvas img { display: block; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; user-select: none; -webkit-user-drag: none; cursor: zoom-in; }
.viewer .canvas.actual { overflow: auto; cursor: grab; }
.viewer .canvas.actual.dragging { cursor: grabbing; }
.viewer .canvas.actual img { max-width: none; max-height: none; cursor: inherit; }
.viewer .canvas img.preview { filter: blur(6px); opacity: .7; width: min(80%, 900px); max-height: 80%; object-fit: contain; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(18, 27, 58, .7); color: var(--white); display: grid; place-items: center; }
.viewer .nav:hover { background: var(--teal); color: var(--navy); }
.viewer .nav.prev { left: 16px; }
.viewer .nav.next { right: 16px; }
.viewer .progress { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); width: min(420px, 70%); text-align: center; font-size: 13px; color: var(--pale); }
.viewer .progress .track { height: 4px; border-radius: 4px; background: rgba(231, 234, 242, .18); overflow: hidden; margin-top: 8px; }
.viewer .progress .fill { height: 100%; width: 0; background: var(--teal); transition: width .1s; }
.viewer .info { overflow-y: auto; padding: 22px; border-left: 1px solid rgba(231, 234, 242, .12); background: rgba(15, 42, 68, .45); }
.viewer .info .kicker { color: var(--teal); margin-bottom: 14px; }
.viewer dl { margin: 0; display: grid; gap: 12px; }
.viewer dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-light); }
.viewer dd { margin: 2px 0 0; color: var(--pale); word-break: break-all; }
.viewer dd.big { font-size: 20px; font-weight: 600; color: var(--white); }
.viewer .copy { margin-top: 8px; }
.viewer .verror { max-width: 460px; padding: 18px 22px; border-left: 4px solid var(--coral); background: rgba(255, 135, 84, .1); border-radius: 8px; }

/* Send to Algo -------------------------------------------------------------------------------- */

.send {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: none; color: var(--navy-light);
}
.send .icon { width: 17px; height: 17px; }
.send:hover, .send.on { color: #0B8F87; }
.folder-row .starrable > .send { position: absolute; top: 50%; right: 40px; transform: translateY(-50%); opacity: 0; transition: opacity .15s; }
.folder-row .starrable:hover > .send, .folder-row .starrable > .send:focus-visible, .folder-row .starrable > .send.on { opacity: 1; }
@media (hover: none) { .folder-row .starrable > .send { opacity: 1; } }
.folder-row .tile.folder .frame { padding-right: 76px; }
.btn.send-btn.on { border-color: var(--teal); color: #0B8F87; }
.send.busy, .btn.busy { cursor: progress; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.list .send-cell { width: 1%; padding: 2px 6px; }
.list tr .send { opacity: 0; }
.list tr:hover .send, .list .send:focus-visible, .list .send.on { opacity: 1; }

.toast {
  position: fixed; right: 22px; bottom: calc(var(--statusbar) + 16px); z-index: 40;
  max-width: min(460px, calc(100vw - 32px)); display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-radius: var(--radius); border-left: 4px solid var(--teal); background: var(--navy); color: var(--white);
  box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast.error { border-left-color: var(--coral); }
.toast a { color: var(--teal); font-weight: 600; white-space: nowrap; text-decoration: none; }

.link { border: 0; background: none; padding: 0; color: #0B8F87; font-weight: 500; }
a.btn { text-decoration: none; }
.table-scroll { overflow-x: auto; }
.link:hover { text-decoration: underline; }

/* Algo: sidebar ------------------------------------------------------------------------------- */

a.tree-row { text-decoration: none; }
.tree-row.muted { color: var(--muted); }
.tree-row.muted .icon { color: var(--muted); }
.sidebar .kicker.sandbox-kicker { padding-top: 22px; }
.sandbox-tools { padding: 0 10px 8px; }
.sandbox-tools .field { width: 100%; }
.sandbox-head { display: flex; align-items: center; gap: 10px; padding: 0 10px 6px; font-size: 12px; color: var(--muted); }
.sandbox-head .selected-count { flex: 1; text-align: right; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input, .sandbox-row input { margin: 0; accent-color: var(--navy); }
.sandbox-row { cursor: grab; align-items: flex-start; }
.sandbox-row .label { white-space: normal; overflow-wrap: anywhere; }
.sandbox-row .icon { width: 16px; height: 16px; }
.drop-on { outline: 2px dashed var(--teal) !important; outline-offset: -2px; background: var(--teal-tint) !important; }
body.dragging-folders .dropzone, body.dragging-folders .experiment-card { outline: 2px dashed var(--navy-light); outline-offset: -2px; }

/* Algo: home ---------------------------------------------------------------------------------- */

.new-experiment { margin-bottom: 30px; max-width: 900px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.form-row .grow { flex: 1 1 260px; min-width: 0; }
.experiment-card { text-decoration: none; }
.experiment-card .meta + .meta { color: var(--ink); }
.containers + .kicker.section { margin-top: 30px; }
.list.sandbox tbody tr { cursor: grab; }
.list td.actions { width: 1%; }
.list td.actions .btn + .btn { margin-left: 6px; }

/* Algo: experiment ---------------------------------------------------------------------------- */

.title-row { display: flex; align-items: center; gap: 6px; }
.btn.quiet { border-color: transparent; color: var(--muted); }
.btn.quiet:hover:not(:disabled) { border-color: var(--grey); color: var(--navy); }
.run { background: var(--lav); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.run-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.run-line strong { color: var(--navy); }
.run .dim, .run .hint { color: var(--muted); font-size: 12.5px; }
.run .hint { margin: 8px 0 0; }
.run .track { height: 6px; border-radius: 6px; background: var(--white); margin-top: 10px; overflow: hidden; }
.run .fill { height: 100%; border-radius: 6px; background: var(--teal); transition: width .3s; }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.panel { min-width: 0; padding: 16px 18px; border: 1px solid var(--grey); border-radius: var(--radius); background: var(--white); }
#exp-results > .panel { margin-bottom: 16px; }
.panel h2 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.panel > .hint { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.panel-foot .hint { font-size: 12.5px; color: var(--muted); }
.folder-lines { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; max-height: 330px; overflow-y: auto; }
.folder-line { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; }
.folder-line:hover { background: var(--lav); }
.folder-line > .icon { color: var(--navy); }
.folder-line .grow { flex: 1; min-width: 0; }
.folder-line .name { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.folder-line .meta { font-size: 12px; color: var(--muted); }
.drop-hint { margin: 10px 0 0; padding: 24px 16px; border-radius: 8px; background: var(--lav); text-align: center; }
.params { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.param label { display: block; margin-bottom: 4px; font-weight: 600; color: var(--navy); }
.param .field { width: 140px; }
.param .hint { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--lav); }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.stat-value { margin-top: 2px; font-size: 28px; font-weight: 600; line-height: 1.2; color: var(--navy); }
.stat-sub { font-size: 12px; color: var(--muted); }
.swatch { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; }

.list.data tbody tr { cursor: default; }
.list.data tbody tr:hover { background: none; }
.list.data td.name { width: auto; max-width: none; white-space: normal; min-width: 160px; }
.list.sandbox td.name { min-width: 220px; }
.list th.num, .list td.num { text-align: right; font-variant-numeric: tabular-nums; }
.list td .dim { color: var(--muted); }
.meter-cell { min-width: 170px; }
.meter { display: inline-block; width: 70px; height: 6px; margin-right: 8px; border-radius: 6px; background: var(--pale); overflow: hidden; vertical-align: middle; }
.meter span { display: block; height: 100%; border-radius: 6px; background: #eb6834; }
.meter-value { font-variant-numeric: tabular-nums; }
.link.more { margin-top: 10px; }
.camera-key { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.chart-controls { margin-bottom: 16px; }
.chart-controls .hint { min-width: 220px; font-size: 12.5px; color: var(--muted); }
.segmented.tabs button { width: auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.segmented.tabs .count { font-size: 11.5px; opacity: .75; }

/* Charts -------------------------------------------------------------------------------------- */

.chart { position: relative; }
.chart-head { display: flex; align-items: center; gap: 12px; min-height: 22px; margin-bottom: 6px; font-size: 12.5px; }
.chart-head .legend { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.chart-head .key { display: inline-flex; align-items: center; gap: 6px; }
.chart-head .note { flex: 1; color: var(--muted); }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--pale); stroke-width: 1; }
.chart-svg .axis { stroke: var(--grey); stroke-width: 1; }
.chart-svg text { font: 500 11px "Outfit", system-ui, sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-svg .ytick { text-anchor: end; }
.chart-svg .xtick { text-anchor: middle; }
.chart-svg .col path { pointer-events: none; }
.chart-svg .hit { fill: transparent; outline: none; }
.chart-svg .hit.on { fill: var(--lav); }
.chart-svg .marker { stroke: var(--ink); stroke-width: 1; }
.chart-svg .marker-label { fill: var(--ink); font-weight: 600; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.chart-svg .dot { stroke: var(--white); stroke-width: 1; pointer-events: none; }
.chart-svg .focus-dot { stroke: var(--white); stroke-width: 2; pointer-events: none; }
.chart-svg .crosshair { stroke: var(--muted); stroke-width: 1; pointer-events: none; }
.chart-svg .ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-svg .ref-label, .chart-svg .end-label { fill: var(--ink); font-weight: 600; }
.chart-svg .ref-label { paint-order: stroke; stroke: var(--white); stroke-width: 4px; stroke-linejoin: round; }
.chart-tip {
  position: absolute; z-index: 5; min-width: 150px; padding: 8px 10px; pointer-events: none;
  border: 1px solid var(--grey); border-radius: 8px; background: var(--white); box-shadow: var(--shadow); font-size: 12.5px;
}
.tip-title { margin-bottom: 4px; color: var(--muted); white-space: nowrap; }
.tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tip-row strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.tip-row span:last-child { color: var(--muted); }
.line-key { flex: none; width: 12px; height: 3px; border-radius: 2px; }
.tip-note { margin-top: 4px; color: var(--muted); }
.chart-table { max-height: 320px; overflow: auto; }

/* Algo: filter from clicks on charts and tables ------------------------------------------------ */

.filter-bar {
  position: sticky; top: -22px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--navy); color: var(--white);
  box-shadow: var(--shadow);
}
.filter-bar .kicker { color: var(--teal); }
.filter-bar .grow { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); font-weight: 500;
}
.chip button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: var(--navy-light); }
.chip button:hover { background: rgba(255, 255, 255, .18); color: var(--white); }
.chip button .icon { width: 14px; height: 14px; }
.chart-svg.pickable .hit { cursor: pointer; }
.chart-svg .col.dimmed { opacity: .3; }
.chart-svg .hit.picked { fill: var(--teal-tint); }
.chart-svg .picked-day { fill: var(--teal-tint); stroke: var(--teal); stroke-width: 1; }
.list.data tbody tr.pickable { cursor: pointer; }
.list.data tbody tr.pickable:hover { background: var(--lav); }
.list.data tbody tr.picked, .list.data tbody tr.picked:hover { background: var(--teal-tint); box-shadow: inset 3px 0 0 var(--teal); }

/* Writes: selection, delete, new folder ------------------------------------------------------- */

.btn.danger { background: var(--coral-deep); border-color: var(--coral-deep); color: var(--white); }
.btn.danger:hover:not(:disabled) { background: #cf5a3d; border-color: #cf5a3d; }
.btn.danger-quiet { color: var(--coral-deep); }
.btn.danger-quiet:hover:not(:disabled) { border-color: var(--coral-deep); }

/* The tick box sits in a thumbnail's top-left corner, next to the tile, never inside its button. */
.starrable > .pick {
  position: absolute; top: 8px; left: 8px; z-index: 1; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: rgba(255, 255, 255, .88); cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.pick input, .pick-cell input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy); cursor: pointer; }
.starrable:hover > .pick, .starrable > .pick:focus-within, .selecting .starrable > .pick, .starrable.picked > .pick { opacity: 1; }
@media (hover: none) { .starrable > .pick { opacity: 1; } }
.starrable.picked .tile .frame { box-shadow: 0 0 0 3px var(--teal); }
.selecting .tile:not(:disabled) { cursor: copy; }
.list .pick-cell { width: 1%; padding: 2px 0 2px 10px; }
.list tr .pick-cell input { opacity: 0; }
.list tr:hover .pick-cell input, .list .pick-cell input:focus-visible, .selecting .list .pick-cell input { opacity: 1; }
.list tbody tr.picked { background: var(--teal-tint); }

.selection-bar {
  position: sticky; top: -22px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: -6px 0 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--navy); color: var(--white);
  box-shadow: var(--shadow);
}
.selection-bar .dim, .selection-bar .hint { color: var(--navy-light); font-size: 12.5px; }
.selection-bar .link { color: var(--teal); }
.selection-bar .grow { flex: 1; }

.results-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.results-head .kicker { flex: 1; }

.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 14px;
  color: var(--ink); background: var(--white); box-shadow: 0 20px 60px rgba(18, 27, 58, .3);
}
.modal::backdrop { background: rgba(18, 27, 58, .45); }
.modal-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; border-top: 4px solid var(--coral); }
.modal h2 { margin: 0; font-size: 20px; color: var(--navy); }
.modal p { margin: 0; }
.modal .lead p { margin: 0 0 6px; }
.modal .hint { color: var(--muted); font-size: 12.5px; }
.modal .names { margin: 0; padding-left: 18px; max-height: 140px; overflow-y: auto; font-size: 13px; overflow-wrap: anywhere; }
.modal .names .dim { color: var(--muted); list-style: none; }
.modal .field { width: 100%; }
.backup-toggle { font-weight: 600; color: var(--navy); }
.backup-toggle .icon { color: #0B8F87; }
.backup-fields { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--lav); }
.backup-fields label > span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.backup-fields .preview { display: flex; flex-direction: column; gap: 4px; }
.backup-fields .preview code { padding: 6px 8px; border-radius: 6px; background: var(--white); font-size: 12px; overflow-wrap: anywhere; }
.modal .warn { padding: 10px 12px; border-left: 4px solid var(--coral); border-radius: 6px; background: var(--coral-tint); color: var(--ink); }
.form-error { color: var(--coral-deep); font-weight: 500; }
.form-error:empty { display: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.modal .track { height: 6px; border-radius: 6px; background: var(--pale); overflow: hidden; }
.modal .fill { height: 100%; width: 0; border-radius: 6px; background: var(--teal); transition: width .3s; }
.job-line { font-weight: 500; color: var(--navy); }
.modal a { color: #0B8F87; font-weight: 500; }
.tile .frame .moved {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px;
  border-radius: 999px; background: rgba(18, 27, 58, .78); color: var(--white); font-size: 11px; font-weight: 600;
}
.tile .frame .moved .icon { width: 13px; height: 13px; color: var(--teal); }

/* Narrow screens ------------------------------------------------------------------------------ */

@media (max-width: 900px) {
  .menu-button { display: inline-flex; }
  .topbar .product, .who .lines { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .sections a { padding: 0 10px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: var(--topbar); bottom: var(--statusbar); left: 0; width: min(320px, 88vw); z-index: 9; box-shadow: var(--shadow); transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  .main { padding: 18px 16px 32px; }
  :root { --tile: 140px; }
  .viewer { grid-template-columns: minmax(0, 1fr); grid-template-rows: 58px minmax(0, 1fr) auto; }
  .viewer .info { max-height: 36vh; border-left: 0; border-top: 1px solid rgba(231, 234, 242, .12); }
  .statusbar { gap: 10px; padding: 0 16px; }
  .statusbar .detail, .statusbar .kicker { display: none; }
  .selection-bar .hint { display: none; }
  .field-row { grid-template-columns: 1fr; }
}

.contents { display: contents; }
