/* The window: the two bars, the left column and the stage, menus, the start screen. */
/* ---- window ------------------------------------------------------------------------------------------
   Left: the project bar over the tree and the selected step's panel (they work together, side by side). Right: the
   view bar over the canvas. Both bars are 44 px, one line across the window. */
.app {
  display: flex;
  height: 100%;
}
.left {
  position: relative;
  z-index: 20;
  width: 456px;
  flex: none;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--edge);
}
.left-body {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
}
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--canvas);
}
.stage-body {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
}
.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px;
  background: var(--toolbar);
  border-bottom: 1px solid var(--edge);
}
.left-bar {
  justify-content: space-between;
}
.left-bar > .menu {
  min-width: 0;
}
.left-bar .tb-button.project {
  max-width: 100%;
} /* a long project name ends in an ellipsis instead of widening the bar */
.view-bar {
  padding-left: 14px;
}
.view-shown {
  min-width: 0;
  flex: 0 1 auto;
  color: var(--label);
  font-weight: var(--fw-text);
  font-size: var(--fs-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the view bar's text that is not a control (zoom, what is shown, size) is one gray */
.bar-note {
  color: var(--label);
  font-weight: var(--fw-text);
  font-size: var(--fs-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* buttons that belong together, joined */
.seg {
  display: inline-flex;
  flex: none;
  gap: 1px;
}
.seg .btn {
  border-radius: 0;
  padding: 0 11px;
}
.seg .btn:first-child {
  border-radius: var(--r) 0 0 var(--r);
}
.seg .btn:last-child {
  border-radius: 0 var(--r) var(--r) 0;
}
/* a button that stays pressed while its view is on (Compare, Tiles): light when on, like a switched-on key */
.btn.toggle {
  flex: none;
}
.btn.toggle[aria-pressed="true"] {
  background: var(--pressed);
  color: var(--pressed-text);
  box-shadow: inset 0 1px 2px var(--black-35);
}
.btn.toggle[aria-pressed="true"]:is(:hover, .is-hover):not(:disabled) {
  background: var(--pressed-hover);
}

.bar-divider {
  align-self: stretch;
  flex: none;
  width: 1px;
  background: var(--edge);
}
.bar-zoom {
  min-width: 44px;
  margin-left: -4px;
  color: var(--label);
  font-weight: var(--fw-text);
  font-size: var(--fs-text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.view-bar {
  gap: 14px;
  padding-right: 8px;
}
.view-bar > .spacer {
  flex: 1 1 0;
  min-width: 8px;
  margin: 0 -14px 0 0;
}
.tb-button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  min-width: 0;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text);
  font-weight: var(--fw-button);
  cursor: pointer;
  transition: background-color var(--t-state);
}
.tb-button:is(:hover, .is-hover):not(:disabled),
.tb-button[aria-expanded="true"] {
  background: var(--flat-hover);
}
.tb-button .menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-button .menu-cost {
  flex: none;
  margin-left: -2px;
  font-weight: var(--fw-text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
} /* as in the projects list */
.tb-thumb {
  width: 24px;
  height: 24px;
  flex: none;
  object-fit: cover;
  border-radius: 4px;
  background: var(--black);
  box-shadow: 0 0 0 1px var(--white-12);
}
.tb-glyph {
  margin-left: 4px;
  color: var(--label);
}
.chev-icon {
  flex: none;
  color: var(--label);
}
/* split button (controls.js: SplitButton): the action and its menu arrow joined, like a segmented pair; the menu under it */
.split {
  position: relative;
  display: inline-flex;
  flex: none;
  gap: 1px;
}
.split > .btn:first-child {
  border-radius: var(--r) 0 0 var(--r);
}
.split > .split-arrow {
  width: 26px;
  padding: 0;
  border-radius: 0 var(--r) var(--r) 0;
}
.split-arrow[aria-expanded="true"]:not(.primary) {
  background: var(--raised-hover);
}
.split-arrow.primary[aria-expanded="true"] {
  background: var(--accent-hover);
}
.split-arrow.primary .chev-icon {
  color: var(--white);
}
.split-menu.right {
  left: auto;
  right: 0;
  transform-origin: right top;
}
.split-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 100%;
  width: max-content;
  padding: 6px;
  background: var(--pop);
  border: 1px solid var(--pop-border);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  animation: pop var(--t-state) ease-out;
  transform-origin: left top;
}
/* segmented control: buttons in one recessed strip; a pressed one is raised */

/* menus (projects, account) */
.menu,
.account {
  position: relative;
  min-width: 0;
}
.menu-pop {
  position: absolute;
  left: 0;
  top: 38px;
  z-index: 40;
  width: max-content;
  min-width: 320px;
  max-width: min(440px, calc(100vw - 16px));
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--pop);
  border: 1px solid var(--pop-border);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  animation: pop var(--t-state) ease-out;
  transform-origin: left top;
}
.menu-pop.right {
  left: auto;
  right: 0;
  width: 220px;
  transform-origin: right top;
}
.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.menu-item:is(:hover, .is-hover) {
  background: var(--accent);
}
.menu-item.strong {
  font-weight: var(--fw-text);
}
.menu-head {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px 2px;
  color: var(--dim);
  font-size: var(--fs-text);
  font-weight: var(--fw-text);
}
.mi-icon {
  display: grid;
  place-items: center;
  width: 16px;
  margin-right: 10px;
  color: var(--label);
  flex: none;
}
.menu-item:is(:hover, .is-hover) .mi-icon {
  color: var(--white);
}
/* a keyboard shortcut (controls.js: Kbd): a small key cap at the right end of its item */
.kbd {
  flex: none;
  align-self: center;
  margin-left: auto;
  min-width: 20px;
  padding: 0 5px;
  border: 1px solid var(--kbd-border);
  border-radius: 4px;
  color: var(--label);
  font: inherit;
  font-size: var(--fs-tiny);
  font-weight: var(--fw-text);
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
}
:is(.menu-item, .add-item):is(:hover, .is-hover) .kbd {
  border-color: var(--on-accent-detail);
  color: var(--on-accent-label);
}
.thumb-none {
  display: grid;
  place-items: center;
  color: var(--label);
  background: var(--thumb-none);
}
/* the start screen: Projects as the sidebar, big; the canvas beside it previews the project under the pointer */
.app.home .home-side {
  width: 456px;
  flex: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--edge);
}
.projects.big {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 12px;
}
.projects.big .menu-head {
  padding: 0 10px 8px;
  font-size: var(--fs-text);
}
.projects.big .menu-item {
  height: 40px;
  font-size: var(--fs-big);
  padding: 0 12px;
}
.projects.big .menu-sep {
  height: 1px;
  margin: 12px -14px;
  background: var(--edge);
} /* as in the menu, edge to edge of the sidebar */
.projects.big .menu-row {
  padding-right: 8px;
}
.projects.big .menu-open {
  padding: 8px 12px;
}
.projects.big .menu-thumb,
.projects.big .menu-thumb .thumb {
  width: 44px;
  height: 44px;
}
.projects.big .menu-text span:first-child {
  font-size: var(--fs-big);
}
.projects.big .projects-foot {
  margin-top: auto;
} /* (its line: the first separator in it) */
.projects-foot {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}
.flight-img {
  position: fixed;
  z-index: 70;
  transform-origin: 0 0;
  border-radius: 4px;
  pointer-events: none;
}
.stage-body.arriving {
  opacity: 0;
} /* while a project's preview flies in; shown at once when it lands */
/* the start screen's mark while no project is previewed: an image and two steps made from it, outlined, faint */
.home-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: var(--home-mark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity var(--t-fade);
  pointer-events: none;
}
.home-mark.on {
  opacity: 1;
}
.home-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.home-preview canvas {
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 30px var(--black-45);
  animation: preview-in var(--t-fade) ease-out;
}
@keyframes preview-in {
  from {
    opacity: 0;
  }
}
.drop-hint {
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--accent-08);
  color: var(--text);
  font-size: var(--fs-title);
  font-weight: var(--fw-text);
  pointer-events: none;
}
.menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--sep);
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  border-radius: var(--r);
}
/* a project's actions: shown on the row under the pointer, the one with its menu open, or reached with Tab */
.menu-more {
  flex: none;
  width: 28px;
  height: 28px;
  visibility: hidden;
}
.menu-row:is(:hover, .is-hover) .menu-more,
.menu-row.menu-open-for .menu-more,
.menu-more:is(:focus-visible, .is-focus) {
  visibility: visible;
}
.menu-row.menu-open-for {
  background: var(--white-10);
}
.action-menu {
  position: fixed;
  z-index: 60;
  min-width: 180px;
  padding: 6px;
  background: var(--pop);
  border: 1px solid var(--pop-border);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  animation: pop var(--t-state) ease-out;
}
.menu-item.danger {
  color: var(--danger-text);
}
.menu-item.danger:is(:is(:hover, .is-hover), .asking) {
  background: var(--danger);
  color: var(--white);
}
.menu-item.danger .mi-icon {
  color: inherit;
}
/* renaming a project: the name's line becomes the field, in place (the same text, the row keeps its height) */
.menu-text {
  position: relative;
}
.menu-text.renaming > span:first-child {
  visibility: hidden;
}
.menu-text input.rename {
  position: absolute;
  left: -6px;
  right: 0;
  top: -2px;
  box-sizing: border-box;
  width: auto;
  height: calc(1.4em + 4px);
  padding: 0 5px;
  border-radius: 4px;
  font-weight: var(--fw-text);
  line-height: 1.4;
}
.projects.big .menu-text input.rename {
  font-size: var(--fs-big);
}
.menu-text input.rename:focus {
  outline: none;
  border-color: var(--accent);
}
.menu-text input.rename::selection {
  background: var(--row-on);
}
.menu-open.renaming {
  cursor: default;
}
/* the open project at the top of the menu: its face only (no box, no menu, not a control) */
.menu-open.current {
  cursor: default;
  padding-top: 4px;
}
.menu-row:is(:hover, .is-hover) {
  background: var(--row-hover);
}
.menu-thumb {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
}
.menu-row.on {
  background: var(--white-08);
}
.menu-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 10px;
}
.menu-foot > span {
  white-space: nowrap;
} /* one line each: the menu grows to fit (menu-pop) */
.menu-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.thumb {
  width: 32px;
  height: 32px;
  flex: none;
  object-fit: cover;
  border-radius: 4px;
  background: var(--black);
}
.menu-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.menu-text span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-text > .label,
.add-text > .label {
  color: var(--dim);
} /* a project's details, an add item's description */
