/* Application chrome: independent scrolling sidebars and a fixed canvas workspace. */
body { margin: 0; }
.shared-view-state { font-size: 11px; }
.shared-view-state[data-state="offline"],
.shared-view-state[data-state="local"] { color: var(--amber); }
main {
  box-sizing: border-box;
  height: 100dvh;
  min-height: 620px;
  max-width: none;
  padding: 8px 12px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.project-bar { min-height: 30px; flex: none; margin: 0; }
.project-bar .button { min-height: 27px; padding: 4px 12px; font-size: 11px; }
.project-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  min-height: 53px;
  margin: 0;
  padding: 5px 0 9px;
}
.project-heading { flex: 0 1 310px; min-width: 200px; }
.project-heading select {
  max-width: 100%;
  width: 100%;
  font-size: 20px;
  padding: 6px 26px 6px 0;
  min-height: 34px;
}
.project-header .project-tools {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  align-self: center;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.project-header .project-tools button {
  flex: none;
  font-size: 11px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #2b3b4c;
  border-radius: 5px;
  background: #121e2a;
  white-space: nowrap;
}
.project-header .project-tools button:hover { background: #203348; }
.project-header .project-tools > :first-child { margin-left: auto; }
.project-header #edit-project { color: #b0bfce; background: transparent; }
.workspace {
  --phase-width: 224px;
  --detail-width: 340px;
  display: grid;
  grid-template-columns: var(--phase-width) minmax(0, 1fr) var(--detail-width);
  align-items: stretch;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.workspace.phases-collapsed { --phase-width: 34px; }
.workspace.details-collapsed { --detail-width: 34px; }
.workspace-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 38px;
  border-bottom: 1px solid var(--line);
  background: #14202c;
}
.sidebar-heading h2 {
  margin: 0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 650;
  color: #d1dfed;
}
.sidebar-heading h2 span { margin-left: 6px; color: #8499b0; font-weight: 400; }
.sidebar-toggle {
  align-self: stretch;
  flex: none;
  width: 32px;
  padding: 0;
  border: 0;
  background: #14202c;
  color: #b7cee5;
  font-size: 25px;
  line-height: 1;
}
.sidebar-toggle:hover { color: white; background: #293e51; }
.phase-sidebar .sidebar-toggle { border-left: 1px solid var(--line); }
.detail-sidebar .sidebar-toggle { border-right: 1px solid var(--line); }
.detail-sidebar .sidebar-heading { justify-content: flex-start; }
.sidebar-toggle:focus-visible { outline: 2px solid #b6dafa; outline-offset: -3px; }
.sidebar-content { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.sidebar-content[hidden] { display: none; }
.sidebar-rail-label { display: none; }
.is-collapsed .sidebar-heading h2 { display: none; }
.is-collapsed .sidebar-heading { justify-content: center; }
.is-collapsed .sidebar-toggle { border: 0; }
.is-collapsed .sidebar-rail-label {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  align-self: center;
  margin-top: 15px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #91a9bf;
}
.phase-sidebar .phase-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px 6px;
}
.phase-sidebar .phase-list button {
  min-height: 46px;
  padding: 9px 8px;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.phase-sidebar .phase-list .phase-label { white-space: normal; overflow-wrap: anywhere; }
.phase-sidebar .phase-list .phase-number { flex: none; }
.phase-sidebar .phase-list button[aria-current=true] { color: #f2f7fc; }
.sidebar-add { margin: 3px 8px 12px; padding: 9px; font-size: 12px; }
.detail-sidebar .detail-panel {
  border: 0;
  border-radius: 0;
  max-height: none;
  min-width: 0;
}
.detail-sidebar .detail-header { padding: 15px 16px; }
.detail-sidebar .detail-header h1 { font-size: 23px; }
.detail-sidebar .inspector-tabs { position: sticky; top: 0; }
.workspace .map-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
}
.map-panel .map-toolbar {
  min-height: 40px;
  padding: 5px 8px;
  gap: 8px;
  flex: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.map-toolbar .segmented { flex: none; padding: 2px; border-radius: 6px; }
.map-toolbar .segmented button { padding: 5px 8px; font-size: 11px; white-space: nowrap; }
.workspace .map-canvas { height: auto; min-height: 180px; flex: 1; }
.map-panel .map-expansion { flex: none; }
.map-panel .map-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 5px 9px;
  min-height: 32px;
  border-top: 1px solid var(--line);
  background: #101a29;
}
.map-panel .map-bottom > span { min-width: 0; max-width: none; font-size: 10px; line-height: 1.4; }
.map-panel .map-navigation-hints { justify-self: start; color: #8ea3ba; }
.map-panel .map-concept-version { justify-self: end; text-align: right; color: #a9bdd1; }
.map-panel .zoom-controls { justify-self: center; }
.map-panel .zoom-controls button { min-height: 23px; font-size: 11px; padding: 3px 8px; }
#map-legend[hidden] { display: none; }
@media (max-width: 1400px) {
  .workspace { --phase-width: 196px; --detail-width: 300px; }
  .project-heading { flex-basis: 265px; }
  .project-heading select { font-size: 18px; }
  .project-header .project-tools button { padding: 5px 6px; }
}
@media (max-width: 1000px) {
  main { padding: 6px 6px 0; }
  .workspace { --phase-width: 170px; --detail-width: 270px; gap: 5px; }
  .map-panel .map-bottom { gap: 6px; }
  .project-heading { min-width: 190px; flex-basis: 220px; }
  .project-header { gap: 8px; }
}
@media (max-width: 700px) {
  main { min-width: 360px; }
  .workspace { position: relative; grid-template-columns: 34px minmax(0, 1fr) 34px; }
  .workspace-sidebar { width: 32px; }
  .workspace-sidebar:not(.is-collapsed) { position: absolute; top: 0; bottom: 0; z-index: 15; }
  .phase-sidebar:not(.is-collapsed) { left: 0; width: min(260px, 80vw); }
  .detail-sidebar:not(.is-collapsed) { right: 0; width: min(330px, 85vw); }
  .map-panel { grid-column: 2; grid-row: 1; }
  .phase-sidebar { grid-column: 1; grid-row: 1; }
  .detail-sidebar { grid-column: 3; grid-row: 1; }
  .project-bar .header-status { width: auto; font-size: 9px; margin: 0; }
  .project-bar .file-actions { flex-wrap: nowrap; }
  .project-bar > .eyebrow { display: none; }
  .project-header { gap: 8px; min-height: 50px; }
  .project-heading { min-width: 165px; }
  .project-heading select { font-size: 16px; }
  .map-panel .map-bottom > span { font-size: 9px; overflow-wrap: anywhere; }
  .map-panel .zoom-controls { gap: 2px; }
  .map-panel .zoom-controls button { min-width: 24px; padding: 3px 5px; }
}
